ExecutiveSystem
index
/scisoft/users/svensson/develop/dna/es/src/ExecutiveSystem.py

#################################################################
#
ExecutiveSystem.py
#
# Authors: The DNA team, http://www.dna.ac.uk
#
# Version: $Id: ExecutiveSystem.html,v 1.1 2004/10/22 09:50:55 svensson Exp $
#
#################################################################
#
# This is the class for the Executive System. Please note that
# this code will be heavily modified for the version after the
# release of DNA 1.0. This is necessary in order to make it
# possible for the ES to do concurrent tasks.
#
#################################################################

 
Modules
       
BaseHTTPServer
Queue
XSD
dna_httplib
exceptions
math
os
pprint
pyxie
re
smtplib
socket
string
sys
threading
time
traceback

 
Classes
       
ExecutiveSystem

 
class ExecutiveSystem
     Methods defined here:
__init__(self)
Initialises the ES and runs the ES main loop.
bcm_abort(self)
Tries to abort the BCM system.
bcm_send_command(self, command, request)
Sends a command to the BCM.
check_abort(self)
Called for checking if the ES has received an abort event.
If this is the case an "ExecutiveException" is raised with the argument "abort".
check_bcm_communication(self)
Checks the comminucation to the BCM by sending a bcm_parameter_request.
If the request succeeds the system is set to online, otherwise to offline.
db_send_synchronous_command(self, path, request)
Sends a sunchronous command to the DB. It's not used in DNA 1.0.
do_cell_refinement_request(self, cell_refinement_request=None)
Called by the do_collect_data_request if the integrate
flag is set to true. It uses the dpm_send_asynchronous_command to
send the request to the DPM_proxy.
do_characterize_crystal_request(self, characterize_crystal_request)
Does the whole chain of tasks involved in a characterize
crystal request, i.e. collecting reference images, indexing, integration
and calculation of the strategy.
do_collect_data_request(self, collect_data_request)
Does the collection of data. If the integrate flag in
the collect data request is set the method will also call the DPM_proxy
to integrate the data. Please note that for the moment this integration
is done after the data collection has finished - this might change in
a week or so.
do_collect_reference_request(self, collect_reference_request)
Does the collection of reference images.
do_collect_request(self, collect_request)
Calls the BCM to do a collect request. It's called by
the do_collect_reference_request and the do_collect_data_request.
do_get_proposal_request(self, db_proposal)
An experimental method for the database access. It is not used for DNA 1.0.
do_index_request(self, index_request)
First checks that the images are available, fills in
missing information in the index request (e.g. detector type) and then
uses the dpm_send_asynchronous_command for sending the index_request to the
DPM_proxy.
do_integrate_request(self, integrate_request=None)
Adds extra integrate commands if available and then uses
the dpm_send_asynchronous_command for sending the integrate request to the
DPM proxy.
do_single_integrate_request(self, single_integrate_request=None)
Adds extra integrate commands if available and then uses
the dpm_send_asynchronous_command for sending the single integrate request to the
DPM proxy.
do_strategy_request(self, strategy_request)
Adds extra strategy commands if available and then uses
the dpm_send_asynchronous_command for sending the strategy request to the
DPM proxy.
dpm_check_thread(self)
Checks if the dpm_thread is alive and sleeps until
the thread is terminated.
dpm_do_request(self)
Is started in a new thread by the dpm_send_asynchronous_command method.
It forward the request (index, integrate etc.) to the DPM proxy.
dpm_send_asynchronous_command(self, request_type, the_request, response_type)
Handles the asynchronous communication with the DPM proxy. It starts the dpm_do_request
method in a new thread.
get_bcm_parameters(self)
Returns the response after sending a BCM parameters request to the BCM.
get_status(self)
Returns the current status of the ES, e.g. "IDLE".
go_offline(self)
Switches the ESContext online attribute to false if it's not already false.
go_online(self)
Switches the ESContext online attribute to true if it's not already true.
gui_send_message(self, path, message)
Sends a message to the GUI.
logwrite(self, logText)
Forwads log messages to the DNA logger thread.
print_traceback(self)
Prints the python traceback as log messages - very useful for debugging.
send_email(self, subject, message)
Sends an email to the DNA contact person (if configured).
send_message(self, command, xml_message)
Called by other threads, mainly the ExecutiveHTTPServer.
The arguments is the command, e.g. "/index_request", and the corresponding
XML request.
set_status(self, newStatus)
Sets the status of the ES.
try_to_go_online(self)
Tries to go online if in offline mode.
wait_for_response(self, response_type)
Is called whenever a asynchronous command has been issued, e.g.
after a collect request or an index request. It waits till the ES thread
has been notified via the send_message method.

 
Data
        Debug = <Debug.Debug instance>
ESConfig = <ESConfig.ESConfig instance>
ESContext = <ESContext.ESContext instance>
FALSE = 0
TRUE = 1
XML_utils = <XML_utils.XML_utils instance>
a = True
version_flag = 0
version_info = (2, 3, 3, 'final', 0)