|
|
|
|
|
#include "stdafx.h"
|
|
|
#include "LaiPuLaser.h"
|
|
|
#include "DlgCutDeviceCtrl.h"
|
|
|
#include "afxdialogex.h"
|
|
|
#include "MsgBox.h"
|
|
|
#include "AuthorityMgr.h"
|
|
|
#include "DlgAuthorityMgr.h"
|
|
|
#include "ProgramCutMgr.h"
|
|
|
#include "CommonFlowMgr.h"
|
|
|
#include "ProgramCutMgr.h"
|
|
|
#include "PlatformXY.h"
|
|
|
#include "ProductMgr.h"
|
|
|
#include "LaserDeviceMgr.h"
|
|
|
#include "MarkParMgr.h"
|
|
|
#include "PropertieMgr.h"
|
|
|
#include "Propertie.h"
|
|
|
#include "WorkTime.h"
|
|
|
#include "MsgBox.h"
|
|
|
#include "EncryptionMgr.h"
|
|
|
#include "PciCh365Mgr.h"
|
|
|
#include "CStringFuc.h"
|
|
|
#include "WorkCmdContainer.h"
|
|
|
#include "MarkAreaMgr.h"
|
|
|
#include "SuperDogMgr.h"
|
|
|
#include "ObjComponentMgr.h"
|
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC(DlgCutDeviceCtrl, CDialogEx)
|
|
|
BEGIN_MESSAGE_MAP(DlgCutDeviceCtrl, CDialogEx)
|
|
|
ON_WM_TIMER()
|
|
|
ON_BN_CLICKED(IDC_INI_DEVICE_BTN, &DlgCutDeviceCtrl::OnBnClickedIniDeviceBtn)
|
|
|
ON_BN_CLICKED(IDC_OPEN_DXF, &DlgCutDeviceCtrl::OnBnClickedOpenDxfWorkFile)
|
|
|
|
|
|
|
|
|
ON_BN_CLICKED(IDC_START_WORK, &DlgCutDeviceCtrl::OnBnClickedStartWork)
|
|
|
ON_BN_CLICKED(IDC_BOOL_SEL_MARK, &DlgCutDeviceCtrl::OnBnClickedSelectedMark)
|
|
|
ON_BN_CLICKED(IDC_SAVE_PAR, &DlgCutDeviceCtrl::OnBnClickedSavePar)
|
|
|
ON_BN_CLICKED(IDC_OPEN_MAK, &DlgCutDeviceCtrl::OnBnClickedOpenMarkFile)
|
|
|
ON_BN_CLICKED(IDC_PRODUCT_1, &DlgCutDeviceCtrl::OnBnClickedProduct1)
|
|
|
ON_BN_CLICKED(IDC_PRODUCT_2, &DlgCutDeviceCtrl::OnBnClickedProduct2)
|
|
|
ON_BN_CLICKED(IDC_PRODUCT_3, &DlgCutDeviceCtrl::OnBnClickedProduct3)
|
|
|
ON_BN_CLICKED(IDC_PRODUCT_4, &DlgCutDeviceCtrl::OnBnClickedProduct4)
|
|
|
|
|
|
ON_BN_CLICKED(IDC_ADJUST_PRODUCT_POS, &DlgCutDeviceCtrl::OnBnClickedAdjustProductPos)
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
|
#define WORK_TIMER1 1
|
|
|
#define WORK_TIME_DELAY1 200
|
|
|
|
|
|
|
|
|
#define WORK_TIMER2 2
|
|
|
#define WORK_TIME_DELAY2 200
|
|
|
|
|
|
#define WORK_TIMER3 3
|
|
|
#define WORK_TIME_DELAY3 200
|
|
|
|
|
|
#define WORK_TIMER5 5
|
|
|
#define WORK_TIME_DELAY5 200
|
|
|
|
|
|
#define LASER_INFO_TIMER 6
|
|
|
#define LASER_INFO_TIMER_DELAY5 500
|
|
|
|
|
|
bool gbSelMark = false;
|
|
|
|
|
|
DlgCutDeviceCtrl::DlgCutDeviceCtrl(CWnd* pParent /*=NULL*/)
|
|
|
{
|
|
|
m_LaserPower = 7.5;//µçÁ÷Öµ
|
|
|
m_LaserFre = 50000;
|
|
|
m_LaserSpeed =300;
|
|
|
m_CutCount = 1;//Çиî´ÎÊý
|
|
|
m_MarkAreaCutCount = 1;
|
|
|
m_RotatoAdjust = 0;//Ðýתµ÷Õûmm
|
|
|
m_CurWorkStep = 0;
|
|
|
m_CurProductIdx = -1;//µ±Ç°²Ù×÷µÄ
|
|
|
}
|
|
|
DlgCutDeviceCtrl::~DlgCutDeviceCtrl()
|
|
|
{
|
|
|
m_CurWorkStep = 0;
|
|
|
}
|
|
|
void DlgCutDeviceCtrl::DoDataExchange(CDataExchange* pDX)
|
|
|
{
|
|
|
CDialogEx::DoDataExchange(pDX);
|
|
|
|
|
|
DDX_Control(pDX, IDC_OPEN_DXF, m_ReadDxfBtn);
|
|
|
DDX_Control(pDX, IDC_INI_DEVICE_BTN, m_IniDeviceBtn);
|
|
|
DDX_Control(pDX, IDC_START_WORK, m_StartWorkBtn);
|
|
|
DDX_Control(pDX, IDC_BOOL_SEL_MARK, m_SelMarkBtn);
|
|
|
DDX_Control(pDX, IDC_SAVE_PAR, m_SaveParBtn);
|
|
|
DDX_Control(pDX, IDC_OPEN_MAK, m_ReadMarkBtn);
|
|
|
DDX_Control(pDX, IDC_SAVE_MAK, m_SaveMarkBtn);
|
|
|
|
|
|
DDX_Control(pDX, IDC_PRODUCT_1, m_ProductBtn1);
|
|
|
DDX_Control(pDX, IDC_PRODUCT_2, m_ProductBtn2);
|
|
|
DDX_Control(pDX, IDC_PRODUCT_3, m_ProductBtn3);
|
|
|
DDX_Control(pDX, IDC_PRODUCT_4, m_ProductBtn4);
|
|
|
DDX_Control(pDX, IDC_ADJUST_PRODUCT_POS, m_AdjustProductPosBtn);
|
|
|
|
|
|
DDX_Text(pDX, IDC_LAESR_DIODE, m_LaserPower);
|
|
|
DDX_Text(pDX, IDC_LASER_FRE, m_LaserFre);
|
|
|
DDX_Text(pDX, IDC_CUT_SPEED, m_LaserSpeed);
|
|
|
DDX_Text(pDX, IDC_CUT_CNT, m_CutCount);
|
|
|
DDX_Text(pDX, IDC_SIZE_ADJUST, m_SizeAdjust.x);
|
|
|
DDX_Text(pDX, IDC_SIZE_ADJUSTY, m_SizeAdjust.y);
|
|
|
DDX_Text(pDX, IDC_CUR_WORK_TIME, m_CurWorkTimes);
|
|
|
DDX_Text(pDX, IDC_TOTAL_WORK_TIME, m_TotalWorkTimes);
|
|
|
DDX_Text(pDX, IDC_WORK_TIME, m_WorkTime);
|
|
|
DDX_Text(pDX, IDC_POS_ADJUSTX, m_OffsetAdjust.x);
|
|
|
DDX_Text(pDX, IDC_POS_ADJUSTY, m_OffsetAdjust.y);
|
|
|
DDX_Text(pDX, IDC_AREA_CUT_CNT, m_MarkAreaCutCount);
|
|
|
|
|
|
DDX_Text(pDX, IDC_ROTATO_ADJUST, m_RotatoAdjust);
|
|
|
}
|
|
|
|
|
|
BOOL DlgCutDeviceCtrl::OnInitDialog()
|
|
|
{
|
|
|
CDialogEx::OnInitDialog();
|
|
|
|
|
|
m_IniDeviceBtn.SetUpColor(RGB_RED);
|
|
|
m_EndInspectionBtn.SetUpColor(RGB_BLUE1);
|
|
|
m_SelMarkBtn.SetUpColor(RGB_GRAY1);
|
|
|
m_StartWorkBtn.SetUpColor(RGB_GREEN);
|
|
|
m_AdjustProductPosBtn.SetUpColor(RGB_PINK);
|
|
|
|
|
|
UpdateInfo();
|
|
|
|
|
|
|
|
|
//SetTimer(WORK_TIMER3,WORK_TIME_DELAY3,NULL);
|
|
|
|
|
|
//SetTimer(LASER_INFO_TIMER,LASER_INFO_TIMER_DELAY5,NULL);
|
|
|
UpdateData(FALSE);
|
|
|
return TRUE;
|
|
|
}
|
|
|
#if 1
|
|
|
//¹Û²ìƽ̨×ø±êµÄ±ä»¯
|
|
|
void DlgCutDeviceCtrl::UpdateInfo()
|
|
|
{
|
|
|
m_CurWorkTimes = gProductMgr->GetCurWorkTimes();
|
|
|
m_TotalWorkTimes = gProductMgr->GetTotalWorkTimes();
|
|
|
m_WorkTime = gWorkTime.GetTimeSpanStr();
|
|
|
m_OffsetAdjust = gCommonFlowMgr->GetAdjustOffset();
|
|
|
m_SizeAdjust = gCommonFlowMgr->GetAdjustSize();
|
|
|
m_RotatoAdjust = gCommonFlowMgr->GetRotatoAdjust();//Ðýתµ÷Õû
|
|
|
m_MarkAreaCutCount = gCommonFlowMgr->GetAreaCycleCnt();
|
|
|
UpdateData(FALSE);
|
|
|
}
|
|
|
void DlgCutDeviceCtrl::Update()
|
|
|
{
|
|
|
SetTimer(WORK_TIMER1,WORK_TIME_DELAY1,NULL);//ÓÃtimerÀ´¸üУ¬·ñÔò»á±¨´í
|
|
|
}
|
|
|
void DlgCutDeviceCtrl::OnTimer(UINT nIDEvent)
|
|
|
{
|
|
|
if(nIDEvent == WORK_TIMER1)
|
|
|
{
|
|
|
UpdateInfo();
|
|
|
KillTimer(WORK_TIMER1);
|
|
|
}
|
|
|
if(nIDEvent == WORK_TIMER2)//Æô¶¯¼Ó¹¤
|
|
|
{
|
|
|
KillTimer(WORK_TIMER2);
|
|
|
AutoWork();
|
|
|
}
|
|
|
if(nIDEvent == WORK_TIMER3)//¼ì²éÊÇ·ñÐèÒª¼Ó¹¤
|
|
|
{
|
|
|
SetProductBtnState();
|
|
|
CheckStartState();
|
|
|
}
|
|
|
|
|
|
if(nIDEvent == WORK_TIMER5)//Öظ´Æô¶¯¼Ó¹¤
|
|
|
{
|
|
|
KillTimer(WORK_TIMER5);
|
|
|
OnBnClickedStartWork();
|
|
|
}
|
|
|
if(nIDEvent == LASER_INFO_TIMER)//¼ì²â¼¤¹â²ÎÊý
|
|
|
{
|
|
|
#ifdef __READ_LASER_DEVICE_INFO__
|
|
|
//¸üм¤¹â²ÎÊý
|
|
|
UpdateLaserParInfo();
|
|
|
#endif
|
|
|
}
|
|
|
CDialog::OnTimer(nIDEvent);
|
|
|
}
|
|
|
#endif
|
|
|
#if 1
|
|
|
void DlgCutDeviceCtrl::OnBnClickedIniDeviceBtn()
|
|
|
{
|
|
|
if(gAuthorityMgr->CheckAuthority(_USER,true)==false)
|
|
|
return;
|
|
|
if(gProgramCutMgr->InitDevice())
|
|
|
{
|
|
|
m_IniDeviceBtn.SetUpColor(RGB_GREEN);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
m_IniDeviceBtn.SetUpColor(RGB_RED);
|
|
|
}
|
|
|
m_IniDeviceBtn.Refreash();
|
|
|
}
|
|
|
#endif
|
|
|
#if 1
|
|
|
|
|
|
//´ò¿ªdxf Îļþ--²¢´´½¨¼Ó¹¤Ô¼þ
|
|
|
void DlgCutDeviceCtrl::OnBnClickedOpenDxfWorkFile()
|
|
|
{
|
|
|
if(gAuthorityMgr->CheckAuthority(_USER,true)==false)
|
|
|
return;
|
|
|
OpenWorkFile(true);
|
|
|
}
|
|
|
void DlgCutDeviceCtrl::OnBnClickedOpenMarkFile()
|
|
|
{
|
|
|
if(gAuthorityMgr->CheckAuthority(_USER,true)==false)
|
|
|
return;
|
|
|
OpenWorkFile(false);
|
|
|
}
|
|
|
void DlgCutDeviceCtrl::OpenWorkFile(bool bDxf)
|
|
|
{
|
|
|
if(gAuthorityMgr->CheckAuthority(_USER,true)==false)
|
|
|
return;
|
|
|
//´ò¿ª
|
|
|
gProgramCutMgr->OpenWorkFile(bDxf);
|
|
|
//¶ÁÈ¡ÎļþÃû¶ÔÓ¦µÄ¼Ó¹¤²ÎÊýÎļþ
|
|
|
gProgramCutMgr->ReadWorkParFile();
|
|
|
gDevicePropertieMgr.SaveAllPropertie();
|
|
|
//ÉèÖòÎÊý,¸üÐÂÏÔʾ
|
|
|
SetPar();
|
|
|
//ÖØÐÂËѼ¯Êý¾ÝÔ´
|
|
|
//gProgramCutMgr->CollectSrcWorkData();
|
|
|
|
|
|
UpdateInfo();
|
|
|
}
|
|
|
#endif
|
|
|
#if 1
|
|
|
void DlgCutDeviceCtrl::SetProductBtnState()
|
|
|
{
|
|
|
vector<CProduct> &ProductVec = gProductMgr->GetProductVec();
|
|
|
int size = ProductVec.size();
|
|
|
for(int k=0;k<size;k++)
|
|
|
{
|
|
|
if(k==0)
|
|
|
SetProductBtnStateExt(m_ProductBtn1,ProductVec[k].IsUsed());
|
|
|
else if(k==1)
|
|
|
SetProductBtnStateExt(m_ProductBtn2,ProductVec[k].IsUsed());
|
|
|
else if(k==2)
|
|
|
SetProductBtnStateExt(m_ProductBtn3,ProductVec[k].IsUsed());
|
|
|
else if(k==3)
|
|
|
SetProductBtnStateExt(m_ProductBtn4,ProductVec[k].IsUsed());
|
|
|
}
|
|
|
}
|
|
|
void DlgCutDeviceCtrl::SetProductBtnStateExt(CMyBttom &btn,bool b)
|
|
|
{
|
|
|
if(b)
|
|
|
btn.SetUpColor(RGB_YELLOW);
|
|
|
else
|
|
|
btn.SetUpColor(RGB_GRAY1);
|
|
|
btn.Refreash();
|
|
|
}
|
|
|
|
|
|
void DlgCutDeviceCtrl::OnBnClickedProduct1()
|
|
|
{
|
|
|
OnBnClickedProduct(0);
|
|
|
}
|
|
|
void DlgCutDeviceCtrl::OnBnClickedProduct2()
|
|
|
{
|
|
|
OnBnClickedProduct(1);
|
|
|
}
|
|
|
void DlgCutDeviceCtrl::OnBnClickedProduct3()
|
|
|
{
|
|
|
OnBnClickedProduct(2);
|
|
|
}
|
|
|
void DlgCutDeviceCtrl::OnBnClickedProduct4()
|
|
|
{
|
|
|
OnBnClickedProduct(3);
|
|
|
}
|
|
|
void DlgCutDeviceCtrl::OnBnClickedProduct(int idx)
|
|
|
{
|
|
|
vector<CProduct> &ProductVec = gProductMgr->GetProductVec();
|
|
|
int size = ProductVec.size();
|
|
|
if(size>idx)
|
|
|
{
|
|
|
bool b = ProductVec[idx].IsUsed();
|
|
|
ProductVec[idx].SetUsed(!b);
|
|
|
SetProductBtnState();
|
|
|
gDevicePropertieMgr.SaveAllPropertie();
|
|
|
|
|
|
int ProductCnt = gProductMgr->GetUsedProductCnt();
|
|
|
if(ProductCnt == 1)
|
|
|
{
|
|
|
int size = ProductVec.size();
|
|
|
for(int i=0;i<size;i++)
|
|
|
{
|
|
|
if(ProductVec[i].IsUsed())
|
|
|
{
|
|
|
//½«Êý¾ÝÒƶ¯µ½µ±Ç°product µÄ»ù×¼µãÉÏ
|
|
|
Dbxy CurBasePt = ProductVec[i].GetProductBasePt();
|
|
|
gProgramCutMgr->MoveObjData(CurBasePt);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
GetCurViewPtr()->RefreshView();
|
|
|
}
|
|
|
}
|
|
|
//µ÷Õû²úÆ·µÄץȡƫÒÆλÖÃ
|
|
|
void DlgCutDeviceCtrl::OnBnClickedAdjustProductPos()
|
|
|
{
|
|
|
CMsgBox MsgBox;
|
|
|
if(MsgBox.ConfirmOkCancel("µ÷ÕûץȡƫÒÆλÖÃ?")==false)
|
|
|
return;
|
|
|
gProductMgr->SetProductCenterPt();
|
|
|
//±£´æ¼Ó¹¤²ÎÊý
|
|
|
gProgramCutMgr->SaveWorkParFile();
|
|
|
}
|
|
|
#endif
|
|
|
#if 1
|
|
|
//Ñ¡Ôñ¼Ó¹¤
|
|
|
void DlgCutDeviceCtrl::OnBnClickedSelectedMark()
|
|
|
{
|
|
|
if(gAuthorityMgr->CheckAuthority(_USER,true)==false)
|
|
|
return;
|
|
|
gbSelMark = !gbSelMark;
|
|
|
if(gbSelMark)
|
|
|
m_SelMarkBtn.SetUpColor(RGB_YELLOW);
|
|
|
else
|
|
|
m_SelMarkBtn.SetUpColor(RGB_GRAY1);
|
|
|
}
|
|
|
//¿ªÊ¼¹¤×÷
|
|
|
void DlgCutDeviceCtrl::OnBnClickedStartWork()
|
|
|
{
|
|
|
if(gSuperDogMgr->CheckState()==false)
|
|
|
{
|
|
|
CMsgBox MsgBox;
|
|
|
MsgBox.Show("É豸ʹÓÃÊÚȨÓÐÎÊÌâ £¬ÇëÁªÏµ¹©Ó¦ÉÌ!");
|
|
|
return;
|
|
|
}
|
|
|
if(gAuthorityMgr->CheckAuthority(_USER,true)==false)
|
|
|
return;
|
|
|
//±ÜÃâÖظ´Æô¶¯
|
|
|
if(m_CurWorkStep != 0)
|
|
|
return;
|
|
|
//¼Ó¹¤Ç°Ìáʾ
|
|
|
if(gCommonFlowMgr->StartWorkConfirm(gbSelMark)==false)
|
|
|
return;
|
|
|
|
|
|
m_CurProductIdx = -1;
|
|
|
//¸üÐÂproduct µÄ״̬(±ê¼Ç×îºóÒ»¸öproduct)
|
|
|
gProductMgr->UpdateProductState();
|
|
|
//È¡Ïûֹͣ״̬
|
|
|
gCommonFlowMgr->SetbWorkStop(false);
|
|
|
//ÉèÖõÚÒ»¸ö¼Ó¹¤µÄproduct ±àºÅ
|
|
|
gProductMgr->SetCurProductIdx(0);
|
|
|
}
|
|
|
//×Ô¶¯¼Ó¹¤(ÿ´Î¼Ó¹¤Ò»¸öproduct )
|
|
|
void DlgCutDeviceCtrl::AutoWork()
|
|
|
{
|
|
|
if(gCommonFlowMgr->IsbWorkStop())
|
|
|
{
|
|
|
m_CurWorkStep = 0;
|
|
|
}
|
|
|
int Idx = gProductMgr->GetCurProductIdx();
|
|
|
if(Idx<0)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
CProduct &Product = gProductMgr->GetProduct(Idx);
|
|
|
if(Product.IsUsed()==false)//¹ýÂ˵ô²»Ê¹ÓõÄproduct
|
|
|
{
|
|
|
m_CurWorkStep = 0;
|
|
|
}
|
|
|
if(m_CurWorkStep == 1)//ץȡ¶¨Î»1
|
|
|
{
|
|
|
//ÏÈ×¥Ò»Ö¡,°ÑCCD Í£µô
|
|
|
if(Idx ==0)//µÚÒ»¸öproduct
|
|
|
{
|
|
|
gWorkTime.StartRecordTime();//¼Æʱ¿ªÊ¼
|
|
|
}
|
|
|
//½«Êý¾ÝÒƶ¯µ½µ±Ç°product µÄ»ù×¼µãÉÏ
|
|
|
gProgramCutMgr->MoveObjData(Product.GetProductBasePt());
|
|
|
gCommonFlowMgr->CameraCatchTwoMark(Product);//ֻץȡһ¸öµã
|
|
|
if(Product.IsSetRealMarkPt1())
|
|
|
{
|
|
|
m_CurWorkStep = 2;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
m_CurWorkStep = 0;
|
|
|
}
|
|
|
}
|
|
|
else if(m_CurWorkStep == 2)//ץȡ¶¨Î»2
|
|
|
{
|
|
|
gCommonFlowMgr->CameraCatchTwoMark(Product);
|
|
|
if(Product.IsMarkReady())
|
|
|
{
|
|
|
m_CurWorkStep = 3;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
m_CurWorkStep = 0;
|
|
|
}
|
|
|
}
|
|
|
else if(m_CurWorkStep == 3)//¿ªÊ¼Çиî
|
|
|
{
|
|
|
if(Product.IsMarkReady())
|
|
|
{
|
|
|
if(!gbSelMark)//È«´òµÄʱºòÖ±½ÓÈ«²¿Ñ¡Ôñ2018-04-20
|
|
|
{
|
|
|
gObjComponentMgr->SelAllObj();
|
|
|
}
|
|
|
gProgramCutMgr->StartWork(Product,true);
|
|
|
CLayer &layer = GetLayerInstance();
|
|
|
CObjContainer ObjContainer = layer.GetObjContainer();
|
|
|
ObjContainer.NotSelAllObj();
|
|
|
}
|
|
|
m_CurWorkStep = 0;//½áÊø
|
|
|
}
|
|
|
if(m_CurWorkStep == 0)//½áÊø
|
|
|
{
|
|
|
gProductMgr->CurProductIdxInc();//product µÄË÷ÒýÖµ++
|
|
|
if(gProductMgr->GetCurProductIdx()<0)//ËùÓÐproduct ¼Ó¹¤Íê³É
|
|
|
{
|
|
|
//Òƶ¯»ØĬÈϵÄλÖÃ
|
|
|
gProgramCutMgr->MoveObjData(Dbxy(0,0));
|
|
|
gCommonFlowMgr->SetLightStateCmd(false);
|
|
|
gWorkTime.StopRecordTime();//Í£Ö¹¼Æʱ
|
|
|
//½«Êý¾ÝÒƶ¯µ½product 0 µÄ»ù×¼µãÉÏ
|
|
|
CProduct &Product0 = gProductMgr->GetProduct(0);
|
|
|
gProgramCutMgr->MoveObjData(Product0.GetProductBasePt());
|
|
|
|
|
|
if(gCommonFlowMgr->IsNeedExecAgain())//¿½»úÔÙ´ÎÆô¶¯
|
|
|
{
|
|
|
SetTimer(WORK_TIMER5,WORK_TIME_DELAY5,NULL);
|
|
|
}
|
|
|
//Çå¿ÕÖ¸Á
|
|
|
CWorkCmdContainer &CmdContainer = CWorkCmdContainer::GetInstance();//Ö¸Á
|
|
|
CmdContainer.Clear();
|
|
|
gLogMgr->WriteDebugLog("All Work End");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
//û½áÊø£¬¼ÌÐøÆô¶¯AutoWork()
|
|
|
if(m_CurWorkStep>=1 && m_CurWorkStep<=3)
|
|
|
{
|
|
|
SetTimer(WORK_TIMER2,WORK_TIME_DELAY2,NULL);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//¼ì²éÆô¶¯×´Ì¬(ÕâÀ︺ÔðÇиîproduct ½øÐмӹ¤)
|
|
|
void DlgCutDeviceCtrl::CheckStartState()
|
|
|
{
|
|
|
int Idx = gProductMgr->GetCurProductIdx();
|
|
|
if(Idx>=0 && Idx != m_CurProductIdx)//²»ÒªÖظ´Æô¶¯
|
|
|
{
|
|
|
m_CurProductIdx = Idx;//µ±Ç°¼Ó¹¤µÄproduct
|
|
|
m_CurWorkStep = 1;//¿ØÖƼӹ¤µ±Ç°productµÄ²½Öè
|
|
|
if(Idx == 0)
|
|
|
{
|
|
|
gCommonFlowMgr->SetLightStateCmd(true);
|
|
|
}
|
|
|
AutoWork();
|
|
|
}
|
|
|
}
|
|
|
//ͨ¹ý°´Å¥Æô¶¯¼Ó¹¤
|
|
|
void DlgCutDeviceCtrl::StartWrokByBottom()
|
|
|
{
|
|
|
|
|
|
}
|
|
|
#endif
|
|
|
#if 1
|
|
|
void DlgCutDeviceCtrl::SetPar()
|
|
|
{
|
|
|
m_LaserPower = gCLaserDeviceMgr->GetPower();
|
|
|
m_LaserFre = gCLaserDeviceMgr->GetLaserFre();
|
|
|
CMarkPar& MarkPar = gMarkParMgr->GetCurPen();
|
|
|
m_LaserSpeed = MarkPar.ms;//ÇиîËÙ¶È
|
|
|
m_CutCount = gCommonFlowMgr->m_OneObjMarkCnt;//Çиî´ÎÊý
|
|
|
m_OffsetAdjust = gCommonFlowMgr->GetAdjustOffset();
|
|
|
m_RotatoAdjust = gCommonFlowMgr->GetRotatoAdjust();//Ðýתµ÷Õû
|
|
|
m_SizeAdjust = gCommonFlowMgr->GetAdjustSize();
|
|
|
m_MarkAreaCutCount = gCommonFlowMgr->GetAreaCycleCnt();//Ñ»·´ÎÊý
|
|
|
UpdateData(FALSE);
|
|
|
}
|
|
|
//Ó¦ÓòÎÊý
|
|
|
void DlgCutDeviceCtrl::OnBnClickedSavePar()
|
|
|
{
|
|
|
if(gAuthorityMgr->CheckAuthority(_USER,true)==false)
|
|
|
return;
|
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
|
gCLaserDeviceMgr->SetPower(m_LaserPower);
|
|
|
gCLaserDeviceMgr->SetFre(m_LaserFre);
|
|
|
CMarkPar& MarkPar = gMarkParMgr->GetCurPen();
|
|
|
MarkPar.ms = m_LaserSpeed;//ÇиîËÙ¶È
|
|
|
gMarkParMgr->SaveCurPen(MarkPar);
|
|
|
gCommonFlowMgr->m_OneObjMarkCnt = m_CutCount;//Çиî´ÎÊý
|
|
|
gCommonFlowMgr->SetAdjustOffset(m_OffsetAdjust);
|
|
|
gCommonFlowMgr->SetRotatoAdjust(m_RotatoAdjust);
|
|
|
gCommonFlowMgr->SetAdjustSize(m_SizeAdjust);
|
|
|
gCommonFlowMgr->SetAreaCycleCnt(m_MarkAreaCutCount);
|
|
|
|
|
|
gDevicePropertieMgr.SaveAllPropertie();
|
|
|
//ÉèÖü¤¹âµÄ²ÎÊý
|
|
|
gCLaserDeviceMgr->SetParToLaserDevice(false);
|
|
|
|
|
|
//ÖØÐÂËѼ¯Êý¾ÝÔ´
|
|
|
gProgramCutMgr->CollectSrcWorkData();
|
|
|
|
|
|
CMsgBox MsgBox;
|
|
|
MsgBox.Show("²ÎÊýÓ¦Óóɹ¦");
|
|
|
|
|
|
//±£´æ¼Ó¹¤²ÎÊý
|
|
|
gProgramCutMgr->SaveWorkParFile();
|
|
|
}
|
|
|
#endif
|
|
|
//¸üм¤¹â²ÎÊý
|
|
|
void DlgCutDeviceCtrl::UpdateLaserParInfo()
|
|
|
{
|
|
|
double LaserCurr = gCLaserDeviceMgr->GetCurLaserCurr();
|
|
|
double LaserFre = gCLaserDeviceMgr->GetCurLaserFre();
|
|
|
if(LaserCurr<0 ||LaserCurr>100)
|
|
|
LaserCurr = 0;
|
|
|
if(LaserFre<0 ||LaserFre>100)
|
|
|
LaserFre = 0;
|
|
|
|
|
|
GetDlgItem(IDC_SLEEP_TIME)->SetWindowText(gCLaserDeviceMgr->GetCurLeftTimes());
|
|
|
GetDlgItem(IDC_CUR_LASER_CURR)->SetWindowText(Db2CString(LaserCurr));
|
|
|
GetDlgItem(IDC_CUR_LASER_FRE)->SetWindowText(Db2CString(LaserFre));
|
|
|
}
|