15,472
社区成员
发帖
与我相关
我的任务
分享
hPrsEvents=CreateEvent(NULL,FALSE,FALSE,NULL);
hPrsDEvents=CreateEvent(NULL,FALSE,FALSE,NULL);
hDAQThread=AfxBeginThread(CDaqUsb1616HS::DaqScanT,&m_daq); // 数据采集线程
hPrcThread=AfxBeginThread(CDataPreAnalyse::DaqRundataPrc,&m_dpa); //数据处理线程
hAllEvents[0]=hPrsEvents;
hAllEvents[1]=hPrsDEvents;
while (TRUE)
{
dwRet = MsgWaitForMultipleObjects (2, hAllEvents, FALSE, INFINITE, QS_ALLINPUT); //等待
switch(dwRet)
{
case WAIT_OBJECT_0: //停止
str.Format("数据采集结束!采集次数=%ld,显示存储数量=%ld;",m_daq.daqP.SampleNum,i);
strInfo=str;
break; //break the loop
case WAIT_OBJECT_0+1: // 数据更新
i++;
str.Format("显示数据个数i=%ld,数据处理次数=%d;",i,m_dpa.dataP.iPrsTimes);
strInfo=str;
SetStatusInfo(strInfo,1);
UpdateShow();
continue;
case WAIT_OBJECT_0 + 2:
while (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg); ////当鼠标按住对话框标题栏移动时
}
continue;
default:
break; // unexpected failure
}
break;
}