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

Class gtkindiclient

bigindiclient --+    
                |    
       indiclient --+
                    |
                   gtkindiclient



Method Summary
  __init__(self, host, port)
_ccdpreview add_ccdpreview(self, devicename, drawingareawidget, brightnesswidget, contrastwidget, gammawidget)
Connects a Gtk.DrawingArea and 3 GTK.Range objects (like sliders, scrollbars etc.) to an INDI device.
_comboboxentryhandler add_comboboxentry(self, devicename, vectorname, widget)
Connects an indiswitchvector object (with rule OneOfMany) to a GTK.comboboxentryBoxEntry (not a GTK.comboboxentryBox) object.
_entryhandler add_entry(self, devicename, vectorname, elementname, widget)
Connects an indielement to a GTK.Entry (can also be used with any GTK object providing a set_text method) (see also _entryhandler)
_indistream add_indistream(self, devicename, drawingareawidget)
Connects a Gtk.DrawingArea to an INDI device.
_labelhandler add_label(self, devicename, vectorname, elementname, widget)
Connects an indielement to a GTK.Label (see also _labelhandler)
_rangehandler add_range(self, devicename, vectorname, elementname, widget)
Connects an indielement to a GTK.Range (like slider scrollbar etc.) (see also _rangehandler)
_spinbuttonhandler add_spinbutton(self, devicename, vectorname, elementname, widget)
Connects an indielement to a GTK.Spinbutton (see also _spinbuttonhandler)
_statuslabelhandler add_statuslabel(self, devicename, vectorname, widget)
Connects the status property of an indivector to a GTK.Label (see also _statuslabelhandler)
_switchlabelhandler add_switchlabel(self, devicename, vectorname, elementname, widget, onlabel, offlabel)
Connects an indiswitch to a GTK.Label, replacing On and Off by a customisable label string
_togglebuttonshandler add_togglebuttons(self, devicename, vectorname, widgetlist)
Connects a list of Gtk.ToggleButton to an indiswitchvector (see _togglebuttonshandler)
_vectorlabelhandler add_vectorlabel(self, devicename, vectorname, widget)
Connects an indivector object to a GTK.Label object (see also _vectorlabelhandler)
gui_indi_object_handler get_handler(self, devicename, vectorname, type)
This function looks for installed indi_custom_vector_handler objects, matching devicename and vectorname and type.
_ccdpreview get_preview(self, devicename)
Return the _ccdpreview object installed for this device.
NoneType setup_range(self, vector, element, widget)
Sets up a GTK.Range widget with the information contained in element.
    Inherited from indiclient
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

Instance Variable Summary
list of _ccdpreview ccdpreviewlist: A list of ccdpreviews connected to INDI devices
list of _indistream indistreamlist: A list of indistreams connected to INDI devices
    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

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.indiclient.__init__

add_ccdpreview(self, devicename, drawingareawidget, brightnesswidget, contrastwidget, gammawidget)

Connects a Gtk.DrawingArea and 3 GTK.Range objects (like sliders, scrollbars etc.) to an INDI device. Any BLOBs with the extension .ccdpreview or .ccdpreview.z being received for this device will be drawn into drawingareawidget, any indinumbervector objects received for this device and a who's name property matches CCDPREVIEW_CTRL will be used in order to set the parameters of the ccdpreview. (see also _ccdpreview)

Important: You have to call indiclient.enable_blob
Parameters:
devicename - The name of the device
           (type=StringType)
drawingareawidget - The Gtk.DrawingArea widget to be used in order to display the ccdpreview.
           (type=Gtk.DrawingArea.)
brightnesswidget - A GTK Range to adjust the brightness
           (type=GTK.Range)
contrastwidget - A GTK Range to adjust the contrast
           (type=GTK.Range)
gammawidget - A GTK Range to adjust gamma
           (type=GTK.Range)
Returns:
The _ccdpreview object
           (type=_ccdpreview)

add_comboboxentry(self, devicename, vectorname, widget)

Connects an indiswitchvector object (with rule OneOfMany) to a GTK.comboboxentryBoxEntry (not a GTK.comboboxentryBox) object. The labels of the indiswitch objects will be fed into the popdown menu of the comboboxentrybox, the label of the active switch will put into the comboboxentrybox entry. (see also _comboboxentryhandler )
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the INDIvector
           (type=StringType)
widget - The GTK widget
           (type=Gtk.Widget)
Returns:
The handler object created
           (type=_comboboxentryhandler)

add_entry(self, devicename, vectorname, elementname, widget)

Connects an indielement to a GTK.Entry (can also be used with any GTK object providing a set_text method) (see also _entryhandler)
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the INDIvector
           (type=StringType)
elementname - name of the INDI element
           (type=StringType)
widget - The GTK widget
           (type=Gtk.Widget)
Returns:
The handler object created
           (type=_entryhandler)

add_indistream(self, devicename, drawingareawidget)

Connects a Gtk.DrawingArea to an INDI device. Any blobs with the extension .stream or .stream.z being received for this device will be drawn into drawingareawidget, any indinumbervector objects received for this device and a who's name property matches IMAGE_SIZE will be used in order to set the parameters of the stream. (see also _indistream)

Important: You have to call indiclient.enable_blob
Parameters:
devicename - The name of the device
           (type=StringType)
drawingareawidget - The Gtk.DrawingArea widget to be used in order to display the stream.
           (type=Gtk.DrawingArea.)
Returns:
The _indistream object
           (type=_indistream)

add_label(self, devicename, vectorname, elementname, widget)

Connects an indielement to a GTK.Label (see also _labelhandler)
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the INDIVector
           (type=StringType)
elementname - name of the INDI element
           (type=StringType)
widget - The Label
           (type=Gtk.Label)
Returns:
The handler object created
           (type=_labelhandler)

add_range(self, devicename, vectorname, elementname, widget)

Connects an indielement to a GTK.Range (like slider scrollbar etc.) (see also _rangehandler)
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the INDIvector
           (type=StringType)
elementname - name of the INDI element
           (type=StringType)
widget - The GTK Range
           (type=GTK.Range)
Returns:
The handler object created
           (type=_rangehandler)

add_spinbutton(self, devicename, vectorname, elementname, widget)

Connects an indielement to a GTK.Spinbutton (see also _spinbuttonhandler)
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the INDIvector
           (type=StringType)
elementname - name of the INDI element
           (type=StringType)
widget - The GTK Spinbutton
           (type=Spinbutton)
Returns:
The handler object created
           (type=_spinbuttonhandler)

add_statuslabel(self, devicename, vectorname, widget)

Connects the status property of an indivector to a GTK.Label (see also _statuslabelhandler)
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the INDIVector
           (type=StringType)
widget - The Label
           (type=Gtk.Label)
Returns:
The handler object created
           (type=_statuslabelhandler)

add_switchlabel(self, devicename, vectorname, elementname, widget, onlabel, offlabel)

Connects an indiswitch to a GTK.Label, replacing On and Off by a customisable label string
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the INDIVector
           (type=StringType)
elementname - name of the INDI element
           (type=StringType)
widget - The Label
           (type=Gtk.Label)
onlabel - The Text to be displayed on the Label if the indiswitch is On, Pango markup is allowed
           (type=StringType)
offlabel - The Text to be displayed on the Label if the indiswitch is Off, Pango markup is allowed
           (type=StringType)
Returns:
The handler object created
           (type=_switchlabelhandler)

add_togglebuttons(self, devicename, vectorname, widgetlist)

Connects a list of Gtk.ToggleButton to an indiswitchvector (see _togglebuttonshandler)
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the INDIvector
           (type=StringType)
widgetlist - The list of togglebuttons.
           (type=List of Gtk.ToggleButton or inherited type.)
Returns:
The handler object created
           (type=_togglebuttonshandler)

add_vectorlabel(self, devicename, vectorname, widget)

Connects an indivector object to a GTK.Label object (see also _vectorlabelhandler)
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the INDIVector
           (type=StringType)
widget - The Label
           (type=Gtk.Label)
Returns:
The handler object created
           (type=_vectorlabelhandler)

get_handler(self, devicename, vectorname, type)

This function looks for installed indi_custom_vector_handler objects, matching devicename and vectorname and type. If exactly one is found, it is returned. Otherwise an exception is raised.
Parameters:
devicename - The name of the device
           (type=StringType)
vectorname - The name of the INDIvector
           (type=StringType)
type - the type of the object to look for
           (type=StringType)
Returns:
the handler found or None on error.
           (type=gui_indi_object_handler)

get_preview(self, devicename)

Parameters:
devicename - The name of the device
           (type=StringType)
Returns:
the _ccdpreview object installed for this device.
           (type=_ccdpreview)

setup_range(self, vector, element, widget)

Sets up a GTK.Range widget with the information contained in element. Set minimum and maximum values as well as the incremental steps and the value of widget are set up.
Parameters:
vector - The indivector in which element is contained.
           (type=indivector)
element - The indielement which shall be used to setup the GTK.Range
           (type=indielement)
widget - The GTK Range to be set up.
           (type=GTK.Range)
Returns:
None
           (type=NoneType)

Instance Variable Details

ccdpreviewlist

A list of ccdpreviews connected to INDI devices
Type:
list of _ccdpreview

indistreamlist

A list of indistreams connected to INDI devices
Type:
list of _indistream

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