diff --git a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc index 660a9608e311c7e97c1e5021e82859f37140f624..b458447aab3690e16c1c0f5adf2bb7816bcb05a4 100644 --- a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc +++ b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc @@ -216,7 +216,7 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface& itsPropertySet->setValue(PN_FSM_ERROR, GCFPVString ("")); itsPropertySet->setValue(PN_MS_OTDB_CONNECTED, GCFPVBool (false)); itsPropertySet->setValue(PN_MS_OTDB_LAST_POLL, GCFPVString ("")); - itsPropertySet->setValue(PN_MS_OTDB_POLLINTERVAL, GCFPVInteger (itsActiveItv)); + itsPropertySet->setValue(PN_MS_OTDB_POLLINTERVAL, GCFPVInteger (itsPlannedItv)); GCFPValueArray emptyArr; itsPropertySet->setValue(PN_MS_ACTIVE_OBSERVATIONS, GCFPVDynArr(LPT_STRING, emptyArr)); itsPropertySet->setValue(PN_MS_PLANNED_OBSERVATIONS, GCFPVDynArr(LPT_STRING, emptyArr)); @@ -580,12 +580,12 @@ void MACScheduler::_updatePlannedList() // get new list (list is ordered on starttime) vector<OTDBtree> plannedDBlist = itsOTDBconnection->getTreeGroup(1, itsPlannedPeriod); // planned observations - if (plannedDBlist.empty()) { - return; - } - LOG_DEBUG(formatString("OTDBCheck:First planned observation is at %s (tree=%d)", + if (!plannedDBlist.empty()) { + LOG_DEBUG(formatString("OTDBCheck:First planned observation is at %s (tree=%d)", to_simple_string(plannedDBlist[0].starttime).c_str(), plannedDBlist[0].treeID())); + } + // NOTE: do not exit routine on emptylist: we need to write an empty list to clear the DB // walk through the list, prepare PVSS for the new obs, update own admin lists. GCFPValueArray plannedArr; @@ -598,7 +598,7 @@ void MACScheduler::_updatePlannedList() while (idx < listSize) { // construct name and timings info for observation treeIDType obsID = plannedDBlist[idx].treeID(); - string obsName(formatString("Observation_%d", obsID)); + string obsName(observationName(obsID)); // must we claim this observation at the claimMgr? OLiter prepIter = itsPreparedObs.find(obsID); @@ -606,7 +606,7 @@ void MACScheduler::_updatePlannedList() // create a ParameterFile for this Observation TreeMaintenance tm(itsOTDBconnection); OTDBnode topNode = tm.getTopNode(obsID); - string filename(formatString("%s/Observation_%d", LOFAR_SHARE_LOCATION, obsID)); + string filename(observationParset(obsID)); if (!tm.exportTree(obsID, topNode.nodeID(), filename)) { LOG_ERROR_STR ("Cannot create ParameterSet '" << filename << "' for new observatio. Observation CANNOT BE STARTED!"); @@ -661,7 +661,7 @@ void MACScheduler::_updateActiveList() vector<OTDBtree> activeDBlist = itsOTDBconnection->getTreeGroup(2, 0); if (activeDBlist.empty()) { LOG_DEBUG ("No active Observations"); - return; + // NOTE: do not exit routine on emptylist: we need to write an empty list to clear the DB } // walk through the list, prepare PVSS for the new obs, update own admin lists. @@ -670,7 +670,7 @@ void MACScheduler::_updateActiveList() uint32 idx = 0; while (idx < listSize) { // construct name and timings info for observation - string obsName(formatString("Observation_%d", activeDBlist[idx].treeID())); + string obsName(observationName(activeDBlist[idx].treeID())); activeArr.push_back(new GCFPVString(obsName)); // remove obs from planned-list if its still their. @@ -682,6 +682,7 @@ void MACScheduler::_updateActiveList() idx++; } // while + // Finally we can pass the list with active observations to PVSS. itsPropertySet->setValue(PN_MS_ACTIVE_OBSERVATIONS, GCFPVDynArr(LPT_DYNSTRING, activeArr)); } @@ -696,7 +697,7 @@ void MACScheduler::_updateFinishedList() vector<OTDBtree> finishedDBlist = itsOTDBconnection->getTreeGroup(3, itsFinishedPeriod); if (finishedDBlist.empty()) { LOG_DEBUG ("No finished Observations"); - return; + // NOTE: do not exit routine on emptylist: we need to write an empty list to clear the DB } // walk through the list, prepare PVSS for the new obs, update own admin lists. @@ -705,12 +706,12 @@ void MACScheduler::_updateFinishedList() uint32 idx = 0; while (idx < listSize) { // construct name and timings info for observation - string obsName(formatString("Observation_%d", finishedDBlist[idx].treeID())); + string obsName(observationName(finishedDBlist[idx].treeID())); finishedArr.push_back(new GCFPVString(obsName)); idx++; } // while - // write those value to PVSS as well. + // Finally we can pass the list with finished observations to PVSS. itsPropertySet->setValue(PN_MS_FINISHED_OBSERVATIONS, GCFPVDynArr(LPT_DYNSTRING, finishedArr)); } diff --git a/MAC/APL/MainCU/src/MACScheduler/MACSchedulerMain.cc b/MAC/APL/MainCU/src/MACScheduler/MACSchedulerMain.cc index 38d373a9631ac0bf593348b35386a660201698f0..d20a78047c7b5b266dde9c4ed16839937c363f31 100644 --- a/MAC/APL/MainCU/src/MACScheduler/MACSchedulerMain.cc +++ b/MAC/APL/MainCU/src/MACScheduler/MACSchedulerMain.cc @@ -31,7 +31,7 @@ using namespace LOFAR::APLCommon; int main(int argc, char* argv[]) { - GCFTask::init(argc, argv); + GCFTask::init(argc, argv, "MACScheduler"); ChildControl* cc = ChildControl::instance(); cc->start(); // make initial transition diff --git a/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc b/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc index c5639bb41ba660b4cca709d04651043a223829f0..cab0f46cac9b68b1c59e5c085da3c4c9ce51b5de 100644 --- a/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc +++ b/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc @@ -40,12 +40,14 @@ #include "MACSchedulerDefines.h" #include "ObsClaimer.h" +#include <boost/date_time/posix_time/posix_time.hpp> using namespace LOFAR::GCF::PVSS; using namespace LOFAR::GCF::TM; using namespace LOFAR::GCF::RTDB; using namespace LOFAR::APL::RTDBCommon; using namespace LOFAR::Deployment; +using namespace boost::posix_time; using namespace std; namespace LOFAR { @@ -216,8 +218,8 @@ GCFEvent::TResult ObsClaimer::preparePVSS_state (GCFEvent& event, GCFPortInterfa RTDBPropertySet* theObsPS = itsCurrentObs->second->propSet; // theObsPS->setValue(PN_OBS_CLAIM_PERIOD, GCFPVInteger(itsClaimPeriod), 0.0, false); // theObsPS->setValue(PN_OBS_PREPARE_PERIOD, GCFPVInteger(itsPreparePeriod), 0.0, false); -// theObsPS->setValue(PN_OBS_START_TIME, GCFPVString (to_simple_string(itsStartTime)), 0.0, false); -// theObsPS->setValue(PN_OBS_STOP_TIME, GCFPVString (to_simple_string(itsStopTime)), 0.0, false); + theObsPS->setValue(PN_OBS_START_TIME, GCFPVString (to_simple_string(from_time_t(theObs.startTime))), 0.0, false); + theObsPS->setValue(PN_OBS_STOP_TIME, GCFPVString (to_simple_string(from_time_t(theObs.stopTime))), 0.0, false); theObsPS->setValue(PN_OBS_BAND_FILTER, GCFPVString (theObs.filter), 0.0, false); theObsPS->setValue(PN_OBS_NYQUISTZONE, GCFPVInteger(theObs.nyquistZone), 0.0, false); theObsPS->setValue(PN_OBS_ANTENNA_ARRAY, GCFPVString (theObs.antennaArray), 0.0, false); diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc index a7b7985331401b34073d6afed3accc4b36b5bdd2..544d3b2a03872934d6b4ca458918971ba9205b28 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc @@ -35,6 +35,7 @@ #include <APL/APLCommon/StationInfo.h> #include <GCF/PVSS/GCF_PVTypes.h> #include <GCF/RTDB/DP_Protocol.ph> +#include <APL/RTDBCommon/CM_Protocol.ph> #include <signal.h> #include "ObservationControl.h" @@ -60,6 +61,7 @@ static ObservationControl* thisObservationControl = 0; ObservationControl::ObservationControl(const string& cntlrName) : GCFTask ((State)&ObservationControl::initial_state,cntlrName), itsPropertySet (0), + itsClaimMgrTask (0), itsChildControl (0), itsChildPort (0), itsParentControl (0), @@ -126,6 +128,10 @@ ObservationControl::ObservationControl(const string& cntlrName) : // need port for timers. itsTimerPort = new GCFTimerPort(*this, "TimerPort"); + // startup claimManager task + itsClaimMgrTask = ClaimMgrTask::instance(); + ASSERTSTR(itsClaimMgrTask, "Can't construct a claimMgrTask"); + registerProtocol (CONTROLLER_PROTOCOL, CONTROLLER_PROTOCOL_STRINGS); registerProtocol (DP_PROTOCOL, DP_PROTOCOL_STRINGS); @@ -175,7 +181,7 @@ void ObservationControl::setState(CTState::CTstateNr newState) LOG_INFO_STR(getName() << " now in state " << cts.name(newState)); if (itsPropertySet) { - itsPropertySet->setValue(string(PVSSNAME_FSM_CURACT), + itsPropertySet->setValue(string(PN_FSM_CURRENT_ACTION), GCFPVString(cts.name(newState))); } @@ -190,53 +196,52 @@ void ObservationControl::setState(CTState::CTstateNr newState) GCFEvent::TResult ObservationControl::initial_state(GCFEvent& event, GCFPortInterface& port) { + static bool firstPass; + LOG_DEBUG_STR ("initial:" << eventName(event) << "@" << port.getName()); GCFEvent::TResult status = GCFEvent::HANDLED; switch (event.signal) { - case F_INIT: - break; + case F_ENTRY: { + itsTimerPort->cancelAllTimers(); + itsTimerPort->setTimer(0.0); + firstPass = true; + } + break; - case F_ENTRY: { - // Create 'Observationxxx' datapoint as top of the observation tree - string propSetName(createPropertySetName(PSN_OBSERVATION, getName())); - LOG_DEBUG_STR ("Activating PropertySet: " << propSetName); - itsBootPS = new RTDBPropertySet(propSetName.c_str(), - PST_OBSERVATION, - PSAT_RW, - this); - } - break; - - case DP_CREATED: { - // NOTE: thsi function may be called DURING the construction of the PropertySet. - // Always exit this event in a way that GCF can end the construction. - DPCreatedEvent dpEvent(event); - LOG_DEBUG_STR("Result of creating " << dpEvent.DPname << " = " << dpEvent.result); - itsTimerPort->cancelAllTimers(); - itsTimerPort->setTimer(0.0); - } - break; - - case F_TIMER: { // must be timer that PropSet has set. - // update PVSS. - LOG_TRACE_FLOW ("top DP of observation created, going to prepDB state"); - TRAN(ObservationControl::prepDB_state); // go to next state. + case F_TIMER: { + if (!firstPass) { + LOG_ERROR_STR("Can't get real name of databasePoint for "<<observationName(itsTreeID)); } - break; - case F_CONNECTED: - break; + // Ask claimMgrTask to get the DPname of this observation + itsClaimMgrTask->claimObject("Observation", + "LOFAR_ObsSW_"+observationName(itsTreeID), port); + // will result in CM_CLAIM_RESULT event + + itsTimerPort->setTimer(10.0); // set emergency timer. + firstPass = false; + } + break; + + case CM_CLAIM_RESULT: { + // TODO: implement error checking and retrying. + CMClaimResultEvent cmEvent(event); + LOG_INFO_STR(cmEvent.nameInAppl << " is mapped to " << cmEvent.DPname); + itsObsDPname = cmEvent.DPname; + itsTimerPort->cancelAllTimers(); +// TRAN(ObservationControl::prepDB_state); // go to next state. + TRAN(ObservationControl::starting_state); // go to next state. + } + break; - case F_DISCONNECTED: - break; - default: LOG_DEBUG_STR ("initial, default"); status = GCFEvent::NOT_HANDLED; - break; + break; } + return (status); } @@ -251,12 +256,13 @@ GCFEvent::TResult ObservationControl::initial_state(GCFEvent& event, GCFEvent::TResult ObservationControl::prepDB_state(GCFEvent& event, GCFPortInterface& port) { + GCFEvent::TResult status = GCFEvent::HANDLED; + +#if 0 uint32 gNrStations = 0; LOG_DEBUG_STR ("prepDB:" << eventName(event) << "@" << port.getName()); - GCFEvent::TResult status = GCFEvent::HANDLED; - switch (event.signal) { case F_INIT: break; @@ -326,6 +332,7 @@ GCFEvent::TResult ObservationControl::prepDB_state(GCFEvent& event, status = GCFEvent::NOT_HANDLED; break; } +#endif return (status); } @@ -386,58 +393,8 @@ GCFEvent::TResult ObservationControl::starting_state(GCFEvent& event, // update PVSS. LOG_TRACE_FLOW ("Updateing state to PVSS"); Observation theObs(globalParameterSet()); - itsPropertySet->setValue(PVSSNAME_FSM_CURACT, GCFPVString("Initial")); - itsPropertySet->setValue(PVSSNAME_FSM_ERROR, GCFPVString("")); - itsPropertySet->setValue(PN_OBSCTRL_CLAIM_PERIOD, GCFPVInteger(itsClaimPeriod)); - itsPropertySet->setValue(PN_OBSCTRL_PREPARE_PERIOD, GCFPVInteger(itsPreparePeriod)); - itsPropertySet->setValue(PN_OBSCTRL_START_TIME, GCFPVString(to_simple_string(itsStartTime))); - itsPropertySet->setValue(PN_OBSCTRL_STOP_TIME, GCFPVString(to_simple_string(itsStopTime))); - itsPropertySet->setValue(PN_OBSCTRL_BAND_FILTER, GCFPVString(theObs.filter)); - itsPropertySet->setValue(PN_OBSCTRL_NYQUISTZONE, GCFPVInteger(theObs.nyquistZone)); - itsPropertySet->setValue(PN_OBSCTRL_ANTENNA_ARRAY, GCFPVString(theObs.antennaArray)); - itsPropertySet->setValue(PN_OBSCTRL_RECEIVER_LIST, GCFPVString( - compactedArrayString(globalParameterSet()-> - getString("Observation.receiverList")))); - itsPropertySet->setValue(PN_OBSCTRL_SAMPLE_CLOCK, GCFPVInteger(theObs.sampleClock)); - itsPropertySet->setValue(PN_OBSCTRL_MEASUREMENT_SET, GCFPVString( - globalParameterSet()->getString("Observation.MSNameMask"))); - itsPropertySet->setValue(PN_OBSCTRL_STATION_LIST, GCFPVString( - compactedArrayString(globalParameterSet()-> - getString("Observation.VirtualInstrument.stationList")))); -// itsPropertySet->setValue(PN_OBSCTRL_INPUT_NODE_LIST, GCFPVString( -// compactedArrayString(globalParameterSet()-> -// getString("Observation.VirtualInstrument.inputNodeList")))); - itsPropertySet->setValue(PN_OBSCTRL_BGL_NODE_LIST, GCFPVString( - compactedArrayString(globalParameterSet()-> - getString("Observation.VirtualInstrument.BGLNodeList")))); - itsPropertySet->setValue(PN_OBSCTRL_STORAGE_NODE_LIST, GCFPVString( - compactedArrayString(globalParameterSet()-> - getString("Observation.VirtualInstrument.storageNodeList")))); - - // for the beams we have to construct dyn arrays first. - GCFPValueArray subbandArr; - GCFPValueArray beamletArr; - GCFPValueArray angle1Arr; - GCFPValueArray angle2Arr; - GCFPValueArray dirTypesArr; - for (uint32 i(0); i < theObs.beams.size(); i++) { - stringstream os; - writeVector(os, theObs.beams[i].subbands); - subbandArr.push_back (new GCFPVString(os.str())); - os.clear(); - writeVector(os, theObs.beams[i].beamlets); - beamletArr.push_back (new GCFPVString(os.str())); - angle1Arr.push_back (new GCFPVDouble(theObs.beams[i].angle1)); - angle2Arr.push_back (new GCFPVDouble(theObs.beams[i].angle2)); - dirTypesArr.push_back (new GCFPVString(theObs.beams[i].directionType)); - } - - // Finally we can write those value to PVSS as well. - itsPropertySet->setValue(PN_OBSCTRL_BEAMS_SUBBAND_LIST, GCFPVDynArr(LPT_DYNSTRING, subbandArr)); - itsPropertySet->setValue(PN_OBSCTRL_BEAMS_BEAMLET_LIST, GCFPVDynArr(LPT_DYNSTRING, beamletArr)); - itsPropertySet->setValue(PN_OBSCTRL_BEAMS_ANGLE1, GCFPVDynArr(LPT_DYNDOUBLE, angle1Arr)); - itsPropertySet->setValue(PN_OBSCTRL_BEAMS_ANGLE2, GCFPVDynArr(LPT_DYNDOUBLE, angle2Arr)); - itsPropertySet->setValue(PN_OBSCTRL_BEAMS_DIRECTION_TYPE, GCFPVDynArr(LPT_DYNSTRING, dirTypesArr)); + itsPropertySet->setValue(PN_FSM_CURRENT_ACTION, GCFPVString("Initial")); + itsPropertySet->setValue(PN_FSM_ERROR, GCFPVString("")); // Start ChildControl task LOG_DEBUG ("Enabling ChildControl task"); @@ -700,8 +657,8 @@ GCFEvent::TResult ObservationControl::finishing_state(GCFEvent& event, itsParentPort->send(msg); // update PVSS - itsPropertySet->setValue(string(PVSSNAME_FSM_CURACT),GCFPVString("Finished")); - itsPropertySet->setValue(string(PVSSNAME_FSM_ERROR),GCFPVString("")); + itsPropertySet->setValue(string(PN_FSM_CURRENT_ACTION),GCFPVString("Finished")); + itsPropertySet->setValue(string(PN_FSM_ERROR),GCFPVString("")); itsTimerPort->setTimer(1L); // give PVSS task some time to update the DB. break; @@ -904,29 +861,28 @@ void ObservationControl::_databaseEventHandler(GCFEvent& event) DPChangedEvent dpEvent(event); // don't watch state and error fields. - if ((strstr(dpEvent.DPname.c_str(), PVSSNAME_FSM_STATE) != 0) || - (strstr(dpEvent.DPname.c_str(), PVSSNAME_FSM_ERROR) != 0) || - (strstr(dpEvent.DPname.c_str(), PVSSNAME_FSM_CURACT) != 0) || - (strstr(dpEvent.DPname.c_str(), PVSSNAME_FSM_LOGMSG) != 0)) { + if ((strstr(dpEvent.DPname.c_str(), PN_FSM_ERROR) != 0) || + (strstr(dpEvent.DPname.c_str(), PN_FSM_CURRENT_ACTION) != 0) || + (strstr(dpEvent.DPname.c_str(), PN_FSM_LOG_MSG) != 0)) { return; } // Change of claim_period? - if (strstr(dpEvent.DPname.c_str(), PN_OBSCTRL_CLAIM_PERIOD) != 0) { + if (strstr(dpEvent.DPname.c_str(), PN_OBS_CLAIM_PERIOD) != 0) { uint32 newVal = ((GCFPVInteger*) (dpEvent.value._pValue))->getValue(); LOG_INFO_STR ("Changing ClaimPeriod from " << itsClaimPeriod << " to " << newVal); itsClaimPeriod = newVal; } // Change of prepare_period? - else if (strstr(dpEvent.DPname.c_str(), PN_OBSCTRL_PREPARE_PERIOD) != 0) { + else if (strstr(dpEvent.DPname.c_str(), PN_OBS_PREPARE_PERIOD) != 0) { uint32 newVal = ((GCFPVInteger*) (dpEvent.value._pValue))->getValue(); LOG_INFO_STR ("Changing PreparePeriod from " << itsPreparePeriod << " to " << newVal); itsPreparePeriod = newVal; } // Change of start or stop time? - if ((strstr(dpEvent.DPname.c_str(), PN_OBSCTRL_START_TIME) != 0) || - (strstr(dpEvent.DPname.c_str(), PN_OBSCTRL_STOP_TIME) != 0)) { + if ((strstr(dpEvent.DPname.c_str(), PN_OBS_START_TIME) != 0) || + (strstr(dpEvent.DPname.c_str(), PN_OBS_STOP_TIME) != 0)) { string newVal = ((GCFPVString*) (dpEvent.value._pValue))->getValue(); ptime newTime; try { @@ -936,7 +892,7 @@ void ObservationControl::_databaseEventHandler(GCFEvent& event) LOG_DEBUG_STR(newVal << " is not a legal time!!!"); return; } - if (strstr(dpEvent.DPname.c_str(), PN_OBSCTRL_START_TIME) != 0) { + if (strstr(dpEvent.DPname.c_str(), PN_OBS_START_TIME) != 0) { LOG_INFO_STR ("Changing startTime from " << to_simple_string(itsStartTime) << " to " << newVal); itsStartTime = newTime; } diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h index 664ac61689231499e65650134e033ff4dd2ccc98..ddc2b94df32c56293c4851bfa7f5c43f9032fef4 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h @@ -27,6 +27,7 @@ #include <MACIO/GCF_Event.h> #include <GCF/TM/GCF_Control.h> #include <GCF/RTDB/RTDB_PropertySet.h> +#include <APL/RTDBCommon/ClaimMgrTask.h> //# local includes #include <APL/APLCommon/Controller_Protocol.ph> @@ -54,6 +55,7 @@ namespace LOFAR { using GCF::TM::GCFPortInterface; using GCF::TM::GCFTask; using GCF::RTDB::RTDBPropertySet; + using APL::RTDBCommon::ClaimMgrTask; using APLCommon::ChildControl; using APLCommon::ParentControl; using APLCommon::CTState; @@ -99,9 +101,11 @@ private: void _disconnectedHandler(GCFPortInterface& port); void _databaseEventHandler(GCFEvent& answer); - RTDBPropertySet* itsPropertySet; - RTDBPropertySet* itsBootPS; - map <string, RTDBPropertySet*> itsStationDPs; + string itsObsDPname; // DPname of ObservationDP + RTDBPropertySet* itsPropertySet; // my own propset. + ClaimMgrTask* itsClaimMgrTask; // for resolving the DPnames +// RTDBPropertySet* itsBootPS; +// map <string, RTDBPropertySet*> itsStationDPs; // pointer to child control task ChildControl* itsChildControl; diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControlDefines.h b/MAC/APL/MainCU/src/ObservationControl/ObservationControlDefines.h index 00f7b2125ac07601bcc4d0f5fdf85b63cf06d715..35ad882a66ae1c1dde0470e5e14cb6252289610d 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControlDefines.h +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControlDefines.h @@ -1,70 +1,296 @@ -//# ObservationControlDefines.h: preprocessor definitions of various constants -//# -//# Copyright (C) 2002-2003 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program 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 General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# -//# $Id$ - -#ifndef OBSERVATIONDEFINES_H -#define OBSERVATIONDEFINES_H - -namespace LOFAR { - namespace MCU { - -#define OC_TASKNAME "ObsCtrl" -#define OC_OBSERVATIONSTATE "observationState" +// This file was generated by create_db_files v1.0 on Mon Jun 23 06:58:37 UTC 2008 -// ObsCtrl -#define PSN_OBS_CTRL "LOFAR_ObsSW_@observation@_ObsCtrl" -#define PST_OBS_CTRL "ObsCtrl" -#define PN_OBSCTRL_CLAIM_PERIOD "claimPeriod" -#define PN_OBSCTRL_PREPARE_PERIOD "preparePeriod" -#define PN_OBSCTRL_START_TIME "startTime" -#define PN_OBSCTRL_STOP_TIME "stopTime" -#define PN_OBSCTRL_BAND_FILTER "bandFilter" -#define PN_OBSCTRL_NYQUISTZONE "nyquistzone" -#define PN_OBSCTRL_ANTENNA_ARRAY "antennaArray" -#define PN_OBSCTRL_RECEIVER_LIST "receiverList" -#define PN_OBSCTRL_SAMPLE_CLOCK "sampleClock" -#define PN_OBSCTRL_MEASUREMENT_SET "measurementSet" -#define PN_OBSCTRL_STATION_LIST "stationList" -#define PN_OBSCTRL_BGL_NODE_LIST "BGLNodeList" -#define PN_OBSCTRL_STORAGE_NODE_LIST "storageNodeList" -#define PN_OBSCTRL_BEAMS_ANGLE1 "Beams.angle1" -#define PN_OBSCTRL_BEAMS_ANGLE2 "Beams.angle2" -#define PN_OBSCTRL_BEAMS_DIRECTION_TYPE "Beams.directionType" -#define PN_OBSCTRL_BEAMS_BEAMLET_LIST "Beams.beamletList" -#define PN_OBSCTRL_BEAMS_SUBBAND_LIST "Beams.subbandList" - - -// next lines should be defined somewhere in Common. -#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" +#ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H +#define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H +// process +#define PN_FSM_PROCESSID "process.processID" +#define PN_FSM_START_TIME "process.startTime" +#define PN_FSM_STOP_TIME "process.stopTime" +#define PN_FSM_LOG_MSG "process.logMsg" +#define PN_FSM_ERROR "process.error" +#define PN_FSM_CURRENT_ACTION "process.currentAction" +// object +#define PN_OBJ_STATE "object.state" +#define PN_OBJ_CHILD_STATE "object.childState" +#define PN_OBJ_MESSAGE "object.message" + +// Station +#define PSN_STATION "LOFAR_PIC_@ring@_@station@" +#define PST_STATION "Station" +#define PN_STS__CHILD_DP "__childDp" + +// MACScheduler +#define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" +#define PST_MAC_SCHEDULER "MACScheduler" +#define PN_MS_PLANNED_OBSERVATIONS "plannedObservations" +#define PN_MS_ACTIVE_OBSERVATIONS "activeObservations" +#define PN_MS_FINISHED_OBSERVATIONS "finishedObservations" +#define PN_MS_OTDB_CONNECTED "OTDB.connected" +#define PN_MS_OTDB_LAST_POLL "OTDB.lastPoll" +#define PN_MS_OTDB_POLLINTERVAL "OTDB.pollinterval" // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" -#define PST_STATION "Station" +#define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" +#define PN_OBS_RECEIVER_BITMAP "receiverBitmap" +#define PN_OBS_CLAIM_PERIOD "claimPeriod" +#define PN_OBS_PREPARE_PERIOD "preparePeriod" +#define PN_OBS_START_TIME "startTime" +#define PN_OBS_STOP_TIME "stopTime" +#define PN_OBS_BAND_FILTER "bandFilter" +#define PN_OBS_NYQUISTZONE "nyquistzone" +#define PN_OBS_ANTENNA_ARRAY "antennaArray" +#define PN_OBS_RECEIVER_LIST "receiverList" +#define PN_OBS_SAMPLE_CLOCK "sampleClock" +#define PN_OBS_MEASUREMENT_SET "measurementSet" +#define PN_OBS_STATION_LIST "stationList" +#define PN_OBS_INPUT_NODE_LIST "inputNodeList" +#define PN_OBS_BGL_NODE_LIST "BGLNodeList" +#define PN_OBS_STORAGE_NODE_LIST "storageNodeList" +#define PN_OBS_BEAMS_ANGLE1 "Beams.angle1" +#define PN_OBS_BEAMS_ANGLE2 "Beams.angle2" +#define PN_OBS_BEAMS_DIRECTION_TYPE "Beams.directionType" +#define PN_OBS_BEAMS_BEAMLET_LIST "Beams.beamletList" +#define PN_OBS_BEAMS_SUBBAND_LIST "Beams.subbandList" + +// ObsCtrl +#define PSN_OBS_CTRL "LOFAR_ObsSW_@observation@_ObsCtrl" +#define PST_OBS_CTRL "ObsCtrl" + +// OnlineCtrl +#define PSN_ONLINE_CTRL "LOFAR_ObsSW_@observation@_OnlineCtrl" +#define PST_ONLINE_CTRL "OnlineCtrl" + +// Correlator +#define PSN_CORRELATOR "LOFAR_ObsSW_@observation@_OnlineCtrl_Correlator" +#define PST_CORRELATOR "Correlator" + +// StorageAppl +#define PSN_STORAGE_APPL "LOFAR_ObsSW_@observation@_OnlineCtrl_StorageAppl" +#define PST_STORAGE_APPL "StorageAppl" + +// Cabinet +#define PSN_CABINET "LOFAR_PIC_@cabinet@" +#define PST_CABINET "Cabinet" +#define PN_CAB_DOOR_OPEN "doorOpen" +#define PN_CAB_FAN "fan" +#define PN_CAB_INLET_TEMP "inletTemp" +#define PN_CAB_FRONT_TEMP "frontTemp" +#define PN_CAB_BACK_TEMP "backTemp" +#define PN_CAB_SETPOINT_TEMP "setpointTemp" +#define PN_CAB_AMBIENT_TEMP "ambientTemp" +#define PN_CAB_CONTROL_MODE "controlMode" + +// SubRack +#define PSN_SUB_RACK "LOFAR_PIC_@cabinet@_@subrack@" +#define PST_SUB_RACK "SubRack" +#define PN_SRCK_SPU__VHBA "SPU.Vhba" +#define PN_SRCK_SPU__VLBA "SPU.Vlba" +#define PN_SRCK_SPU__VDIG "SPU.Vdig" +#define PN_SRCK_SPU_TEMPERATURE "SPU.temperature" +#define PN_SRCK_CLOCK_BOARD__VFSP "clockBoard.Vfsp" +#define PN_SRCK_CLOCK_BOARD__VCLOCK "clockBoard.Vclock" +#define PN_SRCK_CLOCK_BOARD_VERSION "clockBoard.version" +#define PN_SRCK_CLOCK_BOARD_FREQ "clockBoard.freq" +#define PN_SRCK_CLOCK_BOARD_LOCK160 "clockBoard.lock160" +#define PN_SRCK_CLOCK_BOARD_LOCK200 "clockBoard.lock200" +#define PN_SRCK_CLOCK_BOARD_TEMPERATURE "clockBoard.temperature" + +// RSPBoard +#define PSN_RSP_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@RSPBoard@" +#define PST_RSP_BOARD "RSPBoard" +#define PN_RSP_VOLTAGE12 "voltage12" +#define PN_RSP_VOLTAGE25 "voltage25" +#define PN_RSP_VOLTAGE33 "voltage33" +#define PN_RSP_VERSION "version" +#define PN_RSP_ALERT "alert" +#define PN_RSP__ETHERNET_STATUS_STATE "Ethernet.status.state" +#define PN_RSP__ETHERNET_STATUS_CHILD_STATE "Ethernet.status.childState" +#define PN_RSP__ETHERNET_STATUS_MESSAGE "Ethernet.status.message" +#define PN_RSP_ETHERNET_PACKETS_RECEIVED "Ethernet.packetsReceived" +#define PN_RSP_ETHERNET_PACKETS_ERROR "Ethernet.packetsError" +#define PN_RSP_ETHERNET_LAST_ERROR "Ethernet.lastError" +#define PN_RSP_MEP_SEQNR "MEP.seqnr" +#define PN_RSP_MEP_ERROR "MEP.error" +#define PN_RSP_BP_STATUS_STATE "BP.status.state" +#define PN_RSP_BP_STATUS_CHILD_STATE "BP.status.childState" +#define PN_RSP_BP_STATUS_MESSAGE "BP.status.message" +#define PN_RSP_BP_TEMPERATURE "BP.temperature" +#define PN_RSP_BP_VERSION "BP.version" +#define PN_RSP_AP0_STATUS_STATE "AP0.status.state" +#define PN_RSP_AP0_STATUS_CHILD_STATE "AP0.status.childState" +#define PN_RSP_AP0_STATUS_MESSAGE "AP0.status.message" +#define PN_RSP_AP0_TEMPERATURE "AP0.temperature" +#define PN_RSP_AP0_VERSION "AP0.version" +#define PN_RSP_AP0_SYNC_SAMPLE_COUNT "AP0.SYNC.sampleCount" +#define PN_RSP_AP0_SYNC_SYNC_COUNT "AP0.SYNC.syncCount" +#define PN_RSP_AP0_SYNC_ERROR_COUNT "AP0.SYNC.errorCount" +#define PN_RSP_AP1_STATUS_STATE "AP1.status.state" +#define PN_RSP_AP1_STATUS_CHILD_STATE "AP1.status.childState" +#define PN_RSP_AP1_STATUS_MESSAGE "AP1.status.message" +#define PN_RSP_AP1_TEMPERATURE "AP1.temperature" +#define PN_RSP_AP1_VERSION "AP1.version" +#define PN_RSP_AP1_SYNC_SAMPLE_COUNT "AP1.SYNC.sampleCount" +#define PN_RSP_AP1_SYNC_SYNC_COUNT "AP1.SYNC.syncCount" +#define PN_RSP_AP1_SYNC_ERROR_COUNT "AP1.SYNC.errorCount" +#define PN_RSP_AP2_STATUS_STATE "AP2.status.state" +#define PN_RSP_AP2_STATUS_CHILD_STATE "AP2.status.childState" +#define PN_RSP_AP2_STATUS_MESSAGE "AP2.status.message" +#define PN_RSP_AP2_TEMPERATURE "AP2.temperature" +#define PN_RSP_AP2_VERSION "AP2.version" +#define PN_RSP_AP2_SYNC_SAMPLE_COUNT "AP2.SYNC.sampleCount" +#define PN_RSP_AP2_SYNC_SYNC_COUNT "AP2.SYNC.syncCount" +#define PN_RSP_AP2_SYNC_ERROR_COUNT "AP2.SYNC.errorCount" +#define PN_RSP_AP3_STATUS_STATE "AP3.status.state" +#define PN_RSP_AP3_STATUS_CHILD_STATE "AP3.status.childState" +#define PN_RSP_AP3_STATUS_MESSAGE "AP3.status.message" +#define PN_RSP_AP3_TEMPERATURE "AP3.temperature" +#define PN_RSP_AP3_VERSION "AP3.version" +#define PN_RSP_AP3_SYNC_SAMPLE_COUNT "AP3.SYNC.sampleCount" +#define PN_RSP_AP3_SYNC_SYNC_COUNT "AP3.SYNC.syncCount" +#define PN_RSP_AP3_SYNC_ERROR_COUNT "AP3.SYNC.errorCount" + +// RCU +#define PSN_RCU "LOFAR_PIC_@cabinet@_@subrack@_@RSPBoard@_@rcu@" +#define PST_RCU "RCU" +#define PN_RCU_DELAY "Delay" +#define PN_RCU_INPUT_ENABLE "InputEnable" +#define PN_RCU_LBL_ENABLE "LBLEnable" +#define PN_RCU_LBH_ENABLE "LBHEnable" +#define PN_RCU_HBA_ENABLE "HBAEnable" +#define PN_RCU_BAND_SEL_LBA_HBA "bandSelLbaHba" +#define PN_RCU_HBA_FILTER_SEL "HBAFilterSel" +#define PN_RCU_VL_ENABLE "VlEnable" +#define PN_RCU_VH_ENABLE "VhEnable" +#define PN_RCU_VDD_VCC_ENABLE "VddVccEnable" +#define PN_RCU_BAND_SEL_LBL_LBH "bandSelLblLbh" +#define PN_RCU_LBA_FILTER_SEL "LBAFilterSel" +#define PN_RCU_ATTENUATION "Attenuation" +#define PN_RCU_NOF_OVERFLOW "nofOverflow" +#define PN_RCU_ADC_STATISTICS_OVERFLOW "ADCStatistics.overflow" +#define PN_RCU_TBB_ERROR "TBB.error" +#define PN_RCU_TBB_MODE "TBB.mode" +#define PN_RCU_TBB_START_ADDR "TBB.startAddr" +#define PN_RCU_TBB_BUF_SIZE "TBB.bufSize" +#define PN_RCU_TRIGGER_STARTLEVEL "Trigger.startlevel" +#define PN_RCU_TRIGGER_BASELEVEL "Trigger.baselevel" +#define PN_RCU_TRIGGER_STOPLEVEL "Trigger.stoplevel" +#define PN_RCU_TRIGGER_FILTER "Trigger.filter" +#define PN_RCU_TRIGGER_WINDOW "Trigger.window" +#define PN_RCU_TRIGGER_OPERATING_MODE "Trigger.operatingMode" +#define PN_RCU_TRIGGER_COEFF0 "Trigger.coeff0" +#define PN_RCU_TRIGGER_COEFF1 "Trigger.coeff1" +#define PN_RCU_TRIGGER_COEFF2 "Trigger.coeff2" +#define PN_RCU_TRIGGER_COEFF3 "Trigger.coeff3" + +// TBBoard +#define PSN_TB_BOARD "LOFAR_PIC_@cabinet@_@subrack@_@TBBoard@" +#define PST_TB_BOARD "TBBoard" +#define PN_TBB_BOARDID "boardID" +#define PN_TBB_RAM_SIZE "RAMSize" +#define PN_TBB_SW_VERSION "SWVersion" +#define PN_TBB_BOARD_VERSION "boardVersion" +#define PN_TBB_TP_VERSION "TPVersion" +#define PN_TBB_MP0_VERSION "MP0Version" +#define PN_TBB_MP1_VERSION "MP1Version" +#define PN_TBB_MP2_VERSION "MP2Version" +#define PN_TBB_MP3_VERSION "MP3Version" +#define PN_TBB_VOLTAGE12 "voltage12" +#define PN_TBB_VOLTAGE25 "voltage25" +#define PN_TBB_VOLTAGE33 "voltage33" +#define PN_TBB_TEMPPCB "tempPCB" +#define PN_TBB_TEMPTP "tempTP" +#define PN_TBB_TEMPMP0 "tempMP0" +#define PN_TBB_TEMPMP1 "tempMP1" +#define PN_TBB_TEMPMP2 "tempMP2" +#define PN_TBB_TEMPMP3 "tempMP3" +#define PN_TBB_IMAGE_INFO_VERSION "imageInfo.version" +#define PN_TBB_IMAGE_INFO_WRITE_DATE "imageInfo.writeDate" +#define PN_TBB_IMAGE_INFO_TP_FILE "imageInfo.TPFile" +#define PN_TBB_IMAGE_INFO_MP_FILE "imageInfo.MPFile" + +// StationClock +#define PSN_STATION_CLOCK "LOFAR_PIC_StationClock" +#define PST_STATION_CLOCK "StationClock" +#define PN_SCK_CLOCK "clock" + +// LogProcessor +#define PSN_LOG_PROCESSOR "LOFAR_PermSW_Daemons_LogProcessor" +#define PST_LOG_PROCESSOR "LogProcessor" + +// SASGateway +#define PSN_SAS_GATEWAY "LOFAR_PermSW_Daemons_SASGateway" +#define PST_SAS_GATEWAY "SASGateway" + +// HardwareMonitor +#define PSN_HARDWARE_MONITOR "LOFAR_PermSW_HardwareMonitor" +#define PST_HARDWARE_MONITOR "HardwareMonitor" +#define PN_HWM_RSP_CONNECTED "RSP.connected" +#define PN_HWM_TBB_CONNECTED "TBB.connected" + +// SoftwareMonitor +#define PSN_SOFTWARE_MONITOR "LOFAR_PermSW_SoftwareMonitor" +#define PST_SOFTWARE_MONITOR "SoftwareMonitor" + +// TemperatureMonitor +#define PSN_TEMPERATURE_MONITOR "LOFAR_PermSW_TemperatureMonitor" +#define PST_TEMPERATURE_MONITOR "TemperatureMonitor" + +// MACInfoServer +#define PSN_MAC_INFO_SERVER "LOFAR_PermSW_MACInfoServer" +#define PST_MAC_INFO_SERVER "MACInfoServer" + +// StationCtrl +#define PSN_STATION_CTRL "LOFAR_PermSW_StationCtrl" +#define PST_STATION_CTRL "StationCtrl" + +// DigBoardCtrl +#define PSN_DIG_BOARD_CTRL "LOFAR_PermSW_DigBoardCtrl" +#define PST_DIG_BOARD_CTRL "DigBoardCtrl" +#define PN_DBC_CONNECTED "connected" +#define PN_DBC_CLOCK "clock" + +// StnObservation +#define PSN_STN_OBSERVATION "LOFAR_ObsSW_@observation@" +#define PST_STN_OBSERVATION "StnObservation" +#define PN_OBS_NAME "name" +#define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" + +// BeamCtrl +#define PSN_BEAM_CTRL "LOFAR_ObsSW_@observation@_BeamCtrl" +#define PST_BEAM_CTRL "BeamCtrl" +#define PN_BC_CONNECTED "connected" +#define PN_BC_SUB_ARRAY "subArray" +#define PN_BC_SUBBAND_LIST "subbandList" +#define PN_BC_BEAMLET_LIST "beamletList" +#define PN_BC_ANGLE1 "angle1" +#define PN_BC_ANGLE2 "angle2" +#define PN_BC_DIRECTION_TYPE "directionType" +#define PN_BC_BEAM_NAME "beamName" + +// CalCtrl +#define PSN_CAL_CTRL "LOFAR_ObsSW_@observation@_CalCtrl" +#define PST_CAL_CTRL "CalCtrl" +#define PN_CC_CONNECTED "connected" +#define PN_CC_BEAM_NAMES "beamNames" +#define PN_CC_ANTENNA_ARRAY "antennaArray" +#define PN_CC_FILTER "filter" +#define PN_CC_NYQUISTZONE "nyquistzone" +#define PN_CC_RCUS "rcus" -}; // MCU -}; // LOFAR +// TBBCtrl +#define PSN_TBB_CTRL "LOFAR_ObsSW_@observation@_TBBCtrl" +#define PST_TBB_CTRL "TBBCtrl" +#define PN_TBC_CONNECTED "connected" +#define PN_TBC_TRIGGER_RCU_NR "trigger.rcuNr" +#define PN_TBC_TRIGGER_SEQUENCE_NR "trigger.sequenceNr" +#define PN_TBC_TRIGGER_TIME "trigger.time" +#define PN_TBC_TRIGGER_SAMPLE_NR "trigger.sampleNr" +#define PN_TBC_TRIGGER_SUM "trigger.sum" +#define PN_TBC_TRIGGER_NR_SAMPLES "trigger.nrSamples" +#define PN_TBC_TRIGGER_PEAK_VALUE "trigger.peakValue" +#define PN_TBC_TRIGGER_FLAGS "trigger.flags" +#define PN_TBC_TRIGGER_TABLE "trigger.table" #endif