cloudflight
2023-12-02 d67418d0cfd4ad37e56523a1628333b4388c2733
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Hydro.Core.Model
{
    public class NozzleModel : NodeCalcModel
    {
        /// <summary>
        /// 流量系数K
        /// </summary>
        public float FlowCoefficient { get; set; }
 
        /// <summary>
        /// 需水量
        /// </summary>
        public float Demand { get; set; }
        /// <summary>
        /// 用水模式编号
        /// </summary>
        public string PatternID { get; set; }
 
        public override string ToString()
        {
            if (string.IsNullOrEmpty(PatternID)) PatternID = "";
            return $"{ID}\t{Elev}\t{Demand}\t{PatternID}\t;\t";
        }
 
        public string ToEmitterString()
        {
            if (FlowCoefficient > 0)
                return $"{ID}\t{FlowCoefficient * Math.Pow(10 / 101.972, 0.5) / 1000 * 60}\r\n";
            return null;
        }
 
        public JunctionModel ToJunction()
        {
            return new JunctionModel()
            {
                Y = base.Y,
                Elev = base.Elev,
                ID = base.ID,
                Name = base.Name,
                Status = base.Status,
                X = base.X,
            };
        }
    }
}