Esempio n. 1
0
        private void UpdateAnalogOff(DateTime now)
        {
            LogD.Info($"传感器[{PointID}]状态为真正断线...");
            var value      = "模拟量断线";
            var valueState = PointState.OFF;

            //是真正的断线
            RealDataModel.Update(now, value, valueState);
            _analogRunModel.Update(RealDataModel);
            _analogRunModels.Add(_analogRunModel);
            AnalogStatisticModel.UpdateAnalogStatistic(ref _analogStatisticModel, _analogStatisticModels, RealDataModel, this);
            AnalogAlarmModel.UpdateAnalogAlarm(ref _analogAlarmModel, _analogAlarmModels, RealDataModel, this, IsAlarmState);
            Alarm_TodayModel.UpdateAlarmToday(ref _alarmTodayModel, _alarmTodayModels, RealDataModel, this, IsAlarmState);
            DeviceFaultRunModel.UpdateDeviceFaultRun(ref _deviceFaultRunModel, _deviceFaultRunModels, RealDataModel, this, IsAlarmState);
        }
Esempio n. 2
0
 internal void Update(DateTime now)
 {
     _analogOffCount++;
     if (new[] { PointState.UnKnow, PointState.Init }.All(o => o != (PointState)RealDataModel.RealState) && _analogOffCount <= DasConfig.SensorTimeoutCount)
     {
         LogD.Info($"传感器[{PointID}]处于断线屏蔽次数之内:当前屏蔽次数:{_analogOffCount}");
         RealDataModel.Update(now);
         //处于屏蔽次数之内
         _analogRunModels.Add(_analogRunModel);
         AnalogStatisticModel.UpdateAnalogStatistic(ref _analogStatisticModel, _analogStatisticModels, RealDataModel, this);
         AnalogAlarmModel.UpdateAnalogAlarm(ref _analogAlarmModel, _analogAlarmModels, RealDataModel, this, IsAlarmState);
         Alarm_TodayModel.UpdateAlarmToday(ref _alarmTodayModel, _alarmTodayModels, RealDataModel, this, IsAlarmState);
         DeviceFaultRunModel.UpdateDeviceFaultRun(ref _deviceFaultRunModel, _deviceFaultRunModels, RealDataModel, this, IsAlarmState);
     }
     else
     {
         UpdateAnalogOff(now);
     }
 }
Esempio n. 3
0
        internal void Update(DateTime now, List <SensorRealDataInfo> sensorRealDataInfos)
        {
            var sensorRealData = sensorRealDataInfos.FirstOrDefault(p => p.EquipCodes.Exists(q => q == EquipCode));

            if (sensorRealData.IsAnalogOk)
            {
                _analogOffCount = 0;
                PointState valueState = PointState.OK;
                HandleAnalogAlarm(sensorRealData.Value, ref valueState);
                RealDataModel.Update(now, sensorRealData.Value.ToString("f2"), valueState);
                _analogRunModel.Update(RealDataModel);
                _analogRunModels.Add(_analogRunModel);
                AnalogStatisticModel.UpdateAnalogStatistic(ref _analogStatisticModel, _analogStatisticModels, RealDataModel, this);
                AnalogAlarmModel.UpdateAnalogAlarm(ref _analogAlarmModel, _analogAlarmModels, RealDataModel, this, IsAlarmState);
                Alarm_TodayModel.UpdateAlarmToday(ref _alarmTodayModel, _alarmTodayModels, RealDataModel, this, IsAlarmState);
                DeviceFaultRunModel.UpdateDeviceFaultRun(ref _deviceFaultRunModel, _deviceFaultRunModels, RealDataModel, this, IsAlarmState);
            }
            else
            {
                Update(now);
            }
        }