hytos / DTI_PID / SPPIDConverter / Util / SPPIDUtil.cs @ 404185fc
이력 | 보기 | 이력해설 | 다운로드 (17.3 KB)
1 | 23eb98bf | gaqhf | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Linq; |
||
4 | using System.Text; |
||
5 | using System.Threading.Tasks; |
||
6 | using Newtonsoft.Json; |
||
7 | using System.IO; |
||
8 | b8e2644e | gaqhf | using Converter.SPPID.DB; |
9 | 23eb98bf | gaqhf | using Converter.BaseModel; |
10 | using System.Windows.Forms; |
||
11 | bca81f4c | gaqhf | using Converter.SPPID.Model; |
12 | 5dfb8a24 | gaqhf | using System.Drawing; |
13 | 23eb98bf | gaqhf | |
14 | b8e2644e | gaqhf | namespace Converter.SPPID.Util |
15 | 23eb98bf | gaqhf | { |
16 | 5dfb8a24 | gaqhf | public enum SlopeType |
17 | { |
||
18 | d1eac84d | gaqhf | None, |
19 | 5dfb8a24 | gaqhf | Slope, |
20 | HORIZONTAL, |
||
21 | VERTICAL |
||
22 | } |
||
23 | 23eb98bf | gaqhf | public class SPPIDUtil |
24 | { |
||
25 | fab4f207 | gaqhf | public static bool ConvertToSPPIDInfo(string jsonString) |
26 | 23eb98bf | gaqhf | { |
27 | 2e1e3c12 | gaqhf | SPPID_DBInfo _SPPIDInfo = SPPID_DBInfo.GetInstance(); |
28 | 23eb98bf | gaqhf | try |
29 | { |
||
30 | fab4f207 | gaqhf | SPPID_DBInfo jsonSPPIDInfo = JsonConvert.DeserializeObject<SPPID_DBInfo>(jsonString); |
31 | 23eb98bf | gaqhf | |
32 | _SPPIDInfo.DBType = jsonSPPIDInfo.DBType; |
||
33 | _SPPIDInfo.Service = jsonSPPIDInfo.Service; |
||
34 | _SPPIDInfo.Site = jsonSPPIDInfo.Site; |
||
35 | _SPPIDInfo.ServerIP = jsonSPPIDInfo.ServerIP; |
||
36 | _SPPIDInfo.Port = jsonSPPIDInfo.Port; |
||
37 | _SPPIDInfo.DBUser = jsonSPPIDInfo.DBUser; |
||
38 | _SPPIDInfo.DBPassword = jsonSPPIDInfo.DBPassword; |
||
39 | _SPPIDInfo.PlantPath = jsonSPPIDInfo.PlantPath; |
||
40 | _SPPIDInfo.PlantDic = jsonSPPIDInfo.PlantDic; |
||
41 | _SPPIDInfo.PlantPID = jsonSPPIDInfo.PlantPID; |
||
42 | _SPPIDInfo.PlantPIDDic = jsonSPPIDInfo.PlantPIDDic; |
||
43 | _SPPIDInfo.Plant = jsonSPPIDInfo.Plant; |
||
44 | _SPPIDInfo.Enable = jsonSPPIDInfo.Enable; |
||
45 | _SPPIDInfo.SelectedPlant = jsonSPPIDInfo.SelectedPlant; |
||
46 | _SPPIDInfo.PlantList = jsonSPPIDInfo.PlantList; |
||
47 | |||
48 | } |
||
49 | catch (Exception ex) |
||
50 | { |
||
51 | fab4f207 | gaqhf | _SPPIDInfo.Enable = false; |
52 | 23eb98bf | gaqhf | return false; |
53 | } |
||
54 | return true; |
||
55 | } |
||
56 | 5dfb8a24 | gaqhf | |
57 | e00e891d | gaqhf | public static bool ConvertToETCSetting(string jsonString) |
58 | { |
||
59 | ETCSetting _ETCSetting = ETCSetting.GetInstance(); |
||
60 | try |
||
61 | { |
||
62 | ETCSetting jsonETCSetting = JsonConvert.DeserializeObject<ETCSetting>(jsonString); |
||
63 | |||
64 | _ETCSetting.NoteSymbolPath = jsonETCSetting.NoteSymbolPath; |
||
65 | _ETCSetting.TextSymbolPath = jsonETCSetting.TextSymbolPath; |
||
66 | _ETCSetting.DrainValveSize = jsonETCSetting.DrainValveSize; |
||
67 | 1a3a74a8 | gaqhf | _ETCSetting.TextLocation = jsonETCSetting.TextLocation; |
68 | _ETCSetting.NoteLocation = jsonETCSetting.NoteLocation; |
||
69 | _ETCSetting.LineNumberLocation = jsonETCSetting.LineNumberLocation; |
||
70 | b2d1c1aa | gaqhf | _ETCSetting.FlowMarkSymbolPath = jsonETCSetting.FlowMarkSymbolPath; |
71 | e00e891d | gaqhf | } |
72 | catch (Exception ex) |
||
73 | { |
||
74 | return false; |
||
75 | } |
||
76 | return true; |
||
77 | } |
||
78 | bca81f4c | gaqhf | |
79 | 7cbb1038 | gaqhf | public static bool ConvertToGridSetting(string jsonString) |
80 | { |
||
81 | GridSetting _GridSetting = GridSetting.GetInstance(); |
||
82 | try |
||
83 | { |
||
84 | GridSetting jsonGridSetting = JsonConvert.DeserializeObject<GridSetting>(jsonString); |
||
85 | |||
86 | _GridSetting.UseSnapGrid = jsonGridSetting.UseSnapGrid; |
||
87 | _GridSetting.Density = jsonGridSetting.Density; |
||
88 | _GridSetting.Unit = jsonGridSetting.Unit; |
||
89 | } |
||
90 | catch (Exception ex) |
||
91 | { |
||
92 | return false; |
||
93 | } |
||
94 | return true; |
||
95 | } |
||
96 | |||
97 | 39a2a688 | gaqhf | public static bool ConvertPointBystring(string sPoint, ref double dX, ref double dY) |
98 | { |
||
99 | try |
||
100 | { |
||
101 | string[] pointArr = sPoint.Split(new char[] { ',' }); |
||
102 | if (pointArr.Length == 2) |
||
103 | { |
||
104 | dX = Convert.ToDouble(pointArr[0]); |
||
105 | dY = Convert.ToDouble(pointArr[1]); |
||
106 | } |
||
107 | } |
||
108 | catch (Exception) |
||
109 | { |
||
110 | dX = 0; |
||
111 | dY = 0; |
||
112 | return false; |
||
113 | } |
||
114 | |||
115 | return true; |
||
116 | } |
||
117 | bca81f4c | gaqhf | |
118 | 39a2a688 | gaqhf | public static void ConvertSPPIDPoint(ref double dX, ref double dY, double dDwgX, double dDwgY, double SPPID_Width, double SPPID_Height) |
119 | { |
||
120 | 1b261371 | gaqhf | decimal calcX = 0; |
121 | decimal calcY = 0; |
||
122 | decimal tempX = Convert.ToDecimal(dX); |
||
123 | decimal tempY = Convert.ToDecimal(dY); |
||
124 | decimal tempWidth = Convert.ToDecimal(SPPID_Width); |
||
125 | decimal tempHeight = Convert.ToDecimal(SPPID_Height); |
||
126 | decimal tempDwgX = Convert.ToDecimal(dDwgX); |
||
127 | decimal tempDwgY = Convert.ToDecimal(dDwgY); |
||
128 | |||
129 | c3d2e266 | gaqhf | //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 | 1b261371 | gaqhf | calcX = (tempX * tempWidth) / tempDwgX; |
137 | calcY = tempHeight - ((tempY * tempHeight) / tempDwgY); |
||
138 | c3d2e266 | gaqhf | dX = Convert.ToDouble(calcX); |
139 | dY = Convert.ToDouble(calcY); |
||
140 | 39a2a688 | gaqhf | } |
141 | bca81f4c | gaqhf | |
142 | 06b40010 | gaqhf | public static void ConvertGridPoint(ref double x, ref double y) |
143 | { |
||
144 | GridSetting _GridSetting = GridSetting.GetInstance(); |
||
145 | if (_GridSetting.UseSnapGrid) |
||
146 | { |
||
147 | if (_GridSetting.Unit == GridUnit.Inch) |
||
148 | { |
||
149 | double length = _GridSetting.Density * 0.0254; |
||
150 | double tempX = x; |
||
151 | double tempY = y; |
||
152 | x = Math.Round(tempX / length) * length; |
||
153 | y = Math.Round(tempY / length) * length; |
||
154 | b66a2996 | gaqhf | } |
155 | } |
||
156 | } |
||
157 | 4d2571ab | gaqhf | |
158 | b66a2996 | gaqhf | public static void ConvertGridPointOnlyOnePoint(ref double value) |
159 | { |
||
160 | GridSetting _GridSetting = GridSetting.GetInstance(); |
||
161 | if (_GridSetting.UseSnapGrid) |
||
162 | { |
||
163 | if (_GridSetting.Unit == GridUnit.Inch) |
||
164 | { |
||
165 | double temp = value; |
||
166 | d9794a6c | gaqhf | value = Math.Round(value / _GridSetting.Length) * _GridSetting.Length; |
167 | 06b40010 | gaqhf | } |
168 | } |
||
169 | } |
||
170 | |||
171 | 5dfb8a24 | gaqhf | public static SlopeType CalcSlope(double x1, double y1, double x2, double y2) |
172 | { |
||
173 | if (x1 - x2 == 0) |
||
174 | { |
||
175 | return SlopeType.VERTICAL; |
||
176 | } |
||
177 | else |
||
178 | { |
||
179 | double angle = Math.Atan(Math.Abs(y2 - y1) / Math.Abs(x2 - x1)) * 180 / Math.PI; |
||
180 | d9794a6c | gaqhf | if (angle <= 15) |
181 | 5dfb8a24 | gaqhf | return SlopeType.HORIZONTAL; |
182 | d9794a6c | gaqhf | else if (angle >= 75) |
183 | 5dfb8a24 | gaqhf | return SlopeType.VERTICAL; |
184 | else |
||
185 | return SlopeType.Slope; |
||
186 | } |
||
187 | } |
||
188 | |||
189 | 5e6ecf05 | gaqhf | public static double CalcLineToPointDistance(double lineX1, double lineY1, double lineX2, double lineY2, double x, double y) |
190 | { |
||
191 | |||
192 | double distance = 0; |
||
193 | if (lineX1 == lineX2) |
||
194 | distance = Math.Abs(x - lineX1); |
||
195 | else |
||
196 | { |
||
197 | double a; |
||
198 | double b; |
||
199 | double c; |
||
200 | |||
201 | a = (lineY2 - lineY1) / (lineX2 - lineX1); |
||
202 | b = -1; |
||
203 | c = -a * lineX1 + lineY1; |
||
204 | |||
205 | distance = Math.Abs(a * x + b * y + c) / Math.Pow(a * a + b * b, 0.5); |
||
206 | } |
||
207 | return distance; |
||
208 | } |
||
209 | |||
210 | 56bc67e1 | gaqhf | public static double[] CalcLineCrossingPoint(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) |
211 | { |
||
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 | double a1; |
||
223 | double a2; |
||
224 | double b1; |
||
225 | double b2; |
||
226 | |||
227 | if (x1 == x2) |
||
228 | a1 = 0; |
||
229 | else |
||
230 | a1 = (y2 - y1) / (x2 - x1); |
||
231 | if (x3 == x4) |
||
232 | a2 = 0; |
||
233 | else |
||
234 | a2 = (y4 - y3) / (x4 - x3); |
||
235 | |||
236 | b1 = -a1 * x1 + y1; |
||
237 | b2 = -a2 * x3 + y3; |
||
238 | |||
239 | if ((x1 == x2 && x3 == x4) || |
||
240 | (y1 == y2 && y3 == y4)) |
||
241 | { |
||
242 | return null; |
||
243 | } |
||
244 | else if (x1 == x2) |
||
245 | { |
||
246 | return new double[] { x1, a2*x1 + b2 }; |
||
247 | } |
||
248 | else if (x3 == x4) |
||
249 | { |
||
250 | return new double[] { x3, a1 * x3 + b1 }; |
||
251 | } |
||
252 | else |
||
253 | { |
||
254 | return new double[] { -(b1 - b2) / (a1 - a2), a1 * (-(b1 - b2) / (a1 - a2) + b1) }; |
||
255 | } |
||
256 | } |
||
257 | d1eac84d | gaqhf | |
258 | 30a9ffce | gaqhf | public static double CalcPointToPointdDistance(double x1, double y1, double x2, double y2) |
259 | { |
||
260 | return Math.Pow(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2), 0.5); |
||
261 | } |
||
262 | |||
263 | bca81f4c | gaqhf | public static object FindObjectByUID(Document document, string UID) |
264 | { |
||
265 | d63050d6 | gaqhf | if (!string.IsNullOrEmpty(UID) && UID != "None") |
266 | bca81f4c | gaqhf | { |
267 | d63050d6 | gaqhf | foreach (Symbol item in document.SYMBOLS) |
268 | { |
||
269 | if (item.UID == UID) |
||
270 | return item; |
||
271 | } |
||
272 | bca81f4c | gaqhf | |
273 | d63050d6 | gaqhf | foreach (Line item in document.LINES) |
274 | { |
||
275 | if (item.UID == UID) |
||
276 | return item; |
||
277 | } |
||
278 | bca81f4c | gaqhf | |
279 | d63050d6 | gaqhf | foreach (Text item in document.TEXTINFOS) |
280 | { |
||
281 | if (item.UID == UID) |
||
282 | return item; |
||
283 | } |
||
284 | bca81f4c | gaqhf | |
285 | d63050d6 | gaqhf | foreach (Note item in document.NOTES) |
286 | { |
||
287 | if (item.UID == UID) |
||
288 | return item; |
||
289 | } |
||
290 | bca81f4c | gaqhf | |
291 | d63050d6 | gaqhf | foreach (LineNumber item in document.LINENUMBERS) |
292 | { |
||
293 | if (item.UID == UID) |
||
294 | return item; |
||
295 | } |
||
296 | bca81f4c | gaqhf | |
297 | d63050d6 | gaqhf | foreach (Equipment item in document.Equipments) |
298 | { |
||
299 | if (item.UID == UID) |
||
300 | return item; |
||
301 | } |
||
302 | 809a7640 | gaqhf | } |
303 | |||
304 | bca81f4c | gaqhf | return null; |
305 | } |
||
306 | d1eac84d | gaqhf | |
307 | 335b7a24 | gaqhf | public static List<Line> FindLinesByModelId(Document document, string ModelItemId) |
308 | { |
||
309 | List<Line> lines = new List<Line>(); |
||
310 | foreach (Line item in document.LINES) |
||
311 | { |
||
312 | if (item.SPPID.ModelItemId == ModelItemId) |
||
313 | lines.Add(item); |
||
314 | } |
||
315 | |||
316 | return lines; |
||
317 | } |
||
318 | d1eac84d | gaqhf | |
319 | 4d2571ab | gaqhf | public static void FindConnectedSymbolGroup(Document document, Symbol symbol, List<Symbol> group) |
320 | b9cc9254 | gaqhf | { |
321 | f1a7faf9 | gaqhf | if (!group.Contains(symbol)) |
322 | group.Add(symbol); |
||
323 | |||
324 | 4d2571ab | gaqhf | foreach (var connector in symbol.CONNECTORS) |
325 | b9cc9254 | gaqhf | { |
326 | 4d2571ab | gaqhf | object connectedItem = FindObjectByUID(document, connector.CONNECTEDITEM); |
327 | if (connectedItem != null && connectedItem.GetType() == typeof(Symbol)) |
||
328 | b9cc9254 | gaqhf | { |
329 | 4d2571ab | gaqhf | Symbol connSymbol = connectedItem as Symbol; |
330 | if (!group.Contains(connSymbol)) |
||
331 | b9cc9254 | gaqhf | { |
332 | 4d2571ab | gaqhf | group.Add(connSymbol); |
333 | FindConnectedSymbolGroup(document, connSymbol, group); |
||
334 | b9cc9254 | gaqhf | } |
335 | } |
||
336 | } |
||
337 | } |
||
338 | |||
339 | 4d2571ab | gaqhf | public static Symbol FindCenterAtThreeSymbols(Document document, List<Symbol> group) |
340 | d1eac84d | gaqhf | { |
341 | 4d2571ab | gaqhf | Symbol result = null; |
342 | |||
343 | // Group의 가운데 찾기 |
||
344 | if (group.Count == 3) |
||
345 | d1eac84d | gaqhf | { |
346 | 4d2571ab | gaqhf | foreach (var symbol in group) |
347 | { |
||
348 | int count = 0; |
||
349 | foreach (var connector in symbol.CONNECTORS) |
||
350 | { |
||
351 | object item = FindObjectByUID(document, connector.CONNECTEDITEM); |
||
352 | if (item != null && item.GetType() == typeof(Symbol) && group.Contains(item as Symbol)) |
||
353 | count++; |
||
354 | } |
||
355 | d1eac84d | gaqhf | |
356 | 4d2571ab | gaqhf | if (count == 2) |
357 | { |
||
358 | result = symbol; |
||
359 | break; |
||
360 | } |
||
361 | } |
||
362 | d1eac84d | gaqhf | } |
363 | |||
364 | 4d2571ab | gaqhf | return result; |
365 | d1eac84d | gaqhf | } |
366 | |||
367 | private static void GetConnectedSymbol(Document document, Symbol symbol, List<Symbol> symbolGroup) |
||
368 | { |
||
369 | foreach (Connector connector in symbol.CONNECTORS) |
||
370 | { |
||
371 | object item = FindObjectByUID(document, connector.CONNECTEDITEM); |
||
372 | if (item != null && item.GetType() == typeof(Symbol)) |
||
373 | { |
||
374 | Symbol connSymbol = item as Symbol; |
||
375 | if (connSymbol != null && !symbolGroup.Contains(connSymbol)) |
||
376 | { |
||
377 | symbolGroup.Add(connSymbol); |
||
378 | GetConnectedSymbol(document, connSymbol, symbolGroup); |
||
379 | } |
||
380 | } |
||
381 | } |
||
382 | } |
||
383 | 2fdb56bf | gaqhf | |
384 | public static Connector FindSymbolConnectorByUID(Document document, string uid, Symbol targetSymbol) |
||
385 | { |
||
386 | foreach (var connector in targetSymbol.CONNECTORS) |
||
387 | { |
||
388 | if (connector.CONNECTEDITEM == uid) |
||
389 | { |
||
390 | return connector; |
||
391 | } |
||
392 | } |
||
393 | |||
394 | return null; |
||
395 | } |
||
396 | 71ba1ca3 | gaqhf | |
397 | public static Symbol FindSymbolByRepresentationID(Document document, string repID) |
||
398 | { |
||
399 | Symbol findSymbol = null; |
||
400 | foreach (var symbol in document.SYMBOLS) |
||
401 | { |
||
402 | if (symbol.SPPID.RepresentationId == repID) |
||
403 | { |
||
404 | findSymbol = symbol; |
||
405 | } |
||
406 | else |
||
407 | { |
||
408 | ChildSymbol childSymbol = FindChildSymbolByRepresentationID(document, symbol, repID); |
||
409 | if (childSymbol != null) |
||
410 | findSymbol = symbol; |
||
411 | } |
||
412 | |||
413 | if (findSymbol != null) |
||
414 | break; |
||
415 | } |
||
416 | |||
417 | return findSymbol; |
||
418 | } |
||
419 | |||
420 | public static ChildSymbol FindChildSymbolByRepresentationID(Document document, Symbol symbol, string repID) |
||
421 | { |
||
422 | ChildSymbol childSymbol = null; |
||
423 | |||
424 | foreach (ChildSymbol loopChild in symbol.ChildSymbols) |
||
425 | { |
||
426 | if (loopChild.SPPID.RepresentationId == repID) |
||
427 | { |
||
428 | childSymbol = loopChild; |
||
429 | break; |
||
430 | } |
||
431 | else |
||
432 | { |
||
433 | childSymbol = FindChildSymbolByRepresentationIDLoop(document, repID, loopChild); |
||
434 | if (childSymbol != null) |
||
435 | break; |
||
436 | } |
||
437 | } |
||
438 | |||
439 | return childSymbol; |
||
440 | } |
||
441 | |||
442 | private static ChildSymbol FindChildSymbolByRepresentationIDLoop(Document document, string repID, ChildSymbol childSymbol) |
||
443 | { |
||
444 | ChildSymbol findChild = null; |
||
445 | |||
446 | foreach (var item in childSymbol.ChildSymbols) |
||
447 | { |
||
448 | if (item.SPPID.RepresentationId == repID) |
||
449 | { |
||
450 | findChild = item; |
||
451 | break; |
||
452 | } |
||
453 | else |
||
454 | { |
||
455 | findChild = FindChildSymbolByRepresentationIDLoop(document, repID, item); |
||
456 | if (findChild != null) |
||
457 | break; |
||
458 | } |
||
459 | } |
||
460 | |||
461 | return findChild; |
||
462 | } |
||
463 | d9794a6c | gaqhf | |
464 | public static bool IsBranchLine(Line line1, Line line2) |
||
465 | { |
||
466 | bool result = true; |
||
467 | |||
468 | Connector conn1 = line1.CONNECTORS.Find(x => x.CONNECTEDITEM == line2.UID); |
||
469 | Connector conn2 = line2.CONNECTORS.Find(x => x.CONNECTEDITEM == line1.UID); |
||
470 | |||
471 | if (conn1 != null && conn2 != null) |
||
472 | result = false; |
||
473 | |||
474 | return result; |
||
475 | } |
||
476 | |||
477 | 6d12a734 | gaqhf | public static void CalcOverlap(double[] range1, double[] range2, ref double x, ref double y, ref bool overlapX, ref bool overlapY) |
478 | d9794a6c | gaqhf | { |
479 | if (range1[0] <= range2[2] && range1[2] >= range2[0]) |
||
480 | { |
||
481 | 6d12a734 | gaqhf | overlapX = true; |
482 | d9794a6c | gaqhf | x = Math.Min(Math.Abs(range1[0] - range2[2]), Math.Abs(range1[2] - range2[0])); |
483 | } |
||
484 | |||
485 | if (range1[1] <= range2[3] && range1[3] >= range2[1]) |
||
486 | { |
||
487 | 6d12a734 | gaqhf | overlapY = true; |
488 | d9794a6c | gaqhf | y = Math.Min(Math.Abs(range1[1] - range2[3]), Math.Abs(range1[3] - range2[1])); |
489 | } |
||
490 | } |
||
491 | |||
492 | public static void CalcNewCoordinateForSymbol(Symbol symbol, Symbol prevSymbol, double distanceX, double distanceY) |
||
493 | { |
||
494 | SlopeType slopeType = SPPIDUtil.CalcSlope(prevSymbol.SPPID.ORIGINAL_X, prevSymbol.SPPID.ORIGINAL_Y, symbol.SPPID.ORIGINAL_X, symbol.SPPID.ORIGINAL_Y); |
||
495 | GridSetting _GridSetting = GridSetting.GetInstance(); |
||
496 | if (slopeType == SlopeType.HORIZONTAL) |
||
497 | { |
||
498 | double length = (Math.Ceiling(distanceX / _GridSetting.Length) + 1) * _GridSetting.Length; |
||
499 | if (prevSymbol.SPPID.ORIGINAL_X < symbol.SPPID.ORIGINAL_X) |
||
500 | symbol.SPPID.ORIGINAL_X = symbol.SPPID.ORIGINAL_X + length; |
||
501 | else |
||
502 | symbol.SPPID.ORIGINAL_X = symbol.SPPID.ORIGINAL_X - length; |
||
503 | } |
||
504 | else if (slopeType == SlopeType.VERTICAL) |
||
505 | { |
||
506 | double length = (Math.Ceiling(distanceY / _GridSetting.Length) + 1) * _GridSetting.Length; |
||
507 | if (prevSymbol.SPPID.ORIGINAL_Y < symbol.SPPID.ORIGINAL_Y) |
||
508 | symbol.SPPID.ORIGINAL_Y = symbol.SPPID.ORIGINAL_Y + length; |
||
509 | else |
||
510 | symbol.SPPID.ORIGINAL_Y = symbol.SPPID.ORIGINAL_Y - length; |
||
511 | } |
||
512 | } |
||
513 | 23eb98bf | gaqhf | } |
514 | } |