|
|
|
|
#include "StdAfx.h"
|
|
|
|
|
#include "MarkCtrl.h"
|
|
|
|
|
#include "LaipuVbDllMgr.h"
|
|
|
|
|
#include "WorkDataMgr.h"
|
|
|
|
|
#include "LogMgr.h"
|
|
|
|
|
#include "MarkParMgr.h"
|
|
|
|
|
#include "GlobalFunction.h"
|
|
|
|
|
#include "Mirror.h"
|
|
|
|
|
#include "ProductMgr.h"
|
|
|
|
|
#include "PciCh365Mgr.h"
|
|
|
|
|
#include "WorkCmdContainer.h"
|
|
|
|
|
#include "WorkCmdMarkArea.h"
|
|
|
|
|
#include "WorkCmdInvoker.h"
|
|
|
|
|
#include "MarkArea.h"
|
|
|
|
|
#include "WorkTime.h"
|
|
|
|
|
#include "ExceptionMsg.h"
|
|
|
|
|
#include "CommonFlowMgr.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CMarkCtrl::CMarkCtrl(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
CMarkCtrl::~CMarkCtrl(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
#if 1
|
|
|
|
|
void CMarkCtrl::StartMarkPci(vector<vector<Dbxy>> &DateVec,vector<vector<Dbxy>> &SpecialDateVec,int AreaCycleCnt)
|
|
|
|
|
{
|
|
|
|
|
gLogMgr->WriteDebugLog("StartMarkPci",_LOG_FUNC);
|
|
|
|
|
if(gPciCh365Mgr->IsInitialize()==false)
|
|
|
|
|
{
|
|
|
|
|
CString LogStr("Func : StartMarkPci ---->Pci Card Not Init");
|
|
|
|
|
AfxMessageBox(LogStr);
|
|
|
|
|
CExceptionMsg Msg;
|
|
|
|
|
Msg.SetMsg(LogStr);
|
|
|
|
|
throw Msg;
|
|
|
|
|
}
|
|
|
|
|
//CLaipuVbDllMgr &LaipuVbDll = *gLaipuVbDllMgr;
|
|
|
|
|
CLaipuVbDllMgr LaipuVbDll;
|
|
|
|
|
|
|
|
|
|
long low = gPciCh365Mgr->GetOutPortState(true);
|
|
|
|
|
long high = gPciCh365Mgr->GetOutPortState(false);
|
|
|
|
|
LaipuVbDll.VbIniCard(low,high);//<2F><>ʼ<EFBFBD><CABC>
|
|
|
|
|
SetMarkParam(LaipuVbDll);//<2F><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD>
|
|
|
|
|
LaipuVbDll.MarkingStart();//<><D7BC>
|
|
|
|
|
gLogMgr->WriteDebugLog("finc->MarkingStart,finished! Prepare OK!");
|
|
|
|
|
for(int i=0;i<AreaCycleCnt;i++)
|
|
|
|
|
{
|
|
|
|
|
LaipuVbDll.CallMarkingData(DateVec);//<2F>ӹ<EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
if(!SpecialDateVec.empty())//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD>ӹ<EFBFBD>һ<EFBFBD><D2BB>
|
|
|
|
|
{
|
|
|
|
|
LaipuVbDll.CallMarkingData(SpecialDateVec);//<2F>ӹ<EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>---------------------------------------------------------------------
|
|
|
|
|
long fileno = -1;
|
|
|
|
|
long fileAll = 1;
|
|
|
|
|
long MarkM = 8;//<2F><><EFBFBD><EFBFBD>ģʽ(<28><>ģ<EFBFBD>壬<EFBFBD><E5A3AC>λ<EFBFBD><CEBB>)
|
|
|
|
|
long m_sel = 1;//<2F>ļ<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>ʽ
|
|
|
|
|
long head = 0;
|
|
|
|
|
//ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD>ż<EFBFBD>λ<EFBFBD><CEBB>ƫ<EFBFBD><C6AB>
|
|
|
|
|
LaipuVbDll.CallMarkingEnd(fileno,fileAll,MarkM,m_sel,head,NULL);//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>ñ<EFBFBD><C3B1>̲<EFBFBD><CCB2><EFBFBD>
|
|
|
|
|
void CMarkCtrl::SetMarkParam(CLaipuVbDllMgr &LaipuVbDll)
|
|
|
|
|
{
|
|
|
|
|
gMarkParMgr->SetCurPenNum(0);//ֻʹ<D6BB><CAB9>0 <20>űʵIJ<CAB5><C4B2><EFBFBD>
|
|
|
|
|
CMarkPar &MarkPar = gMarkParMgr->GetCurPen();
|
|
|
|
|
//<2F><EFBFBD><F1BEB5B2><EFBFBD>--------------------------------------------------------------
|
|
|
|
|
//float ms = MarkPar.ms;//<2F><><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD>mm/s
|
|
|
|
|
float ms = (float)gCommonFlowMgr->GetCutSpeed();
|
|
|
|
|
float mms = MarkPar.mms;//<2F><><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD>mm/s
|
|
|
|
|
long tcf = MarkPar.tcf;//<2F>ؼ<EFBFBD><D8BC><EFBFBD>ǰ<EFBFBD><C7B0>ʱus
|
|
|
|
|
long tch = MarkPar.tch;//<2F>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱus
|
|
|
|
|
long tof = MarkPar.tof;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>ʱus
|
|
|
|
|
long toh = MarkPar.toh;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱus
|
|
|
|
|
long dr_time = MarkPar.dr_time;//<2F>յ<EFBFBD><D5B5><EFBFBD>ʱ us
|
|
|
|
|
double su = gMirror->GetMirrorStep();//<2F><EFBFBD><F1BEB5B2><EFBFBD>um
|
|
|
|
|
float laserfre = MarkPar.laserfre;//<2F><><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>
|
|
|
|
|
float laserpower = MarkPar.laserpower;//<2F><><EFBFBD><EFBFBD><E2B9A6>
|
|
|
|
|
float maxlaserpower = MarkPar.maxlaserpower;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
CString LogStr;
|
|
|
|
|
LogStr.Format(_T("Fuc:SetMarkParam : [CutSpeed] = [%f] "),ms);
|
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
|
LogStr.Format(_T("Fuc:SetMarkParam : [laserfre] = [%f] ,[laserpower] = [%f] ,[maxlaserpower] = [%f]"),laserfre,laserpower,maxlaserpower);
|
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
|
|
|
|
|
|
LaipuVbDll.GetCom()->Marking_para(&ms,&mms,&tcf,&tch,&tof,&toh,&su,&laserpower,&laserfre,&maxlaserpower,&dr_time);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|