コード例 #1
0
 def disconnect(self, *args, **kwargs):
     """
     Disconnect from device via port agent / logger.
     @raises InstrumentStateException if command not allowed in current state
     @raises NotImplementedException if not implemented by subclass.
     """
     raise NotImplementedException('disconnect() not implemented.')
コード例 #2
0
 def get_current_state(self):
     """
     Return current device state. Implemented in connection specific
     subclasses.
     """
     raise NotImplementedException(
         'get_current_state() is not implemented.')
コード例 #3
0
 def _constraints_for_historical_request(cls, config):
     """
     Determines any constraints that must be added to the constraints configuration.
     This should present a uniform constraints configuration to be sent to _get_data
     @param config Dict containing configuration parameters, may include constraints, formatters, etc
     @retval dictionary containing the restraints
     """
     raise NotImplementedException('{0}.{1} must implement \'_constraints_for_historical_request\''.format(cls.__module__, cls.__name__))
コード例 #4
0
 def _init_acquisition_cycle(cls, config):
     """
     Allows the concrete implementation to initialize/prepare objects the data handler
     will use repeatedly (such as a dataset object) in cls._constraints_for_new_request and/or cls._get_data
     Objects should be added to the config so they are available later in the workflow
     @param config Dict containing configuration parameters, may include constraints, formatters, etc
     """
     raise NotImplementedException('{0}.{1} must implement \'_init_acquisition_cycle\''.format(cls.__module__, cls.__name__))
コード例 #5
0
 def _get_data(cls, config):
     """
     Iterable function that acquires data from a source iteratively based on constraints provided by config
     Passed into BaseDataHandler._publish_data and iterated to publish samples.
     @param config dict containing configuration parameters, may include constraints, formatters, etc
     @retval an iterable that returns well-formed Granule objects on each iteration
     """
     raise NotImplementedException('{0}.{1} must implement \'_get_data\''.format(cls.__module__, cls.__name__))
コード例 #6
0
 def initialize(self, *args, **kwargs):
     """
     Initialize driver connection, bringing communications parameters
     into unconfigured state (no connection object).
     @raises InstrumentStateException if command not allowed in current state        
     @raises NotImplementedException if not implemented by subclass.
     """
     raise NotImplementedException('initialize() not implemented.')
コード例 #7
0
 def connect(self, *args, **kwargs):
     """
     Establish communications with the device via port agent / logger
     (connected connection object).
     @raises InstrumentStateException if command not allowed in current state
     @throws InstrumentConnectionException if the connection failed.
     @raises NotImplementedException if not implemented by subclass.
     """
     raise NotImplementedException('connect() not implemented.')
コード例 #8
0
 def execute_direct_access(self, *args, **kwargs):
     """
     output direct access data to device.
     @raises TimeoutError if could not wake device or no response.
     @raises StateError if command not allowed in current state.
     @raises NotImplementedError if not implemented by subclass.                
     """
     raise NotImplementedException(
         'execute_direct_access() not implemented.')
コード例 #9
0
 def get(self, *args, **kwargs):
     """
     Retrieve device parameters.
     @param args[0] DriverParameter.ALL or a list of parameters to retrive.
     @retval parameter : value dict.
     @raises InstrumentParameterException if missing or invalid get parameters.
     @raises InstrumentStateException if command not allowed in current state
     @raises NotImplementedException if not implemented by subclass.
     """
     raise NotImplementedException('get() is not implemented.')
コード例 #10
0
 def _constraints_for_new_request(cls, config):
     #TODO: Document what "constraints" looks like (yml)!!
     """
     Determines the appropriate constraints for acquiring any "new data" from the external dataset
     Returned value cannot be None and is assigned to config['constraints']
     The format of the constraints are documented:
     @param config dict of configuration parameters - may be used to generate the returned 'constraints' dict
     @retval dict that contains the constraints for retrieval of new data from the external dataset
     """
     raise NotImplementedException('{0}.{1} must implement \'_constraints_for_new_request\''.format(cls.__module__, cls.__name__))
コード例 #11
0
 def execute_stop_direct_access(self, *args, **kwargs):
     """
     Leave direct access mode.
     @raises TimeoutError if could not wake device or no response.
     @raises ProtocolError if stop command not recognized.
     @raises StateError if command not allowed in current state.
     @raises NotImplementedError if not implemented by subclass.                
     """
     raise NotImplementedException(
         'execute_stop_direct_access() not implemented.')
コード例 #12
0
 def configure(self, *args, **kwargs):
     """
     Configure the driver for communications with the device via
     port agent / logger (valid but unconnected connection object).
     @param arg[0] comms config dict.
     @raises InstrumentStateException if command not allowed in current state        
     @throws InstrumentParameterException if missing comms or invalid config dict.
     @raises NotImplementedException if not implemented by subclass.
     """
     raise NotImplementedException('configure() not implemented.')
コード例 #13
0
 def execute_start_autosample(self, *args, **kwargs):
     """
     Switch to autosample mode.
     @param timeout=timeout Optional command timeout.        
     @raises InstrumentTimeoutException if could not wake device or no response.
     @raises InstrumentStateException if command not allowed in current state.
     @raises NotImplementedException if not implemented by subclass.                
     """
     raise NotImplementedException(
         'execute_start_autosample() not implemented.')
コード例 #14
0
 def discover(self, *args, **kwargs):
     """
     Determine initial state upon establishing communications.
     @param timeout=timeout Optional command timeout.        
     @retval Current device state.
     @raises InstrumentTimeoutException if could not wake device.
     @raises InstrumentStateException if command not allowed in current state or if
     device state not recognized.
     @raises NotImplementedException if not implemented by subclass.
     """
     raise NotImplementedException('discover() is not implemented.')
コード例 #15
0
 def execute_calibrate(self, *args, **kwargs):
     """
     Execute device calibration.
     @param timeout=timeout Optional command timeout (for wakeup only --
     device specific timeouts for internal calibration commands).
     @raises InstrumentTimeoutException if could not wake device or no response.
     @raises InstrumentProtocolException if test commands not recognized.
     @raises InstrumentStateException if command not allowed in current state.
     @raises NotImplementedException if not implemented by subclass.                        
     """
     raise NotImplementedException('execute_calibrate() not implemented.')
コード例 #16
0
 def set(self, *args, **kwargs):
     """
     Set device parameters.
     @param args[0] parameter : value dict of parameters to set.
     @param timeout=timeout Optional command timeout.
     @raises InstrumentParameterException if missing or invalid set parameters.
     @raises InstrumentTimeoutException if could not wake device or no response.
     @raises InstrumentProtocolException if set command not recognized.
     @raises InstrumentStateException if command not allowed in current state.
     @raises NotImplementedException if not implemented by subclass.
     """
     raise NotImplementedException('set() not implemented.')
コード例 #17
0
 def execute_acquire_sample(self, *args, **kwargs):
     """
     Poll for a sample.
     @param timeout=timeout Optional command timeout.        
     @ retval Device sample dict.
     @raises InstrumentTimeoutException if could not wake device or no response.
     @raises InstrumentProtocolException if acquire command not recognized.
     @raises InstrumentStateException if command not allowed in current state.
     @raises NotImplementedException if not implemented by subclass.        
     """
     raise NotImplementedException(
         'execute_acquire_sample() not implemented.')
コード例 #18
0
ファイル: packet_factory.py プロジェクト: sfoley/coi-services
 def build_packet(self, farg, **kwargs):
     raise NotImplementedException()
コード例 #19
0
ファイル: packet_factory.py プロジェクト: sfoley/coi-services
 def build_packet(self):
     raise NotImplementedException()
コード例 #20
0
 def _handler(self):
     "The actual handler to which the client is connected.  Must be implemented in any server that inherits from this class"
     log.debug("TcpServer._handler(): not implemented")
     raise NotImplementedException('TcpServer._handler() not implemented.')
コード例 #21
0
 def _handler(self):
     "The actual server to which the user has connected."
     log.debug("TcpServer._handler(): not implemented")
     raise NotImplementedException('TcpServer._handler() not implemented.')