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
95
96
97
| using System;
| using System.Collections.Generic;
| using System.Linq;
| using System.Text;
| using System.Threading.Tasks;
|
| namespace HStation.WinFrmUI
| {
| /// <summary>
| /// 资产匹配参数辅助类
| /// </summary>
| public class AssetsMatchingParasHelper
| {
|
| //创建资产自动匹配ViewModel
| public static AssetsAutoMatchingViewModel Create(Yw.Model.HydroModelInfo hydroInfo)
| {
| var input = new AssetsAutoMatchingViewModel();
| input.PumpMatchingModels = hydroInfo.Pumps?.Select(x => new PumpMatchingViewModel()
| {
| ID = x.ID,
| Code = x.Code,
| Name = x.Name,
| DbId = x.DbId,
| DbLocked = x.DbLocked,
| ChartDbID = hydroInfo.Curves?.Find(t => t.Code == x.CurveQH)?.DbId,
| ModelType = x.ModelType,
| RatedP = x.RatedP,
| RatedH = x.RatedH,
| RatedN = x.RatedN,
| RatedQ = x.RatedQ,
| }).ToList();
| input.ElbowsMatchingModels = hydroInfo.Elbows?.Select(x => new ElbowsMatchingViewModel()
| {
| ID = x.ID,
| Name = x.Name,
| Code = x.Code,
| Dbid = x.DbId,
| DbLocked = x.DbLocked,
| ModelType = x.ModelType,
| Caliber = x.Caliber,
| Material = x.Material
| }).ToList();
| input.ThreeLinkMatchingModels = hydroInfo.Threelinks?.Select(x => new ThreeLinkMatchingViewModel()
| {
| ID = x.ID,
| Name = x.Name,
| Code = x.Code,
| DbId = x.DbId,
| DbLocked = x.DbLocked,
| ModelType = x.ModelType,
| Caliber = x.Caliber,
| Material = x.Material
| }).ToList();
| input.FourLinkMatchingModels = hydroInfo.Fourlinks?.Select(x => new FourLinkMatchingViewModel()
| {
| ID = x.ID,
| Name = x.Name,
| Code = x.Code,
| Dbid = x.DbId,
| DbLocked = x.DbLocked,
| ModelType = x.ModelType,
| Caliber = x.Caliber,
| Material = x.Material
| }).ToList();
| input.PipeLineMatchingModels = hydroInfo.Pipes?.Select(x => new PipeLineMatchingViewModel()
| {
| ID = x.ID,
| Name = x.Name,
| Code = x.Code,
| DbId = x.DbId,
| DbLocked = x.DbLocked,
| ModelType = x.ModelType,
| Caliber = x.Diameter,//这里是数值
| Material = x.Material
| }).ToList();
| input.ValveMatchingModels = hydroInfo.Pipes?.Select(x => new ValveMatchingViewModel()
| {
| ID = x.ID,
| Name = x.Name,
| Code = x.Code,
| DbId = x.DbId,
| DbLocked = x.DbLocked,
| ModelType = x.ModelType,
| Caliber = x.Diameter,//这里是数值
| Material = x.Material//怎么没有阀门类型
| }).ToList();
| return input;
| }
|
| //应用资产自动匹配ViewModel
| public static void Apply(Yw.Model.HydroModelInfo hydroInfo, AssetsAutoMatchingViewModel output)
| {
|
| }
| }
| }
|
|