diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc index a2faa668786281505027c86f57a22fcafa56c393..8127b683a13f9a6a76f5c7bae35abf3de6fc11cb 100644 --- a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc +++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc @@ -39,6 +39,7 @@ #include <GCF/PVSS/GCF_PVTypes.h> #include <GCF/PVSS/PVSSservice.h> #include <GCF/RTDB/DP_Protocol.ph> +#include <GCF/RTDB/DPservice.h> #include <APL/APLCommon/APL_Defines.h> #include <APL/APLCommon/APLUtilities.h> #include <APL/APLCommon/ControllerDefines.h> @@ -529,6 +530,8 @@ GCFEvent::TResult OnlineControl::finishing_state(GCFEvent& event, GCFPortInterfa // uint32 OnlineControl::_startApplications() { + _clearCobaltDatapoints(); + ParameterSet* thePS = globalParameterSet(); // shortcut to global PS. // Get list of all application that should be managed @@ -659,6 +662,142 @@ void OnlineControl::_stopApplications() LOG_INFO_STR ("Result of command = " << result); } +// +// _clearCobaltDatapoints() +// +void OnlineControl::_clearCobaltDatapoints() +{ + ParameterSet* thePS = globalParameterSet(); // shortcut to global PS. + + // create a datapoint service for clearing all the datapoints + DPservice* myDPservice = new DPservice(this); + if (!myDPservice) { + LOG_ERROR_STR("Can't allocate DPservice to PVSS to clear Cobalt values! Navigator contents no longer guaranteed"); + return; + } + + // _DPname=LOFAR_ObsSW_TempObs0185 + string DPbasename(thePS->getString("_DPname", "NO_DPNAME_IN_PARSET")); + + // OSCBT<000>_CobaltGPUProc<00> for 001-009 and 00-01 + string propSetNameMask(createPropertySetName(PSN_COBALTGPU_PROC, getName(), DPbasename)); + // prepare 'cleared value set' + vector<string> fields; + vector<GCFPValue*> values; + fields.push_back(PN_CGP_OBSERVATION_NAME); + fields.push_back(PN_CGP_DATA_PRODUCT_TYPE); + fields.push_back(PN_CGP_SUBBAND); + fields.push_back(PN_CGP_DROPPING); + fields.push_back(PN_CGP_WRITTEN); + fields.push_back(PN_CGP_DROPPED); + GCFPValueArray emptyArr; + values.push_back(new GCFPVString("")); + values.push_back(new GCFPVString("")); + values.push_back(new GCFPVDynArr(LPT_DYNINTEGER, emptyArr)); + values.push_back(new GCFPVDynArr(LPT_DYNBOOL, emptyArr)); + values.push_back(new GCFPVDynArr(LPT_DYNDOUBLE, emptyArr)); + values.push_back(new GCFPVDynArr(LPT_DYNDOUBLE, emptyArr)); + for (int nodeNr = 1; nodeNr <= 9; ++nodeNr) { + for (int gpuNr = 0; gpuNr <= 1; ++gpuNr) { + string DPname(formatString(propSetNameMask.c_str(), nodeNr, gpuNr)); + LOG_DEBUG_STR("Clearing " << DPname); + + PVSSresult result = myDPservice->setValue(DPname, fields, values, 0.0, false); + if (result != SA_NO_ERROR) { + LOG_WARN_STR("Call to PVSS for setValue for " << DPname << " returned: " << result); + } + } + } + // free allocated GCFValues. + for (int i = values.size()-1 ; i >= 0; i--) { + delete values[i]; + } + values.clear(); + fields.clear(); + + + // CobaltOutputProc + string DPname(createPropertySetName(PSN_COBALT_OUTPUT_PROC, getName(), DPbasename)); + // prepare 'cleared value set' + fields.push_back(PN_COP_LOCUS_NODE); + fields.push_back(PN_COP_DATA_PRODUCT_TYPE); + fields.push_back(PN_COP_FILE_NAME); + fields.push_back(PN_COP_DIRECTORY); + fields.push_back(PN_COP_DROPPING); + fields.push_back(PN_COP_WRITTEN); + fields.push_back(PN_COP_DROPPED); + values.push_back(new GCFPVDynArr(LPT_DYNINTEGER, emptyArr)); + values.push_back(new GCFPVDynArr(LPT_DYNSTRING, emptyArr)); + values.push_back(new GCFPVDynArr(LPT_DYNSTRING, emptyArr)); + values.push_back(new GCFPVDynArr(LPT_DYNSTRING, emptyArr)); + values.push_back(new GCFPVDynArr(LPT_DYNBOOL, emptyArr)); + values.push_back(new GCFPVDynArr(LPT_DYNDOUBLE, emptyArr)); + values.push_back(new GCFPVDynArr(LPT_DYNDOUBLE, emptyArr)); + + LOG_DEBUG_STR("Clearing " << DPname); + PVSSresult result = myDPservice->setValue(DPname, fields, values, 0.0, false); + if (result != SA_NO_ERROR) { + LOG_WARN_STR("Call to PVSS for setValue for " << DPname << " returned: " << result); + } + // free allocated GCFValues. + for (int i = values.size()-1 ; i >= 0; i--) { + delete values[i]; + } + values.clear(); + fields.clear(); + + + // CS<000><xBAy>_CobaltStationInput + propSetNameMask = createPropertySetName(PSN_COBALT_STATION_INPUT, getName(), DPbasename); + // LOFAR_PermSW_@stationfield@_CobaltStationInput --> @stationfield@ := %s + // prepare 'cleared value set' + fields.push_back(PN_CSI_NODE); + fields.push_back(PN_CSI_CPU); + fields.push_back(PN_CSI_OBSERVATION_NAME); + fields.push_back(PN_CSI_STREAM0_BLOCKS_IN); + fields.push_back(PN_CSI_STREAM0_REJECTED); + fields.push_back(PN_CSI_STREAM1_BLOCKS_IN); + fields.push_back(PN_CSI_STREAM1_REJECTED); + fields.push_back(PN_CSI_STREAM2_BLOCKS_IN); + fields.push_back(PN_CSI_STREAM2_REJECTED); + fields.push_back(PN_CSI_STREAM3_BLOCKS_IN); + fields.push_back(PN_CSI_STREAM3_REJECTED); + values.push_back(new GCFPVString("")); + values.push_back(new GCFPVInteger(0)); + values.push_back(new GCFPVString("")); + for (int i = 0; i < 8; ++i) { + values.push_back(new GCFPVInteger(0)); + } + const string AntFields[] = {"LBA", "HBA", "HBA0", "HBA1" }; + string ObsLocation(globalParameterSet()->fullModuleName("Observation")); + vector<string> stationList(globalParameterSet()->getStringVector(ObsLocation+".VirtualInstrument.stationList")); + int firstAF = (globalParameterSet()->getString(ObsLocation+".antennaArray") == "LBA") ? 0 : 1; + vector<string>::const_iterator iter = stationList.begin(); + vector<string>::const_iterator end = stationList.end(); + while (iter != end) { + int nrAFs2Clean = 1 + ((firstAF>0 && iter->substr(0,2)=="CS") ? 2 : 0); + for (int AFindex = firstAF; AFindex < firstAF+nrAFs2Clean; ++AFindex) { + string stationField(*iter + AntFields[AFindex]); // eg. CS001 + LBA + string DPname(formatString(propSetNameMask.c_str(), stationField.c_str())); + LOG_DEBUG_STR("Clearing " << DPname); + + PVSSresult result = myDPservice->setValue(DPname, fields, values, 0.0, false); + if (result != SA_NO_ERROR) { + LOG_WARN_STR("Call to PVSS for setValue for " << DPname << " returned: " << result); + } + } // for + ++iter; + } + // free allocated GCFValues. + for (int i = values.size()-1 ; i >= 0; i--) { + delete values[i]; + } + values.clear(); + fields.clear(); + + delete myDPservice; +} + // // _passMetadatToOTDB(); // THIS ROUTINE IS A MODIFIED COPY FROM PYTHONCONTROL.CC diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h index 2e8a73629cf3f053a531ecfd3806675177e97647..3fda39dc026f130746e587e67e6611f2a79e5ec2 100644 --- a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h +++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.h @@ -95,6 +95,7 @@ private: void _setState (CTState::CTstateNr newState); void _databaseEventHandler(GCFEvent& event); void _passMetadatToOTDB (); + void _clearCobaltDatapoints(); // ----- datamembers ----- string itsMyName; diff --git a/MAC/APL/CEPCU/src/OnlineControl/PVSSDatapointDefs.h b/MAC/APL/CEPCU/src/OnlineControl/PVSSDatapointDefs.h index 83d7b1b0fc9f9d33d0ac92f20a247600567bd5e2..74b3ba04eea4920b42a394327b0634af946046c0 100644 --- a/MAC/APL/CEPCU/src/OnlineControl/PVSSDatapointDefs.h +++ b/MAC/APL/CEPCU/src/OnlineControl/PVSSDatapointDefs.h @@ -1,7 +1,8 @@ -// This file was generated by create_db_files v2.0 on Wed Dec 12 12:38:36 UTC 2012 +// This file was generated by create_db_files v2.0 on Wed Aug 20 13:09:19 UTC 2014 #ifndef LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H #define LOFAR_DEPLOYMENT_PVSSDATAPOINTS_H + // process #define PN_FSM_PROCESSID "process.processID" #define PN_FSM_START_TIME "process.startTime" @@ -9,11 +10,8 @@ #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" -#define PN_OBJ_LEAF "object.leaf" // MACScheduler #define PSN_MAC_SCHEDULER "LOFAR_PermSW_MACScheduler" @@ -32,8 +30,6 @@ // Observation #define PSN_OBSERVATION "LOFAR_ObsSW_@observation@" #define PST_OBSERVATION "Observation" -#define PN_OBS_CLAIM_CLAIM_DATE "claim.claimDate" -#define PN_OBS_CLAIM_NAME "claim.name" #define PN_OBS_CLAIM_PERIOD "claimPeriod" #define PN_OBS_PREPARE_PERIOD "preparePeriod" #define PN_OBS_START_TIME "startTime" @@ -68,64 +64,6 @@ #define PST_OBSERVATION_CONTROL "ObservationControl" #define PN_OBSCTRL_COMMAND "command" -// InputBuffer -#define PSN_INPUT_BUFFER "LOFAR_PermSW_@psionode@_InputBuffer" -#define PST_INPUT_BUFFER "InputBuffer" -#define PN_IPB_STATION_NAME "stationName" -#define PN_IPB_OBSERVATION_NAME "observationName" -#define PN_IPB_STREAM0_BLOCKS_IN "stream0.blocksIn" -#define PN_IPB_STREAM0_PERC_BAD "stream0.percBad" -#define PN_IPB_STREAM0_REJECTED "stream0.rejected" -#define PN_IPB_STREAM1_BLOCKS_IN "stream1.blocksIn" -#define PN_IPB_STREAM1_PERC_BAD "stream1.percBad" -#define PN_IPB_STREAM1_REJECTED "stream1.rejected" -#define PN_IPB_STREAM2_BLOCKS_IN "stream2.blocksIn" -#define PN_IPB_STREAM2_PERC_BAD "stream2.percBad" -#define PN_IPB_STREAM2_REJECTED "stream2.rejected" -#define PN_IPB_STREAM3_BLOCKS_IN "stream3.blocksIn" -#define PN_IPB_STREAM3_PERC_BAD "stream3.percBad" -#define PN_IPB_STREAM3_REJECTED "stream3.rejected" -#define PN_IPB_LATE "late" -#define PN_IPB_IO_TIME "IOTime" - -// Adder -#define PSN_ADDER "LOFAR_ObsSW_@osionode@_@adder@" -#define PST_ADDER "Adder" -#define PN_ADD_DROPPING "dropping" -#define PN_ADD_DROPPED "dropped" -#define PN_ADD_DATA_PRODUCT_TYPE "dataProductType" -#define PN_ADD_DATA_PRODUCT "dataProduct" -#define PN_ADD_FILE_NAME "fileName" -#define PN_ADD_LOCUS_NODE "locusNode" -#define PN_ADD_WRITER "writer" -#define PN_ADD_DIRECTORY "directory" -#define PN_ADD_OBSERVATION_NAME "observationName" - -// Writer -#define PSN_WRITER "LOFAR_ObsSW_@oslocusnode@_@writer@" -#define PST_WRITER "Writer" -#define PN_WTR_WRITTEN "written" -#define PN_WTR_DROPPED "dropped" -#define PN_WTR_FILE_NAME "fileName" -#define PN_WTR_DATA_RATE "dataRate" -#define PN_WTR_DATA_PRODUCT_TYPE "dataProductType" -#define PN_WTR_OBSERVATION_NAME "observationName" - -// IONode -#define PSN_IO_NODE "LOFAR_PIC_BGP_@midplane@_@ionode@" -#define PST_IO_NODE "IONode" -#define PN_ION_STATION0 "station0" -#define PN_ION_IP0 "IP0" -#define PN_ION_MAC0 "MAC0" -#define PN_ION_STATION1 "station1" -#define PN_ION_IP1 "IP1" -#define PN_ION_MAC1 "MAC1" -#define PN_ION_MAC_FOREIGN "MACForeign" -#define PN_ION_USE2ND_STATION "use2ndStation" -#define PN_ION_USED_STATION "usedStation" -#define PN_ION_USEDIP "usedIP" -#define PN_ION_USEDMAC "usedMAC" - // LocusNode #define PSN_LOCUS_NODE "LOFAR_PIC_@osrack@_@locusnode@" #define PST_LOCUS_NODE "LocusNode" @@ -136,22 +74,59 @@ // CEPHardwareMonitor #define PSN_CEP_HARDWARE_MONITOR "LOFAR_PermSW_CEPHardwareMonitor" #define PST_CEP_HARDWARE_MONITOR "CEPHardwareMonitor" -#define PN_CHM_BGP_CONNECTED "BGP.connected" +#define PN_CHM_COBALT_CONNECTED "Cobalt.connected" #define PN_CHM_CLUSTER_CONNECTED "Cluster.connected" // OnlineControl #define PSN_ONLINE_CONTROL "LOFAR_ObsSW_@observation@_OnlineControl" #define PST_ONLINE_CONTROL "OnlineControl" -// BGPAppl -#define PSN_BGP_APPL "LOFAR_ObsSW_@observation@_OnlineControl_BGPAppl" -#define PST_BGP_APPL "BGPAppl" -#define PN_BGPA_IO_NODE_LIST "ioNodeList" -#define PN_BGPA_ADDER_LIST "adderList" -#define PN_BGPA_LOCUS_NODE_LIST "locusNodeList" -#define PN_BGPA_WRITER_LIST "writerList" -#define PN_BGPA_DATA_PRODUCT_LIST "dataProductList" -#define PN_BGPA_DATA_PRODUCT_TYPE_LIST "dataProductTypeList" +// CobaltNIC +#define PSN_COBALTNIC "LOFAR_PIC_Cobalt_@cobaltnode@_@cobaltnic@" +#define PST_COBALTNIC "CobaltNIC" +#define PN_CNI_NODE "Node" +#define PN_CNI_CPU "CPU" +#define PN_CNI_INTERFACE "Interface" +#define PN_CNI_MAC "MAC" +#define PN_CNI_STATION_LIST "stationList" +#define PN_CNI_RSP_LIST "RSPList" +#define PN_CNI_IP_LIST "IPList" + +// CobaltStationInput +#define PSN_COBALT_STATION_INPUT "LOFAR_PermSW_@stationfield@_CobaltStationInput" +#define PST_COBALT_STATION_INPUT "CobaltStationInput" +#define PN_CSI_NODE "Node" +#define PN_CSI_CPU "CPU" +#define PN_CSI_OBSERVATION_NAME "observationName" +#define PN_CSI_STREAM0_BLOCKS_IN "stream0.blocksIn" +#define PN_CSI_STREAM0_REJECTED "stream0.rejected" +#define PN_CSI_STREAM1_BLOCKS_IN "stream1.blocksIn" +#define PN_CSI_STREAM1_REJECTED "stream1.rejected" +#define PN_CSI_STREAM2_BLOCKS_IN "stream2.blocksIn" +#define PN_CSI_STREAM2_REJECTED "stream2.rejected" +#define PN_CSI_STREAM3_BLOCKS_IN "stream3.blocksIn" +#define PN_CSI_STREAM3_REJECTED "stream3.rejected" + +// CobaltGPUProc +#define PSN_COBALTGPU_PROC "LOFAR_ObsSW_@observation@_@oscobaltnode@_@cobaltgpuproc@" +#define PST_COBALTGPU_PROC "CobaltGPUProc" +#define PN_CGP_OBSERVATION_NAME "observationName" +#define PN_CGP_DATA_PRODUCT_TYPE "dataProductType" +#define PN_CGP_SUBBAND "subband" +#define PN_CGP_DROPPING "dropping" +#define PN_CGP_WRITTEN "written" +#define PN_CGP_DROPPED "dropped" + +// CobaltOutputProc +#define PSN_COBALT_OUTPUT_PROC "LOFAR_ObsSW_@observation@_CobaltOutputProc" +#define PST_COBALT_OUTPUT_PROC "CobaltOutputProc" +#define PN_COP_LOCUS_NODE "locusNode" +#define PN_COP_DATA_PRODUCT_TYPE "dataProductType" +#define PN_COP_FILE_NAME "fileName" +#define PN_COP_DIRECTORY "directory" +#define PN_COP_DROPPING "dropping" +#define PN_COP_WRITTEN "written" +#define PN_COP_DROPPED "dropped" // Cabinet #define PSN_CABINET "LOFAR_PIC_@cabinet@" @@ -181,18 +156,10 @@ // SubRack #define PSN_SUB_RACK "LOFAR_PIC_@cabinet@_@subrack@" #define PST_SUB_RACK "SubRack" -#define PN_SRCK_SPU_STATUS_STATE "SPU.status.state" -#define PN_SRCK_SPU_STATUS_CHILD_STATE "SPU.status.childState" -#define PN_SRCK_SPU_STATUS_MESSAGE "SPU.status.message" -#define PN_SRCK_SPU_STATUS_LEAF "SPU.status.leaf" #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_STATUS_STATE "clockBoard.status.state" -#define PN_SRCK_CLOCK_BOARD_STATUS_CHILD_STATE "clockBoard.status.childState" -#define PN_SRCK_CLOCK_BOARD_STATUS_MESSAGE "clockBoard.status.message" -#define PN_SRCK_CLOCK_BOARD_STATUS_LEAF "clockBoard.status.leaf" #define PN_SRCK_CLOCK_BOARD__VFSP "clockBoard.Vfsp" #define PN_SRCK_CLOCK_BOARD__VCLOCK "clockBoard.Vclock" #define PN_SRCK_CLOCK_BOARD_VERSION "clockBoard.version" @@ -212,52 +179,28 @@ #define PN_RSP_BITMODE_CAPABILITY "bitmodeCapability" #define PN_RSP_ALERT "alert" #define PN_RSP_SPLITTER_ON "splitterOn" -#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_STATUS_LEAF "Ethernet.status.leaf" #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_STATUS_LEAF "BP.status.leaf" #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_STATUS_LEAF "AP0.status.leaf" #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_STATUS_LEAF "AP1.status.leaf" #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_STATUS_LEAF "AP2.status.leaf" #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_STATUS_LEAF "AP3.status.leaf" #define PN_RSP_AP3_TEMPERATURE "AP3.temperature" #define PN_RSP_AP3_VERSION "AP3.version" #define PN_RSP_AP3_SYNC_SAMPLE_COUNT "AP3.SYNC.sampleCount" @@ -282,6 +225,7 @@ #define PN_RCU_ATTENUATION "Attenuation" #define PN_RCU_NOF_OVERFLOW "nofOverflow" #define PN_RCU_ADC_STATISTICS_OVERFLOW "ADCStatistics.overflow" +#define PN_RCU_ANTENNAS "antennas" #define PN_RCU_TBB_ERROR "TBB.error" #define PN_RCU_TBB_MODE "TBB.mode" #define PN_RCU_TBB_START_ADDR "TBB.startAddr" @@ -323,11 +267,34 @@ #define PN_TBB_TEMPMP1 "tempMP1" #define PN_TBB_TEMPMP2 "tempMP2" #define PN_TBB_TEMPMP3 "tempMP3" +#define PN_TBB_RECORDING "recording" #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" +// UniBoard +#define PSN_UNI_BOARD "LOFAR_PIC_Cabinet1_UniBoard" +#define PST_UNI_BOARD "UniBoard" +#define PN_UNI_POWER "power" +#define PN_UNI_ETH_TEMP "ethTemp" +#define PN_UNI_CURRENT "current" +#define PN_UNI_VOLTAGE "voltage" +#define PN_UNI_E2C_ERROR "e2cError" + +// FPGA +#define PSN_FPGA "LOFAR_PIC_Cabinet1_UniBoard_@fpga@" +#define PST_FPGA "FPGA" +#define PN_FPGA_FIRM_NAME "firmName" +#define PN_FPGA_FIRM_VERSION "firmVersion" +#define PN_FPGA_HW_VERSION "hwVersion" +#define PN_FPGA_HIGH_TEMP "highTemp" +#define PN_FPGA_FPGA_TEMP "fpgaTemp" + +// UriBoard +#define PSN_URI_BOARD "LOFAR_PIC_@uriboard@" +#define PST_URI_BOARD "UriBoard" + // LBAAntenna #define PSN_LBA_ANTENNA "LOFAR_PIC_@lbaantenna@" #define PST_LBA_ANTENNA "LBAAntenna" @@ -346,6 +313,7 @@ #define PN_STI_N_HBAS "N_HBAS" #define PN_STI_HBA__SPLIT "HBA_Split" #define PN_STI_WIDE_LBAS "wide_LBAS" +#define PN_STI_AARTFAAC "AARTFAAC" #define PN_STI_POWER48_ON "power48On" #define PN_STI_POWER220_ON "power220On" #define PN_STI_DATASTREAM0 "datastream0" @@ -353,6 +321,8 @@ #define PN_STI_CABINET_X "Cabinet.X" #define PN_STI_CABINET_Y "Cabinet.Y" #define PN_STI_CABINET_Z "Cabinet.Z" +#define PN_STI_HBA_NR_BROKEN "HBA.nrBroken" +#define PN_STI_HBA_NR_BROKEN_ARCHIVE "HBA.nrBrokenArchive" #define PN_STI_HBA_CENTERX "HBA.centerX" #define PN_STI_HBA_CENTERY "HBA.centerY" #define PN_STI_HBA_CENTERZ "HBA.centerZ" @@ -376,6 +346,8 @@ #define PN_STI_HBA_HBA1__ROTATION_MATRIX_Y "HBA.HBA1.RotationMatrix.Y" #define PN_STI_HBA_HBA1__ROTATION_MATRIX_Z "HBA.HBA1.RotationMatrix.Z" #define PN_STI_HBA_HBA1_ROTATION "HBA.HBA1.rotation" +#define PN_STI_LBA_NR_BROKEN "LBA.nrBroken" +#define PN_STI_LBA_NR_BROKEN_ARCHIVE "LBA.nrBrokenArchive" #define PN_STI_LBA_CENTERX "LBA.centerX" #define PN_STI_LBA_CENTERY "LBA.centerY" #define PN_STI_LBA_CENTERZ "LBA.centerZ" @@ -428,8 +400,6 @@ #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" -#define PN_OBS_CLAIM_NAME "claim.name" #define PN_OBS_RECEIVER_BITMAP "receiverBitmap" #define PN_OBS_HBA_BITMAP "HBABitmap" #define PN_OBS_LBA_BITMAP "LBABitmap" diff --git a/MAC/GCF/PVSS/src/PVSSservice.cc b/MAC/GCF/PVSS/src/PVSSservice.cc index 458ff12716cbaad75b3d47186fa1bc6cfef0c802..53ad7269e7a2c43c5a9de2f0098cd91ec0299fb5 100644 --- a/MAC/GCF/PVSS/src/PVSSservice.cc +++ b/MAC/GCF/PVSS/src/PVSSservice.cc @@ -863,7 +863,7 @@ PVSSresult PVSSservice::dpeSet(const string& dpeName, ASSERT(itsSCADAHandler); // DB must be active if ((result = itsSCADAHandler->isOperational()) != SA_NO_ERROR) { - LOG_FATAL(formatString("Unable to set value of property: '%s'", dpeName.c_str())); + LOG_FATAL(formatString("Unable to set value of property: '%s' -> database down", dpeName.c_str())); } // Property must exist else if (!PVSSinfo::propExists(dpeName)) { @@ -871,10 +871,10 @@ PVSSresult PVSSservice::dpeSet(const string& dpeName, result = SA_PROP_DOES_NOT_EXIST; } else if ((result = getDpId(pvssDpName, dpId)) != SA_NO_ERROR) { - LOG_ERROR(formatString("Unable to set value of property: '%s'", dpeName.c_str())); + LOG_ERROR(formatString("Unable to set value of property: '%s' -> DP unknown", dpeName.c_str())); } else if ((result = convertMACToPVSS(value, &pVar, dpId)) != SA_NO_ERROR) { - LOG_ERROR(formatString("Unable to set value of property: '%s'", dpeName.c_str())); + LOG_ERROR_STR("Unable to set value of property: '" << dpeName << "' -> " << PVSSerrstr(result)); } else { GSAWaitForAnswer* pWFA(0); @@ -1378,7 +1378,7 @@ PVSSresult PVSSservice::convertMACToPVSS(const GCFPValue& macValue, Variable* pItemValue(0); VariableType type(NOTYPE_VAR); // the type for the new FPValue must be determined - // separat, because the array could be empty + // separate, because the array could be empty switch (macValue.getType()) { case LPT_DYNBOOL: if (elTypeId == DPELEMENT_DYNBIT) type = BIT_VAR; @@ -1408,6 +1408,7 @@ PVSSresult PVSSservice::convertMACToPVSS(const GCFPValue& macValue, break; } if (type == NOTYPE_VAR) { + LOG_ERROR_STR("Conversion of dyn_type " << macValue.getType() << " not implemented"); // type mismatch so stop with converting data break; } @@ -1446,10 +1447,12 @@ PVSSresult PVSSservice::convertMACToPVSS(const GCFPValue& macValue, delete pItemValue; pItemValue = 0; } - } - } - else + } // for + } // in DYN_ARR range + else { + LOG_ERROR_STR("Conversion of variable type " << macValue.getType() << " not implemented"); result = SA_MACTYPE_UNKNOWN; + } break; } if (result == SA_NO_ERROR && *pVar == 0) { diff --git a/MAC/GCF/PVSS/test/tPVSSservice.cc b/MAC/GCF/PVSS/test/tPVSSservice.cc index 6e63aa174127d0d2c9dd50ad27f72c7f154c5835..fc0e09b2db60d01384eea85b13b00787731e615a 100644 --- a/MAC/GCF/PVSS/test/tPVSSservice.cc +++ b/MAC/GCF/PVSS/test/tPVSSservice.cc @@ -164,8 +164,7 @@ GCFEvent::TResult tGSAService::test1(GCFEvent& e, GCFPortInterface& p) case F_ENTRY: LOG_DEBUG("===> Creating a bit variable: testBit"); result = itsService->dpCreate("testBit", "ExampleDP_Bit"); - ASSERTSTR(result == SA_NO_ERROR, "Creation of a bit variable returned result: " - << PVSSerrstr(result)); + ASSERTSTR(result == SA_NO_ERROR, "Creation of a bit variable returned result: " << PVSSerrstr(result)); itsTimerPort->setTimer(1.0); break; @@ -198,8 +197,7 @@ GCFEvent::TResult tGSAService::test2(GCFEvent& e, GCFPortInterface& p) case F_ENTRY: LOG_DEBUG("===> Creating a integer variable: testInt"); result = itsService->dpCreate("testInt", "ExampleDP_Int"); - ASSERTSTR(result == SA_NO_ERROR, "Creation of a int variable returned result: " - << PVSSerrstr(result)); + ASSERTSTR(result == SA_NO_ERROR, "Creation of a int variable returned result: " << PVSSerrstr(result)); itsTimerPort->setTimer(1.0); break; @@ -229,8 +227,7 @@ GCFEvent::TResult tGSAService::test3(GCFEvent& e, GCFPortInterface& p) case F_ENTRY: LOG_DEBUG("===> Taking a subscription on testBit"); result = itsService->dpeSubscribe("testBit"); - ASSERTSTR(result == SA_NO_ERROR, - "Taking a subscription on testBit returned result: " << PVSSerrstr(result)); + ASSERTSTR(result == SA_NO_ERROR, "Taking a subscription on testBit returned result: " << PVSSerrstr(result)); itsTimerPort->setTimer(1.0); break; @@ -260,8 +257,7 @@ GCFEvent::TResult tGSAService::test4(GCFEvent& e, GCFPortInterface& p) case F_ENTRY: LOG_DEBUG("===> Taking a subscription on testInt"); result = itsService->dpeSubscribe("testInt"); - ASSERTSTR(result == SA_NO_ERROR, - "Taking a subscription on testInt returned result: " << PVSSerrstr(result)); + ASSERTSTR(result == SA_NO_ERROR, "Taking a subscription on testInt returned result: " << PVSSerrstr(result)); itsTimerPort->setTimer(1.0); break; @@ -295,8 +291,7 @@ GCFEvent::TResult tGSAService::test5(GCFEvent& e, GCFPortInterface& p) result = itsService->dpeSet("testInt", wrongTestVal, 0.0, true); } catch (Exception& except) { - LOG_INFO_STR ("Writing a bool to the testInt returned result: " - << PVSSerrstr(result)); + LOG_INFO_STR ("Writing a bool to the testInt returned result: " << PVSSerrstr(result)); } itsTimerPort->setTimer(1.0); } @@ -392,6 +387,7 @@ GCFEvent::TResult tGSAService::test8(GCFEvent& e, GCFPortInterface& p) LOG_DEBUG("===> Unsubscribing from the variables"); result = itsService->dpeUnsubscribe("testInt"); ASSERTSTR(result == SA_NO_ERROR, "Unsubscribing from testInt returned result: " << PVSSerrstr(result)); + result = itsService->dpeUnsubscribe("testBit"); ASSERTSTR(result == SA_NO_ERROR, "Unsubscribing from testBit returned result: " << PVSSerrstr(result)); try { @@ -431,8 +427,10 @@ GCFEvent::TResult tGSAService::test9(GCFEvent& e, GCFPortInterface& p) LOG_DEBUG("===> Subscribe, unsubscribe and dpSet on the testInt"); result = itsService->dpeSubscribe("testInt"); ASSERTSTR(result == SA_NO_ERROR, "Subscribing from testInt returned result: " << PVSSerrstr(result)); + result = itsService->dpeUnsubscribe("testInt"); ASSERTSTR(result == SA_NO_ERROR, "Unsubscribing from testInt returned result: " << PVSSerrstr(result)); + GCFPVInteger goodTestVal(1000); result = itsService->dpeSet("testInt", goodTestVal, 0.0, true); ASSERTSTR(result == SA_NO_ERROR, "Writing an integer to the testInt returned result: " << PVSSerrstr(result)); @@ -470,8 +468,7 @@ GCFEvent::TResult tGSAService::test10(GCFEvent& e, GCFPortInterface& p) ASSERTSTR(result == SA_NO_ERROR, "Reading an unknown variable should return an error!"); } catch (Exception& except) { - LOG_INFO_STR ("Reading an unknown variable returned result: " - << PVSSerrstr(result)); + LOG_INFO_STR ("Reading an unknown variable returned result: " << PVSSerrstr(result)); } itsTimerPort->setTimer(1.0); } @@ -506,8 +503,7 @@ GCFEvent::TResult tGSAService::testCreateMdpe(GCFEvent& e, GCFPortInterface& p) case F_ENTRY: LOG_DEBUG("===> Creating a complex variable: testDP"); result = itsService->dpCreate("testDP", "TestPS"); - ASSERTSTR(result == SA_NO_ERROR, "Creation of a complex variable returned result: " - << PVSSerrstr(result)); + ASSERTSTR(result == SA_NO_ERROR, "Creation of a complex variable returned result: " << PVSSerrstr(result)); itsTimerPort->setTimer(1.0); break; @@ -551,8 +547,7 @@ GCFEvent::TResult tGSAService::testWriteMdpe(GCFEvent& e, GCFPortInterface& p) result = itsService->dpeSetMultiple("testDP", dpeNames, values, 0.0, true); } catch (Exception& except) { - LOG_INFO_STR ("Writing multiple values at once returned result: " - << PVSSerrstr(result)); + LOG_INFO_STR ("Writing multiple values at once returned result: " << PVSSerrstr(result)); } itsTimerPort->setTimer(1.0); } @@ -608,8 +603,7 @@ GCFEvent::TResult tGSAService::testWriteMdpeTimed(GCFEvent& e, GCFPortInterface& result = itsService->dpeSetMultiple("testDP", dpeNames, values, theTime, true); } catch (Exception& except) { - LOG_INFO_STR ("Writing multiple values at once returned result: " - << PVSSerrstr(result)); + LOG_INFO_STR ("Writing multiple values at once returned result: " << PVSSerrstr(result)); } itsTimerPort->setTimer(1.0); } @@ -646,12 +640,71 @@ GCFEvent::TResult tGSAService::testWriteDynArray(GCFEvent& e, GCFPortInterface& dpeValues.push_back(new GCFPVString("aap")); dpeValues.push_back(new GCFPVString("noot")); dpeValues.push_back(new GCFPVString("mies")); - result = itsService->dpeSet("testDP.stringArr", - GCFPVDynArr(LPT_DYNSTRING, dpeValues)); + result = itsService->dpeSet("testDP.stringArr", GCFPVDynArr(LPT_DYNSTRING, dpeValues)); + } + catch (Exception& except) { + LOG_INFO_STR ("Writing multiple values at once returned result: " << PVSSerrstr(result)); + } + itsTimerPort->setTimer(1.0); + } + break; + + case F_TIMER: + TRAN(tGSAService::testWriteMultipleDynArr); + break; + + default: + status = GCFEvent::NOT_HANDLED; + break; + } + + return status; +} + +// +// testWriteMultipleDynArr (event, port) +// +GCFEvent::TResult tGSAService::testWriteMultipleDynArr(GCFEvent& e, GCFPortInterface& p) +{ + LOG_DEBUG_STR("testWriteMultipleDynArr:" << eventName(e) << "@" << p.getName()); + + GCFEvent::TResult status = GCFEvent::HANDLED; + PVSSresult result(SA_NO_ERROR); + + switch (e.signal) { + case F_ENTRY: { + try { + LOG_DEBUG("===> Setting ALL dynArrays"); + vector<string> dpeNames; + dpeNames.push_back("intArr"); + dpeNames.push_back("floatArr"); + dpeNames.push_back("boolArr"); + dpeNames.push_back("stringArr"); + GCFPValueArray theInts; + GCFPValueArray theFloats; + GCFPValueArray theBools; + GCFPValueArray theStrings; + theInts.push_back(new GCFPVInteger(11)); + theInts.push_back(new GCFPVInteger(222)); + theInts.push_back(new GCFPVInteger(33333)); + theFloats.push_back(new GCFPVDouble(1.11)); + theFloats.push_back(new GCFPVDouble(22.2)); + theFloats.push_back(new GCFPVDouble(333.33)); + theBools.push_back(new GCFPVBool(true)); + theBools.push_back(new GCFPVBool(false)); + theBools.push_back(new GCFPVBool(true)); + theStrings.push_back(new GCFPVString("aap")); + theStrings.push_back(new GCFPVString("noot")); + theStrings.push_back(new GCFPVString("mies")); + GCFPValueArray values; + values.push_back(new GCFPVDynArr(LPT_DYNINTEGER, theInts)); + values.push_back(new GCFPVDynArr(LPT_DYNDOUBLE, theFloats)); + values.push_back(new GCFPVDynArr(LPT_DYNBOOL, theBools)); + values.push_back(new GCFPVDynArr(LPT_DYNSTRING, theStrings)); + result = itsService->dpeSetMultiple("testDP", dpeNames, values, 0.0, true); } catch (Exception& except) { - LOG_INFO_STR ("Writing multiple values at once returned result: " - << PVSSerrstr(result)); + LOG_INFO_STR ("Writing multiple values at once returned result: " << PVSSerrstr(result)); } itsTimerPort->setTimer(1.0); } @@ -669,6 +722,7 @@ GCFEvent::TResult tGSAService::testWriteDynArray(GCFEvent& e, GCFPortInterface& return status; } + // // testQuerySingle (event, port) // @@ -686,8 +740,7 @@ GCFEvent::TResult tGSAService::testQuerySingle(GCFEvent& e, GCFPortInterface& p) result = itsService->dpQuerySubscribeSingle("'LOFAR_PIC_*.state'", "_DPT=\"RCU\""); } catch (Exception& except) { - LOG_INFO_STR ("Taking subscription went wrong:" - << PVSSerrstr(result)); + LOG_INFO_STR ("Taking subscription went wrong:" << PVSSerrstr(result)); } itsTimerPort->setTimer(1.0); } diff --git a/MAC/GCF/PVSS/test/tPVSSservice.h b/MAC/GCF/PVSS/test/tPVSSservice.h index 707af001125b8956a584f9a22bfa9de7face389c..e37215c3a1b51ee2add87f0e8c84438c41b356eb 100644 --- a/MAC/GCF/PVSS/test/tPVSSservice.h +++ b/MAC/GCF/PVSS/test/tPVSSservice.h @@ -62,12 +62,13 @@ class tGSAService : public GCFTask GCFEvent::TResult test8 (GCFEvent& e, GCFPortInterface& p); GCFEvent::TResult test9 (GCFEvent& e, GCFPortInterface& p); GCFEvent::TResult test10 (GCFEvent& e, GCFPortInterface& p); - GCFEvent::TResult testCreateMdpe (GCFEvent& e, GCFPortInterface& p); - GCFEvent::TResult testWriteMdpe (GCFEvent& e, GCFPortInterface& p); - GCFEvent::TResult testWriteMdpeTimed (GCFEvent& e, GCFPortInterface& p); - GCFEvent::TResult testWriteDynArray (GCFEvent& e, GCFPortInterface& p); - GCFEvent::TResult testQuerySingle (GCFEvent& e, GCFPortInterface& p); - GCFEvent::TResult testQueryUnsubscribe(GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult testCreateMdpe (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult testWriteMdpe (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult testWriteMdpeTimed (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult testWriteDynArray (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult testWriteMultipleDynArr (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult testQuerySingle (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult testQueryUnsubscribe (GCFEvent& e, GCFPortInterface& p); private: