- Timestamp:
- 07/30/10 11:33:43 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/eLogStatus/eLogStatus.cc
r270 r272 1 1 // 2 2 // Generate status.xml for elogbook status display 3 // 4 // Copy executable to /srv/www/htdocs/FACTelog/bin/ and 5 // change owner to 'tomcat'. 3 6 // 4 7 // Oliver Grimm, 29/7/2010 … … 14 17 int main() { 15 18 19 string Status1, Status2, Status3, Status4, Status5; 20 16 21 // Open file 17 ofstream File(" status.xml");22 ofstream File("/srv/www/htdocs/FACTelog/jsp/status.xml"); 18 23 if (!File.is_open()) { 19 24 cerr << "Could not open file for writing" << endl; … … 22 27 23 28 // Request data from DIM 24 string Status1, Status2;25 29 DimCurrentInfo Alarm("Alarm/MasterAlarm", NO_LINK); 26 30 DimCurrentInfo FBState("Feedback/State", NO_LINK); 31 DimCurrentInfo RunNumber("drsdaq/RunNumber", NO_LINK); 32 DimCurrentInfo RunSize("drsdaq/RunSizeMB", NO_LINK); 33 DimCurrentInfo EventNo("drsdaq/EventNumber", NO_LINK); 27 34 28 if (!EvidenceServer::ServiceOK(&FBState)) { 29 Status1 = "Feedback state n/a"; 35 // Feedback state 36 if (!EvidenceServer::ServiceOK(&FBState)) Status1 = "Feedback state n/a"; 37 else Status1 = EvidenceServer::ToString((char *) "I:1;C", FBState.getData(), FBState.getSize()).substr(2); 38 39 // MasterAlarm level 40 if (!EvidenceServer::ServiceOK(&Alarm)) Status2 = "MasterAlarm n/a"; 41 else { 42 switch (Alarm.getInt()) { 43 case 0: Status2 = "OK"; break; 44 case 1: Status2 = "Server WARN"; break; 45 case 2: Status2 = "Server ERROR"; break; 46 case 3: Status2 = "Server FATAL"; break; 47 case 4: Status2 = "Server UNAVAILABLE"; break; 48 default: Status2 = "MasterAlarm ???"; 49 } 30 50 } 31 else Status1 = EvidenceServer::ToString((char *) "I:1;C", FBState.getData(), FBState.getSize());32 51 33 if (!EvidenceServer::ServiceOK(&Alarm)) { 34 Status2 = "MasterAlarm n/a"; 35 } 36 else Status2 = "MasterAlarm is " + EvidenceServer::ToString((char *) "I", Alarm.getData(), Alarm.getSize()); 52 // Run-related information 53 if (!EvidenceServer::ServiceOK(&RunNumber)) Status3 = "Run #n/a"; 54 else Status3 = "Run #" + EvidenceServer::ToString((char *) "I", RunNumber.getData(), RunNumber.getSize()); 55 56 if (!EvidenceServer::ServiceOK(&RunSize)) Status4 = "Size n/a"; 57 else Status4 = "Size " + EvidenceServer::ToString((char *) "F", RunSize.getData(), RunSize.getSize()) + " MB"; 58 59 if (!EvidenceServer::ServiceOK(&RunSize)) Status5 = "Event #n/a"; 60 else Status5 = "Event #" + EvidenceServer::ToString((char *) "I", EventNo.getData(), EventNo.getSize()); 37 61 38 62 // Write file … … 40 64 File << "<status_val1>" << Status1 << "</status_val1>" << endl; 41 65 File << "<status_val2>" << Status2 << "</status_val2>" << endl; 42 File << "<status_val3>" << "n/a"<< "</status_val3>" << endl;43 File << "<status_val4>" << "n/a"<< "</status_val4>" << endl;44 File << "<status_val5>" << "n/a"<< "</status_val5>" << endl;45 File << "<status_val6>" << " n/a" << "</status_val6>" << endl;66 File << "<status_val3>" << Status3 << "</status_val3>" << endl; 67 File << "<status_val4>" << Status4 << "</status_val4>" << endl; 68 File << "<status_val5>" << Status5 << "</status_val5>" << endl; 69 File << "<status_val6>" << " " << "</status_val6>" << endl; 46 70 File << "</status_info>" << endl; 47 71
Note:
See TracChangeset
for help on using the changeset viewer.