hytos / DTI_PID / APIDConverter / Model / PlantItem / Note.cs @ 1d561973
이력 | 보기 | 이력해설 | 다운로드 (3.33 KB)
1 | 0a8db7fe | gaqhf | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Linq; |
||
4 | using System.Text; |
||
5 | using System.Threading.Tasks; |
||
6 | |||
7 | namespace AVEVA.PID.CustomizationUtility.Model |
||
8 | { |
||
9 | public class Note |
||
10 | { |
||
11 | private string _UID; |
||
12 | private string _OWNER; |
||
13 | private string _ATTRIBUTEVALUE; |
||
14 | private string _NAME; |
||
15 | private string _LOCATION; |
||
16 | private double _LOCATION_X; |
||
17 | private double _LOCATION_Y; |
||
18 | public double LOCATION_X { get { return _LOCATION_X; } } |
||
19 | public double LOCATION_Y { get { return _LOCATION_Y; } } |
||
20 | private string _VALUE; |
||
21 | private double _ANGLE; |
||
22 | private string _WIDTH; |
||
23 | private string _HEIGHT; |
||
24 | private string _AREA; |
||
25 | private string _SCENE; |
||
26 | |||
27 | public string UID { get => _UID; set => _UID = value; } |
||
28 | public string ATTRIBUTEVALUE { get => _ATTRIBUTEVALUE; set => _ATTRIBUTEVALUE = value; } |
||
29 | public string NAME { get => _NAME; set => _NAME = value; } |
||
30 | public string LOCATION |
||
31 | { |
||
32 | get |
||
33 | { |
||
34 | return _LOCATION; |
||
35 | } |
||
36 | set |
||
37 | { |
||
38 | _LOCATION = value; |
||
39 | double x = 0; |
||
40 | double y = 0; |
||
41 | APIDUtils.ConvertPointBystring(_LOCATION, ref x, ref y); |
||
42 | _LOCATION_X = x; |
||
43 | _LOCATION_Y = y; |
||
44 | } |
||
45 | } |
||
46 | public string VALUE { get => _VALUE; set => _VALUE = value; } |
||
47 | public double ANGLE |
||
48 | { |
||
49 | get |
||
50 | { |
||
51 | return _ANGLE; |
||
52 | } |
||
53 | set |
||
54 | { |
||
55 | double gap = 0.05; |
||
56 | if (value < gap) |
||
57 | 6503fec8 | gaqhf | { |
58 | 0a8db7fe | gaqhf | value = 0; |
59 | 6503fec8 | gaqhf | TextAngle = TextAngle.Degree0; |
60 | } |
||
61 | 0a8db7fe | gaqhf | else if (1.57 - gap < value && value < 1.57 + gap) |
62 | 6503fec8 | gaqhf | { |
63 | 0a8db7fe | gaqhf | value = 90 * Math.PI / 180; |
64 | 6503fec8 | gaqhf | TextAngle = TextAngle.Degree90; |
65 | } |
||
66 | 0a8db7fe | gaqhf | else if (3.14 - gap < value && value < 3.14 + gap) |
67 | 6503fec8 | gaqhf | { |
68 | 0a8db7fe | gaqhf | value = Math.PI; |
69 | 6503fec8 | gaqhf | TextAngle = TextAngle.Degree180; |
70 | } |
||
71 | 0a8db7fe | gaqhf | else if (4.71 - gap < value && value < 4.71 + gap) |
72 | 6503fec8 | gaqhf | { |
73 | 0a8db7fe | gaqhf | value = 270 * Math.PI / 180; |
74 | 6503fec8 | gaqhf | TextAngle = TextAngle.Degree270; |
75 | } |
||
76 | 0a8db7fe | gaqhf | |
77 | _ANGLE = value; |
||
78 | } |
||
79 | } |
||
80 | public string WIDTH { get => _WIDTH; set => _WIDTH = value; } |
||
81 | public string HEIGHT { get => _HEIGHT; set => _HEIGHT = value; } |
||
82 | public string AREA { get => _AREA; set => _AREA = value; } |
||
83 | |||
84 | public string SCENE |
||
85 | { |
||
86 | get |
||
87 | { |
||
88 | return _SCENE; |
||
89 | } |
||
90 | set |
||
91 | { |
||
92 | string[] split = value.Split(','); |
||
93 | X1 = Convert.ToDouble(split[0]); |
||
94 | Y1 = Convert.ToDouble(split[1]); |
||
95 | X2 = X1 + Convert.ToDouble(split[2]); |
||
96 | Y2 = Y1 + Convert.ToDouble(split[3]); |
||
97 | } |
||
98 | } |
||
99 | public double X1 { get; set; } |
||
100 | public double X2 { get; set; } |
||
101 | public double Y1 { get; set; } |
||
102 | public double Y2 { get; set; } |
||
103 | public string OWNER { get => _OWNER; set => _OWNER = value; } |
||
104 | 6503fec8 | gaqhf | public AvevaLabelInfo Aveva { get; set; } |
105 | public TextAngle TextAngle { get; set; } |
||
106 | 0a8db7fe | gaqhf | } |
107 | } |