개정판 f1c9dbaa
dev issue #000 : ID2 Line Number 기준 모델링 및 Equipment, EndBreak 구별
Change-Id: Ifd40906e19bbee1579306fb7620cc739d4268916
DTI_PID/BaseModel/Model/Document.cs | ||
---|---|---|
20 | 20 |
private List<Note> _NOTES = new List<Note>(); |
21 | 21 |
private List<Line> _LINES = new List<Line>(); |
22 | 22 |
private List<LineNumber> _LINENUMBERS = new List<LineNumber>(); |
23 |
private List<EndBreak> _EndBreaks = new List<EndBreak>(); |
|
24 |
private List<Equipment> _Equipments = new List<Equipment>(); |
|
23 | 25 |
private bool _Enable; |
24 | 26 |
|
25 | 27 |
public bool Enable { get { return _Enable; } } |
... | ... | |
29 | 31 |
public List<Note> NOTES { get => _NOTES; set => _NOTES = value; } |
30 | 32 |
public List<Line> LINES { get => _LINES; set => _LINES = value; } |
31 | 33 |
public List<LineNumber> LINENUMBERS { get => _LINENUMBERS; set => _LINENUMBERS = value; } |
34 |
public List<EndBreak> EndBreaks { get => _EndBreaks; set => _EndBreaks = value; } |
|
35 |
public List<Equipment> Equipments { get => _Equipments; set => _Equipments = value; } |
|
32 | 36 |
public string DWGNAME { get => _DWGNAME; set => _DWGNAME = value; } |
33 | 37 |
public string SIZE |
34 | 38 |
{ |
... | ... | |
49 | 53 |
} |
50 | 54 |
public double SIZE_WIDTH { get => _SIZE_WIDTH; } |
51 | 55 |
public double SIZE_HEIGHT { get => _SIZE_HEIGHT; } |
56 |
|
|
52 | 57 |
|
53 | 58 |
public Document(string xmlPath) |
54 | 59 |
{ |
... | ... | |
78 | 83 |
{ |
79 | 84 |
foreach (XElement item in node.Elements("SYMBOL")) |
80 | 85 |
{ |
81 |
Symbol symbol = new Symbol() |
|
86 |
string sType = item.Element("TYPE").Value; |
|
87 |
if (sType == "Segment Breaks") |
|
82 | 88 |
{ |
83 |
UID = item.Element("UID").Value, |
|
84 |
DBUID = item.Element("DBUID").Value, |
|
85 |
NAME = item.Element("NAME").Value, |
|
86 |
TYPE = item.Element("TYPE").Value, |
|
87 |
OWNER = item.Element("OWNER").Value, |
|
88 |
ORIGINALPOINT = item.Element("ORIGINALPOINT").Value, |
|
89 |
CONNECTIONPOINT = item.Element("CONNECTIONPOINT").Value, |
|
90 |
LOCATION = item.Element("LOCATION").Value, |
|
91 |
SIZE = item.Element("SIZE").Value, |
|
92 |
ANGLE = Convert.ToDouble(item.Element("ANGLE").Value), |
|
93 |
PARENT = item.Element("PARENT").Value, |
|
94 |
CHILD = item.Element("CHILD").Value, |
|
95 |
HASINSTRUMENTLABEL = item.Element("HASINSTRUMENTLABEL").Value, |
|
96 |
AREA = item.Element("AREA").Value, |
|
97 |
FLIP = Convert.ToInt32(item.Element("FLIP").Value), |
|
98 |
CURRENTPOINTMODEINDEX = Convert.ToInt32(item.Element("CURRENTPOINTMODEINDEX").Value) |
|
99 |
}; |
|
100 |
SetAssociations(item.Element("ASSOCIATIONS"), symbol.ASSOCIATIONS); |
|
101 |
SetSymbolConnectors(item.Element("CONNECTORS"), symbol.CONNECTORS, symbol.CONNECTIONPOINT); |
|
102 |
SetProperties(item.Element("PROPERTIES"), symbol.PROPERTIES); |
|
103 |
SetAttributes(item.Element("SYMBOLATTRIBUTES"), symbol.ATTRIBUTES); |
|
104 |
SetChildSymbol(symbol); |
|
89 |
continue; |
|
90 |
} |
|
91 |
else if (sType == "End Break") |
|
92 |
{ |
|
93 |
EndBreak endBreak = new EndBreak() |
|
94 |
{ |
|
95 |
UID = item.Element("UID").Value, |
|
96 |
DBUID = item.Element("DBUID").Value, |
|
97 |
NAME = item.Element("NAME").Value, |
|
98 |
TYPE = item.Element("TYPE").Value, |
|
99 |
OWNER = item.Element("OWNER").Value, |
|
100 |
ORIGINALPOINT = item.Element("ORIGINALPOINT").Value, |
|
101 |
CONNECTIONPOINT = item.Element("CONNECTIONPOINT").Value, |
|
102 |
LOCATION = item.Element("LOCATION").Value, |
|
103 |
SIZE = item.Element("SIZE").Value, |
|
104 |
ANGLE = Convert.ToDouble(item.Element("ANGLE").Value), |
|
105 |
PARENT = item.Element("PARENT").Value, |
|
106 |
CHILD = item.Element("CHILD").Value, |
|
107 |
HASINSTRUMENTLABEL = item.Element("HASINSTRUMENTLABEL").Value, |
|
108 |
AREA = item.Element("AREA").Value, |
|
109 |
FLIP = Convert.ToInt32(item.Element("FLIP").Value), |
|
110 |
CURRENTPOINTMODEINDEX = Convert.ToInt32(item.Element("CURRENTPOINTMODEINDEX").Value) |
|
111 |
}; |
|
112 |
SetAssociations(item.Element("ASSOCIATIONS"), endBreak.ASSOCIATIONS); |
|
113 |
SetSymbolConnectors(item.Element("CONNECTORS"), endBreak.CONNECTORS, endBreak.CONNECTIONPOINT); |
|
114 |
SetProperties(item.Element("PROPERTIES"), endBreak.PROPERTIES); |
|
115 |
SetAttributes(item.Element("SYMBOLATTRIBUTES"), endBreak.ATTRIBUTES); |
|
116 |
|
|
117 |
EndBreaks.Add(endBreak); |
|
118 |
} |
|
119 |
else if (sType == "Black Box System" || |
|
120 |
sType == "GGO_Equipment" || |
|
121 |
sType == "Heat Transfer Equipment" || |
|
122 |
sType == "Labels - Equipment" || |
|
123 |
sType == "Mechanical" || |
|
124 |
sType == "Other Equipment" || |
|
125 |
sType == "Vessels") |
|
126 |
{ |
|
127 |
Equipment equipment = new Equipment() |
|
128 |
{ |
|
129 |
UID = item.Element("UID").Value, |
|
130 |
DBUID = item.Element("DBUID").Value, |
|
131 |
NAME = item.Element("NAME").Value, |
|
132 |
TYPE = item.Element("TYPE").Value, |
|
133 |
OWNER = item.Element("OWNER").Value, |
|
134 |
ORIGINALPOINT = item.Element("ORIGINALPOINT").Value, |
|
135 |
CONNECTIONPOINT = item.Element("CONNECTIONPOINT").Value, |
|
136 |
LOCATION = item.Element("LOCATION").Value, |
|
137 |
SIZE = item.Element("SIZE").Value, |
|
138 |
ANGLE = Convert.ToDouble(item.Element("ANGLE").Value), |
|
139 |
PARENT = item.Element("PARENT").Value, |
|
140 |
CHILD = item.Element("CHILD").Value, |
|
141 |
HASINSTRUMENTLABEL = item.Element("HASINSTRUMENTLABEL").Value, |
|
142 |
AREA = item.Element("AREA").Value, |
|
143 |
FLIP = Convert.ToInt32(item.Element("FLIP").Value), |
|
144 |
CURRENTPOINTMODEINDEX = Convert.ToInt32(item.Element("CURRENTPOINTMODEINDEX").Value) |
|
145 |
}; |
|
146 |
SetAssociations(item.Element("ASSOCIATIONS"), equipment.ASSOCIATIONS); |
|
147 |
SetSymbolConnectors(item.Element("CONNECTORS"), equipment.CONNECTORS, equipment.CONNECTIONPOINT); |
|
148 |
SetProperties(item.Element("PROPERTIES"), equipment.PROPERTIES); |
|
149 |
SetAttributes(item.Element("SYMBOLATTRIBUTES"), equipment.ATTRIBUTES); |
|
105 | 150 |
|
106 |
SYMBOLS.Add(symbol); |
|
151 |
Equipments.Add(equipment); |
|
152 |
} |
|
153 |
else |
|
154 |
{ |
|
155 |
Symbol symbol = new Symbol() |
|
156 |
{ |
|
157 |
UID = item.Element("UID").Value, |
|
158 |
DBUID = item.Element("DBUID").Value, |
|
159 |
NAME = item.Element("NAME").Value, |
|
160 |
TYPE = item.Element("TYPE").Value, |
|
161 |
OWNER = item.Element("OWNER").Value, |
|
162 |
ORIGINALPOINT = item.Element("ORIGINALPOINT").Value, |
|
163 |
CONNECTIONPOINT = item.Element("CONNECTIONPOINT").Value, |
|
164 |
LOCATION = item.Element("LOCATION").Value, |
|
165 |
SIZE = item.Element("SIZE").Value, |
|
166 |
ANGLE = Convert.ToDouble(item.Element("ANGLE").Value), |
|
167 |
PARENT = item.Element("PARENT").Value, |
|
168 |
CHILD = item.Element("CHILD").Value, |
|
169 |
HASINSTRUMENTLABEL = item.Element("HASINSTRUMENTLABEL").Value, |
|
170 |
AREA = item.Element("AREA").Value, |
|
171 |
FLIP = Convert.ToInt32(item.Element("FLIP").Value), |
|
172 |
CURRENTPOINTMODEINDEX = Convert.ToInt32(item.Element("CURRENTPOINTMODEINDEX").Value) |
|
173 |
}; |
|
174 |
SetAssociations(item.Element("ASSOCIATIONS"), symbol.ASSOCIATIONS); |
|
175 |
SetSymbolConnectors(item.Element("CONNECTORS"), symbol.CONNECTORS, symbol.CONNECTIONPOINT); |
|
176 |
SetProperties(item.Element("PROPERTIES"), symbol.PROPERTIES); |
|
177 |
SetAttributes(item.Element("SYMBOLATTRIBUTES"), symbol.ATTRIBUTES); |
|
178 |
SetChildSymbol(symbol); |
|
179 |
|
|
180 |
SYMBOLS.Add(symbol); |
|
181 |
} |
|
107 | 182 |
} |
108 | 183 |
} |
109 | 184 |
|
... | ... | |
318 | 393 |
} |
319 | 394 |
if (!string.IsNullOrEmpty(symbol.CONNECTIONPOINT) && symbol.CONNECTIONPOINT != "None") |
320 | 395 |
{ |
396 |
// 현재 부모 Symbol에 자식 Connector까지 들어가 있음 |
|
321 | 397 |
string[] connectionArray = symbol.CONNECTIONPOINT.Split(new char[] { '/' }); |
322 | 398 |
string[] array = symbol.CONNECTIONPOINT.Split(new char[] { '/' }); |
323 |
List<Connector> childConnector = new List<Connector>(); |
|
324 | 399 |
for (int i = 0; i < array.Length; i++) |
325 | 400 |
{ |
326 | 401 |
string[] arrConn = array[i].Split(new char[] { ',' }); |
... | ... | |
328 | 403 |
if (connIndex != 0) |
329 | 404 |
{ |
330 | 405 |
childList[connIndex - 1].Connectors.Add(symbol.CONNECTORS[i]); |
331 |
childConnector.Add(symbol.CONNECTORS[i]);
|
|
406 |
symbol.CONNECTORS[i].Index = connIndex;
|
|
332 | 407 |
} |
333 | 408 |
} |
334 |
|
|
335 |
foreach (var connector in childConnector) |
|
336 |
{ |
|
337 |
symbol.CONNECTORS.Remove(connector); |
|
338 |
} |
|
339 | 409 |
} |
340 | 410 |
} |
341 | 411 |
#endregion |
내보내기 Unified diff