Changeset 17851 for trunk/FACT++/src
- Timestamp:
- 05/14/14 09:30:43 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/evtserver.cc
r17676 r17851 78 78 (rst.rise>rst.set && (now.JD()<rst.set || now.JD()>rst.rise)); 79 79 80 // FIXME: What about errors? 80 81 if (!isUp) 81 82 return EventServer::State::kStandby; … … 86 87 if (fNight!=night) 87 88 { 89 fNight = night; 90 88 91 delete fIn; 89 92 90 93 const string name = fAuxPath + Tools::Form("/%04d/%02d/%02d/%08d.FAD_CONTROL_EVENT_DATA.fits", night/10000, (night/100)%100, night%100, night); 91 94 92 Info("Opening file "+name);93 94 95 fIn = new fits(name); 95 96 96 if (!fIn->is_open()) 97 97 { 98 Error(string(" Opening file failed: ")+strerror(errno));98 Error(string("Failed to open "+name+": ")+strerror(errno)); 99 99 return StateMachineImp::kSM_Error; 100 100 } 101 101 102 fIn->SetRefAddress("QoS", fQoS); 103 fIn->SetRefAddress("Time", fTime); 104 fIn->SetVecAddress("max", fMax); 105 //fIn->SetVecAddress(fRms); 106 //fIn->SetVecAddress(fMax); 107 //fIn->SetVecAddress(fPos); 108 } 109 110 fNight = night; 102 try 103 { 104 fIn->SetRefAddress("QoS", fQoS); 105 fIn->SetRefAddress("Time", fTime); 106 fIn->SetVecAddress("max", fMax); 107 //fIn->SetVecAddress(fRms); 108 //fIn->SetVecAddress(fMax); 109 //fIn->SetVecAddress(fPos); 110 } 111 catch (const runtime_error &e) 112 { 113 delete fIn; 114 fIn = 0; 115 116 Error("Failed to open "+name+": "+e.what()); 117 return StateMachineImp::kSM_Error; 118 } 119 120 Info("File "+name+" open."); 121 } 122 123 if (GetCurrentState()==StateMachineImp::kSM_Error) 124 return StateMachineImp::kSM_Error; 111 125 112 126 // Get next data event … … 143 157 const double deviation = dev[uint32_t(0.682689477208650697*1440)]; 144 158 145 if (sorted[1439]>med+deviation*6) 159 // In a typical shower or muon ring, the first 160 // few pixels will have comparable brightness, 161 // in a NSB event not. Therefore, the 4th brightest 162 // pixel is a good reference. 163 if (sorted[1439-3]>med+deviation*5) 146 164 break; 147 165 } … … 221 239 222 240 223 AddEvent("START", EventServer::State::kIdle, StateMachineImp::kSM_Error)241 AddEvent("START", EventServer::State::kIdle, EventServer::State::kRunning, StateMachineImp::kSM_Error) 224 242 (bind(&StateMachineEventServer::StartServer, this)) 225 243 ("Start serving the smartfact camera file"); 226 244 227 AddEvent("START_DATE", "I:1", EventServer::State::kIdle, StateMachineImp::kSM_Error)245 AddEvent("START_DATE", "I:1", EventServer::State::kIdle, EventServer::State::kRunning, StateMachineImp::kSM_Error) 228 246 (bind(&StateMachineEventServer::StartDate, this, placeholders::_1)) 229 247 ("Start serving the smartfact camera file with the events from the given date"
Note:
See TracChangeset
for help on using the changeset viewer.