| | |
| | | double? propValue |
| | | ) |
| | | { |
| | | this.Relation = visual.Name; |
| | | this.Parter = visual.Name; |
| | | this.PropName = HydroMonitorPropHelper.GetName(vmo.PropName); |
| | | this.PropValue = vmo.GetPropValue(propValue); |
| | | this.UnitName = HydroMonitorPropHelper.GetUnit(vmo.PropName); |
| | | this.Flags = Yw.Untity.FlagsHelper.ToString(vmo.Flags); |
| | | this.SortCode = vmo.SortCode; |
| | | this.Description = vmo.Description; |
| | | this.Vmo = vmo; |
| | | |
| | | if (propValue.HasValue) |
| | | { |
| | | UpdatePropValue(propValue.Value); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | /// 构件 |
| | | /// </summary> |
| | | [DisplayName("构件")] |
| | | public string Relation { get; set; } |
| | | public string Parter { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 名称 |
| | |
| | | public Yw.Vmo.HydroMonitorVmo Vmo { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 更新属性值 |
| | | /// </summary> |
| | | public void UpdatePropValue(double propValue) |
| | | { |
| | | switch (this.Vmo.PropName) |
| | | { |
| | | case Yw.Hydro.MonitorProp.CalcuQ: |
| | | { |
| | | this.PropValue = Math.Round(propValue, 1); |
| | | } |
| | | break; |
| | | case Yw.Hydro.MonitorProp.CalcuP: |
| | | { |
| | | this.PropValue = Math.Round(propValue, 1); |
| | | } |
| | | break; |
| | | case Yw.Hydro.MonitorProp.CalcuE: |
| | | { |
| | | this.PropValue = Math.Round(propValue, 1); |
| | | } |
| | | break; |
| | | case Yw.Hydro.MonitorProp.CalcuPr: |
| | | { |
| | | this.PropValue = Math.Round(propValue, 2); |
| | | } |
| | | break; |
| | | case Yw.Hydro.MonitorProp.CalcuO: |
| | | { |
| | | this.PropValue = Math.Round(propValue, 0); |
| | | } |
| | | break; |
| | | case Yw.Hydro.MonitorProp.CalcuO1: |
| | | { |
| | | this.PropValue = Math.Round(propValue, 0); |
| | | } |
| | | break; |
| | | case Yw.Hydro.MonitorProp.CalcuO2: |
| | | { |
| | | this.PropValue = Math.Round(propValue, 0); |
| | | } |
| | | break; |
| | | default: this.PropValue = Math.Round(propValue, 2); break; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新属性值 |
| | | /// </summary> |
| | | public void UpdatePropValue(double? propValue) |
| | | { |
| | | this.PropValue = propValue; |
| | | if (propValue.HasValue) |
| | | { |
| | | UpdatePropValue(propValue.Value); |
| | | } |
| | | } |
| | | |
| | | |
| | | |