25int main(
int argc,
char **argv)
40 JParser<> zap(
"Auxiliary program to print firmware vesion.");
42 zap[
's'] =
make_field(server) = getServernames();
46 zap[
'D'] =
make_field(
id,
"detector identifier") =
"";
52 catch(
const exception &error) {
53 FATAL(error.what() << endl);
58 JDB::reset(usr, pwd, cookie);
60 catch(
const exception& error) {
61 FATAL(error.what() << endl);
64 const string detid = getDetector<string>(
id);
72 if (! (rs >> clbmap)) {
78 catch(
const exception& error) {
79 FATAL(
"Detector " << detid <<
" - " << error.what() << endl);
83 FATAL(
"Detector " << detid <<
" - " <<
" no data." << endl);
91 JSelector selection(&JDatalogNumbers::PARAMETER_NAME,
"BUILD*");
95 ResultSet& rs = getResultSet(getTable<JDatalogNumbers>(), selection);
99 const int value = (int) parameters.DATA_VALUE;
103 const size_t ls[] = {
104 parameters.PARAMETER_NAME.find(
'['),
105 parameters.PARAMETER_NAME.find(
']')
110 string& version = zmap[parameters.SOURCE_NAME];
114 istringstream(parameters.PARAMETER_NAME.substr(
ls[0] + 1,
ls[1] -
ls[0] + 1)) >> index;
116 if (version.size() <= index) {
117 version.append(index - version.size() + 1,
' ');
120 DEBUG(parameters.PARAMETER_NAME <<
' ' <<
ls[0] <<
' ' <<
ls[1] <<
' ' << index <<
' ' << value << endl);
122 version[index] = (char) value;
129 catch(
const exception& error) {
130 FATAL(error.what() << endl);
135 bool operator()(
const JCLBMap& first,
const JCLBMap& second)
const
145 sort(clbmap.begin(), clbmap.end(), compare);
147 for (
const auto& i : clbmap) {
148 cout <<
"Firmware: " <<
FILL(4,
'0') << i.DUID <<
'.' <<
FILL(2,
'0') << i.FLOORID <<
" " << setw(24) << left << i.UPI <<
" \"" << zmap[i.UPI.toString()] <<
"\"" << right << endl;