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

📄 zhutai.cpp

📁 VC++实现的预测控制
💻 CPP
字号:
// ZhuTai.cpp : implementation file
//

#include "stdafx.h"
#include "MPCTest.h"
#include "ZhuTai.h"
#include "OPCSET.h"
#include "DLLPATH2.h"
#include "SelectServer.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CString  FilePath;//配置文件路径
extern CString  dialogname;//要调用的文件

/////////////////////////////////////////////////////////////////////////////
// CZhuTai dialog


CZhuTai::CZhuTai(CWnd* pParent /*=NULL*/)
	: CDialog(CZhuTai::IDD, pParent)
{
	//{{AFX_DATA_INIT(CZhuTai)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_addserver =0;
}


void CZhuTai::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CZhuTai)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CZhuTai, CDialog)
	//{{AFX_MSG_MAP(CZhuTai)
	ON_BN_CLICKED(IDC_CTROL, OnCtrol)
	ON_BN_CLICKED(IDC_PLANT, OnPlant)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CZhuTai message handlers

void CZhuTai::OnCtrol() 
{
	// TODO: Add your control notification handler code here
	if(!m_addserver)
	{
		AfxMessageBox("先点击现场模型,连接OPC Server!");
		return;
	}
	else{
	CDLLPATH dlg;
	if(dlg.DoModal() == IDOK)
	{
		m_dllpath = dlg.m_dllpath;
		//m_inipath = dlg.m_inipath;
		m_suanfatime = dlg.m_suanfa;
	}
    //FilePath = m_inipath;
	if(pDoc==NULL)
	{
		MessageBox("请先连接OPC服务器");
		return;
	}

    COPCSet dlg1(pDoc,pDoc->opcServer);
	dlg1.pDoc = pDoc;
	dlg1.DoModal();
	}
}

void CZhuTai::OnOK() 
{
	// TODO: Add extra validation here
	
	CDialog::OnOK();
}

void CZhuTai::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

void CZhuTai::OnPlant() 
{
	// TODO: Add your control notification handler code here
    CSelectServer dlg;
	dlg.ParentDoc = pDoc;
	dlg.DoModal();
	m_addserver = 1;
}

⌨️ 快捷键说明

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