diff --git a/.gitignore b/.gitignore index c34c47d..c520363 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ /PrintC/output/Release/*.lib /PrintC/output/Release/*.ini /PrintC/output/Release/*.txt +/PrintC/output/Release/log/* @@ -26,7 +27,7 @@ /PrintS/output/Release/*.lib /PrintS/ProtoCompile/x64/ /PrintS/Protobuf/ProtoCompile.* - +/PrintS/output/Release/log/* /PrintS_.* @@ -43,7 +44,6 @@ /TestClient/output/Release/*.lib /TestClient/ProtoCompile/x64/ /TestClient/Protobuf/ProtoCompile.* - - +/TestClient/output/Release/log/* diff --git a/PrintS/Config/ConfigManager.cpp b/PrintS/Config/ConfigManager.cpp index f2c97c7..80228ab 100644 --- a/PrintS/Config/ConfigManager.cpp +++ b/PrintS/Config/ConfigManager.cpp @@ -462,6 +462,10 @@ void ConfigManager::SendCfgToClients() { m_ExtCfgNew.SetCfg(m_ExtCfg); m_ExtCfgNew.SendToClients(EXTCFGPARAM); + m_RunCfg.SendToClients(RUNCFGPARAM); + m_InfraredTempCfg.SendToClients(INFRAREDTEMPCFGPARAM); + + m_MoldCfg->SendToClients(MOLDCFGPARAM); m_LoadCfg->SendToClients(LOADCFGPARAM); @@ -477,10 +481,14 @@ void ConfigManager::UpdateCfg(const ReadData& rd) { { case PARAMLIMITCFG: m_ParamLimitCfgNew.Update(rd, PARAMLIMITCFGPARAM); - m_ParamLimitCfgNew.UpdateCfg(m_ParamLimitCfg); + m_ParamLimitCfgNew.UpdateCfg(m_ParamLimitCfg); break; case EXTCFG: m_ExtCfgNew.Update(rd, EXTCFGPARAM); - m_ExtCfgNew.UpdateCfg(m_ExtCfg); + m_ExtCfgNew.UpdateCfg(m_ExtCfg); break; + case RUNCFG: + m_RunCfg.Update(rd, RUNCFGPARAM); break; + case INFRAREDTEMPCFG: + m_InfraredTempCfg.Update(rd, INFRAREDTEMPCFGPARAM); break; default: break; } diff --git a/PrintS/Config/ConfigManager.h b/PrintS/Config/ConfigManager.h index 5dfeec4..f50183d 100644 --- a/PrintS/Config/ConfigManager.h +++ b/PrintS/Config/ConfigManager.h @@ -41,7 +41,7 @@ using namespace std; enum ConfigFunc{ SAVECONFIG =0, SAVEMACHINECONFIG, - + DELETEMACHINEIO, }; diff --git a/PrintS/Config/bean/InfraredTempCfg.cpp b/PrintS/Config/bean/InfraredTempCfg.cpp index b5f2687..5345055 100644 --- a/PrintS/Config/bean/InfraredTempCfg.cpp +++ b/PrintS/Config/bean/InfraredTempCfg.cpp @@ -3,49 +3,50 @@ 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"")) { - 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)); + size_t ptrSize = sizeof(nullptr); //指针大小 + void* startPtr = &m_startFlag + 1; + size_t count = ((size_t)&m_endFlag - (size_t)startPtr) / ptrSize; + InsertMp(startPtr, count); } @@ -71,199 +72,199 @@ void InfraredTempCfg::GetUpdateSql(vector& ups) sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), - m_IsEnable ? "1" : "0", + 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).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).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).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).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).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 ? "1" : "0", + 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 ? "1" : "0", + 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 ? "1" : "0", + 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 ? "1" : "0", + 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 ? "1" : "0", + 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).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).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).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).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).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).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).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).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).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).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).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).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).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).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).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).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 ? "1" : "0", + 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).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 ? "1" : "0", + 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 ? "1" : "0", + 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.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).c_str(), + to_string(m_OverTurn->GetValue()).c_str(), strtail.c_str(), FIELD_OVER_TURN.c_str()); ups.push_back(buffer); } diff --git a/PrintS/Config/bean/InfraredTempCfg.h b/PrintS/Config/bean/InfraredTempCfg.h index cf2d4ed..f416380 100644 --- a/PrintS/Config/bean/InfraredTempCfg.h +++ b/PrintS/Config/bean/InfraredTempCfg.h @@ -1,10 +1,11 @@ #pragma once #include #include - +#include "../Controller/Base.h" using namespace std; -class InfraredTempCfg +#pragma pack(1) +class InfraredTempCfg : public Base { public: enum SurfaceTempCtrlType @@ -26,59 +27,62 @@ public: void GetUpdateSql(vector& ups); public: - bool m_IsEnable; - int m_Emissivity; //发射率 - int m_AirTemp; //空气温度 - int m_ReflectTemp; //反射温度 - int m_Humidity; //湿度 - int m_Distance; //距离 - bool m_OSDSwitch; //叠加开关 - bool m_GlobalTempAdd; //全局温度叠加 - bool m_GlobalTempParamAdd; //全局温度参数叠加 - bool m_PseudoColorBarsAdd; //伪彩色带叠加 - bool m_HighLowTempCursorAdd; //高低温度游标叠加 + char m_startFlag; //开始标记 + BoolData* m_IsEnable; + IntData* m_Emissivity; //发射率 + IntData* m_AirTemp; //空气温度 + IntData* m_ReflectTemp; //反射温度 + IntData* m_Humidity; //湿度 + IntData* m_Distance; //距离 + BoolData* m_OSDSwitch; //叠加开关 + BoolData* m_GlobalTempAdd; //全局温度叠加 + BoolData* m_GlobalTempParamAdd; //全局温度参数叠加 + BoolData* m_PseudoColorBarsAdd; //伪彩色带叠加 + BoolData* m_HighLowTempCursorAdd; //高低温度游标叠加 - int m_ColorPalette; //色板模式 - int m_GainType; //增益方式 - int m_TempUnit; //温度单位 - int m_OverTurn; //翻转方式 + IntData* m_ColorPalette; //色板模式 + IntData* m_GainType; //增益方式 + IntData* m_TempUnit; //温度单位 + IntData* m_OverTurn; //翻转方式 - int m_PlatformAX; - int m_PlatformAY; + IntData* m_PlatformAX; + IntData* m_PlatformAY; - int m_PlatformBX; - int m_PlatformBY; + IntData* m_PlatformBX; + IntData* m_PlatformBY; - int m_PlatformCX; - int m_PlatformCY; + IntData* m_PlatformCX; + IntData* m_PlatformCY; - int m_PlatformDX; - int m_PlatformDY; + IntData* m_PlatformDX; + IntData* m_PlatformDY; - float m_ChillDowmTemp; // 冷却温度 - int m_TempCtrlType; + FloatData* m_ChillDowmTemp; // 冷却温度 + IntData* m_TempCtrlType; //bool m_WaitChillDownEnable; //开启等待冷却温度 - float m_DeltaTemp; - float m_DeltaPower; + FloatData* m_DeltaTemp; + FloatData* m_DeltaPower; //float m_TempPowerSlope; //float m_TempPowerIntercept; - unsigned int m_LayerWaitMil; + UIntData* m_LayerWaitMil; - bool m_IsAvgCalcValue; //使用均值 - int m_AvgCalcValueType; //均值类型 - bool m_UseManualPoints; + BoolData* m_IsAvgCalcValue; //使用均值 + IntData* m_AvgCalcValueType; //均值类型 + BoolData* m_UseManualPoints; - float m_EmissivityAssist; //发射率 - float m_AirTempAssist; //空气温度 - float m_ReflectTempAssist; //反射温度 - float m_HumidityAssist; //湿度 - float m_DistanceAssist; //距离 - bool m_IsForceConnect; + FloatData* m_EmissivityAssist; //发射率 + FloatData* m_AirTempAssist; //空气温度 + FloatData* m_ReflectTempAssist; //反射温度 + FloatData* m_HumidityAssist; //湿度 + FloatData* m_DistanceAssist; //距离 + BoolData* m_IsForceConnect; - string m_ForceConnectIP; - char m_szIpAssist[16]; + StrData* m_ForceConnectIP; + StrData* m_szIpAssist; + + char m_endFlag; //结束标记 public: static string CONFIG_NAME; static string FIELD_IS_ENABLE; @@ -119,4 +123,4 @@ public: static string FIELD_FORCE_CONNECT_IP; static string FIELD_OVER_TURN; }; - +#pragma pack() diff --git a/PrintS/Config/bean/RunCfg.cpp b/PrintS/Config/bean/RunCfg.cpp index 72a8749..ba42c98 100644 --- a/PrintS/Config/bean/RunCfg.cpp +++ b/PrintS/Config/bean/RunCfg.cpp @@ -21,7 +21,6 @@ RunCfg::RunCfg() , m_LogPersistInteval(new UIntData("LogPersistInteval", u8"日志间隔记录", 10000)) , m_StatisticsInteval(new UIntData("StatisticsInteval", u8"系统统计间隔", 10000)) , m_OffsetRotateEnable(new BoolData("OffsetRotateEnable", u8"", true)) - , m_StableWindStep(new FloatData("StableWindStep", u8"风稳电压步进值", 0.05f)) , m_SSRTimeLimit(new UIntData("SSRTimeLimit", u8"基板加热输入输出不同步时间 ms", 300)) , m_SSRTimeLimitMin(new UIntData("SSRTimeLimitMin", u8"", 100)) @@ -36,7 +35,6 @@ RunCfg::RunCfg() , m_IsAutoReleasePressureWhenFinish(new BoolData("IsAutoReleasePressureWhenFinish", u8"打印完成后是否自动泄压")) , m_ReleasePressureSeconds(new UIntData("ReleasePressureSeconds", u8"泄压秒数", 120)) , m_ReleasePressureTargeValue(new FloatData("ReleasePressureTargeValue", u8"泄压目标值", 0.5f)) - , m_PrintRestEnable(new BoolData("PrintRestEnable", u8"打印停歇")) , m_PrintContinueMinute(new UIntData("PrintContinueMinute", u8"持续打印分钟", 120)) , m_PrintRestMinutes(new UIntData("PrintRestMinutes", u8"停歇分钟", 30)) @@ -52,7 +50,6 @@ RunCfg::RunCfg() , m_VoltageAlarmOffset(new FloatData("VoltageAlarmOffset", u8"电源电压报警偏差", 10.0f)) , m_ScannerPowerLogTick(new UIntData("ScannerPowerLogTick", u8"",500)) , m_ScannerPowerLogCount(new UIntData("ScannerPowerLogCount", u8"",50)) - , m_ScannerVoltageMinLimit(new FloatData("ScannerVoltageMinLimit", u8"振镜电压下限", 28.0f)) , m_ScannerVoltageMaxLimit(new FloatData("ScannerVoltageMaxLimit", u8"振镜电压上限", 32.0f)) , m_PrintAutoRenewalGas(new BoolData("PrintAutoRenewalGas", u8"打印自动换气")) @@ -68,7 +65,6 @@ RunCfg::RunCfg() , m_CoverWindSimulateTimeOffset(new DoubleData("CoverWindSimulateTimeOffset", u8"", 10000.0)) , m_LogDebugInfo(new BoolData("LogDebugInfo", u8"")) , m_AutoShutdownPower(new BoolData("AutoShutdownPower", u8"")) - , m_FilterOxygenAlarmValue(new FloatData("FilterOxygenAlarmValue", u8"", 0.5f)) , m_FanFreqLowLimit(new FloatData("FanFreqLowLimit", u8"", 5.0f)) , m_PrintLayerDelay(new UIntData("PrintLayerDelay", u8"")) @@ -91,6 +87,11 @@ RunCfg::RunCfg() , m_HeatingDisconnectAlarmJudgeSecond(new UIntData("HeatingDisconnectAlarmJudgeSecond", u8"",20)) , m_ChillerDisconnectAlarmJudgeSecond(new UIntData("ChillerDisconnectAlarmJudgeSecond", u8"",20)) { + size_t ptrSize = sizeof(nullptr); //指针大小 + void* startPtr = &m_startFlag + 1; + size_t count = ((size_t)&m_endFlag - (size_t)startPtr) / ptrSize; + InsertMp(startPtr, count); + /*m_IsDebugMode = false; m_TargeOxygen = 1000.0f; m_WarnOxygen = 2000.0f; @@ -193,12 +194,12 @@ RunCfg::RunCfg() m_OxygenSensorDisconnectAlarmJudgeSecond = 20; m_HeatingDisconnectAlarmJudgeSecond = 20; m_ChillerDisconnectAlarmJudgeSecond = 20;*/ - InitializeCriticalSection(&m_CS); + //InitializeCriticalSection(&m_CS); } RunCfg::~RunCfg() { - DeleteCriticalSection(&m_CS); + //DeleteCriticalSection(&m_CS); } diff --git a/PrintS/Config/bean/RunCfg.h b/PrintS/Config/bean/RunCfg.h index a85a2b5..fec2531 100644 --- a/PrintS/Config/bean/RunCfg.h +++ b/PrintS/Config/bean/RunCfg.h @@ -21,52 +21,59 @@ public: void GetUpdateSql(vector& ups); void SetOxygenTargeValue(float to) { - EnterCriticalSection(&m_CS); + //EnterCriticalSection(&m_CS); + //m_TargeOxygen->SetValue(to); + //LeaveCriticalSection(&m_CS); + + std::unique_lock lck(m_mtx); //写锁 m_TargeOxygen->SetValue(to); - LeaveCriticalSection(&m_CS); } float GetOxygenTargeValue() { - float fv = 0.0f; - EnterCriticalSection(&m_CS); - fv = m_TargeOxygen->GetValue(); - LeaveCriticalSection(&m_CS); - return fv; + //float fv = 0.0f; + //EnterCriticalSection(&m_CS); + //fv = m_TargeOxygen->GetValue(); + //LeaveCriticalSection(&m_CS); + //return fv; + + std::shared_lock lck(m_mtx); //读锁 + return m_TargeOxygen->GetValue(); } void SetOxygenAlarmValue(float to) { - EnterCriticalSection(&m_CS); + //EnterCriticalSection(&m_CS); + //m_AlarmOxygen->SetValue(to); + //LeaveCriticalSection(&m_CS); + + std::unique_lock lck(m_mtx); //写锁 m_AlarmOxygen->SetValue(to); - LeaveCriticalSection(&m_CS); } void SetOxygenWarnValue(float to) { - EnterCriticalSection(&m_CS); + //EnterCriticalSection(&m_CS); + //m_WarnOxygen->SetValue(to); + //LeaveCriticalSection(&m_CS); + + std::unique_lock lck(m_mtx); //写锁 m_WarnOxygen->SetValue(to); - LeaveCriticalSection(&m_CS); } float GetOxygenAlarmValue() { - float fv = 0.0f; - EnterCriticalSection(&m_CS); - fv = m_AlarmOxygen->GetValue(); - LeaveCriticalSection(&m_CS); - return fv; + std::shared_lock lck(m_mtx); //读锁 + return m_AlarmOxygen->GetValue(); } float GetOxygenWarnValue() { - float fv = 0.0f; - EnterCriticalSection(&m_CS); - fv = m_WarnOxygen->GetValue(); - LeaveCriticalSection(&m_CS); - return fv; + std::shared_lock lck(m_mtx); //读锁 + return m_WarnOxygen->GetValue(); } public: + char m_startFlag; //开始标记 BoolData* m_IsDebugMode; FloatData* m_TargeOxygen; //目标氧 FloatData* m_WarnOxygen; //预警氧 @@ -186,6 +193,8 @@ public: UIntData* m_OxygenSensorDisconnectAlarmJudgeSecond; UIntData* m_HeatingDisconnectAlarmJudgeSecond; UIntData* m_ChillerDisconnectAlarmJudgeSecond; + + char m_endFlag; //结束标记 public: static const string CONFIG_NAME; static const string FIELD_IS_DEBUG_MODE; @@ -277,7 +286,7 @@ public: static const string FIELD_OXYGEN_SENSOR_DISCONNECT_ALARM_JUDGE_SECOND; static const string FIELD_HEATING_DISCONNECT_ALARM_JUDGE_SECOND; static const string FIELD_CHILLER_DISCONNECT_ALARM_JUDGE_SECOND; -private: - CRITICAL_SECTION m_CS; +//private: +// CRITICAL_SECTION m_CS; }; #pragma pack() diff --git a/PrintS/Config/dao/BaseConfigDao.cpp b/PrintS/Config/dao/BaseConfigDao.cpp index 425e038..9631520 100644 --- a/PrintS/Config/dao/BaseConfigDao.cpp +++ b/PrintS/Config/dao/BaseConfigDao.cpp @@ -2915,7 +2915,7 @@ void BaseConfigDao::FindInfraredTempCfg(InfraredTempCfg& cfg) vector needins; if (valuemap.find(InfraredTempCfg::FIELD_IS_ENABLE) != valuemap.end()) { - cfg.m_IsEnable = (stoi(valuemap[InfraredTempCfg::FIELD_IS_ENABLE]) > 0 ? true : false); + cfg.m_IsEnable->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_IS_ENABLE]) > 0 ? true : false); } else { sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_IS_ENABLE.c_str(), cfg.m_IsEnable ? "1" : "0"); @@ -2923,106 +2923,106 @@ void BaseConfigDao::FindInfraredTempCfg(InfraredTempCfg& cfg) } if (valuemap.find(InfraredTempCfg::FIELD_EMISSIVITY) != valuemap.end()) { - cfg.m_Emissivity = stoi(valuemap[InfraredTempCfg::FIELD_EMISSIVITY]); + cfg.m_Emissivity->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_EMISSIVITY])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_EMISSIVITY.c_str(), to_string(cfg.m_Emissivity).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_EMISSIVITY.c_str(), to_string(cfg.m_Emissivity->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_AIR_TEMP) != valuemap.end()) { - cfg.m_AirTemp = stoi(valuemap[InfraredTempCfg::FIELD_AIR_TEMP]); + cfg.m_AirTemp->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_AIR_TEMP])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_AIR_TEMP.c_str(), to_string(cfg.m_AirTemp).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_AIR_TEMP.c_str(), to_string(cfg.m_AirTemp->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_REFLECT_TEMP) != valuemap.end()) { - cfg.m_ReflectTemp = stoi(valuemap[InfraredTempCfg::FIELD_REFLECT_TEMP]); + cfg.m_ReflectTemp->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_REFLECT_TEMP])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_REFLECT_TEMP.c_str(), to_string(cfg.m_ReflectTemp).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_REFLECT_TEMP.c_str(), to_string(cfg.m_ReflectTemp->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_HUMIDITY) != valuemap.end()) { - cfg.m_Humidity = stoi(valuemap[InfraredTempCfg::FIELD_HUMIDITY]); + cfg.m_Humidity->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_HUMIDITY])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_HUMIDITY.c_str(), to_string(cfg.m_Humidity).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_HUMIDITY.c_str(), to_string(cfg.m_Humidity->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_DISTANCE) != valuemap.end()) { - cfg.m_Distance = stoi(valuemap[InfraredTempCfg::FIELD_DISTANCE]); + cfg.m_Distance->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_DISTANCE])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_DISTANCE.c_str(), to_string(cfg.m_Distance).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_DISTANCE.c_str(), to_string(cfg.m_Distance->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_OSD_SWITCH) != valuemap.end()) { - cfg.m_OSDSwitch = (stoi(valuemap[InfraredTempCfg::FIELD_OSD_SWITCH]) > 0 ? true : false); + cfg.m_OSDSwitch->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_OSD_SWITCH]) > 0 ? true : false); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_OSD_SWITCH.c_str(), cfg.m_OSDSwitch ? "1" : "0"); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_OSD_SWITCH.c_str(), cfg.m_OSDSwitch->GetValue() ? "1" : "0"); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_GLOBAL_TEMP_ADD) != valuemap.end()) { - cfg.m_GlobalTempAdd = (stoi(valuemap[InfraredTempCfg::FIELD_GLOBAL_TEMP_ADD]) > 0 ? true : false); + cfg.m_GlobalTempAdd->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_GLOBAL_TEMP_ADD]) > 0 ? true : false); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_GLOBAL_TEMP_ADD.c_str(), cfg.m_GlobalTempAdd ? "1" : "0"); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_GLOBAL_TEMP_ADD.c_str(), cfg.m_GlobalTempAdd->GetValue() ? "1" : "0"); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_GLOBAL_TEMP_PARAM_ADD) != valuemap.end()) { - cfg.m_GlobalTempParamAdd = (stoi(valuemap[InfraredTempCfg::FIELD_GLOBAL_TEMP_PARAM_ADD]) > 0 ? true : false); + cfg.m_GlobalTempParamAdd->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_GLOBAL_TEMP_PARAM_ADD]) > 0 ? true : false); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_GLOBAL_TEMP_PARAM_ADD.c_str(), cfg.m_GlobalTempParamAdd ? "1" : "0"); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_GLOBAL_TEMP_PARAM_ADD.c_str(), cfg.m_GlobalTempParamAdd->GetValue() ? "1" : "0"); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_PSEUDO_COLOR_BAR_ADD) != valuemap.end()) { - cfg.m_PseudoColorBarsAdd = (stoi(valuemap[InfraredTempCfg::FIELD_PSEUDO_COLOR_BAR_ADD]) > 0 ? true : false); + cfg.m_PseudoColorBarsAdd->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_PSEUDO_COLOR_BAR_ADD]) > 0 ? true : false); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PSEUDO_COLOR_BAR_ADD.c_str(), cfg.m_PseudoColorBarsAdd ? "1" : "0"); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PSEUDO_COLOR_BAR_ADD.c_str(), cfg.m_PseudoColorBarsAdd->GetValue() ? "1" : "0"); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_HIGH_LOW_TEMP_CURSOR_ADD) != valuemap.end()) { - cfg.m_HighLowTempCursorAdd = (stoi(valuemap[InfraredTempCfg::FIELD_HIGH_LOW_TEMP_CURSOR_ADD]) > 0 ? true : false); + cfg.m_HighLowTempCursorAdd->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_HIGH_LOW_TEMP_CURSOR_ADD]) > 0 ? true : false); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_HIGH_LOW_TEMP_CURSOR_ADD.c_str(), cfg.m_HighLowTempCursorAdd ? "1" : "0"); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_HIGH_LOW_TEMP_CURSOR_ADD.c_str(), cfg.m_HighLowTempCursorAdd->GetValue() ? "1" : "0"); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_GAIN_TYPE) != valuemap.end()) { - cfg.m_GainType = stoi(valuemap[InfraredTempCfg::FIELD_GAIN_TYPE]); + cfg.m_GainType->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_GAIN_TYPE])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_GAIN_TYPE.c_str(), to_string(cfg.m_GainType).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_GAIN_TYPE.c_str(), to_string(cfg.m_GainType->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_COLOR_PALETTE) != valuemap.end()) { - cfg.m_ColorPalette = stoi(valuemap[InfraredTempCfg::FIELD_COLOR_PALETTE]); + cfg.m_ColorPalette->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_COLOR_PALETTE])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_COLOR_PALETTE.c_str(), to_string(cfg.m_ColorPalette).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_COLOR_PALETTE.c_str(), to_string(cfg.m_ColorPalette->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_TEMP_UNIT) != valuemap.end()) { - cfg.m_TempUnit = stoi(valuemap[InfraredTempCfg::FIELD_TEMP_UNIT]); + cfg.m_TempUnit->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_TEMP_UNIT])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_TEMP_UNIT.c_str(), to_string(cfg.m_TempUnit).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_TEMP_UNIT.c_str(), to_string(cfg.m_TempUnit->GetValue()).c_str()); needins.push_back(buffer); } @@ -3059,154 +3059,154 @@ void BaseConfigDao::FindInfraredTempCfg(InfraredTempCfg& cfg) }*/ if (valuemap.find(InfraredTempCfg::FIELD_CHILL_DOWN_TEMP) != valuemap.end()) { - cfg.m_ChillDowmTemp = stof(valuemap[InfraredTempCfg::FIELD_CHILL_DOWN_TEMP]); + cfg.m_ChillDowmTemp->SetValue(stof(valuemap[InfraredTempCfg::FIELD_CHILL_DOWN_TEMP])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_CHILL_DOWN_TEMP.c_str(), to_string(cfg.m_ChillDowmTemp).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_CHILL_DOWN_TEMP.c_str(), to_string(cfg.m_ChillDowmTemp->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_SURFACE_TEMP_CTRL_TYPE) != valuemap.end()) { - cfg.m_TempCtrlType = stoi(valuemap[InfraredTempCfg::FIELD_SURFACE_TEMP_CTRL_TYPE]); + cfg.m_TempCtrlType->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_SURFACE_TEMP_CTRL_TYPE])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_SURFACE_TEMP_CTRL_TYPE.c_str(), to_string(cfg.m_TempCtrlType).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_SURFACE_TEMP_CTRL_TYPE.c_str(), to_string(cfg.m_TempCtrlType->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_PLATFORM_A_X) != valuemap.end()) { - cfg.m_PlatformAX = stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_A_X]); + cfg.m_PlatformAX->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_A_X])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_A_X.c_str(), to_string(cfg.m_PlatformAX).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_A_X.c_str(), to_string(cfg.m_PlatformAX->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_PLATFORM_A_Y) != valuemap.end()) { - cfg.m_PlatformAY = stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_A_Y]); + cfg.m_PlatformAY->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_A_Y])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_A_Y.c_str(), to_string(cfg.m_PlatformAY).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_A_Y.c_str(), to_string(cfg.m_PlatformAY->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_PLATFORM_B_X) != valuemap.end()) { - cfg.m_PlatformBX = stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_B_X]); + cfg.m_PlatformBX->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_B_X])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_B_X.c_str(), to_string(cfg.m_PlatformBX).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_B_X.c_str(), to_string(cfg.m_PlatformBX->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_PLATFORM_B_Y) != valuemap.end()) { - cfg.m_PlatformBY = stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_B_Y]); + cfg.m_PlatformBY->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_B_Y])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_B_Y.c_str(), to_string(cfg.m_PlatformBY).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_B_Y.c_str(), to_string(cfg.m_PlatformBY->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_PLATFORM_C_X) != valuemap.end()) { - cfg.m_PlatformCX = stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_C_X]); + cfg.m_PlatformCX->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_C_X])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_C_X.c_str(), to_string(cfg.m_PlatformCX).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_C_X.c_str(), to_string(cfg.m_PlatformCX->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_PLATFORM_C_Y) != valuemap.end()) { - cfg.m_PlatformCY = stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_C_Y]); + cfg.m_PlatformCY->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_C_Y])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_C_Y.c_str(), to_string(cfg.m_PlatformCY).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_C_Y.c_str(), to_string(cfg.m_PlatformCY->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_PLATFORM_D_X) != valuemap.end()) { - cfg.m_PlatformDX = stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_D_X]); + cfg.m_PlatformDX->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_D_X])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_D_X.c_str(), to_string(cfg.m_PlatformDX).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_D_X.c_str(), to_string(cfg.m_PlatformDX->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_PLATFORM_D_Y) != valuemap.end()) { - cfg.m_PlatformDY = stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_D_Y]); + cfg.m_PlatformDY->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_PLATFORM_D_Y])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_D_Y.c_str(), to_string(cfg.m_PlatformDY).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_PLATFORM_D_Y.c_str(), to_string(cfg.m_PlatformDY->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_DELTA_TEMP) != valuemap.end()) { - cfg.m_DeltaTemp = stof(valuemap[InfraredTempCfg::FIELD_DELTA_TEMP]); + cfg.m_DeltaTemp->SetValue(stof(valuemap[InfraredTempCfg::FIELD_DELTA_TEMP])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_DELTA_TEMP.c_str(), to_string(cfg.m_DeltaTemp).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_DELTA_TEMP.c_str(), to_string(cfg.m_DeltaTemp->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_DELTA_POWER) != valuemap.end()) { - cfg.m_DeltaPower = stof(valuemap[InfraredTempCfg::FIELD_DELTA_POWER]); + cfg.m_DeltaPower->SetValue(stof(valuemap[InfraredTempCfg::FIELD_DELTA_POWER])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_DELTA_POWER.c_str(), to_string(cfg.m_DeltaPower).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_DELTA_POWER.c_str(), to_string(cfg.m_DeltaPower->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_LAYER_WAIT_MIL) != valuemap.end()) { - cfg.m_LayerWaitMil = stoul(valuemap[InfraredTempCfg::FIELD_LAYER_WAIT_MIL]); + cfg.m_LayerWaitMil->SetValue(stoul(valuemap[InfraredTempCfg::FIELD_LAYER_WAIT_MIL])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_LAYER_WAIT_MIL.c_str(), to_string(cfg.m_LayerWaitMil).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_LAYER_WAIT_MIL.c_str(), to_string(cfg.m_LayerWaitMil->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_IS_AVG_CALC_VALUE) != valuemap.end()) { - cfg.m_IsAvgCalcValue = (stoi(valuemap[InfraredTempCfg::FIELD_IS_AVG_CALC_VALUE]) > 0 ? true : false); + cfg.m_IsAvgCalcValue->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_IS_AVG_CALC_VALUE]) > 0 ? true : false); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_IS_AVG_CALC_VALUE.c_str(), cfg.m_IsAvgCalcValue ? "1" : "0"); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_IS_AVG_CALC_VALUE.c_str(), cfg.m_IsAvgCalcValue->GetValue() ? "1" : "0"); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_AVG_CALC_VALUE) != valuemap.end()) { - cfg.m_AvgCalcValueType = stoi(valuemap[InfraredTempCfg::FIELD_AVG_CALC_VALUE]); + cfg.m_AvgCalcValueType->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_AVG_CALC_VALUE])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_AVG_CALC_VALUE.c_str(), to_string(cfg.m_AvgCalcValueType).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_AVG_CALC_VALUE.c_str(), to_string(cfg.m_AvgCalcValueType->GetValue()).c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_IS_FORCE_CONNECT) != valuemap.end()) { - cfg.m_IsForceConnect = (stoi(valuemap[InfraredTempCfg::FIELD_IS_FORCE_CONNECT]) > 0 ? true : false); + cfg.m_IsForceConnect->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_IS_FORCE_CONNECT]) > 0 ? true : false); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_IS_FORCE_CONNECT.c_str(), cfg.m_IsForceConnect ? "1" : "0"); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_IS_FORCE_CONNECT.c_str(), cfg.m_IsForceConnect->GetValue() ? "1" : "0"); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_USE_MANUAL_POINTS) != valuemap.end()) { - cfg.m_UseManualPoints = (stoi(valuemap[InfraredTempCfg::FIELD_USE_MANUAL_POINTS]) > 0 ? true : false); + cfg.m_UseManualPoints->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_USE_MANUAL_POINTS]) > 0 ? true : false); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_USE_MANUAL_POINTS.c_str(), cfg.m_UseManualPoints ? "1" : "0"); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_USE_MANUAL_POINTS.c_str(), cfg.m_UseManualPoints->GetValue() ? "1" : "0"); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_FORCE_CONNECT_IP) != valuemap.end()) { - cfg.m_ForceConnectIP = valuemap[InfraredTempCfg::FIELD_FORCE_CONNECT_IP]; + cfg.m_ForceConnectIP->SetValue(valuemap[InfraredTempCfg::FIELD_FORCE_CONNECT_IP]); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_FORCE_CONNECT_IP.c_str(), cfg.m_ForceConnectIP.c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_FORCE_CONNECT_IP.c_str(), cfg.m_ForceConnectIP->GetValueStr().c_str()); needins.push_back(buffer); } if (valuemap.find(InfraredTempCfg::FIELD_OVER_TURN) != valuemap.end()) { - cfg.m_OverTurn = stoi(valuemap[InfraredTempCfg::FIELD_OVER_TURN]); + cfg.m_OverTurn ->SetValue(stoi(valuemap[InfraredTempCfg::FIELD_OVER_TURN])); } else { - sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_OVER_TURN.c_str(), to_string(cfg.m_OverTurn).c_str()); + sprintf_s(buffer, sizeof(buffer), strsql.c_str(), InfraredTempCfg::FIELD_OVER_TURN.c_str(), to_string(cfg.m_OverTurn->GetValue()).c_str()); needins.push_back(buffer); } diff --git a/PrintS/Controller/Base.h b/PrintS/Controller/Base.h index 5b465e4..7503d6b 100644 --- a/PrintS/Controller/Base.h +++ b/PrintS/Controller/Base.h @@ -52,7 +52,7 @@ public: } - void Update(const ReadData& rd, WRITETYPE type) { + void Update(const ReadData& rd, WRITETYPE type = DEFAULT) { if (m_baseMp.find(rd.nameKey) != m_baseMp.end()) { std::unique_lock lock(m_mtx); @@ -77,12 +77,15 @@ public: else if (rd.valueType == iSTRING) { m_baseMp[rd.nameKey]->SetValue(rd.strValue); } + else if (rd.valueType == iDOUBLE) { + m_baseMp[rd.nameKey]->SetValue(ConverType::TryToD(rd.strValue)); + } } else { printf("error, %s do not find...", rd.nameKey.c_str()); } - SendToClients(type); //客户端更新后在发送给客户端 + if(type != DEFAULT) SendToClients(type); //客户端更新后在发送给客户端 } diff --git a/PrintS/Controller/Controller.cpp b/PrintS/Controller/Controller.cpp index 331bcf6..f9283ed 100644 --- a/PrintS/Controller/Controller.cpp +++ b/PrintS/Controller/Controller.cpp @@ -179,7 +179,6 @@ void Controller::StartSend() { m_Camera->SendToClients(); count = 0; } - this_thread::sleep_for(std::chrono::milliseconds(250)); } diff --git a/PrintS/DataManage/DataHandle.cpp b/PrintS/DataManage/DataHandle.cpp index 7a28e84..de8097c 100644 --- a/PrintS/DataManage/DataHandle.cpp +++ b/PrintS/DataManage/DataHandle.cpp @@ -118,7 +118,12 @@ void DataHandle::DataCallBackHandle(const ReadData& msg) { m_controller->m_Camera->Update(msg); break; case PURIFIERFUNC: m_controller->m_Purifier->CallFunc(msg); break; - + case RUNCFG: + ConfigManager::GetInstance()->GetRunCfg()->Update(msg, RUNCFGPARAM); + break; + case INFRAREDTEMPCFG: + ConfigManager::GetInstance()->GetInfraredTempCfg()->Update(msg, INFRAREDTEMPCFGPARAM); + break; case REQUEST: if (msg.nameKey == "36") { printf("error,36 需要释放ScannerCtrl::Init()内部代码块...\n"); diff --git a/PrintS/DataManage/RWData.h b/PrintS/DataManage/RWData.h index acdf4cc..689785f 100644 --- a/PrintS/DataManage/RWData.h +++ b/PrintS/DataManage/RWData.h @@ -4,7 +4,7 @@ #include enum READTYPE { - AXISMOVEFUNC=0, //轴运动函数 + AXISMOVEFUNC = 0, //轴运动函数 VERSIONREQ, //获取版本信息 @@ -23,12 +23,14 @@ enum READTYPE { /********************配置信息******************/ PARAMLIMITCFG, EXTCFG, + RUNCFG, + INFRAREDTEMPCFG, LOADPARAM, //装载参数 SCANCTRLFUNC, //振镜控制函数 - REQUEST, //获取配置信息 test用 + REQUEST=100, //获取配置信息 test用 }; enum DATATYPE { @@ -91,6 +93,8 @@ enum WRITETYPE { /********************配置信息******************/ PARAMLIMITCFGPARAM, //paramlimit配置参数 EXTCFGPARAM, + RUNCFGPARAM, //runcfg 参数 + INFRAREDTEMPCFGPARAM, //InfraredTempCfg 参数 MOLDCFGPARAM, LOADCFGPARAM, @@ -105,7 +109,8 @@ enum WRITETYPE { SCANCTRLPARAM, //scanctrl参数 XYSCANSTATE, //XYScanState参数 在参数更新的时候才会发送到客户端 CAMERAPARAM, //相机参数 - + + DEFAULT = 900, //默认值 TEST = 1000, //test }; diff --git a/PrintS/ScannerCtrl/ScannerCtrl.cpp b/PrintS/ScannerCtrl/ScannerCtrl.cpp index 6fc3cc0..20e079c 100644 --- a/PrintS/ScannerCtrl/ScannerCtrl.cpp +++ b/PrintS/ScannerCtrl/ScannerCtrl.cpp @@ -849,13 +849,13 @@ void ScannerCtrl::DispatchDataBlock() log.m_Temps.push_back(itPair); } - if (m_InfraredTempCfg->m_TempCtrlType == InfraredTempCfg::WAIT_TEMP) { + if (m_InfraredTempCfg->m_TempCtrlType->GetValue() == InfraredTempCfg::WAIT_TEMP) { while (IsStart()) { if (!m_InfraredTemp->IsOverChillDown()) { break; } - if (m_InfraredTempCfg->m_TempCtrlType != InfraredTempCfg::WAIT_TEMP) + if (m_InfraredTempCfg->m_TempCtrlType->GetValue() != InfraredTempCfg::WAIT_TEMP) { break; } @@ -1029,7 +1029,7 @@ void ScannerCtrl::DispatchDataBlock() } } m_InfraredTemp->ResetPrintMax(); - if (m_InfraredTempCfg->m_TempCtrlType == InfraredTempCfg::COVERED_WAIT) { + if (m_InfraredTempCfg->m_TempCtrlType->GetValue() == InfraredTempCfg::COVERED_WAIT) { m_InfraredTemp->ResetWaitFlag(); } } diff --git a/PrintS/additional/InfraredTemp/InfraredTemp.cpp b/PrintS/additional/InfraredTemp/InfraredTemp.cpp index be1ceab..0079110 100644 --- a/PrintS/additional/InfraredTemp/InfraredTemp.cpp +++ b/PrintS/additional/InfraredTemp/InfraredTemp.cpp @@ -93,10 +93,10 @@ void InfraredTemp::Connect() { - if (m_InfraredTempCfg->m_IsForceConnect) { + if (m_InfraredTempCfg->m_IsForceConnect->GetValue()) { m_ChanelInfo.channel = 0; sprintf_s(m_ChanelInfo.szServerName, sizeof(m_ChanelInfo.szServerName), "IRCAM"); - sprintf_s(m_ChanelInfo.szIP, sizeof(m_ChanelInfo.szIP), m_InfraredTempCfg->m_ForceConnectIP.c_str()); + sprintf_s(m_ChanelInfo.szIP, sizeof(m_ChanelInfo.szIP), m_InfraredTempCfg->m_ForceConnectIP->GetValueStr().c_str()); m_ChanelInfo.wPortNum = 3000; m_ChanelInfo.byChanNum = 0; m_ChanelInfo.byChanNum2 = 0; @@ -154,11 +154,11 @@ void InfraredTemp::Connect() int iOSD = 0; INF_OSD osd_info = INF_OSD(0, 0, 0, 0); sdk_LoadParamOsd(m_Handle, m_ChanelInfo, &iOSD, &osd_info); - m_InfraredTempCfg->m_OSDSwitch = (iOSD == 1 ? true : false); - m_InfraredTempCfg->m_GlobalTempAdd = (osd_info.m_g_temp_add == 1 ? true : false); - m_InfraredTempCfg->m_GlobalTempParamAdd = (osd_info.m_g_temp_param_add == 1 ? true : false); - m_InfraredTempCfg->m_PseudoColorBarsAdd = (osd_info.m_pseudo_add == 1 ? true : false); - m_InfraredTempCfg->m_HighLowTempCursorAdd = (osd_info.m_low_hight_temp_pos == 1 ? true : false); + m_InfraredTempCfg->m_OSDSwitch->SetValue(iOSD == 1 ? true : false); + m_InfraredTempCfg->m_GlobalTempAdd->SetValue(osd_info.m_g_temp_add == 1 ? true : false); + m_InfraredTempCfg->m_GlobalTempParamAdd->SetValue(osd_info.m_g_temp_param_add == 1 ? true : false); + m_InfraredTempCfg->m_PseudoColorBarsAdd->SetValue(osd_info.m_pseudo_add == 1 ? true : false); + m_InfraredTempCfg->m_HighLowTempCursorAdd->SetValue(osd_info.m_low_hight_temp_pos == 1 ? true : false); if (SetSerialCallBack(m_Handle, m_ChanelInfo, SerialCallBackHandle, this) != 0) { @@ -166,11 +166,11 @@ void InfraredTemp::Connect() } envir_param ep; sdk_get_envir_param(m_Handle, m_ChanelInfo, &ep); - ep.airTemp = m_InfraredTempCfg->m_AirTemp; - ep.distance = m_InfraredTempCfg->m_Distance; - ep.emissivity = m_InfraredTempCfg->m_Emissivity; - ep.humidity = m_InfraredTempCfg->m_Humidity; - ep.reflectTemp = m_InfraredTempCfg->m_ReflectTemp; + ep.airTemp = m_InfraredTempCfg->m_AirTemp->GetValue(); + ep.distance = m_InfraredTempCfg->m_Distance->GetValue(); + ep.emissivity = m_InfraredTempCfg->m_Emissivity->GetValue(); + ep.humidity = m_InfraredTempCfg->m_Humidity->GetValue(); + ep.reflectTemp = m_InfraredTempCfg->m_ReflectTemp->GetValue(); sdk_set_envir_param(m_Handle, m_ChanelInfo, ep); sdk_envir_effect(m_Handle); @@ -178,7 +178,7 @@ void InfraredTemp::Connect() if (sdk_get_temp_unit(m_Handle, m_ChanelInfo, &iUnit) != 0) { g_log->TraceInfo("sdk_get_temp_unit error"); } - m_InfraredTempCfg->m_TempUnit = iUnit; + m_InfraredTempCfg->m_TempUnit->SetValue(iUnit); int iWidth = 0; int iHeight = 0; @@ -536,11 +536,11 @@ void InfraredTemp::UpdateEnv() if (!IsConnect())return; envir_param ep; sdk_get_envir_param(m_Handle, m_ChanelInfo, &ep); - ep.emissivity = m_InfraredTempCfg->m_Emissivity; - ep.airTemp = m_InfraredTempCfg->m_AirTemp; - ep.reflectTemp = m_InfraredTempCfg->m_AirTemp; - ep.humidity = m_InfraredTempCfg->m_Humidity; - ep.distance = m_InfraredTempCfg->m_Distance; + ep.emissivity = m_InfraredTempCfg->m_Emissivity->GetValue(); + ep.airTemp = m_InfraredTempCfg->m_AirTemp->GetValue(); + ep.reflectTemp = m_InfraredTempCfg->m_AirTemp->GetValue(); + ep.humidity = m_InfraredTempCfg->m_Humidity->GetValue(); + ep.distance = m_InfraredTempCfg->m_Distance->GetValue(); sdk_set_envir_param(m_Handle, m_ChanelInfo, ep); sdk_envir_effect(m_Handle); } @@ -548,7 +548,7 @@ void InfraredTemp::UpdateEnv() void InfraredTemp::SetOSD() { if (!IsConnect())return; - sdk_osd_switch(m_Handle, m_ChanelInfo, m_InfraredTempCfg->m_OSDSwitch ? 1 : 0); + sdk_osd_switch(m_Handle, m_ChanelInfo, m_InfraredTempCfg->m_OSDSwitch->GetValue() ? 1 : 0); } void InfraredTemp::UpdateOSD() { @@ -557,17 +557,17 @@ void InfraredTemp::UpdateOSD() INF_OSD osd_info = INF_OSD(0, 0, 0, 0); sdk_LoadParamOsd(m_Handle, m_ChanelInfo, &iOSD, &osd_info); - osd_info.m_g_temp_add = m_InfraredTempCfg->m_GlobalTempAdd ? 1 : 0; - osd_info.m_g_temp_param_add = m_InfraredTempCfg->m_GlobalTempParamAdd ? 1 : 0; - osd_info.m_pseudo_add = m_InfraredTempCfg->m_PseudoColorBarsAdd ? 1 : 0; - osd_info.m_low_hight_temp_pos = m_InfraredTempCfg->m_HighLowTempCursorAdd ? 1 : 0; + osd_info.m_g_temp_add = m_InfraredTempCfg->m_GlobalTempAdd->GetValue() ? 1 : 0; + osd_info.m_g_temp_param_add = m_InfraredTempCfg->m_GlobalTempParamAdd->GetValue() ? 1 : 0; + osd_info.m_pseudo_add = m_InfraredTempCfg->m_PseudoColorBarsAdd->GetValue() ? 1 : 0; + osd_info.m_low_hight_temp_pos = m_InfraredTempCfg->m_HighLowTempCursorAdd->GetValue() ? 1 : 0; sdk_SetInfOsd(m_Handle, m_ChanelInfo, osd_info); } void InfraredTemp::UpdateColorPalette() { if (!IsConnect())return; - int rel=sdk_set_color_plate(m_Handle, m_ChanelInfo, m_InfraredTempCfg->m_ColorPalette); + int rel=sdk_set_color_plate(m_Handle, m_ChanelInfo, m_InfraredTempCfg->m_ColorPalette->GetValue()); //g_log->TraceInfo(u8"更改色板模式:%d %d", m_InfraredTempCfg->m_ColorPalette, rel); } @@ -613,7 +613,7 @@ m_InfraredTempCfg->m_GainType = rbuffer[5]; void InfraredTemp::UpdateOverTurn() { - switch (m_InfraredTempCfg->m_OverTurn) + switch (m_InfraredTempCfg->m_OverTurn->GetValue()) { case 0: { unsigned char cmd[9] = { 0xAA, 0x05, 0x00, 0x30, 0x01, 0x01, 0xE1, 0xEB, 0xAA }; @@ -654,8 +654,8 @@ void InfraredTemp::UpdateAutoFocus() void InfraredTemp::UpdateTempUnit() { VSNET_TEMPUNIT_S vts; - vts.m_unit = m_InfraredTempCfg->m_TempUnit; - sdk_set_temp_unit(m_Handle, m_ChanelInfo, m_InfraredTempCfg->m_TempUnit); + vts.m_unit = m_InfraredTempCfg->m_TempUnit->GetValue(); + sdk_set_temp_unit(m_Handle, m_ChanelInfo, m_InfraredTempCfg->m_TempUnit->GetValue()); } void InfraredTemp::MessageCallBackHandle(IRNETHANDLE hHandle, WPARAM wParam, LPARAM lParam, void *context) @@ -785,14 +785,14 @@ void InfraredTemp::CalcPrintPlatform() { EnterCriticalSection(&m_ShowCS); m_PrintPlatform.points.clear(); - m_PrintPlatform.pa.x = m_InfraredTempCfg->m_PlatformAX; - m_PrintPlatform.pa.y = m_InfraredTempCfg->m_PlatformAY; - m_PrintPlatform.pb.x = m_InfraredTempCfg->m_PlatformBX; - m_PrintPlatform.pb.y = m_InfraredTempCfg->m_PlatformBY; - m_PrintPlatform.pc.x = m_InfraredTempCfg->m_PlatformCX; - m_PrintPlatform.pc.y = m_InfraredTempCfg->m_PlatformCY; - m_PrintPlatform.pd.x = m_InfraredTempCfg->m_PlatformDX; - m_PrintPlatform.pd.y = m_InfraredTempCfg->m_PlatformDY; + m_PrintPlatform.pa.x = m_InfraredTempCfg->m_PlatformAX->GetValue(); + m_PrintPlatform.pa.y = m_InfraredTempCfg->m_PlatformAY->GetValue(); + m_PrintPlatform.pb.x = m_InfraredTempCfg->m_PlatformBX->GetValue(); + m_PrintPlatform.pb.y = m_InfraredTempCfg->m_PlatformBY->GetValue(); + m_PrintPlatform.pc.x = m_InfraredTempCfg->m_PlatformCX->GetValue(); + m_PrintPlatform.pc.y = m_InfraredTempCfg->m_PlatformCY->GetValue(); + m_PrintPlatform.pd.x = m_InfraredTempCfg->m_PlatformDX->GetValue(); + m_PrintPlatform.pd.y = m_InfraredTempCfg->m_PlatformDY->GetValue(); m_PrintPlatform.points.push_back(m_PrintPlatform.pa); m_PrintPlatform.points.push_back(m_PrintPlatform.pb); m_PrintPlatform.points.push_back(m_PrintPlatform.pc); @@ -1037,7 +1037,7 @@ bool InfraredTemp::IsOverChillDown() { bool rel = false; EnterCriticalSection(&m_ShowCS); - if (m_MaxTemp > m_InfraredTempCfg->m_ChillDowmTemp) + if (m_MaxTemp > m_InfraredTempCfg->m_ChillDowmTemp->GetValue()) { rel = true; } @@ -1082,7 +1082,7 @@ void InfraredTemp::SetAvgSize() EnterCriticalSection(&m_ShowCS); for (size_t regIndex = 0; regIndex < m_TempRegions.size(); regIndex++) { TempRegion* tr = m_TempRegions[regIndex]; - tr->SetAvgSize(m_InfraredTempCfg->m_AvgCalcValueType); + tr->SetAvgSize(m_InfraredTempCfg->m_AvgCalcValueType->GetValue()); } LeaveCriticalSection(&m_ShowCS); } @@ -1100,7 +1100,7 @@ bool InfraredTemp::WaitTempReady(int partId) rel = true; break; } - if (tr->m_MaxTemp <= m_InfraredTempCfg->m_ChillDowmTemp) { + if (tr->m_MaxTemp <= m_InfraredTempCfg->m_ChillDowmTemp->GetValue()) { rel = true; break; } diff --git a/PrintS/output/Release/log/2024.hbd b/PrintS/output/Release/log/2024.hbd index a0644fd..d80e49a 100644 Binary files a/PrintS/output/Release/log/2024.hbd and b/PrintS/output/Release/log/2024.hbd differ diff --git a/PrintS/utils/ConverType.hpp b/PrintS/utils/ConverType.hpp index dd15e0d..410a151 100644 --- a/PrintS/utils/ConverType.hpp +++ b/PrintS/utils/ConverType.hpp @@ -49,5 +49,20 @@ public: return ret; } + static double TryToD(const std::string& input) { + double ret = -1.0; + try { + ret = stod(input); + return ret; + } + catch (const std::invalid_argument& e) { + printf("input is not double...error:%s\n", e.what()); + } + catch (const std::out_of_range& e) { + printf("input number is out of double range...error:%s\n", e.what()); + } + return ret; + } + }; diff --git a/TestClient/DataManage/DataHandle.cpp b/TestClient/DataManage/DataHandle.cpp index 5eb6827..c0a927e 100644 --- a/TestClient/DataManage/DataHandle.cpp +++ b/TestClient/DataManage/DataHandle.cpp @@ -145,17 +145,19 @@ void DataHandle::ParamReadUsage() { printf(" 24: " COLOR_YELLOW "print axisele slave data...\n" COLOR_RESET); printf(" 25: " COLOR_YELLOW "print paramlimitcfg param data...\n" COLOR_RESET); printf(" 26: " COLOR_YELLOW "print extcfg param data...\n" COLOR_RESET); - printf(" 27: " COLOR_YELLOW "print moldcfg param data...\n" COLOR_RESET); - printf(" 28: " COLOR_YELLOW "print loadcfg param data...\n" COLOR_RESET); - printf(" 29: " COLOR_YELLOW "print armcfgparam data...\n" COLOR_RESET); - printf(" 30: " COLOR_YELLOW "print supplycfgparam data...\n" COLOR_RESET); - printf(" 31: " COLOR_YELLOW "print cleancfgparam data...\n" COLOR_RESET); - printf(" 32: " COLOR_YELLOW "print elecfgparam data...\n" COLOR_RESET); - printf(" 33: " COLOR_YELLOW "print loadparamrsp data...\n" COLOR_RESET); - printf(" 34: " COLOR_YELLOW "print scan ctrl state data...\n" COLOR_RESET); - printf(" 35: " COLOR_YELLOW "print scan ctrl Param data...\n" COLOR_RESET); - printf(" 36: " COLOR_YELLOW "print xy scan state data...\n" COLOR_RESET); - printf(" 37: " COLOR_YELLOW "print camera param data...\n" COLOR_RESET); + printf(" 27: " COLOR_YELLOW "print runcfg param data...\n" COLOR_RESET); + printf(" 28: " COLOR_YELLOW "print infraredtemp cfg param data...\n" COLOR_RESET); + printf(" 29: " COLOR_YELLOW "print moldcfg param data...\n" COLOR_RESET); + printf(" 30: " COLOR_YELLOW "print loadcfg param data...\n" COLOR_RESET); + printf(" 31: " COLOR_YELLOW "print armcfgparam data...\n" COLOR_RESET); + printf(" 32: " COLOR_YELLOW "print supplycfgparam data...\n" COLOR_RESET); + printf(" 33: " COLOR_YELLOW "print cleancfgparam data...\n" COLOR_RESET); + printf(" 34: " COLOR_YELLOW "print elecfgparam data...\n" COLOR_RESET); + printf(" 35: " COLOR_YELLOW "print loadparamrsp data...\n" COLOR_RESET); + printf(" 36: " COLOR_YELLOW "print scan ctrl state data...\n" COLOR_RESET); + printf(" 37: " COLOR_YELLOW "print scan ctrl Param data...\n" COLOR_RESET); + printf(" 38: " COLOR_YELLOW "print xy scan state data...\n" COLOR_RESET); + printf(" 39: " COLOR_YELLOW "print camera param data...\n" COLOR_RESET); } int DataHandle::Request(int index) { @@ -212,16 +214,16 @@ void DataHandle::AllTest() { void DataHandle::ParamRequest(int index) { - if (index == 1) { + if (index == VERSIONRSP) { SetPushMsg(VERSIONREQ); //获取版本信息 } - else if (index >= 26 && index <= 33) { + else if (index >= PARAMLIMITCFGPARAM && index <= ELECFGPARAM) { SetPushMsg(REQUEST); } - else if(index == 34){ - SetPushMsg(LOADPARAM,""); + else if(index == LOADPARAMRSP){ + SetPushMsg(LOADPARAM); } - else if (index == 36) { + else if (index == XYSCANSTATE) { SetPushMsg(REQUEST,to_string(index)); } m_printIndex = index; @@ -236,6 +238,10 @@ void DataHandle::ParamRequest(int index) { break; } } + + + SetPushMsg(WRITETYPE::RUNCFG, "FanFreqLowLimit", to_string(11), iFLOAT); //runcfg test + SetPushMsg(WRITETYPE::INFRAREDTEMPCFG, "ReflectTempAssist", to_string(11), iFLOAT); //runcfg test } @@ -349,4 +355,4 @@ void DataHandle::PurifierTest() { printf("STARTAUTODEOXYGEN is called...\n"); SetPushMsg(PURIFIERFUNC, to_string(STOPAUTODEOXYGEN)); printf("STOPAUTODEOXYGEN is called...\n"); -} \ No newline at end of file +} diff --git a/TestClient/DataManage/RWData.h b/TestClient/DataManage/RWData.h index b9ce20f..6398e0a 100644 --- a/TestClient/DataManage/RWData.h +++ b/TestClient/DataManage/RWData.h @@ -39,6 +39,8 @@ enum READTYPE { /********************配置信息******************/ PARAMLIMITCFGPARAM, //paramlimit配置参数 EXTCFGPARAM, + RUNCFGPARAM, //runcfg 参数 + INFRAREDTEMPCFGPARAM, //InfraredTempCfg 参数 MOLDCFGPARAM, LOADCFGPARAM, @@ -69,6 +71,7 @@ enum DATATYPE { iCHAR, iUCHAR, iWORD, + iDOUBLE, UNKNOW, }; @@ -109,12 +112,14 @@ enum WRITETYPE { /********************配置信息******************/ PARAMLIMITCFG, EXTCFG, + RUNCFG, + INFRAREDTEMPCFG, LOADPARAM, //装载参数 SCANCTRLFUNC, //振镜控制函数 - REQUEST, //获取配置信息 test用 + REQUEST = 100, //获取配置信息 test用 }; struct WriteData {