hytos / DTI_PID / SPPIDConverter / SPPIDModel / GridSetting.cs @ abc4250b
이력 | 보기 | 이력해설 | 다운로드 (964 Bytes)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
4 |
using System.Text; |
5 |
using System.Threading.Tasks; |
6 |
|
7 |
namespace Converter.SPPID |
8 |
{ |
9 |
enum GridUnit |
10 |
{ |
11 |
Inch |
12 |
} |
13 |
class GridSetting |
14 |
{ |
15 |
private static GridSetting setting; |
16 |
public bool UseSnapGrid { get; set; } |
17 |
public double Density { get; set; } |
18 |
public GridUnit Unit { get; set; } |
19 |
public int MinSymbolGridCellCount { get; set; } |
20 |
public int DrainValveCellCount { get; set; } |
21 |
public double Length { get; set; } |
22 |
|
23 |
public static GridSetting GetInstance() |
24 |
{ |
25 |
if (setting == null) |
26 |
setting = new GridSetting(); |
27 |
|
28 |
if (setting.Unit == GridUnit.Inch) |
29 |
{ |
30 |
setting.Length = setting.Density * 0.0254; |
31 |
} |
32 |
|
33 |
return setting; |
34 |
} |
35 |
|
36 |
public static void Clear() |
37 |
{ |
38 |
setting = new GridSetting(); |
39 |
} |
40 |
} |
41 |
} |