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

Bug 1175: Moving PermSW also from VIC to PIC in SAS. First (not tested) setup.

parent 03b2468f
No related branches found
No related tags found
No related merge requests found
......@@ -80,33 +80,40 @@ filledLine = re.compile("^[^#].*", re.MULTILINE)
ringDict = {}
for line in filledLine.findall(open(RingFile).read()):
ringDict[line[0]] = line
print "ringDict =", ringDict
# construct a list with all ring_station combinations
ringStations = []
stations = []
for line in filledLine.findall(open(StationFile).read()):
(name, stationID, stnType, long, lat, height, \
nrRSP, nrTBB, nrLBA, nrHBA, HBAsplit, LBAcal ) = line.split()
ringStations.append(ringDict[stnType]+"_"+name)
stations.append(name)
print "ringStations =", ringStations
print "stations =", stations
# open outputfile and write top-node
# open outputfile and write top-node of PIC
outputFile = open(ResultFile, "w")
print >> outputFile, "21 PIC.state"
print >> outputFile, "21 LOFAR_PIC.state"
print >> outputFile, "21 LOFAR_PermSW.state"
# construct the station-view from the central database
# construct the rings and the stations from the central database
# ??? ??? C P ???_PIC_@???@
ringStationMask=""
central=re.compile("^\w+[ \t]+[^ \t]+[ \t]+C[ \t]+P[ \t]([A-Za-z_]+_PIC_@.*)", \
central=re.compile("^\w+[ \t]+[^ \t]+[ \t]+C[ \t]+P[ \t]([A-Za-z_]+_(?:PIC|PermSW)_@.*)", \
re.IGNORECASE | re.MULTILINE)
for line in central.findall(open(PVSSbasefile).read()):
if line.find("@station@") >= 0:
ringStationMask=line.replace("LOFAR_","")
for RS in ringStations:
for RS in stations:
print >> outputFile, \
"21 "+line.replace("LOFAR_","").replace("@ring@_@station@", RS)+".state"
"21 "+line.replace("@ring@_@station@", RS)+".state"
elif line.find("@ring@") >= 0:
for ring in ringDict.keys():
print >> outputFile, \
"21 "+line.replace("LOFAR_","").replace("@ring@", ringDict[ring])+".state"# for all expandable lines
"21 "+line.replace("@ring@", ringDict[ring])+".state"
# for all expandable lines
# generate the hardware on each station
for line in filledLine.findall(open(StationFile).read()):
......@@ -114,13 +121,12 @@ for line in filledLine.findall(open(StationFile).read()):
nrRSP, nrTBB, nrLBA, nrHBA, HBAsplit, LBAcal ) = line.split()
# Find all expandable hardware elements on a station. The line syntax is:
# ??? ??? S P ???_PIC_@???@
# we are only interested in the @???@ part.
station=re.compile("^\w+[ \t]+[^ \t]+[ \t]+S[ \t]+P[ \t][A-Za-z_]+_PIC(_@.*)", \
# ??? ??? S P ???_PIC_@...@
# we are only interested in the @...@ part.
station=re.compile("^\w+[ \t]+[^ \t]+[ \t]+S[ \t]+P[ \t][A-Za-z_]+_PIC_(@.*)", \
re.IGNORECASE | re.MULTILINE)
for line in station.findall(open(PVSSbasefile).read()):
prefix = ringStationMask.replace("@ring@", ringDict[stnType]). \
replace("@station@", name)
prefix="@station@:LOFAR_PIC_".replace("@station@", name)
if line.find("@rcu@") >= 0:
expandRCUMarker(prefix+line, int(nrRSP))
elif line.find("@RSPBoard@") >= 0:
......@@ -131,6 +137,20 @@ for line in filledLine.findall(open(StationFile).read()):
expandSubrackMarker(prefix+line, int(nrRSP))
elif line.find("@cabinet@") >= 0:
expandCabinetMarker(prefix+line, int(nrRSP))
# for all expandable lines
# for all expandable lines
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)
#for all stations
outputFile.close()
......@@ -11,4 +11,5 @@ CS001 1 C 6.8673859 52.91092509 50.621 4 2 16 16 No No
CS008 8 C 6.868848183 52.91392684 50.612 4 0 16 16 No No
CS010 10 C 6.8690294 52.9129392 54.10 12 3 48 48 No No
CS016 16 C 6.8735352 52.91250243 50.316 4 0 16 16 No No
RS002 102 R 6.0000000 52.00000000 50.000 4 0 16 16 Yes No
DE001 200 E 6.883956633 50.523318927778 358.449 24 12 96 4 No No
bin_PROGRAMS = load_OTDB_comps load_PICtree
bin_PROGRAMS = load_OTDB_comps load_PICtree PVSS2SAS
load_OTDB_comps_SOURCES = load_OTDB_comps.cc
load_OTDB_comps_DEPENCIES = $(LOFAR_DEPEND)
......@@ -9,4 +9,8 @@ load_PICtree_SOURCES = load_PICtree.cc
load_PICtree_DEPENCIES = $(LOFAR_DEPEND)
load_PICtree_LDADD =
PVSS2SAS_SOURCES = PVSS2SAS.cc
PVSS2SAS_DEPENCIES = $(LOFAR_DEPEND)
PVSS2SAS_LDADD =
include $(top_srcdir)/Makefile.common
//# PVSS2SAS: translate PVSS DPname to SAS DPname
//#
//# Copyright (C) 2008
//# 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$
//# Always #include <lofar_config.h> first!
#include <lofar_config.h>
//# Includes
#include <ostream>
using namespace std;
#include <Common/LofarTypes.h>
#include <APL/APLCommon/StationInfo.h>
using namespace LOFAR::Deployment;
int main (int argc, char* argv[]) {
cout << PVSS2SASname(argv[1]) << 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