프로젝트

일반

사용자정보

개정판 a0e3dca4

IDa0e3dca465636997b86e34362f8b403766a6fbf7
상위 31911f94
하위 6a85128e

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

dev issue #706 : Line modeling 수정 / ValidationCheck 추가 / 우선순위 Modeling 적용 / 에러 메시지 추가

Change-Id: I382716081a63a8fa2ac2b983ac7194c0c4b57ce7

차이점 보기:

DTI_PID/SPPIDConverter/Util/SPPIDUtil.cs
126 126
            decimal tempDwgX = Convert.ToDecimal(dDwgX);
127 127
            decimal tempDwgY = Convert.ToDecimal(dDwgY);
128 128

  
129
            //calcX = (tempX * tempWidth) / tempDwgX;
130
            //calcX = Math.Truncate(calcX * 1000) / 1000;
131
            //calcY = tempHeight - ((tempY * tempHeight) / tempDwgY);
132
            //calcY = Math.Truncate(calcY * 1000) / 1000;
133
            //dX = Math.Round(Convert.ToDouble(calcX), 10);
134
            //dY = Math.Round(Convert.ToDouble(calcY), 10);
135

  
136 129
            calcX = (tempX * tempWidth) / tempDwgX;
137 130
            calcY = tempHeight - ((tempY * tempHeight) / tempDwgY);
138 131
            dX = Convert.ToDouble(calcX);
......
167 160
                }
168 161
            }
169 162
        }
163
        public static double ConvertGridPointOnlyOnePoint(double value)
164
        {
165
            GridSetting _GridSetting = GridSetting.GetInstance();
166
            if (_GridSetting.UseSnapGrid)
167
            {
168
                if (_GridSetting.Unit == GridUnit.Inch)
169
                {
170
                    double temp = value;
171
                    value = Math.Round(value / _GridSetting.Length) * _GridSetting.Length;
172
                }
173
            }
174

  
175
            return value;
176
        }
170 177

  
171 178
        public static SlopeType CalcSlope(double x1, double y1, double x2, double y2)
172 179
        {
......
209 216

  
210 217
        public static double[] CalcLineCrossingPoint(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
211 218
        {
212
            x1 = Math.Round(x1, 10);
213
            x2 = Math.Round(x2, 10);
214
            x3 = Math.Round(x3, 10);
215
            x4 = Math.Round(x4, 10);
216

  
217
            y1 = Math.Round(y1, 10);
218
            y2 = Math.Round(y2, 10);
219
            y3 = Math.Round(y3, 10);
220
            y4 = Math.Round(y4, 10);
221

  
222 219
            double a1;
223 220
            double a2;
224 221
            double b1;
......
474 471
            return result;
475 472
        }
476 473

  
474
        public static bool IsBranchLine(Line line)
475
        {
476
            Connector connector = line.CONNECTORS.Find(x => 
477
            x.ConnectedObject != null && 
478
            x.ConnectedObject.GetType() == typeof(Line) && 
479
            IsBranchLine(line, x.ConnectedObject as Line));
480
            return connector != null ? true : false;
481
        }
477 482
        public static void CalcOverlap(double[] range1, double[] range2, ref double x, ref double y, ref bool overlapX, ref bool overlapY)
478 483
        {
479 484
            if (range1[0] <= range2[2] && range1[2] >= range2[0])
......
510 515
                    symbol.SPPID.ORIGINAL_Y = symbol.SPPID.ORIGINAL_Y - length;
511 516
            }
512 517
        }
518

  
519
        public static bool GetLineConnectorPoint(Line line, Connector connector, ref double x, ref double y)
520
        {
521
            bool bStart = false;
522
            int index = line.CONNECTORS.IndexOf(connector);
523
            if (index == 0)
524
            {
525
                x = line.SPPID.START_X;
526
                y = line.SPPID.START_Y;
527
                bStart = true;
528
            }
529
            else
530
            {
531
                x = line.SPPID.END_X;
532
                y = line.SPPID.END_Y;
533
            }
534
            return bStart;
535
        }
513 536
    }
514 537
}

내보내기 Unified diff

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