프로젝트

일반

사용자정보

개정판 cf210438

IDcf21043833e36fa207265a878b011ba4f2bd8650
상위 a925672d
하위 c52c1783, c2b9f64e

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

dev issue #000 : add branched Line 판별 메소드 추가

Change-Id: Ibda182fd403affd6aeeef72054b2c2d7de4ffec9

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.cs
86 86
                    Log.Write("Start Modeling");
87 87
                    SplashScreenManager.ShowForm(typeof(SPPIDSplashScreen), true, true);
88 88
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetParent, (IntPtr)radApp.HWnd);
89
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllStepCount, 17);
89
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllStepCount, 18);
90 90
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetDocumentName, DocumentLabelText);
91 91

  
92 92
                    // Equipment Modeling
......
95 95
                    RunSymbolModeling();
96 96
                    // LineRun Line Modeling
97 97
                    RunLineModeling();
98
                    // Branch Line Modeling
99
                    RunBranchLineModeling();
100 98
                    // Clear Attribute
101 99
                    RunClearValueInconsistancy();
102 100
                    // EndBreak Modeling
......
202 200
        }
203 201
        private void RunLineModeling()
204 202
        {
205
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.LINES.Count);
206
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Lines Modeling");
207
            SetPriorityLine();
208
            foreach (var item in document.LINES)
203
            List<Line> AllLine = document.LINES.ToList();
204
            List<Line> stepLast_Line = document.LINES.FindAll(x => x.CONNECTORS.FindAll(y => y.ConnectedObject != null && y.ConnectedObject.GetType() == typeof(Symbol)).Count == 2 &&
205
            !SPPIDUtil.IsBranchedLine(document, x));
206
            List<Line> step1_Line = AllLine.FindAll(x => !stepLast_Line.Contains(x));
207

  
208
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, step1_Line.Count);
209
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Lines Modeling - 1");
210

  
211
            SetPriorityLine(step1_Line);
212
            foreach (var item in step1_Line)
209 213
            {
210 214
                try
211 215
                {
......
220 224
                    Log.Write(ex.StackTrace);
221 225
                }
222 226
            }
223
        }
224
        private void RunBranchLineModeling()
225
        {
227

  
226 228
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, BranchLines.Count);
227
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Branch Lines Modeling");
229
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Lines Modeling - 2");
228 230
            int branchCount = BranchLines.Count;
229 231
            while (BranchLines.Count > 0)
230 232
            {
......
248 250
                    Log.Write(ex.StackTrace);
249 251
                    break;
250 252
                }
253

  
254
                bool EnableBranchModeling(Line line)
255
                {
256
                    bool result = true;
257
                    if (line.CONNECTORS.FindAll(x => x.ConnectedObject != null &&
258
                    x.ConnectedObject.GetType() == typeof(Line) &&
259
                    string.IsNullOrEmpty(((Line)x.ConnectedObject).SPPID.ModelItemId)).Count > 0)
260
                        result = false;
261

  
262
                    return result;
263
                }
251 264
            }
252 265

  
253
            bool EnableBranchModeling(Line line)
266
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, stepLast_Line.Count);
267
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Lines Modeling - 3");
268
            foreach (var item in stepLast_Line)
254 269
            {
255
                bool result = true;
256
                if (line.CONNECTORS.FindAll(x => x.ConnectedObject != null && 
257
                x.ConnectedObject.GetType() == typeof(Line) && 
258
                string.IsNullOrEmpty(((Line)x.ConnectedObject).SPPID.ModelItemId)).Count > 0)
259
                    result = false;
260

  
261
                return result;
270
                try
271
                {
272
                    NewLineModeling(item);
273
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null);
274
                }
275
                catch (Exception ex)
276
                {
277
                    Log.Write("Error in NewLineModeling");
278
                    Log.Write("UID : " + item.UID);
279
                    Log.Write(ex.Message);
280
                    Log.Write(ex.StackTrace);
281
                }
262 282
            }
263 283
        }
264 284
        private void RunClearValueInconsistancy()
......
3752 3772
            return symbols;
3753 3773
        }
3754 3774

  
3755
        private void SetPriorityLine()
3775
        private void SetPriorityLine(List<Line> lines)
3756 3776
        {
3757
            document.LINES.Sort(SortLinePriority);
3777
            lines.Sort(SortLinePriority);
3758 3778

  
3759 3779
            int SortLinePriority(Line a, Line b)
3760 3780
            {

내보내기 Unified diff

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