Trees | Index | Help |
|
---|
Module indiclient :: Class bigindiclient |
|
indiclient
Method Summary | |
---|---|
| |
indi_custom_element_handler
|
Adds a custom handler function for an indielement , the handler will be called
each time the indielement is received. |
indi_custom_vector_handler
|
Adds a custom handler function for an indivector , the handler will be called each
time the vector is received. |
mini_element_handler
|
Adds handler that will be called each time the element is received. |
NoneType |
Sends a signal to the server that tells it, that this client wants to receive indiblob objects. |
indielement
|
Returns an indielement matching the given devicename and vectorname This method will wait until it
has been received. |
indivector
|
Returns an indivector matching the given devicename and vectorname This method will wait until it
has been received. |
NoneType |
Has to be called frequently by any program using this client. |
NoneType |
must be called in order to close the indiclient instance |
NoneType |
Resets the connection to the server |
NoneType |
Sends an INDI vector to the INDI server. |
NoneType |
Sets new def handlers. |
NoneType |
Sets a new message handler. |
NoneType |
Sets a new timeout handler. |
NoneType |
prints all indivectors and their elements to the screen |
NoneType |
Looks if the requested vector has already been received and waits until it is received otherwise |
Instance Variable Summary | |
---|---|
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 |
Method Details |
---|
__init__(self,
host,
port)
|
add_custom_element_handler(self, handler)Adds a custom handler function for anindielement , the handler will be called
each time the indielement is received. Furthermore this
method will call the hander once. If the element has not been received
yet, this function will wait until the element is received before
calling the handler function. If the indielement does not exist this method
will not return.
|
add_custom_vector_handler(self, handler)Adds a custom handler function for anindivector , the handler will be called
each time the vector is received. Furthermore this method will call the
hander once. If the vector has not been received yet, this function
will wait until the vector is received before calling the handler
function. If the vector does not exist this method will not
return.
|
add_mini_element_handler(self, devicename, vectorname, elementname, handlermethod)Adds handler that will be called each time the element is received. Here the handler is a function that takes only one argument, namely the element that was received. This function is deprecated. It has been replaced by theadd_custom_element_handler function.
|
enable_blob(self)Sends a signal to the server that tells it, that this client wants to receiveindiblob objects. If this method is not
called, the server will not send any indiblob . The DCD clients calls it each
time an indiblob is defined.
|
get_element(self, devicename, vectorname, elementname)Returns anindielement matching the given devicename and vectorname This method will wait until it
has been received. In case the vector doesn't exists this routine will
never return.
|
get_vector(self, devicename, vectorname)Returns anindivector matching the given devicename and vectorname This method will wait until it
has been received. In case the vector doesn't exists this routine will
never return.
|
process_events(self)Has to be called frequently by any program using this client. All custom handler methods will called by this (and only by this) method. furthermore thedef*handler and
massage_handler methods will be called here. See also add_custom_element_handler , set_def_handlers , set_message_handler . If you just don't
want to use any custom handlers and you do not use gtkindiclient
functions, you do not need to call this method at all.
|
quit(self)must be called in order to close the indiclient instance
|
reset_connection(self)Resets the connection to the server
|
send_vector(self, vector)Sends an INDI vector to the INDI server.
|
set_def_handlers(self, blob_def_handler, number_def_handler, switch_def_handler, text_def_handler, light_def_handler)Sets newdef handlers. These will be called whenever an
indivector was received with an def*Vector tag. This means
that the INDI driver has called an IDDef* function and
thus defined a new INDI vector. These handlers will only be called once
for each indivector , even if more than one
def*Vector signals are received, for the same indivector .
|
set_message_handler(self, handler)Sets a new message handler. This handler will be called whenever an INDI message has been received from the server.
|
set_timeout_handler(self, handler)Sets a new timeout handler.
|
tell(self)prints all indivectors and their elements to the screen
|
wait_until_vector_available(self, devicename, vectorname)Looks if the requested vector has already been received and waits until it is received otherwise
|
Instance Variable Details |
---|
blob_def_handlerCalled when a newindiblobvector is defined by the driver
(see set_def_handlers )
|
currentDataA buffer to accumulate the character data to be written into the value attribute ofcurrentElement
|
currentElementThe INDI element currently being processed by the XML parser
|
currentMessageThe INDI message currently being processed by the XML parser
|
currentVectorThe INDI vector currently being processed by the XML parser
|
defvectorlistA list of vectors that have been received withdef*Vector
signal at least one time
|
expatan expat XML parser
|
hostThe hostname of the INDI server, this instance ofindiclient is connected to
|
indivectorsThe list of all indivectors received so far
|
message_handler(seeset_message_handler )
|
number_def_handlerCalled when a newindinumbervector is defined by the driver
(see set_def_handlers )
|
portThe port address of the INDI server, this instance ofindiclient is connected to
|
receive_event_queueA background process (_receiver ) is continuesly receiving data
and putting them into this queue. This queue will be read by the process_events method, that the user has to
call in order to process any custom handlers.
|
receivetimerneeded to run the _receive thread
|
running_queueDuring its destructor indiclient puts signal into this queue in order to stop the background process.
|
socketa TCP/IP socket to communicate with the server
|
text_def_handlerCalled when a newinditextvector is defined by the driver
(see set_def_handlers )
|
timeoutA timeout value (seetimeout_handler )
|
timeout_handlerThis function will be called whenever an indielement has been requested but was not received for a time longer thantimeout since the request was issued. (see also set_timeout_handler )
|
verboseIfTrue all XML data will be printed to the screen
|
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sat Sep 10 10:26:05 2005 | http://epydoc.sf.net |