void TimepixProducer::OnStopRun() { pixelmanCtrl->m_commHistRunCtrl.AddString(_T("End Of Run.")); if ( GetRunStatusFlag() == TimepixProducer::RUN_STOPPED ) { // give a warning to eudaq and do nothing EUDAQ_WARN("StopRun requested when run not active"); SetStatus(eudaq::Status::LVL_WARN, "StopRun requested when run not active"); } else { // send STOP_RUN command to the daq thread PushCommand( STOP_RUN ); // wait for the daq thread to lower the run active flag while ( GetRunStatusFlag() == RUN_ACTIVE ) { Sleep(1); } //EUDAQ_DEBUG("Sending EORE"); Sleep(1000); SendEvent(eudaq::RawDataEvent::EORE(_T("Timepix"),GetRunNumber(), GetEventNumber())); //std::cout << "Stop Run" << std::endl; //MessageBox(NULL, "End Of Run", "Message from Runcontrol",NULL); EUDAQ_INFO("Run Stopped"); SetStatus(eudaq::Status::LVL_OK, "Run Stopped"); } }
//_____________________________________ Bool_t ExampleINDRAAnalysis::Analysis(void) { // Analysis method called event by event. // The current event can be accessed by a call to method GetEvent(). // See KVINDRAReconEvent documentation for the available methods. // Do not remove the following line - reject events with less identified particles than // the acquisition multiplicity trigger if (!GetEvent()->IsOK()) return kTRUE; // avoid pile-up events if (GetGV("ztot")->GetValue() > GetCurrentRun()->GetSystem()->GetZtot() + 4 || GetGV("zvtot")->GetValue() > 1.2) return kTRUE; GetGVList()->FillBranches(); // update values of all global variable branches Mult = GetEvent()->GetMult("OK"); EventNumber = GetEventNumber(); MTensor = GetGV("tensor")->GetValue("NumberParts"); // write new results in TTree FillTree(); return kTRUE; }
void CNewTstatSchedulesDlg::LoadSheduleDataAndColor() { Read_Multi(g_tstat_id, m_SchduleBuffer, 813, 104, 5); for (int i=0;i<48;i++) { Schedule_Node SN; WeeklyEvent[i].Day = i / 6; if (m_SchduleBuffer[2 * i]>23|| m_SchduleBuffer[2 * i + 1]>59) { continue; } if (m_SchduleBuffer[2*i] == 0 && m_SchduleBuffer[2 * i + 1]==0) { continue; } WeeklyEvent[i].Hour = m_SchduleBuffer[2 * i]; WeeklyEvent[i].Minite = m_SchduleBuffer[2 * i + 1]; WeeklyEvent[i].Event_Number = GetEventNumber(i); SN.Hour = m_SchduleBuffer[2 * i]; SN.Minite = m_SchduleBuffer[2 * i + 1]; if (WeeklyEvent[i].Day == 0) { SN.Monday = WeeklyEvent[i].Event_Number; } else if (WeeklyEvent[i].Day == 1) { SN.Tuesday = WeeklyEvent[i].Event_Number; } else if (WeeklyEvent[i].Day == 2) { SN.Wednesday = WeeklyEvent[i].Event_Number; } else if (WeeklyEvent[i].Day == 3) { SN.Thursday = WeeklyEvent[i].Event_Number; } else if (WeeklyEvent[i].Day == 4) { SN.Friday = WeeklyEvent[i].Event_Number; } else if (WeeklyEvent[i].Day == 5) { SN.Saturday = WeeklyEvent[i].Event_Number; } else if (WeeklyEvent[i].Day == 6) { SN.Sunday = WeeklyEvent[i].Event_Number; } else if (WeeklyEvent[i].Day == 7) { SN.Holiday = WeeklyEvent[i].Event_Number; } InsertAndUpdate_Schdule(SN); } m_ScheduleList.sort(); list<Schedule_Node>::iterator it; int index = 0; for (it = m_ScheduleList.begin(); it != m_ScheduleList.end(); ++it) { it->Col_Monday = m_COLScheduleMode[it->Monday]; if (it->Monday == 0 && index != 0) { COLORREF PreviousScheduleColor = GetItemColor(index - 1, 2); it->Col_Monday = PreviousScheduleColor; } it->Col_Tuesday = m_COLScheduleMode[it->Tuesday]; if (it->Tuesday == 0 && index != 0) { COLORREF PreviousScheduleColor = GetItemColor(index - 1, 3); it->Col_Tuesday = PreviousScheduleColor; } it->Col_Wednesday = m_COLScheduleMode[it->Wednesday]; if (it->Wednesday == 0 && index != 0) { COLORREF PreviousScheduleColor = GetItemColor(index - 1, 4); it->Col_Wednesday = PreviousScheduleColor; } it->Col_Thursday = m_COLScheduleMode[it->Thursday]; if (it->Thursday == 0 && index != 0) { COLORREF PreviousScheduleColor = GetItemColor(index - 1, 5); it->Col_Thursday = PreviousScheduleColor; } it->Col_Friday = m_COLScheduleMode[it->Friday]; if (it->Friday == 0 && index != 0) { COLORREF PreviousScheduleColor = GetItemColor(index - 1, 6); it->Col_Friday = PreviousScheduleColor; } it->Col_Saturday = m_COLScheduleMode[it->Saturday]; if (it->Saturday == 0 && index != 0) { COLORREF PreviousScheduleColor = GetItemColor(index - 1, 7); it->Col_Saturday = PreviousScheduleColor; } it->Col_Sunday = m_COLScheduleMode[it->Sunday]; if (it->Sunday == 0 && index != 0) { COLORREF PreviousScheduleColor = GetItemColor(index - 1, 8); it->Col_Sunday = PreviousScheduleColor; } it->Col_Holiday = m_COLScheduleMode[it->Holiday]; if (it->Holiday == 0 && index != 0) { COLORREF PreviousScheduleColor = GetItemColor(index - 1, 9); it->Col_Holiday = PreviousScheduleColor; } index++; } }