177 lines
6.9 KiB
C++
177 lines
6.9 KiB
C++
#pragma once
|
|
#include "BaseClient.h"
|
|
#include "../config/bean/AlarmCfg.h"
|
|
|
|
//class IPGLaserState {
|
|
//public:
|
|
// IPGLaserState() {
|
|
// currentSetpoint=0.0f;
|
|
// laserTemperature=0.0f;
|
|
// moduleErrorCode=0;
|
|
// outputPower = "OFF";
|
|
// isOverheat=false;
|
|
// isEmissionOn = false;
|
|
// isHighBackReflectionLevel = false;
|
|
// isExtCtrlEnable = false;
|
|
// isModuleDisconnected = false;
|
|
// isAimingBeamON = false;
|
|
// isModuleAlarm = false;
|
|
// // isPulseTooShort = false;
|
|
//// isPulseMode = false;
|
|
// isPowerSupplyOff = false;
|
|
// isModulationEnabled = false;
|
|
// isEmission = false;
|
|
//// isGateModeEnabled = false;
|
|
// // isHighPulseEnergy = false;
|
|
// isExtEmissionCtrlEnabled = false;
|
|
// isPowerSupplyFailure = false;
|
|
// // isLockFrontPanel = false;
|
|
// // isKeyswitchInREMPosition = false;
|
|
// // isWaveformPulseModeEnabled = false;
|
|
// // isHighDutyCycle = false;
|
|
// isLeakageCurrentTooHigh = false;
|
|
// isLowTemperature = false;
|
|
// isPowerSupplyVotageAlarm = false;
|
|
// isExtRedLightCtrlEnabled = false;
|
|
// isCritialError = false;
|
|
// isOpticalInterlockActive = false;
|
|
// //isAveragePowerTooHigh = false;
|
|
// }
|
|
//
|
|
//public:
|
|
// float currentSetpoint; //激光二极管电流设置
|
|
// float laserTemperature; //内部实际温度
|
|
// string outputPower; //输出功率W
|
|
// int moduleErrorCode; //模块错误代码
|
|
// bool isOverheat; //温度过热
|
|
// bool isEmissionOn; //使能
|
|
// bool isHighBackReflectionLevel; //高反报警
|
|
// bool isExtCtrlEnable; //外部控制模式
|
|
// bool isModuleDisconnected; //激光模块失连
|
|
// bool isModuleAlarm; //激光模块故障
|
|
// bool isAimingBeamON; //红光开
|
|
// //bool isPulseTooShort; //脉冲宽度太小
|
|
// //bool isPulseMode; //脉冲模式
|
|
// bool isPowerSupplyOff; //模块主电源关闭
|
|
// bool isModulationEnabled; //调制模式开启
|
|
// bool isEmission; //激光发射
|
|
//// bool isGateModeEnabled; //Gate模式开启
|
|
//// bool isHighPulseEnergy; //脉冲能量太大
|
|
// bool isExtEmissionCtrlEnabled; //外部Emission控制开启
|
|
// bool isPowerSupplyFailure; //模块主电源故障
|
|
// //bool isLockFrontPanel; //前显示面板锁定
|
|
// //bool isKeyswitchInREMPosition; //钥匙开关REM位置
|
|
// //bool isWaveformPulseModeEnabled;//波形脉冲模式开启
|
|
// //bool isHighDutyCycle; //脉冲周期太长
|
|
// bool isLowTemperature; //温度过低
|
|
// bool isPowerSupplyVotageAlarm; //模块主电源电压超范围
|
|
// bool isLeakageCurrentTooHigh; //漏电流过大
|
|
// bool isExtRedLightCtrlEnabled; //外部红光控制开启
|
|
// bool isCritialError; //关键错误
|
|
// bool isOpticalInterlockActive; //光学回路安全互锁开路
|
|
// //bool isAveragePowerTooHigh; //平均功率太高
|
|
//};
|
|
//
|
|
//class IPGLaserClient:public TcpClient
|
|
//{
|
|
//public:
|
|
// IPGLaserClient(void* pconfig = nullptr, AlarmCfg* laserAlarm = nullptr, int freq = 100);
|
|
// ~IPGLaserClient();
|
|
// void InitCommand();
|
|
// void ResetAlarm();
|
|
//
|
|
// void GetState(IPGLaserState& state);
|
|
//
|
|
//private:
|
|
// void static PorcReadCurrentSetpoint(void* pobject, Command* pcommand);
|
|
// void static PorcReadLaserTemp(void* pobject, Command* pcommand);
|
|
// void static PorcReadOutputPower(void* pobject, Command* pcommand);
|
|
// void static PorcModuleErrorCode(void* pobject, Command* pcommand);
|
|
// void static PorcDeviceStatus(void* pobject, Command* pcommand);
|
|
//
|
|
//private:
|
|
// IPGLaserState m_State;
|
|
// AlarmCfg* m_LaserAlarm;
|
|
//};
|
|
|
|
#pragma pack(1)
|
|
class IPGLaserStateV1 {
|
|
public:
|
|
IPGLaserStateV1()
|
|
: currentSetpoint(new FloatData("currentSetpoint", u8"激光二极管电流设置"))
|
|
, laserTemperature(new FloatData("laserTemperature", u8"内部实际温度"))
|
|
, outputPower(new StrData("outputPower", u8"输出功率W","OFF"))
|
|
, moduleErrorCode(new IntData("moduleErrorCode", u8"模块错误代码"))
|
|
, isCommandBufferOverload(new BoolData("isCommandBufferOverload", u8"指令溢出"))
|
|
, isOverheat(new BoolData("isOverheat", u8"温度过热"))
|
|
, isEmissionOn(new BoolData("isEmissionOn", u8"使能"))
|
|
, isHighBackReflectionLevel(new BoolData("isHighBackReflectionLevel", u8"高反报警"))
|
|
, isAnalogPowerControlEnable(new BoolData("isAnalogPowerControlEnable", u8"功率外控"))
|
|
, isAimingBeamON(new BoolData("isAimingBeamON", u8"红光开"))
|
|
, isPowerSupplyOff(new BoolData("isPowerSupplyOff", u8"模块主电源关闭"))
|
|
, isModulationEnabled(new BoolData("isModulationEnabled", u8"调制模式开启"))
|
|
, isEmission(new BoolData("isEmission", u8"激光发射"))
|
|
, isGateModeEnable(new BoolData("isGateModeEnable", u8"门模式开启"))
|
|
, isHardwareEmissionCtrlEnabled(new BoolData("isHardwareEmissionCtrlEnabled", u8"硬控发射开启"))
|
|
, isPowerSupplyFailure(new BoolData("isPowerSupplyFailure", u8"模块主电源故障"))
|
|
, isLowTemperature(new BoolData("isLowTemperature", u8"温度过低"))
|
|
, isPowerSupplyAlarm(new BoolData("isPowerSupplyAlarm", u8"供电报警"))
|
|
, isHardwareAimingBeanControlEnable(new BoolData("isHardwareAimingBeanControlEnable", u8"硬控红光开启"))
|
|
, isCritialError(new BoolData("isCritialError", u8"关键错误"))
|
|
, isFiberInterlockActive(new BoolData("isFiberInterlockActive", u8"光路内部锁定"))
|
|
{
|
|
}
|
|
|
|
public:
|
|
char m_startFlag; //开始标记
|
|
FloatData* currentSetpoint; //激光二极管电流设置
|
|
FloatData* laserTemperature; //内部实际温度
|
|
StrData* outputPower; //输出功率W
|
|
IntData* moduleErrorCode; //模块错误代码
|
|
BoolData* isCommandBufferOverload; //指令溢出
|
|
BoolData* isOverheat; //温度过热
|
|
BoolData* isEmissionOn; //使能
|
|
BoolData* isHighBackReflectionLevel; //高反报警
|
|
BoolData* isAnalogPowerControlEnable; //功率外控
|
|
BoolData* isAimingBeamON; //红光开
|
|
BoolData* isPowerSupplyOff; //模块主电源关闭
|
|
BoolData* isModulationEnabled; //调制模式开启
|
|
BoolData* isEmission; //激光发射
|
|
BoolData* isGateModeEnable; //门模式开启
|
|
BoolData* isHardwareEmissionCtrlEnabled; //硬控发射开启
|
|
BoolData* isPowerSupplyFailure; //模块主电源故障
|
|
BoolData* isLowTemperature; //温度过低
|
|
BoolData* isPowerSupplyAlarm; //供电报警
|
|
BoolData* isHardwareAimingBeanControlEnable; //硬控红光开启
|
|
BoolData* isCritialError; //关键错误
|
|
BoolData* isFiberInterlockActive; //光路内部锁定
|
|
char m_endFlag; //结束标记
|
|
};
|
|
#pragma pack()
|
|
|
|
class IPGLaserClientV1 :public TcpClient
|
|
{
|
|
public:
|
|
IPGLaserClientV1(void* pconfig = nullptr, AlarmCfg* laserAlarm = nullptr);
|
|
~IPGLaserClientV1();
|
|
//void Init();
|
|
//void InitCommand();
|
|
//void ResetAlarm();
|
|
|
|
//void GetState(IPGLaserStateV1& state);
|
|
|
|
//void DrawClientState();
|
|
private:
|
|
//void static PorcReadCurrentSetpoint(void* pobject, Command* pcommand);
|
|
//void static PorcReadLaserTemp(void* pobject, Command* pcommand);
|
|
//void static PorcReadOutputPower(void* pobject, Command* pcommand);
|
|
//void static PorcModuleErrorCode(void* pobject, Command* pcommand);
|
|
//void static PorcDeviceStatus(void* pobject, Command* pcommand);
|
|
|
|
private:
|
|
IPGLaserStateV1 m_State;
|
|
AlarmCfg* m_LaserAlarm;
|
|
AlarmCfgWrapper* m_AlarmCfgWrapper;
|
|
|
|
};
|