// RunPage.cpp : implementation file // #include "stdafx.h" #include "daq.h" #include "RunPage.h" #include "DaqSetup.h" #include "ReadoutAgent.h" #include "TriggerAgent.h" #include "Ok.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // RunPage property page IMPLEMENT_DYNCREATE(RunPage, CPropertyPage) RunPage::RunPage() : CPropertyPage(RunPage::IDD) { //{{AFX_DATA_INIT(RunPage) m_loops = 2000; m_repeat = 1; m_file_name = _T("rawData"); //}}AFX_DATA_INIT } RunPage::~RunPage() { } void RunPage::DoDataExchange(CDataExchange* pDX) { CPropertyPage::DoDataExchange(pDX); //{{AFX_DATA_MAP(RunPage) DDX_Text(pDX, IDC_RP_LOOPS, m_loops); DDX_Text(pDX, IDC_RP_REPEAT, m_repeat); DDX_Text(pDX, IDC_RP_FILEN, m_file_name); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(RunPage, CPropertyPage) //{{AFX_MSG_MAP(RunPage) ON_BN_CLICKED(IDC_RP_RUN, OnRpRun) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // RunPage message handlers void RunPage::OnRpRun() { UpdateData (TRUE); DaqSetup* daq = daq->Instance (); ReadoutConfig* config = daq->readoutConfig (); ReadoutAgent agent (config); TriggerAgent trigger; trigger.option_doCalibrate (m_loops, 0); if ( agent.openFile ((char *) (LPCTSTR) m_file_name) ) { for ( int i = 0; i < m_repeat; i++ ) { trigger.doCalibrate (); agent.transferData (); } agent.closeFile (); } // --- notify that data taking is done --- COk ok_dlg; ok_dlg.m_text = _T("done with data taking"); if ( ok_dlg.DoModal () == IDOK ) { } UpdateData (FALSE); }