diff --git a/CHANGELOG.md b/CHANGELOG.md index e8149ee6d0bd6b2401cc75e4ceb03329955c5afd..5e2f270b392b253f105512513476286f497430f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,7 +82,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/ issue #433 - limited refraction correction values to a meaningful range in order to avoid flooding the jlog with warning messages whenever the elevation is close to 90 degrees issue #502 - removed last service daemon reference from Manager.xml io SRT production line -## [discos1.0.5] - +## [discos1.0.5] - 09-03-2020 ## Added issue #504 - added credits clause (regarding INAF data ownership) to fits files headers issue #518 - KBand receivers cryo temperature read wrongly with connection problems. More information: https://github.com/discos/discos/issues/518#issuecomment-590838480 @@ -95,10 +95,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/ ## Changed issue #545 - Oscillation checks enabled for Mc and Nt telescopes, this setting is now under control of a CDB argument -## [next release] +## [discos1.0.6] - 09-02-2022 ## Added + issue #655 - ACU Component for Noto and Medicina is now capble to prevent seldom mode changes coming from ACU reset issue #653 - added a couple of scriptsto ease vnc conection from remote a file copying. The scripts support linux and macos + issue #588 - added the control of the new Noto subreflector and primary focus receiver box servo system. + ## Fixed issue #448 - Added Sky Offsets to calibration tool client issue #585 - Fixed misshandled schedule with NULL as backend (Dry Run) @@ -106,3 +109,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/ 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. + +## [next release] - +## Added + +## Fixed + +## Changed + + diff --git a/Common/Servers/ExternalClients/src/ExternalClientsSocketServer.cpp b/Common/Servers/ExternalClients/src/ExternalClientsSocketServer.cpp index 23411b2a06c4946fa44dd9790addd5d42d5c1457..2fe3df0f44a2bfca451b3d0a54b7f2da0a230260 100644 --- a/Common/Servers/ExternalClients/src/ExternalClientsSocketServer.cpp +++ b/Common/Servers/ExternalClients/src/ExternalClientsSocketServer.cpp @@ -560,17 +560,24 @@ CExternalClientsSocketServer::cmdToScheduler () printf("dentro ans==false\n"); }*/ } + out.ReplaceAll('\n','-'); + /*out.Replace('\n','-'); out.Replace('\n','-'); + out.Replace('\n','-'); + out.Replace('\n','-');*/ Len = out.GetLength (); int i; - for (i = 0; i < Len; i++) - { - outBuffer[i] = out.CharAt (i); - } + for (i = 0; i < Len; i++) { + //if (out.CharAt(i)=='\n') + // break; + outBuffer[i] = out.CharAt (i); + } out.Empty(); outBuffer[Len] = '\n'; + //outBuffer[i] = '\n'; //printf ("Command returned = %s", outBuffer); Res = sendBuffer (outBuffer, Len + 1); + //Res = sendBuffer (outBuffer, i + 1); if (Res == WOULDBLOCK || Res == FAIL) { _EXCPT (SocketErrorExImpl, impl, diff --git a/Common/Servers/PyCalmux/src/Calmux/PyCalmuxImpl.py b/Common/Servers/PyCalmux/src/Calmux/PyCalmuxImpl.py index 15fc28aaff9cbc477f895a151a21ae6032c02a83..239419977348828a2ba2a3790da24165c4e66512 100644 --- a/Common/Servers/PyCalmux/src/Calmux/PyCalmuxImpl.py +++ b/Common/Servers/PyCalmux/src/Calmux/PyCalmuxImpl.py @@ -139,6 +139,8 @@ class PyCalmuxImpl(CalMux, cc, services, lcycle): """ s.sendall(command) +# time.sleep(0.1) + response = s.recv(1024) response = response.strip().split() if len(response) == 1: diff --git a/Medicina/CDB/alma/ANTENNA/Mount/Mount.xml b/Medicina/CDB/alma/ANTENNA/Mount/Mount.xml index 0dca04b5fb042fc19cbd7d7762322fc8fd34648e..60cdd2868a1b40d8aedea7dd05b1b4a87a43febe 100644 --- a/Medicina/CDB/alma/ANTENNA/Mount/Mount.xml +++ b/Medicina/CDB/alma/ANTENNA/Mount/Mount.xml @@ -15,6 +15,7 @@ ControlThreadPeriod="200000" RepetitionCacheTime="2000000" RepetitionExpireTime="5000000" + CheckMode="false" CheckOscillation="true" OscillationThreshold="0.01" OscillationAlarmDuration="2000000" diff --git a/Medicina/Configuration/CDB/alma/ANTENNA/Mount/Mount.xml b/Medicina/Configuration/CDB/alma/ANTENNA/Mount/Mount.xml index 0dca04b5fb042fc19cbd7d7762322fc8fd34648e..60cdd2868a1b40d8aedea7dd05b1b4a87a43febe 100644 --- a/Medicina/Configuration/CDB/alma/ANTENNA/Mount/Mount.xml +++ b/Medicina/Configuration/CDB/alma/ANTENNA/Mount/Mount.xml @@ -15,6 +15,7 @@ ControlThreadPeriod="200000" RepetitionCacheTime="2000000" RepetitionExpireTime="5000000" + CheckMode="false" CheckOscillation="true" OscillationThreshold="0.01" OscillationAlarmDuration="2000000" diff --git a/Medicina/Servers/MedicinaMinorServo/src/MedMinorServoGeometry.cpp b/Medicina/Servers/MedicinaMinorServo/src/MedMinorServoGeometry.cpp index db364b60549c0fdfb45cdf0ffcea6730b8e5d54e..3928ac373ceabdb3a76083b1196a1998bcdf40d0 100755 --- a/Medicina/Servers/MedicinaMinorServo/src/MedMinorServoGeometry.cpp +++ b/Medicina/Servers/MedicinaMinorServo/src/MedMinorServoGeometry.cpp @@ -325,12 +325,16 @@ double MedMinorServoGeometry::_check_axis_limit(const double position, const MedMinorServoAxis axis) { - if(position < axis.position_min){ + int iposition = (int)position; + + + if(iposition < axis.position_min){ throw MinorServoAxisLimitError("axis too low"); //return axis.position_min; } - if(position > axis.position_max){ - throw MinorServoAxisLimitError("axis too high"); + if(iposition > axis.position_max){ + std::cout<<axis.name<<" "<<iposition<<" " <<axis.position_max<< std::endl; + throw MinorServoAxisLimitError("axis too high "); //return axis.position_max; } return position; diff --git a/Medicina/Servers/MedicinaMount/config/CDB/schemas/MedicinaMount.xsd b/Medicina/Servers/MedicinaMount/config/CDB/schemas/MedicinaMount.xsd index 7dbd347358286a71c69ca20c0a0db90c4da7ae54..8b6d4af508a7146f53f8c9dcb00ad6599d8e093c 100644 --- a/Medicina/Servers/MedicinaMount/config/CDB/schemas/MedicinaMount.xsd +++ b/Medicina/Servers/MedicinaMount/config/CDB/schemas/MedicinaMount.xsd @@ -101,6 +101,8 @@ <xs:attribute name="RepetitionCacheTime" type="xs:unsignedLong" use="required" /> <!-- the expire time (microseconds) for logging repetition filter --> <xs:attribute name="RepetitionExpireTime" type="xs:unsignedLong" use="required" /> + <!-- This flag is "true" or "false" to enable the check of the ACU mode --> + <xs:attribute name="CheckMode" type="xs:boolean" use="required" /> <!-- This flag is "true" or "false" to control the oscillattion check is active or not --> <xs:attribute name="CheckOscillation" type="xs:boolean" use="required" /> <!-- the oscillation threshold as azimuth tracking error (degrees) --> diff --git a/Medicina/Servers/MedicinaMount/include/ACUData.h b/Medicina/Servers/MedicinaMount/include/ACUData.h index 23d03ac68d829c3363f6b61d4499c90627cdf962..5fbe0031e09d1de7b206290e15642a39f3d24cd3 100644 --- a/Medicina/Servers/MedicinaMount/include/ACUData.h +++ b/Medicina/Servers/MedicinaMount/include/ACUData.h @@ -83,6 +83,9 @@ public: /** Returns the section which the antenna is located in, at present */ CACUInterface::TAntennaSection getSection() const; + /** Return true if the driver power is on */ + bool getDrivePower() const; + /**Returns the number of free stack slots reserved for time tagged program track positions */ WORD getFreeStackPositions() const; diff --git a/Medicina/Servers/MedicinaMount/include/ACUInterface.h b/Medicina/Servers/MedicinaMount/include/ACUInterface.h index 6e3f8cd926b9752d32f2e4fdb7e9008f64780b17..c765e66440eed8abf776c4b1de76916bbc661e83 100644 --- a/Medicina/Servers/MedicinaMount/include/ACUInterface.h +++ b/Medicina/Servers/MedicinaMount/include/ACUInterface.h @@ -186,9 +186,14 @@ public: static TAxeModes getMode(BYTE mode); /** - * This function returns the antenna presnt section given the control word + * This function returns the antenna present section given the control word */ static TAntennaSection getSection(WORD controlWord); + + /** + * This function returns true i drive power is on, false otherwise + */ + static bool getDrivePower(WORD controlWord); }; diff --git a/Medicina/Servers/MedicinaMount/include/Configuration.h b/Medicina/Servers/MedicinaMount/include/Configuration.h index dcee4e1e1d239012ec375be0da12c9f44db8851b..84d00bdb16199b8e2ebded15c9d852c1df6d823e 100644 --- a/Medicina/Servers/MedicinaMount/include/Configuration.h +++ b/Medicina/Servers/MedicinaMount/include/Configuration.h @@ -99,9 +99,12 @@ public: /** Gets the number of times the oscillation has to be hit before an oscillation is declared*/ inline DWORD oscillationNumberThreashold() const { return m_dwoscNumberThreshold; } - /** Flag that indicates whether the oscillation chek must performed or not. */ + /** Flag that indicates whether the oscillation check must performed or not. */ inline bool checkForOscillation() const { return m_checkOsc; } + /** Flag that indicates whether the ACU check mode must performed or not. */ + inline bool checkForMode() const { return m_checkMode; } + /** * This member function is used to configure component by reading the configuration parameter from the CDB. * This must be the first call before using any other function of this class. @@ -139,9 +142,9 @@ private: DWORD m_dwcontrolThreadPeriod; /** This is the precision (degree) of the antenna */ //double m_dtrackingPrecision; - /** This indicates the cache time for the repetion log filter */ + /** This indicates the cache time for the repetition log filter */ DDWORD m_dwrepetitionCacheTime; - /** This indicates the expire time for the repetion log filter */ + /** This indicates the expire time for the repetition log filter */ DDWORD m_dwexpireCacheTime; /** this number is the separation value between the CW and CCW, if the azimuth is greater than this the section is CW */ double m_cwLimit; @@ -151,6 +154,7 @@ private: WORD m_dwoscNumberThreshold; DDWORD m_dwoscRecoverTime; bool m_checkOsc; + bool m_checkMode; }; diff --git a/Medicina/Servers/MedicinaMount/include/MedicinaMountSocket.h b/Medicina/Servers/MedicinaMount/include/MedicinaMountSocket.h index 45f9d1ed5c756312f9a71f3868eadeb7021fbcb7..2089303a5cfc7712ca0c94c9ddddecdc35de3716 100644 --- a/Medicina/Servers/MedicinaMount/include/MedicinaMountSocket.h +++ b/Medicina/Servers/MedicinaMount/include/MedicinaMountSocket.h @@ -447,10 +447,33 @@ public: * 1) if the tracking error is beyond a threashold an alarm condition is triggered. This condition has a certain validity time. * 2) If more than a number of direction changes (of the tracking error with respect to the zero error) are detected during the alarm time window, the oscillation is declared- * 3) The alarm condition is cleared if the time validity window of the alarm elapsed and the tracking error is again under the threshold. - * In case of detection counter mesures are immediately taken. + * In case of detection counter measures are immediately taken. */ void detectOscillation() throw (AntennaErrors::ConnectionExImpl,ComponentErrors::SocketErrorExImpl,ComponentErrors::TimeoutExImpl,AntennaErrors::NakExImpl,AntennaErrors::AntennaBusyExImpl); - + + /** + * This method has been added to detect the event the ACU mode differs from previously commanded. In case it tries to + * recover from this event by commanding the correct mode. + * @throw AntennaErrors::ConnectionExImpl + * @throw ComponentErrors::SocketErrorExImpl + * @throw ComponentErrors::TimeoutExImpl + * @throw AntennaErrors::NakExImpl + * @throw AntennaErrors::AntennaBusyExImpl + */ + void checkCommandedMode() throw (AntennaErrors::ConnectionExImpl,ComponentErrors::SocketErrorExImpl, + ComponentErrors::TimeoutExImpl,AntennaErrors::NakExImpl,AntennaErrors::AntennaBusyExImpl); + + /** + * This method has been added to detect a power failure in the servo system. In case it tries to + * recover from this event by reseting the servo. + * @throw AntennaErrors::ConnectionExImpl + * @throw ComponentErrors::SocketErrorExImpl + * @throw ComponentErrors::TimeoutExImpl + * @throw AntennaErrors::NakExImpl + */ + void checkPowerFailure() throw (ComponentErrors::TimeoutExImpl,AntennaErrors::NakExImpl, + AntennaErrors::ConnectionExImpl,ComponentErrors::SocketErrorExImpl); + /** * This member function is used by the control thread in order to check if a long job that was started as completed or not. * @param job job identifier @@ -607,6 +630,16 @@ private: */ CACUInterface::TAxeModes m_oscMode; + /** + * this flag indicates that a recovery from mode check in ongoing..... + */ + bool m_modeCheckRecover; + + /** + * this flag indicates that a power failure has been detected + */ + bool m_powerFailDetected; + /** * Stores the epoch of the last scan. Used in oscillation prevention */ diff --git a/Medicina/Servers/MedicinaMount/src/ACUData.cpp b/Medicina/Servers/MedicinaMount/src/ACUData.cpp index 07c67df799bc4361bff219a6467def796611fc10..147d5a4f2a9994c03581f093f92ae628223e2af2 100644 --- a/Medicina/Servers/MedicinaMount/src/ACUData.cpp +++ b/Medicina/Servers/MedicinaMount/src/ACUData.cpp @@ -114,6 +114,14 @@ CACUInterface::TAntennaSection CACUData::getSection() const memcpy(&Value,(m_MonitorData+36),2); return CACUInterface::getSection(Value); } + +bool CACUData::getDrivePower() const +{ + WORD val; + memcpy(&val,(m_MonitorData+36),2); + return CACUInterface::getDrivePower(val); +} + WORD CACUData::getFreeStackPositions() const { diff --git a/Medicina/Servers/MedicinaMount/src/ACUInterface.cpp b/Medicina/Servers/MedicinaMount/src/ACUInterface.cpp index 874ebfe18a440c8ea46667a3a59d329f99894638..7dcb00ad1a5163a37b90f7bf4aa5e816b0b08f66 100644 --- a/Medicina/Servers/MedicinaMount/src/ACUInterface.cpp +++ b/Medicina/Servers/MedicinaMount/src/ACUInterface.cpp @@ -247,3 +247,9 @@ CACUInterface::TAntennaSection CACUInterface::getSection(WORD controlWord) else return CACUInterface::CCW; } +bool CACUInterface::getDrivePower(WORD controlWord) +{ + if (controlWord & (1 << 15)) return false; + else return true; +} + diff --git a/Medicina/Servers/MedicinaMount/src/Configuration.cpp b/Medicina/Servers/MedicinaMount/src/Configuration.cpp index f7504523db58f2cbb26c7b5b3853cde418ebef2a..b7ec59ded99813e3ff67ca01b248a9c4e300e0df 100644 --- a/Medicina/Servers/MedicinaMount/src/Configuration.cpp +++ b/Medicina/Servers/MedicinaMount/src/Configuration.cpp @@ -66,6 +66,13 @@ void CConfiguration::Init(maci::ContainerServices *Services) throw (ComponentErr _GET_DOUBLE_ATTRIBUTE("cw_ccw_limit","CW/CCW limit (degrees):",m_cwLimit,"DataBlock/Mount"); _GET_STRING_ATTRIBUTE("CheckOscillation","Check oscillation during tracking: ",check,""); + check.MakeUpper(); + m_checkOsc=(check=="TRUE"); + + _GET_STRING_ATTRIBUTE("CheckMode","Check ACU mode enabled: ",check,""); + check.MakeUpper(); + m_checkMode=(check=="TRUE"); + _GET_DOUBLE_ATTRIBUTE("OscillationThreshold","Oscillation theshold (deg):",m_doscThreashold,""); _GET_DWORD_ATTRIBUTE("OscillationAlarmDuration","Oscillation alarm duration (uSec):",m_dwoscAlarmDuration,""); _GET_DWORD_ATTRIBUTE("OscillationNumberThreshold","Oscillation number threashold:",m_dwoscNumberThreshold,""); @@ -74,5 +81,5 @@ void CConfiguration::Init(maci::ContainerServices *Services) throw (ComponentErr m_dwoscRecoverTime*=10; m_dwcontrolThreadPeriod*=10; check.MakeUpper(); - m_checkOsc=(check=="TRUE"); + } diff --git a/Medicina/Servers/MedicinaMount/src/MedicinaMountSocket.cpp b/Medicina/Servers/MedicinaMount/src/MedicinaMountSocket.cpp index 00c5a72f60273e17c634b430836803e5931ebc6f..e018632aaa83c3f751d9a7b023a192c064086f4d 100644 --- a/Medicina/Servers/MedicinaMount/src/MedicinaMountSocket.cpp +++ b/Medicina/Servers/MedicinaMount/src/MedicinaMountSocket.cpp @@ -130,6 +130,8 @@ void CMedicinaMountSocket::Init(CConfiguration *config,maci::ContainerServices * m_oscStopTime=0; m_oscMode=CACUInterface::STANDBY; m_lastScanEpoch=0; + m_modeCheckRecover=false; + m_powerFailDetected=false; } CACUInterface::TAxeModes CMedicinaMountSocket::getAzimuthMode() throw (ConnectionExImpl,SocketErrorExImpl,TimeoutExImpl) @@ -587,8 +589,11 @@ void CMedicinaMountSocket::Mode(CACUInterface::TAxeModes azMode,CACUInterface::T TIMEVALUE now; IRA::CIRATools::getTime(now); m_Data.setLastCommandedMode(azMode); - m_Data.setAzimuthOffset(0.0); - m_Data.setElevationOffset(0.0); + if (!m_modeCheckRecover) { // need to keep current offsets in case a recovery procedure is ongoing..... + m_Data.setAzimuthOffset(0.0); + m_Data.setElevationOffset(0.0); + m_modeCheckRecover=false; + } m_lastScanEpoch=now.value().value; } @@ -844,6 +849,50 @@ double CMedicinaMountSocket::getHWAzimuth(double destination,const CACUInterface return CIRATools::getHWAzimuth(pos,dest,m_configuration->azimuthLowerLimit(),m_configuration->azimuthUpperLimit(),section,m_configuration->cwLimit()); } +void CMedicinaMountSocket::checkPowerFailure() throw (ComponentErrors::TimeoutExImpl,AntennaErrors::NakExImpl, + AntennaErrors::ConnectionExImpl,ComponentErrors::SocketErrorExImpl) +{ + //_IRA_LOGDIKE_COMPLETION(m_logDike,__dummy,LM_DEBUG); + if (!m_configuration->checkForMode()) return; + if (m_Data.getDrivePower()) { //in case of a power outage of failure..... + if (!m_powerFailDetected) { //first detection + CUSTOM_LOG(LM_FULL_INFO,"CMedicinaMountSocket::checkPowerFailure()",(LM_CRITICAL, + "Servo system power failure detected")); + } + m_powerFailDetected=true; + } + else { // no power error + if (m_powerFailDetected) { //first detection + CUSTOM_LOG(LM_FULL_INFO,"CMedicinaMountSocket::checkPowerFailure()",(LM_NOTICE, + "Trying a servo system reset")); + failureReset();// throw (TimeoutExImpl,AntennaErrors::NakExImpl,ConnectionExImpl,SocketErrorExImpl) + m_powerFailDetected=false; + CUSTOM_LOG(LM_FULL_INFO,"CMedicinaMountSocket::checkPowerFailure()",(LM_CRITICAL, + "Servo system power failure cleared")); + } + } +} + +void CMedicinaMountSocket::checkCommandedMode() throw (ConnectionExImpl,SocketErrorExImpl,TimeoutExImpl,AntennaErrors::NakExImpl,AntennaBusyExImpl) +{ + CACUInterface::TAxeModes commandedMode, mode; + if (!m_configuration->checkForMode()) return; + if (m_powerFailDetected) return; // no need to try to recover from mode discrepancy if the cause is a power failure + commandedMode=m_Data.getLastCommandedMode(); + if ((commandedMode!=CACUInterface::STANDBY) && (commandedMode!=CACUInterface::UNSTOW) && + (commandedMode!=CACUInterface::STOW) && (commandedMode!=CACUInterface::STOP)) { + mode=getAzimuthMode(); // throw (ConnectionExImpl,SocketErrorExImpl,TimeoutExImpl) + if ((mode!=CACUInterface::UNKNOWN)) { + if ((commandedMode!=mode)) { + CUSTOM_LOG(LM_FULL_INFO,"CMedicinaMountSocket::checkCommandedMode()", + (LM_WARNING,"ACU operation mode differs from commanded one, trying to recover...")); + m_modeCheckRecover=true; + Mode(commandedMode,commandedMode); + } + } + } +} + void CMedicinaMountSocket::detectOscillation() throw (ConnectionExImpl,SocketErrorExImpl,TimeoutExImpl,AntennaErrors::NakExImpl,AntennaBusyExImpl) { TIMEVALUE now; diff --git a/Medicina/Servers/MedicinaMount/src/MedicinaMountThread.cpp b/Medicina/Servers/MedicinaMount/src/MedicinaMountThread.cpp index 695d389de19c01725a9c09316bf8b19d8cdeb131..4023b11c90b292fdfa17ed858aaca77ec9b8102b 100644 --- a/Medicina/Servers/MedicinaMount/src/MedicinaMountThread.cpp +++ b/Medicina/Servers/MedicinaMount/src/MedicinaMountThread.cpp @@ -51,6 +51,8 @@ void CMedicinaMountControlThread::runLoop() CSecAreaResourceWrapper<CMedicinaMountSocket> socket=m_pACUControl->Get(); socket->updateComponent(); // before commenting out or deleting consider that inside this method the flushing of pending event of the log dike object is called socket->detectOscillation(); + socket->checkPowerFailure(); + socket->checkCommandedMode(); if (currentJobID!=0) { ACSErr::Completion_var comp; if (socket->updateLongJobs(currentJobID,comp.out())) { diff --git a/Noto/CDB/alma/ANTENNA/Mount/Mount.xml b/Noto/CDB/alma/ANTENNA/Mount/Mount.xml index 44c2fc8ea4ff976d3a35d2b81c98b4b32da5a4d3..c909831dd49659319fb5fba34536ad397d602f42 100644 --- a/Noto/CDB/alma/ANTENNA/Mount/Mount.xml +++ b/Noto/CDB/alma/ANTENNA/Mount/Mount.xml @@ -15,6 +15,7 @@ ControlThreadPeriod="200000" RepetitionCacheTime="2000000" RepetitionExpireTime="5000000" + CheckMode="true" CheckOscillation="true" OscillationThreshold="0.01" OscillationAlarmDuration="2000000" diff --git a/Noto/CDB/alma/Procedures/StationProcedures/StationProcedures.xml b/Noto/CDB/alma/Procedures/StationProcedures/StationProcedures.xml index a5440f574ab53f018aac51747a77658ae0614a09..95447e60d286546a9360acc346c666dc91707b48 100644 --- a/Noto/CDB/alma/Procedures/StationProcedures/StationProcedures.xml +++ b/Noto/CDB/alma/Procedures/StationProcedures/StationProcedures.xml @@ -15,8 +15,10 @@ calOff setAttenuation=0,15 setAttenuation=1,5 - ifdist=1,1,44 - ifdist=2,1,32 + ifdist=1,1,-1 + ifdist=2,1,-1 + ifdist=1,-1,16 + ifdist=2,-1,32 </body> </Procedure> @@ -26,14 +28,16 @@ initialize=MMC receiversSetup=MMC servoSetup=SEC - asOn + asOn device=0 calmux=TotalPower calOff setAttenuation=0,0 setAttenuation=1,4 - ifdist=1,1,44 - ifdist=2,1,32 + ifdist=1,1,-1 + ifdist=2,1,-1 + ifdist=1,-1,44 + ifdist=2,-1,32 </body> </Procedure> @@ -43,12 +47,14 @@ initialize=KKC receiversSetup=KKC servoSetup=SEC - asOn + asOn device=0 calmux=TotalPower calOff - ifdist=1,1,44 - ifdist=2,1,32 + ifdist=1,1,-1 + ifdist=2,1,-1 + ifdist=2,-1,34 + ifdist=1,-1,36 </body> </Procedure> @@ -62,8 +68,10 @@ device=0 calmux=TotalPower calOff - ifdist=1,1,44 - ifdist=2,1,32 + ifdist=1,1,-1 + ifdist=2,1,-1 + ifdist=1,-1,44 + ifdist=2,-1,32 </body> </Procedure> @@ -76,9 +84,11 @@ asOn device=0 calmux=TotalPower - calOff - ifdist=1,3,44 - ifdist=2,3,32 + calOff + ifdist=1,3,-1 + ifdist=2,3,-1 + ifdist=1,-1,10 + ifdist=2,-1,10 </body> </Procedure> @@ -91,9 +101,11 @@ asOff device=0 calmux=TotalPower - calOff - ifdist=1,4,44 - ifdist=2,3,32 + calOff + ifdist=1,5,-1 + ifdist=2,3,-1 + ifdist=1,-1,8 + ifdist=2,-1,10 </body> </Procedure> @@ -106,9 +118,11 @@ asOff device=0 calmux=TotalPower - calOff - ifdist=1,2,22 - ifdist=2,2,22 + calOff + ifdist=1,2,-1 + ifdist=2,2,-1 + ifdist=1,-1,44 + ifdist=2,-1,44 </body> </Procedure> @@ -121,9 +135,11 @@ servoSetup=SXP device=0 calmux=TotalPower - calOff - ifdist=1,4,44 - ifdist=2,4,32 + calOff + ifdist=1,4,-1 + ifdist=2,4,-1 + ifdist=1,-1,8 + ifdist=2,-1,8 </body> </Procedure> @@ -136,9 +152,11 @@ asOff device=0 calmux=TotalPower - calOff - ifdist=1,3,44 - ifdist=2,5,32 + calOff + ifdist=1,5,-1 + ifdist=2,3,-1 + ifdist=1,-1,8 + ifdist=2,-1,10 </body> </Procedure> diff --git a/Noto/Configuration/CDB/alma/ANTENNA/Mount/Mount.xml b/Noto/Configuration/CDB/alma/ANTENNA/Mount/Mount.xml index 44c2fc8ea4ff976d3a35d2b81c98b4b32da5a4d3..c909831dd49659319fb5fba34536ad397d602f42 100644 --- a/Noto/Configuration/CDB/alma/ANTENNA/Mount/Mount.xml +++ b/Noto/Configuration/CDB/alma/ANTENNA/Mount/Mount.xml @@ -15,6 +15,7 @@ ControlThreadPeriod="200000" RepetitionCacheTime="2000000" RepetitionExpireTime="5000000" + CheckMode="true" CheckOscillation="true" OscillationThreshold="0.01" OscillationAlarmDuration="2000000" diff --git a/Noto/Configuration/CDB/alma/DataBlock/MMC/NormalModeSetup/NormalModeSetup.xml b/Noto/Configuration/CDB/alma/DataBlock/MMC/NormalModeSetup/NormalModeSetup.xml index 234122febc550ece553b3b836b3bde6be3d8d627..c4b0eece4184934766370b21fea6ea365225a743 100644 --- a/Noto/Configuration/CDB/alma/DataBlock/MMC/NormalModeSetup/NormalModeSetup.xml +++ b/Noto/Configuration/CDB/alma/DataBlock/MMC/NormalModeSetup/NormalModeSetup.xml @@ -18,7 +18,7 @@ Feeds="1" IFs="2" Polarization="L R" - DefaultLO="6956.0 6956.0" + DefaultLO="6936.0 6936.0" LOMultiplier="1 1" FixedLO2="0.0 0.0" LOMin="5000.0 5000.0" diff --git a/Noto/Configuration/CDB/alma/DataBlock/MMC/Synthesizer/Synthesizer.xml b/Noto/Configuration/CDB/alma/DataBlock/MMC/Synthesizer/Synthesizer.xml index e7186f9e4f6e22da470ef85f0ca75ad868c74aca..ca6aa325be777324b6b81fd101deedcaed99cef0 100644 --- a/Noto/Configuration/CDB/alma/DataBlock/MMC/Synthesizer/Synthesizer.xml +++ b/Noto/Configuration/CDB/alma/DataBlock/MMC/Synthesizer/Synthesizer.xml @@ -5,6 +5,6 @@ xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -<SynthesizerEntry><Frequency>6956.0</Frequency><OutputPower>16</OutputPower></SynthesizerEntry> +<SynthesizerEntry><Frequency>6936.0</Frequency><OutputPower>16</OutputPower></SynthesizerEntry> -</LocalOscillatorLookUpTable> \ No newline at end of file +</LocalOscillatorLookUpTable> diff --git a/Noto/Configuration/CDB/alma/Procedures/StationProcedures/StationProcedures.xml b/Noto/Configuration/CDB/alma/Procedures/StationProcedures/StationProcedures.xml index a5440f574ab53f018aac51747a77658ae0614a09..95447e60d286546a9360acc346c666dc91707b48 100644 --- a/Noto/Configuration/CDB/alma/Procedures/StationProcedures/StationProcedures.xml +++ b/Noto/Configuration/CDB/alma/Procedures/StationProcedures/StationProcedures.xml @@ -15,8 +15,10 @@ calOff setAttenuation=0,15 setAttenuation=1,5 - ifdist=1,1,44 - ifdist=2,1,32 + ifdist=1,1,-1 + ifdist=2,1,-1 + ifdist=1,-1,16 + ifdist=2,-1,32 </body> </Procedure> @@ -26,14 +28,16 @@ initialize=MMC receiversSetup=MMC servoSetup=SEC - asOn + asOn device=0 calmux=TotalPower calOff setAttenuation=0,0 setAttenuation=1,4 - ifdist=1,1,44 - ifdist=2,1,32 + ifdist=1,1,-1 + ifdist=2,1,-1 + ifdist=1,-1,44 + ifdist=2,-1,32 </body> </Procedure> @@ -43,12 +47,14 @@ initialize=KKC receiversSetup=KKC servoSetup=SEC - asOn + asOn device=0 calmux=TotalPower calOff - ifdist=1,1,44 - ifdist=2,1,32 + ifdist=1,1,-1 + ifdist=2,1,-1 + ifdist=2,-1,34 + ifdist=1,-1,36 </body> </Procedure> @@ -62,8 +68,10 @@ device=0 calmux=TotalPower calOff - ifdist=1,1,44 - ifdist=2,1,32 + ifdist=1,1,-1 + ifdist=2,1,-1 + ifdist=1,-1,44 + ifdist=2,-1,32 </body> </Procedure> @@ -76,9 +84,11 @@ asOn device=0 calmux=TotalPower - calOff - ifdist=1,3,44 - ifdist=2,3,32 + calOff + ifdist=1,3,-1 + ifdist=2,3,-1 + ifdist=1,-1,10 + ifdist=2,-1,10 </body> </Procedure> @@ -91,9 +101,11 @@ asOff device=0 calmux=TotalPower - calOff - ifdist=1,4,44 - ifdist=2,3,32 + calOff + ifdist=1,5,-1 + ifdist=2,3,-1 + ifdist=1,-1,8 + ifdist=2,-1,10 </body> </Procedure> @@ -106,9 +118,11 @@ asOff device=0 calmux=TotalPower - calOff - ifdist=1,2,22 - ifdist=2,2,22 + calOff + ifdist=1,2,-1 + ifdist=2,2,-1 + ifdist=1,-1,44 + ifdist=2,-1,44 </body> </Procedure> @@ -121,9 +135,11 @@ servoSetup=SXP device=0 calmux=TotalPower - calOff - ifdist=1,4,44 - ifdist=2,4,32 + calOff + ifdist=1,4,-1 + ifdist=2,4,-1 + ifdist=1,-1,8 + ifdist=2,-1,8 </body> </Procedure> @@ -136,9 +152,11 @@ asOff device=0 calmux=TotalPower - calOff - ifdist=1,3,44 - ifdist=2,5,32 + calOff + ifdist=1,5,-1 + ifdist=2,3,-1 + ifdist=1,-1,8 + ifdist=2,-1,10 </body> </Procedure> diff --git a/Noto/Configuration/CDB/alma/RECEIVERS/NotoReceivers/NotoReceivers.xml b/Noto/Configuration/CDB/alma/RECEIVERS/NotoReceivers/NotoReceivers.xml index eaeaf8d2a9651a6bda433ce0c4585c5205be4016..fa6d7da85d87781b19243250890a8c465a89ae51 100644 --- a/Noto/Configuration/CDB/alma/RECEIVERS/NotoReceivers/NotoReceivers.xml +++ b/Noto/Configuration/CDB/alma/RECEIVERS/NotoReceivers/NotoReceivers.xml @@ -10,7 +10,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" HPIBIPAddress="192.167.187.201" HPIBPort="1234" - LocalOscillatorInstance="RECEIVERS/LocalOscillator" + LocalOscillatorInstance="" LocalOscillatorEnabledReceivers="KKC QQC CCC MMC" FocusSelectorInterface="IDL:alma/Backends/TotalPower:1.0" > diff --git a/SRT/CDB/alma/MANAGEMENT/ExternalClients/ExternalClients.xml b/SRT/CDB/alma/MANAGEMENT/ExternalClients/ExternalClients.xml index 51fe39ba1ecb5e6cd6c10e85c0504705b715214c..f7302517cedb26e2ac42d433473e079f7a9cdf60 100644 --- a/SRT/CDB/alma/MANAGEMENT/ExternalClients/ExternalClients.xml +++ b/SRT/CDB/alma/MANAGEMENT/ExternalClients/ExternalClients.xml @@ -7,7 +7,7 @@ xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - IPAddress="192.168.200.200" + IPAddress="0.0.0.0" Port="30000" ReceiveTimeout="10000000" ControlThreadPeriod="10000000" diff --git a/SRT/CDB/alma/MANAGEMENT/RFIMonitoring/RFIMonitoring.xml b/SRT/CDB/alma/MANAGEMENT/RFIMonitoring/RFIMonitoring.xml new file mode 100644 index 0000000000000000000000000000000000000000..f868487d0c4fea27d0bf5777902f412ef2905e77 --- /dev/null +++ b/SRT/CDB/alma/MANAGEMENT/RFIMonitoring/RFIMonitoring.xml @@ -0,0 +1,17 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> +<!-- + - History: + - Wed Apr 13 15:18:03 UTC 2005 modified by Carlo Migoni +--> +<RFIMonitoring xmlns="urn:schemas-cosylab-com:RFIMonitoring:1.0" + xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" + xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + IPAddress="0.0.0.0" + Port="40000" + ReceiveTimeout="10000000" + ControlThreadPeriod="10000000" + SuperVisor="Gavino"> + + <status description="The status of the RFI monitoring component" /> +</RFIMonitoring> diff --git a/SRT/Libraries/GAIABoardCommandLibrary/include/GAIABoardCommandLibrary.h b/SRT/Libraries/GAIABoardCommandLibrary/include/GAIABoardCommandLibrary.h new file mode 100644 index 0000000000000000000000000000000000000000..f2a928d4bf6afaceb9be5440d1a5d36dafdc9dfb --- /dev/null +++ b/SRT/Libraries/GAIABoardCommandLibrary/include/GAIABoardCommandLibrary.h @@ -0,0 +1,78 @@ +#ifndef _GAIABOARDCOMMANDLIBRARY_H +#define _GAIABOARDCOMMANDLIBRARY_H + +/** + * GAIABoardCommandLibrary.h + * 2022/02/25 + * Giuseppe Carboni (giuseppe.carboni@inaf.it) + */ + +#include <sstream> + +#define HEADER "#" +#define TAIL "\n" + +/** + * GAIA Board Command Library + * + * This class features static functions used to build commands to be sent to the GAIA Boards + */ +class GAIABoardCommandLibrary +{ +public: + /** + * Builds the command used to ask some info about the GAIA Board and its firmware + * @return the composed message + */ + static std::string idn(); + + /** + * Builds the command used to turn on the Low Noise Amplifiers + * @param channel the channel the command will be sent to + * @return the composed message + */ + static std::string enable(unsigned int channel); + + /** + * Builds the command used to retrieve the gate tension + * @param channel the channel the command will be sent to + * @return the composed message + */ + static std::string getvg(unsigned int channel); + + /** + * Builds the command used to retrieve the drain tension + * @param channel the channel the command will be sent to + * @return the composed message + */ + static std::string getvd(unsigned int channel); + + /** + * Builds the command used to retrieve the drain current draw + * @param channel the channel the command will be sent to + * @return the composed message + */ + static std::string getid(unsigned int channel); + + /** + * Builds the command used to retrieve the reference tensions + * @param channel the channel the command will be sent to + * @return the composed message + */ + static std::string getref(unsigned int channel); + + /** + * Builds the command used to retrieve the temperature of the analog to digital converter + * @param channel the channel the command will be sent to + * @return the composed message + */ + static std::string getemp(unsigned int channel); + + /** + * Builds the command used to retrieve the name of the GAIA Board + * @return the composed message + */ + static std::string name(); +}; + +#endif diff --git a/SRT/Libraries/GAIABoardCommandLibrary/src/GAIABoardCommandLibrary.cpp b/SRT/Libraries/GAIABoardCommandLibrary/src/GAIABoardCommandLibrary.cpp new file mode 100644 index 0000000000000000000000000000000000000000..583e80abe2d50d314a6fd0a0b6168770acb6da7d --- /dev/null +++ b/SRT/Libraries/GAIABoardCommandLibrary/src/GAIABoardCommandLibrary.cpp @@ -0,0 +1,63 @@ +/** + * GAIABoardCommandLibrary.cpp + * 2022/02/25 + * Giuseppe Carboni (giuseppe.carboni@inaf.it) + */ + +#include "GAIABoardCommandLibrary.h" + +std::string GAIABoardCommandLibrary::idn() +{ + std::stringstream command; + command << HEADER << "IDN?" << TAIL; + return command.str(); +} + +std::string GAIABoardCommandLibrary::enable(unsigned int channel) +{ + std::stringstream command; + command << HEADER << "ENABLE " << channel << TAIL; + return command.str(); +} + +std::string GAIABoardCommandLibrary::getvg(unsigned int channel) +{ + std::stringstream command; + command << HEADER << "GETVG " << channel << TAIL; + return command.str(); +} + +std::string GAIABoardCommandLibrary::getvd(unsigned int channel) +{ + std::stringstream command; + command << HEADER << "GETVD " << channel << TAIL; + return command.str(); +} + +std::string GAIABoardCommandLibrary::getid(unsigned int channel) +{ + std::stringstream command; + command << HEADER << "GETID " << channel << TAIL; + return command.str(); +} + +std::string GAIABoardCommandLibrary::getref(unsigned int channel) +{ + std::stringstream command; + command << HEADER << "GETREF " << channel << TAIL; + return command.str(); +} + +std::string GAIABoardCommandLibrary::getemp(unsigned int channel) +{ + std::stringstream command; + command << HEADER << "GETEMP " << channel << TAIL; + return command.str(); +} + +std::string GAIABoardCommandLibrary::name() +{ + std::stringstream command; + command << HEADER << "NAME?" << TAIL; + return command.str(); +} diff --git a/SRT/Libraries/GAIABoardCommandLibrary/src/Makefile b/SRT/Libraries/GAIABoardCommandLibrary/src/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..b9ebdc1a26d8300f3602fdf1c157d39254d81014 --- /dev/null +++ b/SRT/Libraries/GAIABoardCommandLibrary/src/Makefile @@ -0,0 +1,231 @@ + +#******************************************************************************* +# PPPPPPPP +# +# "@(#) $Id$" +# +# Makefile of ........ +# +# who when what +# -------- -------- ---------------------------------------------- +# discos 30/10/20 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 = + +# +# <brief description of xxxxx program> +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 = GAIABoardCommandLibrary +LIBRARIES_L = + +# +# <brief description of lllll library> +GAIABoardCommandLibrary_OBJECTS = GAIABoardCommandLibrary +GAIABoardCommandLibrary_LIBS = + +# +# Scripts (public and local) +# ---------------------------- +SCRIPTS = +SCRIPTS_L = + +# +# TCL scripts (public and local) +# ------------------------------ +TCL_SCRIPTS = +TCL_SCRIPTS_L = + +# +# Python stuff (public and local) +# ---------------------------- +PY_SCRIPTS = +PY_SCRIPTS_L = + +PY_MODULES = +PY_MODULES_L = + +PY_PACKAGES = +PY_PACKAGES_L = +pppppp_MODULES = + +# +# <brief description of tttttt tcl-script> +tttttt_OBJECTS = +tttttt_TCLSH = +tttttt_LIBS = + +# +# TCL libraries (public and local) +# ------------------------------ +TCL_LIBRARIES = +TCL_LIBRARIES_L = + +# +# <brief description of tttlll library> +tttlll_OBJECTS = + +# +# Configuration Database Files +# ---------------------------- +CDB_SCHEMAS = + +# +# 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 + @echo " . . . installation done" + + +#___oOo___ diff --git a/SRT/Libraries/GAIABoardCommandLibrary/tests/.discos b/SRT/Libraries/GAIABoardCommandLibrary/tests/.discos new file mode 100644 index 0000000000000000000000000000000000000000..1ada672a94fe0bc0155145468f693b3e4180735b --- /dev/null +++ b/SRT/Libraries/GAIABoardCommandLibrary/tests/.discos @@ -0,0 +1,5 @@ +This file is here to differentiate between ACS style test directory and discos-style test. + +This is a discos test directory + +DO NOT REMOVE THIS FILE diff --git a/SRT/Libraries/GAIABoardCommandLibrary/tests/Makefile b/SRT/Libraries/GAIABoardCommandLibrary/tests/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..5e06575c78dfabbb1a7392f30f0739c517f68ef4 --- /dev/null +++ b/SRT/Libraries/GAIABoardCommandLibrary/tests/Makefile @@ -0,0 +1,90 @@ +# CPP UNIT TESTING SETUP +#-------------- +GTEST_HOME=/usr/local/include/gtest +GMOCK_HOME=/usr/local/include/gmock +GTEST_LIBS=gtest gtest_main + +USER_INC=-I$(GTEST_HOME) -I$(GMOCK_HOME) +# END OF CPP UNIT TESTING SETUP +#--------------------- + +# DEFINE YOUR CPP UNIT TEST EXECUTABLES HERE as: +# +# EXECTUABLES_L = unittest +# unittest_OBJECTS = unittest +# unittest_LIBS = $(GTEST_LIBS) <ComponentNameImpl> + +EXECUTABLES_L = unittest +unittest_OBJECTS = unittest +unittest_LIBS = $(GTEST_LIBS) GAIABoardCommandLibrary +unittest_LDFLAGS = -lstdc++ -lpthread + +# END OF CUSTOMIZATION +# do not edit below this line +#---------------------------- + +CSOURCENAMES = \ + $(foreach exe, $(EXECUTABLES) $(EXECUTABLES_L), $($(exe)_OBJECTS)) \ + $(foreach rtos, $(RTAI_MODULES) , $($(rtos)_OBJECTS)) \ + $(foreach lib, $(LIBRARIES) $(LIBRARIES_L), $($(lib)_OBJECTS)) + +MAKEDIRTMP := $(shell searchFile include/acsMakefile) +ifneq ($(MAKEDIRTMP),\#error\#) + MAKEDIR := $(MAKEDIRTMP)/include + include $(MAKEDIR)/acsMakefile +endif + +# TEST TARGETS +#TODO: unittest(2) discover pyunit + +do_unit: all + @echo "running cpp unit tests" + ../bin/unittest --gtest_output=xml:results/cppunittest.xml + +do_pyunit: + @echo "running python unit tests" + python -m unittest pyunit + +do_functional: + @echo "running python functional tests" + python -m unittest functional + +do_external: + @echo "running python external tests" + python -m unittest external + +clean_test: + rm -f results/*.xml + rm -f functional/*.pyc + rm -f pyunit/*.pyc + rm -f external/*.pyc + +unit: do_unit + @echo " . . . 'unit' done" + +pyunit: do_pyunit + @echo " . . . 'pyunit' done" + +functional: do_functional + @echo " . . . 'functional' done" + +external: do_external + @echo " . . . 'external' done" + +# TARGETS +# ------- +all: do_all + @echo " . . . 'all' done" + +clean : clean_all clean_test + @echo " . . . clean done" + +clean_dist : clean_all clean_dist_all clean_test + @echo " . . . clean_dist done" + +man : do_man + @echo " . . . man page(s) done" + +install : install_all + @echo " . . . installation done" + diff --git a/SRT/Libraries/GAIABoardCommandLibrary/tests/external/__init__.py b/SRT/Libraries/GAIABoardCommandLibrary/tests/external/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/SRT/Libraries/GAIABoardCommandLibrary/tests/functional/__init__.py b/SRT/Libraries/GAIABoardCommandLibrary/tests/functional/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/SRT/Libraries/GAIABoardCommandLibrary/tests/pyunit/__init__.py b/SRT/Libraries/GAIABoardCommandLibrary/tests/pyunit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/SRT/Libraries/GAIABoardCommandLibrary/tests/unittest.cpp b/SRT/Libraries/GAIABoardCommandLibrary/tests/unittest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5ba815b7193818c43e158c711534faddc1db6799 --- /dev/null +++ b/SRT/Libraries/GAIABoardCommandLibrary/tests/unittest.cpp @@ -0,0 +1,35 @@ +#include "gtest/gtest.h" +#include "GAIABoardCommandLibrary.h" + +TEST(GAIABoardCommandLibraryTest, idn) +{ + EXPECT_EQ(GAIABoardCommandLibrary::idn(), "#IDN?\n"); +} +TEST(GAIABoardCommandLibraryTest, enable) +{ + EXPECT_EQ(GAIABoardCommandLibrary::enable(0), "#ENABLE 0\n"); +} +TEST(GAIABoardCommandLibraryTest, getvg) +{ + EXPECT_EQ(GAIABoardCommandLibrary::getvg(0), "#GETVG 0\n"); +} +TEST(GAIABoardCommandLibraryTest, getvd) +{ + EXPECT_EQ(GAIABoardCommandLibrary::getvd(0), "#GETVD 0\n"); +} +TEST(GAIABoardCommandLibraryTest, getid) +{ + EXPECT_EQ(GAIABoardCommandLibrary::getid(0), "#GETID 0\n"); +} +TEST(GAIABoardCommandLibraryTest, getref) +{ + EXPECT_EQ(GAIABoardCommandLibrary::getref(0), "#GETREF 0\n"); +} +TEST(GAIABoardCommandLibraryTest, getemp) +{ + EXPECT_EQ(GAIABoardCommandLibrary::getemp(0), "#GETEMP 0\n"); +} +TEST(GAIABoardCommandLibraryTest, name) +{ + EXPECT_EQ(GAIABoardCommandLibrary::name(), "#NAME?\n"); +}