프로젝트

일반

사용자정보

통계
| 개정판:

hytos / DTI_PID / SPPIDConverter / SPPIDModel / SPPID_Document.cs @ bd1985ec

이력 | 보기 | 이력해설 | 다운로드 (24.2 KB)

1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.Data;
7
using Converter.BaseModel;
8
using Converter.SPPID.Util;
9

    
10
namespace Converter.SPPID.Model
11
{
12
    public class SPPID_Document : Document
13
    {
14
        public SPPID_Document(string xmlPath) : base(xmlPath)
15
        {
16
            
17
        }
18

    
19
        public List<SymbolMapping> SymbolMappings;
20
        public List<ChildSymbolMapping> ChildSymbolMappings;
21
        public List<LineMapping> LineMappings;
22
        public List<LineNumberMapping> LineNumberMappings;
23
        public List<AttributeMapping> AttributeMappings;
24
        public ETCSetting ETCSetting;
25
        public DataTable SymbolTable { get; set; }
26

    
27
        public List<Group> GROUPS = new List<Group>();
28

    
29
        public string DrawingName { get; set; }
30
        public string DrawingNumber { get; set; }
31
        public string Unit { get; set; }
32
        public string Template { get; set; }
33
        public string SPPID_DrawingNumber { get; set; }
34
        public string SPPID_DrawingName { get; set; }
35

    
36
        public void SetSPPIDInfo()
37
        {
38
            foreach (var item in SYMBOLS)
39
            {
40
                if (item.SPPID == null)
41
                    item.SPPID = new SPPIDSymbolInfo();
42

    
43
                foreach (var childSymbol in item.ChildSymbols)
44
                {
45
                    if (childSymbol.SPPID == null)
46
                        childSymbol.SPPID = new SPPIDSymbolInfo();
47
                    SetChildSymbolSPPIDInfo(childSymbol);
48
                }
49
            }
50

    
51
            foreach (var item in LINES)
52
            {
53
                if (item.SPPID == null)
54
                    item.SPPID = new SPPIDLineInfo();
55
            }
56

    
57
            foreach (var item in Equipments)
58
            {
59
                if (item.SPPID == null)
60
                    item.SPPID = new SPPIDSymbolInfo();
61
            }
62

    
63
            foreach (var item in EndBreaks)
64
            {
65
                if (item.SPPID == null)
66
                    item.SPPID = new SPPIDSymbolInfo();
67
            }
68

    
69
            foreach (var item in SpecBreaks)
70
            {
71
                if (item.SPPID == null)
72
                    item.SPPID = new SPPIDSymbolInfo();
73
            }
74

    
75
            foreach (var item in LINENUMBERS)
76
            {
77
                if (item.SPPID == null)
78
                    item.SPPID = new SPPIDSymbolInfo();
79
            }
80

    
81
            foreach (var item in TEXTINFOS)
82
            {
83
                if (item.SPPID == null)
84
                    item.SPPID = new SPPIDSymbolInfo();
85
            }
86

    
87
            foreach (var item in NOTES)
88
            {
89
                if (item.SPPID == null)
90
                    item.SPPID = new SPPIDSymbolInfo();
91
            }
92
        }
93

    
94
        public void SetSPPIDLocation(double SPPIDDocumentX, double SPPIDDocumentY)
95
        {
96
            foreach (var item in SYMBOLS)
97
            {
98
                double x = double.NaN;
99
                double y = double.NaN;
100
                SPPIDUtil.ConvertPointBystring(item.ORIGINALPOINT, ref x, ref y);
101
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
102

    
103
                item.SPPID.ORIGINAL_X = x;
104
                item.SPPID.ORIGINAL_Y = y;
105
            }
106

    
107
            foreach (var item in LINES)
108
            {
109
                double startX = double.NaN;
110
                double startY = double.NaN;
111

    
112
                SPPIDUtil.ConvertPointBystring(item.STARTPOINT, ref startX, ref startY);
113
                SPPIDUtil.ConvertSPPIDPoint(ref startX, ref startY, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
114
                item.SPPID.START_X = startX;
115
                item.SPPID.START_Y = startY;
116

    
117
                double endX = double.NaN;
118
                double endY = double.NaN;
119

    
120
                SPPIDUtil.ConvertPointBystring(item.ENDPOINT, ref endX, ref endY);
121
                SPPIDUtil.ConvertSPPIDPoint(ref endX, ref endY, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
122
                item.SPPID.END_X = endX;
123
                item.SPPID.END_Y = endY;
124

    
125
                item.SlopeType = SPPIDUtil.CalcSlope(startX, startY, endX, endY);
126
            }
127

    
128
            foreach (var item in Equipments)
129
            {
130
                double x = double.NaN;
131
                double y = double.NaN;
132
                SPPIDUtil.ConvertPointBystring(item.ORIGINALPOINT, ref x, ref y);
133
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
134

    
135
                item.SPPID.ORIGINAL_X = x;
136
                item.SPPID.ORIGINAL_Y = y;
137
            }
138

    
139
            foreach (var item in EndBreaks)
140
            {
141
                double x = double.NaN;
142
                double y = double.NaN;
143
                SPPIDUtil.ConvertPointBystring(item.ORIGINALPOINT, ref x, ref y);
144
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
145
                item.SPPID.ORIGINAL_X = x;
146
                item.SPPID.ORIGINAL_Y = y;
147
            }
148

    
149
            foreach (var item in SpecBreaks)
150
            {
151
                double x = double.NaN;
152
                double y = double.NaN;
153
                SPPIDUtil.ConvertPointBystring(item.ORIGINALPOINT, ref x, ref y);
154
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
155

    
156
                item.SPPID.ORIGINAL_X = x;
157
                item.SPPID.ORIGINAL_Y = y;
158
            }
159

    
160
            foreach (var item in LINENUMBERS)
161
            {
162
                double x = double.NaN;
163
                double y = double.NaN;
164
                SPPIDUtil.ConvertPointBystring(item.LOCATION, ref x, ref y);
165
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
166
                item.SPPID.ORIGINAL_X = x;
167
                item.SPPID.ORIGINAL_Y = y;
168

    
169
                item.SPPIDLabelLocation = new SPPIDLabelLocationInfo();
170
                double x1 = item.X1;
171
                double y1 = item.Y1;
172
                double x2 = item.X2;
173
                double y2 = item.Y2;
174
                SPPIDUtil.ConvertSPPIDPoint(ref x1, ref y1, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
175
                SPPIDUtil.ConvertSPPIDPoint(ref x2, ref y2, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
176
                item.SPPIDLabelLocation.X1 = Math.Min(x1, x2);
177
                item.SPPIDLabelLocation.Y1 = Math.Min(y1, y2);
178
                item.SPPIDLabelLocation.X2 = Math.Max(x1, x2);
179
                item.SPPIDLabelLocation.Y2 = Math.Max(y1, y2);
180
            }
181

    
182
            foreach (var item in TEXTINFOS)
183
            {
184
                double x = double.NaN;
185
                double y = double.NaN;
186
                SPPIDUtil.ConvertPointBystring(item.LOCATION, ref x, ref y);
187
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
188
                item.SPPID.ORIGINAL_X = x;
189
                item.SPPID.ORIGINAL_Y = y;
190

    
191
                item.SPPIDLabelLocation = new SPPIDLabelLocationInfo();
192
                double x1 = item.X1;
193
                double y1 = item.Y1;
194
                double x2 = item.X2;
195
                double y2 = item.Y2;
196
                SPPIDUtil.ConvertSPPIDPoint(ref x1, ref y1, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
197
                SPPIDUtil.ConvertSPPIDPoint(ref x2, ref y2, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
198
                item.SPPIDLabelLocation.X1 = Math.Min(x1, x2);
199
                item.SPPIDLabelLocation.Y1 = Math.Min(y1, y2);
200
                item.SPPIDLabelLocation.X2 = Math.Max(x1, x2);
201
                item.SPPIDLabelLocation.Y2 = Math.Max(y1, y2);
202
            }
203

    
204
            foreach (var item in NOTES)
205
            {
206
                double x = double.NaN;
207
                double y = double.NaN;
208
                SPPIDUtil.ConvertPointBystring(item.LOCATION, ref x, ref y);
209
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
210
                item.SPPID.ORIGINAL_X = x;
211
                item.SPPID.ORIGINAL_Y = y;
212

    
213
                item.SPPIDLabelLocation = new SPPIDLabelLocationInfo();
214
                double x1 = item.X1;
215
                double y1 = item.Y1;
216
                double x2 = item.X2;
217
                double y2 = item.Y2;
218
                SPPIDUtil.ConvertSPPIDPoint(ref x1, ref y1, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
219
                SPPIDUtil.ConvertSPPIDPoint(ref x2, ref y2, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
220
                item.SPPIDLabelLocation.X1 = Math.Min(x1, x2);
221
                item.SPPIDLabelLocation.Y1 = Math.Min(y1, y2);
222
                item.SPPIDLabelLocation.X2 = Math.Max(x1, x2);
223
                item.SPPIDLabelLocation.Y2 = Math.Max(y1, y2);
224
            }
225
        }
226

    
227
        /// <summary>
228
        /// 좌표 보정
229
        /// </summary>
230
        public void CoordinateCorrection()
231
        {
232
            foreach (Symbol symbol in SYMBOLS)
233
            {
234
                if (!symbol.SPPID.IsCorrectionX)
235
                {
236
                    List<object> group = new List<object>();
237
                    group.Add(symbol);
238
                    FindGroupBySymbolAndSlopeType(symbol, group, SlopeType.VERTICAL);
239

    
240
                    List<Symbol> groupSymbols = (from sym in @group
241
                                                 where sym.GetType() == typeof(Symbol)
242
                                                 select sym as Symbol).ToList();
243

    
244
                    // X 좌표만 보정
245
                    Symbol correctionSymbol = groupSymbols.Find(x => x.SPPID.IsCorrectionX);
246
                    double value = symbol.SPPID.ORIGINAL_X;
247
                    if (correctionSymbol == null)
248
                        SPPIDUtil.ConvertGridPointOnlyOnePoint(ref value);
249
                    else
250
                        value = correctionSymbol.SPPID.ORIGINAL_X;
251

    
252
                    foreach (var item in groupSymbols)
253
                    {
254
                        item.SPPID.IsCorrectionX = true;
255
                        item.SPPID.ORIGINAL_X = value;
256
                        item.SPPID.CorrectionX_GroupSymbols = groupSymbols;
257
                    }
258
                }
259

    
260
                if (!symbol.SPPID.IsCorrectionY)
261
                {
262
                    List<object> group = new List<object>();
263
                    group.Add(symbol);
264
                    FindGroupBySymbolAndSlopeType(symbol, group, SlopeType.HORIZONTAL);
265

    
266
                    List<Symbol> groupSymbols = (from sym in @group
267
                                                 where sym.GetType() == typeof(Symbol)
268
                                                 select sym as Symbol).ToList();
269

    
270
                    // Y 좌표만 보정
271
                    Symbol correctionSymbol = groupSymbols.Find(x => x.SPPID.IsCorrectionY);
272
                    double value = symbol.SPPID.ORIGINAL_Y;
273
                    if (correctionSymbol == null)
274
                        SPPIDUtil.ConvertGridPointOnlyOnePoint(ref value);
275
                    else
276
                        value = correctionSymbol.SPPID.ORIGINAL_Y;
277

    
278
                    foreach (var item in groupSymbols)
279
                    {
280
                        item.SPPID.IsCorrectionY = true;
281
                        item.SPPID.ORIGINAL_Y = value;
282
                        item.SPPID.CorrectionY_GroupSymbols = groupSymbols;
283
                    }
284
                }
285
            }
286

    
287
            foreach (Line line in LINES)
288
            {
289
                double tempX = line.SPPID.START_X;
290
                double tempY = line.SPPID.START_Y;
291
                SPPIDUtil.ConvertGridPoint(ref tempX, ref tempY);
292
                line.SPPID.START_X = tempX;
293
                line.SPPID.START_Y = tempY;
294

    
295
                tempX = line.SPPID.END_X;
296
                tempY = line.SPPID.END_Y;
297
                SPPIDUtil.ConvertGridPoint(ref tempX, ref tempY);
298
                line.SPPID.END_X = tempX;
299
                line.SPPID.END_Y = tempY;
300

    
301
                if (line.SlopeType == SlopeType.HORIZONTAL)
302
                    line.SPPID.END_Y = line.SPPID.START_Y;
303
                else if (line.SlopeType == SlopeType.VERTICAL)
304
                    line.SPPID.END_X = line.SPPID.START_X;
305
            }
306
        }
307

    
308
        private void FindGroupBySymbolAndSlopeType(Symbol symbol, List<object> group, SlopeType searchType)
309
        {
310
            foreach (var connector in symbol.CONNECTORS)
311
            {
312
                object connectedItem = SPPIDUtil.FindObjectByUID(this, connector.CONNECTEDITEM);
313
                if (connectedItem != null && connectedItem.GetType() == typeof(Symbol))
314
                {
315
                    Symbol connSymbol = connectedItem as Symbol;
316
                    SlopeType slopeType = SPPIDUtil.CalcSlope(symbol.SPPID.ORIGINAL_X, symbol.SPPID.ORIGINAL_Y, connSymbol.SPPID.ORIGINAL_X, connSymbol.SPPID.ORIGINAL_Y);
317
                    if (slopeType == searchType)
318
                    {
319
                        if (!group.Contains(connSymbol))
320
                        {
321
                            group.Add(connSymbol);
322
                            FindGroupBySymbolAndSlopeType(connSymbol, group, searchType);
323
                        }
324
                    }
325
                }
326
                else if (connectedItem != null && connectedItem.GetType() == typeof(Line))
327
                {
328
                    Line connLine = connectedItem as Line;
329

    
330
                    Connector otherConnector = connLine.CONNECTORS.Find(x => x.CONNECTEDITEM != symbol.UID);
331
                    int connectorIndex = connLine.CONNECTORS.IndexOf(otherConnector);
332
                    double lineX = double.NaN;
333
                    double lineY = double.NaN;
334
                    // Symbol의 Connector ScenePoint
335
                    SPPIDUtil.ConvertPointBystring(connectorIndex == 0 ? connLine.STARTPOINT : connLine.ENDPOINT, ref lineX, ref lineY);
336
                    double symbolX = double.NaN;
337
                    double symbolY = double.NaN;
338
                    SPPIDUtil.ConvertPointBystring(symbol.ORIGINALPOINT, ref symbolX, ref symbolY);
339

    
340
                    SlopeType slopeType = SPPIDUtil.CalcSlope(lineX, lineY, symbolX, symbolY);
341
                    if (slopeType == searchType)
342
                    {
343
                        if (!group.Contains(connLine))
344
                        {
345
                            group.Add(connLine);
346
                            FindGroupByLineAndSlopeType(connLine, group, searchType);
347
                        }
348
                    }
349
                }
350
            }
351
        }
352

    
353
        private void FindGroupByLineAndSlopeType(Line line, List<object> group, SlopeType searchType)
354
        {
355
            foreach (var connector in line.CONNECTORS)
356
            {
357
                object connectedItem = SPPIDUtil.FindObjectByUID(this, connector.CONNECTEDITEM);
358
                if (connectedItem != null && connectedItem.GetType() == typeof(Symbol))
359
                {
360
                    Symbol connSymbol = connectedItem as Symbol;
361

    
362
                    Connector otherConnector = line.CONNECTORS.Find(x => x.CONNECTEDITEM != connSymbol.UID);
363
                    int connectorIndex = line.CONNECTORS.IndexOf(otherConnector);
364
                    double lineX = double.NaN;
365
                    double lineY = double.NaN;
366
                    // Line의 Connector ScenePoint
367
                    SPPIDUtil.ConvertPointBystring(connectorIndex == 0 ? line.STARTPOINT : line.ENDPOINT, ref lineX, ref lineY);
368
                    double symbolX = double.NaN;
369
                    double symbolY = double.NaN;
370
                    SPPIDUtil.ConvertPointBystring(connSymbol.ORIGINALPOINT, ref symbolX, ref symbolY);
371

    
372
                    SlopeType slopeType = SPPIDUtil.CalcSlope(lineX, lineY, symbolX, symbolY);
373
                    if (slopeType == searchType)
374
                    {
375
                        if (!group.Contains(connSymbol))
376
                        {
377
                            group.Add(connSymbol);
378
                            FindGroupBySymbolAndSlopeType(connSymbol, group, searchType);
379
                        }
380
                    }
381
                }
382
                else if (connectedItem != null && connectedItem.GetType() == typeof(Line))
383
                {
384
                    Line connLine = connectedItem as Line;
385
                    SlopeType slopeType = SPPIDUtil.CalcSlope(connLine.SPPID.START_X, connLine.SPPID.START_Y, connLine.SPPID.END_X, connLine.SPPID.END_Y);
386
                    if (slopeType == searchType)
387
                    {
388
                        if (!group.Contains(connLine))
389
                        {
390
                            group.Add(connLine);
391
                            FindGroupByLineAndSlopeType(connLine, group, searchType);
392
                        }
393
                    }
394
                }
395
            }
396
        }
397

    
398
        private void SetChildSymbolSPPIDInfo(ChildSymbol item)
399
        {
400
            foreach (var childSymbol in item.ChildSymbols)
401
            {
402
                if (childSymbol.SPPID == null)
403
                    childSymbol.SPPID = new SPPIDSymbolInfo();
404
                SetChildSymbolSPPIDInfo(childSymbol);
405
            }
406
        }
407
      
408
        public bool SetSPPIDMapping()
409
        {
410
            bool result = true;
411
            StringBuilder sb = new StringBuilder();
412
            foreach (var item in SYMBOLS)
413
            {
414
                SymbolMapping mapping = SymbolMappings.Find(x => x.UID == item.DBUID);
415
                item.SPPID.MAPPINGNAME = mapping != null ? mapping.SPPIDSYMBOLNAME : null;
416
                if (string.IsNullOrEmpty(item.SPPID.MAPPINGNAME))
417
                {
418
                    result = false;
419
                    sb.AppendLine("Need Mapping Symbol Name : " + item.NAME);
420
                }
421
                    
422

    
423
                foreach (var childSymbol in item.ChildSymbols)
424
                {
425
                    ChildSymbolMapping childMapping = ChildSymbolMappings.Find(x => x.UID == childSymbol.NAME);
426
                    childSymbol.SPPID.MAPPINGNAME = childMapping != null ? childMapping.SPPIDSYMBOLNAME : null;
427
                    if (string.IsNullOrEmpty(childSymbol.SPPID.MAPPINGNAME) || !SetChildSymbolMapping(childSymbol))
428
                    {
429
                        result = false;
430
                        sb.AppendLine("Need Mapping Symbol Name : " + childSymbol.NAME);
431
                    }
432
                }
433
            }
434

    
435
            foreach (var item in LINES)
436
            {
437
                LineMapping mapping = LineMappings.Find(x => x.UID == item.TYPEUID);
438
                item.SPPID.MAPPINGNAME = mapping != null ? mapping.SPPIDSYMBOLNAME : null;
439
                if (string.IsNullOrEmpty(item.SPPID.MAPPINGNAME))
440
                {
441
                    result = false;
442
                    sb.AppendLine("Need Mapping Line Type : " + item.TYPE);
443
                }
444
            }
445

    
446
            foreach (var item in Equipments)
447
            {
448
                SymbolMapping mapping = SymbolMappings.Find(x => x.UID == item.DBUID);
449
                item.SPPID.MAPPINGNAME = mapping != null ? mapping.SPPIDSYMBOLNAME : null;
450
                if (string.IsNullOrEmpty(item.SPPID.MAPPINGNAME))
451
                {
452
                    result = false;
453
                    sb.AppendLine("Need Mapping Symbol Name : " + item.NAME);
454
                }
455
            }
456

    
457
            foreach (var item in EndBreaks)
458
            {
459
                SymbolMapping mapping = SymbolMappings.Find(x => x.UID == item.DBUID);
460
                item.SPPID.MAPPINGNAME = mapping != null ? mapping.SPPIDSYMBOLNAME : null;
461
                if (string.IsNullOrEmpty(item.SPPID.MAPPINGNAME))
462
                {
463
                    result = false;
464
                    sb.AppendLine("Need Mapping Symbol Name : " + item.NAME);
465
                }
466
            }
467

    
468
            foreach (var item in LINENUMBERS)
469
            {
470
                if (LineNumberMappings.Count > 0)
471
                    item.SPPID.MAPPINGNAME = LineNumberMappings[0].SPPIDSYMBOLNAME;
472
                if (string.IsNullOrEmpty(item.SPPID.MAPPINGNAME))
473
                {
474
                    result = false;
475
                    sb.AppendLine("Need Mapping LineNumber Mapping");
476
                }
477
            }
478

    
479
            ETCSetting etc = ETCSetting.GetInstance();
480
            foreach (var item in NOTES)
481
            {
482
                item.SPPID.MAPPINGNAME = etc.NoteSymbolPath;
483
                if (string.IsNullOrEmpty(item.SPPID.MAPPINGNAME))
484
                {
485
                    result = false;
486
                    sb.AppendLine("Need Mapping Note Mapping");
487
                }
488
            }
489

    
490
            foreach (var item in TEXTINFOS)
491
            {
492
                item.SPPID.MAPPINGNAME = etc.TextSymbolPath;
493
                if (string.IsNullOrEmpty(item.SPPID.MAPPINGNAME))
494
                {
495
                    result = false;
496
                    sb.AppendLine("Need Mapping Text Mapping");
497
                }
498
            }
499

    
500
            if (!result)
501
                ValidationMessage += sb.ToString();
502
            else
503
                MappingValidation = true;
504

    
505
            return result;
506
        }
507

    
508
        private bool SetChildSymbolMapping(ChildSymbol item)
509
        {
510
            foreach (var childSymbol in item.ChildSymbols)
511
            {
512
                ChildSymbolMapping childMapping = ChildSymbolMappings.Find(x => x.UID == childSymbol.NAME);
513
                childSymbol.SPPID.MAPPINGNAME = childMapping != null ? childMapping.SPPIDSYMBOLNAME : null;
514
                if (string.IsNullOrEmpty(childSymbol.SPPID.MAPPINGNAME))
515
                    return false;
516
                else
517
                    return SetChildSymbolMapping(childSymbol);
518
            }
519

    
520
            return true;
521
        }
522

    
523
        public void CheckModelingResult()
524
        {
525
            StringBuilder sb = new StringBuilder();
526
            sb.AppendLine("Modeling Result");
527
            foreach (var item in Equipments)
528
            {
529
                if (string.IsNullOrEmpty(item.SPPID.RepresentationId))
530
                    sb.AppendLine("Fail Equipment Modeling UID : " + item.UID);
531
            }
532
            foreach (var item in SYMBOLS)
533
            {
534
                if (string.IsNullOrEmpty(item.SPPID.RepresentationId))
535
                    sb.AppendLine("Fail Symbol Modeling UID : " + item.UID);
536
                foreach (var child in item.ChildSymbols)
537
                {
538
                    if (string.IsNullOrEmpty(item.SPPID.RepresentationId))
539
                    {
540
                        sb.AppendLine("Fail Child Symbol Modeling UID : " + item.UID);
541
                        sb.AppendLine("Fail Child Symbol Name : " + child.NAME);
542
                    }
543
                    loop(child, item, sb);
544
                }
545
            }
546
            foreach (var item in LINES)
547
            {
548
                if (string.IsNullOrEmpty(item.SPPID.ModelItemId))
549
                    sb.AppendLine("Fail Line Modeling UID : " + item.UID);
550
            }
551
            foreach (var item in LINENUMBERS)
552
            {
553
                if (string.IsNullOrEmpty(item.SPPID.RepresentationId))
554
                    sb.AppendLine("Fail Line Number Modeling UID : " + item.UID);
555
            }
556
            foreach (var item in NOTES)
557
            {
558
                if (string.IsNullOrEmpty(item.SPPID.RepresentationId))
559
                    sb.AppendLine("Fail Note Text Modeling UID : " + item.UID);
560
            }
561
            foreach (var item in TEXTINFOS)
562
            {
563
                if (string.IsNullOrEmpty(item.SPPID.RepresentationId))
564
                    sb.AppendLine("Fail Text Modeling UID : " + item.UID);
565
            }
566
            foreach (var item in EndBreaks)
567
            {
568
                if (string.IsNullOrEmpty(item.SPPID.RepresentationId))
569
                    sb.AppendLine("Fail End Break Modeling UID : " + item.UID);
570
            }
571
            foreach (var item in SpecBreaks)
572
            {
573
                if (string.IsNullOrEmpty(item.SPPID.RepresentationId))
574
                    sb.AppendLine("Fail SpecBreak Modeling UID : " + item.UID);
575
            }
576
            sb.AppendLine("End Modeling Result");
577
            Log.Write(sb.ToString());
578
        }
579

    
580
        private void loop(ChildSymbol childLoop, Symbol item, StringBuilder sb)
581
        {
582
            foreach (var childLoopLoop in childLoop.ChildSymbols)
583
            {
584
                if (string.IsNullOrEmpty(item.SPPID.RepresentationId))
585
                {
586
                    sb.AppendLine("Fail Child Symbol Modeling UID : " + item.UID);
587
                    sb.AppendLine("Fail Child Symbol Name : " + childLoopLoop.NAME);
588
                }
589
                loop(childLoopLoop, item, sb);
590
            }
591
        }
592
    }
593
}
클립보드 이미지 추가 (최대 크기: 500 MB)