2 #include <boost/format.hpp>
4 #include <utl/ErrorLogger.h>
5 #include <utl/UTMPoint.h>
6 #include <utl/ReferenceEllipsoid.h>
7 #include <det/Detector.h>
8 #include <sdet/SDetector.h>
9 #include <sdet/Station.h>
10 #include <sdet/SStationListSQLManager.h>
11 #include <sdet/SStationListXMLManager.h>
21 using namespace StationListCreatorModuleNS;
24 namespace StationListCreatorModuleNS {
31 for (string::const_iterator it = str.begin(); it != str.end(); ++it)
58 Detector::GetInstance().Update(currentTime);
59 const SDetector& sdetector = Detector::GetInstance().GetSDetector();
68 StationListCreatorModule::Finish()
70 ofstream output(
"SStationList.xml.in");
73 <<
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"
75 "<!DOCTYPE stationList [\n"
76 " <!ENTITY UTMdata SYSTEM\n"
77 " \"<ellipsoid> WGS84 </ellipsoid> <zone> 19 </zone> <band> H </band>\">\n"
80 "<!-- created by StationListCreatorModule on "
81 << Detector::GetInstance().GetTime() <<
"\n"
82 " revision $""Id""$ -->\n"
85 " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
86 " xsi:noNamespaceSchemaLocation='@XMLSCHEMALOCATION@/SStationList.xsd'>\n"
89 const Detector& det = Detector::GetInstance();
100 >(sManagerRegister.
GetManager(
"SStationListSQLManager"));
110 >(sManagerRegister.
GetManager(
"SStationListXMLManager"));
116 const string commonFmt =
117 "%1%<station id=\"%2%\">\n"
118 "%1% <northing unit=\"meter\"> %|3$.2f| </northing>\n"
119 "%1% <easting unit=\"meter\"> %|4$.2f| </easting>\n"
120 "%1% <altitude unit=\"meter\"> %|5$.2f| </altitude>\n"
121 "%1% <name> %6% </name>\n"
122 "%1% <commission> %7% </commission>\n"
123 "%1% <decommission> %8% </decommission>\n"
124 "%1% <inGrid> %9% </inGrid>\n"
125 "%1% <groupId> %10% </groupId>\n"
126 "%1% <axes> %11% %12% </axes>\n";
127 const string fullUTMFmt =
128 "%1% <ellipsoid> %13% </ellipsoid>\n"
129 "%1% <zone> %14% </zone>\n"
130 "%1% <band> %15% </band>\n";
131 const string shortUTMFmt =
133 const string endFmt =
135 boost::format stationFmt(commonFmt + fullUTMFmt + endFmt);
136 boost::format stationShortFmt(commonFmt + shortUTMFmt + endFmt);
140 const UTMPoint utm(sIt->GetPosition(), ReferenceEllipsoid::GetWGS84());
141 const bool shortFmt = (utm.GetZone() == 19 && utm.GetBand() ==
'H');
142 (shortFmt ? stationShortFmt : stationFmt)
149 % sIt->GetCommissionTime()
150 % sIt->GetDecommissionTime()
153 % sIt->GetAxes().at(0)
154 % sIt->GetAxes().at(1);
156 stationFmt %
"WGS84" % utm.GetZone() % utm.GetBand();
157 output << (shortFmt ? stationShortFmt : stationFmt) <<
'\n';
163 output <<
"</stationList>\n";
const std::vector< int > & GetFullStationList() const
Get list of ID's for all stations available in the database or configuration file.
StationIterator AllStationsEnd() const
End of the collection of pointers to all stations in the history of the array.
Class to hold and convert a point in geodetic coordinates.
const SStationListManager & GetStationListManager() const
Manager for SD description in SQL station lists.
void Init()
Initialise the registry.
double GetNorthing() const
Get the northing.
Manager for SD description in XML station lists.
A TimeStamp holds GPS second and nanosecond for some event.
StationIterator AllStationsBegin() const
Beginning of the collection of pointers to all stations in the history of the array.
Top of the hierarchy of the detector description interface.
const sdet::SDetector & GetSDetector() const
const VManager & GetManager(const std::string &managerName) const
Get a specific manager by name.
ResultFlag
Flag returned by module methods to the RunController.
ManagerRegister & GetSManagerRegister() const
Register for detector description managers.
bool DumpXML(std::ostream &output, const std::string &indent="") const
Detector description interface for SDetector-related data.
TimeStamp GetCurrentSystemTime()
get current time as reported by system
const SStationListManager & GetStationListManager() const
string StringToXMLString(const string &str)