Changeset 10392 for trunk/FACT++/src
- Timestamp:
- 04/18/11 14:36:46 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/dataLogger.cc
r10377 r10392 890 890 891 891 //Init the time columns of the file 892 Description dateDesc(std::string("Time"), std::string("M jD"), std::string("Modified Julian Date"));892 Description dateDesc(std::string("Time"), std::string("Modified Julian Date"), std::string("MjD")); 893 893 sub.dailyFile.AddStandardColumn(dateDesc, "1D", &fMjD, sizeof(double)); 894 894 sub.runFile.AddStandardColumn(dateDesc, "1D", &fMjD, sizeof(double)); 895 895 896 Description QoSDesc("Qos", " None", "Quality of service");896 Description QoSDesc("Qos", "Quality of service", "None"); 897 897 sub.dailyFile.AddStandardColumn(QoSDesc, "1J", &fQuality, sizeof(int)); 898 898 sub.runFile.AddStandardColumn(QoSDesc, "1J", &fQuality, sizeof(int)); … … 1103 1103 } 1104 1104 1105 /* 1106 Extract usage clause(s) [if any] for SYNOPSIS. 1107 Translators: "Usage" and "or" here are patterns (regular expressions) which 1108 are used to match the usage synopsis in program output. An example from cp 1109 (GNU coreutils) which contains both strings: 1110 Usage: cp [OPTION]... [-T] SOURCE DEST 1111 or: cp [OPTION]... SOURCE... DIRECTORY 1112 or: cp [OPTION]... -t DIRECTORY SOURCE... 1113 */ 1114 void PrintUsage() 1115 { 1116 cout << "\n" 1117 "The data logger connects to all available Dim services and " 1118 "writes them to ascii and fits files.\n" 1119 "\n" 1120 "Usage: dataLogger [-c type] [OPTIONS]\n" 1121 " or: dataLogger [OPTIONS]\n" 1122 "\n" 1123 "Options:\n" 1124 "The following describes the available commandline options. " 1125 "For further details on how command line option are parsed " 1126 "and in which order which configuration sources are accessed " 1127 "please refer to the class reference of the Configuration class."; 1128 cout << endl; 1129 1130 } 1131 1132 void PrintHelp() 1133 { 1134 cout << "\n" 1135 "The default is that the program is started without user interaction. " 1136 "All actions are supposed to arrive as DimCommands. Using the -c " 1137 "option, a local shell can be initialized. With h or help a short " 1138 "help message about the usuage can be brought to the screen." 1139 << endl; 1140 1141 /* 1142 cout << "bla bla bla" << endl << endl; 1143 cout << endl; 1144 cout << "Environment:" << endl; 1145 cout << "environment" << endl; 1146 cout << endl; 1147 cout << "Examples:" << endl; 1148 cout << "test exam" << endl; 1149 cout << endl; 1150 cout << "Files:" << endl; 1151 cout << "files" << endl; 1152 cout << endl; 1153 */ 1154 } 1155 1156 /* 1157 The first line of the --version information is assumed to be in one 1158 of the following formats: 1159 1160 <version> 1161 <program> <version> 1162 {GNU,Free} <program> <version> 1163 <program> ({GNU,Free} <package>) <version> 1164 <program> - {GNU,Free} <package> <version> 1165 1166 and separated from any copyright/author details by a blank line. 1167 1168 Handle multi-line bug reporting sections of the form: 1169 1170 Report <program> bugs to <addr> 1171 GNU <package> home page: <url> 1172 ... 1173 */ 1174 void PrintVersion(const char *name) 1175 { 1176 cout << 1177 name << " - FACT++ 1.0\n" 1178 "\n" 1179 "Written by Thomas Bretz <thomas.bretz@epfl.ch> et al.\n" 1180 "\n" 1181 "Report bugs to Thomas Bretz <thomas.bretz@epfl.ch>\n" 1182 "FACT++ home page: http://www.xxx.com\n" 1183 "\n" 1184 "Copyright (C) 2011 by the FACT Collaboration.\n" 1185 "This is free software; see the source for copying conditions.\n" 1186 << endl; 1187 } 1188 1189 1105 1190 void SetupConfiguration(Configuration &conf) 1106 1191 { 1107 const st d::string n = conf.GetName()+".log";1192 const string n = conf.GetName()+".log"; 1108 1193 1109 1194 po::options_description config("Program options"); 1110 1195 config.add_options() 1111 ("dns", var<st d::string>("localhost"),"Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")1112 ("log,l", var<st d::string>(n), "Write log-file")1196 ("dns", var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)") 1197 ("log,l", var<string>(n), "Write log-file") 1113 1198 ("console,c", var<int>(), "Use console (0=shell, 1=simple buffered, X=simple unbuffered)") 1114 1199 ; … … 1122 1207 { 1123 1208 Configuration conf(argv[0]); 1209 conf.SetPrintUsage(PrintUsage); 1124 1210 SetupConfiguration(conf); 1125 1211 … … 1129 1215 vm = conf.Parse(argc, argv); 1130 1216 } 1217 catch (std::exception &e) 1218 { 1131 1219 #if BOOST_VERSION > 104000 1132 catch (po::multiple_occurrences &e) 1133 { 1134 std::cout << "Error: " << e.what() << " of '" << e.get_option_name() << "' option." << std::endl; 1135 std::cout << std::endl; 1220 po::multiple_occurrences *MO = dynamic_cast<po::multiple_occurrences*>(&e); 1221 if (MO) 1222 cout << "Error: " << e.what() << " of '" << MO->get_option_name() << "' option." << endl; 1223 else 1224 #endif 1225 cout << "Error: " << e.what() << endl; 1226 cout << endl; 1227 1136 1228 return -1; 1137 1229 } 1138 #endif 1139 catch (std::exception &e) 1230 1231 if (conf.HasPrint()) 1232 return -1; 1233 1234 if (conf.HasVersion()) 1140 1235 { 1141 std::cout << "Error: " << e.what() << std::endl; 1142 std::cout << std::endl; 1143 1236 PrintVersion(argv[0]); 1144 1237 return -1; 1145 1238 } 1146 1239 1147 if (conf.HasHelp() || conf.HasPrint()) 1240 if (conf.HasHelp()) 1241 { 1242 PrintHelp(); 1148 1243 return -1; 1244 } 1149 1245 1150 1246 setenv("DIM_DNS_NODE", conf.Get<string>("dns").c_str(), 1);
Note:
See TracChangeset
for help on using the changeset viewer.