Commit 8e8f9808 authored by Marco Bartolini's avatar Marco Bartolini
Browse files

fixed bug in minor servo position get_axis_position

parent e8662ac4
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -194,21 +194,28 @@ throw (MinorServoAxisNameError)
    if((mode == MED_MINOR_SERVO_PRIMARY)||
       (mode == MED_MINOR_SERVO_TRANSFER_TO_PRIMARY))
    {
        if((axis_name == "yp")||(axis_name == "YP"))
        if((strcmp(axis_name, "yp") == 0) ||
            (strcmp(axis_name, "YP") ==0))
            return y;
        if((axis_name == "zp")||(axis_name == "ZP"))
        if((strcmp(axis_name, "zp") == 0) ||
            (strcmp(axis_name, "ZP") ==0))
            return z;
        throw MinorServoAxisNameError(axis_name);
    }else{
        if((axis_name == "x")||(axis_name == "X"))
        if((strcmp(axis_name, "x") == 0) ||
            (strcmp(axis_name, "X") ==0))
            return x;
        if((axis_name == "y")||(axis_name == "Y"))
        if((strcmp(axis_name, "y") == 0) ||
            (strcmp(axis_name, "Y") ==0))
            return y;
        if((axis_name == "z")||(axis_name == "Z"))
        if((strcmp(axis_name, "z") == 0) ||
            (strcmp(axis_name, "Z") ==0))
            return z;
        if((axis_name == "theta_x")||(axis_name == "THETA_X"))
        if((strcmp(axis_name, "theta_x") == 0) ||
            (strcmp(axis_name, "THETA_X") ==0))
            return theta_x;
        if((axis_name == "theta_y")||(axis_name == "THETA_Y"))
        if((strcmp(axis_name, "theta_y") == 0) ||
            (strcmp(axis_name, "THETA_Y") ==0))
            return theta_y;
        throw MinorServoAxisNameError(axis_name);
    }
+9 −1
Original line number Diff line number Diff line
@@ -154,6 +154,15 @@ throw (MinorServoErrors::ScanErrorEx)
    return true;
}

ACS::Time
MedMinorServoScan::getStopTime()
{
    return getStartingTime() + 
           getMovementTime() + 
           getTotalTime() +
           START_SCAN_TOLERANCE;
}

ACS::Time 
MedMinorServoScan::getStartingTime()
{
@@ -180,4 +189,3 @@ MedMinorServoScan::getMovementTime()
    return m_starting_time - static_cast<ACS::Time>(starting_offset_time * 10000000);
}
+4 −3
Original line number Diff line number Diff line
@@ -587,6 +587,7 @@ MinorServoBossImpl::checkScanImpl(
              ComponentErrors::ComponentErrorsEx)
{
    minor_servo_parameters = new TRunTimeParameters;
    double center = 0;
    MedMinorServoPosition central_position = 
        m_actual_config->get_position(antenna_parameters.elevation);
    MedMinorServoScan scan(central_position, 
@@ -597,11 +598,10 @@ MinorServoBossImpl::checkScanImpl(
                           isElevationTracking());
    minor_servo_parameters->startEpoch = scan.getStartingTime();
    MedMinorServoPosition center_position = scan.getCentralPosition();
    double center = 0;
    try{
        center = center_position.get_axis_position(
                                        scan_parameters.axis_code);
    }catch(...){
    }catch(const MinorServoAxisNameError& msane){
        CUSTOM_LOG(LM_FULL_INFO, 
                   "MinorServo::MinorServoBossImpl::checkScanImpl",
                   (LM_WARNING, "Wrong axis name, defaulting to Z"));
@@ -610,15 +610,16 @@ MinorServoBossImpl::checkScanImpl(
    minor_servo_parameters->centerScan = center;
    minor_servo_parameters->scanAxis = CORBA::string_dup(
                                         scan_parameters.axis_code);
    minor_servo_parameters->timeToStop = scan.getTotalTime();
    if(scan_parameters.is_empty_scan)
    {
        minor_servo_parameters->onTheFly = false;
        minor_servo_parameters->timeToStop = 0;
        return true;
    }
    if(scan.check())
    {
        minor_servo_parameters->onTheFly = true;
        minor_servo_parameters->timeToStop = scan.getStopTime();
        return true;
    }else{
        return false;