📄 hmican_usbdlg.cpp
字号:
m_tip5.ShowWindow(SW_SHOW);
m_tip6.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==5)
{
m_static_SET6.SetFocus();
m_static_SET6.bkColor( bk1 );
m_static_SET5.bkColor( bk );
m_static_SET7.bkColor( bk );
m_tip5.ShowWindow(SW_HIDE);
m_tip6.ShowWindow(SW_SHOW);
m_tip7.ShowWindow(SW_HIDE);
return TRUE;
}
if(index==6)
{
m_static_SET7.SetFocus();
m_static_SET7.bkColor( bk1 );
m_static_SET6.bkColor( bk );
m_static_SET1.bkColor( bk );
m_tip6.ShowWindow(SW_HIDE);
m_tip7.ShowWindow(SW_SHOW);
m_tip1.ShowWindow(SW_HIDE);
return TRUE;
}
}
//退出对话框
if(pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_ESCAPE)
{
CHMIexitDlg* HMIexitDlg=new CHMIexitDlg;
HMIexitDlg->Create(IDD_DIALOG_EXIT,NULL);
HMIexitDlg->ShowWindow(SW_SHOW);
HMIexitDlg->HMIcan_usbDlg=this;
return TRUE;
}
//响应回车键
if(pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_RETURN)
{
//先把焦点交到几个按钮处
if(CHMIcan_usbDlg::GetFocus() != GetDlgItem(IDC_CTRL_SET1)&&
CHMIcan_usbDlg::GetFocus() != GetDlgItem(IDC_CTRL_SET2)&&
CHMIcan_usbDlg::GetFocus() != GetDlgItem(IDC_CTRL_SET3)&&
CHMIcan_usbDlg::GetFocus() != GetDlgItem(IDC_CTRL_SET4)&&
CHMIcan_usbDlg::GetFocus() != GetDlgItem(IDC_CTRL_SET5)&&
CHMIcan_usbDlg::GetFocus() != GetDlgItem(IDC_CTRL_SET6)&&
CHMIcan_usbDlg::GetFocus() != GetDlgItem(IDC_CTRL_SET7))
{
m_static_SET1.SetFocus();
}
if(CHMIcan_usbDlg::GetFocus() == GetDlgItem(IDC_CTRL_SET1))
{
CSCDSET * SCDSET=new CSCDSET;
SCDSET->Create(IDD_DIALOG_SCDSET,NULL);
SCDSET->ShowWindow(SW_SHOW);
SCDSET->HMIcan_usbDlg=this;
return TRUE;
}
if(CHMIcan_usbDlg::GetFocus() == GetDlgItem(IDC_CTRL_SET2))
{
CCXTSET * CXTSET=new CCXTSET;
CXTSET->Create(IDD_DIALOG_CXTSET,NULL);
CXTSET->ShowWindow(SW_SHOW);
CXTSET->HMIcan_usbDlg=this;
return TRUE;
}
if(CHMIcan_usbDlg::GetFocus() == GetDlgItem(IDC_CTRL_SET3))
{
CP_TOILSET * P_TOILSET=new CP_TOILSET;
P_TOILSET->Create(IDD_DIALOG_P_TOILSET,NULL);
P_TOILSET->ShowWindow(SW_SHOW);
P_TOILSET->HMIcan_usbDlg=this;
return TRUE;
}
if(CHMIcan_usbDlg::GetFocus() == GetDlgItem(IDC_CTRL_SET4))
{
CMODE * MODE=new CMODE;
MODE->Create(IDD_DIALOG_MODE,NULL);
MODE->ShowWindow(SW_SHOW);
MODE->HMIcan_usbDlg=this;
return TRUE;
}
if(CHMIcan_usbDlg::GetFocus() == GetDlgItem(IDC_CTRL_SET5))
{
CMXA_MEP * MXA_MEP=new CMXA_MEP;
MXA_MEP->Create(IDD_DIALOG_MXA_MEP,NULL);
MXA_MEP->ShowWindow(SW_SHOW);
MXA_MEP->HMIcan_usbDlg=this;
return TRUE;
}
if(CHMIcan_usbDlg::GetFocus() == GetDlgItem(IDC_CTRL_SET6))
{
CMXA_MEP_BIG * MXA_MEP_BIG=new CMXA_MEP_BIG;
MXA_MEP_BIG->Create(IDD_DIALOG_MXA_MEP_BIG,NULL);
MXA_MEP_BIG->ShowWindow(SW_SHOW);
MXA_MEP_BIG->HMIcan_usbDlg=this;
return TRUE;
}
if(CHMIcan_usbDlg::GetFocus() == GetDlgItem(IDC_CTRL_SET7))
{
CMXA_MEP_SMALL * MXA_MEP_SMALL=new CMXA_MEP_SMALL;
MXA_MEP_SMALL->Create(IDD_DIALOG_MXA_MEP_SMALL,NULL);
MXA_MEP_SMALL->ShowWindow(SW_SHOW);
MXA_MEP_SMALL->HMIcan_usbDlg=this;
return TRUE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
void CHMIcan_usbDlg::OnDestroy()
{
OnOK();
CDialog::OnDestroy();
// TODO: Add your message handler code here
}
void CHMIcan_usbDlg::OnTimer(UINT nIDEvent)
{
CString showstr;
if(nIDEvent==1)
{
m_static_SET1.SetFocus();
KillTimer(1);
}
if(nIDEvent==2)
{
/////////////////////////////定时更新柱状
if(theApp.ACUisMain)
{
//赋值显示
showstr.Format("%d",theApp.Speed);
prog1=theApp.Speed;
this->GetDlgItem(IDC_N_NUM)->SetWindowText(showstr);
this->GetDlgItem(IDC_EDIT_N)->SetWindowText(showstr);
showstr.Format("%d",theApp.Load);
prog3=theApp.Load;
this->GetDlgItem(IDC_POIL_NUM)->SetWindowText(showstr);
this->GetDlgItem(IDC_EDIT_INC)->SetWindowText(showstr);
showstr.Format("%d",theApp.Temp);
prog2=theApp.Temp;
this->GetDlgItem(IDC_MEP_NUM)->SetWindowText(showstr);
this->GetDlgItem(IDC_EDIT_TOIL)->SetWindowText(showstr);
show();
}
else
{
//赋值显示
showstr.Format("%d",theApp.SpeedB);
prog1=theApp.SpeedB;
this->GetDlgItem(IDC_N_NUM)->SetWindowText(showstr);
this->GetDlgItem(IDC_EDIT_N)->SetWindowText(showstr);
showstr.Format("%d",theApp.LoadB);
prog3=theApp.LoadB;
this->GetDlgItem(IDC_POIL_NUM)->SetWindowText(showstr);
this->GetDlgItem(IDC_EDIT_INC)->SetWindowText(showstr);
showstr.Format("%d",theApp.TempB);
prog2=theApp.TempB;
this->GetDlgItem(IDC_MEP_NUM)->SetWindowText(showstr);
this->GetDlgItem(IDC_EDIT_TOIL)->SetWindowText(showstr);
show();
}
////////////////////定时更新亮灯
////////启动停止
if(theApp.IsStart[0]==1) m_Dg11.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg11.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[1]==1) m_Dg21.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg21.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[2]==1) m_Dg31.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg31.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[3]==1) m_Dg41.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg41.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[4]==1) m_Dg51.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg51.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[5]==1) m_Dg61.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg61.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[6]==1) m_Dg71.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg71.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[7]==1) m_Dg81.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg81.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[8]==1) m_Dg91.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg91.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[9]==1) m_Dg101.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg101.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[10]==1) m_Dg111.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg111.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[121]==1) m_Dg121.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg121.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[12]==1) m_Dg131.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg131.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[13]==1) m_Dg141.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg141.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[14]==1) m_Dg151.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg151.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsStart[15]==1) m_Dg161.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg161.SetLed(CLed::LED_COLOR_RED,0,65);
///////////正常中断
if(theApp.IsNormal[0]==1) m_Dg12.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg12.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[1]==1) m_Dg22.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg22.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[2]==1) m_Dg32.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg32.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[3]==1) m_Dg42.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg42.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[4]==1) m_Dg52.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg52.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[5]==1) m_Dg62.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg62.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[6]==1) m_Dg72.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg72.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[7]==1) m_Dg82.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg82.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[8]==1) m_Dg92.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg92.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[9]==1) m_Dg102.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg102.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[10]==1) m_Dg112.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg112.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[122]==1) m_Dg122.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg122.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[132]==1) m_Dg132.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg132.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[13]==1) m_Dg142.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg142.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[14]==1) m_Dg152.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg152.SetLed(CLed::LED_COLOR_RED,0,65);
if(theApp.IsNormal[15]==1) m_Dg162.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else m_Dg162.SetLed(CLed::LED_COLOR_RED,0,65);
//////////////////测试状态
//000表示正常,001表示转速测试,010表示负荷测试,011表示转速负荷测试,100表示频率测试,
if(theApp.state[0]==0) m_Dg12.SetLed(CLed::LED_COLOR_GREEN,0,65);//65是方形模式
else if(theApp.state[0]==1) m_Dg12.SetLed(CLed::LED_COLOR_RED,0,65);
else if(theApp.state[0]==2) m_Dg12.SetLed(CLed::LED_COLOR_RED,0,65);
else if(theApp.state[0]==3) m_Dg12.SetLed(CLed::LED_COLOR_RED,0,65);
else if(theApp.state[0]==4) m_Dg12.SetLed(CLed::LED_COLOR_RED,0,65);
/* CString showstr;
showstr.Format("%d",theApp.state[0]);
GetDlgItem(IDC_EDIT1)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[1]);
GetDlgItem(IDC_EDIT2)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[2]);
GetDlgItem(IDC_EDIT3)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[3]);
GetDlgItem(IDC_EDIT4)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[4]);
GetDlgItem(IDC_EDIT5)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[5]);
GetDlgItem(IDC_EDIT6)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[6]);
GetDlgItem(IDC_EDIT7)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[7]);
GetDlgItem(IDC_EDIT8)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[8]);
GetDlgItem(IDC_EDIT9)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[9]);
GetDlgItem(IDC_EDIT10)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[10]);
GetDlgItem(IDC_EDIT11)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[11]);
GetDlgItem(IDC_EDIT12)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[12]);
GetDlgItem(IDC_EDIT13)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[13]);
GetDlgItem(IDC_EDIT14)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[14]);
GetDlgItem(IDC_EDIT15)->SetWindowText(showstr);
showstr.Format("%d",theApp.state[15]);
GetDlgItem(IDC_EDIT16)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[0]);
GetDlgItem(IDC_H1)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[1]);
GetDlgItem(IDC_H2)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[2]);
GetDlgItem(IDC_H3)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[3]);
GetDlgItem(IDC_H4)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[4]);
GetDlgItem(IDC_H5)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[5]);
GetDlgItem(IDC_H6)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[6]);
GetDlgItem(IDC_H7)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[7]);
GetDlgItem(IDC_H8)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[8]);
GetDlgItem(IDC_H9)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[9]);
GetDlgItem(IDC_H10)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[10]);
GetDlgItem(IDC_H11)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[11]);
GetDlgItem(IDC_H12)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[12]);
GetDlgItem(IDC_H13)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[13]);
GetDlgItem(IDC_H14)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[14]);
GetDlgItem(IDC_H15)->SetWindowText(showstr);
showstr.Format("%d",theApp.rank[15]);
GetDlgItem(IDC_H16)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[0]);
GetDlgItem(IDC_EDIT1B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[1]);
GetDlgItem(IDC_EDIT2B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[2]);
GetDlgItem(IDC_EDIT3B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[3]);
GetDlgItem(IDC_EDIT4B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[4]);
GetDlgItem(IDC_EDIT5B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[5]);
GetDlgItem(IDC_EDIT6B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[6]);
GetDlgItem(IDC_EDIT7B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[7]);
GetDlgItem(IDC_EDIT8B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[8]);
GetDlgItem(IDC_EDIT9B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[9]);
GetDlgItem(IDC_EDIT10B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[10]);
GetDlgItem(IDC_EDIT11B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[11]);
GetDlgItem(IDC_EDIT12B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[12]);
GetDlgItem(IDC_EDIT13B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[13]);
GetDlgItem(IDC_EDIT14B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[14]);
GetDlgItem(IDC_EDIT15B)->SetWindowText(showstr);
showstr.Format("%d",theApp.stateB[15]);
GetDlgItem(IDC_EDIT16B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[0]);
GetDlgItem(IDC_H1B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[1]);
GetDlgItem(IDC_H2B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[2]);
GetDlgItem(IDC_H3B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[3]);
GetDlgItem(IDC_H4B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[4]);
GetDlgItem(IDC_H5B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[5]);
GetDlgItem(IDC_H6B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[6]);
GetDlgItem(IDC_H7B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[7]);
GetDlgItem(IDC_H8B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[8]);
GetDlgItem(IDC_H9B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[9]);
GetDlgItem(IDC_H10B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[10]);
GetDlgItem(IDC_H11B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[11]);
GetDlgItem(IDC_H12B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[12]);
GetDlgItem(IDC_H13B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[13]);
GetDlgItem(IDC_H14B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[14]);
GetDlgItem(IDC_H15B)->SetWindowText(showstr);
showstr.Format("%d",theApp.rankB[15]);
GetDlgItem(IDC_H16B)->SetWindowText(showstr);
*/
}
if(nIDEvent==3)
{
CListBox *pList = (CListBox*)GetDlgItem(IDC_LIST1);
while(pList->GetCount()>0)
{
pList->DeleteString(0);
}
if(theApp.ACUisMain)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -