1 |
96a2080c
|
gaqhf
|
using System;
|
2 |
|
|
using System.Collections.Generic;
|
3 |
|
|
using System.Linq;
|
4 |
|
|
using System.Text;
|
5 |
|
|
using System.Threading.Tasks;
|
6 |
|
|
using System.IO;
|
7 |
|
|
using System.Xml.Linq;
|
8 |
|
|
using System.Windows.Forms;
|
9 |
d63050d6
|
gaqhf
|
using Converter.SPPID.Util;
|
10 |
96a2080c
|
gaqhf
|
|
11 |
|
|
namespace Converter.BaseModel
|
12 |
|
|
{
|
13 |
|
|
public class Document
|
14 |
|
|
{
|
15 |
|
|
private string _DWGNAME;
|
16 |
|
|
private string _SIZE;
|
17 |
39a2a688
|
gaqhf
|
private double _SIZE_WIDTH;
|
18 |
|
|
private double _SIZE_HEIGHT;
|
19 |
60244a8b
|
gaqhf
|
private List<Symbol> _SYMBOLS = new List<Symbol>();
|
20 |
|
|
private List<Text> _TEXTINFOS = new List<Text>();
|
21 |
|
|
private List<Note> _NOTES = new List<Note>();
|
22 |
|
|
private List<Line> _LINES = new List<Line>();
|
23 |
|
|
private List<LineNumber> _LINENUMBERS = new List<LineNumber>();
|
24 |
8aa6f2db
|
gaqhf
|
private List<TrimLine> _TRIMLINES = new List<TrimLine>();
|
25 |
f1c9dbaa
|
gaqhf
|
private List<EndBreak> _EndBreaks = new List<EndBreak>();
|
26 |
53c81765
|
gaqhf
|
private List<SpecBreak> _SpecBreaks = new List<SpecBreak>();
|
27 |
f1c9dbaa
|
gaqhf
|
private List<Equipment> _Equipments = new List<Equipment>();
|
28 |
60244a8b
|
gaqhf
|
private bool _Enable;
|
29 |
|
|
|
30 |
|
|
public bool Enable { get { return _Enable; } }
|
31 |
96a2080c
|
gaqhf
|
|
32 |
|
|
public List<Symbol> SYMBOLS { get => _SYMBOLS; set => _SYMBOLS = value; }
|
33 |
|
|
public List<Text> TEXTINFOS { get => _TEXTINFOS; set => _TEXTINFOS = value; }
|
34 |
|
|
public List<Note> NOTES { get => _NOTES; set => _NOTES = value; }
|
35 |
|
|
public List<Line> LINES { get => _LINES; set => _LINES = value; }
|
36 |
|
|
public List<LineNumber> LINENUMBERS { get => _LINENUMBERS; set => _LINENUMBERS = value; }
|
37 |
f1c9dbaa
|
gaqhf
|
public List<EndBreak> EndBreaks { get => _EndBreaks; set => _EndBreaks = value; }
|
38 |
53c81765
|
gaqhf
|
public List<SpecBreak> SpecBreaks { get => _SpecBreaks; set => _SpecBreaks = value; }
|
39 |
f1c9dbaa
|
gaqhf
|
public List<Equipment> Equipments { get => _Equipments; set => _Equipments = value; }
|
40 |
96a2080c
|
gaqhf
|
public string DWGNAME { get => _DWGNAME; set => _DWGNAME = value; }
|
41 |
39a2a688
|
gaqhf
|
public string SIZE
|
42 |
|
|
{
|
43 |
|
|
get
|
44 |
|
|
{
|
45 |
|
|
return _SIZE;
|
46 |
|
|
}
|
47 |
|
|
set
|
48 |
|
|
{
|
49 |
|
|
_SIZE = value;
|
50 |
|
|
string[] pointArr = _SIZE.Split(new char[] { ',' });
|
51 |
|
|
if (pointArr.Length == 2)
|
52 |
|
|
{
|
53 |
|
|
_SIZE_WIDTH = Convert.ToDouble(pointArr[0]);
|
54 |
|
|
_SIZE_HEIGHT = Convert.ToDouble(pointArr[1]);
|
55 |
|
|
}
|
56 |
|
|
}
|
57 |
|
|
}
|
58 |
|
|
public double SIZE_WIDTH { get => _SIZE_WIDTH; }
|
59 |
|
|
public double SIZE_HEIGHT { get => _SIZE_HEIGHT; }
|
60 |
8aa6f2db
|
gaqhf
|
public List<TrimLine> TRIMLINES { get => _TRIMLINES; set => _TRIMLINES = value; }
|
61 |
e8536f2b
|
gaqhf
|
public string PATH { get; set; }
|
62 |
96a2080c
|
gaqhf
|
|
63 |
a0e3dca4
|
gaqhf
|
StringBuilder validationStringBuilder = new StringBuilder();
|
64 |
|
|
|
65 |
96a2080c
|
gaqhf
|
public Document(string xmlPath)
|
66 |
|
|
{
|
67 |
a0e3dca4
|
gaqhf
|
validationStringBuilder.AppendLine("Document Path : " + xmlPath);
|
68 |
|
|
validationStringBuilder.AppendLine("");
|
69 |
96a2080c
|
gaqhf
|
try
|
70 |
|
|
{
|
71 |
88bac50c
|
gaqhf
|
if (xmlPath != null)
|
72 |
|
|
{
|
73 |
|
|
PATH = xmlPath;
|
74 |
|
|
XElement xml = XElement.Load(xmlPath);
|
75 |
|
|
DWGNAME = xml.Element("DWGNAME").Value;
|
76 |
|
|
SIZE = xml.Element("SIZE").Value;
|
77 |
96a2080c
|
gaqhf
|
|
78 |
a0e3dca4
|
gaqhf
|
validationStringBuilder.AppendLine("Drawing Name : " + DWGNAME);
|
79 |
|
|
validationStringBuilder.AppendLine("");
|
80 |
|
|
|
81 |
88bac50c
|
gaqhf
|
SetText(xml.Element("TEXTINFOS"));
|
82 |
|
|
SetNote(xml.Element("NOTES"));
|
83 |
|
|
SetSymbol(xml.Element("SYMBOLS"));
|
84 |
|
|
SetLine(xml.Element("LINEINFOS"));
|
85 |
|
|
SetLineNumber(xml.Element("LINENOS"));
|
86 |
|
|
SetTrimLine(xml.Element("TRIMLINENOS"));
|
87 |
60244a8b
|
gaqhf
|
|
88 |
d63050d6
|
gaqhf
|
SetAllConnectors();
|
89 |
88bac50c
|
gaqhf
|
_Enable = true;
|
90 |
63c5305b
|
gaqhf
|
ValidationCheck();
|
91 |
88bac50c
|
gaqhf
|
}
|
92 |
96a2080c
|
gaqhf
|
}
|
93 |
|
|
catch (Exception ex)
|
94 |
|
|
{
|
95 |
60244a8b
|
gaqhf
|
_Enable = false;
|
96 |
96a2080c
|
gaqhf
|
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
|
97 |
|
|
}
|
98 |
|
|
}
|
99 |
|
|
|
100 |
60244a8b
|
gaqhf
|
#region READ XML
|
101 |
96a2080c
|
gaqhf
|
private void SetSymbol(XElement node)
|
102 |
|
|
{
|
103 |
|
|
foreach (XElement item in node.Elements("SYMBOL"))
|
104 |
|
|
{
|
105 |
f1c9dbaa
|
gaqhf
|
string sType = item.Element("TYPE").Value;
|
106 |
|
|
if (sType == "Segment Breaks")
|
107 |
96a2080c
|
gaqhf
|
{
|
108 |
53c81765
|
gaqhf
|
SpecBreak specBreak = new SpecBreak()
|
109 |
|
|
{
|
110 |
|
|
UID = item.Element("UID").Value,
|
111 |
|
|
DBUID = item.Element("DBUID").Value,
|
112 |
|
|
NAME = item.Element("NAME").Value,
|
113 |
|
|
TYPE = item.Element("TYPE").Value,
|
114 |
|
|
OWNER = item.Element("OWNER").Value,
|
115 |
|
|
ORIGINALPOINT = item.Element("ORIGINALPOINT").Value,
|
116 |
|
|
CONNECTIONPOINT = item.Element("CONNECTIONPOINT").Value,
|
117 |
|
|
LOCATION = item.Element("LOCATION").Value,
|
118 |
|
|
SIZE = item.Element("SIZE").Value,
|
119 |
|
|
ANGLE = Convert.ToDouble(item.Element("ANGLE").Value),
|
120 |
|
|
PARENT = item.Element("PARENT").Value,
|
121 |
|
|
CHILD = item.Element("CHILD").Value,
|
122 |
|
|
HASINSTRUMENTLABEL = item.Element("HASINSTRUMENTLABEL").Value,
|
123 |
|
|
AREA = item.Element("AREA").Value,
|
124 |
|
|
FLIP = Convert.ToInt32(item.Element("FLIP").Value),
|
125 |
|
|
CURRENTPOINTMODEINDEX = Convert.ToInt32(item.Element("CURRENTPOINTMODEINDEX").Value)
|
126 |
|
|
};
|
127 |
|
|
SetAssociations(item.Element("ASSOCIATIONS"), specBreak.ASSOCIATIONS);
|
128 |
|
|
SetSymbolConnectors(item.Element("CONNECTORS"), specBreak.CONNECTORS, specBreak.CONNECTIONPOINT);
|
129 |
|
|
SetProperties(item.Element("PROPERTIES"), specBreak.PROPERTIES);
|
130 |
|
|
SetAttributes(item.Element("SYMBOLATTRIBUTES"), specBreak.ATTRIBUTES);
|
131 |
|
|
SetSpecBreakAttribute(specBreak);
|
132 |
|
|
|
133 |
|
|
SpecBreaks.Add(specBreak);
|
134 |
f1c9dbaa
|
gaqhf
|
}
|
135 |
|
|
else if (sType == "End Break")
|
136 |
|
|
{
|
137 |
|
|
EndBreak endBreak = new EndBreak()
|
138 |
|
|
{
|
139 |
|
|
UID = item.Element("UID").Value,
|
140 |
|
|
DBUID = item.Element("DBUID").Value,
|
141 |
|
|
NAME = item.Element("NAME").Value,
|
142 |
|
|
TYPE = item.Element("TYPE").Value,
|
143 |
|
|
OWNER = item.Element("OWNER").Value,
|
144 |
|
|
ORIGINALPOINT = item.Element("ORIGINALPOINT").Value,
|
145 |
|
|
CONNECTIONPOINT = item.Element("CONNECTIONPOINT").Value,
|
146 |
|
|
LOCATION = item.Element("LOCATION").Value,
|
147 |
|
|
SIZE = item.Element("SIZE").Value,
|
148 |
|
|
ANGLE = Convert.ToDouble(item.Element("ANGLE").Value),
|
149 |
|
|
PARENT = item.Element("PARENT").Value,
|
150 |
|
|
CHILD = item.Element("CHILD").Value,
|
151 |
|
|
HASINSTRUMENTLABEL = item.Element("HASINSTRUMENTLABEL").Value,
|
152 |
|
|
AREA = item.Element("AREA").Value,
|
153 |
|
|
FLIP = Convert.ToInt32(item.Element("FLIP").Value),
|
154 |
|
|
CURRENTPOINTMODEINDEX = Convert.ToInt32(item.Element("CURRENTPOINTMODEINDEX").Value)
|
155 |
|
|
};
|
156 |
|
|
SetAssociations(item.Element("ASSOCIATIONS"), endBreak.ASSOCIATIONS);
|
157 |
|
|
SetSymbolConnectors(item.Element("CONNECTORS"), endBreak.CONNECTORS, endBreak.CONNECTIONPOINT);
|
158 |
|
|
SetProperties(item.Element("PROPERTIES"), endBreak.PROPERTIES);
|
159 |
|
|
SetAttributes(item.Element("SYMBOLATTRIBUTES"), endBreak.ATTRIBUTES);
|
160 |
|
|
|
161 |
|
|
EndBreaks.Add(endBreak);
|
162 |
|
|
}
|
163 |
|
|
else if (sType == "Black Box System" ||
|
164 |
|
|
sType == "GGO_Equipment" ||
|
165 |
|
|
sType == "Heat Transfer Equipment" ||
|
166 |
|
|
sType == "Mechanical" ||
|
167 |
|
|
sType == "Other Equipment" ||
|
168 |
|
|
sType == "Vessels")
|
169 |
|
|
{
|
170 |
|
|
Equipment equipment = new Equipment()
|
171 |
|
|
{
|
172 |
|
|
UID = item.Element("UID").Value,
|
173 |
|
|
DBUID = item.Element("DBUID").Value,
|
174 |
|
|
NAME = item.Element("NAME").Value,
|
175 |
|
|
TYPE = item.Element("TYPE").Value,
|
176 |
|
|
OWNER = item.Element("OWNER").Value,
|
177 |
|
|
ORIGINALPOINT = item.Element("ORIGINALPOINT").Value,
|
178 |
|
|
CONNECTIONPOINT = item.Element("CONNECTIONPOINT").Value,
|
179 |
|
|
LOCATION = item.Element("LOCATION").Value,
|
180 |
|
|
SIZE = item.Element("SIZE").Value,
|
181 |
|
|
ANGLE = Convert.ToDouble(item.Element("ANGLE").Value),
|
182 |
|
|
PARENT = item.Element("PARENT").Value,
|
183 |
|
|
CHILD = item.Element("CHILD").Value,
|
184 |
|
|
HASINSTRUMENTLABEL = item.Element("HASINSTRUMENTLABEL").Value,
|
185 |
|
|
AREA = item.Element("AREA").Value,
|
186 |
|
|
FLIP = Convert.ToInt32(item.Element("FLIP").Value),
|
187 |
|
|
CURRENTPOINTMODEINDEX = Convert.ToInt32(item.Element("CURRENTPOINTMODEINDEX").Value)
|
188 |
|
|
};
|
189 |
|
|
SetAssociations(item.Element("ASSOCIATIONS"), equipment.ASSOCIATIONS);
|
190 |
|
|
SetSymbolConnectors(item.Element("CONNECTORS"), equipment.CONNECTORS, equipment.CONNECTIONPOINT);
|
191 |
|
|
SetProperties(item.Element("PROPERTIES"), equipment.PROPERTIES);
|
192 |
|
|
SetAttributes(item.Element("SYMBOLATTRIBUTES"), equipment.ATTRIBUTES);
|
193 |
bca81f4c
|
gaqhf
|
|
194 |
f1c9dbaa
|
gaqhf
|
Equipments.Add(equipment);
|
195 |
|
|
}
|
196 |
|
|
else
|
197 |
|
|
{
|
198 |
|
|
Symbol symbol = new Symbol()
|
199 |
|
|
{
|
200 |
|
|
UID = item.Element("UID").Value,
|
201 |
|
|
DBUID = item.Element("DBUID").Value,
|
202 |
|
|
NAME = item.Element("NAME").Value,
|
203 |
|
|
TYPE = item.Element("TYPE").Value,
|
204 |
|
|
OWNER = item.Element("OWNER").Value,
|
205 |
|
|
ORIGINALPOINT = item.Element("ORIGINALPOINT").Value,
|
206 |
|
|
CONNECTIONPOINT = item.Element("CONNECTIONPOINT").Value,
|
207 |
|
|
LOCATION = item.Element("LOCATION").Value,
|
208 |
|
|
SIZE = item.Element("SIZE").Value,
|
209 |
|
|
ANGLE = Convert.ToDouble(item.Element("ANGLE").Value),
|
210 |
|
|
PARENT = item.Element("PARENT").Value,
|
211 |
|
|
CHILD = item.Element("CHILD").Value,
|
212 |
|
|
HASINSTRUMENTLABEL = item.Element("HASINSTRUMENTLABEL").Value,
|
213 |
|
|
AREA = item.Element("AREA").Value,
|
214 |
|
|
FLIP = Convert.ToInt32(item.Element("FLIP").Value),
|
215 |
|
|
CURRENTPOINTMODEINDEX = Convert.ToInt32(item.Element("CURRENTPOINTMODEINDEX").Value)
|
216 |
|
|
};
|
217 |
8aa6f2db
|
gaqhf
|
|
218 |
f1c9dbaa
|
gaqhf
|
SetAssociations(item.Element("ASSOCIATIONS"), symbol.ASSOCIATIONS);
|
219 |
|
|
SetSymbolConnectors(item.Element("CONNECTORS"), symbol.CONNECTORS, symbol.CONNECTIONPOINT);
|
220 |
|
|
SetProperties(item.Element("PROPERTIES"), symbol.PROPERTIES);
|
221 |
|
|
SetAttributes(item.Element("SYMBOLATTRIBUTES"), symbol.ATTRIBUTES);
|
222 |
|
|
SetChildSymbol(symbol);
|
223 |
|
|
|
224 |
|
|
SYMBOLS.Add(symbol);
|
225 |
|
|
}
|
226 |
96a2080c
|
gaqhf
|
}
|
227 |
|
|
}
|
228 |
|
|
|
229 |
|
|
private void SetLine(XElement node)
|
230 |
|
|
{
|
231 |
|
|
foreach (XElement item in node.Elements("LINE"))
|
232 |
|
|
{
|
233 |
60244a8b
|
gaqhf
|
Line line = new Line()
|
234 |
96a2080c
|
gaqhf
|
{
|
235 |
60244a8b
|
gaqhf
|
OWNER = item.Attribute("OWNER").Value,
|
236 |
|
|
UID = item.Element("UID").Value,
|
237 |
|
|
STARTPOINT = item.Element("STARTPOINT").Value,
|
238 |
|
|
ENDPOINT = item.Element("ENDPOINT").Value,
|
239 |
|
|
TYPE = item.Element("TYPE").Value,
|
240 |
30d2cfcc
|
gaqhf
|
TYPEUID = item.Element("TYPE").Attribute("TYPEUID").Value,
|
241 |
60244a8b
|
gaqhf
|
AREA = item.Element("AREA").Value,
|
242 |
|
|
THICKNESS = item.Element("THICKNESS").Value,
|
243 |
|
|
};
|
244 |
b2d1c1aa
|
gaqhf
|
int flowMarkPercent = 0;
|
245 |
|
|
if (int.TryParse(item.Element("FLOWMARK").Value, out flowMarkPercent))
|
246 |
|
|
{
|
247 |
|
|
line.FLOWMARK = true;
|
248 |
|
|
line.FLOWMARK_PERCENT = flowMarkPercent;
|
249 |
|
|
}
|
250 |
|
|
else
|
251 |
|
|
line.FLOWMARK = false;
|
252 |
|
|
|
253 |
0860c756
|
gaqhf
|
SetAssociations(item.Element("ASSOCIATIONS"), line.ASSOCIATIONS);
|
254 |
cfda1fed
|
gaqhf
|
SetConnectors(item.Element("CONNECTORS"), line.CONNECTORS);
|
255 |
0860c756
|
gaqhf
|
SetAttributes(item.Element("SYMBOLATTRIBUTES"), line.ATTRIBUTES);
|
256 |
60244a8b
|
gaqhf
|
LINES.Add(line);
|
257 |
96a2080c
|
gaqhf
|
}
|
258 |
|
|
}
|
259 |
|
|
|
260 |
|
|
private void SetLineNumber(XElement node)
|
261 |
|
|
{
|
262 |
|
|
foreach (XElement item in node.Elements("LINE_NO"))
|
263 |
|
|
{
|
264 |
3734dcc5
|
gaqhf
|
LineNumber lineNumber = new LineNumber()
|
265 |
96a2080c
|
gaqhf
|
{
|
266 |
3734dcc5
|
gaqhf
|
UID = item.Element("UID").Value,
|
267 |
|
|
TEXT = item.Element("TEXT").Value,
|
268 |
|
|
LOCATION = item.Element("LOCATION").Value,
|
269 |
|
|
WIDTH = item.Element("WIDTH").Value,
|
270 |
|
|
HEIGHT = item.Element("HEIGHT").Value,
|
271 |
|
|
ANGLE = Convert.ToDouble(item.Element("ANGLE").Value),
|
272 |
|
|
AREA = item.Element("AREA").Value,
|
273 |
|
|
SCENE = item.Element("SCENE").Value
|
274 |
|
|
};
|
275 |
|
|
if (item.Element("CONNLINE") != null)
|
276 |
|
|
lineNumber.CONNLINE = item.Element("CONNLINE").Value;
|
277 |
|
|
|
278 |
|
|
SetLineNumberRuns(item, lineNumber.RUNS);
|
279 |
|
|
SetProperties(item.Element("PROPERTIES"), lineNumber.PROPERTIES);
|
280 |
|
|
SetAttributes(item, lineNumber.ATTRIBUTES);
|
281 |
|
|
LINENUMBERS.Add(lineNumber);
|
282 |
96a2080c
|
gaqhf
|
}
|
283 |
|
|
}
|
284 |
|
|
|
285 |
|
|
private void SetText(XElement node)
|
286 |
|
|
{
|
287 |
|
|
foreach (XElement item in node.Elements("ATTRIBUTE"))
|
288 |
|
|
{
|
289 |
60244a8b
|
gaqhf
|
Text text = new Text()
|
290 |
96a2080c
|
gaqhf
|
{
|
291 |
60244a8b
|
gaqhf
|
UID = item.Element("UID").Value,
|
292 |
ea80efaa
|
gaqhf
|
OWNER = item.Element("OWNER").Value,
|
293 |
60244a8b
|
gaqhf
|
ATTRIBUTEVALUE = item.Element("ATTRIBUTEVALUE").Value,
|
294 |
|
|
NAME = item.Element("NAME").Value,
|
295 |
|
|
LOCATION = item.Element("LOCATION").Value,
|
296 |
|
|
VALUE = item.Element("VALUE").Value,
|
297 |
|
|
ANGLE = Convert.ToDouble(item.Element("ANGLE").Value),
|
298 |
|
|
WIDTH = item.Element("WIDTH").Value,
|
299 |
|
|
HEIGHT = item.Element("HEIGHT").Value,
|
300 |
1a3a74a8
|
gaqhf
|
AREA = item.Element("AREA").Value,
|
301 |
|
|
SCENE = item.Element("SCENE").Value
|
302 |
60244a8b
|
gaqhf
|
};
|
303 |
96a2080c
|
gaqhf
|
|
304 |
60244a8b
|
gaqhf
|
TEXTINFOS.Add(text);
|
305 |
96a2080c
|
gaqhf
|
}
|
306 |
|
|
}
|
307 |
|
|
|
308 |
|
|
private void SetNote(XElement node)
|
309 |
|
|
{
|
310 |
|
|
foreach (XElement item in node.Elements("ATTRIBUTE"))
|
311 |
|
|
{
|
312 |
60244a8b
|
gaqhf
|
Note note = new Note()
|
313 |
96a2080c
|
gaqhf
|
{
|
314 |
60244a8b
|
gaqhf
|
UID = item.Element("UID").Value,
|
315 |
|
|
ATTRIBUTEVALUE = item.Element("ATTRIBUTEVALUE").Value,
|
316 |
|
|
NAME = item.Element("NAME").Value,
|
317 |
|
|
LOCATION = item.Element("LOCATION").Value,
|
318 |
|
|
VALUE = item.Element("VALUE").Value,
|
319 |
|
|
ANGLE = Convert.ToDouble(item.Element("ANGLE").Value),
|
320 |
|
|
WIDTH = item.Element("WIDTH").Value,
|
321 |
|
|
HEIGHT = item.Element("HEIGHT").Value,
|
322 |
1a3a74a8
|
gaqhf
|
AREA = item.Element("AREA").Value,
|
323 |
fc0a8c33
|
gaqhf
|
SCENE = item.Element("SCENE").Value,
|
324 |
|
|
OWNER = item.Element("OWNER").Value
|
325 |
60244a8b
|
gaqhf
|
};
|
326 |
96a2080c
|
gaqhf
|
|
327 |
60244a8b
|
gaqhf
|
NOTES.Add(note);
|
328 |
|
|
}
|
329 |
|
|
}
|
330 |
8aa6f2db
|
gaqhf
|
|
331 |
|
|
private void SetTrimLine(XElement node)
|
332 |
|
|
{
|
333 |
|
|
foreach (XElement item in node.Elements("TRIM_LINE_NO"))
|
334 |
|
|
{
|
335 |
|
|
TrimLine trimLine = new TrimLine()
|
336 |
|
|
{
|
337 |
|
|
UID = item.Element("UID").Value,
|
338 |
|
|
};
|
339 |
|
|
SetLineNumberRuns(item, trimLine.RUNS);
|
340 |
|
|
TRIMLINES.Add(trimLine);
|
341 |
|
|
}
|
342 |
|
|
}
|
343 |
|
|
|
344 |
60244a8b
|
gaqhf
|
private void SetAssociations(XElement node, List<Association> associations)
|
345 |
|
|
{
|
346 |
|
|
foreach (XElement item in node.Elements("ASSOCIATION"))
|
347 |
|
|
{
|
348 |
ea80efaa
|
gaqhf
|
Association association = new Association()
|
349 |
60244a8b
|
gaqhf
|
{
|
350 |
|
|
TYPE = item.Attribute("TYPE").Value,
|
351 |
|
|
VALUE = item.Value
|
352 |
ea80efaa
|
gaqhf
|
};
|
353 |
|
|
|
354 |
|
|
associations.Add(association);
|
355 |
96a2080c
|
gaqhf
|
}
|
356 |
|
|
}
|
357 |
60244a8b
|
gaqhf
|
|
358 |
|
|
private void SetConnectors(XElement node, List<Connector> connectors)
|
359 |
|
|
{
|
360 |
|
|
foreach (XElement item in node.Elements("CONNECTOR"))
|
361 |
|
|
{
|
362 |
|
|
connectors.Add(new Connector()
|
363 |
|
|
{
|
364 |
|
|
UID = item.Attribute("UID").Value,
|
365 |
|
|
CONNECTED_AT = Convert.ToInt32(item.Attribute("CONNECTED_AT").Value),
|
366 |
bca81f4c
|
gaqhf
|
CONNECTEDITEM = item.Element("CONNECTEDITEM").Value,
|
367 |
|
|
CONNECTPOINT = item.Element("CONNECTPOINT").Value,
|
368 |
|
|
SCENECONNECTPOINT = item.Element("SCENECONNECTPOINT").Value,
|
369 |
|
|
});
|
370 |
|
|
}
|
371 |
|
|
}
|
372 |
|
|
|
373 |
|
|
private void SetSymbolConnectors(XElement node, List<Connector> connectors, string CONNECTIONPOINT)
|
374 |
|
|
{
|
375 |
|
|
foreach (XElement item in node.Elements("CONNECTOR"))
|
376 |
|
|
{
|
377 |
|
|
connectors.Add(new Connector()
|
378 |
|
|
{
|
379 |
|
|
UID = item.Attribute("UID").Value,
|
380 |
|
|
CONNECTED_AT = Convert.ToInt32(item.Attribute("CONNECTED_AT").Value),
|
381 |
60244a8b
|
gaqhf
|
CONNECTEDITEM = item.Element("CONNECTEDITEM").Value,
|
382 |
|
|
CONNECTPOINT = item.Element("CONNECTPOINT").Value,
|
383 |
|
|
SCENECONNECTPOINT = item.Element("SCENECONNECTPOINT").Value,
|
384 |
|
|
});
|
385 |
|
|
}
|
386 |
|
|
}
|
387 |
|
|
|
388 |
|
|
private void SetProperties(XElement node, List<Property> properties)
|
389 |
|
|
{
|
390 |
|
|
foreach (XElement item in node.Elements("PROPERTY"))
|
391 |
|
|
{
|
392 |
30d2cfcc
|
gaqhf
|
properties.Add(new Property()
|
393 |
60244a8b
|
gaqhf
|
{
|
394 |
30d2cfcc
|
gaqhf
|
UID = item.Attribute("UID").Value,
|
395 |
|
|
LENGTH = item.Attribute("Length").Value,
|
396 |
|
|
EXPRESSION = item.Attribute("Expression").Value,
|
397 |
|
|
DISPLAYATTRIBUTE = item.Attribute("DisplayAttribute").Value,
|
398 |
|
|
ATTRIBUTETYPE = item.Attribute("AttributeType").Value,
|
399 |
|
|
ATTRIBUTE = item.Attribute("Attribute").Value,
|
400 |
|
|
VALUE = item.Value
|
401 |
|
|
});
|
402 |
60244a8b
|
gaqhf
|
}
|
403 |
|
|
}
|
404 |
|
|
|
405 |
|
|
private void SetAttributes(XElement node, List<Attribute> attributes)
|
406 |
|
|
{
|
407 |
30d2cfcc
|
gaqhf
|
foreach (XElement item in node.Elements("ATTRIBUTE"))
|
408 |
60244a8b
|
gaqhf
|
{
|
409 |
73415441
|
gaqhf
|
Attribute attribute = new Attribute()
|
410 |
60244a8b
|
gaqhf
|
{
|
411 |
|
|
UID = item.Attribute("UID").Value,
|
412 |
|
|
LENGTH = item.Attribute("Length").Value,
|
413 |
|
|
EXPRESSION = item.Attribute("Expression").Value,
|
414 |
|
|
DISPLAYATTRIBUTE = item.Attribute("DisplayAttribute").Value,
|
415 |
|
|
ATTRIBUTETYPE = item.Attribute("AttributeType").Value,
|
416 |
|
|
ATTRIBUTE = item.Attribute("Attribute").Value,
|
417 |
30d2cfcc
|
gaqhf
|
ATTRAT = item.Attribute("AttrAt").Value,
|
418 |
73415441
|
gaqhf
|
ASSOCITEM = item.Attribute("AssocItem").Value,
|
419 |
60244a8b
|
gaqhf
|
VALUE = item.Value
|
420 |
73415441
|
gaqhf
|
};
|
421 |
|
|
|
422 |
|
|
attributes.Add(attribute);
|
423 |
|
|
|
424 |
|
|
if (!string.IsNullOrEmpty(attribute.ASSOCITEM) && attribute.ASSOCITEM != "None")
|
425 |
|
|
{
|
426 |
|
|
Text text = _TEXTINFOS.Find(x => x.UID == attribute.ASSOCITEM);
|
427 |
|
|
if (text != null)
|
428 |
|
|
text.ASSOCIATION = true;
|
429 |
|
|
}
|
430 |
60244a8b
|
gaqhf
|
}
|
431 |
|
|
}
|
432 |
|
|
|
433 |
53c81765
|
gaqhf
|
private void SetSpecBreakAttribute(SpecBreak specBreak)
|
434 |
|
|
{
|
435 |
|
|
string upStream = specBreak.ATTRIBUTES.Find(x => x.ATTRIBUTE == "UpStream").VALUE;
|
436 |
|
|
string downStream = specBreak.ATTRIBUTES.Find(x => x.ATTRIBUTE == "DownStream").VALUE;
|
437 |
|
|
|
438 |
|
|
specBreak.UpStreamUID = upStream;
|
439 |
|
|
specBreak.DownStreamUID = downStream;
|
440 |
|
|
}
|
441 |
|
|
|
442 |
8aa6f2db
|
gaqhf
|
private void SetLineNumberRuns(XElement node, List<LineRun> lineNumberRuns)
|
443 |
60244a8b
|
gaqhf
|
{
|
444 |
|
|
foreach (XElement item in node.Elements("RUN"))
|
445 |
|
|
{
|
446 |
8aa6f2db
|
gaqhf
|
LineRun run = new LineRun()
|
447 |
60244a8b
|
gaqhf
|
{
|
448 |
|
|
TYPE = item.Attribute("TYPE").Value
|
449 |
|
|
};
|
450 |
|
|
|
451 |
|
|
foreach (XElement element in item.Elements())
|
452 |
|
|
{
|
453 |
|
|
if (element.Name == "SYMBOL")
|
454 |
|
|
{
|
455 |
c3d2e266
|
gaqhf
|
Symbol symbol = GetSymbolByUID(element.Element("UID").Value);
|
456 |
|
|
if (symbol == null)
|
457 |
3734dcc5
|
gaqhf
|
throw new Exception("Missing Item!" + "\r\nUID : " + element.Element("UID").Value);
|
458 |
c3d2e266
|
gaqhf
|
run.RUNITEMS.Add(symbol);
|
459 |
60244a8b
|
gaqhf
|
}
|
460 |
|
|
else if (element.Name == "LINE")
|
461 |
|
|
{
|
462 |
c3d2e266
|
gaqhf
|
Line line = GetLineByUID(element.Element("UID").Value);
|
463 |
|
|
if (line == null)
|
464 |
3734dcc5
|
gaqhf
|
throw new Exception("Missing Item!" + "\r\nUID : " + element.Element("UID").Value);
|
465 |
c3d2e266
|
gaqhf
|
run.RUNITEMS.Add(line);
|
466 |
60244a8b
|
gaqhf
|
}
|
467 |
|
|
}
|
468 |
|
|
lineNumberRuns.Add(run);
|
469 |
|
|
}
|
470 |
|
|
}
|
471 |
30d2cfcc
|
gaqhf
|
|
472 |
|
|
private void SetChildSymbol(Symbol symbol)
|
473 |
|
|
{
|
474 |
|
|
List<ChildSymbol> childList = new List<ChildSymbol>();
|
475 |
|
|
if (!string.IsNullOrEmpty(symbol.CHILD) && symbol.CHILD != "None")
|
476 |
|
|
{
|
477 |
|
|
string[] childArray = symbol.CHILD.Split(new char[] { '/' });
|
478 |
|
|
foreach (string sChild in childArray)
|
479 |
|
|
{
|
480 |
|
|
string[] sChildInfo = sChild.Split(new char[] { ',' });
|
481 |
|
|
childList.Add(new ChildSymbol()
|
482 |
|
|
{
|
483 |
|
|
ParentAt = Convert.ToInt32(sChildInfo[0]),
|
484 |
|
|
Direction = sChildInfo[1],
|
485 |
|
|
NAME = sChildInfo[2]
|
486 |
|
|
});
|
487 |
|
|
}
|
488 |
|
|
|
489 |
|
|
foreach (ChildSymbol child in childList)
|
490 |
|
|
{
|
491 |
|
|
if (child.ParentAt == 0)
|
492 |
|
|
symbol.ChildSymbols.Add(child);
|
493 |
|
|
else
|
494 |
|
|
childList[child.ParentAt - 1].ChildSymbols.Add(child);
|
495 |
|
|
}
|
496 |
|
|
}
|
497 |
|
|
if (!string.IsNullOrEmpty(symbol.CONNECTIONPOINT) && symbol.CONNECTIONPOINT != "None")
|
498 |
|
|
{
|
499 |
f1c9dbaa
|
gaqhf
|
// 현재 부모 Symbol에 자식 Connector까지 들어가 있음
|
500 |
30d2cfcc
|
gaqhf
|
string[] connectionArray = symbol.CONNECTIONPOINT.Split(new char[] { '/' });
|
501 |
|
|
string[] array = symbol.CONNECTIONPOINT.Split(new char[] { '/' });
|
502 |
|
|
for (int i = 0; i < array.Length; i++)
|
503 |
|
|
{
|
504 |
|
|
string[] arrConn = array[i].Split(new char[] { ',' });
|
505 |
|
|
int connIndex = Convert.ToInt32(arrConn[3]);
|
506 |
|
|
if (connIndex != 0)
|
507 |
5dfb8a24
|
gaqhf
|
{
|
508 |
30d2cfcc
|
gaqhf
|
childList[connIndex - 1].Connectors.Add(symbol.CONNECTORS[i]);
|
509 |
f1c9dbaa
|
gaqhf
|
symbol.CONNECTORS[i].Index = connIndex;
|
510 |
5dfb8a24
|
gaqhf
|
}
|
511 |
|
|
}
|
512 |
30d2cfcc
|
gaqhf
|
}
|
513 |
|
|
}
|
514 |
60244a8b
|
gaqhf
|
#endregion
|
515 |
|
|
|
516 |
|
|
public Symbol GetSymbolByUID(string uid)
|
517 |
|
|
{
|
518 |
|
|
return SYMBOLS.Find(x => x.UID == uid);
|
519 |
|
|
}
|
520 |
|
|
|
521 |
|
|
public Line GetLineByUID(string uid)
|
522 |
|
|
{
|
523 |
|
|
return LINES.Find(x => x.UID == uid);
|
524 |
|
|
}
|
525 |
d63050d6
|
gaqhf
|
|
526 |
|
|
public void SetAllConnectors()
|
527 |
|
|
{
|
528 |
|
|
foreach (var item in SYMBOLS)
|
529 |
|
|
foreach (var connector in item.CONNECTORS)
|
530 |
|
|
connector.ConnectedObject = SPPIDUtil.FindObjectByUID(this, connector.CONNECTEDITEM);
|
531 |
|
|
|
532 |
|
|
foreach (var item in LINES)
|
533 |
|
|
foreach (var connector in item.CONNECTORS)
|
534 |
|
|
connector.ConnectedObject = SPPIDUtil.FindObjectByUID(this, connector.CONNECTEDITEM);
|
535 |
|
|
|
536 |
|
|
foreach (var item in Equipments)
|
537 |
|
|
foreach (var connector in item.CONNECTORS)
|
538 |
|
|
connector.ConnectedObject = SPPIDUtil.FindObjectByUID(this, connector.CONNECTEDITEM);
|
539 |
|
|
}
|
540 |
a0e3dca4
|
gaqhf
|
|
541 |
|
|
|
542 |
|
|
|
543 |
|
|
public void ValidationCheck()
|
544 |
|
|
{
|
545 |
63c5305b
|
gaqhf
|
bool validationResult = false;
|
546 |
026f394f
|
gaqhf
|
#region Connection Check / Symbol의 SceneConnectPoint Check
|
547 |
a0e3dca4
|
gaqhf
|
foreach (var item in _SYMBOLS)
|
548 |
|
|
{
|
549 |
|
|
foreach (var connector in item.CONNECTORS)
|
550 |
|
|
{
|
551 |
|
|
if (connector.ConnectedObject != null && connector.ConnectedObject.GetType() == typeof(Line))
|
552 |
|
|
{
|
553 |
|
|
Line line = connector.ConnectedObject as Line;
|
554 |
|
|
if (line.CONNECTORS.Find(x => x.ConnectedObject == item) == null)
|
555 |
|
|
{
|
556 |
|
|
validationStringBuilder.AppendLine("Check connection!");
|
557 |
|
|
validationStringBuilder.AppendLine("Symbol UID : " + item.UID);
|
558 |
|
|
validationStringBuilder.AppendLine("Line UID : " + line.UID);
|
559 |
63c5305b
|
gaqhf
|
validationStringBuilder.AppendLine();
|
560 |
|
|
validationResult = true;
|
561 |
a0e3dca4
|
gaqhf
|
}
|
562 |
|
|
}
|
563 |
|
|
|
564 |
|
|
if (connector.SCENECONNECTPOINT == connector.CONNECTPOINT)
|
565 |
|
|
{
|
566 |
|
|
validationStringBuilder.AppendLine("Check Symbol SceneConnectPoint!");
|
567 |
|
|
validationStringBuilder.AppendLine("Symbol UID : " + item.UID);
|
568 |
63c5305b
|
gaqhf
|
validationStringBuilder.AppendLine();
|
569 |
|
|
validationResult = true;
|
570 |
a0e3dca4
|
gaqhf
|
}
|
571 |
|
|
}
|
572 |
|
|
}
|
573 |
|
|
|
574 |
|
|
foreach (var item in _LINES)
|
575 |
|
|
{
|
576 |
|
|
foreach (var connector in item.CONNECTORS)
|
577 |
|
|
{
|
578 |
|
|
if (connector.ConnectedObject != null && connector.ConnectedObject.GetType() == typeof(Symbol))
|
579 |
|
|
{
|
580 |
|
|
Symbol symbol = connector.ConnectedObject as Symbol;
|
581 |
|
|
if (symbol.CONNECTORS.Find(x => x.ConnectedObject == item) == null)
|
582 |
|
|
{
|
583 |
|
|
validationStringBuilder.AppendLine("Check connection!");
|
584 |
|
|
validationStringBuilder.AppendLine("Symbol UID : " + symbol.UID);
|
585 |
|
|
validationStringBuilder.AppendLine("Line UID : " + item.UID);
|
586 |
63c5305b
|
gaqhf
|
validationStringBuilder.AppendLine();
|
587 |
|
|
validationResult = true;
|
588 |
a0e3dca4
|
gaqhf
|
}
|
589 |
|
|
}
|
590 |
|
|
}
|
591 |
|
|
}
|
592 |
|
|
#endregion
|
593 |
|
|
|
594 |
|
|
#region Symbol Size Check
|
595 |
|
|
foreach (var item in _SYMBOLS)
|
596 |
|
|
{
|
597 |
|
|
if (item.SIZE == "0,0")
|
598 |
|
|
{
|
599 |
|
|
validationStringBuilder.AppendLine("Check symbol size!");
|
600 |
|
|
validationStringBuilder.AppendLine("Symbol UID : " + item.UID);
|
601 |
63c5305b
|
gaqhf
|
validationStringBuilder.AppendLine();
|
602 |
|
|
validationResult = true;
|
603 |
a0e3dca4
|
gaqhf
|
}
|
604 |
|
|
}
|
605 |
|
|
#endregion
|
606 |
026f394f
|
gaqhf
|
|
607 |
|
|
#region SpecBreak, EndBreak Check
|
608 |
|
|
foreach (var item in SpecBreaks)
|
609 |
|
|
{
|
610 |
|
|
object obj1 = SPPIDUtil.FindObjectByUID(this, item.UpStreamUID);
|
611 |
|
|
object obj2 = SPPIDUtil.FindObjectByUID(this, item.DownStreamUID);
|
612 |
|
|
if (obj1 == null || obj2 == null)
|
613 |
|
|
{
|
614 |
|
|
validationStringBuilder.AppendLine("Check SpecBreak UpStream, DownStream!");
|
615 |
|
|
validationStringBuilder.AppendLine("UID : " + item.UID);
|
616 |
63c5305b
|
gaqhf
|
validationStringBuilder.AppendLine();
|
617 |
|
|
validationResult = true;
|
618 |
026f394f
|
gaqhf
|
}
|
619 |
|
|
else
|
620 |
|
|
{
|
621 |
|
|
bool result = false;
|
622 |
|
|
if (obj1.GetType() == typeof(Symbol) && obj2.GetType() == typeof(Symbol))
|
623 |
|
|
{
|
624 |
|
|
Symbol symbol1 = obj1 as Symbol;
|
625 |
|
|
Symbol symbol2 = obj2 as Symbol;
|
626 |
|
|
if (symbol1.CONNECTORS.Find(x => x.ConnectedObject == symbol2) == null || symbol2.CONNECTORS.Find(x => x.ConnectedObject == symbol1) == null)
|
627 |
|
|
result = true;
|
628 |
|
|
}
|
629 |
|
|
else if (obj1.GetType() == typeof(Symbol) && obj2.GetType() == typeof(Line))
|
630 |
|
|
{
|
631 |
|
|
Symbol symbol = obj1 as Symbol;
|
632 |
|
|
Line line = obj2 as Line;
|
633 |
|
|
if (symbol.CONNECTORS.Find(x => x.ConnectedObject == line) == null || line.CONNECTORS.Find(x => x.ConnectedObject == symbol) == null)
|
634 |
|
|
result = true;
|
635 |
|
|
}
|
636 |
|
|
else if (obj1.GetType() == typeof(Line) && obj2.GetType() == typeof(Symbol))
|
637 |
|
|
{
|
638 |
|
|
Symbol symbol = obj2 as Symbol;
|
639 |
|
|
Line line = obj1 as Line;
|
640 |
|
|
if (symbol.CONNECTORS.Find(x => x.ConnectedObject == line) == null || line.CONNECTORS.Find(x => x.ConnectedObject == symbol) == null)
|
641 |
|
|
result = true;
|
642 |
|
|
}
|
643 |
|
|
else if (obj1.GetType() == typeof(Line) && obj2.GetType() == typeof(Line))
|
644 |
|
|
{
|
645 |
|
|
Line line1 = obj2 as Line;
|
646 |
|
|
Line line2 = obj1 as Line;
|
647 |
|
|
Connector connector1 = line1.CONNECTORS.Find(x => x.ConnectedObject == line2);
|
648 |
|
|
Connector connector2 = line2.CONNECTORS.Find(x => x.ConnectedObject == line1);
|
649 |
|
|
if (connector1 == null && connector2 == null)
|
650 |
|
|
result = true;
|
651 |
|
|
}
|
652 |
|
|
|
653 |
|
|
if (result)
|
654 |
|
|
{
|
655 |
|
|
validationStringBuilder.AppendLine("Check SpecBreak UpStream, DownStream!");
|
656 |
|
|
validationStringBuilder.AppendLine("UID : " + item.UID);
|
657 |
63c5305b
|
gaqhf
|
validationStringBuilder.AppendLine();
|
658 |
|
|
validationResult = true;
|
659 |
026f394f
|
gaqhf
|
}
|
660 |
|
|
}
|
661 |
|
|
}
|
662 |
|
|
|
663 |
|
|
foreach (var item in EndBreaks)
|
664 |
|
|
{
|
665 |
|
|
object obj1 = SPPIDUtil.FindObjectByUID(this, item.OWNER);
|
666 |
|
|
object obj2 = SPPIDUtil.FindObjectByUID(this, item.PROPERTIES.Find(x => x.ATTRIBUTE == "Connected Item").VALUE);
|
667 |
|
|
if (obj1 == null || obj2 == null)
|
668 |
|
|
{
|
669 |
|
|
validationStringBuilder.AppendLine("Check EndBreak Owner, Connected Item!");
|
670 |
|
|
validationStringBuilder.AppendLine("UID : " + item.UID);
|
671 |
63c5305b
|
gaqhf
|
validationStringBuilder.AppendLine();
|
672 |
|
|
validationResult = true;
|
673 |
026f394f
|
gaqhf
|
}
|
674 |
|
|
else
|
675 |
|
|
{
|
676 |
|
|
bool result = false;
|
677 |
|
|
if (obj1.GetType() == typeof(Symbol) && obj2.GetType() == typeof(Symbol))
|
678 |
|
|
{
|
679 |
|
|
Symbol symbol1 = obj1 as Symbol;
|
680 |
|
|
Symbol symbol2 = obj2 as Symbol;
|
681 |
|
|
if (symbol1.CONNECTORS.Find(x => x.ConnectedObject == symbol2) == null || symbol2.CONNECTORS.Find(x => x.ConnectedObject == symbol1) == null)
|
682 |
|
|
result = true;
|
683 |
|
|
}
|
684 |
|
|
else if (obj1.GetType() == typeof(Symbol) && obj2.GetType() == typeof(Line))
|
685 |
|
|
{
|
686 |
|
|
Symbol symbol = obj1 as Symbol;
|
687 |
|
|
Line line = obj2 as Line;
|
688 |
|
|
if (symbol.CONNECTORS.Find(x => x.ConnectedObject == line) == null || line.CONNECTORS.Find(x => x.ConnectedObject == symbol) == null)
|
689 |
|
|
result = true;
|
690 |
|
|
}
|
691 |
|
|
else if (obj1.GetType() == typeof(Line) && obj2.GetType() == typeof(Symbol))
|
692 |
|
|
{
|
693 |
|
|
Symbol symbol = obj2 as Symbol;
|
694 |
|
|
Line line = obj1 as Line;
|
695 |
|
|
if (symbol.CONNECTORS.Find(x => x.ConnectedObject == line) == null || line.CONNECTORS.Find(x => x.ConnectedObject == symbol) == null)
|
696 |
|
|
result = true;
|
697 |
|
|
}
|
698 |
|
|
else if (obj1.GetType() == typeof(Line) && obj2.GetType() == typeof(Line))
|
699 |
|
|
{
|
700 |
|
|
Line line1 = obj2 as Line;
|
701 |
|
|
Line line2 = obj1 as Line;
|
702 |
|
|
Connector connector1 = line1.CONNECTORS.Find(x => x.ConnectedObject == line2);
|
703 |
|
|
Connector connector2 = line2.CONNECTORS.Find(x => x.ConnectedObject == line1);
|
704 |
|
|
if (connector1 == null && connector2 == null)
|
705 |
|
|
result = true;
|
706 |
|
|
}
|
707 |
|
|
|
708 |
|
|
if (result)
|
709 |
|
|
{
|
710 |
|
|
validationStringBuilder.AppendLine("Check EndBreak Owner, Connected Item!");
|
711 |
|
|
validationStringBuilder.AppendLine("UID : " + item.UID);
|
712 |
63c5305b
|
gaqhf
|
validationStringBuilder.AppendLine();
|
713 |
|
|
validationResult = true;
|
714 |
026f394f
|
gaqhf
|
}
|
715 |
|
|
}
|
716 |
|
|
}
|
717 |
|
|
|
718 |
|
|
#endregion
|
719 |
d23fe61b
|
gaqhf
|
|
720 |
|
|
#region Check Flow Direction
|
721 |
|
|
foreach (var line in LINES)
|
722 |
|
|
{
|
723 |
|
|
foreach (var connector in line.CONNECTORS)
|
724 |
|
|
{
|
725 |
|
|
if (connector.ConnectedObject != null &&
|
726 |
|
|
connector.ConnectedObject.GetType() == typeof(Line) &&
|
727 |
|
|
!SPPIDUtil.IsBranchLine(line, connector.ConnectedObject as Line))
|
728 |
|
|
{
|
729 |
|
|
Line connLine = connector.ConnectedObject as Line;
|
730 |
|
|
int lineIndex1 = line.CONNECTORS.IndexOf(connector);
|
731 |
|
|
int lineIndex2 = connLine.CONNECTORS.IndexOf(connLine.CONNECTORS.Find(x => x.ConnectedObject == line));
|
732 |
|
|
if (lineIndex1 == lineIndex2 && !SPPIDUtil.IsSegmentLine(this, line, connLine))
|
733 |
|
|
{
|
734 |
|
|
validationStringBuilder.AppendLine("Check line flow direction!");
|
735 |
|
|
validationStringBuilder.AppendLine("UID : " + line.UID);
|
736 |
|
|
validationStringBuilder.AppendLine("UID : " + connLine.UID);
|
737 |
63c5305b
|
gaqhf
|
validationStringBuilder.AppendLine();
|
738 |
|
|
validationResult = true;
|
739 |
d23fe61b
|
gaqhf
|
}
|
740 |
|
|
}
|
741 |
|
|
}
|
742 |
|
|
}
|
743 |
|
|
#endregion
|
744 |
63c5305b
|
gaqhf
|
|
745 |
|
|
if (validationResult)
|
746 |
|
|
{
|
747 |
|
|
_Enable = false;
|
748 |
|
|
SPPID.Form.MessageForm message = new SPPID.Form.MessageForm(validationStringBuilder.ToString());
|
749 |
|
|
message.ShowDialog();
|
750 |
|
|
}
|
751 |
a0e3dca4
|
gaqhf
|
}
|
752 |
96a2080c
|
gaqhf
|
}
|
753 |
|
|
} |