Search Results for

    Show / Hide Table of Contents

    Class StatusGraphic

    • C#
    • Visual Basic
    [Obfuscation(Exclude = true, ApplyToMembers = true)]
    [Serializable]
    public class StatusGraphic
    <Obfuscation(Exclude:=True, ApplyToMembers:=True)>
    <Serializable>
    Public Class StatusGraphic
    Inheritance
    System.Object
    StatusGraphic
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    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 Source

    StatusGraphic(String, ValueRange)

    Initialize a new StatusGraphic with the specified image that targets a range of values

    Declaration
    • C#
    • Visual Basic
    public StatusGraphic(string imagePath, ValueRange targetRange)
    Public Sub New(imagePath As String, targetRange As ValueRange)
    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

    View Source

    StatusGraphic(String, Double, Double)

    Initialize a new StatusGraphic with the specified image that targets a range of values

    Declaration
    • C#
    • Visual Basic
    public StatusGraphic(string imagePath, double minValue, double maxValue)
    Public Sub New(imagePath As String, minValue As Double, maxValue As Double)
    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

    View Source

    StatusGraphic(String, Double, String)

    Initialize a new StatusGraphic with the specified image that targets a single value

    Declaration
    • C#
    • Visual Basic
    public StatusGraphic(string imagePath, double targetValue, string label = "")
    Public Sub New(imagePath As String, targetValue As Double, label As String = "")
    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
    • C#
    • Visual Basic
    EControlUse _controlUse
    _controlUse As EControlUse
    Field Value
    Type Description
    EControlUse
    View Source

    _graphicPath

    Declaration
    • C#
    • Visual Basic
    string _graphicPath
    _graphicPath As String
    Field Value
    Type Description
    System.String
    View Source

    _hasAdditionalData

    Declaration
    • C#
    • Visual Basic
    bool _hasAdditionalData
    _hasAdditionalData As Boolean
    Field Value
    Type Description
    System.Boolean
    View Source

    _isRange

    Declaration
    • C#
    • Visual Basic
    bool _isRange
    _isRange As Boolean
    Field Value
    Type Description
    System.Boolean
    View Source

    _label

    Declaration
    • C#
    • Visual Basic
    string _label
    _label As String
    Field Value
    Type Description
    System.String
    View Source

    _targetRange

    Declaration
    • C#
    • Visual Basic
    ValueRange _targetRange
    _targetRange As ValueRange
    Field Value
    Type Description
    ValueRange
    View Source

    _value

    Declaration
    • C#
    • Visual Basic
    double _value
    _value As Double
    Field Value
    Type Description
    System.Double

    Properties

    View Source

    ControlUse

    What the StatusGraphic is used for. See EControlUse for more information.

    Declaration
    • C#
    • Visual Basic
    public EControlUse ControlUse { get; set; }
    Public Property ControlUse As EControlUse
    Property Value
    Type Description
    EControlUse
    See Also
    EControlUse
    View Source

    Graphic

    The path to an image displayed by the associated HsFeature when its Value field matches the Value or TargetRange on this StatusGraphic

    Declaration
    • C#
    • Visual Basic
    public string Graphic { get; set; }
    Public Property Graphic As String
    Property Value
    Type Description
    System.String
    View Source

    HasAdditionalData

    Whether the StatusGraphic label includes additional data tokens to be replaced by strings in AdditionalStatusData

    Declaration
    • C#
    • Visual Basic
    public bool HasAdditionalData { get; set; }
    Public Property HasAdditionalData As Boolean
    Property Value
    Type Description
    System.Boolean
    View Source

    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
    • C#
    • Visual Basic
    public bool IsRange { get; set; }
    Public Property IsRange As Boolean
    Property Value
    Type Description
    System.Boolean
    View Source

    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
    • C#
    • Visual Basic
    public string Label { get; set; }
    Public Property Label As String
    Property Value
    Type Description
    System.String
    View Source

    RangeMax

    The maximum value targeted by the StatusGraphic

    Declaration
    • C#
    • Visual Basic
    public double RangeMax { get; set; }
    Public Property RangeMax As Double
    Property Value
    Type Description
    System.Double
    View Source

    RangeMin

    The minimum value targeted by the StatusGraphic

    Declaration
    • C#
    • Visual Basic
    public double RangeMin { get; set; }
    Public Property RangeMin As Double
    Property Value
    Type Description
    System.Double
    View Source

    TargetRange

    The range of values that the StatusGraphic targets.

    If IsRange is FALSE then this is ignored in favor of Value

    Declaration
    • C#
    • Visual Basic
    public ValueRange TargetRange { get; set; }
    Public Property TargetRange As ValueRange
    Property Value
    Type Description
    ValueRange
    See Also
    ValueRange
    View Source

    Value

    The value this StatusControl targets.

    If IsRange is TRUE then this is ignored in favor of TargetRange

    Declaration
    • C#
    • Visual Basic
    public double Value { get; set; }
    Public Property Value As Double
    Property Value
    Type Description
    System.Double

    Methods

    View Source

    Clone()

    Create a deep copy of this StatusGraphic

    Declaration
    • C#
    • Visual Basic
    public StatusGraphic Clone()
    Public Function Clone As StatusGraphic
    Returns
    Type Description
    StatusGraphic

    The deep copy of this StatusGraphic

    View Source

    Equals(Object)

    Compare this object with another to see if they are equal

    Declaration
    • C#
    • Visual Basic
    public override bool Equals(object obj)
    Public Overrides Function Equals(obj As Object) As Boolean
    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
    System.Object.Equals(System.Object)
    View Source

    GetHashCode()

    Get the hash code

    Declaration
    • C#
    • Visual Basic
    public override int GetHashCode()
    Public Overrides Function GetHashCode As Integer
    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
    System.Object.GetHashCode()
    View Source

    GetLabelForValue(Double, String[])

    Get the label for the specified value correctly formatted according to the StatusGraphic's configuration

    Declaration
    • C#
    • Visual Basic
    public string GetLabelForValue(double value, string[] additionalData = null)
    Public Function GetLabelForValue(value As Double, additionalData As String() = Nothing) As String
    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

    View Source

    GetTargetValue()

    Get the target value of the StatusGraphic based on whether it is a range or not

    Declaration
    • C#
    • Visual Basic
    public double GetTargetValue()
    Public Function GetTargetValue As Double
    Returns
    Type Description
    System.Double

    Returns RangeMin if it is a range and returns Value if it isn't

    View Source

    IsValueInRange(Double)

    Determine if a specified value is targeted by the StatusGraphic"/>

    Declaration
    • C#
    • Visual Basic
    public bool IsValueInRange(double value)
    Public Function IsValueInRange(value As Double) As Boolean
    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

    View Source

    ReplaceAdditionalData(String, String[])

    Declaration
    • C#
    • Visual Basic
    string ReplaceAdditionalData(string label, string[] additionalData)
    Function ReplaceAdditionalData(label As String, additionalData As String()) As String
    Parameters
    Type Name Description
    System.String label
    System.String[] additionalData
    Returns
    Type Description
    System.String
    View Source

    TryGetLabelForValue(out String, Double, String[])

    Try to get the label for the specified value correctly formatted according to the StatusGraphic's configuration.

    Declaration
    • C#
    • Visual Basic
    public bool TryGetLabelForValue(out string label, double value, string[] additionalData = null)
    Public Function TryGetLabelForValue(ByRef label As String, value As Double, additionalData As String() = Nothing) As Boolean
    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.

    • View Source
    In This Article
    Back to top HomeSeer Technologies