網(wǎng)頁設(shè)計 網(wǎng)站建設(shè) 哪個好產(chǎn)品代理推廣方案
? 啟動按鈕夾緊 密閉,時間0到平衡 進氣,時間1到進氣關(guān),時間2到平衡關(guān) 檢測,時間3到平衡 排氣,時間4到夾緊開、密閉開、排氣關(guān)。
?相關(guān)代碼
void CSEAL_PRESSUREDlg::OnTimer_2(UINT nIDEvent_2)
{// if (nIDEvent_2==1 && t_time_2<=theApp.m_sys_data.m_fMaxTime*10)if (nIDEvent_2==1 ){t_time_1++; YRandom = rand()%3; // Generate Random data m_ctrlPlot_1.GetChannel(0).AddXY(t_time_1/10, YRandom );} if (nIDEvent_2==1 && t_time_2<theApp.m_edit_time0*10){t_time_2++;DO6408Bit(theApp.nAddr_1,theApp.O_1[0],1);//夾緊 DO6408Bit(theApp.nAddr_1,theApp.O_1[1],1);//密閉SetDlgItemText(IDC_EDIT_MESSAGE,"夾緊\密閉");} else if ( t_time_2<theApp.m_edit_time1){t_time_2++;DO6408Bit(theApp.nAddr_1,theApp.O_1[3],1);//平衡開DO6408Bit(theApp.nAddr_1,theApp.O_1[2],1);//進氣 SetDlgItemText(IDC_EDIT_MESSAGE,"夾緊\密閉\r\n平衡\進氣");}else if ( t_time_2<theApp.m_edit_time2){ t_time_2++;DO6408Bit(theApp.nAddr_1,theApp.O_1[2],0);//進氣關(guān)SetDlgItemText(IDC_EDIT_MESSAGE,"夾緊\密閉\r\n平衡\進氣\r\n進氣關(guān)");}else if (t_time_2<theApp.m_edit_time3){t_time_2++;DO6408Bit(theApp.nAddr_1,theApp.O_1[3],0);//平衡關(guān)\檢測SetDlgItemText(IDC_EDIT_MESSAGE,"夾緊\密閉\r\n平衡\進氣\r\n進氣關(guān)\r\n平衡關(guān)\檢測");}else if (t_time_2<theApp.m_edit_time4){t_time_2++;DO6408Bit(theApp.nAddr_1,theApp.O_1[3],1);//平衡開DO6408Bit(theApp.nAddr_1,theApp.O_1[4],1);//排氣開SetDlgItemText(IDC_EDIT_MESSAGE,"夾緊\密閉\r\n平衡\進氣\r\n進氣關(guān)\r\n平衡關(guān)\檢測\r\n平衡\排氣");}else {DO6408Bit(theApp.nAddr_1,theApp.O_1[4],0);//排氣關(guān)DO6408Bit(theApp.nAddr_1,theApp.O_1[3],0);//排氣關(guān)DO6408Bit(theApp.nAddr_1,theApp.O_1[0],0);//夾緊松DO6408Bit(theApp.nAddr_1,theApp.O_1[1],0);//密閉松SetDlgItemText(IDC_EDIT_MESSAGE,"結(jié)束");theApp.m_edit_time1= theApp.m_allPara[theApp.m_nProductSel].m_edit_time1;theApp.m_edit_time2= theApp.m_allPara[theApp.m_nProductSel].m_edit_time2;theApp.m_edit_time3= theApp.m_allPara[theApp.m_nProductSel].m_edit_time3;theApp.m_edit_time4= theApp.m_allPara[theApp.m_nProductSel].m_edit_time4;DestroyTimer();DestroyTimer_2();} }