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.

155 lines
8.1 KiB
C

#pragma once
#include "module.h"
#include "WorkTime.h"
//<2F><><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>
class CEnergyDensityPar
{
public:
CEnergyDensityPar(void)
{
m_LaserDeviceType = 0;
m_LaserFre = 1000;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>Ƶ<EFBFBD><C6B5>Hz
m_EdiK = 0;//<2F><><EFBFBD><EFBFBD><EFBFBD>ܶȵ<DCB6>б<EFBFBD><D0B1>
m_EdiPo = 0;//<2F><><EFBFBD><EFBFBD><EFBFBD>ܶȵĽؾ<C4BD>
};
public:
int m_LaserDeviceType;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
double m_LaserFre;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>Ƶ<EFBFBD><C6B5>Hz
double m_EdiK;//<2F><><EFBFBD><EFBFBD><EFBFBD>ܶȵ<DCB6>б<EFBFBD><D0B1>
double m_EdiPo;//<2F><><EFBFBD><EFBFBD><EFBFBD>ܶȵĽؾ<C4BD>
};
class CWorkCmdContainer;
//<2F><><EFBFBD><EFBFBD>
class CLaser :public CModule
{
public:
CLaser(void);
~CLaser(void);
virtual MODULE GetModuleType(){return _LASER_PROP;};
virtual CMFCPropertyGridProperty *CreatGridProperty();
virtual void OnAppInitialize();
virtual void WriteWorkFileExt(vector<CLab> &LabVec);
virtual void ReadWorkFile(CLabVecRang &LabVecRang);
virtual void Draw(CDC* pDC);
virtual void OnExitApp();
double GetBaseThickness(){return m_BaseThickness;};
void SetBaseThickness(double n){m_BaseThickness = n;};
void SetWorkThickness(double n){m_WorkThickness = n;};
double GetWorkThickness(){return m_WorkThickness;};
bool IsLaserSwitch(){return m_LaserSwitch;};
int GetLaserType(){return m_LaserType;};
int GetOpenLaserDelay();
double GetScanIntervals(double ScanOverlapRatio,bool bhorizontal);
double GetScanOverlapRatio(){return m_ScanOverlapRatio;};
void SetScanOverlapRatio(double val){m_ScanOverlapRatio = val;};
void SetGateFre();
int GetGateOpDelay(){return m_GateOpDelay;};
void SetbLaserGateOpen(bool b){m_bLaserGateOpen = b;};
bool IsbLaserGateOpen(){return m_bLaserGateOpen;};
void SetbRedLaserGateOpen(bool b){m_bRedLaserGateOpen = b;};
bool IsbRedLaserGateOpen(){return m_bRedLaserGateOpen;};
void SetbMachineGateOpen(bool b){m_bMachineGateOpen = b;};
bool IsMachineGateOpen(){return m_bMachineGateOpen;};
int GetShortOpenLaserDelay();
bool IsbCloseAppCloseLaser(){return m_bCloseAppCloseLaser;};
void SetFocusZMoveUpVal(double ZFocus){m_FocusZMoveUpVal = ZFocus;};
double GetFocusZMoveUpVal();
bool IsbAutoCalScanSpeed(){return m_bAutoCalSpeedX;};
bool IsbAutoCalCurr(){return m_bAutoCalCurr;};
double GetLaserFocusDis();
void IOSwitchLaserDimmer(bool bOpen);
void IOSwitchLaserDimmerByTargetCoord(Dbxy TargetCoord);
void StartLaserSleepTime();
void StopLaserSleepTime();
void LaserSleepTimeExt();
CString GetCurSleepLeftTimes();
void CalEnergyDensity(eLaserDeviceType LaserDeviceType,double F,double I,double &Edi);
void CalCurrByEdi(eLaserDeviceType LaserDeviceType,double F,double &I,double Edi);
void LaserSleepImmediately();
double GetCurWorkFoucsZcoord(){return m_CurWorkFoucsZcoord;};
void SetCurWorkFoucsZcoord(double Coord);
void ResetCurWorkFoucsZcoord();
bool IsbInited(){return m_bInited;};
void SetEnergyDensityPar(eLaserDeviceType LaserDeviceType,double Fre,double K,double Po);
bool GetEnergyDensityPar(eLaserDeviceType LaserDeviceType,double Fre,double &K,double &Po);
bool CheckEnergyDensityPar(eLaserDeviceType LaserDeviceType,double Fre,double K,double Po);
int GetRedLaserDelayAdjust(){return m_RedLaserDelayAdjust;};
int GetRedLaserPowCheckPluseW(){return m_RedLaserPowCheckPluseW;};
DbSize GetSpotSize(eLaserDeviceType LaserDeviceType);
bool IsbScanByDirX(){return m_bScanByDirX;};
CString GetLaserDeviceName(eLaserDeviceType LaserDeviceType);
void IniEdiParList(CListCtrl &list);
void UpdateEdiParList(CListCtrl &list);
bool IsLaserSleepTimeRun(){return !m_bStopLaserSleepTime;};//<2F><><EFBFBD>߼<EFBFBD>ʱ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
double CalPowerByRecipePar(eLaserDeviceType LaserDeviceType,double Fre,double I);
double CalPowerByDensityPar(double Po,double K,double I);
bool IsbPowRecordWriteCalPow(){return m_bPowRecordWriteCalPow;};
double CalEnergyDensityByPow(eLaserDeviceType LaserDeviceType,double F,double P);
int GetLaserCurrDigitsCnt(){return (m_LaserCurrDigitsCnt==1)?1:2;};
void UpdateLaserProp();
void GetLaserFixedCurrentPow(eLaserDeviceType LaserDeviceType,double Fre,double FixCurr,double &FixPow);
private:
double CalEnergyDensityExt(eLaserDeviceType LaserDeviceType,double F,double I,double K,double Po);
double CalCurrByEdiExt(eLaserDeviceType LaserDeviceType,double F,double Edi,double K,double Po);
void ReadEnergyDensityParFile();
void WriteEnergyDensityParFile();
double ReadCurSetLddCurrent(eLaserDeviceType LaserDeviceType);
private:
bool m_bInited;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ɹ<EFBFBD>
DbSize m_SpotSize;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵijߴ<C4B3>w<EFBFBD><77>ʾX<CABE><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD>h<EFBFBD><68>ʾY<CABE><59><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ֵ)
double m_ScanOverlapRatio;//ɨ<><C9A8><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(0~100%)
bool m_bAutoCalSpeedX;//<2F><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD>ٶ<EFBFBD>(<28><><EFBFBD><EFBFBD>ֵ)
bool m_bAutoCalCurr;//<2F><><EFBFBD>ݹ<EFBFBD><DDB9><EFBFBD><EFBFBD>ܶ<EFBFBD><DCB6>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ֵ)
bool m_LaserSwitch;//<2F><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ֵ)
bool m_bScanByDirX;//X<><58><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8>
int m_LaserType;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ֵ)
int m_OpenLaserDelay;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱms (<28><><EFBFBD><EFBFBD>ʱ) (<28><><EFBFBD><EFBFBD>ֵ)
int m_OpenLaserDelayShort;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱms (<28><><EFBFBD><EFBFBD>ʱ) (<28><><EFBFBD><EFBFBD>ֵ)
bool m_bLaserGateOpen;//<2F><><EFBFBD><EFBFBD>gate <20>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>״̬
bool m_bRedLaserGateOpen;//<2F><><EFBFBD><EFBFBD>2 gate <20>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>״̬(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
bool m_bSetGateFre;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD>բ<EFBFBD><D5A2>Ƶ<EFBFBD><C6B5>
bool m_bMachineGateOpen;//<2F><>բ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
int m_GateOpDelay;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>բ<EFBFBD><D5A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱms(<28><>Ϊ<EFBFBD><CEAA>բƫת<C6AB><D7AA>Ҫʱ<D2AA><CAB1>)(<28><><EFBFBD><EFBFBD>ֵ)
int m_GateFre;//<2F><>բ<EFBFBD><D5A2>Ƶ<EFBFBD><C6B5>(<28><><EFBFBD><EFBFBD>ֵ)
//<2F><><EFBFBD><EFBFBD><E2BDB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,Z <20><><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
bool m_bAdaptThickness;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>Ӧ<EFBFBD><D3A6>Ʒ<EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD>
double m_BaseThickness;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD><D4BD><EFBFBD><EFBFBD>Ļ<EFBFBD>׼<EFBFBD><D7BC>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>mm
double m_WorkThickness;//<2F><>ǰ<EFBFBD>ӹ<EFBFBD><D3B9>IJ<EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>mm
double m_MaxThickness;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>mm
double m_MinThickness;//<2F><>С<EFBFBD><D0A1>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>mm
double m_FocusZMoveUpVal;//<2F><><EFBFBD><EFBFBD>Z <20>ļ<EFBFBD><C4BC><EFBFBD><E2BDB9>λ<EFBFBD><CEBB>(<28><><EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD>׼<EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>ֵ)
bool m_bCloseAppCloseLaser;//<2F>Ƿ<EFBFBD><C7B7>ڹر<DAB9><D8B1><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>رռ<D8B1><D5BC><EFBFBD>(<28><><EFBFBD><EFBFBD>ֵ)
bool m_bCtrLaserDimmerByMotionIO;//<2F><><EFBFBD>Ƽ<EFBFBD><C6BC><EFBFBD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD>(true <20>˶<EFBFBD><CBB6><EFBFBD><EFBFBD>ƿ<EFBFBD><C6BF><EFBFBD>IO )(false PLC<4C><43><EFBFBD><EFBFBD>)
bool m_bCtrLaserDimmerRev;//<2F><>բ<EFBFBD><D5A2><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD>
CWorkTime m_LaserSleepTime;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool m_bStopLaserSleepTime;//ֹͣ<CDA3><D6B9><EFBFBD>߼<EFBFBD>ʱ
double m_EnergyParChangeScal;//<2F><><EFBFBD><EFBFBD><EFBFBD>жϵ<D0B6><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܶȲ<DCB6><C8B2><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ֵ)
int m_RedLaserPowCheckPluseW;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱʹ<CAB1>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>us
DbSize m_RedSpotSize;//<2F><><EFBFBD><EFBFBD><E2BCA4><EFBFBD><EFBFBD><EFBFBD>ߵijߴ<C4B3>w<EFBFBD><77>ʾX<CABE><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD>h<EFBFBD><68>ʾY<CABE><59><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ֵ)
int m_RedLaserDelayAdjust;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ֵ(<28><><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E5B7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ)
bool m_bPowRecordWriteCalPow;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>¼ʱ<C2BC><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E3B9A6>P = Po+K*I;
int m_LaserCurrDigitsCnt;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
vector<CEnergyDensityPar> m_EnergyDensityParVec;//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD>ܶȲ<DCB6><C8B2><EFBFBD>
double m_CurWorkFoucsZcoord;//<2F><>ǰ<EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD>ԲZ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
};
extern CLaser *gLaser;