ningshuxia
2024-03-20 785c92f5078cb7aeb05b13f6da627defb6525b36
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
using IStation.Epanet.Enums;
 
namespace IStation.Epanet.Network.IO.Output
{
 
    ///<summary>Abstract class with factory for INP and XLSX composers.</summary>
    public abstract class OutputComposer
    {
 
        ///<summary>Composer creation method.</summary>
        /// <param name="net">Hydraulic network reference.</param>
        /// <param name="type">Composer type.</param>
        /// <returns>Composer reference.</returns>
        public static OutputComposer Create(Network net, FileType type)
        {
            switch (type)
            {
                case FileType.INP_FILE: return new InpComposer(net);
            }
            return null;
        }
 
        protected readonly Network _net;
 
        /// <param name="net">Hydraulic network reference.</param>
        protected OutputComposer(Network net) { _net = net; }
 
        ///<summary>Abstract method to implement the output file creation.</summary>
        /// <param name="fileName">File name reference.</param>
        public abstract void Compose(string fileName);
 
    }
 
}