/
MonitorBlockProperties_Bool.cs
126 lines (101 loc) · 6.36 KB
/
MonitorBlockProperties_Bool.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.Xml.Serialization;
using System.IO;
/// +------------------------------------------------------------------------------------------------------------------------------+
/// ¦ TERMS OF USE: MIT License ¦
/// +------------------------------------------------------------------------------------------------------------------------------¦
/// ¦Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation ¦
/// ¦files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, ¦
/// ¦modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software¦
/// ¦is furnished to do so, subject to the following conditions: ¦
/// ¦ ¦
/// ¦The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.¦
/// ¦ ¦
/// ¦THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ¦
/// ¦WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR ¦
/// ¦COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ¦
/// ¦ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ¦
/// +------------------------------------------------------------------------------------------------------------------------------+
namespace Kimono
{
/// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
/// <summary>
/// A class to provide properties for the ctlMonitorBlock_Bool class. An
/// object derived from MonitorBlockProperties_Base serves as the backing store which
/// drives the propertyGrid behind each monitor block.
/// </summary>
[KnownType(typeof(MonitorBlockProperties_Bool))]
[KnownType(typeof(MonitorBlockProperties_Base))]
[DataContract]
[Serializable]
public class MonitorBlockProperties_Bool : MonitorBlockProperties_Base
{
public const string MB_DEFAULT_DISPLAY_NAME = DEFAULT_DISPLAYNAME_PREFIX + " Bool";
// non browsable attributes
private object lastValue = 1;
// if false we had an error parsing this
private bool lastValueIsValid = true;
// browsable attributes
private string titleText = "Title Goes Here";
private string dataSource = "Device#Field";
private string comparisonValue = "0";
private string userReference = "";
private MB_TriggerDirectionEnum triggerDirection = MB_TriggerDirectionEnum.NONE;
private string displayTextNotTriggered = "False";
private string displayTextTriggered = "True";
/// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
/// <summary>
/// Constructor
/// </summary>
public MonitorBlockProperties_Bool()
{
// set the display name
DisplayName = MB_DEFAULT_DISPLAY_NAME;
SummaryString = "Boolean Monitor Block";
}
#region NONBROWSABLE
[System.Xml.Serialization.XmlIgnore]
[Browsable(false)]
public object LastValue { get => lastValue; set => lastValue = value; }
[System.Xml.Serialization.XmlIgnore]
[Browsable(false)]
public bool LastValueIsValid { get => lastValueIsValid; set => lastValueIsValid = value; }
#endregion
#region BROWSABLE
[DataMember]
[DefaultValueAttribute("")]
[CategoryAttribute("Data"), DescriptionAttribute("A text based reference name. Should be only one word. Certain reserved reference names also store the data in the database.")]
public string UserReference { get => userReference; set => userReference = value; }
[DataMember]
[DefaultValueAttribute("0")]
[CategoryAttribute("Data"), DescriptionAttribute("The value against which we compare the incoming data presented by the DataSource.")]
public string ComparisonValue { get => comparisonValue; set => comparisonValue = value; }
[DataMember]
[DefaultValueAttribute("Device#Field")]
[CategoryAttribute("Data"), DescriptionAttribute("The device and field name which provides the source of the data. Can be a complex expression.")]
public string DataSource { get => dataSource; set => dataSource = value; }
[DataMember]
[DefaultValueAttribute("Title Goes Here")]
[CategoryAttribute("Display"), DescriptionAttribute("Title of the Monitor Block. This is what you see at the top of the Monitor Block")]
public string TitleText { get => titleText; set => titleText = value; }
[DataMember]
[DefaultValueAttribute(MB_TriggerDirectionEnum.NONE)]
[CategoryAttribute("Data"), DescriptionAttribute("Determines the trigger direction for the tests. None disables the monitor block.")]
public MB_TriggerDirectionEnum TriggerDirection { get => triggerDirection; set => triggerDirection = value; }
[DataMember]
[DefaultValueAttribute("False")]
[CategoryAttribute("Display"), DescriptionAttribute("The text displayed if the trigger event has not occurred.")]
public string DisplayTextNotTriggered { get => displayTextNotTriggered; set => displayTextNotTriggered = value; }
[DataMember]
[DefaultValueAttribute("True")]
[CategoryAttribute("Display"), DescriptionAttribute("The text displayed if the trigger event has occurred.")]
public string DisplayTextTriggered { get => displayTextTriggered; set => displayTextTriggered = value; }
#endregion
}
}