管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2024-07-18 c969755b5cf2315b344ec3a2a049621aab14d3b4
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
using Newtonsoft.Json;
using SimuTools.Domain;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace SimuTools.Tools
{
    public class Handle
    {
        public static readonly string BaseDir = AppDomain.CurrentDomain.BaseDirectory;
 
        public static void Run(string terrainFile, string waterPath, string flowPath, string outPath)
        {
            Layer layer = new Layer();
            layer.terrain = new Terrain();
            layer.duration = new Duration();
            layer.extension = new Extension();
            layer.waters = new Water();
 
            CopeTerrain(terrainFile, outPath, layer);
            CopeWater(waterPath, outPath, layer);
            CopeFlow(flowPath, outPath, layer);
            CopeLayerJson(outPath, layer);
        }
 
        private static void CopeTerrain(string terrainFile, string outPath, Layer layer)
        {
 
        }
 
        private static void CopeWater(string waterPath, string outPath, Layer layer)
        {
 
        }
 
        private static void CopeFlow(string flowPath, string outPath, Layer layer)
        {
 
        }
 
        private static void CopeLayerJson(string outPath, Layer layer)
        {
            if (null == layer) return;
 
            String json = JsonConvert.SerializeObject(layer);
 
            string filePath = Path.Combine(outPath, "layer.json");
            using (StreamWriter sw = new StreamWriter(filePath))
            {
                sw.Write(json);
            }
        }
    }
}