Title: Common Services Components
1Common ServicesComponents
- Bret Goodrich
- 21 March 2005
2Components
Controller void start(IConfiguration) v
oid stop(String) void
pause(String) void resume(String) void
done(IConfiguration) Void
aborted(IConfiguration) void
_start(IConfiguration) void
_stop(String) void _pause(String) void
_resume(String) void
_done(IConfiguration) void
_aborted(IConfiguration) void
_action(IConfiguration)
Component IattributeTable get(IAttributeTable) voi
d set(IAttributeTable) void
_init(IAttributeTable) void
_startup(IAttributeTable) void
_shutdown() void _remove()
Device void offline(void) void
online(IConfiguration) void
_offline(void) void _online(IConfigurat
ion)
3Components
- Components are the basic building blocks of ATST
applications - Technical interface
- Connections to ATST Containers
- Lifecycle support
- Communications support
- Services support
- Functional interface
- Extensible
- Cannot be natively implemented
- Contain no functional data
- Subclasses add specific application functionality
4Technical Interface
- Creation
- Container constructs a component and associated
toolbox - The component should add no construction
functionality
- Initialization
- Get list of default attributes
- Get metadata for attributes
- Do local initialization
- buffers, drivers, etc.
- Startup
- register name
- Do local startup
- subsystems, events, logs, etc.
Container
new
Component
new
Toolbox
init
Property.getMetaData
_init
Connection.register
startup
_startup
5Technical Interface
- Operation
- handle services calls through toolbox
- periodically check on health
- Shutdown
- release external resources
- subsystems, events, etc.
- unregister name
- Remove
- stop all activities
- release internal resources
Container
Component
Toolbox
healthCheck
_health
Log.debug
shutdown
_shutdown
Connection.unregister
remove
_remove
delete
delete
6Technical Interface
- Abstract methods written by a subclass
- _healthCheck test the health of the component
- GOOD, WARNING, BAD, (not UNKNOWN).
- should actively test threads, drivers, and
resources. - _init perform internal initializations
- typical one-time calls (memory allocation, driver
initialization) - cannot use Common Services
- _startup
- external calls (event subscription, logging)
- connection to other Components via Common
Services - _shutdown
- disconnect from Common Services
- _remove
- delete or destroy all internal resources
7Functional Interface
- The functional interface for Components supports
attribute values - Is externally visible through the communications
IDL - Can only get and set values
- Changing the attribute list is done through the
OCS database tools - Extending the Component class adds new
functionality - IAttributeTable get (IAttributeTable)
- fills an attribute table with corresponding
values - void set (IAttributeTable)
- sets values from the input attribute table
8Controllers
- A Controller implements the ATST application
framework - ATST components expect specific behavior from
other components - Command-Action-Response model
- Configurations
- Configuration lifecycle
- Controllers enforce this behavior by
implementation - subclass of Component
- thin functional command interface
- action thread pool
- Controllers are usually at the top of a systems
hierarchy - provide control mechanisms for subsystems
9Controllers
- Public Commands
- start queue an input configuration
- stop stop the named configuration
- pause pause the named configuration
- resume resume the named configuration
- done/aborted callback from an action
- Protected Commands
- _start/_stop/_pause_resume user-supplied
routines - _action user-supplied action routine
- Attributes
- starttime/stoptime optional queue start and
stop - threadmodel/numthreads/activethreads
thread-specific operations
10Command-Action-Response
- Command
- control configurations, not actions
- do not block
- queue configurations
- Action
- perform work in the background
- multiple, simultaneous actions
- Response
- 1st after command accepted
- 2nd after action completes
- associated configuration ID
11Configuration Control
- Configurations are created by the OCS and
- sent throughout the ATST systems
- must follow a sequence of states
QUEUED?RUNNING?DONE - Controllers enforce the sequence and
- enforce it in their subsystems
- keep the state of their slowest subsystem
Subsystems
Queued
Running
Done
Queued
Running
Done
Queued
Running
Done
12Hierarchies
- Controllers manage a list of other controllers
- startup/shutdown makes and breaks connections
- start passes configurations down
- stop/pause/resume pass down configuration control
- done tallies all subsystem states
- User routines modify the behavior of the
hierarchy - _start breaks down configuration into subsystem
configurations - mcs.pos becomes mcs.az.pos and mcs.alt.pos
- mcs.az.rate passes through the upper system
TCS
MCS
M1CS
M2CS
ECS
FOCS
AGCS
WCCS
Azimuth
Cover
Altitude
GIS
Aux
Brakes
Servo
13Action Thread
- Execute specialize actions
- Start any subsystems
- Wait for all subsystems to return
- Generate DONE response
Subsystem
start
Command
Action
Action
sync
_action
(return)
start
Command
start
_action
(return)
Event.post(configstate)
Callback
done
_done
Event.post(configstate)
delete
14Devices
- Devices add real-time control to the ATST
application framework - protect critical resources
- allow only one operational thread
- provide unique device states
- add interface to initialize hardware
- Devices are a subclass of Controller
- expands the interface
- increases the number of operational states
- constrains the number of configurations to one
15Commands
- Additional Device commands apply to the hardware
- online hardware initialization (power on,
brakes, homing) - offline hardware shutdown (power off, brakes)
- Application-specific commands
- _online/_offline
- _start
- _stop/_pause/_resume
- _get/_set
16Device States
- Device states allow the controller to have finer
control over the hardware - OFF The device is in the lowest state, the
default. - IDLE The device is able to accept positioning
commands - BUSY The device cannot be interrupted
- PAUSED The device is suspended
- FAULT The device has detected a fatal error
17MotorDevice
- The MotorDevice adds typical motor operations.
- home a routine to position and index the motor
- toRaw conversion to encoder units
- fromRaw conversion to user units
- And attributes
- pos/cpos demand and current position
- rate/crate maximum and current rate
- acc/cacc maximum and current acceleration
- dec/cdec maximum and current deceleration
- limits current set limits switches
- channel driver board channel
- The MotorDevice is extended into several
subclasses - DiscreteMotorDevice adds incremental positions
- Rate MotorDevice adds continuous rate motion
18SequenceDevice
- The SequenceDevice allows hardware operations in
a given order - a subsystem can be placed in any numbered phase
- all subsystems in a phase complete a busy-done
cycle - the next phase is then begun
- Sequences are useful for staging
- A sequencer is used to read a camera
- phase 1 move mechanisms
- phase 2 configure camera
- phase 3 wait for trigger
- phase 4 transfer data