Deprecated API

Deprecated Classes
          Used InstrumentServiceBlock instead 
          Use DeviceLogBlock instead 
          Replaced by BaseInstrumentService, PolledInstrumentService, and StreamingInstrumentService. InstrumentService is the base class of an "application framework" for instruments which communicate through a serial port

The application framework is a semi-complete application, providing data and behavior which are common to all instrument services. To complete the implementation of a specific instrument service, the programmer extends the InstrumentService class, and implements or overrides several InstrumentService methods.

InstrumentService provides the following as built-in features:

  • Generic service and instrument initialization method
  • Main control loop which invokes methods to a) request data sample from the instrument, b) read the sample from the instrument, c) process the sample, and d) log the sample. The subclass must implement the sample request method, but in many cases the sample retrieval and processing methods can be used "as is".
  • Automatic power management of the instrument

Access to instrument serial port: InstrumentService contains a for output to the instrument's CommPort, and a for input from the instrument's CommPort. Subclasses can use these stream objects to communicate with the instrument. Note that these objects should NOT be accessed from your subclass constructor, as they haven't been created yet at construction time.

Power management: Your subclass must implement methods initCommunicationPowerPolicy(), and initInstrumentPowerPolicy(), which should return one of the following values defined in interface org.mbari.isi.interfaces.Instrument: PowerPolicy.NEVER (for self-powered instruments), PowerPolicy.ALWAYS, or PowerPolicy.WHEN_SAMPLING. The subclass needn't do any further power management, as the base automatically manages instrument power through its DPA port based on the "power policy" specified by your subclass.

The base class provides default values for a number of attributes (member variables); see comments on the DEFAULT_ fields (below). These default values can be overridden using the "set" methods provided for each attribute (e.g. setMaxSampleTries()). For some attributes, no reasonable default value is known, and must be provided by your subclass. These values are specified by implementing the abstract "init" member functions defined by the base class (e.g. initCommunicationPowerPolicy()).

To implement a specific instrument service, complete the following steps:

1. Extend InstrumentService to create your service's subclass

2. Implement any abstract InstrumentService methods (see documentation below for specific methods)

3. If necessary, override base class initializeInstrument() method, where service- and instrument-specific initialization should be done. If necessary, change values of base class attributes here, using "set" methods provided.

4. If necessary, override other base class methods

5. If necessary, add any additional attributes/methods needed to implement your instrument's service. 

          Used SummaryBlock instead 
          Replaced by MetadataPacket 

Deprecated Fields
          Use getShapeScale() instead 

Deprecated Methods
com.jrefinery.util.ObjectUtils.equalOrBothNull(Object, Object)
          Use ObjectUtils.equal(...). 
          use getLegendItems(). 

Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.