Class StatusGraphic
[Obfuscation(Exclude = true, ApplyToMembers = true)]
[Serializable]
public class StatusGraphic
Inheritance
Inherited Members
Namespace: HomeSeer.PluginSdk.Devices
Assembly: PluginSdk.dll
Status graphics are used to specify what image is displayed for a device when its value matches certain criteria
Constructors
View SourceStatusGraphic(String, ValueRange)
Initialize a new StatusGraphic with the specified image that targets a range of values
Declaration
public StatusGraphic(string imagePath, ValueRange targetRange)
Parameters
Type | Name | Description |
---|---|---|
System.String | imagePath | The path to the image used for the graphic |
ValueRange | targetRange | The range of values targeted by the StatusGraphic |
StatusGraphic(String, Double, Double)
Initialize a new StatusGraphic with the specified image that targets a range of values
Declaration
public StatusGraphic(string imagePath, double minValue, double maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | imagePath | The path to the image used for the graphic |
System.Double | minValue | The minimum value targeted by the StatusGraphic |
System.Double | maxValue | The maximum value targeted by the StatusGraphic |
StatusGraphic(String, Double, String)
Initialize a new StatusGraphic with the specified image that targets a single value
Declaration
public StatusGraphic(string imagePath, double targetValue, string label = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | imagePath | The path to the image used for the graphic |
System.Double | targetValue | The value targeted by the StatusGraphic |
System.String | label | The status text |
Fields
View Source_controlUse
Declaration
EControlUse _controlUse
Field Value
Type | Description |
---|---|
EControlUse |
_graphicPath
Declaration
string _graphicPath
Field Value
Type | Description |
---|---|
System.String |
_hasAdditionalData
Declaration
bool _hasAdditionalData
Field Value
Type | Description |
---|---|
System.Boolean |
_isRange
Declaration
bool _isRange
Field Value
Type | Description |
---|---|
System.Boolean |
_label
Declaration
string _label
Field Value
Type | Description |
---|---|
System.String |
_targetRange
Declaration
ValueRange _targetRange
Field Value
Type | Description |
---|---|
ValueRange |
_value
Declaration
double _value
Field Value
Type | Description |
---|---|
System.Double |
Properties
View SourceControlUse
What the StatusGraphic is used for. See EControlUse for more information.
Declaration
public EControlUse ControlUse { get; set; }
Property Value
Type | Description |
---|---|
EControlUse |
See Also
View SourceGraphic
The path to an image displayed by the associated HsFeature when its Value field matches the Value or TargetRange on this StatusGraphic
Declaration
public string Graphic { get; set; }
Property Value
Type | Description |
---|---|
System.String |
HasAdditionalData
Whether the StatusGraphic label includes additional data tokens to be replaced by strings in AdditionalStatusData
Declaration
public bool HasAdditionalData { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsRange
Whether the StatusGraphic targets a range of values or a single value.
Settings this to TRUE will cause the Value field to be ignored in favor of the TargetRange
Declaration
public bool IsRange { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Label
The text displayed when the associated HsFeature's Value field matches the Value or TargetRange.
Leaving this blank will cause the StatusControl's Label field to be used instead
Set this to a single space " " to ensure that the corresponding status is left blank when displayed
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String |
RangeMax
The maximum value targeted by the StatusGraphic
Declaration
public double RangeMax { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
RangeMin
The minimum value targeted by the StatusGraphic
Declaration
public double RangeMin { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
TargetRange
The range of values that the StatusGraphic targets.
Declaration
public ValueRange TargetRange { get; set; }
Property Value
Type | Description |
---|---|
ValueRange |
See Also
View SourceValue
The value this StatusControl targets.
If IsRange is TRUE then this is ignored in favor of TargetRange
Declaration
public double Value { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
View SourceClone()
Create a deep copy of this StatusGraphic
Declaration
public StatusGraphic Clone()
Returns
Type | Description |
---|---|
StatusGraphic | The deep copy of this StatusGraphic |
Equals(Object)
Compare this object with another to see if they are equal
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare |
Returns
Type | Description |
---|---|
System.Boolean | True if they are equal, False if they are not |
Overrides
GetHashCode()
Get the hash code
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code based on the Min of TargetRange if IsRange is true or Value if it is false. |
Overrides
GetLabelForValue(Double, String[])
Get the label for the specified value correctly formatted according to the StatusGraphic's configuration
Declaration
public string GetLabelForValue(double value, string[] additionalData = null)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to get the label for |
System.String[] | additionalData | Additional data to include in the status label that replaces any tokens from GetAdditionalDataToken(Int32) included in the status. |
Returns
Type | Description |
---|---|
System.String | The value as a string formatted according to the TargetRange configuration. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown when the value is not targeted by the StatusGraphic |
GetTargetValue()
Get the target value of the StatusGraphic based on whether it is a range or not
Declaration
public double GetTargetValue()
Returns
Type | Description |
---|---|
System.Double | Returns RangeMin if it is a range and returns Value if it isn't |
IsValueInRange(Double)
Determine if a specified value is targeted by the StatusGraphic"/>
Declaration
public bool IsValueInRange(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to check |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the value is targeted by the StatusGraphic, FALSE if it is not |
ReplaceAdditionalData(String, String[])
Declaration
string ReplaceAdditionalData(string label, string[] additionalData)
Parameters
Type | Name | Description |
---|---|---|
System.String | label | |
System.String[] | additionalData |
Returns
Type | Description |
---|---|
System.String |
TryGetLabelForValue(out String, Double, String[])
Try to get the label for the specified value correctly formatted according to the StatusGraphic's configuration.
Declaration
public bool TryGetLabelForValue(out string label, double value, string[] additionalData = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | label | The string variable the label will be written to |
System.Double | value | The value to get the label for |
System.String[] | additionalData | Additional data to include in the status label that replaces any tokens from GetAdditionalDataToken(Int32) included in the status. |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if a label is available for the StatusGraphic, FALSE if the value is not valid for this StatusGraphic or there is no label defined. |