// // Generate status.xml for elogbook status display // // Oliver Grimm, 29/7/2010 #include #include #include "Evidence.h" using namespace std; int main() { // Open file ofstream File("status.xml"); if (!File.is_open()) { cerr << "Could not open file for writing" << endl; exit (EXIT_FAILURE); } // Request data from DIM string Status1, Status2; DimCurrentInfo Alarm("Alarm/MasterAlarm", NO_LINK); DimCurrentInfo FBState("Feedback/State", NO_LINK); if (!EvidenceServer::ServiceOK(&FBState)) { Status1 = "Feedback state n/a"; } else Status1 = EvidenceServer::ToString((char *) "I:1;C", FBState.getData(), FBState.getSize()); if (!EvidenceServer::ServiceOK(&Alarm)) { Status2 = "MasterAlarm n/a"; } else Status2 = "MasterAlarm is " + EvidenceServer::ToString((char *) "I", Alarm.getData(), Alarm.getSize()); // Write file File << "" << endl; File << "" << Status1 << "" << endl; File << "" << Status2 << "" << endl; File << "" << "n/a" << "" << endl; File << "" << "n/a" << "" << endl; File << "" << "n/a" << "" << endl; File << "" << "n/a" << "" << endl; File << "" << endl; // Close file File.close(); }