diff --git a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc index ee01f42059eb8f8eb5fda3388fe097873c0f7986..8399e7ab3c2b6ed6b42b11c6d2311c601d6d4e6c 100644 --- a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc +++ b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc @@ -227,7 +227,7 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface& case F_TIMER: { // must be timer that PropSet is enabled. // update PVSS. LOG_TRACE_FLOW ("Updateing state to PVSS"); - itsPropertySet->setValue(PVSSNAME_FSM_STATE, GCFPVString ("initial")); + itsPropertySet->setValue(PVSSNAME_FSM_CURACT, GCFPVString ("initial")); itsPropertySet->setValue(PVSSNAME_FSM_ERROR, GCFPVString ("")); itsPropertySet->setValue(PN_MS_OTDB_CONNECTED, GCFPVBool (false)); itsPropertySet->setValue(PN_MS_OTDB_LAST_POLL, GCFPVString ("")); @@ -292,7 +292,7 @@ GCFEvent::TResult MACScheduler::recover_state(GCFEvent& event, GCFPortInterface& case F_ENTRY: { // update PVSS - itsPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("recover")); + itsPropertySet->setValue(string(PVSSNAME_FSM_CURACT),GCFPVString("recover")); itsPropertySet->setValue(string(PVSSNAME_FSM_ERROR),GCFPVString("")); // @@ -335,7 +335,7 @@ GCFEvent::TResult MACScheduler::active_state(GCFEvent& event, GCFPortInterface& signal (SIGTERM, MACScheduler::sigintHandler); // kill // update PVSS - itsPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("active")); + itsPropertySet->setValue(string(PVSSNAME_FSM_CURACT),GCFPVString("active")); itsPropertySet->setValue(string(PVSSNAME_FSM_ERROR),GCFPVString("")); // Timers must be connected to ports, so abuse serverPort for second timer. @@ -472,7 +472,7 @@ GCFEvent::TResult MACScheduler::finishing_state(GCFEvent& event, GCFPortInterfac case F_ENTRY: { // update PVSS - itsPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("finished")); + itsPropertySet->setValue(string(PVSSNAME_FSM_CURACT),GCFPVString("finished")); itsPropertySet->setValue(string(PVSSNAME_FSM_ERROR),GCFPVString("")); itsTimerPort->setTimer(1L); diff --git a/MAC/APL/MainCU/src/MACScheduler/MACSchedulerDefines.h b/MAC/APL/MainCU/src/MACScheduler/MACSchedulerDefines.h index 6b22576dd13c5c66f29bd2a5edddc8b571a200a0..fb21d4a841bc991964f22f139b65fe67875e9a2d 100644 --- a/MAC/APL/MainCU/src/MACScheduler/MACSchedulerDefines.h +++ b/MAC/APL/MainCU/src/MACScheduler/MACSchedulerDefines.h @@ -39,8 +39,11 @@ namespace LOFAR { #define PVSSNAME_MS_CLAIMPERIOD "ClaimPeriod" // next lines should be defined somewhere in Common. -#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_CURACT "currentAction" #define PVSSNAME_FSM_ERROR "error" +#define PVSSNAME_FSM_LOGMSG "logMsg" +#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_CHILDSTATE "childState" }; // MCU diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc index 583000606b6768b7fe9c7cbde88a71c8036a8425..f0f70dcf54d8f68afca63bd02ad1ed18548374e5 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc @@ -129,11 +129,6 @@ ObservationControl::~ObservationControl() { LOG_TRACE_OBJ_STR (getName() << " destruction"); -// if (itsPropertySet) { -// itsPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("down")); -// itsPropertySet->disable(); -// } - } // @@ -168,7 +163,7 @@ void ObservationControl::setState(CTState::CTstateNr newState) LOG_INFO_STR(getName() << " now in state " << cts.name(newState)); if (itsPropertySet) { - itsPropertySet->setValue(string(PVSSNAME_FSM_STATE), + itsPropertySet->setValue(string(PVSSNAME_FSM_CURACT), GCFPVString(cts.name(newState))); } @@ -222,6 +217,7 @@ void ObservationControl::handlePropertySetAnswer(GCFEvent& answer) // don't watch state and error fields. if ((strstr(pPropAnswer->pPropName, PVSSNAME_FSM_STATE) != 0) || (strstr(pPropAnswer->pPropName, PVSSNAME_FSM_ERROR) != 0) || + (strstr(pPropAnswer->pPropName, PVSSNAME_FSM_CURACT) != 0) || (strstr(pPropAnswer->pPropName, PVSSNAME_FSM_LOGMSG) != 0)) { return; } @@ -368,7 +364,13 @@ GCFEvent::TResult ObservationControl::starting_state(GCFEvent& event, } break; - case F_TIMER: { // must be timer that PropSet has set. + case F_TIMER: { // can be timer that PropSet has set or timer from + // wait period for Child and Parent Control. + if (thisObservationControl == this) { // task timer + TRAN(ObservationControl::active_state); // go to next state. + break; + } + // first redirect signalhandler to finishing state to leave PVSS in the // right state when we are going down. thisObservationControl = this; @@ -377,7 +379,7 @@ GCFEvent::TResult ObservationControl::starting_state(GCFEvent& event, // update PVSS. LOG_TRACE_FLOW ("Updateing state to PVSS"); - itsPropertySet->setValue(PVSSNAME_FSM_STATE, GCFPVString("initial")); + itsPropertySet->setValue(PVSSNAME_FSM_CURACT, GCFPVString("initial")); itsPropertySet->setValue(PVSSNAME_FSM_ERROR, GCFPVString("")); itsPropertySet->setValue(PN_OC_CLAIM_PERIOD, GCFPVInteger(itsClaimPeriod)); itsPropertySet->setValue(PN_OC_PREPARE_PERIOD,GCFPVInteger(itsPreparePeriod)); @@ -414,7 +416,7 @@ GCFEvent::TResult ObservationControl::starting_state(GCFEvent& event, itsPropertySet->setValue(PN_OC_STORAGE_NODE_LIST, GCFPVString( APLUtilities::compactedArrayString(globalParameterSet()-> getString("Observation.VirtualInstrument.storageNodeList")))); - + // Start ChildControl task LOG_DEBUG ("Enabling ChildControl task"); itsChildControl->openService(MAC_SVCMASK_OBSERVATIONCTRL, itsInstanceNr); @@ -424,7 +426,8 @@ GCFEvent::TResult ObservationControl::starting_state(GCFEvent& event, LOG_DEBUG ("Enabling ParentControl task"); itsParentPort = itsParentControl->registerTask(this); - TRAN(ObservationControl::active_state); // go to next state. + itsTimerPort->setTimer(2.0); // wait 2 second for tasks to come up. + } break; @@ -640,7 +643,7 @@ GCFEvent::TResult ObservationControl::finishing_state(GCFEvent& event, itsParentPort->send(msg); // update PVSS - itsPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("finished")); + itsPropertySet->setValue(string(PVSSNAME_FSM_CURACT),GCFPVString("finished")); itsPropertySet->setValue(string(PVSSNAME_FSM_ERROR),GCFPVString("")); itsTimerPort->setTimer(1L); diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControlDefines.h b/MAC/APL/MainCU/src/ObservationControl/ObservationControlDefines.h index 52656c50bd4a77ccf1e0f5ba93e3dc8430f03053..cca423ba9ea739855957107a9e03a8735c65ec7d 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControlDefines.h +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControlDefines.h @@ -1,4 +1,4 @@ -//# MACScheduler_Defines.h: preprocessor definitions of various constants +//# ObservationControlDefines.h: preprocessor definitions of various constants //# //# Copyright (C) 2002-2003 //# ASTRON (Netherlands Foundation for Research in Astronomy) @@ -51,9 +51,11 @@ namespace LOFAR { // next lines should be defined somewhere in Common. -#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_CURACT "currentAction" #define PVSSNAME_FSM_ERROR "error" -#define PVSSNAME_FSM_LOGMSG "logmsg" +#define PVSSNAME_FSM_LOGMSG "logMsg" +#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_CHILDSTATE "childState" // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" diff --git a/MAC/APL/StationCU/src/BeamControl/BeamControl.cc b/MAC/APL/StationCU/src/BeamControl/BeamControl.cc index 06a62bdddb27feae2a6523523be918cbbf8ade6c..e264c9cfac035afff4f397eec88f487862dd5839 100644 --- a/MAC/APL/StationCU/src/BeamControl/BeamControl.cc +++ b/MAC/APL/StationCU/src/BeamControl/BeamControl.cc @@ -143,7 +143,7 @@ void BeamControl::setState(CTState::CTstateNr newState) if (itsPropertySet) { CTState cts; - itsPropertySet->setValue(PVSSNAME_FSM_STATE, GCFPVString(cts.name(newState))); + itsPropertySet->setValue(PVSSNAME_FSM_CURACT, GCFPVString(cts.name(newState))); } } @@ -264,7 +264,7 @@ GCFEvent::TResult BeamControl::initial_state(GCFEvent& event, // update PVSS. LOG_TRACE_FLOW ("Updateing state to PVSS"); - itsPropertySet->setValue(PVSSNAME_FSM_STATE,GCFPVString("initial")); + itsPropertySet->setValue(PVSSNAME_FSM_CURACT,GCFPVString("initial")); itsPropertySet->setValue(PVSSNAME_FSM_ERROR,GCFPVString("")); itsPropertySet->setValue(PN_BC_CONNECTED, GCFPVBool (false)); itsPropertySet->setValue(PN_BC_SUBBANDLIST, GCFPVString("")); @@ -326,7 +326,7 @@ GCFEvent::TResult BeamControl::started_state(GCFEvent& event, GCFPortInterface& switch (event.signal) { case F_ENTRY: { // update PVSS -// itsPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("started")); +// itsPropertySet->setValue(string(PVSSNAME_FSM_CURACT),GCFPVString("started")); itsPropertySet->setValue(PVSSNAME_FSM_ERROR,GCFPVString("")); itsPropertySet->setValue(PN_BC_CONNECTED, GCFPVBool (false)); break; @@ -402,7 +402,7 @@ GCFEvent::TResult BeamControl::claimed_state(GCFEvent& event, GCFPortInterface& switch (event.signal) { case F_ENTRY: { // update PVSS -// itsPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("claimed")); +// itsPropertySet->setValue(string(PVSSNAME_FSM_CURACT),GCFPVString("claimed")); itsPropertySet->setValue(PVSSNAME_FSM_ERROR, GCFPVString("")); break; } @@ -478,7 +478,7 @@ GCFEvent::TResult BeamControl::active_state(GCFEvent& event, GCFPortInterface& p switch (event.signal) { case F_ENTRY: { // update PVSS -// itsPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("active")); +// itsPropertySet->setValue(string(PVSSNAME_FSM_CURACT),GCFPVString("active")); itsPropertySet->setValue(PVSSNAME_FSM_ERROR, GCFPVString("")); break; } @@ -578,7 +578,7 @@ GCFEvent::TResult BeamControl::quiting_state(GCFEvent& event, GCFPortInterface& case F_ENTRY: { // update PVSS setState(CTState::QUIT); -// itsPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("quiting")); +// itsPropertySet->setValue(string(PVSSNAME_FSM_CURACT),GCFPVString("quiting")); itsPropertySet->setValue(PVSSNAME_FSM_ERROR, GCFPVString("")); // disconnect from BeamServer itsBeamServer->close(); diff --git a/MAC/APL/StationCU/src/BeamControl/BeamControlDefines.h b/MAC/APL/StationCU/src/BeamControl/BeamControlDefines.h index 5c2570db0d977c0de411065a4a4cfbb24c9547fd..9e4a5fd9c4a35647a16a7bc82b268f54af564ff9 100644 --- a/MAC/APL/StationCU/src/BeamControl/BeamControlDefines.h +++ b/MAC/APL/StationCU/src/BeamControl/BeamControlDefines.h @@ -40,9 +40,11 @@ namespace LOFAR { #define PN_BC_BEAMID "beamID" // next lines should be defined somewhere in Common. -#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_CURACT "currentAction" #define PVSSNAME_FSM_ERROR "error" -#define PVSSNAME_FSM_LOGMSG "logmsg" +#define PVSSNAME_FSM_LOGMSG "logMsg" +#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_CHILDSTATE "childState" }; // MCU }; // LOFAR diff --git a/MAC/APL/StationCU/src/CalibrationControl/CalibrationControl.cc b/MAC/APL/StationCU/src/CalibrationControl/CalibrationControl.cc index f222370cd237faaff13328956a62012113584587..7ef0bb214bfbf1b51ace3faabadbc76f8287f244 100644 --- a/MAC/APL/StationCU/src/CalibrationControl/CalibrationControl.cc +++ b/MAC/APL/StationCU/src/CalibrationControl/CalibrationControl.cc @@ -136,7 +136,7 @@ void CalibrationControl::setState(CTState::CTstateNr newState) if (itsPropertySet) { CTState cts; - itsPropertySet->setValue(PVSSNAME_FSM_STATE, GCFPVString(cts.name(newState))); + itsPropertySet->setValue(PVSSNAME_FSM_CURACT, GCFPVString(cts.name(newState))); } } @@ -146,16 +146,21 @@ void CalibrationControl::setState(CTState::CTstateNr newState) // int32 CalibrationControl::convertFilterSelection(const string& filterselection) { - if (filterselection == "LBL_10_90") { return(1); } + if (filterselection == "LBL_10_80") { return(1); } if (filterselection == "LBL_30_80") { return(2); } - if (filterselection == "LBH_10_90") { return(3); } + if (filterselection == "LBH_10_80") { return(3); } if (filterselection == "LBH_30_80") { return(4); } if (filterselection == "HB_110_190") { return(5); } if (filterselection == "HB_170_230") { return(6); } + if (filterselection == "HB_210_240") { return(7); } + + // those will become obsolete! + if (filterselection == "LBL_10_90") { return(1); } + if (filterselection == "LBH_10_90") { return(3); } if (filterselection == "HB_210_250") { return(7); } LOG_WARN_STR ("filterselection value '" << filterselection << - "' not recognized, using LBL_10_90"); + "' not recognized, using LBL_10_80"); return (1); } @@ -249,7 +254,7 @@ GCFEvent::TResult CalibrationControl::initial_state(GCFEvent& event, // update PVSS. LOG_TRACE_FLOW ("Updateing state to PVSS"); - itsPropertySet->setValue(PVSSNAME_FSM_STATE,GCFPVString ("initial")); + itsPropertySet->setValue(PVSSNAME_FSM_CURACT,GCFPVString ("initial")); itsPropertySet->setValue(PVSSNAME_FSM_ERROR,GCFPVString ("")); itsPropertySet->setValue(PN_CC_CONNECTED, GCFPVBool (false)); itsPropertySet->setValue(PN_CC_OBSNAME, GCFPVString ("")); @@ -613,6 +618,7 @@ bool CalibrationControl::startCalibration() calStartEvent.rcumode()(0).setMode((RSP_Protocol::RCUSettings::Control::RCUMode) convertFilterSelection(itsObsPar.filter)); // calStartEvent.nyquist_zone = itsObsPar.nyquistZone; + calStartEvent.rcumode()(0).setSpecinv(calStartEvent.rcumode()(0).getNyquistZone() == 2); calStartEvent.subset = itsObsPar.RCUset; LOG_DEBUG(formatString("Sending CALSTART(%s,%s,08X)", obsName.c_str(), calStartEvent.parent.c_str(), diff --git a/MAC/APL/StationCU/src/CalibrationControl/CalibrationControlDefines.h b/MAC/APL/StationCU/src/CalibrationControl/CalibrationControlDefines.h index e190ef2cbf4aae6cf382fa534a981b195b2b07fe..d65bc691d05367f10a86600ba5ecb1eec9c9a95f 100644 --- a/MAC/APL/StationCU/src/CalibrationControl/CalibrationControlDefines.h +++ b/MAC/APL/StationCU/src/CalibrationControl/CalibrationControlDefines.h @@ -40,10 +40,11 @@ namespace LOFAR { #define PROPNAME_FUNCTIONALITY "functionality" // next lines should be defined somewhere in Common. -#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_CURACT "currentAction" #define PVSSNAME_FSM_ERROR "error" -#define PVSSNAME_FSM_LOGMSG "logmsg" - +#define PVSSNAME_FSM_LOGMSG "logMsg" +#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_CHILDSTATE "childState" }; // MCU }; // LOFAR diff --git a/MAC/APL/StationCU/src/DigitalBoardControl/DigitalBoardControl.cc b/MAC/APL/StationCU/src/DigitalBoardControl/DigitalBoardControl.cc index 8beccb2a0ac2a37b51754e69feb49fba78a74b0e..aebe7006a7968b3ed5cbad335000cf3c75ce967d 100644 --- a/MAC/APL/StationCU/src/DigitalBoardControl/DigitalBoardControl.cc +++ b/MAC/APL/StationCU/src/DigitalBoardControl/DigitalBoardControl.cc @@ -186,6 +186,7 @@ void DigitalBoardControl::handlePropertySetAnswer(GCFEvent& answer) // don't watch state and error fields. if ((strstr(pPropAnswer->pPropName, PVSSNAME_FSM_STATE) != 0) || (strstr(pPropAnswer->pPropName, PVSSNAME_FSM_ERROR) != 0) || + (strstr(pPropAnswer->pPropName, PVSSNAME_FSM_CURACT) != 0) || (strstr(pPropAnswer->pPropName, PVSSNAME_FSM_LOGMSG) != 0)) { return; } @@ -279,13 +280,13 @@ myPropSetName=myPropSetName.substr(8); // update PVSS. LOG_TRACE_FLOW ("Updateing state to PVSS"); - itsOwnPropertySet->setValue(PVSSNAME_FSM_STATE,GCFPVString("initial")); + itsOwnPropertySet->setValue(PVSSNAME_FSM_CURACT,GCFPVString("initial")); itsOwnPropertySet->setValue(PVSSNAME_FSM_ERROR,GCFPVString("")); itsOwnPropertySet->setValue(PN_DBC_CONNECTED, GCFPVBool(false)); // Now connect to propertyset that dictates the clocksetting string extPropSetName(createPropertySetName(PSN_STATION_CLOCK, getName())); -extPropSetName= extPropSetName.substr(8); +//extPropSetName= extPropSetName.substr(8); LOG_DEBUG_STR ("Connecting to PropertySet " << extPropSetName); itsExtPropertySet = GCFExtPropertySetPtr( new GCFExtPropertySet(extPropSetName.c_str(), @@ -359,7 +360,7 @@ GCFEvent::TResult DigitalBoardControl::connect_state(GCFEvent& event, case F_ENTRY: case F_TIMER: - itsOwnPropertySet->setValue(PVSSNAME_FSM_STATE, GCFPVString("connecting")); + itsOwnPropertySet->setValue(PVSSNAME_FSM_CURACT, GCFPVString("connecting")); itsOwnPropertySet->setValue(PN_DBC_CONNECTED, GCFPVBool(false)); itsSubscription = 0; itsRSPDriver->open(); // will result in F_CONN or F_DISCONN @@ -410,7 +411,7 @@ GCFEvent::TResult DigitalBoardControl::subscribe_state(GCFEvent& event, case F_ENTRY: case F_TIMER: - itsOwnPropertySet->setValue(PVSSNAME_FSM_STATE,GCFPVString("subscribe on clock")); + itsOwnPropertySet->setValue(PVSSNAME_FSM_CURACT,GCFPVString("subscribe on clock")); requestSubscription(); // will result in RSP_SUBCLOCKACK; break; @@ -463,7 +464,7 @@ GCFEvent::TResult DigitalBoardControl::retrieve_state(GCFEvent& event, case F_ENTRY: case F_TIMER: - itsOwnPropertySet->setValue(PVSSNAME_FSM_STATE,GCFPVString("retrieve clock")); + itsOwnPropertySet->setValue(PVSSNAME_FSM_CURACT,GCFPVString("retrieve clock")); requestClockSetting(); // will result in RSP_GETCLOCKACK; break; @@ -523,7 +524,7 @@ GCFEvent::TResult DigitalBoardControl::setClock_state(GCFEvent& event, case F_ENTRY: case F_TIMER: - itsOwnPropertySet->setValue(PVSSNAME_FSM_STATE,GCFPVString("set clock")); + itsOwnPropertySet->setValue(PVSSNAME_FSM_CURACT,GCFPVString("set clock")); sendClockSetting(); // will result in RSP_SETCLOCKACK; break; @@ -574,7 +575,7 @@ GCFEvent::TResult DigitalBoardControl::active_state(GCFEvent& event, GCFPortInte case F_ENTRY: { // update PVSS - itsOwnPropertySet->setValue(PVSSNAME_FSM_STATE,GCFPVString("active")); + itsOwnPropertySet->setValue(PVSSNAME_FSM_CURACT,GCFPVString("active")); itsOwnPropertySet->setValue(PVSSNAME_FSM_ERROR,GCFPVString("")); break; } @@ -806,7 +807,7 @@ GCFEvent::TResult DigitalBoardControl::finishing_state(GCFEvent& event, GCFPortI case F_ENTRY: { // update PVSS - itsOwnPropertySet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("finished")); + itsOwnPropertySet->setValue(string(PVSSNAME_FSM_CURACT),GCFPVString("finished")); itsOwnPropertySet->setValue(string(PVSSNAME_FSM_ERROR),GCFPVString("")); itsTimerPort->setTimer(1L); diff --git a/MAC/APL/StationCU/src/DigitalBoardControl/DigitalBoardControlDefines.h b/MAC/APL/StationCU/src/DigitalBoardControl/DigitalBoardControlDefines.h index 9e9f1f0e84bfd342083b977e5d3d8ac14d6f8669..16276dc5179c5f9e6249da496e0de22dd2967986 100644 --- a/MAC/APL/StationCU/src/DigitalBoardControl/DigitalBoardControlDefines.h +++ b/MAC/APL/StationCU/src/DigitalBoardControl/DigitalBoardControlDefines.h @@ -32,14 +32,16 @@ namespace LOFAR { #define PN_DBC_CLOCK "clock" // next three line should be defined elsewhere because we are not the owner. -#define PSN_STATION_CLOCK "lofar28:LOFAR_PIC_StationClock" +#define PSN_STATION_CLOCK "LOFAR_PIC_StationClock" #define PST_STATION_CLOCK "StationClock" #define PN_SC_CLOCK "clock" // next lines should be defined somewhere in Common. -#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_CURACT "currentAction" #define PVSSNAME_FSM_ERROR "error" -#define PVSSNAME_FSM_LOGMSG "logmsg" +#define PVSSNAME_FSM_LOGMSG "logMsg" +#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_CHILDSTATE "childState" }; // StationCU diff --git a/MAC/APL/StationCU/src/Makefile.am b/MAC/APL/StationCU/src/Makefile.am index e2071433b4103a5ab0ad1a0aa7046f3833e0f4de..c84087f5f4d78ccb3ae69cfd0170096f6ac379ef 100644 --- a/MAC/APL/StationCU/src/Makefile.am +++ b/MAC/APL/StationCU/src/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = BeamControl CalibrationControl DigitalBoardControl StationControl +SUBDIRS = BeamControl CalibrationControl DigitalBoardControl StationControl HardwareMonitor include $(top_srcdir)/Makefile.common diff --git a/MAC/APL/StationCU/src/StationControl/ActiveObs.cc b/MAC/APL/StationCU/src/StationControl/ActiveObs.cc index 6eeafac86d313d51e273e93cb15a6bb34d51549b..cdcd7d0e4b013266f83ef6f2f759baedef8cbfe0 100644 --- a/MAC/APL/StationCU/src/StationControl/ActiveObs.cc +++ b/MAC/APL/StationCU/src/StationControl/ActiveObs.cc @@ -35,7 +35,7 @@ // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" -#define PST_OBSERVATION "Observation" +#define PST_OBSERVATION "StnObservation" namespace LOFAR { using ACC::APS::ParameterSet; @@ -127,6 +127,7 @@ void ActiveObs::handlePropertySetAnswer(GCFEvent& answer) // don't watch state and error fields. if ((strstr(pPropAnswer->pPropName, PVSSNAME_FSM_STATE) != 0) || (strstr(pPropAnswer->pPropName, PVSSNAME_FSM_ERROR) != 0) || + (strstr(pPropAnswer->pPropName, PVSSNAME_FSM_CURACT) != 0) || (strstr(pPropAnswer->pPropName, PVSSNAME_FSM_LOGMSG) != 0)) { return; } @@ -282,6 +283,14 @@ GCFEvent::TResult ActiveObs::connected(GCFEvent& event, GCFPortInterface& /*port case CONTROL_CLAIM: { // The stationControllerTask should have set the stationclock by now. +#if 0 + // Wait a second to give the RSPDriver time to register the clocksetting + itsPropSetTimer->setTimer(1.5); + } + break; + + case F_TIMER: { +#endif // Activate the Calibration Controller LOG_DEBUG_STR("Asking " << itsCalCntlrName << " to connect to CalServer"); ChildControl::instance()-> @@ -318,9 +327,6 @@ GCFEvent::TResult ActiveObs::connected(GCFEvent& event, GCFPortInterface& /*port TRAN(ActiveObs::stopping); break; - case F_INIT: - break; - default: LOG_DEBUG_STR(itsName << ":default(" << F_EVT_PROTOCOL(event) << "," << F_EVT_SIGNAL(event) << ")"); diff --git a/MAC/APL/StationCU/src/StationControl/StationControl.cc b/MAC/APL/StationCU/src/StationControl/StationControl.cc index 3f2f514ce30212d680adaff685397c83b48a093c..c8d1f24e3439f207df382ae85504c5fb921dfe58 100644 --- a/MAC/APL/StationCU/src/StationControl/StationControl.cc +++ b/MAC/APL/StationCU/src/StationControl/StationControl.cc @@ -189,6 +189,7 @@ void StationControl::handlePropertySetAnswer(GCFEvent& answer) // don't watch state and error fields. if ((strstr(pPropAnswer->pPropName, PVSSNAME_FSM_STATE) != 0) || (strstr(pPropAnswer->pPropName, PVSSNAME_FSM_ERROR) != 0) || + (strstr(pPropAnswer->pPropName, PVSSNAME_FSM_CURACT) != 0) || (strstr(pPropAnswer->pPropName, PVSSNAME_FSM_LOGMSG) != 0)) { return; } @@ -261,7 +262,7 @@ GCFEvent::TResult StationControl::initial_state(GCFEvent& event, // update PVSS. LOG_TRACE_FLOW ("Updateing state to PVSS"); - itsOwnPropSet->setValue(PVSSNAME_FSM_STATE,GCFPVString("initial")); + itsOwnPropSet->setValue(PVSSNAME_FSM_CURACT,GCFPVString("initial")); itsOwnPropSet->setValue(PVSSNAME_FSM_ERROR,GCFPVString("")); // enable clock propertyset. @@ -318,7 +319,7 @@ GCFEvent::TResult StationControl::connect_state(GCFEvent& event, break; case F_ENTRY: { - itsOwnPropSet->setValue(PVSSNAME_FSM_STATE,GCFPVString("connected")); + itsOwnPropSet->setValue(PVSSNAME_FSM_CURACT,GCFPVString("connected")); // start DigitalBoardController LOG_DEBUG_STR("Starting DigitalBoardController"); @@ -403,7 +404,7 @@ GCFEvent::TResult StationControl::operational_state(GCFEvent& event, GCFPortInte case F_ENTRY: { // update PVSS - itsOwnPropSet->setValue(PVSSNAME_FSM_STATE,GCFPVString("active")); + itsOwnPropSet->setValue(PVSSNAME_FSM_CURACT,GCFPVString("active")); itsOwnPropSet->setValue(PVSSNAME_FSM_ERROR,GCFPVString("")); } break; @@ -554,7 +555,7 @@ GCFEvent::TResult StationControl::finishing_state(GCFEvent& event, GCFPortInterf itsParentPort->send(msg); // update PVSS - itsOwnPropSet->setValue(string(PVSSNAME_FSM_STATE),GCFPVString("finished")); + itsOwnPropSet->setValue(string(PVSSNAME_FSM_CURACT),GCFPVString("finished")); itsOwnPropSet->setValue(string(PVSSNAME_FSM_ERROR),GCFPVString("")); itsTimerPort->setTimer(1L); diff --git a/MAC/APL/StationCU/src/StationControl/StationControlDefines.h b/MAC/APL/StationCU/src/StationControl/StationControlDefines.h index 04948a9d0bcdb92c2fa3b8e8994d3be07362ea33..2fb0249a0f12760162f7087ddbe9a0de4a7656a0 100644 --- a/MAC/APL/StationCU/src/StationControl/StationControlDefines.h +++ b/MAC/APL/StationCU/src/StationControl/StationControlDefines.h @@ -36,9 +36,11 @@ namespace LOFAR { #define PST_STATION_CTRL "StationCtrl" // next lines should be defined somewhere in Common. -#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_CURACT "currentAction" #define PVSSNAME_FSM_ERROR "error" -#define PVSSNAME_FSM_LOGMSG "logmsg" +#define PVSSNAME_FSM_LOGMSG "logMsg" +#define PVSSNAME_FSM_STATE "state" +#define PVSSNAME_FSM_CHILDSTATE "childState" }; // StationCU