300 lines
7.4 KiB
C++

#pragma once
#include <map>
#include <string>
#include <vector>
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;
};