|
|
|
|
|
|
|
|
|
// TestDlg.cpp : ʵ<><CAB5><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include "LaiPuLaser.h"
|
|
|
|
|
#include "DlgTest.h"
|
|
|
|
|
#include "afxdialogex.h"
|
|
|
|
|
#include "LogMgr.h"
|
|
|
|
|
#include "GlobalFunction.h"
|
|
|
|
|
// CDlgTest <20>Ի<EFBFBD><D4BB><EFBFBD>
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include "PciCh365Mgr.h"
|
|
|
|
|
#include "PlatformXY.h"
|
|
|
|
|
#include "PciPort.h"
|
|
|
|
|
#include "CommPortMgr.h"
|
|
|
|
|
#include "GratingRuler.h"
|
|
|
|
|
#include "Motor.h"
|
|
|
|
|
#include "MouseToolmgr.h"
|
|
|
|
|
#include "WorkCmdMotorToOffsetPos.h"
|
|
|
|
|
#include "AuthorityMgr.h"
|
|
|
|
|
#include "WorkCmdMovePlatformXY.h"
|
|
|
|
|
#include "Laser.h"
|
|
|
|
|
#include "LaipuVbDllMgr.h"
|
|
|
|
|
#include "CameraKeyence.h"
|
|
|
|
|
#include "WorkCmdInvoker.h"
|
|
|
|
|
#include "MsgBox.h"
|
|
|
|
|
#include "WorkCmdFactory.h"
|
|
|
|
|
#include "DlgMarkArea.h"
|
|
|
|
|
#include "MarkAreaMgr.h"
|
|
|
|
|
#include "ObjComponentMgr.h"
|
|
|
|
|
#include "DlgObjComponent.h"
|
|
|
|
|
#include "PciPortMgr.h"
|
|
|
|
|
#include "WorkTime.h"
|
|
|
|
|
#include "FileMgr.h"
|
|
|
|
|
#include "LaipuVbDllMgr.h"
|
|
|
|
|
#include "ProgramCutMgr.h"
|
|
|
|
|
#include "CommonFlowMgr.h"
|
|
|
|
|
#include "DxfReadMgr.h"
|
|
|
|
|
#include "ExceptionMsg.h"
|
|
|
|
|
#include "Product.h"
|
|
|
|
|
#include "PltReader.h"
|
|
|
|
|
#include "ProductMgr.h"
|
|
|
|
|
#include "WorkFileMgr.h"
|
|
|
|
|
#include "LaipuVbDllMgr.h"
|
|
|
|
|
#include "MotionCard_PCI1245.h"
|
|
|
|
|
#include "Program_SZ_XL_TrackWorkFlow.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC(CDlgTest, CDialogEx)
|
|
|
|
|
BEGIN_MESSAGE_MAP(CDlgTest, CDialogEx)
|
|
|
|
|
ON_BN_CLICKED(IDC_TEST_BTN1, &CDlgTest::OnBnClickedTestBtn1)
|
|
|
|
|
ON_BN_CLICKED(IDC_OPEN_PORT, &CDlgTest::OnBnClickedOpenPort)
|
|
|
|
|
ON_BN_CLICKED(IDC_CLOSE_PORT, &CDlgTest::OnBnClickedClosePort)
|
|
|
|
|
ON_BN_CLICKED(IDC_TEST_BTN2, &CDlgTest::OnBnClickedTestBtn2)
|
|
|
|
|
ON_BN_CLICKED(IDC_READ_PORT, &CDlgTest::OnBnClickedReadPort)
|
|
|
|
|
ON_BN_CLICKED(IDC_WRITE_TO_COMM, &CDlgTest::OnBnClickedWriteToComm)
|
|
|
|
|
ON_EN_CHANGE(IDC_CMD_INPUT, OnEnChangeEdit)
|
|
|
|
|
|
|
|
|
|
ON_WM_MOUSEWHEEL()//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
ON_BN_CLICKED(IDC_MARK_AREA_DLG, &CDlgTest::OnBnClickedMarkAreaDlg)
|
|
|
|
|
ON_BN_CLICKED(IDC_OBJ_COMP_DLG, &CDlgTest::OnBnClickedObjCompDlg)
|
|
|
|
|
ON_BN_CLICKED(IDC_CREAT_OBJ_BY_LAYER, &CDlgTest::OnBnClickedCreatObjByLayerShape)
|
|
|
|
|
ON_BN_CLICKED(IDC_OPEN_DXF, &CDlgTest::OnBnClickedReadDxfFile)
|
|
|
|
|
ON_BN_CLICKED(IDC_OPEN_PLT, &CDlgTest::OnBnClickedReadPltFile)
|
|
|
|
|
ON_BN_CLICKED(IDC_PCI_MARK, &CDlgTest::OnBnClickedPciMark)
|
|
|
|
|
ON_BN_CLICKED(IDC_PCI_MULTI_AREA_MARK, &CDlgTest::OnBnClickedPciMultiAreaMark)
|
|
|
|
|
ON_BN_CLICKED(IDC_CUT_BY_PLATFROM, &CDlgTest::OnBnClickedCutByPlatfrom)
|
|
|
|
|
ON_BN_CLICKED(IDC_CCD_CATCH, &CDlgTest::OnBnClickedCcdCatch)
|
|
|
|
|
ON_BN_CLICKED(IDC_CCD_CATCH_TWO_MARK, &CDlgTest::OnBnClickedCcdCatchTwoMark)
|
|
|
|
|
ON_BN_CLICKED(IDC_OBJ_TO_CCD_MODE, &CDlgTest::OnBnClickedObjToCcdMode)
|
|
|
|
|
ON_BN_CLICKED(IDC_SET_MARK_PT, &CDlgTest::OnBnClickedSetMarkPt)
|
|
|
|
|
|
|
|
|
|
ON_BN_CLICKED(IDC_READ_OBJ, &CDlgTest::OnBnClickedReadObjFile)
|
|
|
|
|
ON_BN_CLICKED(IDC_SAVE_OBJ, &CDlgTest::OnBnClickedSaveObjFile)
|
|
|
|
|
ON_BN_CLICKED(IDC_CREAT_VISION_DATA, &CDlgTest::OnBnClickedCreatVisionData)
|
|
|
|
|
|
|
|
|
|
ON_BN_CLICKED(IDC_OPEN_MAK, &CDlgTest::OnBnClickedOpenMak)
|
|
|
|
|
ON_BN_CLICKED(IDC_ADJUST_PRODUCT_POS, &CDlgTest::OnBnClickedAdjustProductPos)
|
|
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
|
|
bool bObjToCcdMode = false;
|
|
|
|
|
bool gFlg = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CDlgTest::CDlgTest(CWnd* pParent /*=NULL*/)
|
|
|
|
|
{
|
|
|
|
|
m_PortNum = 0;//<2F><><EFBFBD>Ե<EFBFBD>pci <20>˿ں<CBBF>
|
|
|
|
|
m_Input1 = 1;
|
|
|
|
|
m_CommPort = 1;
|
|
|
|
|
m_CommStr = "Trigger,1\r\n";
|
|
|
|
|
m_PortState = _T("״̬: ");
|
|
|
|
|
m_MarkTimes = 1;
|
|
|
|
|
m_CyclicTimes = 1;
|
|
|
|
|
}
|
|
|
|
|
CDlgTest::~CDlgTest()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::DoDataExchange(CDataExchange* pDX)
|
|
|
|
|
{
|
|
|
|
|
CDialogEx::DoDataExchange(pDX);
|
|
|
|
|
DDX_Text(pDX, IDC_PORT_STATE, m_PortState);
|
|
|
|
|
DDX_Text(pDX, IDC_INPUT1, m_Input1);
|
|
|
|
|
DDX_Text(pDX, IDC_COMM_PORT, m_CommPort);
|
|
|
|
|
DDX_Text(pDX, IDC_COMM_STR, m_CommStr);
|
|
|
|
|
DDX_Text(pDX, IDC_COMM_REV, m_CommRev);
|
|
|
|
|
DDX_Text(pDX, IDC_MARK_CNT, m_MarkTimes);
|
|
|
|
|
DDX_Text(pDX, IDC_CYCLIC_TIMES, m_CyclicTimes);
|
|
|
|
|
DDX_Text(pDX, IDC_PORT_NUM, m_PortNum);
|
|
|
|
|
DDX_Control(pDX, IDC_CMD_INPUT, m_CmdInputEdit);
|
|
|
|
|
#ifdef __TBAR_CODE__
|
|
|
|
|
DDX_Control(pDX, IDC_TBARCODE51, m_Tbarcode51);
|
|
|
|
|
#endif
|
|
|
|
|
DDX_Text(pDX, IDC_CMD_INPUT, m_CmdInputStr);
|
|
|
|
|
DDX_Control(pDX, IDC_WRITE_TO_COMM, m_SendToComBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_OPEN_PORT, m_OpenPciPortBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_CLOSE_PORT, m_ClosePciPortBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_READ_PORT, m_ReadPciPortBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_TEST_BTN1, m_Test1Btn);
|
|
|
|
|
DDX_Control(pDX, IDC_TEST_BTN2, m_Test2Btn);
|
|
|
|
|
DDX_Control(pDX, IDC_OBJ_COMP_DLG, m_ObjCompSetBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_MARK_AREA_DLG, m_MarkAreaSetBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_CREAT_OBJ_BY_LAYER, m_CreatObjBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_OPEN_DXF, m_ReadDxfBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_OPEN_PLT, m_ReadPltBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_READ_OBJ, m_ReadObjBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_OPEN_MAK, m_ReadMakBtn);
|
|
|
|
|
|
|
|
|
|
DDX_Control(pDX, IDC_SAVE_OBJ, m_SaveObjBtn);
|
|
|
|
|
|
|
|
|
|
DDX_Control(pDX, IDC_PCI_MARK, m_PciMarkBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_PCI_MULTI_AREA_MARK, m_PciAreaMarkBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_CUT_BY_PLATFROM, m_CutByPlatformBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_CCD_CATCH, m_CameraCatchBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_CCD_CATCH_TWO_MARK, m_CameraCatchMarkBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_OBJ_TO_CCD_MODE, m_ObjToCCDModeBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_SET_MARK_PT, m_SetMarkBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_CREAT_VISION_DATA, m_CreatVisionDataBtn);
|
|
|
|
|
DDX_Control(pDX, IDC_ADJUST_PRODUCT_POS, m_AdjustProductPosBtn);
|
|
|
|
|
}
|
|
|
|
|
BOOL CDlgTest::OnInitDialog()
|
|
|
|
|
{
|
|
|
|
|
CDialogEx::OnInitDialog();
|
|
|
|
|
|
|
|
|
|
m_ObjCompSetBtn.SetUpColor(RGB_GREEN);
|
|
|
|
|
m_MarkAreaSetBtn.SetUpColor(RGB_GREEN);
|
|
|
|
|
m_CreatObjBtn.SetUpColor(RGB_PINK);
|
|
|
|
|
m_ReadDxfBtn.SetUpColor(RGB_PINK);
|
|
|
|
|
m_ReadPltBtn.SetUpColor(RGB_PINK);
|
|
|
|
|
m_ReadObjBtn.SetUpColor(RGB_PINK);
|
|
|
|
|
m_SaveObjBtn.SetUpColor(RGB_PINK);
|
|
|
|
|
m_ReadMakBtn.SetUpColor(RGB_PINK);
|
|
|
|
|
|
|
|
|
|
m_PciMarkBtn.SetUpColor(RGB_GREEN1);
|
|
|
|
|
m_PciAreaMarkBtn.SetUpColor(RGB_GREEN1);
|
|
|
|
|
m_CutByPlatformBtn.SetUpColor(RGB_GREEN1);
|
|
|
|
|
|
|
|
|
|
m_CameraCatchBtn.SetUpColor(RGB_BLUE1);
|
|
|
|
|
m_CameraCatchMarkBtn.SetUpColor(RGB_BLUE1);
|
|
|
|
|
m_CreatVisionDataBtn.SetUpColor(RGB_BLUE1);
|
|
|
|
|
m_SetMarkBtn.SetUpColor(RGB_PINK);
|
|
|
|
|
m_ObjToCCDModeBtn.SetUpColor(RGB_GREEN);
|
|
|
|
|
|
|
|
|
|
m_AdjustProductPosBtn.SetUpColor(RGB_GREEN1);
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if 1
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void CDlgTest::OnBnClickedTestBtn1()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnBnClickedTestBtn2()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
int CDlgTest::GetInput1()
|
|
|
|
|
{
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
return m_Input1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
#if 1//pci <20>˿ڲ<CBBF><DAB2><EFBFBD>
|
|
|
|
|
//<2F>˿ں<CBBF>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>0~16
|
|
|
|
|
bool CDlgTest::CheckPortNum()
|
|
|
|
|
{
|
|
|
|
|
if(0<=m_PortNum&&m_PortNum<16)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F>˿<F2BFAAB6>
|
|
|
|
|
void CDlgTest::OnBnClickedOpenPort()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
if(CheckPortNum())
|
|
|
|
|
{
|
|
|
|
|
SPciPort PciPort;
|
|
|
|
|
PciPort.num = m_PortNum;
|
|
|
|
|
gLogMgr->WriteDebugLog("<EFBFBD>˿<EFBFBD>","m_PortNum", m_PortNum);
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
gPciCh365Mgr->WritePortState(PciPort,true);
|
|
|
|
|
}
|
|
|
|
|
catch(CExceptionMsg &Msg)
|
|
|
|
|
{
|
|
|
|
|
CString str("Func : OpenPciPort---->");
|
|
|
|
|
str += Msg.GetMsgStr();
|
|
|
|
|
gLogMgr->WriteDebugLog(str,_LOG_ERROR);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//<2F>رն˿<D5B6>
|
|
|
|
|
void CDlgTest::OnBnClickedClosePort()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
if(CheckPortNum())
|
|
|
|
|
{
|
|
|
|
|
SPciPort PciPort;
|
|
|
|
|
PciPort.num = m_PortNum;
|
|
|
|
|
gLogMgr->WriteDebugLog("<EFBFBD>رն˿<EFBFBD>","m_PortNum", m_PortNum);
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
gPciCh365Mgr->WritePortState(PciPort,false);
|
|
|
|
|
}
|
|
|
|
|
catch(CExceptionMsg &Msg)
|
|
|
|
|
{
|
|
|
|
|
CString str("Func : OpenPciPort---->");
|
|
|
|
|
str += Msg.GetMsgStr();
|
|
|
|
|
gLogMgr->WriteDebugLog(str,_LOG_ERROR);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnBnClickedReadPort()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
if(CheckPortNum())
|
|
|
|
|
{
|
|
|
|
|
SPciPort port;
|
|
|
|
|
port.num = m_PortNum;
|
|
|
|
|
gLogMgr->WriteDebugLog("<EFBFBD><EFBFBD>ȡ<EFBFBD>˿<EFBFBD>","m_PortNum", m_PortNum);
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
bool ret = gPciCh365Mgr->ReadPortState(port);
|
|
|
|
|
if(ret)
|
|
|
|
|
{
|
|
|
|
|
m_PortState = _T("״̬: ON");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_PortState = _T("״̬: OFF");
|
|
|
|
|
}
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
}
|
|
|
|
|
catch(CExceptionMsg &Msg)
|
|
|
|
|
{
|
|
|
|
|
CString str("Func : ReadPciPort---->");
|
|
|
|
|
str += Msg.GetMsgStr();
|
|
|
|
|
gLogMgr->WriteDebugLog(str,_LOG_ERROR);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if 1//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void CDlgTest::OnBnClickedWriteToComm()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
|
|
|
|
|
CCommPortMgr com;
|
|
|
|
|
//<2F><EFBFBD><F2BFAAB4><EFBFBD>
|
|
|
|
|
if(com.Open(m_CommPort,115200)==false)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
int DelayTime = 200;
|
|
|
|
|
|
|
|
|
|
CString str1 = m_CommStr;
|
|
|
|
|
CString str = str1+char(13)+char(10);
|
|
|
|
|
com.Write(str);
|
|
|
|
|
Sleep(DelayTime);
|
|
|
|
|
|
|
|
|
|
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
|
|
|
|
m_CommRev = com.ReadStr();
|
|
|
|
|
|
|
|
|
|
com.Close();
|
|
|
|
|
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#if 1//<2F><><EFBFBD>ϱ<EFBFBD><CFB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>cmd edit <20>۽<EFBFBD>
|
|
|
|
|
void CDlgTest::SetCmdEditFocus()
|
|
|
|
|
{
|
|
|
|
|
GetDlgItem(IDC_CMD_INPUT)->SetFocus();
|
|
|
|
|
}
|
|
|
|
|
//<2F>ػ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>봫<EFBFBD>ݸ<EFBFBD>view
|
|
|
|
|
BOOL CDlgTest::PreTranslateMessage(MSG* pMsg)
|
|
|
|
|
{
|
|
|
|
|
if(pMsg->message==WM_KEYDOWN)
|
|
|
|
|
{
|
|
|
|
|
char c = pMsg->wParam;
|
|
|
|
|
if(c==VK_RETURN)
|
|
|
|
|
{
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
if(c==VK_ESCAPE || c==VK_CONTROL||c==VK_DELETE)
|
|
|
|
|
{
|
|
|
|
|
return GetCurViewPtr()->PreTranslateMessage(pMsg);
|
|
|
|
|
}
|
|
|
|
|
if(c == 'A' || c == 'Z' || c == 'Y')
|
|
|
|
|
{
|
|
|
|
|
return GetCurViewPtr()->PreTranslateMessage(pMsg);
|
|
|
|
|
}
|
|
|
|
|
if(c==VK_LEFT||c==VK_RIGHT||c==VK_UP||c==VK_DOWN)
|
|
|
|
|
{
|
|
|
|
|
return GetCurViewPtr()->PreTranslateMessage(pMsg);
|
|
|
|
|
//BOOL ret = CDialogEx::PreTranslateMessage(pMsg);//<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD><EFBFBD>ƶ<EFBFBD>
|
|
|
|
|
//SetCaptionInputStr();//<2F>ٸ<EFBFBD><D9B8>¹<EFBFBD><C2B9><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
//return ret;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(pMsg->message==WM_KEYUP)
|
|
|
|
|
{
|
|
|
|
|
switch(pMsg->wParam)
|
|
|
|
|
{
|
|
|
|
|
case VK_CONTROL:
|
|
|
|
|
return GetCurViewPtr()->PreTranslateMessage(pMsg);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return CDialogEx::PreTranslateMessage(pMsg);
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnEnChangeEdit()
|
|
|
|
|
{
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>space <20><>
|
|
|
|
|
char space = ' ';
|
|
|
|
|
if(m_CmdInputStr.Find(space,0)!= -1)
|
|
|
|
|
{
|
|
|
|
|
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
if(gMouseToolMgr.OnSetCmd(m_CmdInputStr))
|
|
|
|
|
{
|
|
|
|
|
GetFrame()->ResetCaptionBar();
|
|
|
|
|
ResetCmdInputStr();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gLogMgr->WriteCmd(STR_INPUT_ERROR+m_CmdInputStr,STR_NULL,STR_NULL);
|
|
|
|
|
ResetCmdInputStr();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SetCaptionInputStr();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::ResetCmdInputStr()
|
|
|
|
|
{
|
|
|
|
|
m_CmdInputStr = "";
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::SetCaptionInputStr()
|
|
|
|
|
{
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
//<2F><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
int nStartChar;
|
|
|
|
|
int nEndChar;
|
|
|
|
|
m_CmdInputEdit.GetSel(nStartChar,nEndChar);
|
|
|
|
|
CString str1(m_CmdInputStr,nStartChar);
|
|
|
|
|
CString str3 = "_";
|
|
|
|
|
CString str4(m_CmdInputStr);
|
|
|
|
|
str4.Delete(0,nStartChar);
|
|
|
|
|
|
|
|
|
|
GetFrame()->SetCaptionInputStr(str1+str3+str4);
|
|
|
|
|
GetFrame()->RefreashCaptionBar();
|
|
|
|
|
}
|
|
|
|
|
//<2F>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ش<EFBFBD><D8B4><EFBFBD>view
|
|
|
|
|
BOOL CDlgTest::OnMouseWheel(UINT nFlags,short zDelta,CPoint point)
|
|
|
|
|
{
|
|
|
|
|
return GetCurViewPtr()->OnMouseWheel(nFlags,zDelta,point);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if 1//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>
|
|
|
|
|
void CDlgTest::OnBnClickedMarkAreaDlg()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
CDlgMarkArea dlg(*gMarkAreaMgr);
|
|
|
|
|
dlg.DoModal();
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnBnClickedObjCompDlg()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_ADMIN,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
CDlgObjComponent dlg(*gObjComponentMgr);
|
|
|
|
|
dlg.DoModal();
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnBnClickedCreatObjByLayerShape()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
CMsgBox MsgBox;
|
|
|
|
|
if(MsgBox.ConfirmOkCancel("ͨ<EFBFBD><EFBFBD>ͼ<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD>obj <20><><EFBFBD><EFBFBD>?"))
|
|
|
|
|
{
|
|
|
|
|
gObjComponentMgr->CreatObjByLayerObj();
|
|
|
|
|
GetCurViewPtr()->RefreshView();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnBnClickedReadDxfFile()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_ADMIN,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
gDxfReadMgr->OpenDxfFileDlg(-90);
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnBnClickedReadPltFile()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_ADMIN,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
gPltReader->OpenFile();
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnBnClickedOpenMak()
|
|
|
|
|
{
|
|
|
|
|
gProgramCutMgr->OpenMarkFile();
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnBnClickedReadObjFile()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_ADMIN,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
CWorkFileMgr WorkFileMgr;
|
|
|
|
|
WorkFileMgr.OpenObjFile();
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnBnClickedSaveObjFile()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
CWorkFileMgr WorkFileMgr;
|
|
|
|
|
WorkFileMgr.SaveObjFile();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if 1//<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>
|
|
|
|
|
bool bPciMarkFlg = false;//<2F><>ֹ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD>뱨<EFBFBD><EBB1A8>
|
|
|
|
|
void CDlgTest::OnBnClickedPciMark()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
if(!bPciMarkFlg)
|
|
|
|
|
{
|
|
|
|
|
bPciMarkFlg = true;
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
bool bSel = ((CButton*)GetDlgItem(IDC_NEED_SEL_CHECK))->GetCheck();
|
|
|
|
|
gCommonFlowMgr->NormalMarkByPciCard(bSel,m_MarkTimes,m_CyclicTimes);
|
|
|
|
|
|
|
|
|
|
bPciMarkFlg = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnBnClickedPciMultiAreaMark()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
CMsgBox MsgBox;
|
|
|
|
|
if(MsgBox.ConfirmOkCancel(_T("Start PCI MultiMark?"))==false)
|
|
|
|
|
return;
|
|
|
|
|
vector<CProduct> &ProductVec = gProductMgr->GetProductVec();
|
|
|
|
|
int size = ProductVec.size();
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
{
|
|
|
|
|
CProduct &Product = ProductVec[i];
|
|
|
|
|
bool bSel = ((CButton*)GetDlgItem(IDC_NEED_SEL_CHECK))->GetCheck();
|
|
|
|
|
gCommonFlowMgr->MultipleAreaMark(Product,bSel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnBnClickedCutByPlatfrom()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
CMsgBox MsgBox;
|
|
|
|
|
if(MsgBox.ConfirmOkCancel(_T("Start Cut By Platfrom?"))==false)
|
|
|
|
|
return;
|
|
|
|
|
vector<CProduct> &ProductVec = gProductMgr->GetProductVec();
|
|
|
|
|
int size = ProductVec.size();
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
{
|
|
|
|
|
CProduct &Product = ProductVec[i];
|
|
|
|
|
bool bSel = ((CButton*)GetDlgItem(IDC_NEED_SEL_CHECK))->GetCheck();
|
|
|
|
|
gCommonFlowMgr->CutShapeByPlatform(Product,bSel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#if 1
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ccd ʶ<><CAB6>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD>
|
|
|
|
|
void CDlgTest::OnBnClickedCcdCatch()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
gCommonFlowMgr->CameraCatch();
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>obj Ϊmark <20><>
|
|
|
|
|
void CDlgTest::OnBnClickedSetMarkPt()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
gObjComponentMgr->SetMarkObj();
|
|
|
|
|
CLayer &layer = GetLayerInstance();
|
|
|
|
|
layer.NotSelAllObj();//ȫ<><C8AB>ѡ
|
|
|
|
|
GetCurViewPtr()->RefreshView();
|
|
|
|
|
}
|
|
|
|
|
//ʶ<><CAB6><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>ƫ<EFBFBD>ƺ<EFBFBD><C6BA><EFBFBD>ת
|
|
|
|
|
void CDlgTest::OnBnClickedCcdCatchTwoMark()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//ѡ<><D1A1>obj <20>ƶ<EFBFBD><C6B6><EFBFBD>CCD<43><44><EFBFBD>Ĺ۲<C4B9>
|
|
|
|
|
void CDlgTest::OnBnClickedObjToCcdMode()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
vector<CProduct> &ProductVec = gProductMgr->GetProductVec();
|
|
|
|
|
if(!ProductVec.empty())
|
|
|
|
|
{
|
|
|
|
|
gCommonFlowMgr->MoveSelObjToCamera(ProductVec[0]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>vision.dat
|
|
|
|
|
void CDlgTest::OnBnClickedCreatVisionData()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
CMsgBox MsgBox;
|
|
|
|
|
if(MsgBox.ConfirmOkCancel(_T("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> \"Vision.dat\"?"))==false)
|
|
|
|
|
return;
|
|
|
|
|
if(gCommonFlowMgr->AutoMeasureVisionData())
|
|
|
|
|
{
|
|
|
|
|
MsgBox.Show("<EFBFBD><EFBFBD><EFBFBD><EFBFBD> \"Vision.dat\" <20><><EFBFBD><EFBFBD>! ");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void CDlgTest::OnBnClickedAdjustProductPos()
|
|
|
|
|
{
|
|
|
|
|
CMsgBox MsgBox;
|
|
|
|
|
if(MsgBox.ConfirmOkCancel("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ץȡƫ<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>?")==false)
|
|
|
|
|
return;
|
|
|
|
|
gProductMgr->SetProductCenterPt();
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
gProgramCutMgr->SaveWorkParFile();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|