Skip to content
Snippets Groups Projects
Commit eaed29bb authored by Ruud Overeem's avatar Ruud Overeem
Browse files

Task #3713: Updated conversion-regexes between PVSS and SAS to support the LBA and HBA antenna's.

parent 87c7f46d
No related branches found
No related tags found
No related merge requests found
......@@ -147,10 +147,6 @@ string realHostname(const string& someName)
//
// SAS : LOFAR.PIC.<RING>.<SYSTEM>.xxx
// PVSS: <SYSTEM>:LOFAR_PIC_xxx
// ^ ^ ^
// | | +-- locationPos + locationLen
// | +-- colon
// +-- systemLen
//
// NOTE: instead of PIC the DPname may contain PermSW or ObsSW_Observation<n>
//
......@@ -158,21 +154,27 @@ string PVSS2SASname(const string& PVSSname)
{
const char* structure_match = "(([A-Z]{2,3}[0-9]{3}[A-Z]?):LOFAR_(PIC|PermSW)_)|" // 1,2,3
"(([A-Z]{2,3}[0-9]{3}[A-Z]?):LOFAR_(PIC|PermSW)\\.)"; // 4,5,6
"(([A-Z]{2,3}[0-9]{3}[A-Z]?):LOFAR_PIC_(LBA|HBA)\\.)"; // 7,8,9
const char* location_match = "(RCU[0-9]{3})|" // 1
"_(CS[0-9]{3}[A-Z]?)_|" // 2 CS999
"_(RS[0-9]{3}[A-Z]?)_|" // 3 RS999
"_([ABD-QS-Z][A-Z][0-9]{3}[A-Z]?)_|" // 4 XX999
"_([A-Z]{3}[0-9]{3}[A-Z]?)_"; // 5 XXX999
"(LBA[0-9]{3})|" // 2 LBA999
"(HBA[0-9]{2})|" // 3 HBA99
"_(CS[0-9]{3}[A-Z]?)_|" // 4 CS999
"_(RS[0-9]{3}[A-Z]?)_|" // 5 RS999
"_([ABD-QS-Z][A-Z][0-9]{3}[A-Z]?)_|" // 6 XX999
"_([A-Z]{3}[0-9]{3}[A-Z]?)_"; // 7 XXX999
const char* separator_match = "(_)|(\\.)";
const char* boundary_match = "(^([^_]+)_)";
const char* structure_repl = "(?1LOFAR_$3_$2_)" // LOFAR_PIC_RS002
"(?4LOFAR_$6.)"; // LOFAR_PIC
"(?7LOFAR_PIC_$6.)"; // LOFAR_PIC_[HL]BA
const char* location_repl = "(?1$&)" // ignore RCU999
"(?2_Core$&)"
"(?3_Remote$&)"
"(?4_Europe$&)"
"(?5_Control$&)";
"(?2$&)"
"(?3$&)"
"(?4_Core$&)"
"(?5_Remote$&)"
"(?6_Europe$&)"
"(?7_Control$&)";
const char* separator_repl = "(?1.)(?2_)"; // swap separators
const char* boundary_repl = "$2."; // reverse separator on object-field edge
......
......@@ -6,3 +6,4 @@ lofar_add_test(tAntField tAntField.cc)
lofar_add_test(tAntennaSet tAntennaSet.cc)
lofar_add_test(tObservation tObservation.cc)
lofar_add_executable(tHasDataslots tHasDataslots.cc)
lofar_add_executable(tStationInfo tStationInfo.cc)
......@@ -33,7 +33,7 @@
using namespace LOFAR;
int main (int argc, char* argv[])
int main (int/*argc*/, char* argv[])
{
INIT_LOGGER(argv[0]);
......@@ -59,6 +59,10 @@ int main (int argc, char* argv[])
PVSS2SASname("RS002:LOFAR_ObsSW_Observation5.antennaArray"));
LOG_INFO_STR("PVSS==>SAS(RS002:LOFAR_ObsSW_Observation5_BeamControl.status.state) = " <<
PVSS2SASname("RS002:LOFAR_ObsSW_Observation5_BeamControl.status.state"));
LOG_INFO_STR("PVSS==>SAS(RS005:LOFAR_PIC_HBA05.status.state) = " <<
PVSS2SASname("RS005:LOFAR_PIC_HBA05.status.state"));
LOG_INFO_STR("PVSS==>SAS(DE603:LOFAR_PIC_LBA005.status.state) = " <<
PVSS2SASname("DE603:LOFAR_PIC_LBA005.status.state"));
LOG_INFO_STR("SAS==>PVSS(LOFAR.PIC.Remote.RS002.Cabinet0.Subrack0.status_state) = " <<
SAS2PVSSname("LOFAR.PIC.Remote.RS002.Cabinet0.Subrack0.status_state"));
......@@ -68,6 +72,10 @@ int main (int argc, char* argv[])
SAS2PVSSname("LOFAR.PermSW.Control.MCU001.MACScheduler.status_state"));
LOG_INFO_STR("SAS==>PVSS(LOFAR.ObsSW.Observation.VirtualInstrument.stationList) = " <<
SAS2PVSSname("LOFAR.ObsSW.Observation.VirtualInstrument.stationList"));
LOG_INFO_STR("SAS==>PVSS(LOFAR.PIC.Remote.RS005.LBA123.status_state) = " <<
SAS2PVSSname("LOFAR.PIC.Remote.RS005.LBA123.status_state"));
LOG_INFO_STR("SAS==>PVSS(LOFAR.PIC.Europe.DE603.HBA23.status_state) = " <<
SAS2PVSSname("LOFAR.PIC.Europe.DE603.HBA23.status_state"));
return (0);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment