You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
3.3 KiB
C++
115 lines
3.3 KiB
C++
|
|
#include "stdafx.h"
|
|
#include "LaiPuLaser.h"
|
|
#include "afxdialogex.h"
|
|
#include "DlgPCSLoadPortCtrl.h"
|
|
#include "GlobalFunction.h"
|
|
#include "MsgBox.h"
|
|
#include "TransferArmMgr.h"
|
|
#include "GlobalDrawMgr.h"
|
|
#include "CommonFlowMgr.h"
|
|
#include "FoupLoadPortMgr.h"
|
|
|
|
|
|
#define UPDATE_INFO_TIMER 1
|
|
#define UPDATE_INFO_TIMER_DELAY 300
|
|
|
|
|
|
IMPLEMENT_DYNAMIC(CDlgPCSLoadPortCtrl, CDialogEx)
|
|
BEGIN_MESSAGE_MAP(CDlgPCSLoadPortCtrl, CDialogEx)
|
|
ON_WM_TIMER()
|
|
ON_BN_CLICKED(IDC_LOAD_FOUP_BTN, &CDlgPCSLoadPortCtrl::OnBnClickedLoadFoupBtn)
|
|
ON_BN_CLICKED(IDC_UNLOAD_FOUP_BTN, &CDlgPCSLoadPortCtrl::OnBnClickedUnloadFoupBtn)
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
CDlgPCSLoadPortCtrl::CDlgPCSLoadPortCtrl(CWnd* pParent /*=NULL*/)
|
|
: CDialogEx(CDlgPCSLoadPortCtrl::IDD, pParent)
|
|
{
|
|
|
|
}
|
|
CDlgPCSLoadPortCtrl::~CDlgPCSLoadPortCtrl()
|
|
{
|
|
}
|
|
void CDlgPCSLoadPortCtrl::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialogEx::DoDataExchange(pDX);
|
|
DDX_Control(pDX, IDC_LOAD_FOUP_BTN, m_PortLoadMapBtn);
|
|
DDX_Control(pDX, IDC_UNLOAD_FOUP_BTN, m_PortUnloadBtn);
|
|
}
|
|
|
|
BOOL CDlgPCSLoadPortCtrl::OnInitDialog()
|
|
{
|
|
CDialogEx::OnInitDialog();
|
|
CRect cr;
|
|
GetClientRect(&cr);
|
|
ClientToScreen(&cr);
|
|
IntXY Pos = gDraw->GetWndPos(_eWndPos_LoadPort1Dlg);
|
|
if(m_LoadPortType==_LoadPortType_Port2)
|
|
Pos = gDraw->GetWndPos(_eWndPos_LoadPort2Dlg);
|
|
//设置对话框的位置
|
|
MoveWindow(Pos.x ,Pos.y,cr.Width()+20,cr.Height()+50);
|
|
//设置对话框的标题
|
|
CString title = gTransferArmMgr->GetLoadPortStr(m_LoadPortType);
|
|
title = "Load"+title;
|
|
SetWindowText(title);
|
|
|
|
UpdateData(FALSE);
|
|
|
|
SetTimer(UPDATE_INFO_TIMER,UPDATE_INFO_TIMER_DELAY,NULL);
|
|
return TRUE;
|
|
}
|
|
void CDlgPCSLoadPortCtrl::OnTimer(UINT nIDEvent)
|
|
{
|
|
if(nIDEvent == UPDATE_INFO_TIMER)
|
|
{
|
|
UpdateInfoExt();
|
|
}
|
|
CDialog::OnTimer(nIDEvent);
|
|
}
|
|
void CDlgPCSLoadPortCtrl::UpdateInfoExt()
|
|
{
|
|
CFoupLoadPort &FoupLoadPort = gFoupLoadPortMgr->GetFoupLoadPort(m_LoadPortType);
|
|
if(FoupLoadPort.m_CurCmdType==_TdkCmd_LoadMap)
|
|
m_PortLoadMapBtn.SetUpColor(RGB_YELLOW);
|
|
else
|
|
m_PortLoadMapBtn.SetUpColor(RGB_GRAY2);
|
|
if(FoupLoadPort.m_CurCmdType==_TdkCmd_Unload)
|
|
m_PortUnloadBtn.SetUpColor(RGB_YELLOW);
|
|
else
|
|
m_PortUnloadBtn.SetUpColor(RGB_GRAY2);
|
|
}
|
|
|
|
void CDlgPCSLoadPortCtrl::OnBnClickedLoadFoupBtn()
|
|
{
|
|
CLogInfo LogInfo;
|
|
LogInfo.m_ClassName = "CDlgPCSLoadPortCtrl";
|
|
LogInfo.m_FuncName = "OnBnClickedLoadFoupBtn";
|
|
gLogMgr->WriteLogInfo(LogInfo);
|
|
|
|
if(!gTransferArmMgr->ManualFoupLoadCheck(m_LoadPortType))
|
|
return;
|
|
|
|
if(m_LoadPortType==_LoadPortType_Port1)
|
|
gCommonFlowMgr->ExcuteSimpleFlowType(_ExcuteFlow_Foup_LoadMap_Port1,false);
|
|
else
|
|
gCommonFlowMgr->ExcuteSimpleFlowType(_ExcuteFlow_Foup_LoadMap_Port2,false);
|
|
}
|
|
void CDlgPCSLoadPortCtrl::OnBnClickedUnloadFoupBtn()
|
|
{
|
|
CLogInfo LogInfo;
|
|
LogInfo.m_ClassName = "CDlgPCSLoadPortCtrl";
|
|
LogInfo.m_FuncName = "OnBnClickedUnloadFoupBtn";
|
|
gLogMgr->WriteLogInfo(LogInfo);
|
|
|
|
if(!gTransferArmMgr->ManualFoupUnloadCheck(m_LoadPortType))
|
|
return;
|
|
|
|
if(m_LoadPortType==_LoadPortType_Port1)
|
|
gCommonFlowMgr->ExcuteSimpleFlowType(_ExcuteFlow_Foup_Unload_Port1,false);
|
|
else
|
|
gCommonFlowMgr->ExcuteSimpleFlowType(_ExcuteFlow_Foup_Unload_Port2,false);
|
|
|
|
|
|
}
|