ningshuxia
2025-03-26 6171f94b5ca6c804ac2892d214943ff0ac400d26
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
namespace HydroUI
{
    [Serializable]
    public class TankViewModel : NodeViewModel
    {
        [Category("计算参数")]
        [DisplayName("初始水位(m)")]
        public float InitLevel { get; set; } = 5;
        [Category("计算参数")]
        [DisplayName("最低水位(m)")]
        public float MinLevel { get; set; } = 0;
        [Category("计算参数")]
        [DisplayName("最高水位(m)")]
        public float MaxLevel { get; set; } = 10;
        [Category("计算参数")]
        [DisplayName("直径(mm)")]
 
        public float Diameter { get; set; } = 10;
 
        [Category("计算参数")]
        [DisplayName("池底面积")]
        public double Area
        {
            get
            {
                return Math.PI * Math.Pow(Diameter, 2) / 4;
            }
            set
            {
                Diameter = (float)Math.Pow(value / Math.PI, 0.5) * 2;
            }
        }
        [Category("计算参数")]
        [DisplayName("最小容积")]
        public float MinVol { get; set; } = 0;
 
        [Category("计算参数")]
        [DisplayName("容积曲线")]
        public string VolCurve { get; set; } = "";
        [Category("计算参数")]
        [DisplayName("是否允许溢流")]
        public string Overflow { get; set; } = "";
 
        public TankViewModel()
        {
 
        }
        public TankViewModel(string id, string elevation, string initlevel, string minlevel, string maxlevel, string diameter, string minvol, string volcurve, string overflow)
        {
            ID = id;
            Elev = float.Parse(elevation);
            float d = 0;
            float.TryParse(initlevel, out d);
            InitLevel = d;
            float.TryParse(minlevel, out d);
            MinLevel = d;
            float.TryParse(maxlevel, out d);
            MaxLevel = d;
            float.TryParse(diameter, out d);
            Diameter = d;
            float.TryParse(minvol, out d);
            MinVol = d;
            VolCurve = "";
            //float.TryParse(overflow, out d );
            Overflow = "";
        }
        public override string ToString()
        {
            VolCurve = "";
            Overflow = "";
            return $"{ID}\t{Elev}\t{InitLevel}\t{MinLevel}\t{MaxLevel}\t{Diameter}\t{MinVol}\t{VolCurve}\t{Overflow}\t;\t";
        }
    }
}