417 lines
11 KiB
C++
417 lines
11 KiB
C++
#pragma once
|
||
|
||
#include <map>
|
||
#include <string>
|
||
#include <vector>
|
||
#include "../UI/Base.h"
|
||
using namespace std;
|
||
|
||
struct AdcLinear
|
||
{
|
||
int id;
|
||
string code;
|
||
double slope;
|
||
double intercept;
|
||
AdcLinear() {
|
||
|
||
}
|
||
AdcLinear(int did,string strcode,double dslope,double dintercept) {
|
||
id = did;
|
||
code = strcode;
|
||
slope = dslope;
|
||
intercept = dintercept;
|
||
}
|
||
};
|
||
|
||
struct FanFit
|
||
{
|
||
string code;
|
||
double slope;
|
||
double intercept;
|
||
float checkWindOffset;
|
||
float targeWind;
|
||
float alarmWind;
|
||
float checkAlarmPercent;
|
||
};
|
||
|
||
class ExtCfg
|
||
{
|
||
public:
|
||
enum CameraType
|
||
{
|
||
Galaxy = 0,
|
||
OPT
|
||
};
|
||
|
||
enum CameraRotateAngle {
|
||
Angle_0 = 0,
|
||
Angle_90,
|
||
Angle_180,
|
||
Angle_270
|
||
};
|
||
|
||
enum OxygenSensor
|
||
{
|
||
MOT500_LOW=0,
|
||
MOT500_HIGH,
|
||
HT
|
||
};
|
||
|
||
enum ScanPowerType {
|
||
JSY_V0 = 0,
|
||
JSY_V1
|
||
};
|
||
|
||
enum ModelBroderType {
|
||
All_Border = 0,
|
||
Border,
|
||
BorderDown,
|
||
BorderAdditionalDown,
|
||
BorderBlockedDown,
|
||
BorderAdditional,
|
||
BorderBlocked,
|
||
BorderUp,
|
||
BorderAdditionalUp,
|
||
BorderBlockedUp,
|
||
BorderSupport,
|
||
BorderAdditionalSupport
|
||
};
|
||
|
||
enum ChillerType {
|
||
DOLUYO=0,
|
||
HANS,
|
||
TONGFEI
|
||
};
|
||
|
||
enum LaserType {
|
||
IPG = 0,
|
||
XC,
|
||
IPG_V1
|
||
};
|
||
|
||
ExtCfg();
|
||
~ExtCfg();
|
||
void GetUpdateSql(vector<string>& ups);
|
||
|
||
|
||
public:
|
||
unsigned short m_LimitCode;
|
||
AdcLinear m_OxygenAdc;
|
||
AdcLinear m_AmbientTempAdc;
|
||
AdcLinear m_InnerTempAdc;
|
||
AdcLinear m_BlowAdc;
|
||
AdcLinear m_PressureAdc;
|
||
map<int, AdcLinear*> m_AdcCfgs;
|
||
|
||
int m_FanId;
|
||
FanFit m_ArgonFit;
|
||
FanFit m_NitrogenFit;
|
||
int m_SelectedFanWindFit;
|
||
map<int, FanFit*> m_FanWindFit;
|
||
|
||
bool m_ComGetOxygen;
|
||
bool m_CheckDataWhenInport;
|
||
|
||
bool m_UseCamera;
|
||
int m_CameraType;
|
||
bool m_IsCameralColorful;
|
||
bool m_IsExposureAuto;
|
||
bool m_IsGainAuto;
|
||
double m_ExposureTime;
|
||
double m_ExposureTimeMin;
|
||
double m_ExposureTimeMax;
|
||
float m_LogRatio;
|
||
float m_ShowImageUV0x;
|
||
float m_ShowImageUV0y;
|
||
float m_ShowImageUV1x;
|
||
float m_ShowImageUV1y;
|
||
int m_ShowImageRotateAngle; //逆时针角度
|
||
float m_ShowImageScaleX;
|
||
float m_ShowImageScaleY;
|
||
bool m_FrameRateEnable;
|
||
double m_FrameRate;
|
||
|
||
double m_ShowImageAngle;
|
||
bool m_UseShowImageWarpPerspective;
|
||
int m_ShowImageTopLeftX;
|
||
int m_ShowImageTopLeftY;
|
||
int m_ShowImageTopRightX;
|
||
int m_ShowImageTopRightY;
|
||
int m_ShowImageBottomLeftX;
|
||
int m_ShowImageBottomLeftY;
|
||
int m_ShowImageBottomRightX;
|
||
int m_ShowImageBottomRightY;
|
||
int m_ShowImagePerspectiveWidth;
|
||
int m_ShowImagePerspectiveHeigh;
|
||
|
||
bool m_model_enable;
|
||
int m_model_scan_mode; // 0激光 ,1红光
|
||
string m_model_scan_type; // 0轮廓 ,1实体
|
||
int m_model_scan_part_id;
|
||
int m_model_laser_power;
|
||
int m_model_laser_power_min;
|
||
int m_model_laser_power_max;
|
||
double m_model_laser_speed;
|
||
int m_model_border_type;
|
||
|
||
float m_FanFrequencySlope; //风机电压转频率
|
||
float m_FanFrequencyIntercept;
|
||
uint32_t m_TestEmissionTime; //ms
|
||
bool m_UseDataSeq;
|
||
|
||
bool m_AutoCoverSlowWind;
|
||
|
||
int m_Oxygen1SensorType;
|
||
int m_Oxygen2SensorType;
|
||
int m_OutOxygenSensorType;
|
||
bool m_HasCleanBoxOxygenSensor;
|
||
int m_CleanBoxOxygenSensorType;
|
||
|
||
unsigned int m_AftLaserPowerWaitSecond;
|
||
unsigned int m_AftLaserStartWaitSecond;
|
||
unsigned int m_AftLaserEnableWaitSecond;
|
||
|
||
bool m_UsePowderStick; //使用料位棒
|
||
bool m_IsSupplyOneWay;
|
||
|
||
float m_HeatingAlarmPercent; //加热温度越限百分比
|
||
|
||
int m_LaserChillerType;
|
||
int m_PurifierChillerType;
|
||
|
||
int m_ScanPowerType;
|
||
int m_LaserType;
|
||
public:
|
||
static string CONFIG_NAME;
|
||
static string FIELD_OXYGEN_ID;
|
||
static string FIELD_OXYGEN_CODE;
|
||
static string FIELD_OXYGEN_SLOPE;
|
||
static string FIELD_OXYGEN_INTERCEPT;
|
||
static string FIELD_AMBIENTTEMP_ID;
|
||
static string FIELD_AMBIENTTEMP_CODE;
|
||
static string FIELD_AMBIENTTEMP_SLOPE;
|
||
static string FIELD_AMBIENTTEMP_INTERCEPT;
|
||
static string FIELD_INNERTEMP_ID;
|
||
static string FIELD_INNERTEMP_CODE;
|
||
static string FIELD_INNERTEMP_SLOPE;
|
||
static string FIELD_INNERTEMP_INTERCEPT;
|
||
static string FIELD_BLOW_ID;
|
||
static string FIELD_BLOW_CODE;
|
||
static string FIELD_BLOW_SLOPE;
|
||
static string FIELD_BLOW_INTERCEPT;
|
||
static string FIELD_LIMIT_CODE;
|
||
static string FIELD_IS_DYNAMIC_FOCUS;
|
||
static string FIELD_DEFOCUS_RATIO;
|
||
static string FIELD_DEFOCUS_RATIO_MIN;
|
||
static string FIELD_DEFOCUS_RATIO_MAX;
|
||
static string FIELD_FAN_ID;
|
||
static string FIELD_ARGON_CODE;
|
||
static string FIELD_ARGON_SLOPE;
|
||
static string FIELD_ARGON_INTERCEPT;
|
||
|
||
static string FIELD_NITROGEN_CODE;
|
||
static string FIELD_NITROGEN_SLOPE;
|
||
static string FIELD_NITROGEN_INTERCEPT;
|
||
static string FIELD_SELECTED_FAN_WIND_FIT;
|
||
static string FIELD_ARGON_CHECK_WIND_OFFSET;
|
||
static string FIELD_ARGON_TARGET_WIND;
|
||
static string FIELD_NITROGEN_CHECK_WIND_OFFSET;
|
||
static string FIELD_NITROGEN_TARGET_WIND;
|
||
static string FIELD_ARGON_WIND_LOWER_LIMIT;
|
||
static string FIELD_NITROGEN_WIND_LOWER_LIMIT;
|
||
static string FIELD_ARGON_CHECK_ALARM_PERCENT;
|
||
static string FIELD_NITROGEN_CHECK_ALARM_PERCENT;
|
||
|
||
static string FIELD_PRESSURE_ID;
|
||
static string FIELD_PRESSURE_CODE;
|
||
static string FIELD_PRESSURE_SLOPE;
|
||
static string FIELD_PRESSURE_INTERCEPT;
|
||
static string FIELD_COM_GET_OXYGEN;
|
||
static string FIELD_CHECK_DATA_WHEN_IMPORT;
|
||
static string FIELD_USE_CAMERA;
|
||
static string FIELD_CAMERA_TYPE;
|
||
static string FIELD_IS_CAMERA_COLORFUL;
|
||
static string FIELD_CAMERA_IS_GAIN_AUTO;
|
||
static string FIELD_CAMERA_EXPOSURE_TIME;
|
||
static string FIELD_CAMERA_EXPOSURE_TIME_MIN;
|
||
static string FIELD_CAMERA_EXPOSURE_TIME_MAX;
|
||
static string FIELD_CAMERA_IS_EXPOSURE_AUTO;
|
||
static string FIELD_CAMERA_LOG_RATIO;
|
||
static string FIELD_SHOW_IMAGE_UV0X;
|
||
static string FIELD_SHOW_IMAGE_UV0Y;
|
||
static string FIELD_SHOW_IMAGE_UV1X;
|
||
static string FIELD_SHOW_IMAGE_UV1Y;
|
||
static string FIELD_SHOW_IMAGE_ROTATE_ANGLE;
|
||
static string FIELD_SHOW_IMAGE_SCRALE_X;
|
||
static string FIELD_SHOW_IMAGE_SCRALE_Y;
|
||
static string FIELD_FRAME_RATE_ENABLE;
|
||
static string FIELD_FRAME_RATE;
|
||
static string FIELD_SHOW_IMAGE_ANGLE;
|
||
static string FIELD_USE_SHOW_IMAGE_WARP_PERSPECTIVE;
|
||
static string FIELD_SHOW_IMAGE_TOP_LEFT_X;
|
||
static string FIELD_SHOW_IMAGE_TOP_LEFT_Y;
|
||
static string FIELD_SHOW_IMAGE_TOP_RIGHT_X;
|
||
static string FIELD_SHOW_IMAGE_TOP_RIGHT_Y;
|
||
static string FIELD_SHOW_IMAGE_BOTTOM_LEFT_X;
|
||
static string FIELD_SHOW_IMAGE_BOTTOM_LEFT_Y;
|
||
static string FIELD_SHOW_IMAGE_BOTTOM_RIGHT_X;
|
||
static string FIELD_SHOW_IMAGE_BOTTOM_RIGHT_Y;
|
||
static string FIELD_SHOW_IMAGE_PERSPECTIVE_WIDTH;
|
||
static string FIELD_SHOW_IMAGE_PERSPECTIVE_HEIGH;
|
||
|
||
static string FIELD_MODEL_ENABLE;
|
||
static string FIELD_MODEL_SCAN_MODE;
|
||
static string FIELD_MODEL_SCAN_TYPE;
|
||
static string FIELD_MODEL_LASER_POWER;
|
||
static string FIELD_MODEL_LASER_POWER_MIN;
|
||
static string FIELD_MODEL_LASER_POWER_MAX;
|
||
static string FIELD_MODEL_LASER_SPEED;
|
||
static string FIELD_MODEL_BORDER_TYPE;
|
||
|
||
static const int EXT_LENGTH = 5;
|
||
static string FIELD_FAN_FREQUENCY_SLOPE;
|
||
static string FIELD_FAN_FREQUENCY_INTERCEPT;
|
||
static string FIELD_TEST_EMISSION_TIME;
|
||
static string FIELD_USE_DATA_SEQ;
|
||
|
||
static string FIELD_AUTO_COVER_SLOW_WIND;
|
||
|
||
static string FIELD_OXYGEN1_SENSOR_TYPE;
|
||
static string FIELD_OXYGEN2_SENSOR_TYPE;
|
||
static string FIELD_OUT_OXYGEN_SENSOR_TYPE;
|
||
static string FIELD_HAS_CLEAN_BOX_OXYGEN_SENSOR;
|
||
static string FIELD_CLEAN_BOX_OXYGEN_SENSOR_TYPE;
|
||
|
||
static string FIELD_AFT_LASER_POWER_WAIT_SECOND;
|
||
static string FIELD_AFT_LASER_START_WAIT_SECOND;
|
||
static string FIELD_AFT_LASER_ENABLE_WAIT_SECOND;
|
||
static string FIELD_USE_POWDER_STICK;
|
||
static string FIELD_IS_SUPPLY_ONE_WAY;
|
||
static string FIELD_HEATING_ALARM_PERCENT;
|
||
|
||
static string FIELD_LASER_CHILLER_TYPE;
|
||
static string FIELD_PURIFIER_CHILLER_TYPE;
|
||
static string FIELD_SCAN_POWER_TYPE;
|
||
static string FIELD_LASER_TYPE;
|
||
|
||
const int ARGON_FIT_INDEX = 0;
|
||
const int NITROGEN_FIT_INDEX = 1;
|
||
};
|
||
|
||
|
||
|
||
#pragma pack(1)
|
||
class ExtCfgNew :public Base {
|
||
struct AdcLinear {
|
||
char m_startFlag;
|
||
IntData* id;
|
||
StrData* code;
|
||
FloatData* slope;
|
||
FloatData* intercept;
|
||
char m_endFlag;
|
||
AdcLinear()
|
||
: id(new IntData("id"))
|
||
, code(new StrData("code"))
|
||
, slope(new FloatData("slope"))
|
||
, intercept(new FloatData("intercept"))
|
||
{}
|
||
};
|
||
|
||
struct FanFit
|
||
{
|
||
char m_startFlag;
|
||
StrData* code;
|
||
FloatData* slope;
|
||
FloatData* intercept;
|
||
FloatData* checkWindOffset;
|
||
FloatData* targeWind;
|
||
FloatData* alarmWind;
|
||
FloatData* checkAlarmPercent;
|
||
char m_endFlag;
|
||
FanFit()
|
||
: code(new StrData("code"))
|
||
, slope(new FloatData("slope"))
|
||
, intercept(new FloatData("intercept"))
|
||
, checkWindOffset(new FloatData("checkWindOffset"))
|
||
, targeWind(new FloatData("targeWind"))
|
||
, alarmWind(new FloatData("alarmWind"))
|
||
, checkAlarmPercent(new FloatData("checkAlarmPercent"))
|
||
{}
|
||
};
|
||
|
||
public:
|
||
ExtCfgNew();
|
||
virtual ~ExtCfgNew() {}
|
||
|
||
void GetCfg(ExtCfg& cfg);
|
||
private:
|
||
FanFit m_ArgonFit; //传
|
||
FanFit m_NitrogenFit; //传
|
||
|
||
char m_startFlag;
|
||
IntData* m_SelectedFanWindFit; //传
|
||
BoolData* m_ComGetOxygen;
|
||
BoolData* m_CheckDataWhenInport;
|
||
BoolData* m_UseCamera;
|
||
IntData* m_CameraType;
|
||
BoolData* m_IsCameralColorful;
|
||
BoolData* m_IsExposureAuto;
|
||
BoolData* m_IsGainAuto;
|
||
FloatData* m_ExposureTime;
|
||
FloatData* m_ExposureTimeMin;
|
||
FloatData* m_ExposureTimeMax;
|
||
FloatData* m_LogRatio;
|
||
FloatData* m_ShowImageUV0x;
|
||
FloatData* m_ShowImageUV0y;
|
||
FloatData* m_ShowImageUV1x;
|
||
FloatData* m_ShowImageUV1y;
|
||
IntData* m_ShowImageRotateAngle; //逆时针角度
|
||
FloatData* m_ShowImageScaleX;
|
||
FloatData* m_ShowImageScaleY;
|
||
BoolData* m_FrameRateEnable;
|
||
FloatData* m_FrameRate;
|
||
FloatData* m_ShowImageAngle;
|
||
BoolData* m_UseShowImageWarpPerspective;
|
||
IntData* m_ShowImageTopLeftX;
|
||
IntData* m_ShowImageTopLeftY;
|
||
IntData* m_ShowImageTopRightX;
|
||
IntData* m_ShowImageTopRightY;
|
||
IntData* m_ShowImageBottomLeftX;
|
||
IntData* m_ShowImageBottomLeftY;
|
||
IntData* m_ShowImageBottomRightX;
|
||
IntData* m_ShowImageBottomRightY;
|
||
IntData* m_ShowImagePerspectiveWidth;
|
||
IntData* m_ShowImagePerspectiveHeigh;
|
||
BoolData* m_model_enable;
|
||
IntData* m_model_scan_mode; // 0激光 ,1红光
|
||
StrData* m_model_scan_type; // 0轮廓 ,1实体
|
||
IntData* m_model_scan_part_id;
|
||
IntData* m_model_laser_power;
|
||
IntData* m_model_laser_power_min;
|
||
IntData* m_model_laser_power_max;
|
||
FloatData* m_model_laser_speed;
|
||
IntData* m_model_border_type;
|
||
FloatData* m_FanFrequencySlope; //风机电压转频率
|
||
FloatData* m_FanFrequencyIntercept;
|
||
UIntData* m_TestEmissionTime; //ms
|
||
BoolData* m_UseDataSeq;
|
||
BoolData* m_AutoCoverSlowWind;
|
||
IntData* m_Oxygen1SensorType;
|
||
IntData* m_Oxygen2SensorType;
|
||
IntData* m_OutOxygenSensorType;
|
||
BoolData* m_HasCleanBoxOxygenSensor;
|
||
IntData* m_CleanBoxOxygenSensorType;
|
||
UIntData* m_AftLaserPowerWaitSecond;
|
||
UIntData* m_AftLaserStartWaitSecond;
|
||
UIntData* m_AftLaserEnableWaitSecond;
|
||
BoolData* m_UsePowderStick; //使用料位棒
|
||
BoolData* m_IsSupplyOneWay;
|
||
FloatData* m_HeatingAlarmPercent; //加热温度越限百分比
|
||
IntData* m_LaserChillerType;
|
||
IntData* m_PurifierChillerType;
|
||
IntData* m_ScanPowerType;
|
||
IntData* m_LaserType;
|
||
|
||
char m_endFlag;
|
||
};
|
||
#pragma pack() |