diff --git a/LaiPuLaser/LaiPuLaser/OtherMonitorDevMgr.cpp b/LaiPuLaser/LaiPuLaser/OtherMonitorDevMgr.cpp index 7972125..c12fdfd 100644 --- a/LaiPuLaser/LaiPuLaser/OtherMonitorDevMgr.cpp +++ b/LaiPuLaser/LaiPuLaser/OtherMonitorDevMgr.cpp @@ -156,7 +156,7 @@ CMFCPropertyGridProperty *COtherMonitorDevMgr::CreatGridProperty() //添加属性显示 PropertyName = _T("大理石机台烟雾报警阀值"); - Description = _T("大理石机台烟雾报警:最小浓度值1000"); + Description = _T("大理石机台烟雾报警:范围[1000,20000]"); pPropertie->SetGroupName(GroupName); pPropertie->SetShowName(PropertyName); @@ -179,7 +179,7 @@ CMFCPropertyGridProperty *COtherMonitorDevMgr::CreatGridProperty() //添加属性显示 PropertyName = _T("B01箱子烟雾报警阀值"); - Description = _T("B01箱子烟雾报警:最小浓度值1000"); + Description = _T("B01箱子烟雾报警:范围[1000,20000]"); pPropertie->SetGroupName(GroupName); pPropertie->SetShowName(PropertyName); @@ -202,7 +202,7 @@ CMFCPropertyGridProperty *COtherMonitorDevMgr::CreatGridProperty() //添加属性显示 PropertyName = _T("B03箱子烟雾报警阀值"); - Description = _T("B03箱子烟雾报警:最小浓度值1000"); + Description = _T("B03箱子烟雾报警:范围[1000,20000]"); pPropertie->SetGroupName(GroupName); pPropertie->SetShowName(PropertyName); @@ -1175,34 +1175,59 @@ void COtherMonitorDevMgr::WriteModValToPLC() gLogMgr->WriteLogInfo(LogInfo); gPlcCommunicationMgr->WriteRwRegisterWORDValue(PLATSUCKER2_VACPRESSURE_INDEX, m_ValScal_Sucker2_VacPressure); } - iDevVal = GetMonitorDevVal(_MonitorValType_Marble_Smoke_Threshold); - if (iDevVal != m_SmokeAlarmThreshold) { - if (m_SmokeAlarmThreshold < 1000) { - m_SmokeAlarmThreshold = 1000; + int NeedVal = m_SmokeAlarmThreshold; + if (m_SmokeAlarmThreshold < 1000) + { + NeedVal = 1000; + } + else if (m_SmokeAlarmThreshold>20000) + { + NeedVal = 20000; + } + iDevVal = GetMonitorDevVal(_MonitorValType_Marble_Smoke_Threshold); + if (iDevVal != NeedVal) + { + LogInfo.m_LogMsg.Format("Set m_SmokeAlarmThreshold = %d", NeedVal); + gLogMgr->WriteLogInfo(LogInfo); + gPlcCommunicationMgr->WriteRwRegisterWORDValue(MARBLE_SMOKE_THRESHOLD_INDEX, NeedVal); } - LogInfo.m_LogMsg.Format("Set m_SmokeAlarmThreshold = %d", m_SmokeAlarmThreshold); - gLogMgr->WriteLogInfo(LogInfo); gPlcCommunicationMgr->WriteRwRegisterWORDValue(MARBLE_SMOKE_THRESHOLD_INDEX, m_SmokeAlarmThreshold); } - iDevVal = GetMonitorDevVal(_MonitorValType_B01_Smoke_Threshold); - if (iDevVal != m_B01SmokeAlarmThreshold) { - if (m_B01SmokeAlarmThreshold < 1000) { - m_B01SmokeAlarmThreshold = 1000; + int NeedVal = m_B01SmokeAlarmThreshold; + if (m_B01SmokeAlarmThreshold < 1000) + { + NeedVal = 1000; + } + else if (m_B01SmokeAlarmThreshold > 20000) + { + NeedVal = 20000; + } + iDevVal = GetMonitorDevVal(_MonitorValType_B01_Smoke_Threshold); + if (iDevVal != NeedVal) + { + LogInfo.m_LogMsg.Format("Set m_B01SmokeAlarmThreshold = %d", NeedVal); + gLogMgr->WriteLogInfo(LogInfo); + gPlcCommunicationMgr->WriteRwRegisterWORDValue(B01_SMOKE_THRESHOLD_INDEX, NeedVal); } - LogInfo.m_LogMsg.Format("Set m_B01SmokeAlarmThreshold = %d", m_B01SmokeAlarmThreshold); - gLogMgr->WriteLogInfo(LogInfo); - gPlcCommunicationMgr->WriteRwRegisterWORDValue(B01_SMOKE_THRESHOLD_INDEX, m_B01SmokeAlarmThreshold); } - iDevVal = GetMonitorDevVal(_MonitorValType_B03_Smoke_Threshold); - if (iDevVal != m_B03SmokeAlarmThreshold) { - if (m_B03SmokeAlarmThreshold < 1000) { - m_B03SmokeAlarmThreshold = 1000; + int NeedVal = m_B03SmokeAlarmThreshold; + if (m_B03SmokeAlarmThreshold < 1000) + { + NeedVal = 1000; + } + else if (m_B03SmokeAlarmThreshold > 20000) + { + NeedVal = 20000; + } + iDevVal = GetMonitorDevVal(_MonitorValType_B03_Smoke_Threshold); + if (iDevVal != NeedVal) + { + LogInfo.m_LogMsg.Format("Set m_B03SmokeAlarmThreshold = %d", NeedVal); + gLogMgr->WriteLogInfo(LogInfo); + gPlcCommunicationMgr->WriteRwRegisterWORDValue(B03_SMOKE_THRESHOLD_INDEX, NeedVal); } - LogInfo.m_LogMsg.Format("Set m_B03SmokeAlarmThreshold = %d", m_B03SmokeAlarmThreshold); - gLogMgr->WriteLogInfo(LogInfo); - gPlcCommunicationMgr->WriteRwRegisterWORDValue(B03_SMOKE_THRESHOLD_INDEX, m_B03SmokeAlarmThreshold); } }