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

📄 home.cpp

📁 机械手IPC控制器伺服运动程序
💻 CPP
字号:
// Home.cpp : implementation file
//

#include "stdafx.h"
#include "alfa.h"
#include "Home.h"
#include "Main.h"
#include "MCCL.h"
#include "sys.h"
//#define SYSTEM_FILE _T("system.bkp")
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CHome dialog

CHome::CHome(CWnd* pParent /*=NULL*/)
	: CDialog(CHome::IDD, pParent)
{
	//{{AFX_DATA_INIT(CHome)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	flghome=0;
	order=0;
	rst0=0;
	rstflg0=0;

}


void CHome::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CHome)
	DDX_Control(pDX, IDC_STATIC1, m_prompt);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CHome, CDialog)
	//{{AFX_MSG_MAP(CHome)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_WM_SHOWWINDOW()
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_WM_TIMER()
	ON_BN_CLICKED(IDC_BUTTON3, OnBtnStop)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHome message handlers

void CHome::OnButton2() 
{
	// TODO: Add your control notification handler code here
	CMain * main=(CMain *)GetParent();
	ShowWindow(FALSE);
	main->dlghomeset->ShowWindow(TRUE);
}

void CHome::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CDialog::OnShowWindow(bShow, nStatus);
	
	// TODO: Add your message handler code here
	if(bShow==1)
	{
		CMain * main=(CMain *)GetParent();
		main->dlgcur =this;
	}
}

void CHome::OnButton1() 
{
	// TODO: Add your control notification handler code here
	int HomeMX=255, HomeMZ=255, HomeY=255, HomeSX=255, HomeSZ=255;
    CMain * main=(CMain *)GetParent();

	rst0=1;
	rstflg0=0;
    flghome=0;
	HomeOKflg=2;

// Add Alarm Check

// Home Order
///*
	if(Demo_Flag==0) {
	    CString strAxis;
	    order=0;
	    for(order=0; order<5; order++) {
            main->dlghomeset->m_list.GetText(order, strAxis);
		    if(strAxis=="MX")      HomeMX=order;
		    else if(strAxis=="MZ") HomeMZ=order;
		    else if(strAxis=="Y")  HomeY =order;
		    else if(strAxis=="SX") HomeSX=order;
		    else if(strAxis=="SZ") HomeSZ=order;
		}
	    MCC_Home(HomeMX, HomeMZ, HomeY, HomeSX, HomeSZ, 255, CARD_INDEX);
        SetTimer(15, 50, NULL);  // No Home Delete Temp
	}
//*/
// No Home Added Temp.
///*
	else {
		m_prompt.SetWindowText("確耴笆

⌨️ 快捷键说明

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