천호석
2022-06-17 4de9ea98e13449174aa2cd09c8351fc0e978f44a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
using System;
using System.Collections.Generic;
 
namespace SHARP_CLAS_UI
{
    public class Scanner_Recipe
    {
        #region Enum
        public enum Ablation_Style
        {
            LEFT_RIGHT_ZIGZAG,
            LEFT_TO_RIGHT,
            TOP_TO_BOTTOM_ZIGZAG,
        }
        #endregion
 
        #region Property
        public List<Scanner_Position_Info> Recipe_Pos_Info { get; private set; }
 
        public Ablation_Style ablation_style { get; private set; }
 
        public float working_area_x { get; private set; }
        public float working_area_y { get; private set; }
        public float process_area_start_x { get; private set; }
        public float process_area_start_y { get; private set; }
        public float process_area_end_x { get; private set; }
        public float process_area_end_y { get; private set; }
 
        public float distance { get; private set; }
        public int jump_repeat { get; private set; }
        public int jump_range { get; private set; }
 
        public float process_area_degree { get; private set; }
        public float distance_start { get; private set; }
        public int repeat_start { get; private set; }
        public float distance_end { get; private set; }
        public int repeat_end { get; private set; }
 
        public float height_X { get; private set; }
        public float height_Y { get; private set; }
 
        public bool Reverse { get; private set; }
        #endregion
 
        #region Construct
 
        //구버전 가공
        public Scanner_Recipe(float working_area_x, float working_area_y, float process_area_x, float process_area_y,
            float distance = 0.1f, int jump_repeat = 0, int jump_range = 0, Ablation_Style ablation_style = Ablation_Style.LEFT_RIGHT_ZIGZAG)
        {
            this.working_area_x = Math.Abs(working_area_x);
            this.working_area_y = Math.Abs(working_area_y);
 
 
            float Data_X, Data_Y;
            float degree_X, degree_Y;
            float startx, starty;
            this.process_area_degree = (float)DegreeToRadian(0);
            startx = process_area_x / 2;
            starty = process_area_y / 2;
            Data_X = (float)(Math.Cos(process_area_degree));
            Data_Y = (float)(Math.Sin(process_area_degree));
            degree_X = (startx * Data_X - starty * Data_Y);
            degree_Y = (startx * Data_Y + starty * Data_X);
            if (this.process_area_degree == 0)
            {
                float process_area_start_x = -startx;
                float process_area_start_y = -starty;
                float process_area_end_x = startx;
                float process_area_end_y = starty;
            }
            else
            {
                float process_area_start_x = -degree_X;
                float process_area_start_y = -degree_Y;
                float process_area_end_x = degree_X;
                float process_area_end_y = degree_Y;
            }
            this.process_area_start_x = Math.Abs(process_area_start_x) > working_area_x / 2 ? -(working_area_x / 2) : process_area_start_x;
            this.process_area_start_y = Math.Abs(process_area_start_y) > working_area_y / 2 ? -(working_area_y / 2) : process_area_start_y;
            this.process_area_end_x = Math.Abs(process_area_end_x) > working_area_x / 2 ? working_area_x / 2 : process_area_end_x < process_area_start_x ? working_area_x : process_area_end_x;
            this.process_area_end_y = Math.Abs(process_area_end_y) > working_area_y / 2 ? working_area_y / 2 : process_area_end_y < process_area_start_y ? working_area_x : process_area_end_y;
            this.ablation_style = ablation_style;
            this.distance = distance < 0.001f ? 0.001f : distance;
 
            this.jump_repeat = Math.Abs(jump_repeat);
            this.jump_range = Math.Abs(jump_range);
            Recipe_Pos_Info = new List<Scanner_Position_Info>();
            Fill_Recipe_Pos_Info();
        }
 
        //신버전 가공 Recipe Setting 후 변경 진행
        public Scanner_Recipe(float working_area_x, float working_area_y, float process_area_start_x, float process_area_start_y, float process_area_end_x, float process_area_end_y,
            float distance = 0.1f, int jump_repeat = 0, int jump_range = 0, float dis_start = 0f, float dis_end = 0f, int rep_start = 0, int rep_end = 0,
            Ablation_Style ablation_style = Ablation_Style.TOP_TO_BOTTOM_ZIGZAG, double degree = 0, bool reverse = false)
        {
            float Data_X, Data_Y;
            float degree_X_Start, degree_Y_Start, degree_X_End, degree_Y_End;
            float startx, starty, endx, endy;
            float sam_x, sam_y;
 
            this.working_area_x = working_area_x;
            this.working_area_y = working_area_y;
            this.process_area_degree = (float)DegreeToRadian(degree);
 
            startx = process_area_start_x;
            starty = process_area_start_y;
            endx = process_area_end_x;
            endy = process_area_end_y;
 
            if (reverse)
            {
                sam_x = process_area_start_x - process_area_end_x;
                sam_y = process_area_start_y - process_area_end_y;
            }
            else
            {
                sam_x = -(process_area_start_x - process_area_end_x);
                sam_y = -(process_area_start_y - process_area_end_y);
            }
 
 
            this.height_X = sam_x;
            this.height_Y = sam_y;
 
            //Data_X = (float)(Math.Cos(process_area_degree));
            //Data_Y = (float)(Math.Sin(process_area_degree));
 
            //degree_X_Start = (float)Math.Round((startx * Data_X - starty * Data_Y),3, MidpointRounding.AwayFromZero);
            //degree_Y_Start = (float)Math.Round((startx * Data_Y + starty * Data_X), 3, MidpointRounding.AwayFromZero);
 
            //degree_X_End = (float)Math.Round((startx * Data_X - endy * Data_Y), 3, MidpointRounding.AwayFromZero);
            //degree_Y_End = (float)Math.Round((startx * Data_Y + endy * Data_X), 3, MidpointRounding.AwayFromZero);
 
            //if (this.process_area_degree == 0)
            //{
                this.process_area_start_x = process_area_start_x;
                this.process_area_start_y = process_area_start_y;
                this.process_area_end_x = process_area_start_x;
                this.process_area_end_y = process_area_end_y;
            //}
            //else
            //{
 
            //    this.process_area_start_x = degree_X_Start;
            //    this.process_area_start_y = degree_Y_Start;
            //    this.process_area_end_x = degree_X_End;
            //    this.process_area_end_y = degree_Y_End;
            //}
                this.ablation_style = ablation_style;
                this.distance = distance < 0.001f ? 0.001f : distance;
                this.distance_start = dis_start < 0.001f ? 0.001f : dis_start;
                this.distance_end = dis_end < 0.001f ? 0.001f : dis_end;
 
 
                this.jump_repeat = Math.Abs(jump_repeat);
                this.jump_range = Math.Abs(jump_range);
                this.repeat_start = rep_start;
                this.repeat_end = rep_end;
                this.Reverse = reverse;
                Recipe_Pos_Info = new List<Scanner_Position_Info>();
 
                if (!Reverse)
                    Fill_Recipe_Pos_Info_Start();
                else
                    Fill_Recipe_Pos_Info_end();
            
        }
        #endregion
 
        #region Fuction
        public void Fill_Recipe_Pos_Info()
        {
            float valid_x = working_area_x;
            float valid_y = working_area_y;
            float valid_distance = distance * valid_y;
            float start_x = process_area_start_x * valid_x;
            float start_y = process_area_start_y * valid_y;
            float end_x = process_area_end_x * valid_x;
            float end_y = process_area_end_y * valid_y;
 
 
            bool jump_repeat_start = false;
            float line_cnt;
            int cnt = 0, jump_cnt = 0, jump_length = 0;
            short scan_start_x, scan_start_y, scan_end_x, scan_end_y;
            Recipe_Pos_Info.Clear();
            
            if (valid_x == 0 || valid_y == 0 || valid_distance == 0)
                return;
            
            DateTime dt = DateTime.Now;
            System.Diagnostics.Debug.WriteLine(dt);
 
            if (ablation_style == Ablation_Style.TOP_TO_BOTTOM_ZIGZAG)
            {
                line_cnt = start_y;
                valid_distance = distance * valid_y;
                while (line_cnt <= end_y)
                {
                    scan_start_x = (short)start_x;
                    scan_start_y = (short)(line_cnt);
                    scan_end_x = (short)end_x;
                    scan_end_y = (short)(line_cnt);
 
                    if (ablation_style == Ablation_Style.TOP_TO_BOTTOM_ZIGZAG)
                    {
                        if (cnt % 2 == 0)
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, true));
                        }
                        else
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, true));
                        }
                    }
 
                    line_cnt += valid_distance;
                    jump_length++;
                    cnt++;
                }
            }
            else
            {
                line_cnt = start_x;
                valid_distance = distance * valid_x;
 
                while (line_cnt <= end_x)
                {
 
                    scan_start_x = (short)(line_cnt);
                    scan_start_y = (short)start_y;
                    scan_end_x = (short)(line_cnt);
                    scan_end_y = (short)end_y;
                    if (ablation_style == Ablation_Style.LEFT_RIGHT_ZIGZAG)
                    {
                        if (cnt % 2 == 0)
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, true));
                        }
                        else
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, true));
                        }
                    }
                    else if (ablation_style == Ablation_Style.LEFT_TO_RIGHT)
                    {
                        if (cnt % 2 == 0)
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, true));
                        }
                        else
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, true));
                        }
                    }
                    line_cnt += valid_distance;
                    jump_length++;
                    cnt++;
                }
            }
            System.Diagnostics.Debug.WriteLine((DateTime.Now - dt).TotalSeconds);
        }
 
        public void Fill_Recipe_Pos_Info_Start()
        {
            float valid_x = (working_area_x);
            float valid_y = (working_area_y);
            float valid_distance = distance;
            float start_x = process_area_start_x;
            float start_y = process_area_start_y;
            float end_x = process_area_end_x;
            float end_y = process_area_end_y;
            float dis_Start = distance_start;
 
            float height_x = height_X;
            float height_y = height_Y;
 
            float Data_X = (float)(Math.Cos(process_area_degree));
            float Data_Y = (float)(Math.Sin(process_area_degree));
 
            bool jump_repeat_start = false;
            float line_cnt;
            float line_cnt_end;
            int cnt = 0, jump_cnt = 0, jump_length = 0;
            short scan_start_x, scan_start_y, scan_end_x, scan_end_y;
            Recipe_Pos_Info.Clear();
 
            if (valid_x == 0 || valid_y == 0 || valid_distance == 0 || dis_Start == 0)
                return;
 
            DateTime dt = DateTime.Now;
            System.Diagnostics.Debug.WriteLine(dt);
 
            if (ablation_style == Ablation_Style.TOP_TO_BOTTOM_ZIGZAG)
            {
                line_cnt = start_y;
                valid_distance = distance * valid_y;
                
                while (line_cnt <= start_y + height_y)
                {
                    scan_start_x = (short)((float)Math.Round(((start_x * Data_X - line_cnt * Data_Y) * valid_x), 3, MidpointRounding.AwayFromZero) - (float)Math.Round(-((end_x / 2) * valid_x), 3, MidpointRounding.AwayFromZero));
                    scan_start_y = (short)(float)Math.Round(((start_x * Data_Y + line_cnt * Data_X) * valid_y), 3, MidpointRounding.AwayFromZero);
                    scan_end_x = (short)((float)Math.Round(((end_x * Data_X - line_cnt * Data_Y) * valid_x), 3, MidpointRounding.AwayFromZero) - (float)Math.Round(-((end_x / 2) * valid_x), 3, MidpointRounding.AwayFromZero));
                    scan_end_y = (short)(float)Math.Round(((end_x * Data_Y + line_cnt * Data_X) * valid_y), 3, MidpointRounding.AwayFromZero);
 
                    if (ablation_style == Ablation_Style.TOP_TO_BOTTOM_ZIGZAG)
                    {
                        if (cnt % 2 == 0)
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, true));
                        }
                        else
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, true));
                        }
                    }
 
                    if (cnt + 1 < repeat_start)
                    {
                        line_cnt += dis_Start;
                    }
                    else if (cnt + 1 > repeat_start)
                    {
                        line_cnt += valid_distance;
                    }
                    jump_length++;
                    cnt++;
                }
            }
            else
            {
                line_cnt = start_x;
                valid_distance = distance;
 
                while (line_cnt <= start_x+height_x)
                {
 
                    //scan_start_x = (short)(start_x + line_cnt);
                    //scan_start_y = (short)start_y;
                    //scan_end_x = (short)(end_x + line_cnt);
                    //scan_end_y = (short)end_y;
 
                    scan_start_x = (short)(float)Math.Round(-((line_cnt * Data_X - start_y * Data_Y) * valid_x), 3, MidpointRounding.AwayFromZero);
                    scan_start_y = (short)((float)Math.Round(-((line_cnt * Data_Y + start_y * Data_X) * valid_y), 3, MidpointRounding.AwayFromZero) - (float)Math.Round(-((end_y / 2) * valid_x), 3, MidpointRounding.AwayFromZero));
                    scan_end_x = (short)(float)Math.Round(-((line_cnt * Data_X - end_y * Data_Y) * valid_x), 3, MidpointRounding.AwayFromZero);
                    scan_end_y = (short)((float)Math.Round(-((line_cnt * Data_Y + end_y * Data_X) * valid_y), 3, MidpointRounding.AwayFromZero) - (float)Math.Round(-((end_y / 2) * valid_x), 3, MidpointRounding.AwayFromZero));
 
 
                    if (ablation_style == Ablation_Style.LEFT_RIGHT_ZIGZAG)
                    {
                        if (cnt % 2 == 0)
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, true));
                        }
                        else
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, true));
                        }
                    }
                    else if (ablation_style == Ablation_Style.LEFT_TO_RIGHT)
                    {
                        if (cnt % 2 == 0)
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, true));
                        }
                        else
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, true));
                        }
                    }
                    if (cnt + 1 <= repeat_start)
                    {
                        line_cnt += dis_Start;
                    }
                    else if (cnt + 1 > repeat_start)
                    {
                        line_cnt += valid_distance;
                    }
                    jump_length++;
                    cnt++;
                }
            }
            System.Diagnostics.Debug.WriteLine((DateTime.Now - dt).TotalSeconds);
        }
 
        public void Fill_Recipe_Pos_Info_end()
        {
            float valid_x = working_area_x;
            float valid_y = working_area_y;
            float valid_distance = distance;
            float start_x = process_area_start_x;
            float start_y = process_area_start_y;
            float end_x = process_area_end_x;
            float end_y = process_area_end_y;
            float dis_end = distance_end;
 
            float height_x = height_X;
            float height_y = height_Y;
 
 
            float Data_X = (float)(Math.Cos(process_area_degree));
            float Data_Y = (float)(Math.Sin(process_area_degree));
 
            bool jump_repeat_start = false;
            float line_cnt;
            int cnt = 0, jump_cnt = 0, jump_length = 0;
            short scan_start_x, scan_start_y, scan_end_x, scan_end_y;
            Recipe_Pos_Info.Clear();
 
            if (valid_x == 0 || valid_y == 0 || valid_distance == 0 || dis_end == 0)
                return;
 
            DateTime dt = DateTime.Now;
            System.Diagnostics.Debug.WriteLine(dt);
 
            if (ablation_style == Ablation_Style.TOP_TO_BOTTOM_ZIGZAG)
            {
                line_cnt = start_y;
                valid_distance = distance;
                while (line_cnt >= start_y+height_y)
                {
                    //scan_start_x = (short)start_x;
                    //scan_start_y = (short)(start_y + line_cnt);
                    //scan_end_x = (short)end_x;
                    //scan_end_y = (short)(end_y + line_cnt);
 
                    scan_start_x = (short)((float)Math.Round(((start_x * Data_X - line_cnt * Data_Y) * valid_x), 3, MidpointRounding.AwayFromZero) - (float)Math.Round(-((end_x / 2) * valid_x), 3, MidpointRounding.AwayFromZero));
                    scan_start_y = (short)(float)Math.Round(((start_x * Data_Y + line_cnt * Data_X) * valid_y), 3, MidpointRounding.AwayFromZero);
                    scan_end_x = (short)((float)Math.Round(((end_x * Data_X - line_cnt * Data_Y) * valid_x), 3, MidpointRounding.AwayFromZero) - (float)Math.Round(-((end_x / 2) * valid_x), 3, MidpointRounding.AwayFromZero));
                    scan_end_y = (short)(float)Math.Round(((end_x * Data_Y + line_cnt * Data_X) * valid_y), 3, MidpointRounding.AwayFromZero);
 
                    if (ablation_style == Ablation_Style.TOP_TO_BOTTOM_ZIGZAG)
                    {
                        if (cnt % 2 == 0)
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, true));
                        }
                        else
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, true));
                        }
                    }
 
                    if (cnt + 1 < repeat_end)
                    {
                        line_cnt -= dis_end;
                    }
                    else if (cnt + 1 > repeat_end)
                    {
                        line_cnt -= valid_distance;
                    }
                    jump_length++;
                    cnt++;
                }
            }
            else
            {
                line_cnt = start_x;
                valid_distance = distance;
 
                while (line_cnt >= start_x - height_x)
                {
 
                    //scan_start_x = (short)(start_x + line_cnt);
                    //scan_start_y = (short)start_y;
                    //scan_end_x = (short)(end_x + line_cnt);
                    //scan_end_y = (short)end_y;
 
                    scan_start_x = (short)(float)Math.Round(-((line_cnt * Data_X - start_y * Data_Y) * valid_x), 3, MidpointRounding.AwayFromZero);
                    scan_start_y = (short)((float)Math.Round(-((line_cnt * Data_Y + start_y * Data_X) * valid_y), 3, MidpointRounding.AwayFromZero) - (float)Math.Round(-((end_y / 2) * valid_x), 3, MidpointRounding.AwayFromZero));
                    scan_end_x = (short)(float)Math.Round(-((line_cnt * Data_X - end_y * Data_Y) * valid_x), 3, MidpointRounding.AwayFromZero);
                    scan_end_y = (short)((float)Math.Round(-((line_cnt * Data_Y + end_y * Data_X) * valid_y), 3, MidpointRounding.AwayFromZero) - (float)Math.Round(-((end_y / 2) * valid_x), 3, MidpointRounding.AwayFromZero));
 
                    if (ablation_style == Ablation_Style.LEFT_RIGHT_ZIGZAG)
                    {
                        if (cnt % 2 == 0)
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, true));
                        }
                        else
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, true));
                        }
                    }
                    else if (ablation_style == Ablation_Style.LEFT_TO_RIGHT)
                    {
                        if (cnt % 2 == 0)
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, true));
                        }
                        else
                        {
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_start_x, scan_start_y, false));
                            Recipe_Pos_Info.Add(new Scanner_Position_Info(scan_end_x, scan_end_y, true));
                        }
                    }
                    if (cnt + 1 <= repeat_end)
                    {
                        line_cnt -= dis_end;
                    }
                    else if (cnt + 1 > repeat_end)
                    {
                        line_cnt -= valid_distance;
                    }
                    jump_length++;
                    cnt++;
                }
            }
            System.Diagnostics.Debug.WriteLine((DateTime.Now - dt).TotalSeconds);
        }
 
        public static double DegreeToRadian(double degree) { return (Math.PI / 180) * degree; }
        #endregion
    }
}