diff --git a/CHANGELOG.md b/CHANGELOG.md index 61c8cc58270ed7ca09c2a53414990da7c0f2f16a..4b8b90a97c40c01b7cca0208235ca9e54dad0850 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -88,11 +88,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/ issue #518 - KBand receivers cryo temperature read wrongly with connection problems. More information: https://github.com/discos/discos/issues/518#issuecomment-590838480 issue #533 - New Fitszilla version 1.21 online. The user offsets related keywords added to the primary header. issue #556 - Added API to send emails to local system administrators. This feature is now exploted when a servo system oscillation is detected at Noto and Medicina + issue #595 - Added ifdist command to use IF Distributor (for Nt telescope) from operator input. ## Fixed issue #518 - In case of communication error we set a dummy value (100000) for the temperature properties, and the related timestamp keeps the value of the last communication timestamp. issue #525 - When in LOCAL mode the receivers can turn on/off the noise mark and LNAs. There is no more MNG_FAILURE logging in case of LOCAL mode: only the LOCAL/REMOTE status (during component activation) and the change of status (LOCAL to REMOTE and viceversa) are written to the logfile. ## Changed - issue #545 - Oscillation checks enabled for Mc and Nt telescopes, this setting is now under control of a CDB argument + issue #545 - Oscillation checks enabled for Mc and Nt telescopes, this setting is now under control of a CDB argument ## [next release] ## Added @@ -102,4 +103,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/ ## Changed issues #481, #484, #486, #487, #491, #493, #497. SRT Active Surface module has been improved in order to speed up its booting time and optimize its overall behavior issue #604 - The control software will not allow anymore that a schedule, belonging to another project, could be run. In that case a warning message is sent to user console - and the execution aborted. \ No newline at end of file + and the execution aborted. diff --git a/Common/Clients/SystemTerminal/src/nuraghe_commands.py b/Common/Clients/SystemTerminal/src/nuraghe_commands.py index 1ab5c387604101400fe91230284c261ceb149969..7390df0e05f79d8ee4643c2a8bc0f766eb226555 100755 --- a/Common/Clients/SystemTerminal/src/nuraghe_commands.py +++ b/Common/Clients/SystemTerminal/src/nuraghe_commands.py @@ -416,6 +416,36 @@ def help(command): print 'e.g. > help(setupCCB)' print 'help() (without argument) lists all the available commands' + +def ifdist(): + """ + ifdist=input,pol,att + allowed values for input: + 1 input1 + 2 input2 + + allowed value for pol for input1 + 0 nessun ingresso selezionato + 1 ricevitore in vertex Right Pol + 2 ricevitore L Right Pol + 3 ricevitore X Right Pol + 4 ricevitore S Right Pol + 5 spare1 + 6 spare2 + + allowed value for pol for input2 + 0 nessun ingresso selezionato + 1 ricevitore in vertex Left Pol + 2 ricevitore L Left Pol + 3 ricevitore X Left Pol + 4 ricevitore S Left Pol + 5 ricevitore S Right Pol (per oss. geo) + 6 spare1 + + allowed values for att: + from 0 to 63, each step is 0.5 dB + """ + def initialize(): """ initialize=code diff --git a/Common/Servers/Scheduler/src/Core.cpp b/Common/Servers/Scheduler/src/Core.cpp index 67a8d791bf0447602f611041ea6eaa45db93ce88..c89c72ce9bb8e2ff6ff33e668c78253056151390 100644 --- a/Common/Servers/Scheduler/src/Core.cpp +++ b/Common/Servers/Scheduler/src/Core.cpp @@ -12,8 +12,7 @@ _IRA_LOGFILTER_IMPORT; #define SCHED_EXECUTOR_NAME "SCHED_THREAD" -CCore::CCore(ContainerServices *service,CConfiguration *conf,DiscosLocals::StationConfig* stConfig) : - m_config(conf), m_stationConf(stConfig), m_services(service) +CCore::CCore(ContainerServices *service, CConfiguration *conf, DiscosLocals::StationConfig *stConfig) : m_config(conf), m_stationConf(stConfig), m_services(service) { } @@ -25,192 +24,204 @@ void CCore::initialize() { RESOURCE_INIT; clearStatus(); - m_currentProceduresFile=""; - m_lastWeatherTime=0; + m_currentProceduresFile = ""; + m_lastWeatherTime = 0; } -void CCore::execute() throw (ComponentErrors::TimerErrorExImpl,ComponentErrors::CouldntGetComponentExImpl, - ComponentErrors::MemoryAllocationExImpl,ManagementErrors::ProcedureFileLoadingErrorExImpl, - ComponentErrors::UnexpectedExImpl) +void CCore::execute() throw(ComponentErrors::TimerErrorExImpl, ComponentErrors::CouldntGetComponentExImpl, + ComponentErrors::MemoryAllocationExImpl, ManagementErrors::ProcedureFileLoadingErrorExImpl, + ComponentErrors::UnexpectedExImpl) { Antenna::TSiteInformation_var site; - Antenna::Observatory_var observatory=Antenna::Observatory::_nil(); - try { - observatory=m_services->getDefaultComponent((const char*)m_config->getObservatoryComponent()); - } - catch (maciErrType::CannotGetComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CCore::execute()"); - Impl.setComponentName((const char*)m_config->getObservatoryComponent()); + Antenna::Observatory_var observatory = Antenna::Observatory::_nil(); + try + { + observatory = m_services->getDefaultComponent((const char *)m_config->getObservatoryComponent()); + } + catch (maciErrType::CannotGetComponentExImpl &ex) + { + _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl, Impl, ex, "CCore::execute()"); + Impl.setComponentName((const char *)m_config->getObservatoryComponent()); throw Impl; } - catch (maciErrType::NoPermissionExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CCore::execute()"); - Impl.setComponentName((const char*)m_config->getObservatoryComponent()); - throw Impl; + catch (maciErrType::NoPermissionExImpl &ex) + { + _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl, Impl, ex, "CCore::execute()"); + Impl.setComponentName((const char *)m_config->getObservatoryComponent()); + throw Impl; } - catch (maciErrType::NoDefaultComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CCore::execute()"); - Impl.setComponentName((const char*)m_config->getObservatoryComponent()); - throw Impl; + catch (maciErrType::NoDefaultComponentExImpl &ex) + { + _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl, Impl, ex, "CCore::execute()"); + Impl.setComponentName((const char *)m_config->getObservatoryComponent()); + throw Impl; } /*catch (...) { }*/ - ACS_LOG(LM_FULL_INFO,"CCore::execute()",(LM_INFO,"OBSERVATORY_LOCATED")); - try { - site=observatory->getSiteSummary(); //throw CORBA::SYSTEMEXCEPTION - } - catch (CORBA::SystemException& ex) { - _EXCPT(ComponentErrors::CORBAProblemExImpl,__dummy,"CCore::updateSite()"); + ACS_LOG(LM_FULL_INFO, "CCore::execute()", (LM_INFO, "OBSERVATORY_LOCATED")); + try + { + site = observatory->getSiteSummary(); //throw CORBA::SYSTEMEXCEPTION + } + catch (CORBA::SystemException &ex) + { + _EXCPT(ComponentErrors::CORBAProblemExImpl, __dummy, "CCore::updateSite()"); __dummy.setName(ex._name()); __dummy.setMinor(ex.minor()); throw __dummy; } - m_site=IRA::CSite(site.out()); - m_dut1=site->DUT1; - ACS_LOG(LM_FULL_INFO,"CCore::execute()",(LM_INFO,"SITE_INITIALIZED")); - try { - m_services->releaseComponent((const char*)observatory->name()); - } - catch (maciErrType::CannotReleaseComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntReleaseComponentExImpl,Impl,ex,"CCore::execute()"); - Impl.setComponentName((const char*)observatory->name()); + m_site = IRA::CSite(site.out()); + m_dut1 = site->DUT1; + ACS_LOG(LM_FULL_INFO, "CCore::execute()", (LM_INFO, "SITE_INITIALIZED")); + try + { + m_services->releaseComponent((const char *)observatory->name()); + } + catch (maciErrType::CannotReleaseComponentExImpl &ex) + { + _ADD_BACKTRACE(ComponentErrors::CouldntReleaseComponentExImpl, Impl, ex, "CCore::execute()"); + Impl.setComponentName((const char *)observatory->name()); throw Impl; } - loadCustomLogger(m_customLogger,m_customLoggerError); // throw ComponentErrors::CouldntGetComponentExImpl - + loadCustomLogger(m_customLogger, m_customLoggerError); // throw ComponentErrors::CouldntGetComponentExImpl + RESOURCE_EXEC; // spawn schedule executor thread........ - try { - CCore *tmp=this; - m_schedExecuter=m_services->getThreadManager()->create(SCHED_EXECUTOR_NAME,tmp); - } - catch (acsthreadErrType::acsthreadErrTypeExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::ThreadErrorExImpl,_dummy,ex,"CCore::execute()"); + try + { + CCore *tmp = this; + m_schedExecuter = m_services->getThreadManager()->create(SCHED_EXECUTOR_NAME, tmp); + } + catch (acsthreadErrType::acsthreadErrTypeExImpl &ex) + { + _ADD_BACKTRACE(ComponentErrors::ThreadErrorExImpl, _dummy, ex, "CCore::execute()"); throw _dummy; } - catch (...) { - _THROW_EXCPT(ComponentErrors::UnexpectedExImpl,"CCore::execute()"); + catch (...) + { + _THROW_EXCPT(ComponentErrors::UnexpectedExImpl, "CCore::execute()"); } - m_schedExecuter->initialize(m_services,m_dut1,m_site,m_config); // throw (ComponentErrors::TimerErrorExImpl) - ACS::TimeInterval sleepTime=m_config->getScheduleExecutorSleepTime()*10; + m_schedExecuter->initialize(m_services, m_dut1, m_site, m_config); // throw (ComponentErrors::TimerErrorExImpl) + ACS::TimeInterval sleepTime = m_config->getScheduleExecutorSleepTime() * 10; m_schedExecuter->setSleepTime(sleepTime); - try { - m_parser=new CParser(this,10,true);\ + try + { + m_parser = new CParser(this, 10, true); } - catch (...) { - _EXCPT(ComponentErrors::MemoryAllocationExImpl,dummy,"CCore::execute()"); + catch (...) + { + _EXCPT(ComponentErrors::MemoryAllocationExImpl, dummy, "CCore::execute()"); throw dummy; } //add local commands - m_parser->add("tsys",new function1 >(this,&CCore::_callTSys),0); - m_parser->add("wait",new function1 >(this,&CCore::_wait),1); - m_parser->add("nop",new function0(this,&CCore::_nop),0); - m_parser->add("waitOnSource",new function0(this,&CCore::_waitOnSource),0); - m_parser->add("waitTracking",new function0(this,&CCore::_waitTracking),0); - m_parser->add("waitUntil",new function1 >(this,&CCore::_waitUntil),1); - m_parser->add("haltSchedule",new function0(this,&CCore::_haltSchedule),0); - m_parser->add("stopSchedule",new function0(this,&CCore::_stopSchedule),0); - m_parser->add("startSchedule",new function2,I >(this,&CCore::_startSchedule),2); - m_parser->add("device",new function1 >(this,&CCore::_setDevice),1); - m_parser->add("chooseBackend",new function1 >(this,&CCore::_chooseDefaultBackend),1); - m_parser->add("chooseRecorder",new function1 >(this,&CCore::_chooseDefaultDataRecorder),1); - m_parser->add("crossScan",new function3 >,I >, - I >(this,&CCore::crossScan),3); - m_parser->add("peakerScan",new function3,I,I >(this,&CCore::peakerScan),3); - m_parser->add("log",new function1 >(this,&CCore::_changeLogFile),1); - m_parser->add("logMessage",new function1 >(this,&CCore::_logMessage),1); - m_parser->add("wx",new function4,O,O,O >(this,&CCore::_getWeatherStationParameters),0); - m_parser->add("project",new function2,O >(this,&CCore::_setProjectCode),1); + m_parser->add("tsys", new function1 >(this, &CCore::_callTSys), 0); + m_parser->add("wait", new function1 >(this, &CCore::_wait), 1); + m_parser->add("nop", new function0(this, &CCore::_nop), 0); + m_parser->add("waitOnSource", new function0(this, &CCore::_waitOnSource), 0); + m_parser->add("waitTracking", new function0(this, &CCore::_waitTracking), 0); + m_parser->add("waitUntil", new function1 >(this, &CCore::_waitUntil), 1); + m_parser->add("haltSchedule", new function0(this, &CCore::_haltSchedule), 0); + m_parser->add("stopSchedule", new function0(this, &CCore::_stopSchedule), 0); + m_parser->add("startSchedule", new function2, I >(this, &CCore::_startSchedule), 2); + m_parser->add("device", new function1 >(this, &CCore::_setDevice), 1); + m_parser->add("chooseBackend", new function1 >(this, &CCore::_chooseDefaultBackend), 1); + m_parser->add("chooseRecorder", new function1 >(this, &CCore::_chooseDefaultDataRecorder), 1); + m_parser->add("crossScan", new function3 >, I >, I >(this, &CCore::crossScan), 3); + m_parser->add("peakerScan", new function3, I, I >(this, &CCore::peakerScan), 3); + m_parser->add("log", new function1 >(this, &CCore::_changeLogFile), 1); + m_parser->add("logMessage", new function1 >(this, &CCore::_logMessage), 1); + m_parser->add("wx", new function4, O, O, O >(this, &CCore::_getWeatherStationParameters), 0); + m_parser->add("project", new function2, O >(this, &CCore::_setProjectCode), 1); // no range checks because * is allowed - m_parser->add("skydip",new function3 >,I >,I >(this,&CCore::skydip),3); - m_parser->add("agc","_tp_agc",2,"NONE"); + m_parser->add("skydip", new function3 >, I >, I >(this, &CCore::skydip), 3); + m_parser->add("agc", "_tp_agc", 2, "NONE"); // m_parser->add("ifd","_ifd",1,"SRT"); - m_parser->add("calmux","_calmux",1); - m_parser->add("dmed","_dmed",1,"Medicina"); - m_parser->add("restFrequency",new function1 >(this,&CCore::_setRestFrequency),1); - m_parser->add("fTrack",new function1 >(this,&CCore::_fTrack),1); - m_parser->add("peaker",new function3,I,I >(this,&CCore::_peaker),3); - m_parser->add("lonOTF",new function3 >,I >, I >(this,&CCore::_lonOTF),3); - m_parser->add("latOTF",new function3 >,I >, I >(this,&CCore::_latOTF),3); - m_parser->add("skydipOTF",new function3 >,I >,I >(this,&CCore::_skydipOTF),3); - m_parser->add("moon",new function0(this,&CCore::_moon),0); - m_parser->add("sidereal",new function5,I >, - I >,I >, - I > >(this,&CCore::_sidereal),5); - m_parser->add("track",new function1 >(this,&CCore::_track),1); - m_parser->add("goTo",new function2 >,I > >(this,&CCore::_goTo),2); - m_parser->add("abort",new function0(this,&CCore::_abort),0); - m_parser->add("initRecording",new function1 >(this,&CCore::_initRecording),1); - m_parser->add("startRecording",new function2,I >(this,&CCore::_startRecording),2); - m_parser->add("terminateScan",new function0(this,&CCore::_terminateScan),0); - m_parser->add("goOff",new function2 >,I >(this,&CCore::goOff),2); + m_parser->add("calmux", "_calmux", 1); + m_parser->add("dmed", "_dmed", 1, "Medicina"); + m_parser->add("ifdist", "_ifdist", 3, "Noto"); + + m_parser->add("restFrequency", new function1 >(this, &CCore::_setRestFrequency), 1); + m_parser->add("fTrack", new function1 >(this, &CCore::_fTrack), 1); + m_parser->add("peaker", new function3, I, I >(this, &CCore::_peaker), 3); + m_parser->add("lonOTF", new function3 >, I >, I >(this, &CCore::_lonOTF), 3); + m_parser->add("latOTF", new function3 >, I >, I >(this, &CCore::_latOTF), 3); + m_parser->add("skydipOTF", new function3 >, I >, I >(this, &CCore::_skydipOTF), 3); + m_parser->add("moon", new function0(this, &CCore::_moon), 0); + m_parser->add("sidereal", new function5, I >, I >, I >, I > >(this, &CCore::_sidereal), 5); + m_parser->add("track", new function1 >(this, &CCore::_track), 1); + m_parser->add("goTo", new function2 >, I > >(this, &CCore::_goTo), 2); + m_parser->add("abort", new function0(this, &CCore::_abort), 0); + m_parser->add("initRecording", new function1 >(this, &CCore::_initRecording), 1); + m_parser->add("startRecording", new function2, I >(this, &CCore::_startRecording), 2); + m_parser->add("terminateScan", new function0(this, &CCore::_terminateScan), 0); + m_parser->add("goOff", new function2 >, I >(this, &CCore::goOff), 2); //add remote commands ************ should be loaded from a CDB table............................**********/ // antenna subsystem - m_parser->add("antennaDisable","antenna",1,&CCore::remoteCall); - m_parser->add("antennaEnable","antenna",1,&CCore::remoteCall); - m_parser->add("antennaCorrectionOn","antenna",1,&CCore::remoteCall); - m_parser->add("antennaCorrectionOff","antenna",1,&CCore::remoteCall); - m_parser->add("antennaPark","antenna",1,&CCore::remoteCall); - m_parser->add("antennaAzEl","antenna",1,&CCore::remoteCall); - m_parser->add("antennaTrack","antenna",1,&CCore::remoteCall); - m_parser->add("antennaUnstow","antenna",1,&CCore::remoteCall); - m_parser->add("antennaStop","antenna",1,&CCore::remoteCall); - m_parser->add("antennaSetup","antenna",1,&CCore::remoteCall); - m_parser->add("preset","antenna",1,&CCore::remoteCall); - m_parser->add("bwhm","antenna",1,&CCore::remoteCall); - m_parser->add("azelOffsets","antenna",1,&CCore::remoteCall); - m_parser->add("radecOffsets","antenna",1,&CCore::remoteCall); - m_parser->add("lonlatOffsets","antenna",1,&CCore::remoteCall); - m_parser->add("antennaReset","antenna",1,&CCore::remoteCall); - m_parser->add("radialVelocity","antenna",1,&CCore::remoteCall); + m_parser->add("antennaDisable", "antenna", 1, &CCore::remoteCall); + m_parser->add("antennaEnable", "antenna", 1, &CCore::remoteCall); + m_parser->add("antennaCorrectionOn", "antenna", 1, &CCore::remoteCall); + m_parser->add("antennaCorrectionOff", "antenna", 1, &CCore::remoteCall); + m_parser->add("antennaPark", "antenna", 1, &CCore::remoteCall); + m_parser->add("antennaAzEl", "antenna", 1, &CCore::remoteCall); + m_parser->add("antennaTrack", "antenna", 1, &CCore::remoteCall); + m_parser->add("antennaUnstow", "antenna", 1, &CCore::remoteCall); + m_parser->add("antennaStop", "antenna", 1, &CCore::remoteCall); + m_parser->add("antennaSetup", "antenna", 1, &CCore::remoteCall); + m_parser->add("preset", "antenna", 1, &CCore::remoteCall); + m_parser->add("bwhm", "antenna", 1, &CCore::remoteCall); + m_parser->add("azelOffsets", "antenna", 1, &CCore::remoteCall); + m_parser->add("radecOffsets", "antenna", 1, &CCore::remoteCall); + m_parser->add("lonlatOffsets", "antenna", 1, &CCore::remoteCall); + m_parser->add("antennaReset", "antenna", 1, &CCore::remoteCall); + m_parser->add("radialVelocity", "antenna", 1, &CCore::remoteCall); //m_parser->add("goOff","antenna",1,&CCore::remoteCall); // receivers subsystem - m_parser->add("receiversPark","receivers",2,&CCore::remoteCall); - m_parser->add("receiversSetup","receivers",2,&CCore::remoteCall); - m_parser->add("receiversMode","receivers",2,&CCore::remoteCall); - m_parser->add("calOn","receivers",2,&CCore::remoteCall); - m_parser->add("calOff","receivers",2,&CCore::remoteCall); - m_parser->add("setLO","receivers",2,&CCore::remoteCall); - m_parser->add("antennaUnitOn","receivers",2,&CCore::remoteCall); - m_parser->add("antennaUnitOff","receivers",2,&CCore::remoteCall); - m_parser->add("derotatorPark","receivers",2,&CCore::remoteCall); + m_parser->add("receiversPark", "receivers", 2, &CCore::remoteCall); + m_parser->add("receiversSetup", "receivers", 2, &CCore::remoteCall); + m_parser->add("receiversMode", "receivers", 2, &CCore::remoteCall); + m_parser->add("calOn", "receivers", 2, &CCore::remoteCall); + m_parser->add("calOff", "receivers", 2, &CCore::remoteCall); + m_parser->add("setLO", "receivers", 2, &CCore::remoteCall); + m_parser->add("antennaUnitOn", "receivers", 2, &CCore::remoteCall); + m_parser->add("antennaUnitOff", "receivers", 2, &CCore::remoteCall); + m_parser->add("derotatorPark", "receivers", 2, &CCore::remoteCall); //m_parser->add("derotatorMode","receivers",2,&CCore::remoteCall); - m_parser->add("derotatorSetPosition","receivers",2,&CCore::remoteCall); - m_parser->add("derotatorRewind","receivers",2,&CCore::remoteCall); - m_parser->add("derotatorSetConfiguration","receivers",2,&CCore::remoteCall); - m_parser->add("derotatorSetRewindingMode","receivers",2,&CCore::remoteCall); - m_parser->add("derotatorSetAutoRewindingSteps","receivers",2,&CCore::remoteCall); - m_parser->add("externalCalOn","receivers",2,&CCore::remoteCall); - m_parser->add("externalCalOff","receivers",2,&CCore::remoteCall); + m_parser->add("derotatorSetPosition", "receivers", 2, &CCore::remoteCall); + m_parser->add("derotatorRewind", "receivers", 2, &CCore::remoteCall); + m_parser->add("derotatorSetConfiguration", "receivers", 2, &CCore::remoteCall); + m_parser->add("derotatorSetRewindingMode", "receivers", 2, &CCore::remoteCall); + m_parser->add("derotatorSetAutoRewindingSteps", "receivers", 2, &CCore::remoteCall); + m_parser->add("externalCalOn", "receivers", 2, &CCore::remoteCall); + m_parser->add("externalCalOff", "receivers", 2, &CCore::remoteCall); // backend //m_parser->add("bck","backends",3,&CCore::remoteCall); - m_parser->add("integration","backend",3,&CCore::remoteCall); - m_parser->add("setSection","backend",3,&CCore::remoteCall); - m_parser->add("setAttenuation","backend",3,&CCore::remoteCall); - m_parser->add("getTpi","backend",3,&CCore::remoteCall); - m_parser->add("getZero","backend",3,&CCore::remoteCall); - m_parser->add("initialize","backend",3,&CCore::remoteCall); - m_parser->add("calSwitch","backend",3,&CCore::remoteCall); - m_parser->add("getRms","backend",3,&CCore::remoteCall); + m_parser->add("integration", "backend", 3, &CCore::remoteCall); + m_parser->add("setSection", "backend", 3, &CCore::remoteCall); + m_parser->add("setAttenuation", "backend", 3, &CCore::remoteCall); + m_parser->add("getTpi", "backend", 3, &CCore::remoteCall); + m_parser->add("getZero", "backend", 3, &CCore::remoteCall); + m_parser->add("initialize", "backend", 3, &CCore::remoteCall); + m_parser->add("calSwitch", "backend", 3, &CCore::remoteCall); + m_parser->add("getRms", "backend", 3, &CCore::remoteCall); // minor servo - m_parser->add("servoSetup","minorservo",4,&CCore::remoteCall); - m_parser->add("servoPark","minorservo",4,&CCore::remoteCall); - m_parser->add("setServoElevationTracking","minorservo",4,&CCore::remoteCall); - m_parser->add("setServoASConfiguration","minorservo",4,&CCore::remoteCall); - m_parser->add("clearServoOffsets","minorservo",4,&CCore::remoteCall); - m_parser->add("setServoOffset","minorservo",4,&CCore::remoteCall); + m_parser->add("servoSetup", "minorservo", 4, &CCore::remoteCall); + m_parser->add("servoPark", "minorservo", 4, &CCore::remoteCall); + m_parser->add("setServoElevationTracking", "minorservo", 4, &CCore::remoteCall); + m_parser->add("setServoASConfiguration", "minorservo", 4, &CCore::remoteCall); + m_parser->add("clearServoOffsets", "minorservo", 4, &CCore::remoteCall); + m_parser->add("setServoOffset", "minorservo", 4, &CCore::remoteCall); // active surface - m_parser->add("asSetup","activesurface",5,&CCore::remoteCall); - m_parser->add("asPark","activesurface",5,&CCore::remoteCall); - m_parser->add("asOn","activesurface",5,&CCore::remoteCall); - m_parser->add("asOff","activesurface",5,&CCore::remoteCall); + m_parser->add("asSetup", "activesurface", 5, &CCore::remoteCall); + m_parser->add("asPark", "activesurface", 5, &CCore::remoteCall); + m_parser->add("asOn", "activesurface", 5, &CCore::remoteCall); + m_parser->add("asOff", "activesurface", 5, &CCore::remoteCall); // procedures loadProcedures(m_config->getDefaultProceduresFile()); // throws ManagementErrors::ProcedureFileLoadingErrorExImpl @@ -229,23 +240,26 @@ void CCore::cleanUp() unloadWeatherStation(m_weatherStation); unloadDefaultBackend(); unloadDefaultDataReceiver(); - if (m_schedExecuter!=NULL) m_schedExecuter->suspend(); + if (m_schedExecuter != NULL) + m_schedExecuter->suspend(); m_services->getThreadManager()->destroy(m_schedExecuter); - ACS_LOG(LM_FULL_INFO,"CCore::cleanUp()",(LM_INFO,"THREAD_DESTROYED")); + ACS_LOG(LM_FULL_INFO, "CCore::cleanUp()", (LM_INFO, "THREAD_DESTROYED")); } -void CCore::skydip(const double& el1,const double& el2,const ACS::TimeInterval& duration) throw ( - ManagementErrors::NotAllowedDuringScheduleExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::UnexpectedExImpl, - ComponentErrors::OperationErrorExImpl,ComponentErrors::ComponentNotActiveExImpl,ComponentErrors::CORBAProblemExImpl, - ManagementErrors::BackendNotAvailableExImpl,ManagementErrors::DataTransferSetupErrorExImpl, - ManagementErrors::AntennaScanErrorExImpl,ComponentErrors::TimerErrorExImpl,ManagementErrors::TelescopeSubScanErrorExImpl, - ManagementErrors::TargetOrSubscanNotFeasibleExImpl,ManagementErrors::AbortedByUserExImpl, - ManagementErrors::RecordingAlreadyActiveExImpl,ManagementErrors::CloseTelescopeScanErrorExImpl) +void CCore::skydip(const double &el1, const double &el2, const ACS::TimeInterval &duration) throw( + ManagementErrors::NotAllowedDuringScheduleExImpl, ComponentErrors::CouldntGetComponentExImpl, ComponentErrors::UnexpectedExImpl, + ComponentErrors::OperationErrorExImpl, ComponentErrors::ComponentNotActiveExImpl, ComponentErrors::CORBAProblemExImpl, + ManagementErrors::BackendNotAvailableExImpl, ManagementErrors::DataTransferSetupErrorExImpl, + ManagementErrors::AntennaScanErrorExImpl, ComponentErrors::TimerErrorExImpl, ManagementErrors::TelescopeSubScanErrorExImpl, + ManagementErrors::TargetOrSubscanNotFeasibleExImpl, ManagementErrors::AbortedByUserExImpl, + ManagementErrors::RecordingAlreadyActiveExImpl, ManagementErrors::CloseTelescopeScanErrorExImpl) { //no need to get the mutex, because it is already done inside the executor object - if (m_schedExecuter) { - if (m_schedExecuter->isScheduleActive()) { - _THROW_EXCPT(ManagementErrors::NotAllowedDuringScheduleExImpl,"CCore::skydip()"); + if (m_schedExecuter) + { + if (m_schedExecuter->isScheduleActive()) + { + _THROW_EXCPT(ManagementErrors::NotAllowedDuringScheduleExImpl, "CCore::skydip()"); } } ACS::doubleSeq tsys; @@ -253,19 +267,19 @@ void CCore::skydip(const double& el1,const double& el2,const ACS::TimeInterval& // the mutex is not necessary as it's taken internally by all the called procedures, generally this macro calls should not required the mutex //baci::ThreadSyncGuard guard(&m_mutex); // TSYS SCAN - ACS_LOG(LM_FULL_INFO,"CCore::skydip()",(LM_NOTICE,"TSYS_COMPUTATION")); + ACS_LOG(LM_FULL_INFO, "CCore::skydip()", (LM_NOTICE, "TSYS_COMPUTATION")); // it calls directly the antennaBoss method - goOff(Antenna::ANT_HORIZONTAL,3.0); // go off 3 beams sizes + goOff(Antenna::ANT_HORIZONTAL, 3.0); // go off 3 beams sizes _waitOnSource(); _callTSys(tsys); _wait(1.5); _initRecording(1); - ACS_LOG(LM_FULL_INFO,"CCore::skydip()",(LM_NOTICE,"START_SKYDIP")); + ACS_LOG(LM_FULL_INFO, "CCore::skydip()", (LM_NOTICE, "START_SKYDIP")); // start the scan - _skydipOTF(el1,el2,duration); //ManagementErrors::TelescopeSubScanErrorExImpl,ManagementErrors::TargetOrSubscanNotFeasibleExImpl - _startRecording(1,duration); // start recording + _skydipOTF(el1, el2, duration); //ManagementErrors::TelescopeSubScanErrorExImpl,ManagementErrors::TargetOrSubscanNotFeasibleExImpl + _startRecording(1, duration); // start recording _terminateScan(); - ACS_LOG(LM_FULL_INFO,"CCore::skydip()",(LM_NOTICE,"SKYDIP_DONE")); + ACS_LOG(LM_FULL_INFO, "CCore::skydip()", (LM_NOTICE, "SKYDIP_DONE")); } /*void CCore::skydip(const double& el1,const double& el2,const ACS::TimeInterval& duration) throw (ManagementErrors::NotAllowedDuringScheduleExImpl, @@ -385,94 +399,101 @@ void CCore::skydip(const double& el1,const double& el2,const ACS::TimeInterval& ACS_LOG(LM_FULL_INFO,"CCore::skydip()",(LM_NOTICE,"SKYDIP_DONE")); }*/ -void CCore::peakerScan(const char *axis,const double& span,const ACS::TimeInterval& duration) throw (ComponentErrors::CouldntGetComponentExImpl, - ComponentErrors::ComponentNotActiveExImpl,ManagementErrors::AntennaScanErrorExImpl,ComponentErrors::CORBAProblemExImpl, - ComponentErrors::UnexpectedExImpl,ManagementErrors::TsysErrorExImpl,ComponentErrors::OperationErrorExImpl, - ManagementErrors::UnsupportedOperationExImpl,ManagementErrors::MinorServoScanErrorExImpl,ComponentErrors::TimerErrorExImpl, - ManagementErrors::AbortedByUserExImpl,ManagementErrors::NotAllowedDuringScheduleExImpl,ManagementErrors::RecordingAlreadyActiveExImpl, - ComponentErrors::ValidationErrorExImpl,ManagementErrors::TelescopeSubScanErrorExImpl) +void CCore::peakerScan(const char *axis, const double &span, const ACS::TimeInterval &duration) throw(ComponentErrors::CouldntGetComponentExImpl, + ComponentErrors::ComponentNotActiveExImpl, ManagementErrors::AntennaScanErrorExImpl, ComponentErrors::CORBAProblemExImpl, + ComponentErrors::UnexpectedExImpl, ManagementErrors::TsysErrorExImpl, ComponentErrors::OperationErrorExImpl, + ManagementErrors::UnsupportedOperationExImpl, ManagementErrors::MinorServoScanErrorExImpl, ComponentErrors::TimerErrorExImpl, + ManagementErrors::AbortedByUserExImpl, ManagementErrors::NotAllowedDuringScheduleExImpl, ManagementErrors::RecordingAlreadyActiveExImpl, + ComponentErrors::ValidationErrorExImpl, ManagementErrors::TelescopeSubScanErrorExImpl) { //no need to get the mutex, because it is already done inside the executor object - if (m_schedExecuter) { - if (m_schedExecuter->isScheduleActive()) { - _THROW_EXCPT(ManagementErrors::NotAllowedDuringScheduleExImpl,"CCore::peakerScan()"); + if (m_schedExecuter) + { + if (m_schedExecuter->isScheduleActive()) + { + _THROW_EXCPT(ManagementErrors::NotAllowedDuringScheduleExImpl, "CCore::peakerScan()"); } } ACS::doubleSeq tsys; TIMEVALUE now; - ACS_LOG(LM_FULL_INFO,"CCore::skydip()",(LM_NOTICE,"TSYS_COMPUTATION")); + ACS_LOG(LM_FULL_INFO, "CCore::skydip()", (LM_NOTICE, "TSYS_COMPUTATION")); // it calls directly the antennaBoss method - goOff(Antenna::ANT_HORIZONTAL,3.0); // go off 3 beams sizes + goOff(Antenna::ANT_HORIZONTAL, 3.0); // go off 3 beams sizes _waitOnSource(); _callTSys(tsys); _wait(1.5); _initRecording(1); - ACS_LOG(LM_FULL_INFO,"CCore::skydip()",(LM_NOTICE,"START_PEAKERSCAN")); + ACS_LOG(LM_FULL_INFO, "CCore::skydip()", (LM_NOTICE, "START_PEAKERSCAN")); // start the scan - _peaker(axis,span,duration); - _startRecording(1,duration); // start recording + _peaker(axis, span, duration); + _startRecording(1, duration); // start recording _terminateScan(); } -void CCore::crossScan(const Antenna::TCoordinateFrame& scanFrame,const double& span,const ACS::TimeInterval& duration) throw ( - ManagementErrors::NotAllowedDuringScheduleExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::UnexpectedExImpl, - ComponentErrors::OperationErrorExImpl,ComponentErrors::ComponentNotActiveExImpl,ComponentErrors::CORBAProblemExImpl, - ManagementErrors::BackendNotAvailableExImpl,ManagementErrors::DataTransferSetupErrorExImpl, - ManagementErrors::AntennaScanErrorExImpl,ComponentErrors::TimerErrorExImpl,ManagementErrors::TelescopeSubScanErrorExImpl, - ManagementErrors::TargetOrSubscanNotFeasibleExImpl,ManagementErrors::AbortedByUserExImpl, - ManagementErrors::RecordingAlreadyActiveExImpl,ManagementErrors::CloseTelescopeScanErrorExImpl) +void CCore::crossScan(const Antenna::TCoordinateFrame &scanFrame, const double &span, const ACS::TimeInterval &duration) throw( + ManagementErrors::NotAllowedDuringScheduleExImpl, ComponentErrors::CouldntGetComponentExImpl, ComponentErrors::UnexpectedExImpl, + ComponentErrors::OperationErrorExImpl, ComponentErrors::ComponentNotActiveExImpl, ComponentErrors::CORBAProblemExImpl, + ManagementErrors::BackendNotAvailableExImpl, ManagementErrors::DataTransferSetupErrorExImpl, + ManagementErrors::AntennaScanErrorExImpl, ComponentErrors::TimerErrorExImpl, ManagementErrors::TelescopeSubScanErrorExImpl, + ManagementErrors::TargetOrSubscanNotFeasibleExImpl, ManagementErrors::AbortedByUserExImpl, + ManagementErrors::RecordingAlreadyActiveExImpl, ManagementErrors::CloseTelescopeScanErrorExImpl) { //no need to get the mutex, because it is already done inside the executor object - if (m_schedExecuter) { - if (m_schedExecuter->isScheduleActive()) { - _THROW_EXCPT(ManagementErrors::NotAllowedDuringScheduleExImpl,"CCore::crossScan()"); + if (m_schedExecuter) + { + if (m_schedExecuter->isScheduleActive()) + { + _THROW_EXCPT(ManagementErrors::NotAllowedDuringScheduleExImpl, "CCore::crossScan()"); } } - IRA::CString obsName,prj,suffix,path,extraPath,baseName; - IRA::CString layoutName,schedule; + IRA::CString obsName, prj, suffix, path, extraPath, baseName; + IRA::CString layoutName, schedule; ACS::stringSeq layout; ACS::doubleSeq tsys; TIMEVALUE now; // the mutex is not necessary as it's taken internally by all the called procedures, generally this macro calls should not required the mutex //baci::ThreadSyncGuard guard(&m_mutex); // TSYS SCAN - ACS_LOG(LM_FULL_INFO,"CCore::crossScan()",(LM_NOTICE,"TSYS_COMPUTATION")); + ACS_LOG(LM_FULL_INFO, "CCore::crossScan()", (LM_NOTICE, "TSYS_COMPUTATION")); // it calls directly the antennaBoss method - goOff(scanFrame,3.0); // go off 3 beams sizes + goOff(scanFrame, 3.0); // go off 3 beams sizes _waitOnSource(); _callTSys(tsys); _wait(1.5); _initRecording(1); - ACS_LOG(LM_FULL_INFO,"CCore::crossScan()",(LM_NOTICE,"LATITUDE_SCAN")); + ACS_LOG(LM_FULL_INFO, "CCore::crossScan()", (LM_NOTICE, "LATITUDE_SCAN")); // start the scan - _latOTF(scanFrame,span,duration); //ManagementErrors::TelescopeSubScanErrorExImpl,ManagementErrors::TargetOrSubscanNotFeasibleExImpl - _startRecording(1,duration); // start recording + _latOTF(scanFrame, span, duration); //ManagementErrors::TelescopeSubScanErrorExImpl,ManagementErrors::TargetOrSubscanNotFeasibleExImpl + _startRecording(1, duration); // start recording // LONGITUDE SCAN.............. - ACS_LOG(LM_FULL_INFO,"CCore::crossScan()",(LM_NOTICE,"LONGITUDE_SCAN")); + ACS_LOG(LM_FULL_INFO, "CCore::crossScan()", (LM_NOTICE, "LONGITUDE_SCAN")); // start the scan - _lonOTF(scanFrame,span,duration); //ManagementErrors::TelescopeSubScanErrorExImpl,ManagementErrors::TargetOrSubscanNotFeasibleExImpl - _startRecording(2,duration); // start recording the second subscan + _lonOTF(scanFrame, span, duration); //ManagementErrors::TelescopeSubScanErrorExImpl,ManagementErrors::TargetOrSubscanNotFeasibleExImpl + _startRecording(2, duration); // start recording the second subscan _terminateScan(); - ACS_LOG(LM_FULL_INFO,"CCore::crossScan()",(LM_NOTICE,"CROSSSCAN_DONE")); + ACS_LOG(LM_FULL_INFO, "CCore::crossScan()", (LM_NOTICE, "CROSSSCAN_DONE")); } void CCore::clearStatus() { baci::ThreadSyncGuard guard(&m_mutex); - m_schedulerStatus=Management::MNG_OK; - ACS_LOG(LM_FULL_INFO,"CCore::clearStatus()",(LM_NOTICE,"COMPONENT_STATUS_RESET")); + m_schedulerStatus = Management::MNG_OK; + ACS_LOG(LM_FULL_INFO, "CCore::clearStatus()", (LM_NOTICE, "COMPONENT_STATUS_RESET")); } -bool CCore::command(const IRA::CString& cmd,IRA::CString& answer) +bool CCore::command(const IRA::CString &cmd, IRA::CString &answer) { - try { - m_parser->run(cmd,answer); //parser is already thread safe..... + try + { + m_parser->run(cmd, answer); //parser is already thread safe..... return true; } - catch (ParserErrors::ParserErrorsExImpl &ex) { + catch (ParserErrors::ParserErrorsExImpl &ex) + { return false; } - catch (ACSErr::ACSbaseExImpl& ex) { + catch (ACSErr::ACSbaseExImpl &ex) + { ex.log(LM_ERROR); // the errors resulting from the execution are logged here as stated in the documentation of CommandInterpreter interface, while the parser errors are never logged. return false; } @@ -484,7 +505,6 @@ bool CCore::command(const IRA::CString& cmd,IRA::CString& answer) /////// PRIVATES - #include "Core_Common.i" #include "Core_Resource.i" @@ -492,4 +512,3 @@ bool CCore::command(const IRA::CString& cmd,IRA::CString& answer) #include "Core_Extra.i" #include "Core_Basic.i" - diff --git a/Noto/CDB/alma/DataBlock/IFDist/IFDist.xml b/Noto/CDB/alma/DataBlock/IFDist/IFDist.xml new file mode 100644 index 0000000000000000000000000000000000000000..7ad6db765e2f2c3fab1e8ac2bb503d4e1a16a1c0 --- /dev/null +++ b/Noto/CDB/alma/DataBlock/IFDist/IFDist.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/Noto/CDB/alma/Procedures/StationProcedures/StationProcedures.xml b/Noto/CDB/alma/Procedures/StationProcedures/StationProcedures.xml index ef71765d2e7ebdcc3b52d3d3849451d280430bf9..8ac5a2e45a24025054e5ee06a3d2edc391e86484 100644 --- a/Noto/CDB/alma/Procedures/StationProcedures/StationProcedures.xml +++ b/Noto/CDB/alma/Procedures/StationProcedures/StationProcedures.xml @@ -14,6 +14,8 @@ calOff setAttenuation=0,15 setAttenuation=1,5 + ifdist=1,1,44 + ifdist=2,1,32 @@ -27,7 +29,9 @@ calmux=TotalPower calOff setAttenuation=0,0 - setAttenuation=1,4 + setAttenuation=1,4 + ifdist=1,1,44 + ifdist=2,1,32 @@ -41,6 +45,8 @@ device=0 calmux=TotalPower calOff + ifdist=1,1,44 + ifdist=2,1,32 @@ -48,8 +54,8 @@ antennaSetup=SEC initialize=QQC - receiversSetup=QQC - asOn + receiversSetup=QQC + asOn device=0 calmux=TotalPower calOff @@ -60,8 +66,8 @@ antennaSetup=PRIM initialize=XXP - receiversSetup=XXP - asOn + receiversSetup=XXP + asOn device=0 calmux=TotalPower calOff @@ -72,8 +78,8 @@ antennaSetup=PRIM initialize=XXP - receiversSetup=XXP - asOff + receiversSetup=XXP + asOff device=0 calmux=TotalPower calOff @@ -84,11 +90,67 @@ antennaSetup=LL initialize=LLP - receiversSetup=LLP - asOff + receiversSetup=LLP + asOff + device=0 + calmux=TotalPower + calOff + + + + + + antennaSetup=PRIM + initialize=SSP + receiversSetup=SSP + asOff + device=0 + calmux=TotalPower + calOff + ifdist=1,1,44 + ifdist=2,1,32 + + + + + + antennaSetup=PRIM + initialize=XXP + receiversSetup=XXP + asOn device=0 calmux=TotalPower calOff + ifdist=1,3,44 + ifdist=2,3,32 + + + + + + antennaSetup=PRIM + initialize=XXP + receiversSetup=XXP + asOff + device=0 + calmux=TotalPower + calOff + ifdist=1,4,44 + ifdist=2,3,32 + + + + + + antennaSetup=LL + initialize=LLP + receiversSetup=LLP + asOff + device=0 + calmux=TotalPower + calOff + ifdist=1,2,44 + ifdist=2,2,32 @@ -101,6 +163,8 @@ device=0 calmux=TotalPower calOff + ifdist=1,4,44 + ifdist=2,4,32 @@ -108,11 +172,13 @@ antennaSetup=PRIM initialize=SSP - receiversSetup=SSP - asOff + receiversSetup=SSP + asOff device=0 calmux=TotalPower calOff + ifdist=1,3,44 + ifdist=2,5,32 diff --git a/Noto/Configuration/CDB/alma/DataBlock/IFDist/IFDist.xml b/Noto/Configuration/CDB/alma/DataBlock/IFDist/IFDist.xml new file mode 100644 index 0000000000000000000000000000000000000000..234876af9ba39f0790e6c5e6a6a4e0567ea02508 --- /dev/null +++ b/Noto/Configuration/CDB/alma/DataBlock/IFDist/IFDist.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/Noto/Configuration/CDB/alma/Procedures/StationProcedures/StationProcedures.xml b/Noto/Configuration/CDB/alma/Procedures/StationProcedures/StationProcedures.xml index ef71765d2e7ebdcc3b52d3d3849451d280430bf9..3dc64f13552925704ba5b43488f97ead591efc90 100644 --- a/Noto/Configuration/CDB/alma/Procedures/StationProcedures/StationProcedures.xml +++ b/Noto/Configuration/CDB/alma/Procedures/StationProcedures/StationProcedures.xml @@ -14,6 +14,8 @@ calOff setAttenuation=0,15 setAttenuation=1,5 + ifdist=1,1,44 + ifdist=2,1,32 @@ -27,7 +29,9 @@ calmux=TotalPower calOff setAttenuation=0,0 - setAttenuation=1,4 + setAttenuation=1,4 + ifdist=1,1,44 + ifdist=2,1,32 @@ -41,6 +45,8 @@ device=0 calmux=TotalPower calOff + ifdist=1,1,44 + ifdist=2,1,32 @@ -48,11 +54,13 @@ antennaSetup=SEC initialize=QQC - receiversSetup=QQC - asOn + receiversSetup=QQC + asOn device=0 calmux=TotalPower calOff + ifdist=1,1,44 + ifdist=2,1,32 @@ -60,11 +68,13 @@ antennaSetup=PRIM initialize=XXP - receiversSetup=XXP - asOn + receiversSetup=XXP + asOn device=0 calmux=TotalPower calOff + ifdist=1,3,44 + ifdist=2,3,32 @@ -72,11 +82,13 @@ antennaSetup=PRIM initialize=XXP - receiversSetup=XXP - asOff + receiversSetup=XXP + asOff device=0 calmux=TotalPower calOff + ifdist=1,4,44 + ifdist=2,3,32 @@ -84,11 +96,13 @@ antennaSetup=LL initialize=LLP - receiversSetup=LLP - asOff + receiversSetup=LLP + asOff device=0 calmux=TotalPower calOff + ifdist=1,2,44 + ifdist=2,2,32 @@ -101,6 +115,8 @@ device=0 calmux=TotalPower calOff + ifdist=1,4,44 + ifdist=2,4,32 @@ -108,11 +124,13 @@ antennaSetup=PRIM initialize=SSP - receiversSetup=SSP - asOff + receiversSetup=SSP + asOff device=0 calmux=TotalPower calOff + ifdist=1,3,44 + ifdist=2,5,32 diff --git a/Noto/Servers/NotoPyIfDistributor/config/CDB/schemas/IFDistConfiguration.xsd b/Noto/Servers/NotoPyIfDistributor/config/CDB/schemas/IFDistConfiguration.xsd new file mode 100644 index 0000000000000000000000000000000000000000..571c1d4efa46e632d9e94409cb0a615394cbf656 --- /dev/null +++ b/Noto/Servers/NotoPyIfDistributor/config/CDB/schemas/IFDistConfiguration.xsd @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Noto/Servers/NotoPyIfDistributor/src/Makefile b/Noto/Servers/NotoPyIfDistributor/src/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..c6c8c5fb134dc846102b453e3383d8133460daa7 --- /dev/null +++ b/Noto/Servers/NotoPyIfDistributor/src/Makefile @@ -0,0 +1,231 @@ + +#******************************************************************************* +# PPPPPPPP +# +# "@(#) $Id$" +# +# Makefile of ........ +# +# who when what +# -------- -------- ---------------------------------------------- +# discos 15/02/19 created +# + +# ALMA - Atacama Large Millimeter Array +# Copyright (c) ESO - European Southern Observatory, 2014 +# (in the framework of the ALMA collaboration). +# All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +#******************************************************************************* + +#******************************************************************************* +# This Makefile follows ALMA/ACS Standards (see Makefile(5) for more). +#******************************************************************************* +# REMARKS +# None +#------------------------------------------------------------------------ + +# +# user definable C-compilation flags +#USER_CFLAGS = + +# +# additional include and library search paths +#USER_INC = +#USER_LIB = + +# +# MODULE CODE DESCRIPTION: +# ------------------------ +# As a general rule: public file are "cleaned" and "installed" +# local (_L) are not "installed". + +# +# C programs (public and local) +# ----------------------------- +EXECUTABLES = +EXECUTABLES_L = + +# +# +xxxxx_OBJECTS = +xxxxx_LDFLAGS = +xxxxx_LIBS = + +# +# special compilation flags for single c sources +#yyyyy_CFLAGS = + +# +# Includes (.h) files (public only) +# --------------------------------- +INCLUDES = + +# +# Libraries (public and local) +# ---------------------------- +LIBRARIES = +LIBRARIES_L = + +# +# +lllll_OBJECTS = + +# +# Scripts (public and local) +# ---------------------------- +SCRIPTS = +SCRIPTS_L = + +# +# TCL scripts (public and local) +# ------------------------------ +TCL_SCRIPTS = +TCL_SCRIPTS_L = + +# +# Python stuff (public and local) +# ---------------------------- +PY_SCRIPTS = _ifdist +PY_SCRIPTS_L = + +PY_MODULES = +PY_MODULES_L = + +PY_PACKAGES = +PY_PACKAGES_L = +pppppp_MODULES = + +# +# +tttttt_OBJECTS = +tttttt_TCLSH = +tttttt_LIBS = + +# +# TCL libraries (public and local) +# ------------------------------ +TCL_LIBRARIES = +TCL_LIBRARIES_L = + +# +# +tttlll_OBJECTS = + +# +# Configuration Database Files +# ---------------------------- +CDB_SCHEMAS = IFDistConfiguration + +# +# IDL Files and flags +# +IDL_FILES = +TAO_IDLFLAGS = +USER_IDL = +# +# Jarfiles and their directories +# +JARFILES= +jjj_DIRS= +jjj_EXTRAS= +# For expressing dependencies between jarfiles (parallel builds) +jjj_JLIBS= +# +# java sources in Jarfile on/off +DEBUG= +# +# ACS XmlIdl generation on/off +# +XML_IDL= +# +# Java Component Helper Classes generation on/off +# +COMPONENT_HELPERS= +# +# Java Entity Classes generation on/off +# +XSDBIND= +# +# Schema Config files for the above +# +XSDBIND_INCLUDE= +# man pages to be done +# -------------------- +MANSECTIONS = +MAN1 = +MAN3 = +MAN5 = +MAN7 = +MAN8 = + +# +# local man pages +# --------------- +MANl = + +# +# ASCII file to be converted into Framemaker-MIF +# -------------------- +ASCII_TO_MIF = + +# +# other files to be installed +#---------------------------- +INSTALL_FILES = + +# +# list of all possible C-sources (used to create automatic dependencies) +# ------------------------------ +CSOURCENAMES = \ + $(foreach exe, $(EXECUTABLES) $(EXECUTABLES_L), $($(exe)_OBJECTS)) \ + $(foreach rtos, $(RTAI_MODULES) , $($(rtos)_OBJECTS)) \ + $(foreach lib, $(LIBRARIES) $(LIBRARIES_L), $($(lib)_OBJECTS)) + +# +#>>>>> END OF standard rules + +# +# INCLUDE STANDARDS +# ----------------- + +MAKEDIRTMP := $(shell searchFile include/acsMakefile) +ifneq ($(MAKEDIRTMP),\#error\#) + MAKEDIR := $(MAKEDIRTMP)/include + include $(MAKEDIR)/acsMakefile +endif + +# +# TARGETS +# ------- +all: do_all + @echo " . . . 'all' done" + +clean : clean_all + @echo " . . . clean done" + +clean_dist : clean_all clean_dist_all + @echo " . . . clean_dist done" + +man : do_man + @echo " . . . man page(s) done" + +install : install_all + @chmod 700 $(INTROOT)/bin/_ifdist + @echo " . . . installation done" + + +#___oOo___ diff --git a/Noto/Servers/NotoPyIfDistributor/src/_ifdist.py b/Noto/Servers/NotoPyIfDistributor/src/_ifdist.py new file mode 100644 index 0000000000000000000000000000000000000000..6be5741f34c40804292f3a4e186056bd798c1715 --- /dev/null +++ b/Noto/Servers/NotoPyIfDistributor/src/_ifdist.py @@ -0,0 +1,156 @@ +#!/usr/bin/env python + +# This is a python script that can be used to configure the IF distributor. +# The script is adapted from DMED. +# PARAMETERS: +# ifdist=input,pol,att + +#who when what +#fabio vitello (fabio.vitello@inaf.it) 28/06/2021 Creation + +from Acspy.Clients.SimpleClient import PySimpleClient +import ACSLog +import maciErrType +import cdbErrType +import maciErrTypeImpl +import ManagementErrorsImpl +import ComponentErrorsImpl +from IRAPy import logger,userLogger +from SimpleParserPy import add_user_message +import xml.etree.ElementTree as ET +import sys,getopt +import os +import socket +import time +from collections import namedtuple + +def send_command(ip, port, command): + s=socket.socket(socket.AF_INET, socket.SOCK_STREAM) + try: + s.connect((ip,int(port))) + except socket.error: + return "Fail" + s.sendall(command) + time.sleep(0.1) + response=s.recv(1024) + s.close() + response=response.strip().split('\n') + return response + +def cdb(xmlstr): + root=ET.fromstring(xmlstr) + return root.items()[0][1],root.items()[1][1] + +def main(argv): + #check we are at the Noto + station=os.environ['STATION'] + dataPath="alma/DataBlock/IFDist" + xmlstring="" + data=[] + found=False + if station!="Noto": + newEx = ManagementErrorsImpl.UnsupportedOperationExImpl() + add_user_message(newEx,"The command is not available or it is not supported") + userLogger.logExcpetion(newEx) + simpleClient.disconnect() + sys.exit(1) + + simpleClient = PySimpleClient() + + try: + xmlstring=simpleClient.getCDBRecord(dataPath) + except cdbErrType.CDBRecordDoesNotExistEx as ex: + newEx = ComponentErrorsImpl.CDBAccessExImpl( exception=ex, create=1 ) + add_user_message(newEx,"Unable to load IFDist configuration") + userLogger.logException(newEx) + simpleClient.disconnect() + sys.exit(1) + + try: + ip,port=cdb(xmlstring) + except: + newEx = ComponentErrorsImpl.CDBFieldFormatExImpl() + add_user_message(newEx,"Unable to parse IFDist configuration") + userLogger.logException(newEx) + simpleClient.disconnect() + sys.exit(1) + + commandstr=[] + + + try: + if int(argv[0]) not in range (1,3): + sys.stderr.write(str('error Enter a valid input channel number')) + userLogger.logError("Enter a valid input channel number") + simpleClient.disconnect() + sys.exit(1) + + selectedInput='input'+argv[0] + + if int(argv[1]) not in range (-1,7): + sys.stderr.write(str('error Enter an allowed value for pol')) + userLogger.logError("Enter an allowed value for pol") + simpleClient.disconnect() + sys.exit(1) + + selectedPol=argv[1] + + if float(argv[2]) not in range (-1,64): + sys.stderr.write(str('error Enter an allowed value for att')) + userLogger.logError("Enter an allowed value for att") + simpleClient.disconnect() + sys.exit(1) + + selectedAtt=argv[2] + + except ValueError: + sys.stderr.write(str('error Enter a numeric value')) + userLogger.logError("Enter a numeric value") + simpleClient.disconnect() + sys.exit(1) + + #if selectedPol and selectedAtt are -1 print information on current pol and att + if int(selectedPol) == -1 and float(selectedAtt)==-1: + commandstr=[selectedInput,"att"+argv[0]] + #if selectedPol is -1 and selectedAtt is not -1 change att for selected input and current pol + elif int(selectedPol) == -1 and float(selectedAtt) !=-1: + commandstr=["att"+argv[0]+","+selectedAtt] + #if selectedPol is not -1 and selectedAtt is -1 change pol for selected input + elif int(selectedPol) != -1 and float(selectedAtt) ==-1: + commandstr=[selectedInput+","+selectedPol] + #if selectedPol is not -1 and selectedAtt is not -1 change pol and att for selected input + elif int(selectedPol) != -1 and float(selectedAtt) !=-1: + commandstr=[selectedInput+","+selectedPol, "att"+argv[0]+","+selectedAtt] + + answerstr = "" + + for i in range(0,len(commandstr)): + userLogger.logNotice("IFDist setup according to %s command"%(commandstr[i])) + + answer=send_command(ip,port, commandstr[i]) + answerstr+= str(answer) + + if answer=="Fail": + newEx = ComponentErrorsImpl.SocketErrorExImpl() + add_user_message(newEx,"Unable to communicate to IFDist") + sys.stderr.write(str('error Unable to communicate to IFDist')) + userLogger.logError(newEx) + simpleClient.disconnect() + sys.exit(1) + + elif answer[0]=="NAK": + newEx = ComponentErrorsImpl.NakExImpl() + add_user_message(newEx,"IFDist command error") + sys.stderr.write(str('error IFDist command error')) + userLogger.logError(newEx) + simpleClient.disconnect() + sys.exit(1) + else: + userLogger.logNotice( "Answer: %s"%(answer)) + + + print >> sys.stderr, answerstr.replace(","," ") + + +if __name__=="__main__": + main(sys.argv[1:]) diff --git a/SystemMake/Makefile b/SystemMake/Makefile index b7bc925d71d62d33f4aaee26f0a08e1b37f8a231..ecddae09fd9aec196d13de0d93b802a57e7ef2f4 100644 --- a/SystemMake/Makefile +++ b/SystemMake/Makefile @@ -68,7 +68,7 @@ NT_DOC:=NTDox NT_ERRORS:=NotoActiveSurfaceErrors NT_INTERFACES:=NotoAntennaInterface NotoReceiversInterface NotoWeatherStationInterface NotoActiveSurfaceInterface \ NT_LIBRARIES:= -NT_SERVERS:= NotoReceivers NotoMount NotoWeatherStation NotoActiveSurface NotoMinorServo NotoPyLocalOscillator +NT_SERVERS:= NotoReceivers NotoMount NotoWeatherStation NotoActiveSurface NotoMinorServo NotoPyLocalOscillator NotoPyIfDistributor NT_CLIENTS:=NotoMountTextClient NT_MISC:=NotoScripts