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

📄 setwnddlg.cpp

📁 波峰焊后台控制软件-英文版
💻 CPP
📖 第 1 页 / 共 4 页
字号:
// SetWndDlg.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "SetWndDlg.h"
#include "FLADS.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSetWndDlg dialog
static UINT WeekOnID[5] = 
{ 
IDC_ONSET1,IDC_ONSET2,IDC_ONSET3,IDC_ONSET4,IDC_ONSET5
};

static UINT WeekOfID[5] = 
{ 
IDC_OFFSET1, IDC_OFFSET2, IDC_OFFSET3, IDC_OFFSET4, IDC_OFFSET5
};

extern CFLADSApp theApp;
CSetWndDlg::CSetWndDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSetWndDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSetWndDlg)
	//}}AFX_DATA_INIT
}


void CSetWndDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSetWndDlg)
	DDX_Control(pDX, IDC_AUTO_DISABLE, m_auto_disable);
	DDX_Control(pDX, IDC_AUTO_ENABLE, m_auto_enable);
	DDX_Control(pDX, IDC_SL_UP_ENABLE, m_up_enable);
	DDX_Control(pDX, IDC_SL_UP_DISABLE, m_up_disable);
	DDX_Control(pDX, IDC_RIGHT_CHECK, m_right_sel);
	DDX_Control(pDX, IDC_LEFT_CHECK, m_left_sel);
	DDX_Control(pDX, IDC_FP_CHECK, m_fp_sel);
	DDX_Control(pDX, IDC_PW_CHECK, m_pw_sel);
	DDX_Control(pDX, IDC_HWAVE_CHECK, m_hwave);
	DDX_Control(pDX, IDC_DWAVE_CHECK, m_dwave);
	DDX_Control(pDX, IDC_3TEMP_CHECK, m_3temp);
	DDX_Control(pDX, IDC_2TEMP_CHECK, m_2temp);
	DDX_Control(pDX, IDC_ENGLISH_CHECK, m_english);
	DDX_Control(pDX, IDC_CHINESE_CHECK, m_chinese);
	DDX_Control(pDX, IDC_SLIDER_JJRUN_BACK, m_jjback);
	DDX_Control(pDX, IDC_SLIDER_JJRUN, m_jjrun);
	DDX_Control(pDX, IDC_WARNTABCTL, m_warntabctl);
	DDX_Control(pDX, IDC_WEEKTABCTL, m_week);
	DDX_Control(pDX, IDC_SLIDER_SXOUT, m_sxspeed);
	DDX_Control(pDX, IDC_SLIDER_PWWITH, m_pwwith);
	DDX_Control(pDX, IDC_SLIDER_PWLEN, m_pwlen);
	DDX_Control(pDX, IDC_SLIDER_N2OUT, m_n2out);
	DDX_Control(pDX, IDC_SLIDER_BJMD, m_bjmd);
	DDX_Control(pDX, IDC_SLIDER_RH1, m_silder_rh1);
	DDX_Control(pDX, IDC_SLIDER_RH2, m_silder_rh2);
	DDX_Control(pDX, IDC_SLIDER_RH3, m_silder_rh3);
	DDX_Control(pDX, IDC_SLIDER_SL, m_silder_sl);
	DDX_Control(pDX, IDC_SLIDER_WS1, m_silder_ws1);
	DDX_Control(pDX, IDC_SLIDER_WS2, m_silder_ws2);
	DDX_Control(pDX, IDC_SLIDER_TRANS, m_silder_trans);
	DDX_Control(pDX, IDC_SLIDER_PWBM, m_pwbm);
	DDX_Control(pDX, IDC_FAN_SLIDER, m_fan_slider);
	DDX_Control(pDX, IDC_ONSET5, m_onset5);
	DDX_Control(pDX, IDC_ONSET4, m_onset4);
	DDX_Control(pDX, IDC_ONSET3, m_onset3);
	DDX_Control(pDX, IDC_ONSET2, m_onset2);
	DDX_Control(pDX, IDC_ONSET1, m_onset1);
	DDX_Control(pDX, IDC_ONSET, m_onset);
	DDX_Control(pDX, IDC_OFFSET5, m_offset5);
	DDX_Control(pDX, IDC_OFFSET4, m_offset4);
	DDX_Control(pDX, IDC_OFFSET3, m_offset3);
	DDX_Control(pDX, IDC_OFFSET2, m_offset2);
	DDX_Control(pDX, IDC_OFFSET1, m_offset1);
	DDX_Control(pDX, IDC_OFFSET, m_offset);
	DDX_Control(pDX, IDC_TIMERCHK5, m_timerchk5);
	DDX_Control(pDX, IDC_TIMERCHK4, m_timerchk4);
	DDX_Control(pDX, IDC_TIMERCHK3, m_timerchk3);
	DDX_Control(pDX, IDC_TIMERCHK2, m_timerchk2);
	DDX_Control(pDX, IDC_TIMERCHK1, m_timerchk1);
	DDX_Control(pDX, IDC_WARNCHK, m_warnchk);
	DDX_Control(pDX, IDC_RLTEMPER, m_rlt);
	DDX_Control(pDX, IDC_RLPASS, m_rlpass);
	DDX_Control(pDX, IDC_RLEAKTEMPER, m_rltempers);
	DDX_Control(pDX, IDC_REV_CHECK, m_rev);
	DDX_Control(pDX, IDC_FWD_CHECK, m_fwd);
	DDX_Control(pDX, IDC_TKTZ_ENABLE,  m_tktz_enable );
	DDX_Control(pDX, IDC_TKTZ_DISABLE, m_tktz_disable);
	DDX_Control(pDX, IDC_WORKMODE2, m_workmode2);
	DDX_Control(pDX, IDC_WORKMODE1, m_workmode1);
	DDX_Control(pDX, IDC_CHKTEMP3, m_chktemp3);
	DDX_Control(pDX, IDC_CHKTEMP2, m_chktemp2);
	DDX_Control(pDX, IDC_CHKTEMP1, m_chktemp1);
	DDX_Control(pDX, IDC_RESETOUT, m_resetout);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSetWndDlg, CDialog)
	//{{AFX_MSG_MAP(CSetWndDlg)
	ON_WM_CTLCOLOR()
	ON_WM_DESTROY()
	ON_EN_CHANGE(IDC_SETRH1, OnChangeSetrh1)
	ON_EN_CHANGE(IDC_SETRH2, OnChangeSetrh2)
	ON_EN_CHANGE(IDC_SETRH3, OnChangeSetrh3)
	ON_EN_CHANGE(IDC_SETSL, OnChangeSetsl)
	ON_EN_CHANGE(IDC_SETWS1, OnChangeSetws1)
	ON_EN_CHANGE(IDC_SETWS2, OnChangeSetws2)
	ON_EN_CHANGE(IDC_SETTRANS, OnChangeSettrans)
	ON_EN_CHANGE(IDC_FAN_EDIT, OnChangeFanEdit)
	ON_EN_CHANGE(IDC_PWBM_NUM, OnChangePwbmNum)
	ON_EN_CHANGE(IDC_PWWITH, OnChangePwwith)
	ON_EN_CHANGE(IDC_PWBOARDEDIT, OnChangePwboardedit)
	ON_EN_CHANGE(IDC_BJMA, OnChangeBjma)
	ON_EN_CHANGE(IDC_N2OUT, OnChangeN2out)
	ON_EN_CHANGE(IDC_SXOUT, OnChangeSxout)
	ON_WM_TIMER()
	ON_BN_CLICKED(IDC_TIMERCHK1, OnTimerchk1)
	ON_BN_CLICKED(IDC_TIMERCHK2, OnTimerchk2)
	ON_BN_CLICKED(IDC_TIMERCHK3, OnTimerchk3)
	ON_BN_CLICKED(IDC_TIMERCHK4, OnTimerchk4)
	ON_BN_CLICKED(IDC_TIMERCHK5, OnTimerchk5)
	ON_EN_CHANGE(IDC_ONSET1, OnChangeOnset1)
	ON_EN_CHANGE(IDC_ONSET2, OnChangeOnset2)
	ON_EN_CHANGE(IDC_ONSET3, OnChangeOnset3)
	ON_EN_CHANGE(IDC_ONSET4, OnChangeOnset4)
	ON_EN_CHANGE(IDC_ONSET5, OnChangeOnset5)
	ON_EN_CHANGE(IDC_OFFSET1, OnChangeOffset1)
	ON_EN_CHANGE(IDC_OFFSET2, OnChangeOffset2)
	ON_EN_CHANGE(IDC_OFFSET3, OnChangeOffset3)
	ON_EN_CHANGE(IDC_OFFSET4, OnChangeOffset4)
	ON_EN_CHANGE(IDC_OFFSET5, OnChangeOffset5)
	ON_EN_CHANGE(IDC_UPWARNEDIT, OnChangeUpwarnedit)
	ON_EN_CHANGE(IDC_DNWARNEDIT, OnChangeDnwarnedit)
	ON_BN_CLICKED(IDC_WARNCHK, OnWarnchk)
	ON_EN_CHANGE(IDC_RLTEMPER, OnChangeRltemper)
	ON_EN_CHANGE(IDC_RLPASS, OnChangeRlpass)
	ON_BN_CLICKED(IDC_FWD_CHECK, OnFwdCheck)
	ON_BN_CLICKED(IDC_REV_CHECK, OnRevCheck)
	ON_BN_CLICKED(IDC_TKTZ_ENABLE, OnTktzEnable)
	ON_BN_CLICKED(IDC_TKTZ_DISABLE, OnTktzDisable)
	ON_BN_CLICKED(IDC_WORKMODE1, OnWorkmode1)
	ON_BN_CLICKED(IDC_WORKMODE2, OnWorkmode2)
	ON_BN_CLICKED(IDC_CHKTEMP1, OnChktemp1)
	ON_BN_CLICKED(IDC_CHKTEMP2, OnChktemp2)
	ON_BN_CLICKED(IDC_CHKTEMP3, OnChktemp3)
	ON_EN_CHANGE(IDC_TRANSSCALE, OnChangeTransscale)
	ON_EN_CHANGE(IDC_OUTSET_EDIT, OnChangeOutsetEdit)
	ON_EN_CHANGE(IDC_OUTOFFSET_EDIT, OnChangeOutoffsetEdit)
	ON_BN_CLICKED(IDC_RESETOUT, OnResetout)
	ON_EN_CHANGE(IDC_BOARD_BASE, OnChangeBoardBase)
	ON_BN_CLICKED(IDC_BOARD_SET, OnBoardSet)
	ON_EN_CHANGE(IDC_JJRUN, OnChangeJjrun)
	ON_EN_CHANGE(IDC_JJRUN_BACK, OnChangeJjrunBack)
	ON_BN_CLICKED(IDC_CHINESE_CHECK, OnChineseCheck)
	ON_BN_CLICKED(IDC_ENGLISH_CHECK, OnEnglishCheck)
	ON_BN_CLICKED(IDC_2TEMP_CHECK, On2tempCheck)
	ON_BN_CLICKED(IDC_3TEMP_CHECK, On3tempCheck)
	ON_BN_CLICKED(IDC_HWAVE_CHECK, OnHwaveCheck)
	ON_BN_CLICKED(IDC_DWAVE_CHECK, OnDwaveCheck)
	ON_BN_CLICKED(IDC_PW_CHECK, OnPwCheck)
	ON_BN_CLICKED(IDC_FP_CHECK, OnFpCheck)
	ON_BN_CLICKED(IDC_LEFT_CHECK, OnLeftCheck)
	ON_BN_CLICKED(IDC_RIGHT_CHECK, OnRightCheck)
	ON_BN_CLICKED(IDC_SL_UP_ENABLE, OnSlUpEnable)
	ON_BN_CLICKED(IDC_SL_UP_DISABLE, OnSlUpDisable)
	ON_BN_CLICKED(IDC_AUTO_ENABLE, OnAutoEnable)
	ON_BN_CLICKED(IDC_AUTO_DISABLE, OnAutoDisable)
	ON_EN_CHANGE(IDC_SL_FAN_EDIT, OnChangeSlFanEdit)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSetWndDlg message handlers

HBRUSH CSetWndDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	
	// TODO: Change any attributes of the DC here
	int i;
	double  dx;
	CString string;

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



    if( pWnd->m_hWnd ==  m_silder_rh1.m_hWnd)
	{
         if(theApp.rh1_flash==0)
		 {
			i=m_silder_rh1.GetPos();
			dx=(double)i;
			dx=dx/10;
			theApp.rh1_temper_set=dx;		
			string.Format(_T("%3.1f"),theApp.rh1_temper_set);
			SetDlgItemText(IDC_SETRH1,string); 
		 }
		 theApp.rh1_flash=0;
	}
    
    if( pWnd->m_hWnd ==  m_silder_rh2.m_hWnd)
	{
         if(theApp.rh2_flash==0)
		 {

			i=m_silder_rh2.GetPos();
			dx=(double)i;
			dx=dx/10;
			theApp.rh2_temper_set=dx;		
			string.Format(_T("%3.1f"),theApp.rh2_temper_set);
			SetDlgItemText(IDC_SETRH2,string); 
		 }
		 theApp.rh2_flash=0;
	}

    if( pWnd->m_hWnd ==  m_silder_rh3.m_hWnd)
	{
         if(theApp.rh3_flash==0)
		 {

			i=m_silder_rh3.GetPos();
			dx=(double)i;
			dx=dx/10;
			theApp.rh3_temper_set=dx;		
			string.Format(_T("%3.1f"),theApp.rh3_temper_set);
			SetDlgItemText(IDC_SETRH3,string); 
		 }
		 theApp.rh3_flash=0;
	}



    if( pWnd->m_hWnd ==  m_silder_sl.m_hWnd)
	{
         if(theApp.sl_flash==0)
		 {

			i=m_silder_sl.GetPos();
			dx=(double)i;
			dx=dx/10;
			theApp.sl_temper_set=dx;		
			string.Format(_T("%3.1f"),theApp.sl_temper_set);
			SetDlgItemText(IDC_SETSL,string); 
		 }
		 theApp.sl_flash=0;
	}

    if( pWnd->m_hWnd ==  m_silder_ws1.m_hWnd)
	{
         if(theApp.ws1_flash==0)
		 {

			i=m_silder_ws1.GetPos();
			dx=(double)i;
			dx=dx/10;
			theApp.ws1_temper_set=dx;		
			string.Format(_T("%3.1f"),theApp.ws1_temper_set);
			SetDlgItemText(IDC_SETWS1,string); 
		 }
         theApp.ws1_flash=0;
	}

    if( pWnd->m_hWnd ==  m_silder_ws2.m_hWnd)
	{
         if(theApp.ws2_flash==0)
		 {

			i=m_silder_ws2.GetPos();
			dx=(double)i;
			dx=dx/10;
			theApp.ws2_temper_set=dx;		
			string.Format(_T("%3.1f"),theApp.ws2_temper_set);
			SetDlgItemText(IDC_SETWS2,string); 
		 }
         theApp.ws2_flash=0;
	}

    if( pWnd->m_hWnd ==  m_silder_trans.m_hWnd)
	{
         if(theApp.trans_flash==0)
		 {

			i=m_silder_trans.GetPos();
			dx=(double)i;
			theApp.trans_speed_set=dx;		
			string.Format(_T("%3.1f"),theApp.trans_speed_set);
			SetDlgItemText(IDC_SETTRANS,string); 
//			if(m_transon.m_nColor==28) theApp.TransOn();
		 }
		 theApp.trans_flash=0;
	}

    if( pWnd->m_hWnd ==  m_fan_slider.m_hWnd)
	{
         if(theApp.fan_flash==0)
		 {

			i=m_fan_slider.GetPos();
			dx=(double)i;
			theApp.fan_set=dx;		
			string.Format(_T("%4.0f"),theApp.fan_set);
			SetDlgItemText(IDC_FAN_EDIT,string); 
			if(theApp.yxtask.BitTestChar(theApp.yxtask.yxbuf,130))
			{
				theApp.FanOn();
			}else
			{
	             if(theApp.yxtask.BitTestChar(theApp.yxtask.yxbuf,131))
				 {
					 theApp.FanOn();
				 }else
				 {
	                 if(theApp.yxtask.BitTestChar(theApp.yxtask.yxbuf,132)) theApp.FanOn();
				 }
			}
		 }
		 theApp.fan_flash=0;
	}



    if( pWnd->m_hWnd ==  m_pwbm.m_hWnd)
	{
		    if(theApp.pwbm_flash==0)
			{
				i=m_pwbm.GetPos();
				theApp.PW_Count=i;		
				string.Format(_T("%4d"),i);
				SetDlgItemText(IDC_PWBM_NUM,string); 
			}
		    theApp.pwbm_flash=0;

	}

    if( pWnd->m_hWnd ==  m_pwlen.m_hWnd)
	{
		    if(theApp.pwlen_flash==0)
			{
				i=m_pwlen.GetPos();
				theApp.PW_Length=i;		
				string.Format(_T("%4d"),i);
				SetDlgItemText(IDC_PWBOARDEDIT,string); 
			}
		    theApp.pwlen_flash=0;
	}

    if(pWnd->m_hWnd ==  m_pwwith.m_hWnd)
	{
		    if(theApp.pwwith_flash==0)
			{
				i=m_pwwith.GetPos();
				theApp.PW_With=i;		
				string.Format(_T("%4d"),i);
				SetDlgItemText(IDC_PWWITH,string); 
			}
		    theApp.pwwith_flash=0;
	}

    if(pWnd->m_hWnd ==  m_jjback.m_hWnd)
	{
		    if(theApp.jjback_flash==0)
			{
				i=m_jjback.GetPos();
				theApp.jjback_len=i;		
				string.Format(_T("%4d"),i);
				SetDlgItemText(IDC_JJRUN_BACK,string); 
			}
		    theApp.jjback_flash=0;
	}

    if(pWnd->m_hWnd ==  m_jjrun.m_hWnd)
	{
		    if(theApp.jjrun_flash==0)
			{
				i=m_jjrun.GetPos();
				theApp.jjrun_len=i;		
				string.Format(_T("%4d"),i);
				SetDlgItemText(IDC_JJRUN,string); 
			}
		    theApp.jjrun_flash=0;
	}



    if( pWnd->m_hWnd ==  m_bjmd.m_hWnd)
	{
		    if(theApp.bjmd_flash==0)
			{
				i=m_bjmd.GetPos();
				theApp.Bjmd_speed=i;
				string.Format(_T("%4d"),i);
				SetDlgItemText(IDC_BJMA,string); 
			}
		    theApp.bjmd_flash=0;
	}

    if( pWnd->m_hWnd ==  m_n2out.m_hWnd)
	{
		    if(theApp.n2out_flash==0)
			{
				i=m_n2out.GetPos();
				theApp.N2_Speed=i;		
				string.Format(_T("%4d"),i);
				SetDlgItemText(IDC_N2OUT,string); 
			}
		    theApp.n2out_flash=0;
	}

    if( pWnd->m_hWnd ==  m_sxspeed.m_hWnd)
	{
		    if(theApp.sxout_flash==0)
			{
				i=m_sxspeed.GetPos();
				theApp.Sx_Speed=i;		
				string.Format(_T("%4d"),i);
				SetDlgItemText(IDC_SXOUT,string); 
			}
		    theApp.sxout_flash=0;
	}
	if( pWnd->m_hWnd == m_week.m_hWnd)
	{
		pDC->SetBkMode(TRANSPARENT);
        return hbrush;
	}



    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;
}

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

BOOL CSetWndDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	OnInitFlash();
    SetTimer (Set_TIMER,500,NULL);	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CSetWndDlg::OnChangeSetrh1() 
{
	// 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;
    theApp.rh1_flash=0xff;

	GetDlgItemText(IDC_SETRH1,wBuf,20);
	sign=0;
	for (i=0; i<31; i++)
	{
        if(wBuf[i]=='.')  
		{
             sign=0xff;
			 j=i;
		}
		if(sign!=0)
		{
			wBuf[j]=wBuf[i+1];
		}
		j++;
	}
	theApp.rh1_temper_set=((double)_wtoi(wBuf)/10);
	if(theApp.rh1_temper_set>300)theApp.rh1_temper_set=300;
    m_silder_rh1.SetPos((int)(theApp.rh1_temper_set*10));

}

void CSetWndDlg::OnChangeSetrh2() 
{
	// 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];

⌨️ 快捷键说明

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