Home2L - Python API v1.4-0-g38cc (2024-05-25)
Smart Tools for a Private Home
Public Member Functions | List of all members
CRcValueState Class Reference

Description

Typed value tagged with a state and a time stamp.

The constants for type 'ERcType' have the prefix 'rct*'.The state may be one of:
  'rcsUnknown': The value is unknown.
  'rcsBusy': The value is known, the underlying device is busy.
  'rcsValid': The value is known and stable.
The time stamp reflects the age of a value (last change/update). It is
generally not valid to judge from the time stamp whether the value is
outdated, since there are other mechanisms in the library setting the
state to 'rcsUnknown' if, for example, the connection to a remote resource
got lost.

Inherits object.

Public Member Functions

def Clear (self, *args)
 
def Set (self, vs2)
 
def SetToReportBusy (self)
 
def SetToReportBusyOldVal (self)
 
def SetToReportBusyNewVal (self)
 
def SetToReportNothing (self)
 
def SetGenericInt (self, _val, _type, _state=rcsValid)
 
def SetGenericFloat (self, _val, _type, _state=rcsValid)
 
def SetGenericString (self, _val, _type, _state=rcsValid)
 
def SetBool (self, _val, _state=rcsValid)
 
def SetInt (self, _val, _state=rcsValid)
 
def SetFloat (self, _val, _state=rcsValid)
 
def SetString (self, _val, _state=rcsValid)
 
def SetTime (self, _val, _state=rcsValid)
 
def SetTrigger (self, _val=1, _state=rcsValid)
 
def SetMutex (self, _val, _state=rcsValid)
 
def SetUnitInt (self, type, _val, _state=rcsValid)
 
def SetUnitFloat (self, type, _val, _state=rcsValid)
 
def SetEnum (self, type, _val, _state=rcsValid)
 
def GenericInt (self)
 
def GenericFloat (self)
 
def GenericString (self)
 
def Bool (self)
 
def Int (self)
 
def Float (self)
 
def String (self)
 
def Time (self)
 
def Trigger (self)
 
def Mutex (self)
 
def UnitInt (self, _type)
 
def UnitFloat (self, _type)
 
def EnumIdx (self)
 
def ValidBool (self, defaultVal=False)
 
def ValidInt (self, defaultVal=0)
 
def ValidFloat (self, defaultVal=0.0)
 
def ValidString (self, *args)
 
def ValidTime (self, defaultVal=0)
 
def ValidTrigger (self, defaultVal=0)
 
def ValidMutex (self, *args)
 
def ValidUnitInt (self, _type, defaultVal=0)
 
def ValidUnitFloat (self, _type, defaultVal=0.0)
 
def ValidEnumIdx (self, _type, defaultVal=0)
 
def SetType (self, _type)
 
def SetState (self, _state)
 
def SetTimeStamp (self, _timeStamp)
 
def Type (self)
 
def State (self)
 
def TimeStamp (self)
 
def IsValid (self)
 
def IsBusy (self)
 
def IsKnown (self)
 
def Equals (self, vs2)
 
def ValueEquals (self, vs2)
 
def Convert (self, _type)
 
def ToStr (self, ret, withType=False, withTimeStamp=False, precise=False, stringChars=20)
 
def SetFromStr (self, str)
 
def SetFromStrFast (self, str, warn=True)
 
def ToHuman (self, retBuf, retBufSize)
 
def Value (self)
 Return the value as a Python object. More...
 
def ValidValue (self, defaultVal)
 Return the most appropriate valid value as a Python object. More...
 

Member Function Documentation

◆ Clear()

def Clear (   self,
args 
)
    Clear(CRcValueState self)
    Clear(CRcValueState self, ERcType _type, ERcState _state=rcsUnknown)

◆ Set()

def Set (   self,
  vs2 
)
Set(CRcValueState self, CRcValueState vs2)

◆ SetToReportBusy()

def SetToReportBusy (   self)
SetToReportBusy(CRcValueState self)

◆ SetToReportBusyOldVal()

def SetToReportBusyOldVal (   self)
SetToReportBusyOldVal(CRcValueState self)

◆ SetToReportBusyNewVal()

def SetToReportBusyNewVal (   self)
SetToReportBusyNewVal(CRcValueState self)

◆ SetToReportNothing()

def SetToReportNothing (   self)
SetToReportNothing(CRcValueState self)

◆ SetGenericInt()

def SetGenericInt (   self,
  _val,
  _type,
  _state = rcsValid 
)
SetGenericInt(CRcValueState self, int _val, ERcType _type, ERcState _state=rcsValid)

◆ SetGenericFloat()

def SetGenericFloat (   self,
  _val,
  _type,
  _state = rcsValid 
)
SetGenericFloat(CRcValueState self, float _val, ERcType _type, ERcState _state=rcsValid)

◆ SetGenericString()

def SetGenericString (   self,
  _val,
  _type,
  _state = rcsValid 
)
SetGenericString(CRcValueState self, char const * _val, ERcType _type, ERcState _state=rcsValid) -> bool

◆ SetBool()

def SetBool (   self,
  _val,
  _state = rcsValid 
)
SetBool(CRcValueState self, bool _val, ERcState _state=rcsValid)

◆ SetInt()

def SetInt (   self,
  _val,
  _state = rcsValid 
)
SetInt(CRcValueState self, int _val, ERcState _state=rcsValid)

◆ SetFloat()

def SetFloat (   self,
  _val,
  _state = rcsValid 
)
SetFloat(CRcValueState self, float _val, ERcState _state=rcsValid)

◆ SetString()

def SetString (   self,
  _val,
  _state = rcsValid 
)
SetString(CRcValueState self, char const * _val, ERcState _state=rcsValid) -> bool

◆ SetTime()

def SetTime (   self,
  _val,
  _state = rcsValid 
)
SetTime(CRcValueState self, TTicks _val, ERcState _state=rcsValid)

◆ SetTrigger()

def SetTrigger (   self,
  _val = 1,
  _state = rcsValid 
)
SetTrigger(CRcValueState self, int _val=1, ERcState _state=rcsValid)

◆ SetMutex()

def SetMutex (   self,
  _val,
  _state = rcsValid 
)
SetMutex(CRcValueState self, char const * _val, ERcState _state=rcsValid) -> bool

◆ SetUnitInt()

def SetUnitInt (   self,
  type,
  _val,
  _state = rcsValid 
)
SetUnitInt(CRcValueState self, ERcType type, int _val, ERcState _state=rcsValid)

◆ SetUnitFloat()

def SetUnitFloat (   self,
  type,
  _val,
  _state = rcsValid 
)
SetUnitFloat(CRcValueState self, ERcType type, float _val, ERcState _state=rcsValid)

◆ SetEnum()

def SetEnum (   self,
  type,
  _val,
  _state = rcsValid 
)
SetEnum(CRcValueState self, ERcType type, int _val, ERcState _state=rcsValid)

◆ GenericInt()

def GenericInt (   self)
GenericInt(CRcValueState self) -> int

◆ GenericFloat()

def GenericFloat (   self)
GenericFloat(CRcValueState self) -> float

◆ GenericString()

def GenericString (   self)
GenericString(CRcValueState self) -> char const *

◆ Bool()

def Bool (   self)
Bool(CRcValueState self) -> bool

◆ Int()

def Int (   self)
Int(CRcValueState self) -> int

◆ Float()

def Float (   self)
Float(CRcValueState self) -> float

◆ String()

def String (   self)
String(CRcValueState self) -> char const *

◆ Time()

def Time (   self)
Time(CRcValueState self) -> TTicks

◆ Trigger()

def Trigger (   self)
Trigger(CRcValueState self) -> int

◆ Mutex()

def Mutex (   self)
Mutex(CRcValueState self) -> char const *

◆ UnitInt()

def UnitInt (   self,
  _type 
)
UnitInt(CRcValueState self, ERcType _type) -> int

◆ UnitFloat()

def UnitFloat (   self,
  _type 
)
UnitFloat(CRcValueState self, ERcType _type) -> float

◆ EnumIdx()

def EnumIdx (   self)
EnumIdx(CRcValueState self) -> int

◆ ValidBool()

def ValidBool (   self,
  defaultVal = False 
)
ValidBool(CRcValueState self, bool defaultVal=False) -> bool

◆ ValidInt()

def ValidInt (   self,
  defaultVal = 0 
)
ValidInt(CRcValueState self, int defaultVal=0) -> int

◆ ValidFloat()

def ValidFloat (   self,
  defaultVal = 0.0 
)
ValidFloat(CRcValueState self, float defaultVal=0.0) -> float

◆ ValidString()

def ValidString (   self,
args 
)
ValidString(CRcValueState self, char const * defaultVal=CString::emptyStr) -> char const

◆ ValidTime()

def ValidTime (   self,
  defaultVal = 0 
)
ValidTime(CRcValueState self, TTicks defaultVal=0) -> TTicks

◆ ValidTrigger()

def ValidTrigger (   self,
  defaultVal = 0 
)
ValidTrigger(CRcValueState self, int defaultVal=0) -> int

◆ ValidMutex()

def ValidMutex (   self,
args 
)
ValidMutex(CRcValueState self, char const * defaultVal=CString::emptyStr) -> char const

◆ ValidUnitInt()

def ValidUnitInt (   self,
  _type,
  defaultVal = 0 
)
ValidUnitInt(CRcValueState self, ERcType _type, int defaultVal=0) -> int

◆ ValidUnitFloat()

def ValidUnitFloat (   self,
  _type,
  defaultVal = 0.0 
)
ValidUnitFloat(CRcValueState self, ERcType _type, float defaultVal=0.0) -> float

◆ ValidEnumIdx()

def ValidEnumIdx (   self,
  _type,
  defaultVal = 0 
)
ValidEnumIdx(CRcValueState self, ERcType _type, int defaultVal=0) -> int

◆ SetType()

def SetType (   self,
  _type 
)
SetType(CRcValueState self, ERcType _type)

◆ SetState()

def SetState (   self,
  _state 
)
SetState(CRcValueState self, ERcState _state)

◆ SetTimeStamp()

def SetTimeStamp (   self,
  _timeStamp 
)
SetTimeStamp(CRcValueState self, TTicks _timeStamp)

◆ Type()

def Type (   self)
Type(CRcValueState self) -> ERcType

◆ State()

def State (   self)
State(CRcValueState self) -> ERcState

◆ TimeStamp()

def TimeStamp (   self)
TimeStamp(CRcValueState self) -> TTicks

◆ IsValid()

def IsValid (   self)
IsValid(CRcValueState self) -> bool

◆ IsBusy()

def IsBusy (   self)
IsBusy(CRcValueState self) -> bool

◆ IsKnown()

def IsKnown (   self)
IsKnown(CRcValueState self) -> bool

◆ Equals()

def Equals (   self,
  vs2 
)
Equals(CRcValueState self, CRcValueState vs2) -> bool

◆ ValueEquals()

def ValueEquals (   self,
  vs2 
)
ValueEquals(CRcValueState self, CRcValueState vs2) -> bool

◆ Convert()

def Convert (   self,
  _type 
)
Convert(CRcValueState self, ERcType _type) -> bool

◆ ToStr()

def ToStr (   self,
  ret,
  withType = False,
  withTimeStamp = False,
  precise = False,
  stringChars = 20 
)
ToStr(CRcValueState self, CString * ret, bool withType=False, bool withTimeStamp=False, bool precise=False, int stringChars=20) -> char const

◆ SetFromStr()

def SetFromStr (   self,
  str 
)
SetFromStr(CRcValueState self, char const * str) -> bool

◆ SetFromStrFast()

def SetFromStrFast (   self,
  str,
  warn = True 
)
SetFromStrFast(CRcValueState self, char const * str, bool warn=True) -> bool

◆ ToHuman()

def ToHuman (   self,
  retBuf,
  retBufSize 
)
ToHuman(CRcValueState self, char * retBuf, int retBufSize)

◆ Value()

def Value (   self)

Return the value as a Python object.

Return the value as a Python object. In case of a state of 'rcsUnknown' or
if 'self' is not defined, 'None' is returned. 'self == None' is allowed.

◆ ValidValue()

def ValidValue (   self,
  defaultVal 
)

Return the most appropriate valid value as a Python object.

Return the value as a Python object. Unlike 'Value', this method never
returns 'None', but reverts to the given default value, if 'self' does not
transort a valid value. 'self == None' is tolerated