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.
133 lines
5.2 KiB
C++
133 lines
5.2 KiB
C++
#pragma once
|
|
#include "module.h"
|
|
|
|
|
|
|
|
|
|
|
|
//功率点检参数
|
|
class CPowCheckPar
|
|
{
|
|
public:
|
|
CPowCheckPar(void)
|
|
{
|
|
m_PulseFre = 1000;//激光脉冲频率Hz
|
|
m_StartCurr = 27;//开始电流值A
|
|
m_EndCurr = 40;//结束电流值A
|
|
m_GapCurr = 1;//间隔电流值A
|
|
m_FirstCheckDelay = 30;//第一个电流值测量的延时ms
|
|
m_CheckDelay = 15;//每个电流值测量的延时ms
|
|
};
|
|
|
|
void Serialize( CArchive& ar);
|
|
public:
|
|
double m_PulseFre;//激光脉冲频率Hz
|
|
double m_StartCurr;//开始电流值A
|
|
double m_EndCurr;//结束电流值A
|
|
double m_GapCurr;//间隔电流值A
|
|
int m_CheckDelay;//每个电流值测量的延时ms
|
|
int m_FirstCheckDelay;//第一个电流值测量的延时ms
|
|
|
|
|
|
};
|
|
//单个点的功率点检数据
|
|
class CPowCheckPt
|
|
{
|
|
public:
|
|
CPowCheckPt(void)
|
|
{
|
|
m_SetCurr = 0;//设定电流值A
|
|
m_LaserDevicePow = 0;//激光器内部功率值W
|
|
m_LaserPathPow = 0;//光路功率值W
|
|
m_DOE_Pow = 0;//下光路DOE 功率值W
|
|
m_SurfacePow = 0;//产品面功率值W
|
|
};
|
|
public:
|
|
double m_SetCurr;//设定电流值A
|
|
double m_LaserDevicePow;//激光器出光口功率值W
|
|
double m_LaserPathPow;//光路功率值W
|
|
double m_DOE_Pow;//下光路DOE 功率值W
|
|
double m_SurfacePow;//产品面功率值W
|
|
|
|
eLaserDeviceType m_LaserType;
|
|
double m_LaserFre;//激光频率Hz
|
|
};
|
|
|
|
//功率点检数据
|
|
class CPowCheckData
|
|
{
|
|
public:
|
|
CPowCheckData(void)
|
|
{
|
|
m_CheckType = _LaserDeviceType_MainLaser1;
|
|
m_EnergyDensityK = 0;//功率密度的斜率
|
|
m_EnergyDensityPo = 0;//功率密度的截距
|
|
m_LaserFre = 0;//点检使用的激光频率
|
|
};
|
|
void ResetCheckData(){m_bCheckDataValid = false;};
|
|
public:
|
|
bool m_bCheckDataValid;//点检结果是否有效
|
|
CString m_DateTime;//数据产生的时间
|
|
double m_LaserFre;//点检使用的激光频率Hz
|
|
eLaserDeviceType m_CheckType;
|
|
double m_EnergyDensityK;//功率密度的斜率
|
|
double m_EnergyDensityPo;//功率密度的截距
|
|
vector<CPowCheckPt> m_PowCheckPtVec;//功率点检数据容器
|
|
};
|
|
|
|
class CLaserPowCheckMgr :public CModule
|
|
{
|
|
public:
|
|
CLaserPowCheckMgr(void);
|
|
~CLaserPowCheckMgr(void);
|
|
virtual void OnAppInitialize();
|
|
|
|
void InitSelYearComb(CComboBox &ComboBox);
|
|
void InitSelMonthComb(CComboBox &ComboBox);
|
|
void InitSelLaserComb(CComboBox &ComboBox);
|
|
void IniParList(CListCtrl &list,int AddW=0);
|
|
void UpdatePowCheckDataList(CListCtrl &List,bool bInsert,int SelIdx=-1);
|
|
void IniRecordList(CListCtrl &list);
|
|
void SetCurPowCheckType(int idx);
|
|
CPowCheckPar *GetCurPowCheckPar();
|
|
void SetCurPowCheckFre(double Fre);
|
|
void CreatCurPowCheckData();
|
|
void SetPowCheckPar(CPowCheckPar CheckPar);
|
|
void GetEnergyDensityPar(double &K,double &Po);
|
|
CPowCheckData &GetCurPowCheckData(){return m_CurPowCheckData;};
|
|
void LaserPowSavePt(CPowCheckPt *pCheckPt);
|
|
void BindingParList(CListCtrl *p){m_ParList = p;};
|
|
bool SaveCurPowCheckData();
|
|
void ReadPowCheckData(int LaserType,CString Year,CString Month);
|
|
void UpdatePowCheckRecordList(CListCtrl &List);
|
|
void SaveSelCheckRecordToFile();
|
|
eLaserDeviceType GetCurPowCheckType(){return m_CurPowCheckType;};
|
|
void RecoverLastPowCheckData(eLaserDeviceType LaserDeviceType);
|
|
void GetLastPowCheckPar(eLaserDeviceType LaserDeviceType,double &K,double &Po);
|
|
void SaveCurPowCheckDataForRecipe();
|
|
void ReadLaserFixedCurrentPowFile(vector<CPowCheckPt> &PowCheckPtPowCheckPVec);
|
|
private:
|
|
CString GetPowCheckFilePath();
|
|
void ReadPowCheckPar();
|
|
bool CalEnergyDensityPar();
|
|
double CalTwoPtK(CPowCheckPt CheckPt1,CPowCheckPt CheckPt2);
|
|
void UpdatePowCheckDataListExt(CListCtrl &List,bool bInsert,CPowCheckData &PowCheckData);
|
|
void SerializePowCheckData(CArchive& ar,CPowCheckData &PowCheckData);
|
|
private:
|
|
CPowCheckPar m_MainPowCheckPar;//主激光的功率点检参数
|
|
CPowCheckPar m_RedPowCheckPar;//红光的功率点检参数
|
|
CPowCheckData m_CurPowCheckData;//当前功率点检数据
|
|
vector<CPowCheckData> m_CurPowCheckRecordVec;//当前的记录列表数据
|
|
int m_CurSelCheckRecordIdx;
|
|
eLaserDeviceType m_CurPowCheckType;//当前功率点检的类型
|
|
CListCtrl *m_ParList;
|
|
CString m_CurSelMonth;//当前选择的月
|
|
int m_CurExtLaserType;
|
|
|
|
CPowCheckData m_LastPow1CheckData;//最近一次激光1 功率点检数据
|
|
CPowCheckData m_LastPow2CheckData;//最近一次激光2 功率点检数据
|
|
CPowCheckData m_LastRedPowCheckData;//最近一次红光功率点检数据
|
|
};
|
|
|
|
extern CLaserPowCheckMgr *gLaserPowCheckMgr;
|