public void InitPointModel(List <AnalogPointModel> analogPointModels, List <FluxPointModel> fluxPointModels, List <FluxRunModel> fluxRunModels) { lock (_lock) { AnalogPointModels.Clear(); AnalogPointModels.AddRange(analogPointModels); FluxPointModels.Clear(); FluxPointModels.AddRange(fluxPointModels); AnalogPointModels.ForEach(p => p.InitPointModel()); FluxPointModels.ForEach(p => p.InitPointModel(fluxRunModels?.FirstOrDefault(q => q.FluxID == p.FluxID))); } InitRealDataModel(RealDataModel); }
internal void Update(DateTime now, SubStationData substationData) { RealDataModel.Update(now, "正常", PointState.OK); AnalogPointModels.ForEach(p => p.Update(now, substationData.SensorRealDataInfos)); try { lock (_lock) { FluxPointModels.ForEach(p => p.Update(now, AnalogPointModels.Select(p => p.RealDataModel).ToList())); } SubStationRunModel.UpdateSubStationRun(ref _subStationRunModel, _subStationRunModels, RealDataModel, this); } catch (Exception ex) { LogD.Error(ex.ToString()); } }
public void UpdateNetOff(DateTime now) { var value = "网络中断"; var state = PointState.OFF; _tcpOffCount++; if (_tcpOffCount < DasConfig.NetworkOffCount && this.RealDataModel.RealState == (int)PointState.OK) { RealDataModel.Update(now); AnalogPointModels.ForEach(p => p.Update(now)); } else { RealDataModel.Update(now, value, state, FeedState.OK); AnalogPointModels.ForEach(p => p.UpdateWhenSubstationOff(now)); } SubStationRunModel.UpdateSubStationRun(ref _subStationRunModel, _subStationRunModels, RealDataModel, this); }
public void UpdateAnalogOff(DateTime now) { RealDataModel.Update(now, "正常", PointState.OK); SubStationRunModel.UpdateSubStationRun(ref _subStationRunModel, _subStationRunModels, RealDataModel, this); AnalogPointModels.ForEach(p => p.Update(now)); }