namespace Yw.WinFrmUI { /// /// 压力表视图 /// public class HydroPressmeterViewModel : HydroInstrumentViewModel, IHydroCalcuPressmeterResult { /// /// /// public HydroPressmeterViewModel() { } /// /// /// public HydroPressmeterViewModel(Yw.Model.HydroPressmeterInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo) { this.Vmo = rhs; } /// /// 计算压力 /// [Category("计算结果")] [DisplayName("计算压力")] [Display(Name = "计算压力(m)")] [DisplayUnit("m")] [HydroCalcuPro] [PropertyOrder(11001)] [ShowEditor(false)] [Browsable(true)] public double? CalcuPr { get; set; } /// /// /// [Browsable(false)] public new Yw.Model.HydroPressmeterInfo Vmo { get; set; } /// /// 更新计算属性 /// public override void UpdateCalcuProperty(HydroCalcuVisualResult rhs) { base.UpdateCalcuProperty(rhs); if (rhs is HydroCalcuPressmeterResult calcuPressmeterProperty) { this.CalcuPr = calcuPressmeterProperty.CalcuPr.HasValue ? Math.Round(calcuPressmeterProperty.CalcuPr.Value, 2) : null; } } } }