|
|
@ -102,10 +102,10 @@ CMFCPropertyGridProperty * CCommonFlowMgr::CreatGridProperty()
|
|
|
|
CString Description;//描述
|
|
|
|
CString Description;//描述
|
|
|
|
CString Path = _T("CommonFlowMgr");;//存储路径
|
|
|
|
CString Path = _T("CommonFlowMgr");;//存储路径
|
|
|
|
CString Name;
|
|
|
|
CString Name;
|
|
|
|
//-------------------------------------------------------------------------------//
|
|
|
|
//-------------------------------------------------------------------------------//
|
|
|
|
PropertyName = _T("常用流程");
|
|
|
|
PropertyName = _T("常用流程");
|
|
|
|
CMFCPropertyGridProperty* pGroup = new CMFCPropertyGridProperty(PropertyName);
|
|
|
|
CMFCPropertyGridProperty* pGroup = new CMFCPropertyGridProperty(PropertyName);
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
if (gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//添加属性变量映射
|
|
|
|
//添加属性变量映射
|
|
|
@ -229,11 +229,11 @@ CMFCPropertyGridProperty * CCommonFlowMgr::CreatGridProperty()
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------//
|
|
|
|
//-------------------------------------------------------------------------------//
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("设备初始化"));
|
|
|
|
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("设备初始化"));
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
if (gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//添加属性变量映射
|
|
|
|
//添加属性变量映射
|
|
|
@ -342,7 +342,7 @@ CMFCPropertyGridProperty * CCommonFlowMgr::CreatGridProperty()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("大幅面加工"));
|
|
|
|
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("大幅面加工"));
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
if (gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//添加属性变量映射
|
|
|
|
//添加属性变量映射
|
|
|
@ -429,7 +429,7 @@ CMFCPropertyGridProperty * CCommonFlowMgr::CreatGridProperty()
|
|
|
|
pGroup1->AddSubItem(p);
|
|
|
|
pGroup1->AddSubItem(p);
|
|
|
|
gDevicePropertieMgr.Insert(p, pPropertie);
|
|
|
|
gDevicePropertieMgr.Insert(p, pPropertie);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//添加属性变量映射
|
|
|
|
//添加属性变量映射
|
|
|
|
Name = _T("m_RotatoAdjust");//变量名字
|
|
|
|
Name = _T("m_RotatoAdjust");//变量名字
|
|
|
@ -447,7 +447,7 @@ CMFCPropertyGridProperty * CCommonFlowMgr::CreatGridProperty()
|
|
|
|
pGroup1->AddSubItem(p);
|
|
|
|
pGroup1->AddSubItem(p);
|
|
|
|
gDevicePropertieMgr.Insert(p, pPropertie);
|
|
|
|
gDevicePropertieMgr.Insert(p, pPropertie);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//添加属性变量映射
|
|
|
|
//添加属性变量映射
|
|
|
|
Name = _T("m_bFocalAdjust");//变量名字
|
|
|
|
Name = _T("m_bFocalAdjust");//变量名字
|
|
|
@ -592,7 +592,7 @@ CMFCPropertyGridProperty * CCommonFlowMgr::CreatGridProperty()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("平台切割"));
|
|
|
|
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("平台切割"));
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
if (gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//添加属性变量映射
|
|
|
|
//添加属性变量映射
|
|
|
@ -617,7 +617,7 @@ CMFCPropertyGridProperty * CCommonFlowMgr::CreatGridProperty()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("振镜校准"));
|
|
|
|
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("振镜校准"));
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
if (gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//添加属性变量映射
|
|
|
|
//添加属性变量映射
|
|
|
@ -668,56 +668,56 @@ void CCommonFlowMgr::Ini()
|
|
|
|
#if 1
|
|
|
|
#if 1
|
|
|
|
void CCommonFlowMgr::WriteWorkFileExt(vector<CLab> &LabVec)
|
|
|
|
void CCommonFlowMgr::WriteWorkFileExt(vector<CLab> &LabVec)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LabVec.push_back(CLab(LAB_ONE_OBJ_CUT_TIMES,m_OneObjMarkCnt));
|
|
|
|
LabVec.push_back(CLab(LAB_ONE_OBJ_CUT_TIMES, m_OneObjMarkCnt));
|
|
|
|
LabVec.push_back(CLab(LAB_SPECIAL_ONE_OBJ_CUT_TIMES,m_SpecialOneObjMarkCnt));
|
|
|
|
LabVec.push_back(CLab(LAB_SPECIAL_ONE_OBJ_CUT_TIMES, m_SpecialOneObjMarkCnt));
|
|
|
|
LabVec.push_back(CLab(LAB_ONE_AREA_CUT_TIMES,m_AreaCycleCnt));
|
|
|
|
LabVec.push_back(CLab(LAB_ONE_AREA_CUT_TIMES, m_AreaCycleCnt));
|
|
|
|
LabVec.push_back(CLab(LAB_ONE_CUT_SPEED,m_CutSpeed));
|
|
|
|
LabVec.push_back(CLab(LAB_ONE_CUT_SPEED, m_CutSpeed));
|
|
|
|
LabVec.push_back(CLab(LAB_ADJUST_OFFSET_X,m_ProductOffset.x));
|
|
|
|
LabVec.push_back(CLab(LAB_ADJUST_OFFSET_X, m_Jig2PrtOft.x));
|
|
|
|
LabVec.push_back(CLab(LAB_ADJUST_OFFSET_Y,m_ProductOffset.y));
|
|
|
|
LabVec.push_back(CLab(LAB_ADJUST_OFFSET_Y, m_Jig2PrtOft.y));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void CCommonFlowMgr::ReadWorkFile(CLabVecRang &LabVecRang)
|
|
|
|
void CCommonFlowMgr::ReadWorkFile(CLabVecRang &LabVecRang)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkFileMgr WorkFileMgr;
|
|
|
|
CWorkFileMgr WorkFileMgr;
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_ONE_OBJ_CUT_TIMES);
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang, LAB_ONE_OBJ_CUT_TIMES);
|
|
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
|
|
if (Lab.m_ValType != _TYPE_NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_OneObjMarkCnt = Lab.m_Int;
|
|
|
|
m_OneObjMarkCnt = Lab.m_Int;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_SPECIAL_ONE_OBJ_CUT_TIMES);
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang, LAB_SPECIAL_ONE_OBJ_CUT_TIMES);
|
|
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
|
|
if (Lab.m_ValType != _TYPE_NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_SpecialOneObjMarkCnt = Lab.m_Int;
|
|
|
|
m_SpecialOneObjMarkCnt = Lab.m_Int;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_ONE_AREA_CUT_TIMES);
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang, LAB_ONE_AREA_CUT_TIMES);
|
|
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
|
|
if (Lab.m_ValType != _TYPE_NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_AreaCycleCnt = Lab.m_Int;
|
|
|
|
m_AreaCycleCnt = Lab.m_Int;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_ONE_CUT_SPEED);
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang, LAB_ONE_CUT_SPEED);
|
|
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
|
|
if (Lab.m_ValType != _TYPE_NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_CutSpeed = Lab.m_Int;
|
|
|
|
m_CutSpeed = Lab.m_Int;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_ADJUST_OFFSET_X);
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang, LAB_ADJUST_OFFSET_X);
|
|
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
|
|
if (Lab.m_ValType != _TYPE_NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_ProductOffset.x = Lab.m_Double;
|
|
|
|
m_Jig2PrtOft.x = Lab.m_Double;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_ADJUST_OFFSET_Y);
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang, LAB_ADJUST_OFFSET_Y);
|
|
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
|
|
if (Lab.m_ValType != _TYPE_NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_ProductOffset.y = Lab.m_Double;
|
|
|
|
m_Jig2PrtOft.y = Lab.m_Double;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -726,11 +726,11 @@ void CCommonFlowMgr::ReadWorkFile(CLabVecRang &LabVecRang)
|
|
|
|
#if 1
|
|
|
|
#if 1
|
|
|
|
bool CCommonFlowMgr::StartWorkConfirm(bool bSelMark)
|
|
|
|
bool CCommonFlowMgr::StartWorkConfirm(bool bSelMark)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!m_bStartWorkMsg)
|
|
|
|
if (!m_bStartWorkMsg)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
CString str;
|
|
|
|
CString str;
|
|
|
|
if(bSelMark)
|
|
|
|
if (bSelMark)
|
|
|
|
str = "开始选择切割?";
|
|
|
|
str = "开始选择切割?";
|
|
|
|
else
|
|
|
|
else
|
|
|
|
str = "开始全部切割?";
|
|
|
|
str = "开始全部切割?";
|
|
|
@ -743,7 +743,7 @@ bool CCommonFlowMgr::IsNeedExecAgain()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//查询的是否累加当前次数
|
|
|
|
//查询的是否累加当前次数
|
|
|
|
m_CurWorkExecTimes++;
|
|
|
|
m_CurWorkExecTimes++;
|
|
|
|
if(m_CurWorkExecTimes>=m_AllWorkExecTimes)
|
|
|
|
if (m_CurWorkExecTimes >= m_AllWorkExecTimes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_CurWorkExecTimes = 0;//重置
|
|
|
|
m_CurWorkExecTimes = 0;//重置
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -751,28 +751,28 @@ bool CCommonFlowMgr::IsNeedExecAgain()
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置警示灯
|
|
|
|
//设置警示灯
|
|
|
|
void CCommonFlowMgr::SetLightStateCmd(CWorkCmdContainer &CmdContainer,bool bStart)
|
|
|
|
void CCommonFlowMgr::SetLightStateCmd(CWorkCmdContainer &CmdContainer, bool bStart)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!m_bSetLightState)
|
|
|
|
if (!m_bSetLightState)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
#if 1
|
|
|
|
#if 1
|
|
|
|
if(bStart)
|
|
|
|
if (bStart)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//关闭所有灯和蜂鸣器
|
|
|
|
//关闭所有灯和蜂鸣器
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LIGHT_R,false);
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LIGHT_R, false);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LIGHT_Y,false);
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LIGHT_Y, false);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LIGHT_G,false);
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LIGHT_G, false);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_ALARM,false);
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_ALARM, false);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -780,41 +780,41 @@ void CCommonFlowMgr::SetLightStateCmd(CWorkCmdContainer &CmdContainer,bool bSta
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//亮黄灯------------------------------------
|
|
|
|
//亮黄灯------------------------------------
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LIGHT_Y,true);
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LIGHT_Y, true);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LIGHT_R,false);
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LIGHT_R, false);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LIGHT_G,false);
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LIGHT_G, false);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//蜂鸣器提示-----------------------------
|
|
|
|
//蜂鸣器提示-----------------------------
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_ALARM,true);
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_ALARM, true);
|
|
|
|
pCmd->SetAfterDelay(m_AlamDelay);
|
|
|
|
pCmd->SetAfterDelay(m_AlamDelay);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_ALARM,false);
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_ALARM, false);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置警示灯
|
|
|
|
//设置警示灯
|
|
|
|
void CCommonFlowMgr::SetLightStateCmd(bool bStart)
|
|
|
|
void CCommonFlowMgr::SetLightStateCmd(bool bStart)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!m_bSetLightState)
|
|
|
|
if (!m_bSetLightState)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
CCommPortMgr com;
|
|
|
|
CCommPortMgr com;
|
|
|
|
//打开串口
|
|
|
|
//打开串口
|
|
|
|
if(com.Open(gPlcIOMgr->GetComPort(),115200)==false)
|
|
|
|
if (com.Open(gPlcIOMgr->GetComPort(), 115200) == false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -824,17 +824,17 @@ void CCommonFlowMgr::SetLightStateCmd(bool bStart)
|
|
|
|
|
|
|
|
|
|
|
|
CString str;
|
|
|
|
CString str;
|
|
|
|
com.Write(str);
|
|
|
|
com.Write(str);
|
|
|
|
if(bStart)
|
|
|
|
if (bStart)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
str = strG +char(13)+char(10);
|
|
|
|
str = strG + char(13) + char(10);
|
|
|
|
com.Write(str);
|
|
|
|
com.Write(str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
str = strR +char(13)+char(10);
|
|
|
|
str = strR + char(13) + char(10);
|
|
|
|
com.Write(str);
|
|
|
|
com.Write(str);
|
|
|
|
Sleep(m_AlamDelay);
|
|
|
|
Sleep(m_AlamDelay);
|
|
|
|
str = strY +char(13)+char(10);
|
|
|
|
str = strY + char(13) + char(10);
|
|
|
|
com.Write(str);
|
|
|
|
com.Write(str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
com.Close();
|
|
|
|
com.Close();
|
|
|
@ -844,9 +844,9 @@ void CCommonFlowMgr::SetLightStateCmd(bool bStart)
|
|
|
|
bool CCommonFlowMgr::InitDevice()
|
|
|
|
bool CCommonFlowMgr::InitDevice()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CMsgBox MsgBox;
|
|
|
|
CMsgBox MsgBox;
|
|
|
|
if(m_bIniConfirmMsgBox)
|
|
|
|
if (m_bIniConfirmMsgBox)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(MsgBox.ConfirmOkCancel(_T("初始化设备?"))==false)
|
|
|
|
if (MsgBox.ConfirmOkCancel(_T("初始化设备?")) == false)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -877,46 +877,46 @@ bool CCommonFlowMgr::InitDevice()
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//反向移动一段距离
|
|
|
|
//反向移动一段距离
|
|
|
|
if(m_bIniMotorZ)
|
|
|
|
if (m_bIniMotorZ)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CMotor *pMotorZ = CMotor::GetMotor(MOTOR_Z);
|
|
|
|
CMotor *pMotorZ = CMotor::GetMotor(MOTOR_Z);
|
|
|
|
double Dis = pMotorZ->GetReverseMoveDis();
|
|
|
|
double Dis = pMotorZ->GetReverseMoveDis();
|
|
|
|
CWorkCmdMoveMotor *pCmd = new CWorkCmdMoveMotor(*pMotorZ,Dis);
|
|
|
|
CWorkCmdMoveMotor *pCmd = new CWorkCmdMoveMotor(*pMotorZ, Dis);
|
|
|
|
pCmd->SetMoveFlg(true);//移动一段距离
|
|
|
|
pCmd->SetMoveFlg(true);//移动一段距离
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_bIniMotorZ)//等待移动结束
|
|
|
|
if (m_bIniMotorZ)//等待移动结束
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdWaitMotorStop *pCmd = new CWorkCmdWaitMotorStop();
|
|
|
|
CWorkCmdWaitMotorStop *pCmd = new CWorkCmdWaitMotorStop();
|
|
|
|
pCmd->SetbWaitMotorZ();
|
|
|
|
pCmd->SetbWaitMotorZ();
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_bIniMotorZ)
|
|
|
|
if (m_bIniMotorZ)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMotorToMachineOrigin *pCmd = new CWorkCmdMotorToMachineOrigin(*(CMotor::GetMotor("Z")));
|
|
|
|
CWorkCmdMotorToMachineOrigin *pCmd = new CWorkCmdMotorToMachineOrigin(*(CMotor::GetMotor("Z")));
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//等待运动结束
|
|
|
|
//等待运动结束
|
|
|
|
if(m_bIniMotorZ)
|
|
|
|
if (m_bIniMotorZ)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdWaitMotorStop *pCmd = new CWorkCmdWaitMotorStop();
|
|
|
|
CWorkCmdWaitMotorStop *pCmd = new CWorkCmdWaitMotorStop();
|
|
|
|
pCmd->SetbWaitMotorZ();
|
|
|
|
pCmd->SetbWaitMotorZ();
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//XY 平台相关------------------------------------------------------------
|
|
|
|
//XY 平台相关------------------------------------------------------------
|
|
|
|
if(m_bIniPlatfrom)
|
|
|
|
if (m_bIniPlatfrom)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(m_bIniMotorX)
|
|
|
|
if (m_bIniMotorX)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMotorToMachineOrigin *pCmd = new CWorkCmdMotorToMachineOrigin(*(CMotor::GetMotor("X")));
|
|
|
|
CWorkCmdMotorToMachineOrigin *pCmd = new CWorkCmdMotorToMachineOrigin(*(CMotor::GetMotor("X")));
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_bIniMotorX)
|
|
|
|
if (m_bIniMotorX)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMotorToMachineOrigin *pCmd = new CWorkCmdMotorToMachineOrigin(*(CMotor::GetMotor("X2")));
|
|
|
|
CWorkCmdMotorToMachineOrigin *pCmd = new CWorkCmdMotorToMachineOrigin(*(CMotor::GetMotor("X2")));
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_bIniMotorY)
|
|
|
|
if (m_bIniMotorY)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMotorToMachineOrigin *pCmd = new CWorkCmdMotorToMachineOrigin(*(CMotor::GetMotor("Y")));
|
|
|
|
CWorkCmdMotorToMachineOrigin *pCmd = new CWorkCmdMotorToMachineOrigin(*(CMotor::GetMotor("Y")));
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
@ -946,17 +946,17 @@ bool CCommonFlowMgr::InitDevice()
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//移动到原点偏移位置
|
|
|
|
//移动到原点偏移位置
|
|
|
|
if(m_bIniMotorY)
|
|
|
|
if (m_bIniMotorY)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMotorToOffsetPos *pCmd = new CWorkCmdMotorToOffsetPos(*(CMotor::GetMotor("Y")));
|
|
|
|
CWorkCmdMotorToOffsetPos *pCmd = new CWorkCmdMotorToOffsetPos(*(CMotor::GetMotor("Y")));
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_bIniMotorX)
|
|
|
|
if (m_bIniMotorX)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMotorToOffsetPos *pCmd = new CWorkCmdMotorToOffsetPos(*(CMotor::GetMotor("X")));
|
|
|
|
CWorkCmdMotorToOffsetPos *pCmd = new CWorkCmdMotorToOffsetPos(*(CMotor::GetMotor("X")));
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_bIniMotorX)
|
|
|
|
if (m_bIniMotorX)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMotorToOffsetPos *pCmd = new CWorkCmdMotorToOffsetPos(*(CMotor::GetMotor("X2")));
|
|
|
|
CWorkCmdMotorToOffsetPos *pCmd = new CWorkCmdMotorToOffsetPos(*(CMotor::GetMotor("X2")));
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
@ -970,13 +970,13 @@ bool CCommonFlowMgr::InitDevice()
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_bIniMotorZ)
|
|
|
|
if (m_bIniMotorZ)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMotorToOffsetPos *pCmd = new CWorkCmdMotorToOffsetPos(*(CMotor::GetMotor("Z")));
|
|
|
|
CWorkCmdMotorToOffsetPos *pCmd = new CWorkCmdMotorToOffsetPos(*(CMotor::GetMotor("Z")));
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//等待运动结束
|
|
|
|
//等待运动结束
|
|
|
|
if(m_bIniMotorZ)
|
|
|
|
if (m_bIniMotorZ)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdWaitMotorStop *pCmd = new CWorkCmdWaitMotorStop();
|
|
|
|
CWorkCmdWaitMotorStop *pCmd = new CWorkCmdWaitMotorStop();
|
|
|
|
pCmd->SetbWaitMotorZ();
|
|
|
|
pCmd->SetbWaitMotorZ();
|
|
|
@ -994,7 +994,7 @@ bool CCommonFlowMgr::InitDevice()
|
|
|
|
gPlatformXY->SetbUseMoveRange(OldbUseMoveRange);
|
|
|
|
gPlatformXY->SetbUseMoveRange(OldbUseMoveRange);
|
|
|
|
|
|
|
|
|
|
|
|
bool Ret = !Invoker.IsCancel();
|
|
|
|
bool Ret = !Invoker.IsCancel();
|
|
|
|
if(Ret)
|
|
|
|
if (Ret)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
gCameraHawkvis->OpenCamera();
|
|
|
|
gCameraHawkvis->OpenCamera();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1002,20 +1002,21 @@ bool CCommonFlowMgr::InitDevice()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//普通的振镜打标功能(layer 中的图形数据,平台不移动)
|
|
|
|
//普通的振镜打标功能(layer 中的图形数据,平台不移动)
|
|
|
|
//使用pci 卡(times 加工次数) (CyclicTimes 循环次数)
|
|
|
|
//使用pci 卡(times 加工次数) (CyclicTimes 循环次数)
|
|
|
|
bool CCommonFlowMgr::NormalMarkByPciCard(bool bSel,int times,int CyclicTimes)
|
|
|
|
bool CCommonFlowMgr::NormalMarkByPciCard(bool bSel, int times, int CyclicTimes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
gLogMgr->WriteDebugLog("Fuc---->NormalMarkByPciCard : bSel = " + Bool2Str(bSel));
|
|
|
|
gLogMgr->WriteDebugLog("Fuc---->NormalMarkByPciCard : bSel = " + Bool2Str(bSel));
|
|
|
|
//临时Product
|
|
|
|
//临时Product
|
|
|
|
CProduct Product;
|
|
|
|
CProduct Product;
|
|
|
|
|
|
|
|
Product.m_bManualMark = true;
|
|
|
|
//创建一个临时的area
|
|
|
|
//创建一个临时的area
|
|
|
|
CMarkArea MarkArea(Dbxy(0,0),DbSize(100,100));
|
|
|
|
CMarkArea MarkArea(Dbxy(0, 0), DbSize(100, 100));
|
|
|
|
//收集加工数据
|
|
|
|
//收集加工数据
|
|
|
|
MarkArea.CollectOrgWorkData(bSel, Product);
|
|
|
|
MarkArea.CollectOrgWorkData(bSel, Product);
|
|
|
|
MarkArea.CollectWorkData(bSel,Product);
|
|
|
|
MarkArea.CollectWorkData(bSel, Product);
|
|
|
|
|
|
|
|
|
|
|
|
if(MarkArea.HasWorkData())
|
|
|
|
if (MarkArea.HasWorkData())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for(int k=0;k<CyclicTimes;k++)
|
|
|
|
for (int k = 0;k < CyclicTimes;k++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdInvoker Invoker;
|
|
|
|
CWorkCmdInvoker Invoker;
|
|
|
|
CWorkCmdContainer &CmdContainer = CWorkCmdContainer::GetInstance();//指令集
|
|
|
|
CWorkCmdContainer &CmdContainer = CWorkCmdContainer::GetInstance();//指令集
|
|
|
@ -1025,7 +1026,7 @@ bool CCommonFlowMgr::NormalMarkByPciCard(bool bSel,int times,int CyclicTimes)
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
//执行指令-----------------------------------------------------
|
|
|
|
//执行指令-----------------------------------------------------
|
|
|
|
Invoker.ExcuteAllCmd(false);//不要在新线程中执行
|
|
|
|
Invoker.ExcuteAllCmd(false);//不要在新线程中执行
|
|
|
|
if(Invoker.IsCancel())
|
|
|
|
if (Invoker.IsCancel())
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -1041,7 +1042,7 @@ void CCommonFlowMgr::MoveToFirstArea()
|
|
|
|
//第一个area 用空移速度
|
|
|
|
//第一个area 用空移速度
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdSetMotorSpeed *pCmd = new CWorkCmdSetMotorSpeed();
|
|
|
|
CWorkCmdSetMotorSpeed *pCmd = new CWorkCmdSetMotorSpeed();
|
|
|
|
if(gMotionCard_PCI1245->GetCurGpIdx() == 0)
|
|
|
|
if (gMotionCard_PCI1245->GetCurGpIdx() == 0)
|
|
|
|
pCmd->SetbSetMotorX();
|
|
|
|
pCmd->SetbSetMotorX();
|
|
|
|
else
|
|
|
|
else
|
|
|
|
pCmd->SetbSetMotorX2();
|
|
|
|
pCmd->SetbSetMotorX2();
|
|
|
@ -1051,7 +1052,7 @@ void CCommonFlowMgr::MoveToFirstArea()
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
vector<CMarkArea> &AreaVec = gMarkAreaMgr->GetAreaVec();
|
|
|
|
vector<CMarkArea> &AreaVec = gMarkAreaMgr->GetAreaVec();
|
|
|
|
if(AreaVec.empty())
|
|
|
|
if (AreaVec.empty())
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
Dbxy TargetPt = gLaser->GetCoord();//加工中心点
|
|
|
|
Dbxy TargetPt = gLaser->GetCoord();//加工中心点
|
|
|
@ -1062,7 +1063,7 @@ void CCommonFlowMgr::MoveToFirstArea()
|
|
|
|
MovePt.x = AreaRealBasePt.x;
|
|
|
|
MovePt.x = AreaRealBasePt.x;
|
|
|
|
MovePt.y = AreaRealBasePt.y;
|
|
|
|
MovePt.y = AreaRealBasePt.y;
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
pCmd->MoveToTargetPt(MovePt,TargetPt);
|
|
|
|
pCmd->MoveToTargetPt(MovePt, TargetPt);
|
|
|
|
pCmd->InWorkState();
|
|
|
|
pCmd->InWorkState();
|
|
|
|
pCmd->SetAfterDelay(500);//执行后强制等待
|
|
|
|
pCmd->SetAfterDelay(500);//执行后强制等待
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
@ -1072,25 +1073,25 @@ void CCommonFlowMgr::MoveToFirstArea()
|
|
|
|
Invoker.Excute(CmdContainer);
|
|
|
|
Invoker.Excute(CmdContainer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//大幅面拼接打标(平台移动,振镜拼接,数据为obj 对象) (bSel ==true 的时候为选择打标)
|
|
|
|
//大幅面拼接打标(平台移动,振镜拼接,数据为obj 对象) (bSel ==true 的时候为选择打标)
|
|
|
|
bool CCommonFlowMgr::MultipleAreaMark(CProduct &Product,bool bSel)
|
|
|
|
bool CCommonFlowMgr::MultipleAreaMark(CProduct &Product, bool bSel)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
gLogMgr->WriteDebugLog("Fuc---->MultipleAreaMark : bSel = " + Bool2Str(bSel));
|
|
|
|
gLogMgr->WriteDebugLog("Fuc---->MultipleAreaMark : bSel = " + Bool2Str(bSel));
|
|
|
|
|
|
|
|
|
|
|
|
//搜集加工数据(这里比较耗费时间)
|
|
|
|
//搜集加工数据(这里比较耗费时间)
|
|
|
|
gMarkAreaMgr->CollectWorkData(bSel,Product);
|
|
|
|
gMarkAreaMgr->CollectWorkData(bSel, Product);
|
|
|
|
if(!gMarkAreaMgr->HasWorkData())
|
|
|
|
if (!gMarkAreaMgr->HasWorkData())
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
gProductMgr->WorkTimesInc();
|
|
|
|
gProductMgr->WorkTimesInc();
|
|
|
|
return true;//全部加工一次才返回true
|
|
|
|
return true;//全部加工一次才返回true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//通过平台走位来切割layer 中的图形(激光不动,只动平台)
|
|
|
|
//通过平台走位来切割layer 中的图形(激光不动,只动平台)
|
|
|
|
bool CCommonFlowMgr::CutShapeByPlatform(CProduct &Product,bool bSel)
|
|
|
|
bool CCommonFlowMgr::CutShapeByPlatform(CProduct &Product, bool bSel)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
gLogMgr->WriteDebugLog("Fuc---->CutShapeByPlatform : bSel = " + Bool2Str(bSel));
|
|
|
|
gLogMgr->WriteDebugLog("Fuc---->CutShapeByPlatform : bSel = " + Bool2Str(bSel));
|
|
|
|
//搜集加工数据----------------------------
|
|
|
|
//搜集加工数据----------------------------
|
|
|
|
gMarkAreaMgr->CollectWorkData(bSel,Product);
|
|
|
|
gMarkAreaMgr->CollectWorkData(bSel, Product);
|
|
|
|
if(!gMarkAreaMgr->HasWorkData())
|
|
|
|
if (!gMarkAreaMgr->HasWorkData())
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
CWorkCmdInvoker Invoker;
|
|
|
|
CWorkCmdInvoker Invoker;
|
|
|
@ -1102,39 +1103,39 @@ bool CCommonFlowMgr::CutShapeByPlatform(CProduct &Product,bool bSel)
|
|
|
|
vector<CMarkArea> &AreaVec = gMarkAreaMgr->GetAreaVec();
|
|
|
|
vector<CMarkArea> &AreaVec = gMarkAreaMgr->GetAreaVec();
|
|
|
|
vector<CMarkArea>::iterator iter = AreaVec.begin();
|
|
|
|
vector<CMarkArea>::iterator iter = AreaVec.begin();
|
|
|
|
vector<CMarkArea>::iterator iter_end = AreaVec.end();
|
|
|
|
vector<CMarkArea>::iterator iter_end = AreaVec.end();
|
|
|
|
for(;iter!=iter_end;iter++)
|
|
|
|
for (;iter != iter_end;iter++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
vector<vector<Dbxy>> &Vec = (*iter).GetDataVec();
|
|
|
|
vector<vector<Dbxy>> &Vec = (*iter).GetDataVec();
|
|
|
|
vector<vector<Dbxy>>::iterator iter1 = Vec.begin();
|
|
|
|
vector<vector<Dbxy>>::iterator iter1 = Vec.begin();
|
|
|
|
vector<vector<Dbxy>>::iterator iter1_end = Vec.end();
|
|
|
|
vector<vector<Dbxy>>::iterator iter1_end = Vec.end();
|
|
|
|
for(int i=0;iter1!=iter1_end;i++,iter1++)
|
|
|
|
for (int i = 0;iter1 != iter1_end;i++, iter1++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
vector<Dbxy>::iterator iter2 = (*iter1).begin();
|
|
|
|
vector<Dbxy>::iterator iter2 = (*iter1).begin();
|
|
|
|
vector<Dbxy>::iterator iter2_end = (*iter1).end();
|
|
|
|
vector<Dbxy>::iterator iter2_end = (*iter1).end();
|
|
|
|
for(;iter2!=iter2_end;iter2++)
|
|
|
|
for (;iter2 != iter2_end;iter2++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//移动平台---------------------------------------------
|
|
|
|
//移动平台---------------------------------------------
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
pCmd->MoveToTargetPt((*iter2),TargetPt);
|
|
|
|
pCmd->MoveToTargetPt((*iter2), TargetPt);
|
|
|
|
if(iter2 != (*iter1).begin())//移动到第一个点是空移
|
|
|
|
if (iter2 != (*iter1).begin())//移动到第一个点是空移
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pCmd->InWorkState();//其他点是工作点
|
|
|
|
pCmd->InWorkState();//其他点是工作点
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_bUseLaser)
|
|
|
|
if (m_bUseLaser)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(iter2==(*iter1).begin())//开激光
|
|
|
|
if (iter2 == (*iter1).begin())//开激光
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LASER,true);
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LASER, true);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(m_bUseLaser)//关激光
|
|
|
|
if (m_bUseLaser)//关激光
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LASER,false);
|
|
|
|
CWorkCmd *pCmd = new CWorkCmdPciPortSwitch(PCI_PORT_LASER, false);
|
|
|
|
pCmd->CanNotCancel();//不能取消
|
|
|
|
pCmd->CanNotCancel();//不能取消
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1164,7 +1165,7 @@ bool CCommonFlowMgr::CameraCatch()
|
|
|
|
//执行指令-----------------------------------------------------
|
|
|
|
//执行指令-----------------------------------------------------
|
|
|
|
Invoker.ExcuteAllCmd(false);//不要在新线程中执行
|
|
|
|
Invoker.ExcuteAllCmd(false);//不要在新线程中执行
|
|
|
|
|
|
|
|
|
|
|
|
if(!ResultVec.empty())
|
|
|
|
if (!ResultVec.empty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
gMeasureMgr.SetNewPt(ResultVec[0]);//设置测量点
|
|
|
|
gMeasureMgr.SetNewPt(ResultVec[0]);//设置测量点
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1174,20 +1175,20 @@ bool CCommonFlowMgr::CameraCatch()
|
|
|
|
bool CCommonFlowMgr::CameraCatchTwoMark()
|
|
|
|
bool CCommonFlowMgr::CameraCatchTwoMark()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CDeviceState &DeviceState = CDeviceState::GetInstance();
|
|
|
|
CDeviceState &DeviceState = CDeviceState::GetInstance();
|
|
|
|
if(!DeviceState.CheckInitState())
|
|
|
|
if (!DeviceState.CheckInitState())
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
bool ret = true;
|
|
|
|
bool ret = true;
|
|
|
|
vector<CProduct> &ProductVec = gProductMgr->GetProductVec();
|
|
|
|
vector<CProduct> &ProductVec = gProductMgr->GetProductVec();
|
|
|
|
int size = ProductVec.size();
|
|
|
|
int size = ProductVec.size();
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
for (int i = 0;i < size;i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CProduct &Product = ProductVec[i];
|
|
|
|
CProduct &Product = ProductVec[i];
|
|
|
|
Dbxy MarkPt1;
|
|
|
|
Dbxy MarkPt1;
|
|
|
|
Dbxy MarkPt2;
|
|
|
|
Dbxy MarkPt2;
|
|
|
|
if(gObjComponentMgr->GetTwoMarkPt(MarkPt1,MarkPt2))//获取定位点
|
|
|
|
if (gObjComponentMgr->GetTwoMarkPt(MarkPt1, MarkPt2))//获取定位点
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Product.SetTheoryMarkPt(MarkPt1,MarkPt2);//设置定位点
|
|
|
|
Product.SetTheoryMarkPt(MarkPt1, MarkPt2);//设置定位点
|
|
|
|
CameraCatchMarkExt(Product);
|
|
|
|
CameraCatchMarkExt(Product);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else//没有两个定位点
|
|
|
|
else//没有两个定位点
|
|
|
@ -1205,9 +1206,9 @@ void CCommonFlowMgr::CameraCatchTwoMark(CProduct &Product)
|
|
|
|
gLogMgr->WriteDebugLog("CCommonFlowMgr::CameraCatchTwoMark");
|
|
|
|
gLogMgr->WriteDebugLog("CCommonFlowMgr::CameraCatchTwoMark");
|
|
|
|
Dbxy MarkPt1;
|
|
|
|
Dbxy MarkPt1;
|
|
|
|
Dbxy MarkPt2;
|
|
|
|
Dbxy MarkPt2;
|
|
|
|
if(gObjComponentMgr->GetTwoMarkPt(MarkPt1,MarkPt2))//从ObjComponent 中获取定位点
|
|
|
|
if (gObjComponentMgr->GetTwoMarkPt(MarkPt1, MarkPt2))//从ObjComponent 中获取定位点
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Product.SetTheoryMarkPt(MarkPt1,MarkPt2);//设置定位点
|
|
|
|
Product.SetTheoryMarkPt(MarkPt1, MarkPt2);//设置定位点
|
|
|
|
CameraCatchMarkExt(Product);
|
|
|
|
CameraCatchMarkExt(Product);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else//没有两个定位点
|
|
|
|
else//没有两个定位点
|
|
|
@ -1232,7 +1233,7 @@ bool CCommonFlowMgr::CameraCatchMark3(CProduct &Product)
|
|
|
|
//设置电机移动速度
|
|
|
|
//设置电机移动速度
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdSetMotorSpeed *pCmd = new CWorkCmdSetMotorSpeed();
|
|
|
|
CWorkCmdSetMotorSpeed *pCmd = new CWorkCmdSetMotorSpeed();
|
|
|
|
if(gMotionCard_PCI1245->GetCurGpIdx() == 0)
|
|
|
|
if (gMotionCard_PCI1245->GetCurGpIdx() == 0)
|
|
|
|
pCmd->SetbSetMotorX();
|
|
|
|
pCmd->SetbSetMotorX();
|
|
|
|
else
|
|
|
|
else
|
|
|
|
pCmd->SetbSetMotorX2();
|
|
|
|
pCmd->SetbSetMotorX2();
|
|
|
@ -1242,20 +1243,20 @@ bool CCommonFlowMgr::CameraCatchMark3(CProduct &Product)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//如果有mark3 先识别mark3
|
|
|
|
//如果有mark3 先识别mark3
|
|
|
|
Product.SetbHasMarkPt3(false);
|
|
|
|
Product.SetbHasMarkPt3(false);
|
|
|
|
if(gObjComponentMgr->GetMark3Pt(MarkPt3))
|
|
|
|
if (gObjComponentMgr->GetMark3Pt(MarkPt3))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Product.SetbHasMarkPt3(true);
|
|
|
|
Product.SetbHasMarkPt3(true);
|
|
|
|
Product.SetTheoryMark3Pt(MarkPt3);
|
|
|
|
Product.SetTheoryMark3Pt(MarkPt3);
|
|
|
|
//移动mark 1 到CCD 中心
|
|
|
|
//移动mark 1 到CCD 中心
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
pCmd->MoveToTargetPt(MarkPt3,CameraPt);
|
|
|
|
pCmd->MoveToTargetPt(MarkPt3, CameraPt);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//等待运动结束
|
|
|
|
//等待运动结束
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdWaitMotorStop *pCmd = new CWorkCmdWaitMotorStop();
|
|
|
|
CWorkCmdWaitMotorStop *pCmd = new CWorkCmdWaitMotorStop();
|
|
|
|
if(gMotionCard_PCI1245->GetCurGpIdx() == 0)
|
|
|
|
if (gMotionCard_PCI1245->GetCurGpIdx() == 0)
|
|
|
|
pCmd->SetbWaitMotorX();
|
|
|
|
pCmd->SetbWaitMotorX();
|
|
|
|
else
|
|
|
|
else
|
|
|
|
pCmd->SetbWaitMotorX2();
|
|
|
|
pCmd->SetbWaitMotorX2();
|
|
|
@ -1273,7 +1274,7 @@ bool CCommonFlowMgr::CameraCatchMark3(CProduct &Product)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//执行指令-----------------------------------------------------
|
|
|
|
//执行指令-----------------------------------------------------
|
|
|
|
Invoker.ExcuteAllCmd(false);//不要在新线程中执行
|
|
|
|
Invoker.ExcuteAllCmd(false);//不要在新线程中执行
|
|
|
|
if(Invoker.IsCancel())//中断的时候重置
|
|
|
|
if (Invoker.IsCancel())//中断的时候重置
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Product.ResetRealMarkPt();
|
|
|
|
Product.ResetRealMarkPt();
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -1284,7 +1285,7 @@ bool CCommonFlowMgr::CameraCatchMark3(CProduct &Product)
|
|
|
|
void CCommonFlowMgr::MarkAreaByIdx(int AreaIndex)
|
|
|
|
void CCommonFlowMgr::MarkAreaByIdx(int AreaIndex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
vector<CMarkArea> &AreaVec = gMarkAreaMgr->GetAreaVec();
|
|
|
|
vector<CMarkArea> &AreaVec = gMarkAreaMgr->GetAreaVec();
|
|
|
|
if (AreaVec.size()==0)
|
|
|
|
if (AreaVec.size() == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
gLogMgr->WriteDebugLog("No Mark Data.");
|
|
|
|
gLogMgr->WriteDebugLog("No Mark Data.");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -1307,8 +1308,8 @@ bool CCommonFlowMgr::CameraCatchMarkExt(CProduct &Product)
|
|
|
|
CCamera &Camera = *m_CurCamera;
|
|
|
|
CCamera &Camera = *m_CurCamera;
|
|
|
|
gLogMgr->WriteDebugLog("Fuc---->CameraCatchTwoMark");
|
|
|
|
gLogMgr->WriteDebugLog("Fuc---->CameraCatchTwoMark");
|
|
|
|
//获取mark 坐标的大致位置
|
|
|
|
//获取mark 坐标的大致位置
|
|
|
|
Dbxy MarkPt1,MarkPt2,MarkPt3;
|
|
|
|
Dbxy MarkPt1, MarkPt2, MarkPt3;
|
|
|
|
Product.GetMarkCoord(MarkPt1,MarkPt2);
|
|
|
|
Product.GetMarkCoord(MarkPt1, MarkPt2);
|
|
|
|
//移动目标点(ccd 的中心)
|
|
|
|
//移动目标点(ccd 的中心)
|
|
|
|
Dbxy CameraPt = Camera.GetCenterPt();
|
|
|
|
Dbxy CameraPt = Camera.GetCenterPt();
|
|
|
|
|
|
|
|
|
|
|
@ -1318,7 +1319,7 @@ bool CCommonFlowMgr::CameraCatchMarkExt(CProduct &Product)
|
|
|
|
//设置电机移动速度
|
|
|
|
//设置电机移动速度
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdSetMotorSpeed *pCmd = new CWorkCmdSetMotorSpeed();
|
|
|
|
CWorkCmdSetMotorSpeed *pCmd = new CWorkCmdSetMotorSpeed();
|
|
|
|
if(gMotionCard_PCI1245->GetCurGpIdx() == 0)
|
|
|
|
if (gMotionCard_PCI1245->GetCurGpIdx() == 0)
|
|
|
|
pCmd->SetbSetMotorX();
|
|
|
|
pCmd->SetbSetMotorX();
|
|
|
|
else
|
|
|
|
else
|
|
|
|
pCmd->SetbSetMotorX2();
|
|
|
|
pCmd->SetbSetMotorX2();
|
|
|
@ -1327,18 +1328,18 @@ bool CCommonFlowMgr::CameraCatchMarkExt(CProduct &Product)
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//识别mark1 和mark2
|
|
|
|
//识别mark1 和mark2
|
|
|
|
if(!Product.IsSetRealMarkPt1() || (Product.IsSetRealMarkPt1() && Product.IsSetRealMarkPt2()))
|
|
|
|
if (!Product.IsSetRealMarkPt1() || (Product.IsSetRealMarkPt1() && Product.IsSetRealMarkPt2()))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//移动mark 1 到CCD 中心
|
|
|
|
//移动mark 1 到CCD 中心
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
pCmd->MoveToTargetPt(MarkPt1,CameraPt);
|
|
|
|
pCmd->MoveToTargetPt(MarkPt1, CameraPt);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//等待运动结束
|
|
|
|
//等待运动结束
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdWaitMotorStop *pCmd = new CWorkCmdWaitMotorStop();
|
|
|
|
CWorkCmdWaitMotorStop *pCmd = new CWorkCmdWaitMotorStop();
|
|
|
|
if(gMotionCard_PCI1245->GetCurGpIdx() == 0)
|
|
|
|
if (gMotionCard_PCI1245->GetCurGpIdx() == 0)
|
|
|
|
pCmd->SetbWaitMotorX();
|
|
|
|
pCmd->SetbWaitMotorX();
|
|
|
|
else
|
|
|
|
else
|
|
|
|
pCmd->SetbWaitMotorX2();
|
|
|
|
pCmd->SetbWaitMotorX2();
|
|
|
@ -1358,13 +1359,13 @@ bool CCommonFlowMgr::CameraCatchMarkExt(CProduct &Product)
|
|
|
|
//移动mark 2 到CCD 中心
|
|
|
|
//移动mark 2 到CCD 中心
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
pCmd->MoveToTargetPt(MarkPt2,CameraPt);
|
|
|
|
pCmd->MoveToTargetPt(MarkPt2, CameraPt);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//等待运动结束
|
|
|
|
//等待运动结束
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdWaitMotorStop *pCmd = new CWorkCmdWaitMotorStop();
|
|
|
|
CWorkCmdWaitMotorStop *pCmd = new CWorkCmdWaitMotorStop();
|
|
|
|
if(gMotionCard_PCI1245->GetCurGpIdx() == 0)
|
|
|
|
if (gMotionCard_PCI1245->GetCurGpIdx() == 0)
|
|
|
|
pCmd->SetbWaitMotorX();
|
|
|
|
pCmd->SetbWaitMotorX();
|
|
|
|
else
|
|
|
|
else
|
|
|
|
pCmd->SetbWaitMotorX2();
|
|
|
|
pCmd->SetbWaitMotorX2();
|
|
|
@ -1381,7 +1382,7 @@ bool CCommonFlowMgr::CameraCatchMarkExt(CProduct &Product)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//执行指令-----------------------------------------------------
|
|
|
|
//执行指令-----------------------------------------------------
|
|
|
|
Invoker.ExcuteAllCmd(false);//不要在新线程中执行
|
|
|
|
Invoker.ExcuteAllCmd(false);//不要在新线程中执行
|
|
|
|
if(Invoker.IsCancel())//中断的时候重置
|
|
|
|
if (Invoker.IsCancel())//中断的时候重置
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Product.ResetRealMarkPt();
|
|
|
|
Product.ResetRealMarkPt();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1401,17 +1402,17 @@ bool CCommonFlowMgr::AutoMeasureVisionData()
|
|
|
|
//创建移动点坐标序列
|
|
|
|
//创建移动点坐标序列
|
|
|
|
vector<Dbxy> PtVec;
|
|
|
|
vector<Dbxy> PtVec;
|
|
|
|
Dbxy CurPlatCoord = gPlatformXY->GetCoord();//当前平台坐标
|
|
|
|
Dbxy CurPlatCoord = gPlatformXY->GetCoord();//当前平台坐标
|
|
|
|
int PtCnt = m_CalibrationRange/m_CalibrationPointGap+1;//一个方向的移动点数
|
|
|
|
int PtCnt = m_CalibrationRange / m_CalibrationPointGap + 1;//一个方向的移动点数
|
|
|
|
|
|
|
|
|
|
|
|
CString LogStr;
|
|
|
|
CString LogStr;
|
|
|
|
LogStr.Format(_T("[振镜范围] = [%f] ,[点间隔] = [%f]"),m_CalibrationRange,m_CalibrationPointGap);
|
|
|
|
LogStr.Format(_T("[振镜范围] = [%f] ,[点间隔] = [%f]"), m_CalibrationRange, m_CalibrationPointGap);
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
LogStr.Format(_T("[点数] = [%d]"),PtCnt*PtCnt);
|
|
|
|
LogStr.Format(_T("[点数] = [%d]"), PtCnt*PtCnt);
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<PtCnt;i++)//列
|
|
|
|
for (int i = 0;i < PtCnt;i++)//列
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for(int k=0;k<PtCnt;k++)//行
|
|
|
|
for (int k = 0;k < PtCnt;k++)//行
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Dbxy pt;
|
|
|
|
Dbxy pt;
|
|
|
|
pt.x = CurPlatCoord.x - m_CalibrationPointGap*k;
|
|
|
|
pt.x = CurPlatCoord.x - m_CalibrationPointGap*k;
|
|
|
@ -1421,19 +1422,19 @@ bool CCommonFlowMgr::AutoMeasureVisionData()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//依次移动平台观察-----------------------------------
|
|
|
|
//依次移动平台观察-----------------------------------
|
|
|
|
vector<Dbxy> ResultVec;//结果
|
|
|
|
vector<Dbxy> ResultVec;//结果
|
|
|
|
MovePtToCamera(PtVec,ResultVec,true);
|
|
|
|
MovePtToCamera(PtVec, ResultVec, true);
|
|
|
|
//结果输出到vision.dat 文件-----------------------------
|
|
|
|
//结果输出到vision.dat 文件-----------------------------
|
|
|
|
if(!ResultVec.empty())
|
|
|
|
if (!ResultVec.empty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CString FilePath;
|
|
|
|
CString FilePath;
|
|
|
|
CFileMgr FileMgr;
|
|
|
|
CFileMgr FileMgr;
|
|
|
|
FileMgr.GetFullFilePath(FilePath,"\\vision_data.dat");
|
|
|
|
FileMgr.GetFullFilePath(FilePath, "\\vision_data.dat");
|
|
|
|
|
|
|
|
|
|
|
|
ofstream file;
|
|
|
|
ofstream file;
|
|
|
|
file.open(FilePath);
|
|
|
|
file.open(FilePath);
|
|
|
|
//输出范围和间隔
|
|
|
|
//输出范围和间隔
|
|
|
|
file<<m_CalibrationRange<<","<<m_CalibrationRange<<","<<m_CalibrationPointGap<<","<<m_CalibrationPointGap<<endl;
|
|
|
|
file << m_CalibrationRange << "," << m_CalibrationRange << "," << m_CalibrationPointGap << "," << m_CalibrationPointGap << endl;
|
|
|
|
FileMgr.WriteDbxyVecToFile(ResultVec,&file);
|
|
|
|
FileMgr.WriteDbxyVecToFile(ResultVec, &file);
|
|
|
|
file.close();
|
|
|
|
file.close();
|
|
|
|
//复制到打标软件目录
|
|
|
|
//复制到打标软件目录
|
|
|
|
CString DestPath = "C:\\Program Files\\Laipu Soft\\Marking System\\vision_data.dat";
|
|
|
|
CString DestPath = "C:\\Program Files\\Laipu Soft\\Marking System\\vision_data.dat";
|
|
|
@ -1447,7 +1448,7 @@ bool CCommonFlowMgr::AutoMeasureVisionData()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//连续移动平台到一系列坐标,ResultVec保存抓取的结果
|
|
|
|
//连续移动平台到一系列坐标,ResultVec保存抓取的结果
|
|
|
|
void CCommonFlowMgr::MovePtToCamera(vector<Dbxy> &PtVec,vector<Dbxy> &ResultVec,bool bCatch)
|
|
|
|
void CCommonFlowMgr::MovePtToCamera(vector<Dbxy> &PtVec, vector<Dbxy> &ResultVec, bool bCatch)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CCamera &Camera = *m_CurCamera;
|
|
|
|
CCamera &Camera = *m_CurCamera;
|
|
|
|
|
|
|
|
|
|
|
@ -1457,18 +1458,18 @@ void CCommonFlowMgr::MovePtToCamera(vector<Dbxy> &PtVec,vector<Dbxy> &ResultVec,
|
|
|
|
|
|
|
|
|
|
|
|
vector<Dbxy>::iterator iter = PtVec.begin();
|
|
|
|
vector<Dbxy>::iterator iter = PtVec.begin();
|
|
|
|
vector<Dbxy>::iterator iter_end = PtVec.end();
|
|
|
|
vector<Dbxy>::iterator iter_end = PtVec.end();
|
|
|
|
for(;iter!=iter_end;iter++)
|
|
|
|
for (;iter != iter_end;iter++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//移动平台-------------------------------------------------
|
|
|
|
//移动平台-------------------------------------------------
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
pCmd->MoveToTargetPt(Dbxy(0,0),(*iter));
|
|
|
|
pCmd->MoveToTargetPt(Dbxy(0, 0), (*iter));
|
|
|
|
pCmd->InWorkState();//工作速度
|
|
|
|
pCmd->InWorkState();//工作速度
|
|
|
|
pCmd->SetAfterDelay(300);//移动后延时
|
|
|
|
pCmd->SetAfterDelay(300);//移动后延时
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//抓取--------------------------------------------------------
|
|
|
|
//抓取--------------------------------------------------------
|
|
|
|
if(bCatch)
|
|
|
|
if (bCatch)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdCameraCatch *pCmd = new CWorkCmdCameraCatch(Camera);
|
|
|
|
CWorkCmdCameraCatch *pCmd = new CWorkCmdCameraCatch(Camera);
|
|
|
|
pCmd->SetResultVec(ResultVec);//绑定结果容器
|
|
|
|
pCmd->SetResultVec(ResultVec);//绑定结果容器
|
|
|
@ -1492,7 +1493,7 @@ void CCommonFlowMgr::MovePtToCamera(Dbxy pt)
|
|
|
|
//移动平台-------------------------------------------------
|
|
|
|
//移动平台-------------------------------------------------
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY();
|
|
|
|
pCmd->MoveToTargetPt(Camera.GetCenterPt(),pt);
|
|
|
|
pCmd->MoveToTargetPt(Camera.GetCenterPt(), pt);
|
|
|
|
pCmd->InWorkState();//工作速度
|
|
|
|
pCmd->InWorkState();//工作速度
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
CmdContainer.AddCmd(pCmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1514,9 +1515,9 @@ void CCommonFlowMgr::MoveSelObjToCamera(CProduct &Product)
|
|
|
|
vector<CObjComponent>&ComponentVec = gObjComponentMgr->GetComponentVec();
|
|
|
|
vector<CObjComponent>&ComponentVec = gObjComponentMgr->GetComponentVec();
|
|
|
|
vector<CObjComponent>::iterator iter = ComponentVec.begin();
|
|
|
|
vector<CObjComponent>::iterator iter = ComponentVec.begin();
|
|
|
|
vector<CObjComponent>::iterator iter_end = ComponentVec.end();
|
|
|
|
vector<CObjComponent>::iterator iter_end = ComponentVec.end();
|
|
|
|
for(;iter!=iter_end;iter++)
|
|
|
|
for (;iter != iter_end;iter++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if((*iter).IsSelected())
|
|
|
|
if ((*iter).IsSelected())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Dbxy pt = (*iter).GetBasePt();
|
|
|
|
Dbxy pt = (*iter).GetBasePt();
|
|
|
|
pt = Product.TheoryPtToRealPt(pt);//计算实际位置
|
|
|
|
pt = Product.TheoryPtToRealPt(pt);//计算实际位置
|
|
|
@ -1526,17 +1527,18 @@ void CCommonFlowMgr::MoveSelObjToCamera(CProduct &Product)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(flg)
|
|
|
|
if (flg)
|
|
|
|
GetCurViewPtr()->RefreshView();
|
|
|
|
GetCurViewPtr()->RefreshView();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
void CCommonFlowMgr::SetAdjustOffsetAll(Dbxy Offset)
|
|
|
|
void CCommonFlowMgr::SetAdjustOffsetAll(Dbxy Offset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_AdjustOffsetAll.x = Offset.x + m_ProductOffset.x;
|
|
|
|
auto JigOft = m_Jig2PrtOft;
|
|
|
|
m_AdjustOffsetAll.y = Offset.y + m_ProductOffset.y;
|
|
|
|
if (gServer->m_RcvCurTrackIndex != 0)
|
|
|
|
|
|
|
|
JigOft = m_Jig4PrtOft;
|
|
|
|
|
|
|
|
m_AdjustOffsetAll= Offset + JigOft;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void CCommonFlowMgr::ResetProductOffset()
|
|
|
|
void CCommonFlowMgr::ResetProductOffset()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_ProductOffset.x = m_ProductOffset.y = 0;
|
|
|
|
m_Jig2PrtOft.x = m_Jig2PrtOft.y = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|