#include "InfraredTempCfg.h" #include "BaseConfig.h" InfraredTempCfg::InfraredTempCfg() : m_IsEnable(new BoolData("IsEnable", u8"")) , m_Emissivity(new IntData("Emissivity", u8"发射率", 9500)) , m_AirTemp(new IntData("AirTemp", u8"空气温度", 250000)) , m_ReflectTemp(new IntData("ReflectTemp", u8"反射温度", 250000)) , m_Humidity(new IntData("Humidity", u8"湿度", 10000)) , m_Distance(new IntData("Distance", u8"距离", 7000)) , m_OSDSwitch(new BoolData("OSDSwitch", u8"叠加开关")) , m_GlobalTempAdd(new BoolData("GlobalTempAdd", u8"全局温度叠加")) , m_GlobalTempParamAdd(new BoolData("GlobalTempParamAdd", u8"全局温度参数叠加")) , m_PseudoColorBarsAdd(new BoolData("PseudoColorBarsAdd", u8"伪彩色带叠加")) , m_HighLowTempCursorAdd(new BoolData("HighLowTempCursorAdd", u8"高低温度游标叠加")) , m_ColorPalette(new IntData("ColorPalette")) , m_GainType(new IntData("GainType")) , m_TempUnit(new IntData("TempUnit")) , m_OverTurn(new IntData("OverTurn")) , m_PlatformAX(new IntData("PlatformAX")) , m_PlatformAY(new IntData("PlatformAY")) , m_PlatformBX(new IntData("PlatformBX", u8"", 630)) , m_PlatformBY(new IntData("PlatformBY")) , m_PlatformCX(new IntData("PlatformCX", u8"",630)) , m_PlatformCY(new IntData("PlatformCY", u8"", 510)) , m_PlatformDX(new IntData("PlatformDX")) , m_PlatformDY(new IntData("PlatformDY", u8"", 510)) , m_ChillDowmTemp(new FloatData("ChillDowmTemp", u8"冷却温度", 200.0f)) , m_TempCtrlType(new IntData("TempCtrlType",u8"", WAIT_TEMP)) , m_DeltaTemp(new FloatData("DeltaTemp", u8"", 5.0f)) , m_DeltaPower(new FloatData("DeltaPower", u8"", 0.5f)) , m_LayerWaitMil(new UIntData("LayerWaitMil")) , m_IsAvgCalcValue(new BoolData("IsAvgCalcValue",u8"使用均值",true)) , m_AvgCalcValueType(new IntData("AvgCalcValueType",u8"均值类型", AVG_5)) , m_UseManualPoints(new BoolData("UseManualPoints")) , m_EmissivityAssist(new FloatData("EmissivityAssist", u8"发射率")) , m_AirTempAssist(new FloatData("AirTempAssist", u8"空气温度")) , m_ReflectTempAssist(new FloatData("ReflectTempAssist", u8"反射温度")) , m_HumidityAssist(new FloatData("HumidityAssist", u8"湿度")) , m_DistanceAssist(new FloatData("DistanceAssist", u8"距离")) , m_IsForceConnect(new BoolData("IsForceConnect")) , m_ForceConnectIP(new StrData("ForceConnectIP",u8"", "192.168.1.29")) , m_szIpAssist(new StrData("szIpAssist",u8"")) { size_t ptrSize = sizeof(nullptr); //指针大小 void* startPtr = &m_startFlag + 1; size_t count = ((size_t)&m_endFlag - (size_t)startPtr) / ptrSize; InsertMp(startPtr, count); } InfraredTempCfg::~InfraredTempCfg() { } void InfraredTempCfg::GetUpdateSql(vector& ups) { char buffer[512]; sprintf_s(buffer, sizeof(buffer), "UPDATE %s set %s=", BaseConfig::TABLE_NAME.c_str(), BaseConfig::FIELD_CONFIG_VALUE.c_str() ); string strhead(buffer); sprintf_s(buffer, sizeof(buffer), " WHERE %s='%s' AND %s=", BaseConfig::FIELD_CONFIG_NAME.c_str(), CONFIG_NAME.c_str(), BaseConfig::FIELD_CONFIG_CODE.c_str() ); string strtail(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), m_IsEnable->GetValue() ? "1" : "0", strtail.c_str(), FIELD_IS_ENABLE.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_Emissivity->GetValue()).c_str(), strtail.c_str(), FIELD_EMISSIVITY.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_AirTemp->GetValue()).c_str(), strtail.c_str(), FIELD_AIR_TEMP.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ReflectTemp->GetValue()).c_str(), strtail.c_str(), FIELD_REFLECT_TEMP.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_Humidity->GetValue()).c_str(), strtail.c_str(), FIELD_HUMIDITY.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_Distance->GetValue()).c_str(), strtail.c_str(), FIELD_DISTANCE.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), m_OSDSwitch->GetValue() ? "1" : "0", strtail.c_str(), FIELD_OSD_SWITCH.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), m_GlobalTempAdd->GetValue() ? "1" : "0", strtail.c_str(), FIELD_GLOBAL_TEMP_ADD.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), m_GlobalTempParamAdd->GetValue() ? "1" : "0", strtail.c_str(), FIELD_GLOBAL_TEMP_PARAM_ADD.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), m_PseudoColorBarsAdd->GetValue() ? "1" : "0", strtail.c_str(), FIELD_PSEUDO_COLOR_BAR_ADD.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), m_HighLowTempCursorAdd->GetValue() ? "1" : "0", strtail.c_str(), FIELD_HIGH_LOW_TEMP_CURSOR_ADD.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ColorPalette->GetValue()).c_str(), strtail.c_str(), FIELD_COLOR_PALETTE.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_GainType->GetValue()).c_str(), strtail.c_str(), FIELD_GAIN_TYPE.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_TempUnit->GetValue()).c_str(), strtail.c_str(), FIELD_TEMP_UNIT.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ChillDowmTemp->GetValue()).c_str(), strtail.c_str(), FIELD_CHILL_DOWN_TEMP.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_TempCtrlType->GetValue()).c_str(), strtail.c_str(), FIELD_SURFACE_TEMP_CTRL_TYPE.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_PlatformAX->GetValue()).c_str(), strtail.c_str(), FIELD_PLATFORM_A_X.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_PlatformAY->GetValue()).c_str(), strtail.c_str(), FIELD_PLATFORM_A_Y.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_PlatformBX->GetValue()).c_str(), strtail.c_str(), FIELD_PLATFORM_B_X.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_PlatformBY->GetValue()).c_str(), strtail.c_str(), FIELD_PLATFORM_B_Y.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_PlatformCX->GetValue()).c_str(), strtail.c_str(), FIELD_PLATFORM_C_X.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_PlatformCY->GetValue()).c_str(), strtail.c_str(), FIELD_PLATFORM_C_Y.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_PlatformDX->GetValue()).c_str(), strtail.c_str(), FIELD_PLATFORM_D_X.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_PlatformDY->GetValue()).c_str(), strtail.c_str(), FIELD_PLATFORM_D_Y.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_DeltaTemp->GetValue()).c_str(), strtail.c_str(), FIELD_DELTA_TEMP.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_DeltaPower->GetValue()).c_str(), strtail.c_str(), FIELD_DELTA_POWER.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_LayerWaitMil->GetValue()).c_str(), strtail.c_str(), FIELD_LAYER_WAIT_MIL.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), m_IsAvgCalcValue->GetValue() ? "1" : "0", strtail.c_str(), FIELD_IS_AVG_CALC_VALUE.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_AvgCalcValueType->GetValue()).c_str(), strtail.c_str(), FIELD_AVG_CALC_VALUE.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), m_IsForceConnect->GetValue() ? "1" : "0", strtail.c_str(), FIELD_IS_FORCE_CONNECT.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), m_UseManualPoints->GetValue() ? "1" : "0", strtail.c_str(), FIELD_USE_MANUAL_POINTS.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), m_ForceConnectIP->GetValueStr().c_str(), strtail.c_str(), FIELD_FORCE_CONNECT_IP.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_OverTurn->GetValue()).c_str(), strtail.c_str(), FIELD_OVER_TURN.c_str()); ups.push_back(buffer); } string InfraredTempCfg::CONFIG_NAME = "InfraredTempCfg"; string InfraredTempCfg::FIELD_IS_ENABLE = "IsEnable"; string InfraredTempCfg::FIELD_EMISSIVITY = "Emissivity"; string InfraredTempCfg::FIELD_AIR_TEMP = "AirTemp"; string InfraredTempCfg::FIELD_REFLECT_TEMP = "ReflectTemp"; string InfraredTempCfg::FIELD_HUMIDITY = "Humidity"; string InfraredTempCfg::FIELD_DISTANCE = "Distance"; string InfraredTempCfg::FIELD_OSD_SWITCH = "OSDSwitch"; string InfraredTempCfg::FIELD_GLOBAL_TEMP_ADD = "GlobalTempAdd"; string InfraredTempCfg::FIELD_GLOBAL_TEMP_PARAM_ADD = "GlobalTempParamAdd"; string InfraredTempCfg::FIELD_PSEUDO_COLOR_BAR_ADD = "PseudoColorBarAdd"; string InfraredTempCfg::FIELD_HIGH_LOW_TEMP_CURSOR_ADD = "HighLowTempCursorAdd"; string InfraredTempCfg::FIELD_COLOR_PALETTE = "ColorPalette"; string InfraredTempCfg::FIELD_GAIN_TYPE = "GainType"; string InfraredTempCfg::FIELD_TEMP_UNIT = "TempUnit"; /*string InfraredTempCfg::FIELD_PLATFORM_START_X="PlatformStartX"; string InfraredTempCfg::FIELD_PLATFORM_START_Y="PlatformStartY"; string InfraredTempCfg::FIELD_PLATFORM_END_X="PlatformEndX"; string InfraredTempCfg::FIELD_PLATFORM_END_Y="PlatformEndY";*/ string InfraredTempCfg::FIELD_CHILL_DOWN_TEMP = "ChilleDownTemp"; string InfraredTempCfg::FIELD_SURFACE_TEMP_CTRL_TYPE = "SurfaceTempCtrlType"; string InfraredTempCfg::FIELD_PLATFORM_A_X = "PlatFormAX"; string InfraredTempCfg::FIELD_PLATFORM_A_Y = "PlatFormAY"; string InfraredTempCfg::FIELD_PLATFORM_B_X = "PlatFormBX"; string InfraredTempCfg::FIELD_PLATFORM_B_Y = "PlatFormBY"; string InfraredTempCfg::FIELD_PLATFORM_C_X = "PlatFormCX"; string InfraredTempCfg::FIELD_PLATFORM_C_Y = "PlatFormCY"; string InfraredTempCfg::FIELD_PLATFORM_D_X = "PlatFormDX"; string InfraredTempCfg::FIELD_PLATFORM_D_Y = "PlatFormDY"; string InfraredTempCfg::FIELD_DELTA_TEMP = "DeltaTemp"; string InfraredTempCfg::FIELD_DELTA_POWER = "DeltaPower"; string InfraredTempCfg::FIELD_LAYER_WAIT_MIL = "LayerWaitMil"; string InfraredTempCfg::FIELD_IS_AVG_CALC_VALUE = "IsAvgCalcValue"; string InfraredTempCfg::FIELD_AVG_CALC_VALUE = "AvgCalcValue"; string InfraredTempCfg::FIELD_IS_FORCE_CONNECT = "IsForceConnect"; string InfraredTempCfg::FIELD_USE_MANUAL_POINTS = "UseManualPoints"; string InfraredTempCfg::FIELD_FORCE_CONNECT_IP = "ForceConnectIP"; string InfraredTempCfg::FIELD_OVER_TURN = "OverTurn";