Old Windows 3.1 server protocol.
|
Methods
|
|
|
|
|
__del__
|
__del__ ( self )
Destructor.
Tries to cleanly shut down the connection to the KappaCCD PC |
|
|
__init__
|
__init__ (
self,
hostname,
txtout=None,
idletask=None,
)
Constructor: Open and initialize the connection to the CCD host
parameters:
- hostname
hostname or IP address of the PC controlling the KappaCCD
optional parameters:
- txtout
the file or pseudofile used to write a log to.
|
|
|
allsockdown
|
allsockdown ( self )
Shut down the sockets brute force.
Internal use. |
|
|
getpacket
|
getpacket ( self )
Get a packet from datasocket, and decode it
return value:
A tuple containing the packet-type and the data.
Packet types are: 1- output string; 2- prompt; 3- image; 4- exit
request; 5- image with new style saveid.
For types 1, 2 and 4, the data is a string. For images the data is a
tuple of (saveid,filename,imagedata).
In type 3 images, the saveid is 1 for the first image, and 2 for
subsequent images that are destined for the same file.
In type 5 images, the saveid is the sequence number of the image
in the file.
|
Exceptions
|
|
KeyboardInterrupt, arg, sys.exc_traceback error( "Trying to get packet while waiting for input" )
|
|
|
|
imagestatus
|
imagestatus ( self, status )
Send the image status.
parameters:
- status
boolean. if 1, the image was treated ok; if 0, there was an
unrecoverable error.
|
|
|
mksocks
|
mksocks ( self )
Create the socket connections.
Internal use by the constructor. |
|
|
sendcommand
|
sendcommand ( self, data )
Send a command to the KappaCCD controlling PC
parameters:
- data
the command line
|
Exceptions
|
|
error( "Trying to send command without prompt" )
|
|
|
|
sendfatal
|
sendfatal ( self, data )
Send interruption request. |
|
|
sendpacket
|
sendpacket (
self,
data,
sendfixed=sendfixed,
)
Send a packet over the command socket. |
|
|
sendstatus
|
sendstatus ( self, data )
Send image status over the command socket.
Internal use. |
|
|
setidletask
|
setidletask ( self, idletask )
Set a task that can be called during waiting time.
Normally idletask will be a function that updates the GUI |
|
|
splitfilepacket
|
splitfilepacket ( self, packet )
|