#include "ParamLimitCfg.h" #include "BaseConfig.h" ParamLimitCfg::ParamLimitCfg() { m_ScanSpeedMin=1.0f; m_ScanSpeedMax=3000.0f; m_ScanPowerMin=0.0f; m_ScanPowerMax=100.0f; m_ScanDiameterMin=-1500.0f; m_ScanDiameterMax=1500.0f; m_LayerThicknessMin=0; m_LayerThicknessMax=200; m_SupplyPowderMin=0; m_SupplyPowderMax=300; m_ScanTimesMin=0; m_ScanTimesMax=10; m_MoldSpeedMin=0.1f; m_MoldSpeedMax=10.0f; m_MoldAccMin=1.0f; m_MoldAccMax=500.0f; m_MoldDecMin=1.0f; m_MoldDecMax=500.0f; m_MoldPointStepMin=0.0f; m_MoldPointStepMax=10000.0f; m_LoadSpeedMin=0.1f; m_LoadSpeedMax=100.0f; m_LoadAccMin=1.0f; m_LoadAccMax=5000.0f; m_LoadDecMin=1.0f; m_LoadDecMax=5000.0f; m_LoadPointStepMin=0.0f; m_LoadPointStepMax=10000.0f; m_CleanSpeedMin=0.1f; m_CleanSpeedMax=10.0f; m_CleanAccMin=1.0f; m_CleanAccMax=500.0f; m_CleanDecMin=1.0f; m_CleanDecMax=500.0f; m_CleanPointStepMin=0.0f; m_CleanPointStepMax=10000.0f; m_ArmSpeedMin=1.0f; m_ArmSpeedMax=300.0f; m_ArmAccMin=1.0f; m_ArmAccMax=3000.0f; m_ArmDecMin=1.0f; m_ArmDecMax=3000.0f; m_ArmPointStepMin=0.0f; m_ArmPointStepMax=10000.0f; m_SupplySpeedMin=1.0f; m_SupplySpeedMax=100.0f; m_SupplyAccMin=1.0f; m_SupplyAccMax=1000.0f; m_SupplyDecMin=1.0f; m_SupplyDecMax=1000.0f; m_SupplyPointStepMin=0.0f; m_SupplyPointStepMax=30.0f; m_FixGapMin = 0.0f; m_FixGapMax = 1000.0f; m_SupplyWaitTimeMin = 0.0f; m_SupplyWaitTimeMax = 3000.0f; m_SupplyCountMin = 0; m_SupplyCountMax = 30; m_CoverDistanceMin = 0.0f; m_CoverDistanceMax = 700.0f; m_CtrlLayerThicknessMin = 0.0f; m_CtrlLayerThicknessMax = 200.0f; } ParamLimitCfg::~ParamLimitCfg() { } void ParamLimitCfg::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(), ParamLimitCfg::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(), to_string(m_ScanSpeedMin).c_str(), strtail.c_str(), FIELD_SCAN_SPEED_MIN.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ScanSpeedMax).c_str(), strtail.c_str(),FIELD_SCAN_SPEED_MAX.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ScanPowerMin).c_str(), strtail.c_str(), FIELD_SCAN_POWER_MIN.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ScanPowerMax).c_str(), strtail.c_str(), FIELD_SCAN_POWER_MAX.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ScanDiameterMin).c_str(), strtail.c_str(),FIELD_SCAN_DIAMETER_MIN.c_str()); ups.push_back(buffer); sprintf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ScanDiameterMax).c_str(), strtail.c_str(), FIELD_SCAN_DIAMETER_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_LayerThicknessMin).c_str(), strtail.c_str(), FIELD_LAYER_THICKNESS_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_LayerThicknessMax).c_str(), strtail.c_str(), FIELD_LAYER_THICKNESS_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplyPowderMin).c_str(), strtail.c_str(), FIELD_SUPPLY_POWDER_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplyPowderMax).c_str(), strtail.c_str(), FIELD_SUPPLY_POWDER_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ScanTimesMin).c_str(), strtail.c_str(), FIELD_SCAN_TIMES_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ScanTimesMax).c_str(), strtail.c_str(), FIELD_SCAN_TIMES_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_MoldSpeedMin).c_str(), strtail.c_str(), FIELD_MOLD_SPEED_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_MoldSpeedMax).c_str(), strtail.c_str(), FIELD_MOLD_SPEED_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_MoldAccMin).c_str(), strtail.c_str(), FIELD_MOLD_ACC_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_MoldAccMax).c_str(), strtail.c_str(), FIELD_MOLD_ACC_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_MoldDecMin).c_str(), strtail.c_str(), FIELD_MOLD_DEC_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_MoldDecMax).c_str(), strtail.c_str(), FIELD_MOLD_DEC_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_MoldPointStepMin).c_str(), strtail.c_str(), FIELD_MOLD_POINT_STEP_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_MoldPointStepMax).c_str(), strtail.c_str(), FIELD_MOLD_POINT_STEP_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_LoadSpeedMin).c_str(), strtail.c_str(), FIELD_LOAD_SPEED_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_LoadSpeedMax).c_str(), strtail.c_str(), FIELD_LOAD_SPEED_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_LoadAccMin).c_str(), strtail.c_str(), FIELD_LOAD_ACC_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_LoadAccMax).c_str(), strtail.c_str(), FIELD_LOAD_ACC_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_LoadDecMin).c_str(), strtail.c_str(), FIELD_LOAD_DEC_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_LoadDecMax).c_str(), strtail.c_str(), FIELD_LOAD_DEC_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_LoadPointStepMin).c_str(), strtail.c_str(), FIELD_LOAD_POINT_STEP_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_LoadPointStepMax).c_str(), strtail.c_str(), FIELD_LOAD_POINT_STEP_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_CleanSpeedMin).c_str(), strtail.c_str(), FIELD_CLEAN_SPEED_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_CleanSpeedMax).c_str(), strtail.c_str(), FIELD_CLEAN_SPEED_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_CleanAccMin).c_str(), strtail.c_str(), FIELD_CLEAN_ACC_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_CleanAccMax).c_str(), strtail.c_str(), FIELD_CLEAN_ACC_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_CleanDecMin).c_str(), strtail.c_str(), FIELD_CLEAN_DEC_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_CleanDecMax).c_str(), strtail.c_str(), FIELD_CLEAN_DEC_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_CleanPointStepMin).c_str(), strtail.c_str(), FIELD_CLEAN_POINT_STEP_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_CleanPointStepMax).c_str(), strtail.c_str(), FIELD_CLEAN_POINT_STEP_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ArmSpeedMin).c_str(), strtail.c_str(), FIELD_ARM_SPEED_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ArmSpeedMax).c_str(), strtail.c_str(), FIELD_ARM_SPEED_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ArmAccMin).c_str(), strtail.c_str(), FIELD_ARM_ACC_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ArmAccMax).c_str(), strtail.c_str(), FIELD_ARM_ACC_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ArmDecMin).c_str(), strtail.c_str(), FIELD_ARM_DEC_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ArmDecMax).c_str(), strtail.c_str(), FIELD_ARM_DEC_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ArmPointStepMin).c_str(), strtail.c_str(), FIELD_ARM_POINT_STEP_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_ArmPointStepMax).c_str(), strtail.c_str(), FIELD_ARM_POINT_STEP_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplySpeedMin).c_str(), strtail.c_str(), FIELD_SUPPLY_SPEED_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplySpeedMax).c_str(), strtail.c_str(), FIELD_SUPPLY_SPEED_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplyAccMin).c_str(), strtail.c_str(), FIELD_SUPPLY_ACC_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplyAccMax).c_str(), strtail.c_str(), FIELD_SUPPLY_ACC_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplyDecMin).c_str(), strtail.c_str(), FIELD_SUPPLY_DEC_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplyDecMax).c_str(), strtail.c_str(), FIELD_SUPPLY_DEC_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplyPointStepMin).c_str(), strtail.c_str(), FIELD_SUPPLY_POINT_STEP_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplyPointStepMax).c_str(), strtail.c_str(), FIELD_SUPPLY_POINT_STEP_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_FixGapMin).c_str(), strtail.c_str(), FIELD_FIX_GAP_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_FixGapMax).c_str(), strtail.c_str(), FIELD_FIX_GAP_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplyWaitTimeMin).c_str(), strtail.c_str(), FIELD_SUPPLY_WAIT_TIME_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplyWaitTimeMax).c_str(), strtail.c_str(), FIELD_SUPPLY_WAIT_TIME_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplyCountMin).c_str(), strtail.c_str(), FIELD_SUPPLY_COUNT_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_SupplyCountMax).c_str(), strtail.c_str(), FIELD_SUPPLY_COUNT_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_CoverDistanceMin).c_str(), strtail.c_str(), FIELD_COVER_DISTANCE_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_CoverDistanceMax).c_str(), strtail.c_str(), FIELD_COVER_DISTANCE_MAX.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_CtrlLayerThicknessMin).c_str(), strtail.c_str(), FIELD_CTRL_LAYER_THICKNESS_MIN.c_str()); ups.push_back(buffer); printf_s(buffer, sizeof(buffer), "%s'%s'%s'%s'", strhead.c_str(), to_string(m_CtrlLayerThicknessMax).c_str(), strtail.c_str(), FIELD_CTRL_LAYER_THICKNESS_MAX.c_str()); ups.push_back(buffer); } string ParamLimitCfg::CONFIG_NAME="ParamLimitCfg"; string ParamLimitCfg::FIELD_SCAN_SPEED_MIN="ScanSpeedMin"; string ParamLimitCfg::FIELD_SCAN_SPEED_MAX="ScanSpeedMax"; string ParamLimitCfg::FIELD_SCAN_POWER_MIN="ScanPowerMin"; string ParamLimitCfg::FIELD_SCAN_POWER_MAX="ScanPowerMax"; string ParamLimitCfg::FIELD_SCAN_DIAMETER_MIN="ScanDiameterMin"; string ParamLimitCfg::FIELD_SCAN_DIAMETER_MAX="ScanDiameterMax"; string ParamLimitCfg::FIELD_LAYER_THICKNESS_MIN="LayerThicknessMin"; string ParamLimitCfg::FIELD_LAYER_THICKNESS_MAX="LayerThicknessMax"; string ParamLimitCfg::FIELD_CTRL_LAYER_THICKNESS_MIN="CtrlLayerThicknessMin"; string ParamLimitCfg::FIELD_CTRL_LAYER_THICKNESS_MAX="CtrlLayerThicknessMax"; string ParamLimitCfg::FIELD_SUPPLY_POWDER_MIN="SupplyPowderMin"; string ParamLimitCfg::FIELD_SUPPLY_POWDER_MAX="SupplyPowderMax"; string ParamLimitCfg::FIELD_SCAN_TIMES_MIN="ScanTimesMin"; string ParamLimitCfg::FIELD_SCAN_TIMES_MAX="ScanTimesMax"; string ParamLimitCfg::FIELD_MOLD_SPEED_MIN="MoldSpeedMin"; string ParamLimitCfg::FIELD_MOLD_SPEED_MAX="MoldSpeedMax"; string ParamLimitCfg::FIELD_MOLD_ACC_MIN="MoldAccMin"; string ParamLimitCfg::FIELD_MOLD_ACC_MAX="MoldAccMax"; string ParamLimitCfg::FIELD_MOLD_DEC_MIN="MoldDecMin"; string ParamLimitCfg::FIELD_MOLD_DEC_MAX="MoldDecMax"; string ParamLimitCfg::FIELD_MOLD_POINT_STEP_MIN="MoldPointStepMin"; string ParamLimitCfg::FIELD_MOLD_POINT_STEP_MAX="MoldPointStepMax"; string ParamLimitCfg::FIELD_LOAD_SPEED_MIN="LoadSpeedMin"; string ParamLimitCfg::FIELD_LOAD_SPEED_MAX="LoadSpeedMax"; string ParamLimitCfg::FIELD_LOAD_ACC_MIN="LoadAccMin"; string ParamLimitCfg::FIELD_LOAD_ACC_MAX="LoadAccMax"; string ParamLimitCfg::FIELD_LOAD_DEC_MIN="LoadDecMin"; string ParamLimitCfg::FIELD_LOAD_DEC_MAX="LoadDecMax"; string ParamLimitCfg::FIELD_LOAD_POINT_STEP_MIN="LoadPointStepMin"; string ParamLimitCfg::FIELD_LOAD_POINT_STEP_MAX="LoadPointStepMax"; string ParamLimitCfg::FIELD_CLEAN_SPEED_MIN="CleanSpeedMin"; string ParamLimitCfg::FIELD_CLEAN_SPEED_MAX="CleanSpeedMax"; string ParamLimitCfg::FIELD_CLEAN_ACC_MIN="CleanAccMin"; string ParamLimitCfg::FIELD_CLEAN_ACC_MAX="CleanAccMax"; string ParamLimitCfg::FIELD_CLEAN_DEC_MIN="CleanDecMin"; string ParamLimitCfg::FIELD_CLEAN_DEC_MAX="CleanDecMax"; string ParamLimitCfg::FIELD_CLEAN_POINT_STEP_MIN="CleanPointStepMin"; string ParamLimitCfg::FIELD_CLEAN_POINT_STEP_MAX="CleanPointStepMax"; string ParamLimitCfg::FIELD_ARM_SPEED_MIN="ArmSpeedMin"; string ParamLimitCfg::FIELD_ARM_SPEED_MAX="ArmSpeedMax"; string ParamLimitCfg::FIELD_ARM_ACC_MIN="ArmAccMin"; string ParamLimitCfg::FIELD_ARM_ACC_MAX="ArmAccMax"; string ParamLimitCfg::FIELD_ARM_DEC_MIN="ArmDecMin"; string ParamLimitCfg::FIELD_ARM_DEC_MAX="ArmDecMax"; string ParamLimitCfg::FIELD_ARM_POINT_STEP_MIN="ArmPointStepMin"; string ParamLimitCfg::FIELD_ARM_POINT_STEP_MAX="ArmPointStepMax"; string ParamLimitCfg::FIELD_SUPPLY_SPEED_MIN="SupplySpeedMin"; string ParamLimitCfg::FIELD_SUPPLY_SPEED_MAX="SupplySpeedMax"; string ParamLimitCfg::FIELD_SUPPLY_ACC_MIN = "SupplyAccMin"; string ParamLimitCfg::FIELD_SUPPLY_ACC_MAX="SupplyAccMax"; string ParamLimitCfg::FIELD_SUPPLY_DEC_MIN="SupplyDecMin"; string ParamLimitCfg::FIELD_SUPPLY_DEC_MAX="SupplyDecMax"; string ParamLimitCfg::FIELD_SUPPLY_POINT_STEP_MIN="SupplyPointStepMin"; string ParamLimitCfg::FIELD_SUPPLY_POINT_STEP_MAX="SupplyPointStepMax"; string ParamLimitCfg::FIELD_FIX_GAP_MIN = "FixGapMin"; string ParamLimitCfg::FIELD_FIX_GAP_MAX = "FixGapMax"; string ParamLimitCfg::FIELD_SUPPLY_WAIT_TIME_MIN = "SupplyWaitTimeMin"; string ParamLimitCfg::FIELD_SUPPLY_WAIT_TIME_MAX = "SupplyWaitTimeMax"; string ParamLimitCfg::FIELD_SUPPLY_COUNT_MIN = "SupplyCountMin"; string ParamLimitCfg::FIELD_SUPPLY_COUNT_MAX = "SupplyCountMax"; string ParamLimitCfg::FIELD_COVER_DISTANCE_MIN = "CoverDistanceMin"; string ParamLimitCfg::FIELD_COVER_DISTANCE_MAX = "CoverDistanceMax"; ParamLimitCfgNew::ParamLimitCfgNew() : m_ScanSpeedMin(new FloatData("ScanSpeedMin")) , m_ScanSpeedMax(new FloatData("ScanSpeedMax")) , m_ScanPowerMin(new FloatData("ScanPowerMin")) , m_ScanPowerMax(new FloatData("ScanPowerMax")) , m_ScanDiameterMin(new FloatData("ScanDiameterMin")) , m_ScanDiameterMax(new FloatData("ScanDiameterMax")) , m_LayerThicknessMin(new UIntData("LayerThicknessMin")) , m_LayerThicknessMax(new UIntData("LayerThicknessMax")) , m_CtrlLayerThicknessMin(new FloatData("CtrlLayerThicknessMin")) , m_CtrlLayerThicknessMax(new FloatData("CtrlLayerThicknessMax")) , m_SupplyPowderMin(new UIntData("SupplyPowderMin")) , m_SupplyPowderMax(new UIntData("SupplyPowderMax")) , m_ScanTimesMin(new IntData("ScanTimesMin")) , m_ScanTimesMax(new IntData("ScanTimesMax")) , m_MoldSpeedMin(new FloatData("MoldSpeedMin")) , m_MoldSpeedMax(new FloatData("MoldSpeedMax")) , m_MoldAccMin(new FloatData("MoldAccMin")) , m_MoldAccMax(new FloatData("MoldAccMax")) , m_MoldDecMin(new FloatData("MoldDecMin")) , m_MoldDecMax(new FloatData("MoldDecMax")) , m_MoldPointStepMin(new FloatData("MoldPointStepMin")) , m_MoldPointStepMax(new FloatData("MoldPointStepMax")) , m_LoadSpeedMin(new FloatData("LoadSpeedMin")) , m_LoadSpeedMax(new FloatData("LoadSpeedMax")) , m_LoadAccMin(new FloatData("LoadAccMin")) , m_LoadAccMax(new FloatData("LoadAccMax")) , m_LoadDecMin(new FloatData("LoadDecMin")) , m_LoadDecMax(new FloatData("LoadDecMax")) , m_LoadPointStepMin(new FloatData("LoadPointStepMin")) , m_LoadPointStepMax(new FloatData("LoadPointStepMax")) , m_CleanSpeedMin(new FloatData("CleanSpeedMin")) , m_CleanSpeedMax(new FloatData("CleanSpeedMax")) , m_CleanAccMin(new FloatData("CleanAccMin")) , m_CleanAccMax(new FloatData("CleanAccMax")) , m_CleanDecMin(new FloatData("CleanDecMin")) , m_CleanDecMax(new FloatData("CleanDecMax")) , m_CleanPointStepMin(new FloatData("CleanPointStepMin")) , m_CleanPointStepMax(new FloatData("CleanPointStepMax")) , m_ArmSpeedMin(new FloatData("ArmSpeedMin")) , m_ArmSpeedMax(new FloatData("ArmSpeedMax")) , m_ArmAccMin(new FloatData("ArmAccMin")) , m_ArmAccMax(new FloatData("ArmAccMax")) , m_ArmDecMin(new FloatData("ArmDecMin")) , m_ArmDecMax(new FloatData("ArmDecMax")) , m_ArmPointStepMin(new FloatData("ArmPointStepMin")) , m_ArmPointStepMax(new FloatData("ArmPointStepMax")) , m_SupplySpeedMin(new FloatData("SupplySpeedMin")) , m_SupplySpeedMax(new FloatData("SupplySpeedMax")) , m_SupplyAccMin(new FloatData("SupplyAccMin")) , m_SupplyAccMax(new FloatData("SupplyAccMax")) , m_SupplyDecMin(new FloatData("SupplyDecMin")) , m_SupplyDecMax(new FloatData("SupplyDecMax")) , m_SupplyPointStepMin(new FloatData("SupplyPointStepMin")) , m_SupplyPointStepMax(new FloatData("SupplyPointStepMax")) , m_FixGapMin(new FloatData("FixGapMin")) , m_FixGapMax(new FloatData("FixGapMax")) , m_SupplyWaitTimeMin(new FloatData("SupplyWaitTimeMin")) , m_SupplyWaitTimeMax(new FloatData("SupplyWaitTimeMax")) , m_SupplyCountMin(new ShortData("SupplyCountMin")) , m_SupplyCountMax(new ShortData("SupplyCountMax")) , m_CoverDistanceMin(new FloatData("CoverDistanceMin")) , m_CoverDistanceMax(new FloatData("CoverDistanceMax")) { size_t ptrSize = sizeof(nullptr); //指针大小 void* startPtr = &m_startFlag + 1; size_t count = ((size_t)&m_endFlag - (size_t)startPtr) / ptrSize; InsertMp(startPtr, count); } ParamLimitCfgNew::~ParamLimitCfgNew() { } void ParamLimitCfgNew::UpdateCfg(ParamLimitCfg& cfg) { std::shared_lock lock(m_mtx); cfg.m_ScanSpeedMin = m_ScanSpeedMin->GetValue(); cfg.m_ScanSpeedMax = m_ScanSpeedMax->GetValue(); cfg.m_ScanPowerMin = m_ScanPowerMin->GetValue(); cfg.m_ScanPowerMax = m_ScanPowerMax->GetValue(); cfg.m_ScanDiameterMin = m_ScanDiameterMin->GetValue(); cfg.m_ScanDiameterMax = m_ScanDiameterMax->GetValue(); cfg.m_LayerThicknessMin = m_LayerThicknessMin->GetValue(); cfg.m_LayerThicknessMax = m_LayerThicknessMax->GetValue(); cfg.m_CtrlLayerThicknessMin = m_CtrlLayerThicknessMin->GetValue(); cfg.m_CtrlLayerThicknessMax = m_CtrlLayerThicknessMax->GetValue(); cfg.m_SupplyPowderMin = m_SupplyPowderMin->GetValue(); cfg.m_SupplyPowderMax = m_SupplyPowderMax->GetValue(); cfg.m_ScanTimesMin = m_ScanTimesMin->GetValue(); cfg.m_ScanTimesMax = m_ScanTimesMax->GetValue(); cfg.m_MoldSpeedMin = m_MoldSpeedMin->GetValue(); cfg.m_MoldSpeedMax = m_MoldSpeedMax->GetValue(); cfg.m_MoldAccMin = m_MoldAccMin->GetValue(); cfg.m_MoldAccMax = m_MoldAccMax->GetValue(); cfg.m_MoldDecMin = m_MoldDecMin->GetValue(); cfg.m_MoldDecMax = m_MoldDecMax->GetValue(); cfg.m_MoldPointStepMin = m_MoldPointStepMin->GetValue(); cfg.m_MoldPointStepMax = m_MoldPointStepMax->GetValue(); cfg.m_LoadSpeedMin = m_LoadSpeedMin->GetValue(); cfg.m_LoadSpeedMax = m_LoadSpeedMax->GetValue(); cfg.m_LoadAccMin = m_LoadAccMin->GetValue(); cfg.m_LoadAccMax = m_LoadAccMax->GetValue(); cfg.m_LoadDecMin = m_LoadDecMin->GetValue(); cfg.m_LoadDecMax = m_LoadDecMax->GetValue(); cfg.m_LoadPointStepMin = m_LoadPointStepMin->GetValue(); cfg.m_LoadPointStepMax = m_LoadPointStepMax->GetValue(); cfg.m_CleanSpeedMin = m_CleanSpeedMin->GetValue(); cfg.m_CleanSpeedMax = m_CleanSpeedMax->GetValue(); cfg.m_CleanAccMin = m_CleanAccMin->GetValue(); cfg.m_CleanAccMax = m_CleanAccMax->GetValue(); cfg.m_CleanDecMin = m_CleanDecMin->GetValue(); cfg.m_CleanDecMax = m_CleanDecMax->GetValue(); cfg.m_CleanPointStepMin = m_CleanPointStepMin->GetValue(); cfg.m_CleanPointStepMax = m_CleanPointStepMax->GetValue(); cfg.m_ArmSpeedMin = m_ArmSpeedMin->GetValue(); cfg.m_ArmSpeedMax = m_ArmSpeedMax->GetValue(); cfg.m_ArmAccMin = m_ArmAccMin->GetValue(); cfg.m_ArmAccMax = m_ArmAccMax->GetValue(); cfg.m_ArmDecMin = m_ArmDecMin->GetValue(); cfg.m_ArmDecMax = m_ArmDecMax->GetValue(); cfg.m_ArmPointStepMin = m_ArmPointStepMin->GetValue(); cfg.m_ArmPointStepMax = m_ArmPointStepMax->GetValue(); cfg.m_SupplySpeedMin = m_SupplySpeedMin->GetValue(); cfg.m_SupplySpeedMax = m_SupplySpeedMax->GetValue(); cfg.m_SupplyAccMin = m_SupplyAccMin->GetValue(); cfg.m_SupplyAccMax = m_SupplyAccMax->GetValue(); cfg.m_SupplyDecMin = m_SupplyDecMin->GetValue(); cfg.m_SupplyDecMax = m_SupplyDecMax->GetValue(); cfg.m_SupplyPointStepMin = m_SupplyPointStepMin->GetValue(); cfg.m_SupplyPointStepMax = m_SupplyPointStepMax->GetValue(); cfg.m_FixGapMin = m_FixGapMin->GetValue(); cfg.m_FixGapMax = m_FixGapMax->GetValue(); cfg.m_SupplyWaitTimeMin = m_SupplyWaitTimeMin->GetValue(); cfg.m_SupplyWaitTimeMax = m_SupplyWaitTimeMax->GetValue(); cfg.m_SupplyCountMin = m_SupplyCountMin->GetValue(); cfg.m_SupplyCountMax = m_SupplyCountMax->GetValue(); cfg.m_CoverDistanceMin = m_CoverDistanceMin->GetValue(); cfg.m_CoverDistanceMax = m_CoverDistanceMax->GetValue(); } void ParamLimitCfgNew::SetCfg(const ParamLimitCfg& cfg) { std::unique_lock lock(m_mtx); m_ScanSpeedMin->SetValue(cfg.m_ScanSpeedMin); m_ScanSpeedMax->SetValue(cfg.m_ScanSpeedMax); m_ScanPowerMin->SetValue(cfg.m_ScanPowerMin); m_ScanPowerMax->SetValue(cfg.m_ScanPowerMax); m_ScanDiameterMin->SetValue(cfg.m_ScanDiameterMin); m_ScanDiameterMax->SetValue(cfg.m_ScanDiameterMax); m_LayerThicknessMin->SetValue(cfg.m_LayerThicknessMin); m_LayerThicknessMax->SetValue(cfg.m_LayerThicknessMax); m_CtrlLayerThicknessMin->SetValue(cfg.m_CtrlLayerThicknessMin); m_CtrlLayerThicknessMax->SetValue(cfg.m_CtrlLayerThicknessMax); m_SupplyPowderMin->SetValue(cfg.m_SupplyPowderMin); m_SupplyPowderMax->SetValue(cfg.m_SupplyPowderMax); m_ScanTimesMin->SetValue(cfg.m_ScanTimesMin); m_ScanTimesMax->SetValue(cfg.m_ScanTimesMax); m_MoldSpeedMin->SetValue(cfg.m_MoldSpeedMin); m_MoldSpeedMax->SetValue(cfg.m_MoldSpeedMax); m_MoldAccMin->SetValue(cfg.m_MoldAccMin); m_MoldAccMax->SetValue(cfg.m_MoldAccMax); m_MoldDecMin->SetValue(cfg.m_MoldDecMin); m_MoldDecMax->SetValue(cfg.m_MoldDecMax); m_MoldPointStepMin->SetValue(cfg.m_MoldPointStepMin); m_MoldPointStepMax->SetValue(cfg.m_MoldPointStepMax); m_LoadSpeedMin->SetValue(cfg.m_LoadSpeedMin); m_LoadSpeedMax->SetValue(cfg.m_LoadSpeedMax); m_LoadAccMin->SetValue(cfg.m_LoadAccMin); m_LoadAccMax->SetValue(cfg.m_LoadAccMax); m_LoadDecMin->SetValue(cfg.m_LoadDecMin); m_LoadDecMax->SetValue(cfg.m_LoadDecMax); m_LoadPointStepMin->SetValue(cfg.m_LoadPointStepMin); m_LoadPointStepMax->SetValue(cfg.m_LoadPointStepMax); m_CleanSpeedMin->SetValue(cfg.m_CleanSpeedMin); m_CleanSpeedMax->SetValue(cfg.m_CleanSpeedMax); m_CleanAccMin->SetValue(cfg.m_CleanAccMin); m_CleanAccMax->SetValue(cfg.m_CleanAccMax); m_CleanDecMin->SetValue(cfg.m_CleanDecMin); m_CleanDecMax->SetValue(cfg.m_CleanDecMax); m_CleanPointStepMin->SetValue(cfg.m_CleanPointStepMin); m_CleanPointStepMax->SetValue(cfg.m_CleanPointStepMax); m_ArmSpeedMin->SetValue(cfg.m_ArmSpeedMin); m_ArmSpeedMax->SetValue(cfg.m_ArmSpeedMax); m_ArmAccMin->SetValue(cfg.m_ArmAccMin); m_ArmAccMax->SetValue(cfg.m_ArmAccMax); m_ArmDecMin->SetValue(cfg.m_ArmDecMin); m_ArmDecMax->SetValue(cfg.m_ArmDecMax); m_ArmPointStepMin->SetValue(cfg.m_ArmPointStepMin); m_ArmPointStepMax->SetValue(cfg.m_ArmPointStepMax); m_SupplySpeedMin->SetValue(cfg.m_SupplySpeedMin); m_SupplySpeedMax->SetValue(cfg.m_SupplySpeedMax); m_SupplyAccMin->SetValue(cfg.m_SupplyAccMin); m_SupplyAccMax->SetValue(cfg.m_SupplyAccMax); m_SupplyDecMin->SetValue(cfg.m_SupplyDecMin); m_SupplyDecMax->SetValue(cfg.m_SupplyDecMax); m_SupplyPointStepMin->SetValue(cfg.m_SupplyPointStepMin); m_SupplyPointStepMax->SetValue(cfg.m_SupplyPointStepMax); m_FixGapMin->SetValue(cfg.m_FixGapMin); m_FixGapMax->SetValue(cfg.m_FixGapMax); m_SupplyWaitTimeMin->SetValue(cfg.m_SupplyWaitTimeMin); m_SupplyWaitTimeMax->SetValue(cfg.m_SupplyWaitTimeMax); m_SupplyCountMin->SetValue(cfg.m_SupplyCountMin); m_SupplyCountMax->SetValue(cfg.m_SupplyCountMax); m_CoverDistanceMin->SetValue(cfg.m_CoverDistanceMin); m_CoverDistanceMax->SetValue(cfg.m_CoverDistanceMax); }