프로젝트

일반

사용자정보

개정판 5e67ad61

ID5e67ad61c226e6dd250e4da855a62227530f4eca
상위 a1df4864
하위 ec47b5b2

gaqhf 이(가) 5년 이상 전에 추가함

dev issue #000 : add drain valve

Change-Id: Iaf373184285d5ad6a619849839620347ea745bf3

차이점 보기:

DTI_PID/SPPIDConverter_AutoModeling/Modeling/AutoModeling.cs
28 28

  
29 29
        public void Run()
30 30
        {
31
            List<Group> drainGroup = new List<Group>();
32

  
31 33
            CloseOPCForm.Run();
32 34

  
33 35
            ProgressForm.SetProgressAllValue(0);
......
64 66
                        loopAction = true;
65 67
                        GroupLineModeling(group);
66 68
                        document.GROUPS.Remove(group);
69

  
70
                        if (group.Items.Count == 2)
71
                        {
72
                            object item1 = group.Items[0];
73
                            object item2 = group.Items[1];
74
                            if (item1.GetType() == typeof(Line) && item2.GetType() == typeof(Symbol))
75
                            {
76
                                Line line = item1 as Line;
77
                                Symbol symbol = item2 as Symbol;
78
                                if (line.SPPIDMAPPINGNAME.ToUpper().Contains("PRIMARY") && symbol.SPPIDMAPPINGNAME.ToUpper().Contains("VALVE"))
79
                                    drainGroup.Add(group);
80
                            }
81
                            else if (item1.GetType() == typeof(Symbol) && item2.GetType() == typeof(Line))
82
                            {
83
                                Line line = item2 as Line;
84
                                Symbol symbol = item1 as Symbol;
85
                                if (line.SPPIDMAPPINGNAME.ToUpper().Contains("PRIMARY") && symbol.SPPIDMAPPINGNAME.ToUpper().Contains("VALVE"))
86
                                    drainGroup.Add(group);
87
                            }
88
                        }
89

  
67 90
                        break;
68 91
                    }
69 92
                }
......
87 110
            System.Threading.Thread.Sleep(100);
88 111
            // End
89 112

  
113
            // EndBreak Modeling
114
            ProgressForm.UpdateStatus("End Break Modeling");
115
            ProgressForm.SetProgressStatusValue(0);
116
            ProgressForm.SetProgressStatusMax(document.ENDBREAK.Count);
117
            foreach (EndBreak item in document.ENDBREAK)
118
            {
119
                item.Modeling(document);
120

  
121
                ProgressForm.IncreaseProgressStatus();
122
            }
123
            ProgressForm.SetProgressStatusMax();
124
            ProgressForm.IncreaseProgressAll();
125
            System.Threading.Thread.Sleep(100);
126
            // End
127

  
128

  
90 129
            // SprecBreak Modeling
91 130
            ProgressForm.UpdateStatus("Spec Break Modeling");
92 131
            ProgressForm.SetProgressStatusValue(0);
......
185 224
            System.Threading.Thread.Sleep(100);
186 225
            // End
187 226

  
227
            // Input Drain Valve Attribute
228
            ProgressForm.UpdateStatus("Input Drain Valve Attribute");
229
            ProgressForm.SetProgressStatusValue(0);
230
            ProgressForm.SetProgressStatusMax(document.SYMBOLS.Count);
231
            foreach (Group group in drainGroup)
232
            {
233
                if (group.Items.Count == 2)
234
                {
235
                    object item1 = group.Items[0];
236
                    object item2 = group.Items[1];
237
                    ItemAttribute itemAttribute = new ItemAttribute()
238
                    {
239
                        Attribute = "NominalDiameter",
240
                        VALUE = document.AttributeMapping["DrainSize"],
241
                        SPPIDMAPPINGNAME = "NOMINALDIAMETER"
242
                    };
243
                    if (item1.GetType() == typeof(Line) && item2.GetType() == typeof(Symbol))
244
                    {
245
                        Line line = item1 as Line;
246
                        Symbol symbol = item2 as Symbol;
247
                        if (line.SPPIDMAPPINGNAME.ToUpper().Contains("PRIMARY") && symbol.SPPIDMAPPINGNAME.ToUpper().Contains("VALVE"))
248
                        {
249
                            line.ATTRIBUTES.Clear();
250
                            line.ATTRIBUTES.Add(itemAttribute);
251
                            symbol.ASSOCIATIONS.Clear();
252
                            symbol.ATTRIBUTES.Clear();
253
                            symbol.ATTRIBUTES.Add(itemAttribute);
254
                            line.SetAttribute(document);
255
                            symbol.SetAttribute(document);
256
                        }
257
                    }
258
                    else if (item1.GetType() == typeof(Symbol) && item2.GetType() == typeof(Line))
259
                    {
260
                        Line line = item2 as Line;
261
                        Symbol symbol = item1 as Symbol;
262
                        if (line.SPPIDMAPPINGNAME.ToUpper().Contains("PRIMARY") && symbol.SPPIDMAPPINGNAME.ToUpper().Contains("VALVE"))
263
                        {
264
                            line.ATTRIBUTES.Clear();
265
                            line.ATTRIBUTES.Add(itemAttribute);
266
                            symbol.ASSOCIATIONS.Clear();
267
                            symbol.ATTRIBUTES.Clear();
268
                            symbol.ATTRIBUTES.Add(itemAttribute);
269
                            line.SetAttribute(document);
270
                            symbol.SetAttribute(document);
271
                        }
272
                    }
273
                }
274
            }
275
            ProgressForm.SetProgressStatusMax();
276
            ProgressForm.IncreaseProgressAll();
277
            System.Threading.Thread.Sleep(100);
278

  
188 279
            CloseOPCForm.Stop();
189 280
            //
190 281
            //Log.WriteLine(new ListBoxItem(string.Format("Time : {0}", ts), Color.Black), logListBox);

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)