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

Bug 1175: PIC and PermSW are now stored in PIC tree in OTDB.

parent 472f1683
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,7 @@ dnl
lofar_GENERAL
lofar_INTERNAL(LCS/Common,Common,,1,Common/LofarTypedefs.h,,)
lofar_INTERNAL(SAS/OTDB,OTDB,,1,OTDB/OTDBtypes.h,,)
lofar_INTERNAL(APL/APLCommon,APLCommon,,1,APL/APLCommon/StationInfo.h,,)
lofar_EXTERNAL(boost,1,boost/date_time/date.hpp, boost_date_time)
lofar_EXTERNAL(pqxx,2.5.5,pqxx/pqxx, pqxx)
lofar_EXTERNAL(pq,,libpq-fe.h, pq, /usr/local/pgsql)
......
......@@ -5,8 +5,8 @@
# name vers qual constr. descr.
#--------------------------------------------------------------------------------------------------------
node LOFAR 1.0.2 development 'node constraint' "LOFAR Main"
uses PermSW 1.0.0 development 1 "Permanent Software"
#uses PermSW 1.0.0 development 1 "Permanent Software"
uses ObsSW 1.0.2 development 1 "Observation Software"
uses PIC 1.0.1 development 1 "Physical Instrument Components"
#uses PIC 1.0.1 development 1 "Physical Instrument Components"
uses Clock160 1.0.0 development 1 "160MHz System Clock"
uses Clock200 1.0.0 development 1 "200MHz System Clock"
......@@ -6,5 +6,5 @@
#--------------------------------------------------------------------------------------------------------
node PIC 1.0.1 development 'node constraint' "Physical Instrument Component"
uses @ring@ 1.0.0 development 'node constraint' "One of the four ring-areas"
uses Connection 1.0.1 development 'node constraint' "Connections between nodes"
#uses Connection 1.0.1 development 'node constraint' "Connections between nodes"
uses Cluster 1.0.1 development 'node constraint' "The central clusters"
......@@ -4,6 +4,7 @@
#
# Syntax: createFiles ( -a | stationname [stationame ...])
#
# Makea a file with PVSS(!) datapoints that must be monitored in SAS.
import re, sys
def expandRCUMarker(dataPoint, nrRSP):
......@@ -14,8 +15,7 @@ def expandRCUMarker(dataPoint, nrRSP):
rsp = rcu / 8
subrack = rsp / 4
cabinet = rsp / 8
print >> outputFile, \
"21 "+dataPoint.replace("@cabinet@","Cabinet"+str(cabinet)) \
print "21 "+dataPoint.replace("@cabinet@","Cabinet"+str(cabinet)) \
.replace("@subrack@","Subrack"+str(subrack)) \
.replace("@RSPBoard@", "RSPBoard"+str(rsp)) \
.replace("@rcu@", "RCU"+str(rcu))+".state"
......@@ -27,8 +27,7 @@ def expandRSPBoardMarker(dataPoint, nrRSP):
for rsp in range(0, nrRSP):
subrack = rsp / 4
cabinet = rsp / 8
print >> outputFile, \
"21 "+dataPoint.replace("@cabinet@","Cabinet"+str(cabinet)) \
print "21 "+dataPoint.replace("@cabinet@","Cabinet"+str(cabinet)) \
.replace("@subrack@","Subrack"+str(subrack)) \
.replace("@RSPBoard@", "RSPBoard"+str(rsp))+".state"
......@@ -39,8 +38,7 @@ def expandTBBoardMarker(dataPoint, nrTBB):
for tbb in range(0, nrTBB):
subrack = tbb / 2
cabinet = tbb / 4
print >> outputFile, \
"21 "+dataPoint.replace("@cabinet@","Cabinet"+str(cabinet)) \
print "21 "+dataPoint.replace("@cabinet@","Cabinet"+str(cabinet)) \
.replace("@subrack@","Subrack"+str(subrack)) \
.replace("@TBBoard@", "TBBoard"+str(tbb))+".state"
......@@ -52,8 +50,7 @@ def expandSubrackMarker(dataPoint, nrRSP):
if nrRSP % 4: nrSubracks += 1
for subrack in range(0, nrSubracks):
cabinet = subrack / 2
print >> outputFile, \
"21 "+dataPoint.replace("@cabinet@","Cabinet"+str(cabinet)) \
print "21 "+dataPoint.replace("@cabinet@","Cabinet"+str(cabinet)) \
.replace("@subrack@","Subrack"+str(subrack))+".state"
def expandCabinetMarker(dataPoint, nrRSP):
......@@ -63,8 +60,7 @@ def expandCabinetMarker(dataPoint, nrRSP):
nrCabinets = nrRSP / 8
if nrRSP % 8: nrCabinets += 1
for cabinet in range(0, nrCabinets):
print >> outputFile, \
"21 "+dataPoint.replace("@cabinet@","Cabinet"+str(cabinet))+".state"
print "21 "+dataPoint.replace("@cabinet@","Cabinet"+str(cabinet))+".state"
......@@ -72,15 +68,16 @@ def expandCabinetMarker(dataPoint, nrRSP):
# all the files we are uisng
PVSSbasefile= "../PVSS/PVSSDataPoints.base"
StationFile = "../StaticMetaData/StationInfo"
ControlFile = "../StaticMetaData/ControlInfo"
RingFile = "../PVSS/Rings.list"
ResultFile = "./OTDBDatapoints.out"
ClusterFile = "../PVSS/Clusters.list"
filledLine = re.compile("^[^#].*", re.MULTILINE)
# construct a dictionary from the rings file: key is first character, value is ringname
ringDict = {}
for line in filledLine.findall(open(RingFile).read()):
ringDict[line[0]] = line
print "ringDict =", ringDict
#print "ringDict =", ringDict
# construct a list with all ring_station combinations
ringStations = []
......@@ -90,15 +87,29 @@ for line in filledLine.findall(open(StationFile).read()):
nrRSP, nrTBB, nrLBA, nrHBA, HBAsplit, LBAcal ) = line.split()
ringStations.append(ringDict[stnType]+"_"+name)
stations.append(name)
print "ringStations =", ringStations
print "stations =", stations
#print "ringStations =", ringStations
#print "stations =", stations
# construct a dictionary for the clusters
clusterDict = {}
for line in filledLine.findall(open(ClusterFile).read()):
(mnemonic, prefix, count) = line.split()
clusterDict[mnemonic] = (prefix, count)
#print "clusterDict =", clusterDict
# construct a list for the control-machines
controlList = []
for line in filledLine.findall(open(ControlFile).read()):
(name, ipaddr, macaddr) = line.split()
controlList.append(name)
#print "controlList =", controlList
# open outputfile and write top-node of PIC
outputFile = open(ResultFile, "w")
print >> outputFile, "21 LOFAR_PIC.state"
print >> outputFile, "21 LOFAR_PermSW.state"
print "21 LOFAR.state"
print "21 LOFAR_PIC.state"
print "21 LOFAR_PermSW.state"
# construct the rings and the stations from the central database
# construct the rings with stations and the clusters with their nodes
# ??? ??? C P ???_PIC_@???@
ringStationMask=""
central=re.compile("^\w+[ \t]+[^ \t]+[ \t]+C[ \t]+P[ \t]([A-Za-z_]+_(?:PIC|PermSW)_@.*)", \
......@@ -106,15 +117,42 @@ central=re.compile("^\w+[ \t]+[^ \t]+[ \t]+C[ \t]+P[ \t]([A-Za-z_]+_(?:PIC|PermS
for line in central.findall(open(PVSSbasefile).read()):
if line.find("@station@") >= 0:
ringStationMask=line.replace("LOFAR_","")
for RS in stations:
print >> outputFile, \
"21 "+line.replace("@ring@_@station@", RS)+".state"
for RS in ringStations:
print "21 "+line.replace("@ring@_@station@", RS)+".state"
# ---
elif line.find("@ring@") >= 0:
# for all rings
for ring in ringDict.keys():
print >> outputFile, \
"21 "+line.replace("@ring@", ringDict[ring])+".state"
print "21 "+line.replace("@ring@", ringDict[ring])+".state"
# ---
elif line.find("@node@") >= 0:
# for all nodes in each cluster
for cluster in clusterDict.keys():
(name, count) = clusterDict[cluster]
for nodeNr in range(1, int(count)+1):
nodename = "%s%03d" % (name, nodeNr)
print "21 "+line.replace("@cluster@_@node@", cluster+"_"+nodename)+".state"
# for all nodes
# for all clusters
# also add the control 'cluster' at this place
for node in controlList:
print "21 "+line.replace("@cluster@_@node@", "Control_"+node)+".state"
# ---
elif line.find("@cluster@") >= 0:
# for all clusters
for cluster in clusterDict.keys():
print "21 "+line.replace("@cluster@", cluster)+".state"
# and the control-section
print "21 "+line.replace("@cluster@", "Control")+".state"
# for all expandable lines
# Permanent software on MCU
software=re.compile("^\w+[ \t]+[^ \t]+[ \t]+C[ \t]+P[ \t]([A-Za-z_]+_PermSW_[^@].*)", \
re.IGNORECASE | re.MULTILINE)
for line in software.findall(open(PVSSbasefile).read()):
print "21 MCU001:%s.state" % line
# generate the hardware on each station
for line in filledLine.findall(open(StationFile).read()):
(name, stationID, stnType, long, lat, height, \
......@@ -139,18 +177,12 @@ for line in filledLine.findall(open(StationFile).read()):
expandCabinetMarker(prefix+line, int(nrRSP))
# for all expandable lines
# Permanent software on the stations
software=re.compile("^\w+[ \t]+[^ \t]+[ \t]+S[ \t]+P[ \t]([A-Za-z_]+_PermSW_.*)", \
re.IGNORECASE | re.MULTILINE)
for line in software.findall(open(PVSSbasefile).read()):
print >> outputFile, \
"21 %s:%s.state" % (name, line)
print "21 %s:%s.state" % (name, line)
#for all stations
outputFile.close()
......@@ -52,5 +52,5 @@ RESULTFILE=OTDBDatapoints.out
rm -f ${RESULTFILE}
echo "Creating PIC file..."
./createPICfile
./createPICfile | ../../build/gnu_debug/data/bin/PVSS2SAS >${RESULTFILE}
../../build/gnu_debug/data/bin/load_PICtree $1 ${RESULTFILE}
BGL BGLFE 8
Storage LIST 12
Imaging LIMG 0
Auxilary LIAUX 19
BGL bglfen 4
Storage lifs 12
Offline lioff 32
......@@ -25,6 +25,8 @@ PermSW - C P LOFAR_PermSW
MACScheduler MS C P LOFAR_PermSW_MACScheduler
Ring - C P LOFAR_PermSW_@ring@
Station - C P LOFAR_PermSW_@ring@_@station@
Cluster - C P LOFAR_PermSW_@cluster@
Node - C P LOFAR_PermSW_@cluster@_@node@
ObsSW - C P LOFAR_ObsSW
Observation OBS C O LOFAR_ObsSW_@observation@
ObsCtrl OBSCTRL C O LOFAR_ObsSW_@observation@_ObsCtrl
......
......@@ -4,7 +4,7 @@
# $Id: $
#
# name IPaddress MACaddress
#--------------------------------------------------------------------------------------------------------------
#------------------------------------------
MCU001 10.230.10.1 00:30:48:2d:00:f6
SAS001 10.230.20.1 00:30:48:79:1c:f4
SHM001 10.230.30.1 00:30:48:2d:22:bc
......@@ -32,7 +32,10 @@ using namespace std;
using namespace LOFAR::Deployment;
int main (int argc, char* argv[]) {
cout << PVSS2SASname(argv[1]) << endl;
string input;
while(getline(cin, input)) {
cout << PVSS2SASname(input) << endl;
}
return (0);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment