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.

600 lines
24 KiB
C++

#include "stdafx.h"
#include "LaiPuLaser.h"
#include "afxdialogex.h"
#include "DlgChildLaserPathState.h"
#include "ProgramLaserTuiHuo.h"
#include "AuthorityMgr.h"
#include "LogMgr.h"
#include "Laser.h"
#include "DeviceStateMgr.h"
#include "CommonFlowMgr.h"
#include "DlgTestFunc.h"
#include "GlobalFunction.h"
#include "MotionCtrl.h"
#include "DistanceMeterMgr.h"
#include "LaserPowDeviceMgr.h"
#include "LaserDevice.h"
#include "PlcCommunicationMgr.h"
#include "IO_CtrlMgr.h"
#include "AllThreadMgr.h"
#include "Motor.h"
#include "CStringFuc.h"
#include "DeviceStateMgr.h"
#include "JobQueueMgr.h"
#include "DlgMeasureParSet.h"
#include "DeviceStateMgr.h"
#include "DlgLaserPowCheck.h"
#include "MsgBox.h"
#include "LanguageMgr.h"
#include "ThorlabsRotatoMotorCtrlMgr.h"
#include "WorkCmdInvoker.h"
#include "SemiSecsCommMgr.h"
#include "AllThreadMgr.h"
#include "TekOscilloscopeMgr.h"
#include "DlgBeamGageCtrl.h"
#include "DlgTekOscilloscopeCtrl.h"
#include "ThorlabsKCubeMotorCtrlMgr.h"
#include "OtherMonitorDevMgr.h"
#include "DlgDeviceMain.h"
#define UPDATE_INFO_TIMER 1
#define UPDATE_INFO_TIMER_DELAY 1000
#define ON_PAINT_TIMER 2
#define ON_PAINT_TIMER_DELAY 200
IMPLEMENT_DYNAMIC(CDlgChildLaserPathState, CMyDlgView)
BEGIN_MESSAGE_MAP(CDlgChildLaserPathState, CMyDlgView)
ON_WM_TIMER()
ON_WM_PAINT()
ON_BN_CLICKED(NEW_TEST_FUC_BTN, &CDlgChildLaserPathState::OnBnClickedTestFucBtn)
ON_BN_CLICKED(NEW_MAIN_LASER_STATE, &CDlgChildLaserPathState::OnBnClickedMainLaserState)
ON_BN_CLICKED(NEW_LASER_POW_CHECK, &CDlgChildLaserPathState::OnBnClickedLaserPowCheck)
ON_BN_CLICKED(NEW_CLOSE_LASER_LD, &CDlgChildLaserPathState::OnBnClickedCloseLaserDevice)
ON_MESSAGE(ON_COM_RECEIVE,&CDlgChildLaserPathState::OnRobotCommRecv)
ON_BN_CLICKED(NEW_LASER_BEAM_CHECK, &CDlgChildLaserPathState::OnBnClickedLaserBeamCheck)
ON_BN_CLICKED(NEW_LASER_OSCILL_CTRL, &CDlgChildLaserPathState::OnBnClickedLaserOscillCtrl)
END_MESSAGE_MAP()
CDlgChildLaserPathState::CDlgChildLaserPathState(CWnd* pParent /*=NULL*/)
: CMyDlgView(CDlgChildLaserPathState::IDD, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
CDlgChildLaserPathState::~CDlgChildLaserPathState()
{
}
void CDlgChildLaserPathState::DoDataExchange(CDataExchange* pDX)
{
CMyDlgView::DoDataExchange(pDX);
}
BOOL CDlgChildLaserPathState::OnInitDialog()
{
CMyDlgView::OnInitDialog();
UpdateData(FALSE);
Sleep(2000);
SetTimer(UPDATE_INFO_TIMER,UPDATE_INFO_TIMER_DELAY,NULL);
return TRUE;
}
void CDlgChildLaserPathState::OnTimer(UINT nIDEvent)
{
if(nIDEvent == UPDATE_INFO_TIMER)
{
KillTimer(UPDATE_INFO_TIMER);
if(gAllThreadMgr.IsbStopAllThread())
{
gAllThreadMgr.SetThreadInfoState(_EThreadType_DlgLaserPathStateTimer,false);
}
else
{
gAllThreadMgr.SetThreadInfoState(_EThreadType_DlgLaserPathStateTimer,true);
UpdateInfoExt();
SetTimer(UPDATE_INFO_TIMER,UPDATE_INFO_TIMER_DELAY,NULL);
}
}
if(nIDEvent == ON_PAINT_TIMER)
{
KillTimer(ON_PAINT_TIMER);
Invalidate();
}
CDialog::OnTimer(nIDEvent);
}
void CDlgChildLaserPathState::TriggerOnPaint()
{
SetTimer(ON_PAINT_TIMER,ON_PAINT_TIMER_DELAY,NULL);
}
void CDlgChildLaserPathState::OnPaint()
{
{
CPaintDC dc(this);
CRect rc;
GetClientRect(&rc);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
//<2F><><EFBFBD><EFBFBD>ɫ
{
CBitmap bmpBackground;
bmpBackground.LoadBitmap(IDB_BTN_IMG141);
BITMAP bitmap;
bmpBackground.GetBitmap(&bitmap);
CBitmap* pOldBitmap = dcMem.SelectObject(&bmpBackground);
dc.StretchBlt(0,0,bitmap.bmWidth,bitmap.bmHeight, &dcMem,0,0,bitmap.bmWidth, bitmap.bmHeight, SRCCOPY);
dcMem.SelectObject(pOldBitmap);
}
int BaseX = -40;
int BaseY = 0;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>
{
CBitmap bmpBackground;
bmpBackground.LoadBitmap(gDeviceStateMgr->GetLaserPathBmpId(1));
BITMAP bitmap;
bmpBackground.GetBitmap(&bitmap);
CBitmap* pOldBitmap = dcMem.SelectObject(&bmpBackground);
dc.StretchBlt(360+BaseX,15+BaseY,bitmap.bmWidth,bitmap.bmHeight, &dcMem,0,0,bitmap.bmWidth, bitmap.bmHeight, SRCCOPY);
dcMem.SelectObject(pOldBitmap);
}
//<2F><>բ<EFBFBD><D5A2><EFBFBD><EFBFBD>
{
CBitmap bmpBackground;
bmpBackground.LoadBitmap(gDeviceStateMgr->GetLaserPathBmpId(2));
BITMAP bitmap;
bmpBackground.GetBitmap(&bitmap);
CBitmap* pOldBitmap = dcMem.SelectObject(&bmpBackground);
dc.StretchBlt(1015+BaseX,280+BaseY,bitmap.bmWidth,bitmap.bmHeight, &dcMem,0,0,bitmap.bmWidth, bitmap.bmHeight, SRCCOPY);
dcMem.SelectObject(pOldBitmap);
}
//<2F>¹<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>
{
CBitmap bmpBackground;
bmpBackground.LoadBitmap(gDeviceStateMgr->GetLaserPathBmpId(3));
BITMAP bitmap;
bmpBackground.GetBitmap(&bitmap);
CBitmap* pOldBitmap = dcMem.SelectObject(&bmpBackground);
dc.StretchBlt(480+BaseX,329+BaseY,bitmap.bmWidth,bitmap.bmHeight, &dcMem,0,0,bitmap.bmWidth, bitmap.bmHeight, SRCCOPY);
dcMem.SelectObject(pOldBitmap);
}
//ƽ̨<C6BD><CCA8><EFBFBD>ʼ<EFBFBD>
{
CBitmap bmpBackground;
bmpBackground.LoadBitmap(gDeviceStateMgr->GetLaserPathBmpId(4));
BITMAP bitmap;
bmpBackground.GetBitmap(&bitmap);
CBitmap* pOldBitmap = dcMem.SelectObject(&bmpBackground);
dc.StretchBlt(513+BaseX,695+BaseY,bitmap.bmWidth,bitmap.bmHeight, &dcMem,0,0,bitmap.bmWidth, bitmap.bmHeight, SRCCOPY);
dcMem.SelectObject(pOldBitmap);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>LDD
{
CBitmap bmpBackground;
bmpBackground.LoadBitmap(gDeviceStateMgr->GetLaserPathBmpId(5));
BITMAP bitmap;
bmpBackground.GetBitmap(&bitmap);
CBitmap* pOldBitmap = dcMem.SelectObject(&bmpBackground);
dc.StretchBlt(259+BaseX,36+BaseY,bitmap.bmWidth,bitmap.bmHeight, &dcMem,0,0,bitmap.bmWidth, bitmap.bmHeight, SRCCOPY);
dcMem.SelectObject(pOldBitmap);
}
VERIFY(dcMem.DeleteDC());
}
}
void CDlgChildLaserPathState::ChangeItemState()
{
bool bEnable = true;
if(gCommonFlowMgr->IsbAutoRunning())
bEnable = false;
if(gCmdInvoker_WaferAneal.IsbExcuting())
bEnable = false;
//if(gSemiSecsCommMgr->IsbOnlineRemote())
//bEnable = false;
GetDlgItem(NEW_TEST_FUC_BTN)->EnableWindow(bEnable);
GetDlgItem(NEW_MAIN_LASER_STATE)->EnableWindow(bEnable);
GetDlgItem(NEW_LASER_POW_CHECK)->EnableWindow(bEnable);
GetDlgItem(NEW_CLOSE_LASER_LD)->EnableWindow(bEnable);
GetDlgItem(NEW_LASER_BEAM_CHECK)->EnableWindow(bEnable);
GetDlgItem(NEW_LASER_OSCILL_CTRL)->EnableWindow(bEnable);
}
LRESULT CDlgChildLaserPathState::OnRobotCommRecv(WPARAM wParam, LPARAM lParam)
{
gTransferArmMgr->OnRobotCommRecv();
return 0;
}
#if 1
void CDlgChildLaserPathState::UpdateLanguageTxt()
{
}
void CDlgChildLaserPathState::SetTextCtrlItemID()
{
m_CtrlColorIDSet.insert(LCD_PATH_POW_1);
m_CtrlColorIDSet.insert(LCD_PATH_POW_2);
m_CtrlColorIDSet.insert(LCD_PATH_POW_3);
m_CtrlColorIDSet.insert(LCD_SURFACE_POW);
m_CtrlColorIDSet.insert(LCD_REAL_EDI);
m_CtrlColorIDSet.insert(LCD_LASER_REAL_FRE);
m_CtrlColorIDSet.insert(LCD_LASER1_SET_CURR);
m_CtrlColorIDSet.insert(LCD_LASER1_REAL_CURR);
m_CtrlColorIDSet.insert(LCD_LASER1_REAL_VOLTAGE);
m_CtrlColorIDSet.insert(LCD_LASER2_REAL_FRE);
m_CtrlColorIDSet.insert(LCD_LASER2_SET_CURR);
m_CtrlColorIDSet.insert(LCD_LASER2_REAL_CURR);
m_CtrlColorIDSet.insert(LCD_LASER2_REAL_VOLTAGE);
m_CtrlColorIDSet.insert(LCD_LASER_PULSE_DELAY);
m_CtrlColorIDSet.insert(LCD_LASER_REAL_WATER_FLOW);
m_CtrlColorIDSet.insert(LCD_LASER_REAL_HUMI);
m_CtrlColorIDSet.insert(LCD_LASER_HUMI_SENSOR);
m_CtrlColorIDSet.insert(LCD_LASER_REAL_SHG_TMP);
m_CtrlColorIDSet.insert(LCD_LASER_REAL_THG_TMP);
m_CtrlColorIDSet.insert(LCD_LASER_REAL_DIODE_TMP_1);
m_CtrlColorIDSet.insert(LCD_LASER_REAL_DIODE_TMP_2);
m_CtrlColorIDSet.insert(LCD_LASER_REAL_DIODE_TMP_3);
m_CtrlColorIDSet.insert(LCD_LASER2_REAL_DIODE_TMP_1);
m_CtrlColorIDSet.insert(LCD_LASER2_REAL_DIODE_TMP_2);
m_CtrlColorIDSet.insert(LCD_LASER2_REAL_DIODE_TMP_3);
m_CtrlColorIDSet.insert(LCD_MOTOR_X_R_POS);
m_CtrlColorIDSet.insert(LCD_MOTOR_Y_R_POS);
m_CtrlColorIDSet.insert(LCD_MOTOR_Z_R_POS);
m_CtrlColorIDSet.insert(LCD_MOTOR_X_F_POS);
m_CtrlColorIDSet.insert(LCD_MOTOR_Y_F_POS);
m_CtrlColorIDSet.insert(LCD_MOTOR_Z_F_POS);
m_CtrlColorIDSet.insert(LCD_MOTOR_W_F_POS);
m_CtrlColorIDSet.insert(LCD_DIS_METER_VAL);
m_CtrlColorIDSet.insert(LCD_CAGE_ROTATOR_ANG);
m_CtrlColorIDSet.insert(LCD_CAGE_ROTATOR_ANG2);
m_CtrlColorIDSet.insert(LCD_LASER_DEVICE_POW_1);
m_CtrlColorIDSet.insert(LCD_LASER_DEVICE_POW_2);
m_CtrlColorIDSet.insert(LCD_BEAM_SIZE_X);
m_CtrlColorIDSet.insert(LCD_BEAM_SIZE_Y);
m_CtrlColorIDSet.insert(LCD_PATH_POW_SIZE);
m_CtrlColorIDSet.insert(LCD_PATH_POW_POS_X);
m_CtrlColorIDSet.insert(LCD_PATH_POW_POS_Y);
m_CtrlColorIDSet.insert(LCD_PATH_POW2_SIZE);
m_CtrlColorIDSet.insert(LCD_PATH_POW2_POS_X);
m_CtrlColorIDSet.insert(LCD_PATH_POW2_POS_Y);
m_CtrlColorIDSet.insert(LCD_PATH_POW3_SIZE);
m_CtrlColorIDSet.insert(LCD_PATH_POW3_POS_X);
m_CtrlColorIDSet.insert(LCD_PATH_POW3_POS_Y);
m_CtrlColorIDSet.insert(LCD_PATH_MOTOR_POS1);
m_CtrlColorIDSet.insert(LCD_PATH_MOTOR_POS2);
m_CtrlColorIDSet.insert(LCD_PATH_MOTOR_POS3);
m_CtrlColorIDSet.insert(LCD_PATH_MOTOR_POS4);
m_CtrlColorIDSet.insert(LCD_PATH_MOTOR_POS5);
m_CtrlColorIDSet.insert(LCD_PATH_MOTOR_POS6);
m_CtrlColorIDSet.insert(LCD_PATH_MOTOR_POS7);
m_CtrlColorIDSet.insert(LCD_PATH_MOTOR_POS8);
m_CtrlColorIDSet.insert(LCD_LASER1_REAL_PULSE_W);
m_CtrlColorIDSet.insert(LCD_OSCI_PK2PK);
m_CtrlColorIDSet.insert(LCD_OSCI_MEAN);
m_CtrlColorIDSet.insert(LCD_OSCI_AMP);
m_CtrlColorIDSet.insert(IDC_DATA_FFUMAIN);
m_CtrlColorIDSet.insert(IDC_DATA_FFUTRANS);
m_CtrlColorIDSet.insert(IDC_DATA_CURL1);
m_CtrlColorIDSet.insert(IDC_DATA_CURL2);
m_CtrlColorIDSet.insert(IDC_DATA_CURL3);
m_CtrlColorIDSet.insert(IDC_DATA_VOL);
}
void CDlgChildLaserPathState::UpdateInfoExt()
{
if(gExitApp)
return;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
UpdateIDisMeterInfo();
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>Ϣ
UpdateLaserInfo();
//XYZ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UpdateXYZCoord();
//<2F><EFBFBD><E8B1B8>Ϣ
UpdataDeviceInfo();
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>Ϣ
void CDlgChildLaserPathState::UpdateLaserInfo()
{
if(!gLaserDevice)
return;
double LaserPathPower1Val = 0;
double LaserPathPower2Val = 0;
double LaserPathPower3Val = 0;
double ProductSurfacePowerVal = 0;
LaserPathPower1Val = gLaserPowDeviceMgr->GetCurLaserPowerVal(_PowerMeterDevice_Source1);
LaserPathPower2Val = gLaserPowDeviceMgr->GetCurLaserPowerVal(_PowerMeterDevice_Source2);
LaserPathPower3Val = gLaserPowDeviceMgr->GetCurLaserPowerVal(_PowerMeterDevice_LightPath);
ProductSurfacePowerVal = gLaserPowDeviceMgr->GetCurLaserPowerVal(_PowerMeterDevice_Stage);
CPowerBeamPar BeamParLightPath1 = gLaserPowDeviceMgr->GetCurLaserPowerBeamPar(_PowerMeterDevice_Source1);
CPowerBeamPar BeamParLightPath2 = gLaserPowDeviceMgr->GetCurLaserPowerBeamPar(_PowerMeterDevice_Source2);
CPowerBeamPar BeamParLightPath3 = gLaserPowDeviceMgr->GetCurLaserPowerBeamPar(_PowerMeterDevice_LightPath);
CLaserDeviceState LaserDeviceState = gLaserDevice->GetCurLaserDeviceState();
CCommonIOState IOState = gDeviceStateMgr->GetIOState();
double Laser1SetFre = LaserDeviceState.m_Laser1SetFre;
double Laser2SetFre = LaserDeviceState.m_Laser2SetFre;
double RedLaserSetFre = LaserDeviceState.m_RedLaserSetFre;
int CurrDigitsCnt = gLaser->GetLaserCurrDigitsCnt();//<2F><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>λ<EFBFBD><CEBB>
COscilloscopeData OscilloscopeData = gTekOscilloscopeMgr->GetCurOscilloscopeData();
//<2F><><EFBFBD><EFBFBD><EFBFBD>ܶ<EFBFBD>
double MainLaserEdi = gLaser->CalEnergyDensityByPow(_LaserDeviceType_MainLaser1,Laser1SetFre,ProductSurfacePowerVal);
//˥<><CBA5><EFBFBD>Ƕ<EFBFBD>
double RotatoDimmerAng = gThorlabsRotatoMotorCtrlMgr->GetCurAng(_LaserDeviceType_MainLaser1);
double RotatoDimmerAng2 = gThorlabsRotatoMotorCtrlMgr->GetCurAng(_LaserDeviceType_MainLaser2);
SetItemText(LCD_PATH_POW_1,Db2CString(LaserPathPower1Val,3));
SetItemText(LCD_PATH_POW_2,Db2CString(LaserPathPower2Val,3));
SetItemText(LCD_PATH_POW_3,Db2CString(LaserPathPower3Val,3));
SetItemText(LCD_SURFACE_POW,Db2CString(ProductSurfacePowerVal,3));
SetItemText(LCD_REAL_EDI,Db2CString(MainLaserEdi,3));
SetItemText(LCD_LASER_REAL_FRE,Db2CString(LaserDeviceState.m_Laser1SetFre,2));
SetItemText(LCD_LASER1_SET_CURR,Db2CString(LaserDeviceState.m_Laser1SetCurr,3));
SetItemText(LCD_LASER1_REAL_CURR,Db2CString(LaserDeviceState.m_Laser1ActualCurr,3));
SetItemText(LCD_LASER1_REAL_VOLTAGE,Db2CString(LaserDeviceState.m_Laser1ActualVoltage,3));
SetItemText(LCD_LASER2_REAL_FRE,Db2CString(LaserDeviceState.m_Laser2SetFre,2));
SetItemText(LCD_LASER2_SET_CURR,Db2CString(LaserDeviceState.m_Laser2SetCurr,3));
SetItemText(LCD_LASER2_REAL_CURR,Db2CString(LaserDeviceState.m_Laser2ActualCurr,3));
SetItemText(LCD_LASER2_REAL_VOLTAGE,Db2CString(LaserDeviceState.m_Laser2ActualVoltage,3));
SetItemText(LCD_LASER_PULSE_DELAY,Db2CString(LaserDeviceState.m_SetPRF2Delay,2));
SetItemText(LCD_LASER_REAL_WATER_FLOW,Db2CString(LaserDeviceState.m_LaserWaterFlow,2));
SetItemText(LCD_LASER_REAL_HUMI,Db2CString(LaserDeviceState.m_LaserHumidity,2));
SetItemText(LCD_LASER_HUMI_SENSOR,Db2CString(LaserDeviceState.m_LaserWetState,2));
SetItemText(LCD_LASER_REAL_SHG_TMP,Db2CString(LaserDeviceState.m_LaserSHGTemp,2));
SetItemText(LCD_LASER_REAL_THG_TMP,Db2CString(LaserDeviceState.m_Laser2SHGTemp,2));
SetItemText(LCD_LASER_REAL_DIODE_TMP_1,Db2CString(LaserDeviceState.m_Laser1DiodeTemp1,2));
SetItemText(LCD_LASER_REAL_DIODE_TMP_2,Db2CString(LaserDeviceState.m_Laser1DiodeTemp2,2));
SetItemText(LCD_LASER_REAL_DIODE_TMP_3,Db2CString(LaserDeviceState.m_Laser1DiodeTemp3,2));
SetItemText(LCD_LASER2_REAL_DIODE_TMP_1,Db2CString(LaserDeviceState.m_Laser2DiodeTemp1,2));
SetItemText(LCD_LASER2_REAL_DIODE_TMP_2,Db2CString(LaserDeviceState.m_Laser2DiodeTemp2,2));
SetItemText(LCD_LASER2_REAL_DIODE_TMP_3,Db2CString(LaserDeviceState.m_Laser2DiodeTemp3,2));
SetItemText(LCD_LASER1_REAL_PULSE_W,Db2CString(OscilloscopeData.m_PulseWidth,2));
SetItemText(LCD_OSCI_PK2PK,Db2CString(OscilloscopeData.m_Pk2pk,2));
SetItemText(LCD_OSCI_MEAN,Db2CString(OscilloscopeData.m_Mean,2));
SetItemText(LCD_OSCI_AMP,Db2CString(OscilloscopeData.m_Amplitude,2));
SetItemText(LCD_CAGE_ROTATOR_ANG,Db2CString(RotatoDimmerAng,3));
SetItemText(LCD_CAGE_ROTATOR_ANG2,Db2CString(RotatoDimmerAng2,3));
if(gLaserDevice->IsbReadLaserDevicePower())
{
GetDlgItem(LCD_LASER_DEVICE_POW_1)->ShowWindow(SW_SHOW);
GetDlgItem(LCD_LASER_DEVICE_POW_2)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_STATIC_LASER_DEV_POW1)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_STATIC_LASER_DEV_POW2)->ShowWindow(SW_SHOW);
SetItemText(LCD_LASER_DEVICE_POW_1,Db2CString(LaserDeviceState.m_Laser1DevicePower,2));
SetItemText(LCD_LASER_DEVICE_POW_2,Db2CString(LaserDeviceState.m_Laser2DevicePower,2));
}
else
{
GetDlgItem(LCD_LASER_DEVICE_POW_1)->ShowWindow(SW_HIDE);
GetDlgItem(LCD_LASER_DEVICE_POW_2)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_STATIC_LASER_DEV_POW1)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_STATIC_LASER_DEV_POW2)->ShowWindow(SW_HIDE);
}
DbSize BeamSize = gLaser->GetBeamSize(_LaserDeviceType_MainLaser1);
SetItemText(LCD_BEAM_SIZE_X,Db2CString(BeamSize.w,3));
SetItemText(LCD_BEAM_SIZE_Y,Db2CString(BeamSize.h,3));
SetItemText(LCD_PATH_POW_SIZE,Db2CString(BeamParLightPath1.m_BeamSize,3));
SetItemText(LCD_PATH_POW_POS_X,Db2CString(BeamParLightPath1.m_BeamPosX,3));
SetItemText(LCD_PATH_POW_POS_Y,Db2CString(BeamParLightPath1.m_BeamPosY,3));
SetItemText(LCD_PATH_POW2_SIZE,Db2CString(BeamParLightPath2.m_BeamSize,3));
SetItemText(LCD_PATH_POW2_POS_X,Db2CString(BeamParLightPath2.m_BeamPosX,3));
SetItemText(LCD_PATH_POW2_POS_Y,Db2CString(BeamParLightPath2.m_BeamPosY,3));
SetItemText(LCD_PATH_POW3_SIZE,Db2CString(BeamParLightPath3.m_BeamSize,3));
SetItemText(LCD_PATH_POW3_POS_X,Db2CString(BeamParLightPath3.m_BeamPosX,3));
SetItemText(LCD_PATH_POW3_POS_Y,Db2CString(BeamParLightPath3.m_BeamPosY,3));
}
//XYZ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void CDlgChildLaserPathState::UpdateXYZCoord()
{
CMotor *pMotorX = CMotor::GetMotor(MOTOR_X);
CMotor *pMotorY = CMotor::GetMotor(MOTOR_Y);
CMotor *pMotorZ = CMotor::GetMotor(MOTOR_Z);
CMotor *pMotorW = CMotor::GetMotor(MOTOR_W);
//ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Dbxy AsixCmdCoordXY = gMotionCtrl->GetCurCmdCoordXY();
double AsixCmdCoordZ = gMotionCtrl->AsixGetCmdCoord(*pMotorZ);//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>mm
//<2F><>դ<EFBFBD><D5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
double GratingRulerCoordX = gMotionCtrl->AsixGetGratingRulerCoord(*pMotorX);
double GratingRulerCoordY = gMotionCtrl->AsixGetGratingRulerCoord(*pMotorY);
double GratingRulerCoordZ = gMotionCtrl->AsixGetGratingRulerCoord(*pMotorZ);
double GratingRulerCoordW = gMotionCtrl->AsixGetGratingRulerCoord(*pMotorW);
//<2F><>Ҫ<EFBFBD><D2AA>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
ZeroChange(AsixCmdCoordXY.x);
ZeroChange(AsixCmdCoordXY.y);
ZeroChange(GratingRulerCoordX);
ZeroChange(GratingRulerCoordY);
ZeroChange(AsixCmdCoordZ);
SetItemText(LCD_MOTOR_X_R_POS,Db2CString(AsixCmdCoordXY.x,3));
SetItemText(LCD_MOTOR_Y_R_POS,Db2CString(AsixCmdCoordXY.y,3));
SetItemText(LCD_MOTOR_Z_R_POS,Db2CString(AsixCmdCoordZ,3));
SetItemText(LCD_MOTOR_X_F_POS,Db2CString(GratingRulerCoordX,3));
SetItemText(LCD_MOTOR_Y_F_POS,Db2CString(GratingRulerCoordY,3));
SetItemText(LCD_MOTOR_Z_F_POS,Db2CString(GratingRulerCoordZ,3));
SetItemText(LCD_MOTOR_W_F_POS,Db2CString(GratingRulerCoordW,3));
//<2F><>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SetItemText(LCD_PATH_MOTOR_POS1,Db2CString(gThorlabsKCubeIMotorCtrlMgr->GetPathMotorPos(1),3));
SetItemText(LCD_PATH_MOTOR_POS2,Db2CString(gThorlabsKCubeIMotorCtrlMgr->GetPathMotorPos(2),3));
SetItemText(LCD_PATH_MOTOR_POS3,Db2CString(gThorlabsKCubeIMotorCtrlMgr->GetPathMotorPos(3),3));
SetItemText(LCD_PATH_MOTOR_POS4,Db2CString(gThorlabsKCubeIMotorCtrlMgr->GetPathMotorPos(4),3));
SetItemText(LCD_PATH_MOTOR_POS5,Db2CString(gThorlabsKCubeIMotorCtrlMgr->GetPathMotorPos(5),3));
SetItemText(LCD_PATH_MOTOR_POS6,Db2CString(gThorlabsKCubeIMotorCtrlMgr->GetPathMotorPos(6),3));
SetItemText(LCD_PATH_MOTOR_POS7,Db2CString(gThorlabsKCubeIMotorCtrlMgr->GetPathMotorPos(7),3));
SetItemText(LCD_PATH_MOTOR_POS8,Db2CString(gThorlabsKCubeIMotorCtrlMgr->GetPathMotorPos(8),3));
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
void CDlgChildLaserPathState::UpdateIDisMeterInfo()
{
double CurReadVal = gDistanceMeterMgr->GetCurDis();//<2F><><EFBFBD><EFBFBD><EFBFBD>ǵĶ<C7B5>ֵ
SetItemText(LCD_DIS_METER_VAL,Db2CString(CurReadVal,3));
}
void CDlgChildLaserPathState::UpdataDeviceInfo()
{
SetItemText(IDC_DATA_FFUMAIN, Db2CString(gOtherMonitorDevMgr->GetMonitorDevVal(_MonitorValType_FFUMain),3));
SetItemText(IDC_DATA_FFUTRANS, Db2CString(gOtherMonitorDevMgr->GetMonitorDevVal(_MonitorValType_FFUTrans), 3));
SetItemText(IDC_DATA_CURL1, Db2CString(gOtherMonitorDevMgr->GetMonitorDevVal(_MonitorValType_DevCurrent1), 3));
SetItemText(IDC_DATA_CURL2, Db2CString(gOtherMonitorDevMgr->GetMonitorDevVal(_MonitorValType_DevCurrent2), 3));
SetItemText(IDC_DATA_CURL3, Db2CString(gOtherMonitorDevMgr->GetMonitorDevVal(_MonitorValType_DevCurrent3), 3));
SetItemText(IDC_DATA_VOL, Db2CString(gOtherMonitorDevMgr->GetMonitorDevVal(_MonitorValType_DevVoltage1), 3));
}
void CDlgChildLaserPathState::SetBtnState(CMyPictrueBttom &btn,bool bOn)
{
if(bOn)
{
btn.SetCurPicType(_EPicType_2);
}
else
{
btn.SetCurPicType(_EPicType_1);
}
}
//<2F><>Ҫ<EFBFBD><D2AA>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>ӽ<EFBFBD>0 <20><><EFBFBD><EFBFBD>ֵ
void CDlgChildLaserPathState::ZeroChange(double &Val)
{
if(IsDbEqualZero(Val))
Val = 0;
}
void CDlgChildLaserPathState::SetItemStr(int ItemId,double Val)
{
CString Str;
Str.Format("%.3f",Val);
SetItemText(ItemId,Str);
}
#endif
//<2F><><EFBFBD>Թ<EFBFBD><D4B9><EFBFBD>
void CDlgChildLaserPathState::OnBnClickedTestFucBtn()
{
if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_TestFunc",true))
return;
CLogInfo LogInfo;
LogInfo.m_ClassName = "CDlgChildLaserPathState";
LogInfo.m_FuncName = "OnBnClickedTestFucBtn";
gLogMgr->WriteLogInfo(LogInfo);
CDlgTestFunc dlg;
dlg.DoModal();
if(dlg.IsbShowDlgGraphEdit())
{
GetFrame()->m_DlgGraphEdit.ShowAllItem();
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>༭ͼ<E0BCAD><CDBC>
gDlgDeviceMain->ShowWindow(SW_HIDE);
GetFrame()->ShowWindowMax();
//<2F><><EFBFBD>»<EFBFBD><C2BB><EFBFBD>
m_pView->RefreshView();
}
else
{
gDlgDeviceMain->ShowWindow(SW_SHOW);
GetFrame()->ShowWindowMax();
}
}
void CDlgChildLaserPathState::OnBnClickedMainLaserState()
{
CLogInfo LogInfo;
LogInfo.m_ClassName = "CDlgChildLaserPathState";
LogInfo.m_FuncName = "OnBnClickedMainLaserState";
gLogMgr->WriteLogInfo(LogInfo);
gLaserDevice->OpenLaserStateDlg();
}
void CDlgChildLaserPathState::OnBnClickedLaserPowCheck()
{
CLogInfo LogInfo;
LogInfo.m_ClassName = "CDlgChildLaserPathState";
LogInfo.m_FuncName = "OnBnClickedLaserPowCheck";
gLogMgr->WriteLogInfo(LogInfo);
if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_LaserPowCheck",true))
return;
CDlgLaserPowCheck dlg;
dlg.DoModal();
}
void CDlgChildLaserPathState::OnBnClickedCloseLaserDevice()
{
CLogInfo LogInfo;
LogInfo.m_ClassName = "CDlgChildLaserPathState";
LogInfo.m_FuncName = "OnBnClickedCloseLaserDevice";
gLogMgr->WriteLogInfo(LogInfo);
if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_CloseLaser",true))
return;
CMsgBox MsgBox;
if(MsgBox.ConfirmOkCancel("<EFBFBD>رռ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?"))
{
gLaser->LaserSleepImmediately();
}
}
//<2F>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD>߼<EFBFBD><DFBC><EFBFBD>
void CDlgChildLaserPathState::OnBnClickedLaserBeamCheck()
{
CLogInfo LogInfo;
LogInfo.m_ClassName = "CDlgChildLaserPathState";
LogInfo.m_FuncName = "OnBnClickedLaserBeamCheck";
gLogMgr->WriteLogInfo(LogInfo);
if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_ManualBeamCheck",true))
return;
CDlgBeamGageCtrl dlg;
dlg.DoModal();
}
void CDlgChildLaserPathState::OnBnClickedLaserOscillCtrl()
{
CLogInfo LogInfo;
LogInfo.m_ClassName = "CDlgChildLaserPathState";
LogInfo.m_FuncName = "OnBnClickedLaserOscillCtrl";
gLogMgr->WriteLogInfo(LogInfo);
if(!gAuthorityMgr->CheckAuthorityByName("AUTHORITY_ManualOscillCheck",true))
return;
#if 0
//<2F><>ʱ<EFBFBD><CAB1>֧<EFBFBD><D6A7>
CMsgBox MsgBox;
MsgBox.Show("Not Support Manual Oscill Check");
return;
#endif
CDlgTekOscilloscopeCtrl dlg;
dlg.DoModal();
}