hytos / DTI_PID / SPPIDConverter / BaseModel / Text.cs @ b7a29053
이력 | 보기 | 이력해설 | 다운로드 (2.66 KB)
1 | 96a2080c | gaqhf | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Linq; |
||
4 | using System.Text; |
||
5 | using System.Threading.Tasks; |
||
6 | |||
7 | namespace Converter.BaseModel |
||
8 | { |
||
9 | aadf6821 | gaqhf | public class Text |
10 | 96a2080c | gaqhf | { |
11 | 60244a8b | gaqhf | private string _UID; |
12 | ea80efaa | gaqhf | private string _OWNER; |
13 | 60244a8b | gaqhf | private string _ATTRIBUTEVALUE; |
14 | private string _NAME; |
||
15 | private string _LOCATION; |
||
16 | private string _VALUE; |
||
17 | private double _ANGLE; |
||
18 | private string _WIDTH; |
||
19 | private string _HEIGHT; |
||
20 | private string _AREA; |
||
21 | 1a3a74a8 | gaqhf | private string _SCENE; |
22 | 6b298450 | gaqhf | private SPPIDSymbolInfo _SPPID; |
23 | ea80efaa | gaqhf | private bool _ASSOCIATION; |
24 | 60244a8b | gaqhf | |
25 | public string UID { get => _UID; set => _UID = value; } |
||
26 | public string ATTRIBUTEVALUE { get => _ATTRIBUTEVALUE; set => _ATTRIBUTEVALUE = value; } |
||
27 | public string NAME { get => _NAME; set => _NAME = value; } |
||
28 | public string LOCATION { get => _LOCATION; set => _LOCATION = value; } |
||
29 | public string VALUE { get => _VALUE; set => _VALUE = value; } |
||
30 | 6b298450 | gaqhf | public double ANGLE |
31 | { |
||
32 | get |
||
33 | { |
||
34 | return _ANGLE; |
||
35 | } |
||
36 | set |
||
37 | { |
||
38 | 912a05b0 | gaqhf | double gap = 0.05; |
39 | if (value < gap) |
||
40 | value = 0; |
||
41 | else if (1.57 - gap < value && value < 1.57 + gap) |
||
42 | 6b298450 | gaqhf | value = 90 * Math.PI / 180; |
43 | 912a05b0 | gaqhf | else if (3.14 - gap < value && value < 3.14 + gap) |
44 | 6b298450 | gaqhf | value = Math.PI; |
45 | 912a05b0 | gaqhf | else if (4.71 - gap < value && value < 4.71 + gap) |
46 | 6b298450 | gaqhf | value = 270 * Math.PI / 180; |
47 | |||
48 | _ANGLE = value; |
||
49 | } |
||
50 | } |
||
51 | 60244a8b | gaqhf | public string WIDTH { get => _WIDTH; set => _WIDTH = value; } |
52 | public string HEIGHT { get => _HEIGHT; set => _HEIGHT = value; } |
||
53 | public string AREA { get => _AREA; set => _AREA = value; } |
||
54 | 6b298450 | gaqhf | public SPPIDSymbolInfo SPPID { get => _SPPID; set => _SPPID = value; } |
55 | ea80efaa | gaqhf | public bool ASSOCIATION { get => _ASSOCIATION; set => _ASSOCIATION = value; } |
56 | public string OWNER { get => _OWNER; set => _OWNER = value; } |
||
57 | 1a3a74a8 | gaqhf | |
58 | public string SCENE |
||
59 | { |
||
60 | get |
||
61 | { |
||
62 | return _SCENE; |
||
63 | } |
||
64 | set |
||
65 | { |
||
66 | string[] split = value.Split(','); |
||
67 | X1 = Convert.ToDouble(split[0]); |
||
68 | Y1 = Convert.ToDouble(split[1]); |
||
69 | X2 = X1 + Convert.ToDouble(split[2]); |
||
70 | Y2 = Y1 + Convert.ToDouble(split[3]); |
||
71 | } |
||
72 | } |
||
73 | public double X1 { get; set; } |
||
74 | public double X2 { get; set; } |
||
75 | public double Y1 { get; set; } |
||
76 | public double Y2 { get; set; } |
||
77 | public SPPIDLabelLocationInfo SPPIDLabelLocation { get; set; } |
||
78 | 96a2080c | gaqhf | } |
79 | } |