Commit 070aaa2c authored by Andrea Orlat's avatar Andrea Orlat
Browse files

fixed a bug in reading equipment.xml, configuration file

parent 7983e73a
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ void CConfiguration::init(maci::ContainerServices *Services) throw (ComponentErr
	IRA::CString componentName;
	IRA::CString strVal;
	IRA::CString fieldPath;
	long counter=0;

	componentName="DataBlock/Equipment/MinorServoMapping";

@@ -168,7 +169,7 @@ void CConfiguration::init(maci::ContainerServices *Services) throw (ComponentErr

	for(;;) {
		if (m_minorServoMappings==0) fieldPath=componentName;
		else fieldPath.Format("%s%d",(const char *)componentName,m_minorServoMappings);
		else fieldPath.Format("%s%d",(const char *)componentName,counter);
		if (!CIRATools::getDBValue(Services,"axis",strVal,"alma/",fieldPath)) {
			break;
		}
@@ -193,15 +194,14 @@ void CConfiguration::init(maci::ContainerServices *Services) throw (ComponentErr
		}
		ACS_DEBUG_PARAM("CConfiguration::Init()","beamDeviationFactor: %lf",m_axis[m_minorServoMappings].beamDevitionFactor);
		m_minorServoMappings++;
		counter++;
		if (m_minorServoMappings>=MAX_AXIS_NUMBER) break;
	}
	ACS_DEBUG_PARAM("CConfiguration::Init()","Total minor servo axis: %d",m_minorServoMappings);

	componentName="DataBlock/Equipment/AvailableBackend";

	for(;;) {
		if (m_availableBackends==0) fieldPath=componentName;
		else fieldPath.Format("%s%d",(const char *)componentName,m_availableBackends);
		else fieldPath.Format("%s%d",(const char *)componentName,counter);
		if (!CIRATools::getDBValue(Services,"alias",strVal,"alma/",fieldPath)) {
			break;
		}
@@ -219,8 +219,9 @@ void CConfiguration::init(maci::ContainerServices *Services) throw (ComponentErr
		ACS_DEBUG_PARAM("CConfiguration::Init()","noData: %s",(const char *)strVal);
		m_availableBackends++;
		if (m_availableBackends>=MAX_BCK_NUMBER) break;
		counter++;
	}
	ACS_DEBUG_PARAM("CConfiguration::Init()","Total minor servo axis: %d",m_minorServoMappings);
	ACS_DEBUG_PARAM("CConfiguration::Init()","Total available backends: %d",m_availableBackends);
	if (!CIRATools::getDBValue(Services,"FTrackPrecisionDigits",m_fTrackDigits,"alma/","DataBlock/Equipment")) {
		_EXCPT(ComponentErrors::CDBAccessExImpl,dummy,"CConfiguration::Init()");
		dummy.setFieldName("FTrackPrecisionDigits");
+2 −1
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ bool CScanList::parseLine(const IRA::CString& line,const DWORD& lnNumber,IRA::CS
			CSubScanBinder binder(getConfiguration(),false);
			DWORD identifier;
			if (!parsePeaker(line,identifier,errMsg,binder)) {
				binder.dispose();
				return false;
			}
			TRecord *rec=new TRecord;
@@ -355,7 +356,7 @@ bool CScanList::parseSidereal(const IRA::CString& val,Antenna::TTrackingParamete
	Antenna::TCoordinateFrame frame;
	// get the second item.....
	if (!IRA::CIRATools::getNextToken(val,start,SEPARATOR,token)) {  // id
		errMsg="could read scan identifier";
		errMsg="cannot read scan identifier";
		return false;
	}
	id=token.ToLong();
+16 −0
Original line number Diff line number Diff line
@@ -562,6 +562,22 @@ void SchedulerImpl::terminateScan() throw (ComponentErrors::ComponentErrorsEx,Ma
	}
}

void SchedulerImpl::getSubScanConfigruation(Management::TSubScanConfiguration_out conf) throw (ComponentErrors::ComponentErrorsEx,
		ManagementErrors::ManagementErrorsEx,CORBA::SystemException)
{
	try {

	}
	catch (ComponentErrors::ComponentErrorsExImpl& ex) {
		ex.log(LM_DEBUG);
		throw ex.getComponentErrorsEx();
	}
	catch (ManagementErrors::ManagementErrorsExImpl& ex) {
		ex.log(LM_DEBUG);
		throw ex.getManagementErrorsEx();
	}
}

_PROPERTY_REFERENCE_CPP(SchedulerImpl,Management::ROTSystemStatus,m_pstatus,status);
_PROPERTY_REFERENCE_CPP(SchedulerImpl,ACS::ROstring,m_pscheduleName,scheduleName);
_PROPERTY_REFERENCE_CPP(SchedulerImpl,ACS::ROlong,m_pscanID,scanID);
+18 −4
Original line number Diff line number Diff line
@@ -23,12 +23,17 @@ CSubScanBinder::CSubScanBinder(CConfiguration* config,bool dispose): m_primary(N
CSubScanBinder::~CSubScanBinder()
{
	if (m_own) {
		dispose();
	}
}

void CSubScanBinder::dispose()
{
	if (m_primary) delete m_primary;
	if (m_secondary) delete m_secondary;
	if (m_servo) delete m_servo;
	if (m_receivers) delete m_receivers;
}
}

void CSubScanBinder::addOffsets(const double& lonOff,const double& latOff,const Antenna::TCoordinateFrame& frame)
{
@@ -164,6 +169,7 @@ void CSubScanBinder::OTF(const IRA::CString& target,
    m_servo->axis_code=CORBA::string_dup("");
    m_servo->range=0;
    m_servo->total_time=0;
    m_subScanConf.signal=Management::MNG_SIGNAL_NONE;
}

void CSubScanBinder::lonOTF(const Antenna::TCoordinateFrame& scanFrame,const double& span,const ACS::TimeInterval& duration)
@@ -195,7 +201,9 @@ void CSubScanBinder::lonOTF(const Antenna::TCoordinateFrame& scanFrame,const dou
    m_servo->axis_code=CORBA::string_dup("");
    m_servo->range=0;
    m_servo->total_time=0;
    m_subScanConf.signal=Management::MNG_SIGNAL_NONE;
	// The other subsystems can stay with defaults

}

void CSubScanBinder::latOTF(const Antenna::TCoordinateFrame& scanFrame,const double& span,const ACS::TimeInterval& duration)
@@ -228,6 +236,7 @@ void CSubScanBinder::latOTF(const Antenna::TCoordinateFrame& scanFrame,const dou
    m_servo->axis_code=CORBA::string_dup("");
    m_servo->range=0;
    m_servo->total_time=0;
    m_subScanConf.signal=Management::MNG_SIGNAL_NONE;
	// The other subsystems can stay with defaults
}

@@ -250,6 +259,7 @@ void CSubScanBinder::sidereal(const char * targetName,const double& ra,const dou
    m_servo->axis_code=CORBA::string_dup("");
    m_servo->range=0;
    m_servo->total_time=0;
    m_subScanConf.signal=Management::MNG_SIGNAL_SIGNAL;
	// The other subsystems can stay with defaults
}

@@ -270,6 +280,7 @@ void CSubScanBinder::moon()
    m_servo->axis_code=CORBA::string_dup("");
    m_servo->range=0;
    m_servo->total_time=0;
    m_subScanConf.signal=Management::MNG_SIGNAL_SIGNAL;
	// The other subsystems can stay with defaults
}

@@ -291,6 +302,7 @@ void CSubScanBinder::track(const char *targetName)
    m_servo->axis_code=CORBA::string_dup("");
    m_servo->range=0;
    m_servo->total_time=0;
    m_subScanConf.signal=Management::MNG_SIGNAL_SIGNAL;
	// The other subsystems can stay with defaults
}

@@ -313,6 +325,7 @@ void CSubScanBinder::goTo(const double& az,const double& el)
    m_servo->axis_code=CORBA::string_dup("");
    m_servo->range=0;
    m_servo->total_time=0;
    m_subScanConf.signal=Management::MNG_SIGNAL_SIGNAL;
}

void CSubScanBinder::init()
@@ -350,6 +363,7 @@ void CSubScanBinder::init()
		m_servo->axis_code=CORBA::string_dup("");;
		m_servo->is_empty_scan=true;
		m_receivers->dummy=0;
		m_subScanConf.signal=Management::MNG_SIGNAL_NONE;
}

// **** PRVATE *********