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

Class indiclient

bigindiclient --+
                |
               indiclient

Known Subclasses:
gtkindiclient

providing a simplified interface to bigindiclient
Method Summary
  __init__(self, host, port)
BooleanType get_bool(self, devicename, vectorname, elementname)
Returns Boolean representing the value of the element requested.
FloatType get_float(self, devicename, vectorname, elementname)
Returns a floating point number representing the value of the element requested.
StringType get_text(self, devicename, vectorname, elementname)
Returns a text representing the value of the element requested.
indivector set_and_send_bool(self, devicename, vectorname, elementname, state)
Sets the value of of an indi element by a boolean, and sends it to the server
indivector set_and_send_float(self, devicename, vectorname, elementname, number)
Sets the value of an indi element by a floating point number, and sends it to the server
indivector set_and_send_switchvector_by_elementlabel(self, devicename, vectorname, elementlabel)
Sets all indiswitch elements in this vector to Off.
indivector set_and_send_text(self, devicename, vectorname, elementname, text)
Sets the value of an element by a text, and sends it to the server
    Inherited from bigindiclient
indi_custom_element_handler add_custom_element_handler(self, handler)
Adds a custom handler function for an indielement, the handler will be called each time the indielement is received.
indi_custom_vector_handler add_custom_vector_handler(self, handler)
Adds a custom handler function for an indivector, the handler will be called each time the vector is received.
mini_element_handler add_mini_element_handler(self, devicename, vectorname, elementname, handlermethod)
Adds handler that will be called each time the element is received.
NoneType enable_blob(self)
Sends a signal to the server that tells it, that this client wants to receive indiblob objects.
indielement get_element(self, devicename, vectorname, elementname)
Returns an indielement matching the given devicename and vectorname This method will wait until it has been received.
indivector get_vector(self, devicename, vectorname)
Returns an indivector matching the given devicename and vectorname This method will wait until it has been received.
NoneType process_events(self)
Has to be called frequently by any program using this client.
NoneType quit(self)
must be called in order to close the indiclient instance
NoneType reset_connection(self)
Resets the connection to the server
NoneType send_vector(self, vector)
Sends an INDI vector to the INDI server.
NoneType set_def_handlers(self, blob_def_handler, number_def_handler, switch_def_handler, text_def_handler, light_def_handler)
Sets new def handlers.
NoneType set_message_handler(self, handler)
Sets a new message handler.
NoneType set_timeout_handler(self, handler)
Sets a new timeout handler.
NoneType tell(self)
prints all indivectors and their elements to the screen
NoneType wait_until_vector_available(self, devicename, vectorname)
Looks if the requested vector has already been received and waits until it is received otherwise
NoneType _char_data(self, data)
Char data handler for expat parser.
NoneType _default_def_handler(self, vector, indi)
Called whenever an indivector was received with an def*vector tag.
NoneType _default_message_handler(self, message, indi)
Called whenever an INDI message has been received from the server.
NoneType _default_timeout_handler(self, devicename, vectorname, indi)
Called whenever an indielement has been requested but was not received for a time longer than timeout since the request was issued.
NoneType _element_received(self, vector, element)
Called during the process_events method each time an INDI element has been received
NoneType _end_element(self, name)
End of XML element handler for expat parser.
NoneType _get_and_update_element(self, attrs, tag)
Looks in self.currentVector for an existing indivector matching the name attibute given in attrs, and updates it according to attrs.
NoneType _get_and_update_vector(self, attrs, tag)
Looks for an existing indivector matching the device and name attibutes given in attrs, and updates it according to attrs
NoneType _receive(self)
receive data from the server
NoneType _receiver(self)
A "thread" that receives data from the server
NoneType _start_element(self, name, attrs)
Start XML element handler for expat parser.
NoneType _vector_received(self, vector)
Called during the process_events method each time an indivector element has been received

Instance Variable Summary
    Inherited from bigindiclient
function blob_def_handler: Called when a new indiblobvector is defined by the driver (see set_def_handlers)
StringType currentData: A buffer to accumulate the character data to be written into the value attribute of currentElement
indivector currentElement: The INDI element currently being processed by the XML parser
indimessage currentMessage: The INDI message currently being processed by the XML parser
indivector currentVector: The INDI vector currently being processed by the XML parser
list of indivector defvectorlist: A list of vectors that have been received with def*Vector signal at least one time
xml.parsers.expat expat: an expat XML parser
StringType host: The hostname of the INDI server, this instance of indiclient is connected to
_indilist of indivector indivectors: The list of all indivectors received so far
function message_handler: (see set_message_handler)
function number_def_handler: Called when a new indinumbervector is defined by the driver (see set_def_handlers)
IntType port: The port address of the INDI server, this instance of indiclient is connected to
Queue.Queue receive_event_queue: A background process (_receiver) is continuesly receiving data and putting them into this queue.
threading.Timer receivetimer: needed to run the _receive thread
Queue.Queue running_queue: During its destructor indiclient puts signal into this queue in order to stop the background process.
socket.socket.socket socket: a TCP/IP socket to communicate with the server
function text_def_handler: Called when a new inditextvector is defined by the driver (see set_def_handlers)
FloatType timeout: A timeout value (see timeout_handler)
function timeout_handler: This function will be called whenever an indielement has been requested but was not received for a time longer than timeout since the request was issued.
BooleanType verbose: If True all XML data will be printed to the screen
_indiobjectfactory() _factory: A factory used to create and classify objects during the XML parsing process.

Method Details

__init__(self, host, port)
(Constructor)

Parameters:
host - The hostname or IP address of the server you want to connect to
           (type=StringType)
port - The port address of the server you want to connect to.
           (type=IntType)
Overrides:
indiclient.bigindiclient.__init__ (inherited documentation)

get_bool(self, devicename, vectorname, elementname)

Returns Boolean representing the value of the element requested. The element must be an indiswitch
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the vector
           (type=StringType)
elementname - The name of the element
           (type=StringType)
Returns:
the value of the element
           (type=BooleanType)

get_float(self, devicename, vectorname, elementname)

Returns a floating point number representing the value of the element requested. The element must be an indinumber.
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the vector
           (type=StringType)
elementname - The name of the element
           (type=StringType)
Returns:
the value of the element
           (type=FloatType)

get_text(self, devicename, vectorname, elementname)

Returns a text representing the value of the element requested.
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the vector
           (type=StringType)
elementname - The name of the element
           (type=StringType)
Returns:
the value of the element
           (type=StringType)

set_and_send_bool(self, devicename, vectorname, elementname, state)

Sets the value of of an indi element by a boolean, and sends it to the server
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the vector
           (type=StringType)
elementname - The name of the element
           (type=StringType)
state - The state to be set.
           (type=BooleanType)
Returns:
The vector containing the element that was just sent.
           (type=indivector)

set_and_send_float(self, devicename, vectorname, elementname, number)

Sets the value of an indi element by a floating point number, and sends it to the server
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the vector
           (type=StringType)
elementname - The name of the element
           (type=StringType)
number - The number to be set.
           (type=FloatType)
Returns:
The vector containing the element that was just sent.
           (type=indivector)

set_and_send_switchvector_by_elementlabel(self, devicename, vectorname, elementlabel)

Sets all indiswitch elements in this vector to Off. And sets the one matching the given elementlabel to On
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the vector
           (type=StringType)
elementlabel - The INDI Label of the Switch to be set to On
           (type=StringType)
Returns:
The vector that that was just sent.
           (type=indivector)

set_and_send_text(self, devicename, vectorname, elementname, text)

Sets the value of an element by a text, and sends it to the server
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the vector
           (type=StringType)
elementname - The name of the element
           (type=StringType)
text - The value to be set.
           (type=StringType)
Returns:
The vector containing the element that was just sent.
           (type=indivector)

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