GrpcPrint/PrintS/ScannerCtrl/IntelliScanState.h

104 lines
3.3 KiB
C
Raw Normal View History

2024-03-26 10:33:00 +08:00
#pragma once
#include "../LanguageManager.h"
class IntelliScanState {
public:
IntelliScanState() {
m_GalvanometerScannerTemp = 0.0f;
m_ServoBoardTemp = 0.0f;
m_PDSupplyVoltage = 0.0f;
m_DSPCoreSupplyVoltage = 0.0f;
m_DSPIOVoltage = 0.0f;
m_AnalogSectionVoltage = 0.0f;
m_ADConverterSupplyVoltage = 0.0f;
m_PDSupplyCurrent = 0.0f;
}
~IntelliScanState() {}
static string GetStopEventInfo(int ivalue, bool& bvalue)
{
string info = _(u8"没有").c_str();
bvalue = false;
switch (ivalue) {
case 0x10: {
info = _(u8"摆镜到达危险边缘位置").c_str();
bvalue = true;
}break;
case 0x20: {
info = _(u8"AD转换错误").c_str();
bvalue = true;
}break;
case 0x30: {
info = _(u8"扫描系统温度越限").c_str();
bvalue = true;
}break;
case 0x40: {
info = _(u8"外部电压过低").c_str();
bvalue = true;
}break;
case 0x50: {
info = _(u8"标志不合法").c_str();
bvalue = true;
}break;
case 0xD0: {
info = _(u8"看门狗超时").c_str();
bvalue = true;
}break;
case 0xE0: {
info = _(u8"振镜位置到达超时").c_str();
bvalue = true;
}break;
}
return info;
}
public:
//bool m_IsInternalVoltagesNormal; //内部电压正常
bool m_GalvanometerScannerTempOK; //振镜预热完成
float m_ActualPosition; //真实位置
float m_SetPosition; //设值位置
float m_PositionError; //位置误差
//float m_ActualCurrent; //真实电流
//float m_ActualVelocity; //真实速度
float m_GalvanometerScannerTemp; //振镜温度
float m_ServoBoardTemp; //伺服板卡温度
float m_PDSupplyVoltage; //PD供电电压
float m_DSPCoreSupplyVoltage; //DSP核心供电电压
float m_DSPIOVoltage; //DSP输入输出电压
float m_AnalogSectionVoltage; //模拟区电压
float m_ADConverterSupplyVoltage; //AD转换供电电压
float m_PDSupplyCurrent; //PD供电电流
bool m_IsGalvanometerScannerOutputStageOn; //振镜输出级生效
bool m_IsGalvanometerScannerHeaterOutputStageOn; //振镜加热器输出级生效
bool m_IsInternalVoltagesNormal; //内部电压正常
bool m_IsPositionErrorNormalRange; //位置误差正常
bool m_IsScannerAndServoBoradTempNormal; //振镜和伺服温度正常
bool m_IsBootingProcessCompleted; //启动处理完成
bool m_IsCriticalError; //发生严重错误
bool m_IsExternalPowderLow; //外部电压欠压
bool m_IsScanSystemTempOverLimit; //扫描系统超温
bool m_IsADConverterSuccessfullyInit; //AD转换初始化成功
bool m_IsScannerReachedCriticalEdgePos; //振镜到达临界边缘位置
bool m_IsAllControlParametersValid; //允许控制参数
bool m_IsADConverterVoltageOK; //AD转换供电正常
bool m_IsAnalogSetionVoltageOK; //模拟区电压正常
bool m_IsDSPIOVoltageOK; //DSP 输入输出电压正常
bool m_IsDSPCoreVoltageOK; //DSP核心供电正常
bool m_IsAGCVoltageOK; //AGC电压正常
bool m_IsServoBoradOperationTempNormal; //伺服板卡操作温度正常
bool m_IsGalvanometerScannerOperationTempNormal; //振镜操作温度正常
int m_LowState;
int m_HighState;
int m_StopEven;
};
class ScanStateXY {
public:
ScanStateXY() {}
~ScanStateXY() {}
public:
bool m_IsConnected;
UINT m_LastError;
IntelliScanState m_X;
IntelliScanState m_Y;
IntelliScanState m_Focus;
};