?? stack.cpp
字號:
// Stack.cpp : implementation file
//
#include "stdafx.h"
#include "alfa.h"
#include "Stack.h"
#include "TeachMode.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStack dialog
CStack::CStack(CWnd* pParent /*=NULL*/)
: CDialog(CStack::IDD, pParent)
{
//{{AFX_DATA_INIT(CStack)
m_nx = 0;
m_ny = 0;
m_nz = 0;
m_dx = 0.0;
m_dy = 0.0;
m_dz = 0.0;
m_delay = 0.0;
m_Vac= 0;
m_Hold= 0;
//}}AFX_DATA_INIT
}
void CStack::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CStack)
DDX_Control(pDX, IDC_EDIT7, m_edit7);
DDX_Control(pDX, IDC_EDIT6, m_edit6);
DDX_Control(pDX, IDC_EDIT5, m_edit5);
DDX_Control(pDX, IDC_EDIT4, m_edit4);
DDX_Control(pDX, IDC_EDIT3, m_edit3);
DDX_Control(pDX, IDC_EDIT2, m_edit2);
DDX_Control(pDX, IDC_EDIT1, m_edit1);
DDX_Text(pDX, IDC_EDIT1, m_nx);
DDX_Text(pDX, IDC_EDIT2, m_ny);
DDX_Text(pDX, IDC_EDIT3, m_nz);
DDX_Text(pDX, IDC_EDIT4, m_dx);
DDX_Text(pDX, IDC_EDIT5, m_dy);
DDX_Text(pDX, IDC_EDIT6, m_dz);
DDX_Text(pDX, IDC_EDIT7, m_delay);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CStack, CDialog)
//{{AFX_MSG_MAP(CStack)
ON_WM_SHOWWINDOW()
ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CStack message handlers
void CStack::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
CString Temp_str;
// TODO: Add your message handler code here
if(bShow==1) {
CTeachMode * parent=(CTeachMode *)GetParent();
if(parent->flagShow==0) {
m_nx=0;
m_ny=0;
m_nz=0;
m_dx=0;
m_dy=0;
m_dz=0;
m_delay=0;
m_Vac=0;
m_Hold=0;
CButton *VacChk=(CButton *)GetDlgItem(IDC_CHECK1);
VacChk->SetCheck(0);
CButton *HoldChk=(CButton *)GetDlgItem(IDC_CHECK2);
HoldChk->SetCheck(0);
}
else {
int idx=parent->curidx;
m_nx=parent->command[idx].mcommand.para.stack1.nx & 0x0000FFFF;
m_ny=parent->command[idx].mcommand.para.stack1.nx/0x00010000;
m_nz=parent->command[idx].mcommand.para.stack1.nz & 0x0FFFFFFF;
m_dx=parent->command[idx].mcommand.para.stack1.dx;
m_dy=parent->command[idx].mcommand.para.stack1.dy;
m_dz=parent->command[idx].mcommand.para.stack1.dz;
m_delay=((double)(parent->command[idx].mcommand.para.stack1.ny))/100.0;
m_Vac=parent->command[idx].mcommand.para.stack1.nz & 0x10000000;
m_Hold=parent->command[idx].mcommand.para.stack1.nz & 0x20000000;
CButton *VacChk=(CButton *)GetDlgItem(IDC_CHECK1);
if((m_Vac & 0x10000000) >0) VacChk->SetCheck(1);
else { m_Vac=0; VacChk->SetCheck(0); }
CButton *HoldChk=(CButton *)GetDlgItem(IDC_CHECK2);
if((m_Hold & 0x20000000) >0) HoldChk->SetCheck(1);
else { m_Hold=0; HoldChk->SetCheck(0);}
}
UpdateData(FALSE);
Temp_str.Format("%6.2f", m_dx);
GetDlgItem(IDC_EDIT4)->SetWindowText(Temp_str);
Temp_str.Format("%6.2f", m_dy);
GetDlgItem(IDC_EDIT5)->SetWindowText(Temp_str);
Temp_str.Format("%6.2f", m_dz);
GetDlgItem(IDC_EDIT6)->SetWindowText(Temp_str);
Temp_str.Format("%6.2f", m_delay);
GetDlgItem(IDC_EDIT7)->SetWindowText(Temp_str);
// UpdateData(FALSE);
}
}
void CStack::OnCheck1()
{
// TODO: Add your control notification handler code here
if((m_Vac & 0x10000000)>0) m_Vac=0;
else m_Vac=0x10000000;
}
void CStack::OnCheck2()
{
// TODO: Add your control notification handler code here
if((m_Hold & 0x20000000)>0) m_Hold=0;
else m_Hold=0x20000000;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -