Changeset 11825
- Timestamp:
- 08/06/11 19:09:38 (13 years ago)
- Location:
- trunk/FACT++/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11824 r11825 16 16 #include "src/Dim.h" 17 17 #include "src/Converter.h" 18 #include "src/Configuration.h" 18 19 #include "src/HeadersFTM.h" 19 20 #include "src/HeadersFAD.h" … … 3139 3140 #endif 3140 3141 3142 pair<string,string> Split(const string &str) const 3143 { 3144 const size_t p = str.find_first_of('|'); 3145 if (p==string::npos) 3146 return make_pair(str, ""); 3147 3148 return make_pair(str.substr(0, p), str.substr(p+1)); 3149 } 3150 3141 3151 public: 3142 FactGui( ) :3152 FactGui(Configuration &conf) : 3143 3153 fFtuStatus(40), 3144 3154 fPixelMapHW(1440), fPatchMapHW(160), fPatchHW(1440), … … 3191 3201 fClockCondFreq->addItem("5 GHz", QVariant(5000)); 3192 3202 3203 cout << "-- run counter ---" << endl; 3193 3204 fMcpNumEvents->addItem("unlimited", QVariant(0)); 3194 fMcpNumEvents->addItem("100", QVariant(100)); 3195 fMcpNumEvents->addItem("300", QVariant(300)); 3196 fMcpNumEvents->addItem("1000", QVariant(1000)); 3197 fMcpNumEvents->addItem("3000", QVariant(3000)); 3198 fMcpNumEvents->addItem("10000", QVariant(10000)); 3199 fMcpNumEvents->addItem("30000", QVariant(30000)); 3200 3205 const vector<uint32_t> runcount = conf.Vec<uint32_t>("run-count"); 3206 for (vector<uint32_t>::const_iterator it=runcount.begin(); it!=runcount.end(); it++) 3207 { 3208 cout << *it << endl; 3209 ostringstream str; 3210 str << *it; 3211 fMcpNumEvents->addItem(str.str().c_str(), QVariant(*it)); 3212 } 3213 3214 cout << "-- run times ---" << endl; 3201 3215 fMcpTime->addItem("unlimited", QVariant(0)); 3202 fMcpTime->addItem("00:30", QVariant(30)); 3203 fMcpTime->addItem("01:00", QVariant(60)); 3204 fMcpTime->addItem("02:30", QVariant(150)); 3205 fMcpTime->addItem("05:00", QVariant(300)); 3206 fMcpTime->addItem("10:00", QVariant(600)); 3207 fMcpTime->addItem("15:00", QVariant(900)); 3208 fMcpTime->addItem("20:00", QVariant(1200)); 3209 fMcpTime->addItem("30:00", QVariant(1800)); 3210 fMcpTime->addItem("60:00", QVariant(3600)); 3211 3212 fMcpRunType->addItem("Data", QVariant("data")); 3213 fMcpRunType->addItem("Pedestal", QVariant("pedestal")); 3214 fMcpRunType->addItem("DRS Calib", QVariant("drs-calib")); 3215 fMcpRunType->addItem("Light pulser", QVariant("light-pulser")); 3216 const vector<string> runtime = conf.Vec<string>("run-time"); 3217 for (vector<string>::const_iterator it=runtime.begin(); it!=runtime.end(); it++) 3218 { 3219 const pair<string,string> p = Split(*it); 3220 cout << *it << "|" << p.second << "|" << p.first << "|" << endl; 3221 fMcpTime->addItem(p.second.c_str(), QVariant(stoi(p.first))); 3222 } 3223 3224 cout << "-- run types ---" << endl; 3225 const vector<string> runtype = conf.Vec<string>("run-type"); 3226 for (vector<string>::const_iterator it=runtype.begin(); it!=runtype.end(); it++) 3227 { 3228 const pair<string,string> p = Split(*it); 3229 cout << *it << "|" << p.second << "|" << p.first << "|" << endl; 3230 fMcpRunType->addItem(p.second.c_str(), QVariant(p.first.c_str())); 3231 } 3216 3232 3217 3233 fTriggerWidget->setEnabled(false); -
trunk/FACT++/gui/fact.cc
r11611 r11825 39 39 ; 40 40 41 po::options_description runtype("Run type configuration"); 42 runtype.add_options() 43 ("run-type", vars<string>(), "Names of available run-types") 44 ("run-time", vars<string>(), "Possible run-times for runs") 45 ("run-count", vars<uint32_t>(), "Number of events for a run") 46 ; 47 41 48 conf.AddEnv("dns", "DIM_DNS_NODE"); 42 49 conf.AddEnv("host", "DIM_HOST_NODE"); 43 50 44 51 conf.AddOptions(config); 52 conf.AddOptions(runtype); 45 53 } 46 54 … … 58 66 QApplication app(argc, const_cast<char**>(argv)); 59 67 60 FactGui gui ;68 FactGui gui(conf); 61 69 gui.show(); 62 70
Note:
See TracChangeset
for help on using the changeset viewer.