Module indiclient :: Class indiswitchvector
[show private | hide private]
[frames | no frames]

Class indiswitchvector

 indiobject --+        
              |        
indinamedobject --+    
                  |    
         indivector --+
                      |
                     indiswitchvector


a vector of switches
Method Summary
  __init__(self, attrs, tag)
indiswitch get_active_element(self)
Return the first active (On) element, None if there is none
IntType get_active_index(self)
Return the index of the first switch in the Vector that is On
NoneType set_active_index(self, index)
Turns the switch with index index to On and all other switches of this vector to Off.
NoneType set_by_elementlabel(self, elementlabel)
Sets all indiswitch elements of this vector to Off.
NoneType set_by_elementname(self, elementname)
Sets all indiswitch elements of this vector to Off.
NoneType tell(self)
" Prints the most important parameters of the vector and its elements.
    Inherited from indivector
indielement get_element(self, elementname)
Returns an element on this vector matching a given name.
indielement get_first_element(self)
Returns the first element on this vector.
indilight get_light(self)
Returns the indilight of the vector
indimessage get_message(self)
Return the indimessage associated with the vector, if there is any, None otherwise
indipermissions get_permissions(self)
Returns the read/write permission of the vector
StringType get_xml(self, transfertype)
Returns an XML representation of the object
NoneType update(self, attrs, tag)
Update this element with data received form the XML Parser.
NoneType wait_for_ok(self)
Wait until its state is Ok.
NoneType wait_for_ok_timeout(self, timeout)
Return None
BooleanType _get_changed(self)
Return True if the objects XML data was changed since the last _get_changed was called, False otherwise.
NoneType _wait_for_ok_general(self, checkinterval, timeout)
Wait until its state is Ok.
    Inherited from indiobject
BooleanType is_valid(self)
Checks whether the object is valid.
NoneType _check_writeable(self)
Raises an exception if the object is not writable

Instance Variable Summary
StringType rule: A rule defining which states of switches of the vector are allowed.
    Inherited from indivector
StringType device: The INDI device the vector belongs to
list of indielement elements: The list of indielement objects contained in the vector
StringType group: The INDI group the vector belongs to
StringType host: The hostname of the server that send the vector
IntType port: The port on which the server send the vector
StringType timeout: The timeout value.
StringType timestamp: The time when the vector was send out by the INDI server.
indilight _light: The StatusLED of the vector
indimessage _message: The indimessage associated with the vector or None if not present
indipermissions _perm: The users read/write permissions for the vector
    Inherited from indinamedobject
StringType label: label of the INDI object as given in the "label" XML attribute
StringType name: name of the INDI object as given in the "name" XML attribute
    Inherited from indiobject
indixmltag tag: The XML tag of the INDI object (see indixmltag).

Method Details

__init__(self, attrs, tag)
(Constructor)

Parameters:
attrs - The attributes of the XML version of the INDI vector.
           (type=DictType)
tag - The XML tag of the vector (see indixmltag).
           (type=indixmltag)
Overrides:
indiclient.indivector.__init__ (inherited documentation)

get_active_element(self)

Returns:
The first active (On) element, None if there is none
           (type=indiswitch)

get_active_index(self)

Returns:
the index of the first switch in the Vector that is On
           (type=IntType)

set_active_index(self, index)

Turns the switch with index index to On and all other switches of this vector to Off.
Parameters:
index - the index of the switch to turned On exclusively
           (type=IntType)
Returns:
None
           (type=NoneType)

set_by_elementlabel(self, elementlabel)

Sets all indiswitch elements of this vector to Off. And sets the one who's label property matches elementlabel to On . If no matching one is found or at least two matching ones are found, nothing is done.
Parameters:
elementlabel - The INDI Label of the Switch to be set to On
           (type=StringType)
Returns:
None
           (type=NoneType)

set_by_elementname(self, elementname)

Sets all indiswitch elements of this vector to Off. And sets the one who's label property matches elementname to On. If no matching one is found or at least two matching ones are found, nothing is done.
Parameters:
elementname - The INDI Name of the Switch to be set to On
           (type=StringType)
Returns:
None
           (type=NoneType)

tell(self)

" Prints the most important parameters of the vector and its elements.
Returns:
None
           (type=NoneType)
Overrides:
indiclient.indivector.tell (inherited documentation)

Instance Variable Details

rule

A rule defining which states of switches of the vector are allowed. possible values are:
  • OneOfMany Exactly one of the switches in the vector has to be On all others have to be Off
  • AtMostOne At most one of the switches in the vector can to be On all others have to be Off
  • AnyOfMany Any switch in the vector may have any state
Type:
StringType

Generated by Epydoc 2.1 on Sat Sep 10 10:26:05 2005 http://epydoc.sf.net