⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parawnddlg.cpp

📁 波峰焊后台控制软件-中文版
💻 CPP
📖 第 1 页 / 共 3 页
字号:
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
    unsigned short wBuf[32];
	int i,j,sign;
	GetDlgItemText(IDC_ZERO_SL,wBuf,20);
    theApp.zero[0]=theApp.ReadDataChar(wBuf);
}

void CParaWndDlg::OnChangeIntreglRh1() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
    unsigned short wBuf[32];
	int i,j,sign;
	GetDlgItemText(IDC_INTREGL_RH1,wBuf,20);
    theApp.integral[1]=theApp.ReadDataChar(wBuf);
	
}

void CParaWndDlg::OnChangeIntreglRh2() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
    unsigned short wBuf[32];
	int i,j,sign;
	GetDlgItemText(IDC_INTREGL_RH2,wBuf,20);
    theApp.integral[2]=theApp.ReadDataChar(wBuf);
	
}

void CParaWndDlg::OnChangeIntreglRh3() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
    unsigned short wBuf[32];
	GetDlgItemText(IDC_INTREGL_RH3,wBuf,20);
    theApp.integral[3]=theApp.ReadDataChar(wBuf);	
}

void CParaWndDlg::OnChangeIntreglSl() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
    unsigned short wBuf[32];
	GetDlgItemText(IDC_INTREGL_SL,wBuf,20);
    theApp.integral[0]=theApp.ReadDataChar(wBuf);
}
void CParaWndDlg::OnParaDatFlash() 
{//参数窗 参数 处始化

	CString  string;
	double   dx;
	int   i;

	for(i=0;i<4;i++)
	{	
		dx=theApp.p_gain[i];
		dx=dx/100;
	    string.Format(_T("%03.2f"),dx);
		SetDlgItemText(ParaID[i],  _T(" ")+ string);
	}

	for(i=0;i<4;i++)
	{	
		dx=theApp.i_gain[i];
		dx=dx/100;
	    string.Format(_T("%03.2f"),dx);
		SetDlgItemText(ParaID[4+i],  _T(" ")+ string);
	}

	for(i=0;i<4;i++)
	{	
		dx=theApp.d_gain[i];
		dx=dx/100;
	    string.Format(_T("%03.2f"),dx);
		SetDlgItemText(ParaID[4*2+i],  _T(" ")+ string);
	}

	for(i=0;i<4;i++)
	{	
		dx=theApp.acc_ff[i];
		dx=dx/100;
	    string.Format(_T("%03.2f"),dx);
		SetDlgItemText(ParaID[4*3+i],  _T(" ")+ string);
	}

	for(i=0;i<4;i++)
	{	
		dx=theApp.fri_ff[i];
		dx=dx/100;
	    string.Format(_T("%03.2f"),dx);
		SetDlgItemText(ParaID[4*4+i],  _T(" ")+ string);
	}


	for(i=0;i<4;i++)
	{	
		dx=theApp.vel_ff[i];
		dx=dx/100;
	    string.Format(_T("%03.2f"),dx);
		SetDlgItemText(ParaID[4*5+i],  _T(" ")+ string);
	}

	for(i=0;i<4;i++)
	{	
		dx=theApp.hold[i];
		dx=dx/100;
	    string.Format(_T("%03.2f"),dx);
		SetDlgItemText(ParaID[4*6+i],  _T(" ")+ string);
	}

	for(i=0;i<4;i++)
	{	
		dx=theApp.bias[i];
		dx=dx/100;
	    string.Format(_T("%03.2f"),dx);
		SetDlgItemText(ParaID[4*7+i],  _T(" ")+ string);
	}

	for(i=0;i<4;i++)
	{	
		dx=theApp.accel[i];
		dx=dx/10;
	    string.Format(_T("%03.1f"),dx);
		SetDlgItemText(ParaID[4*8+i],  _T(" ")+ string);
	}

	for(i=0;i<4;i++)
	{	
		dx=theApp.slew[i];
		dx=dx/10;
	    string.Format(_T("%03.2f"),dx);
		SetDlgItemText(ParaID[4*9+i],  _T(" ")+ string);
	}

	for(i=0;i<4;i++)
	{	
		dx=theApp.scale[i];
		dx=dx/1000;
	    string.Format(_T("%01.3f"),dx);
		SetDlgItemText(ParaID[4*10+i],  _T(" ")+ string);
	}
	for(i=0;i<4;i++)
	{	
		dx=theApp.zero[i];
		dx=dx/10;
	    string.Format(_T("%03.1f"),dx);
		SetDlgItemText(ParaID[4*11+i],  _T(" ")+ string);
	}
	for(i=0;i<4;i++)
	{	
		dx=theApp.integral[i];
		dx=dx/10;
	    string.Format(_T("%03.1f"),dx);
		SetDlgItemText(ParaID[4*12+i],  _T(" ")+ string);
	}

	for(i=5;i<8;i++)
	{	
		dx=theApp.scale[i];
		dx=dx/1000;
	    string.Format(_T("%01.3f"),dx);
		SetDlgItemText(ParaID[4*13+i-5],  _T(" ")+ string);
	}

	for(i=5;i<8;i++)
	{	
		dx=theApp.zero[i];
		dx=dx/10;
	    string.Format(_T("%03.1f"),dx);
		SetDlgItemText(ParaID[4*13+3+i-5],  _T(" ")+ string);
	}

	m_split1.SetCheck(theApp.split_flag[0]);
	m_split2.SetCheck(theApp.split_flag[1]);
	m_split3.SetCheck(theApp.split_flag[2]);
	m_split4.SetCheck(theApp.split_flag[3]);

    string.Format(_T("%4d"),theApp.SL_Timer);
	SetDlgItemText(IDC_SL_TIMER,string);
}

void CParaWndDlg::OnDestroy() 
{
	CDialog::OnDestroy();
	
	// TODO: Add your message handler code here
    DeleteObject(hbrush);
    DeleteObject(editbrush);         
	
}

HBRUSH CParaWndDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	
	// TODO: Change any attributes of the DC here




    if(nCtlColor==CTLCOLOR_EDIT)
	{
	    pDC->SetTextColor(RGB(0,0,255) );
		return editbrush;
	}

    if(nCtlColor==CTLCOLOR_STATIC)
	{
	    pDC->SetTextColor(RGB(0,0,255) );
        pDC->SetBkColor(RGB(212, 208, 200) );
	    return hbrush;
	}

  
	return hbrush;
	
	// TODO: Return a different brush if the default is not desired
	return hbr;
}

BOOL CParaWndDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
    OnParaDatFlash();	
    hbrush=CreateSolidBrush(RGB(212, 208, 200));
    editbrush=CreateSolidBrush(RGB(247, 249, 232));
    theApp.ControlMode= Para_Window;

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CParaWndDlg::OnChangeScaleTest1() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
    unsigned short wBuf[32];
	int i,j,sign;
	GetDlgItemText(IDC_SCALE_TEST1,wBuf,20);
    theApp.scale[5]=theApp.ReadDataChar(wBuf);	
}

void CParaWndDlg::OnChangeScaleTest2() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
    unsigned short wBuf[32];
	int i,j,sign;
	GetDlgItemText(IDC_SCALE_TEST2,wBuf,20);
    theApp.scale[6]=theApp.ReadDataChar(wBuf);	
	
}

void CParaWndDlg::OnChangeScaleTest3() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
    unsigned short wBuf[32];
	int i,j,sign;
	GetDlgItemText(IDC_SCALE_TEST3,wBuf,20);
    theApp.scale[7]=theApp.ReadDataChar(wBuf);	
	
}

void CParaWndDlg::OnChangeZeroTest1() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
    unsigned short wBuf[32];
	int i,j,sign;
	GetDlgItemText(IDC_ZERO_TEST1,wBuf,20);
    theApp.zero[5]=theApp.ReadDataChar(wBuf);
	
}

void CParaWndDlg::OnChangeZeroTest2() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
    unsigned short wBuf[32];
	int i,j,sign;
	GetDlgItemText(IDC_ZERO_TEST2,wBuf,20);
    theApp.zero[6]=theApp.ReadDataChar(wBuf);
	
}

void CParaWndDlg::OnChangeZeroTest3() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
    unsigned short wBuf[32];
	int i,j,sign;
	GetDlgItemText(IDC_ZERO_TEST3,wBuf,20);
    theApp.zero[7]=theApp.ReadDataChar(wBuf);
}

void CParaWndDlg::OnSplit1() 
{
	// TODO: Add your control notification handler code here
	if((m_split1.GetCheck()%2)!=0)
	{
         m_split1.SetCheck(1);
		 theApp.split_flag[0]=1;
	}else
	{
         m_split1.SetCheck(0);
		 theApp.split_flag[0]=0;
	}	
}

void CParaWndDlg::OnSplit2() 
{
	// TODO: Add your control notification handler code here
	if((m_split2.GetCheck()%2)!=0)
	{
         m_split2.SetCheck(1);
		 theApp.split_flag[1]=1;
	}else
	{
         m_split2.SetCheck(0);
		 theApp.split_flag[1]=0;
	}	
}

void CParaWndDlg::OnSplit3() 
{
	// TODO: Add your control notification handler code here
	if((m_split3.GetCheck()%2)!=0)
	{
         m_split3.SetCheck(1);
		 theApp.split_flag[2]=1;
	}else
	{
         m_split3.SetCheck(0);
		 theApp.split_flag[2]=0;
	}	
}

void CParaWndDlg::OnSplit4() 
{
	// TODO: Add your control notification handler code here
	if((m_split4.GetCheck()%2)!=0)
	{
         m_split4.SetCheck(1);
		 theApp.split_flag[3]=1;
	}else
	{
         m_split4.SetCheck(0);
		 theApp.split_flag[3]=0;
	}	
}

void CParaWndDlg::OnChangeSlTimer() 
{//锡炉底部开始加热时间
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
    unsigned short wBuf[32];
	int i,j,sign;
	GetDlgItemText(IDC_SL_TIMER,wBuf,20);
    theApp.SL_Timer=_wtoi(wBuf);	
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -