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

📄 plcin1dlg.cpp

📁 波峰焊后台控制软件-英文版
💻 CPP
📖 第 1 页 / 共 2 页
字号:
// PlcIn1Dlg.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "PlcIn1Dlg.h"
#include "FLADS.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CPlcIn1Dlg dialog

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


void CPlcIn1Dlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPlcIn1Dlg)
	DDX_Control(pDX, IDC_PART8, m_pin8);
	DDX_Control(pDX, IDC_PART7, m_pin7);
	DDX_Control(pDX, IDC_PART6, m_pin6);
	DDX_Control(pDX, IDC_PART5, m_pin5);
	DDX_Control(pDX, IDC_PART4, m_pin4);
	DDX_Control(pDX, IDC_PART3, m_pin3);
	DDX_Control(pDX, IDC_PART2, m_pin2);
	DDX_Control(pDX, IDC_PART1, m_pin1);
	DDX_Control(pDX, IDC_UNIT8, m_in8);
	DDX_Control(pDX, IDC_UNIT7, m_in7);
	DDX_Control(pDX, IDC_UNIT6, m_in6);
	DDX_Control(pDX, IDC_UNIT5, m_in5);
	DDX_Control(pDX, IDC_UNIT4, m_in4);
	DDX_Control(pDX, IDC_UNIT3, m_in3);
	DDX_Control(pDX, IDC_UNIT2, m_in2);
	DDX_Control(pDX, IDC_UNIT1, m_in1);
	DDX_Control(pDX, IDC_NENABLE, m_nenable);
	DDX_Control(pDX, IDC_SET_ENABLE, m_set_enable);
	DDX_Control(pDX, IDC_OR_ENABLE, m_or_enable);
	DDX_Control(pDX, IDC_CLR_ENABLE, m_clr_enable);
	DDX_Control(pDX, IDC_AND_ENABLE, m_and_enable);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPlcIn1Dlg, CDialog)
	//{{AFX_MSG_MAP(CPlcIn1Dlg)
	ON_WM_DESTROY()
	ON_BN_CLICKED(IDC_AND_ENABLE, OnAndEnable)
	ON_BN_CLICKED(IDC_OR_ENABLE, OnOrEnable)
	ON_BN_CLICKED(IDC_SET_ENABLE, OnSetEnable)
	ON_BN_CLICKED(IDC_CLR_ENABLE, OnClrEnable)
	ON_BN_CLICKED(IDC_NENABLE, OnNenable)
	ON_EN_CHANGE(IDC_UNIT, OnChangeUnit)
	ON_BN_CLICKED(IDC_UNIT1, OnUnit1)
	ON_BN_CLICKED(IDC_UNIT2, OnUnit2)
	ON_BN_CLICKED(IDC_UNIT3, OnUnit3)
	ON_BN_CLICKED(IDC_UNIT4, OnUnit4)
	ON_BN_CLICKED(IDC_UNIT5, OnUnit5)
	ON_BN_CLICKED(IDC_UNIT6, OnUnit6)
	ON_BN_CLICKED(IDC_UNIT7, OnUnit7)
	ON_BN_CLICKED(IDC_UNIT8, OnUnit8)
	ON_EN_CHANGE(IDC_INPUT1, OnChangeInput1)
	ON_EN_CHANGE(IDC_INPUT2, OnChangeInput2)
	ON_EN_CHANGE(IDC_INPUT3, OnChangeInput3)
	ON_EN_CHANGE(IDC_INPUT4, OnChangeInput4)
	ON_EN_CHANGE(IDC_INPUT5, OnChangeInput5)
	ON_EN_CHANGE(IDC_INPUT6, OnChangeInput6)
	ON_EN_CHANGE(IDC_INPUT7, OnChangeInput7)
	ON_EN_CHANGE(IDC_INPUT8, OnChangeInput8)
	ON_EN_CHANGE(IDC_UNIT_NUM, OnChangeUnitNum)
	ON_BN_CLICKED(IDC_PART1, OnPart1)
	ON_BN_CLICKED(IDC_PART2, OnPart2)
	ON_BN_CLICKED(IDC_PART3, OnPart3)
	ON_BN_CLICKED(IDC_PART4, OnPart4)
	ON_BN_CLICKED(IDC_PART5, OnPart5)
	ON_BN_CLICKED(IDC_PART6, OnPart6)
	ON_BN_CLICKED(IDC_PART7, OnPart7)
	ON_BN_CLICKED(IDC_PART8, OnPart8)
	ON_EN_CHANGE(IDC_EDIT_P1, OnChangeEditP1)
	ON_EN_CHANGE(IDC_EDIT_P2, OnChangeEditP2)
	ON_EN_CHANGE(IDC_EDIT_P3, OnChangeEditP3)
	ON_EN_CHANGE(IDC_EDIT_P4, OnChangeEditP4)
	ON_EN_CHANGE(IDC_EDIT_P5, OnChangeEditP5)
	ON_EN_CHANGE(IDC_EDIT_P6, OnChangeEditP6)
	ON_EN_CHANGE(IDC_EDIT_P7, OnChangeEditP7)
	ON_EN_CHANGE(IDC_EDIT_P8, OnChangeEditP8)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPlcIn1Dlg message handlers

BOOL CPlcIn1Dlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	CString  string;
	int  i;
	
	// TODO: Add extra initialization here


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

void CPlcIn1Dlg::OnDestroy() 
{
	CDialog::OnDestroy();
	
	// TODO: Add your message handler code here
	
}

void CPlcIn1Dlg::OnAndEnable() 
{//与门
	// TODO: Add your control notification handler code here

	if((m_and_enable.GetCheck()%2)!=0)
	{
		   m_and_enable.SetCheck(1);
		   m_or_enable.SetCheck(0);
		   m_set_enable.SetCheck(0);
		   m_clr_enable.SetCheck(0);
		   theApp.yxtask.con_in[theApp.krnum].B.log_enable=0;
	}else
	{
		   m_and_enable.SetCheck(0);
		   m_or_enable.SetCheck(0);
		   m_set_enable.SetCheck(0);
		   m_clr_enable.SetCheck(1);
		   theApp.yxtask.con_in[theApp.krnum].B.log_enable=3;
	}
}

void CPlcIn1Dlg::OnOrEnable() 
{//或门
	// TODO: Add your control notification handler code here
	if((m_or_enable.GetCheck()%2)!=0)
	{
		   m_and_enable.SetCheck(0);
		   m_or_enable.SetCheck(1);
		   m_set_enable.SetCheck(0);
		   m_clr_enable.SetCheck(0);
		   theApp.yxtask.con_in[theApp.krnum].B.log_enable=1;
	}else
	{
		   m_and_enable.SetCheck(0);
		   m_or_enable.SetCheck(0);
		   m_set_enable.SetCheck(0);
		   m_clr_enable.SetCheck(1);
		   theApp.yxtask.con_in[theApp.krnum].B.log_enable=3;
	}	
}

void CPlcIn1Dlg::OnSetEnable() 
{//设置
	// TODO: Add your control notification handler code here
	if((m_set_enable.GetCheck()%2)!=0)
	{
		   m_and_enable.SetCheck(0);
		   m_or_enable.SetCheck(0);
		   m_set_enable.SetCheck(1);
		   m_clr_enable.SetCheck(0);
		   theApp.yxtask.con_in[theApp.krnum].B.log_enable=2;
	}else
	{
		   m_and_enable.SetCheck(0);
		   m_or_enable.SetCheck(0);
		   m_set_enable.SetCheck(0);
		   m_clr_enable.SetCheck(1);
		   theApp.yxtask.con_in[theApp.krnum].B.log_enable=3;
	}	
}

void CPlcIn1Dlg::OnClrEnable() 
{//清零
	// TODO: Add your control notification handler code here
	if((m_clr_enable.GetCheck()%2)!=0)
	{
		   m_and_enable.SetCheck(0);
		   m_or_enable.SetCheck(0);
		   m_set_enable.SetCheck(0);
		   m_clr_enable.SetCheck(1);
		   theApp.yxtask.con_in[theApp.krnum].B.log_enable=3;
	}else
	{
		   m_and_enable.SetCheck(1);
		   m_or_enable.SetCheck(0);
		   m_set_enable.SetCheck(0);
		   m_clr_enable.SetCheck(0);
		   theApp.yxtask.con_in[theApp.krnum].B.log_enable=0;
	}		
}

void CPlcIn1Dlg::OnNenable() 
{//取反
	// TODO: Add your control notification handler code here

	if((m_nenable.GetCheck()%2)!=0)
	{
			m_nenable.SetCheck(1);	
		    theApp.yxtask.con_in[theApp.krnum].B.kgbf=1;
	}else
	{
			m_nenable.SetCheck(0);	
		    theApp.yxtask.con_in[theApp.krnum].B.kgbf=0;
	}

}

void CPlcIn1Dlg::OnChangeUnitNum() 
{
	// 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 j;
	CString  string;

	GetDlgItemText(IDC_UNIT,wBuf,20);
	j=_wtoi(wBuf);
	if(j>8) j=8;
	if(j<=0) j=1;
	theApp.yxtask.con_in[theApp.krnum].B.unit_num=j-1;
	string.Format(_T("%3d"),j);
    SetDlgItemText(IDC_UNIT,string);
	
}



void CPlcIn1Dlg::OnChangeUnit() 
{//项总数
	// 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

}

void CPlcIn1Dlg::OnUnit1() 
{//子项1

	// TODO: Add your control notification handler code here
}

void CPlcIn1Dlg::OnUnit2() 
{//子项2
	// TODO: Add your control notification handler code here
	
}

void CPlcIn1Dlg::OnUnit3() 
{//子项3
	// TODO: Add your control notification handler code here
	
}

void CPlcIn1Dlg::OnUnit4() 
{//子项4
	// TODO: Add your control notification handler code here
	
}

void CPlcIn1Dlg::OnUnit5() 
{//子项5
	// TODO: Add your control notification handler code here
	
}

void CPlcIn1Dlg::OnUnit6() 
{//子项6
	// TODO: Add your control notification handler code here
	
}

void CPlcIn1Dlg::OnUnit7() 
{//子项7
	// TODO: Add your control notification handler code here
	
}

void CPlcIn1Dlg::OnUnit8() 
{//子项8
	// TODO: Add your control notification handler code here
	
}



void CPlcIn1Dlg::OnPart1() 
{//子项1
	// TODO: Add your control notification handler code here
	if((m_pin1.GetCheck()%2)!=0)
	{
			m_pin1.SetCheck(1);	
		    theApp.yxtask.con_in[theApp.krnum].B.u0_kgbf=1;
	}else
	{
			m_pin1.SetCheck(0);	
		    theApp.yxtask.con_in[theApp.krnum].B.u0_kgbf=0;
	}
	
}

void CPlcIn1Dlg::OnPart2() 
{//子项2
	// TODO: Add your control notification handler code here
	if((m_pin2.GetCheck()%2)!=0)
	{
			m_pin2.SetCheck(1);	
		    theApp.yxtask.con_in[theApp.krnum].B.u1_kgbf=1;
	}else
	{
			m_pin2.SetCheck(0);	
		    theApp.yxtask.con_in[theApp.krnum].B.u1_kgbf=0;
	}
	
}

void CPlcIn1Dlg::OnPart3() 
{//子项3
	// TODO: Add your control notification handler code here
	if((m_pin3.GetCheck()%2)!=0)
	{
			m_pin3.SetCheck(1);	
		    theApp.yxtask.con_in[theApp.krnum].B.u2_kgbf=1;
	}else
	{

⌨️ 快捷键说明

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