lixiaojun
2025-02-20 8a169e59577fd2cf19ce4ec6cb88e47d0ff79d63
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using DevExpress.XtraSpreadsheet.Export;
 
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 
    /// </summary>
    public class HydroPumpAnalyWorkingPumpListItemViewModel
    {
        /// <summary>
        /// 
        /// </summary>
        public HydroPumpAnalyWorkingPumpListItemViewModel() { }
 
        /// <summary>
        /// 
        /// </summary>
        public HydroPumpAnalyWorkingPumpListItemViewModel
            (
                Yw.Model.HydroPumpInfo rhs,
                Dictionary<HydroWorkingVmo, HydroPumpAnalyViewModel> allCalcuResultDict
            )
        {
            this.BeginGroup = string.IsNullOrEmpty(rhs.BeginGroup) ? string.Empty : rhs.BeginGroup;
            this.Name = rhs.Name;
            this.Code = rhs.Code;
            this.RatedHz = $"{rhs.RatedHz}hz";
            this.LinkStatus = Yw.Hydro.PumpStatus.Closed;
            if (allCalcuResultDict != null && allCalcuResultDict.Count > 0)
            {
                var list = allCalcuResultDict.Values.ToList();
                if (list.Exists(x => x.Items != null && x.Items.Exists(t => t.Code == rhs.Code && t.LinkStatus == Yw.Hydro.PumpStatus.Open)))
                {
                    this.LinkStatus = Yw.Hydro.PumpStatus.Open;
                }
            }
            this.Description = rhs.Description;
            this.Vmo = rhs;
        }
 
        /// <summary>
        /// 分组
        /// </summary>
        public string BeginGroup { get; set; }
 
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
 
        /// <summary>
        /// 编码
        /// </summary>
        public string Code { get; set; }
 
        /// <summary>
        /// 额定频率
        /// </summary>
        public string RatedHz { get; set; }
 
        /// <summary>
        /// 运行状态
        /// </summary>
        public string LinkStatus { get; set; }
 
        /// <summary>
        /// 图片
        /// </summary>
        public Image Image
        {
            get
            {
                if (this.LinkStatus == Yw.Hydro.PumpStatus.Open)
                {
                    return Yw.WinFrmUI.Hydro.Core.Properties.Resources.pump_run_32;
                }
                return Yw.WinFrmUI.Hydro.Core.Properties.Resources.pump_shut_32;
            }
        }
 
        /// <summary>
        /// 说明
        /// </summary>
        public string Description { get; set; }
 
        /// <summary>
        /// vmo
        /// </summary>
        public Yw.Model.HydroPumpInfo Vmo { get; set; }
 
 
 
    }
}