GrpcPrint/PrintS/Config/bean/InfraredTempCfg.cpp

308 lines
9.3 KiB
C++

#include "InfraredTempCfg.h"
#include "BaseConfig.h"
InfraredTempCfg::InfraredTempCfg()
{
m_Emissivity = 9500;
m_AirTemp = 250000;
m_ReflectTemp = 250000;
m_Humidity = 10000;
m_Distance = 7000;
m_ColorPalette = 0;
/*m_PlatformStartX = 50;
m_PlatformStartY = 50;
m_PlatformEndX = 600;
m_PlatformEndY = 450;*/
m_PlatformAX = 0;
m_PlatformAY = 0;
m_PlatformBX = 630;
m_PlatformBY = 0;
m_PlatformCX = 630;
m_PlatformCY = 510;
m_PlatformDX = 0;
m_PlatformDY = 510;
m_ChillDowmTemp = 200.0f;
m_TempCtrlType = WAIT_TEMP;
m_DeltaTemp = 5.0f;
m_DeltaPower = 0.5f;
m_LayerWaitMil = 0;
m_OverTurn = 0;
m_IsAvgCalcValue = true;
m_AvgCalcValueType = AVG_5;
m_IsForceConnect = false;
m_IsEnable = false;
m_UseManualPoints = false;
m_ForceConnectIP = "192.168.1.29";
memset(m_szIpAssist, '\0', sizeof(m_szIpAssist));
}
InfraredTempCfg::~InfraredTempCfg()
{
}
void InfraredTempCfg::GetUpdateSql(vector<string>& 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 ? "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).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).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).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).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).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 ? "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 ? "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 ? "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 ? "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 ? "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).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).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).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).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).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).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).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).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).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).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).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).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).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).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).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).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 ? "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).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 ? "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 ? "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.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).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";