烟雾传感器阀值防呆,设置范围默认[1000,20000]

main
admin 1 month ago
parent a51290b59b
commit 9d0bc03ecb

@ -156,7 +156,7 @@ CMFCPropertyGridProperty *COtherMonitorDevMgr::CreatGridProperty()
//添加属性显示 //添加属性显示
PropertyName = _T("大理石机台烟雾报警阀值"); PropertyName = _T("大理石机台烟雾报警阀值");
Description = _T("大理石机台烟雾报警:最小浓度值1000"); Description = _T("大理石机台烟雾报警:范围[1000,20000]");
pPropertie->SetGroupName(GroupName); pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName); pPropertie->SetShowName(PropertyName);
@ -179,7 +179,7 @@ CMFCPropertyGridProperty *COtherMonitorDevMgr::CreatGridProperty()
//添加属性显示 //添加属性显示
PropertyName = _T("B01箱子烟雾报警阀值"); PropertyName = _T("B01箱子烟雾报警阀值");
Description = _T("B01箱子烟雾报警最小浓度值1000"); Description = _T("B01箱子烟雾报警范围[1000,20000]");
pPropertie->SetGroupName(GroupName); pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName); pPropertie->SetShowName(PropertyName);
@ -202,7 +202,7 @@ CMFCPropertyGridProperty *COtherMonitorDevMgr::CreatGridProperty()
//添加属性显示 //添加属性显示
PropertyName = _T("B03箱子烟雾报警阀值"); PropertyName = _T("B03箱子烟雾报警阀值");
Description = _T("B03箱子烟雾报警最小浓度值1000"); Description = _T("B03箱子烟雾报警范围[1000,20000]");
pPropertie->SetGroupName(GroupName); pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName); pPropertie->SetShowName(PropertyName);
@ -1175,34 +1175,59 @@ void COtherMonitorDevMgr::WriteModValToPLC()
gLogMgr->WriteLogInfo(LogInfo); gLogMgr->WriteLogInfo(LogInfo);
gPlcCommunicationMgr->WriteRwRegisterWORDValue(PLATSUCKER2_VACPRESSURE_INDEX, m_ValScal_Sucker2_VacPressure); gPlcCommunicationMgr->WriteRwRegisterWORDValue(PLATSUCKER2_VACPRESSURE_INDEX, m_ValScal_Sucker2_VacPressure);
} }
iDevVal = GetMonitorDevVal(_MonitorValType_Marble_Smoke_Threshold);
if (iDevVal != m_SmokeAlarmThreshold)
{ {
if (m_SmokeAlarmThreshold < 1000) { int NeedVal = m_SmokeAlarmThreshold;
m_SmokeAlarmThreshold = 1000; 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) { int NeedVal = m_B01SmokeAlarmThreshold;
m_B01SmokeAlarmThreshold = 1000; 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) { int NeedVal = m_B03SmokeAlarmThreshold;
m_B03SmokeAlarmThreshold = 1000; 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);
} }
} }

Loading…
Cancel
Save