Real-Time Java AOCS Framework v1.0 API Specification

RtjAocsFramework.UnitManagement
Class BasicUnitReconfigurer

java.lang.Object
  |
  +--RtjAocsFramework.BasicObjects.RootObject
        |
        +--RtjAocsFramework.BasicObjects.AocsObject
              |
              +--RtjAocsFramework.UnitManagement.BasicUnitReconfigurer
All Implemented Interfaces:
Configurable, DataSink, DataSource, Reconfigurable, Resettable, Telemeterable, UnitFunctional

public class BasicUnitReconfigurer
extends AocsObject
implements Reconfigurable, UnitFunctional

In a common situation a primary unit is backed up by one or more identical redundant units. The BasicUnitReconfigurer can be used as a reconfiguration manager for this situation. It handles reconfigurations across a set of n identical units.

Copyright: see the Copyright Notice.

Version:
1.0
Author:
Vaclav Cechticky (IfA ETHZ), Alessandro Pasetti (University of Konstanz)
See Also:
Unit Framelet Document

Field Summary
 
Fields inherited from interface RtjAocsFramework.TelemetryManagement.Telemeterable
DEBUG_TM, LONG_TM, NORMAL_TM, NTMFORMATS, SHORT_TM
 
Constructor Summary
BasicUnitReconfigurer(short numberOfConfig, int numberOfList, short defaultConfig)
          Creates a new BasicUnitReconfigurer object.
 
Method Summary
 void acquireFunctionalData()
          Initiates the transaction(s) for the acquisition of functional data from the unit.
 void addReconfigurationListener(ReconfigurationListener l)
          Register a listener to reconfiguration events
 void addUnit(Unit u)
          Load an unit.
 boolean canReconfigure()
          Calls to reconfigure should normally be preceded by calls to canReconfigure to verify that the reconfiguration is possible.
 void disableConfiguration(short n)
          Disable reconfiguration to the n-th configuration.
 void disableReconfiguration()
          Disable reconfigurations.
 void enableConfiguration(short n)
          Enable reconfiguration to the n-th configuration.
 void enableReconfiguration()
          Enable reconfigurations.
 AocsObject getAocsObject()
          Return the reconfiguration manager as an instance of type AocsObject.
 short getConfiguration()
          Returns the current configuration.
 short getConfigurationRank(short n)
          Returns the rank of the n-th configuration.
 int getNumberOfInputs()
          Return the number of inputs of the data sink object.
 int getNumberOfOutputs()
          Return the number of outputs of the data source object.
 double getOutput(int i)
          Return the value of the i-th output.
 RecoveryAction getReconfigurationErrorRecoveryAction()
          Getter method for recovery action associated to failed reconfiguration request.
 int getReconfigurationOrder()
          Returns the order of the reconfiguration group.
 int getTelemetryImageLength()
          Return the length in bits of the telemetry image that would be written by the object in response to a call to method writeToTelemetry.
 boolean isAcquireTransactionFinished()
          The method returns the completion status of the acquisition.
 boolean isConfigurationHealthy(short n)
          Checks whether the configuration n is healthy.
 boolean isConfigured()
          Checks a configuration of the reconfiguration manager helper and the list of units where backup units are stored.
 boolean isSendTransactionFinished()
          The method returns the completion status of the send transaction.
 boolean isSynchronizeFunctionalFinished()
          Checks whether the underlying transaction has been completed.
 void markConfiguration(short n, boolean mark)
          The method marks configuration n as healthy if mark is true and as unhealthy if mark is false.
 void rankConfiguration(short n, short r)
          Sets the rank of configuration n to rank.
 void reconfigure()
          Perform a reconfiguration to the highest-ranking healthy configuration that has not been disabled.
 void refreshFunctionalIn()
          Functional data are acquired at raw data level and placed in a hardware buffer internal to the unit.
 void refreshFunctionalOut()
          Sent functional data to the external unit are taken from hardware buffer internal to the unit.
 void removeReconfigurationListener(ReconfigurationListener l)
          Unregister a listener to reconfiguration events
 void removeUnit(Unit u)
          Unload an unit.
 void reset()
          Resets super object state and performs a local reset.
 void resetConfiguration()
          Resets configuration of the super object and performs the local reset of the configuration.
 void restoreConfiguration(ConfigurationState s)
          Restore the internal configuration of the reconfiguration manager to the value stored in s.
 void saveConfiguration(ConfigurationState s)
          Save the internal configuration of the reconfiguration manager in the parameter s.
 void sendFunctionalData()
          Initiates the transaction(s) to send the functional data to the unit.
 void setConfiguration(short n)
          Set the current configuration to newConfiguration.
 void setFunctionalInConverter(AbstractControlChannel c)
          Data conversion from raw data level to customized data level, and any other processing on the raw data (eg. bias correction), is done by a control channel object.
 void setFunctionalInLink(DataSink destLink)
          Sets the functional input data link for the data converted from raw data level to customized data level.
 void setFunctionalInLink(DataSink destLink, int i, int j)
          Sets the functional input data link for the data converted from raw data level to customized data level.
 void setFunctionalOutConverter(AbstractControlChannel c)
          Data conversion from customized data level (in the source buffers) to raw data level (in the hardware buffer) is done by a control channel object.
 void setFunctionalOutLink(DataSource sourceLink)
          Sets the functional output data link for the data at customized data level.
 void setFunctionalOutLink(DataSource sourceLink, int i, int j)
          Sets the functional output data link for the data at customized data level.
 void setInput(double newValue, int i)
          Set the i-th input.
 void setReconfigurationErrorRecoveryAction(RecoveryAction r)
          Setter method for recovery action associated to failed reconfiguration request.
 void synchronizeFunctional()
          Initiates a synchronization operation for the functional data.
 void writeToTelemetry(TelemetryStream stream)
          Causes the object to write its own state to the telemetry stream.
 
Methods inherited from class RtjAocsFramework.BasicObjects.AocsObject
addConfigurationListener, addFailureListener, finalize, getAocsClock, getConfigurationListenerList, getCycle, getDestructionRecoveryAction, getFailureListenerList, getSystemManager, getTelemetryFormat, getTime, removeConfigurationListener, removeFailureListener, reportConfigurationEvent, reportFailure, resetStaticConfiguration, setAocsClock, setDestructionRecoveryAction, setMaxNumberOfConfigurationListeners, setMaxNumberOfFailureListeners, setSystemManager, setTelemetryFormat
 
Methods inherited from class RtjAocsFramework.BasicObjects.RootObject
getClassId, getInstanceId, setClassId
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicUnitReconfigurer

public BasicUnitReconfigurer(short numberOfConfig,
                             int numberOfList,
                             short defaultConfig)
Creates a new BasicUnitReconfigurer object.

Parameters:
numberOfConfig - number of configuration in the configuration group
numberOfList - maximum number of listeners for reconfiguration events
defaultConfig - default configuration
Method Detail

isConfigured

public boolean isConfigured()
Checks a configuration of the reconfiguration manager helper and the list of units where backup units are stored.

Specified by:
isConfigured in interface Configurable
Overrides:
isConfigured in class AocsObject
Returns:
the true value if the object is configured, otherwise returns false

reset

public void reset()
Resets super object state and performs a local reset.

Specified by:
reset in interface Resettable
Overrides:
reset in class AocsObject

resetConfiguration

public void resetConfiguration()
Resets configuration of the super object and performs the local reset of the configuration.

Specified by:
resetConfiguration in interface Configurable
Overrides:
resetConfiguration in class AocsObject

addUnit

public void addUnit(Unit u)
Load an unit.

Parameters:
u - an unit to load

removeUnit

public void removeUnit(Unit u)
Unload an unit.

Parameters:
u - an unit to unload

getConfiguration

public short getConfiguration()
Returns the current configuration.

Specified by:
getConfiguration in interface Reconfigurable
Returns:
short the current configuration

setConfiguration

public void setConfiguration(short n)
Set the current configuration to newConfiguration. The change is only performed if the target configuration is legal and if the target configuration is different from the starting configuration. If the request for the configuration change originates from outside the reconfigurer helper, the starting configuration is marked as 'unhealthy'. A reconfiguration event is fired to all registered listeners to inform them of the configuration change. The configuration change is performed regardless of the enable status of the target configuration or of the enable status of reconfigurations.

Specified by:
setConfiguration in interface Reconfigurable
Parameters:
n - the new configuration

markConfiguration

public void markConfiguration(short n,
                              boolean mark)
The method marks configuration n as healthy if mark is true and as unhealthy if mark is false.

Specified by:
markConfiguration in interface Reconfigurable
Parameters:
n - a particular configuration
mark - marks the configuration n as healthy if mark is true and as unhealthy if mark is false

rankConfiguration

public void rankConfiguration(short n,
                              short r)
Sets the rank of configuration n to rank.

Specified by:
rankConfiguration in interface Reconfigurable
Parameters:
n - a particular configuration
r - a particular rank

enableConfiguration

public void enableConfiguration(short n)
Enable reconfiguration to the n-th configuration. The effect of this method is the same as marking the n-th configuration as healthy.

Specified by:
enableConfiguration in interface Reconfigurable
Parameters:
n - particular configuration

disableConfiguration

public void disableConfiguration(short n)
Disable reconfiguration to the n-th configuration. The effect of this method is the same as marking the n-th configuration as unhealthy.

Specified by:
disableConfiguration in interface Reconfigurable
Parameters:
n - particular configuration

enableReconfiguration

public void enableReconfiguration()
Enable reconfigurations. A call to method reconfigure has no effect when reconfigurations are disabled. However, it does not interfere with calls to method setConfiguration.

Specified by:
enableReconfiguration in interface Reconfigurable

disableReconfiguration

public void disableReconfiguration()
Disable reconfigurations. A call to method reconfigure has no effect when reconfigurations are disabled. However, it does not interfere with calls to method setConfiguration.

Specified by:
disableReconfiguration in interface Reconfigurable

reconfigure

public void reconfigure()
Perform a reconfiguration to the highest-ranking healthy configuration that has not been disabled. Reconfigurations are performed only if they are enabled. If no reconfiguration is possible, the method returns without taking any action.

Specified by:
reconfigure in interface Reconfigurable

canReconfigure

public boolean canReconfigure()
Calls to reconfigure should normally be preceded by calls to canReconfigure to verify that the reconfiguration is possible.

Specified by:
canReconfigure in interface Reconfigurable
Returns:
the true value if further reconfigurations are possible

isConfigurationHealthy

public boolean isConfigurationHealthy(short n)
Checks whether the configuration n is healthy.

Specified by:
isConfigurationHealthy in interface Reconfigurable
Parameters:
n - particular configuration
Returns:
the true value if the configuration n is healthy

getReconfigurationOrder

public int getReconfigurationOrder()
Returns the order of the reconfiguration group.

Specified by:
getReconfigurationOrder in interface Reconfigurable
Returns:
the order of the reconfiguration group

getConfigurationRank

public short getConfigurationRank(short n)
Returns the rank of the n-th configuration.

Specified by:
getConfigurationRank in interface Reconfigurable
Parameters:
n - particular configuration
Returns:
the rank of the n-th configuration

setReconfigurationErrorRecoveryAction

public void setReconfigurationErrorRecoveryAction(RecoveryAction r)
Setter method for recovery action associated to failed reconfiguration request.

Specified by:
setReconfigurationErrorRecoveryAction in interface Reconfigurable
Parameters:
r - particular recovery action

getReconfigurationErrorRecoveryAction

public RecoveryAction getReconfigurationErrorRecoveryAction()
Getter method for recovery action associated to failed reconfiguration request.

Specified by:
getReconfigurationErrorRecoveryAction in interface Reconfigurable
Returns:
RecoveryAction

acquireFunctionalData

public void acquireFunctionalData()
Initiates the transaction(s) for the acquisition of functional data from the unit.

Specified by:
acquireFunctionalData in interface UnitFunctional

sendFunctionalData

public void sendFunctionalData()
Initiates the transaction(s) to send the functional data to the unit.

Specified by:
sendFunctionalData in interface UnitFunctional

isAcquireTransactionFinished

public boolean isAcquireTransactionFinished()
The method returns the completion status of the acquisition.

Specified by:
isAcquireTransactionFinished in interface UnitFunctional
Returns:
true value if the acquire transaction has been finished

isSendTransactionFinished

public boolean isSendTransactionFinished()
The method returns the completion status of the send transaction.

Specified by:
isSendTransactionFinished in interface UnitFunctional
Returns:
true value if the send transaction has been finished

refreshFunctionalIn

public void refreshFunctionalIn()
Functional data are acquired at raw data level and placed in a hardware buffer internal to the unit. A call to this method causes them to be converted to customized data level and transferred to the data pool location.

Specified by:
refreshFunctionalIn in interface UnitFunctional

refreshFunctionalOut

public void refreshFunctionalOut()
Sent functional data to the external unit are taken from hardware buffer internal to the unit. A call to this method causes the content of the hardware buffer to be updated with the latest data from the source buffers in the data pool.

Specified by:
refreshFunctionalOut in interface UnitFunctional

synchronizeFunctional

public void synchronizeFunctional()
Initiates a synchronization operation for the functional data.

Specified by:
synchronizeFunctional in interface UnitFunctional

isSynchronizeFunctionalFinished

public boolean isSynchronizeFunctionalFinished()
Checks whether the underlying transaction has been completed.

Specified by:
isSynchronizeFunctionalFinished in interface UnitFunctional
Returns:
true value if the transaction has been completed

setFunctionalInLink

public void setFunctionalInLink(DataSink destLink)
Sets the functional input data link for the data converted from raw data level to customized data level.

Specified by:
setFunctionalInLink in interface UnitFunctional

setFunctionalInLink

public void setFunctionalInLink(DataSink destLink,
                                int i,
                                int j)
Sets the functional input data link for the data converted from raw data level to customized data level. Links the j-th output of the Unit to the i-th input of a DataSink.

Specified by:
setFunctionalInLink in interface UnitFunctional

setFunctionalOutLink

public void setFunctionalOutLink(DataSource sourceLink)
Sets the functional output data link for the data at customized data level.

Specified by:
setFunctionalOutLink in interface UnitFunctional

setFunctionalOutLink

public void setFunctionalOutLink(DataSource sourceLink,
                                 int i,
                                 int j)
Sets the functional output data link for the data at customized data level. Links the j-th input of the Unit to the i-th output of a DataSource.

Specified by:
setFunctionalOutLink in interface UnitFunctional

setFunctionalInConverter

public void setFunctionalInConverter(AbstractControlChannel c)
Data conversion from raw data level to customized data level, and any other processing on the raw data (eg. bias correction), is done by a control channel object. This method allows the converter control channel to be loaded. The control channel will in general be a multi-input-multi-output control channel. The correct number of inputs and outputs is checked when the control channel is loaded, the number of inputs and outputs has to be equal. An incorrect number of inputs and/or outputs represents a configuration error.

Specified by:
setFunctionalInConverter in interface UnitFunctional
Parameters:
c - particular control channel object

setFunctionalOutConverter

public void setFunctionalOutConverter(AbstractControlChannel c)
Data conversion from customized data level (in the source buffers) to raw data level (in the hardware buffer) is done by a control channel object. This method allows the converter control channel for outgoing data to be loaded. The control channel will in general be a multi-input-multi-output control channel. The correct number of inputs and outputs is checked when the control channel is loaded, the number of inputs and outputs has to be equal. An incorrect number of inputs and/or outputs represents a configuration error.

Specified by:
setFunctionalOutConverter in interface UnitFunctional
Parameters:
c - particular control channel object

setInput

public void setInput(double newValue,
                     int i)
Set the i-th input.

Specified by:
setInput in interface DataSink

getNumberOfInputs

public int getNumberOfInputs()
Return the number of inputs of the data sink object.

Specified by:
getNumberOfInputs in interface DataSink

getOutput

public double getOutput(int i)
Return the value of the i-th output.

Specified by:
getOutput in interface DataSource

getNumberOfOutputs

public int getNumberOfOutputs()
Return the number of outputs of the data source object.

Specified by:
getNumberOfOutputs in interface DataSource

getAocsObject

public AocsObject getAocsObject()
Return the reconfiguration manager as an instance of type AocsObject. If the reconfiguration manager is not derived from class AocsObject, then null is returned.

Specified by:
getAocsObject in interface Reconfigurable

restoreConfiguration

public void restoreConfiguration(ConfigurationState s)
Restore the internal configuration of the reconfiguration manager to the value stored in s. The configuration of a reconfiguration manager may contain information that should survive system resets and other traumatic events. This is typically the case of the health status of the configurations they manage. For this reasons, reconfiguration managers expose operations to save/restore their configuration. A configuration is stored in an object of class ConfigurationState. A call to restoreConfiguration directs the reconfiguration manager to restore its own internal configuration to the value stored in the parameter s. The way in which configuration information is stored in the ConfigurationState object is an implementation issue for the reconfiguration manager (memento pattern).

In the framework, configuration state objects are stored in the System Manager.

Specified by:
restoreConfiguration in interface Reconfigurable
See Also:
ConfigurationState, SystemManager

saveConfiguration

public void saveConfiguration(ConfigurationState s)
Save the internal configuration of the reconfiguration manager in the parameter s. The configuration of a reconfiguration manager may contain information that should survive system resets and other traumatic events. This is typically the case of the health status of the configurations they manage. For this reasons, reconfiguration managers expose operations to save/restore their configuration. A configuration is stored in an object of class ConfigurationState. A call to saveConfiguration directs the reconfiguration manager to save its own internal configuration to the value stored in the parameter s. The way in which configuration information is stored in the ConfigurationState object is an implementation issue for the reconfiguration manager (memento pattern).

In the framework, configuration state objects are stored in the System Manager.

Specified by:
saveConfiguration in interface Reconfigurable
See Also:
ConfigurationState, SystemManager

addReconfigurationListener

public void addReconfigurationListener(ReconfigurationListener l)
Register a listener to reconfiguration events

Specified by:
addReconfigurationListener in interface Reconfigurable

removeReconfigurationListener

public void removeReconfigurationListener(ReconfigurationListener l)
Unregister a listener to reconfiguration events

Specified by:
removeReconfigurationListener in interface Reconfigurable

getTelemetryImageLength

public int getTelemetryImageLength()
Return the length in bits of the telemetry image that would be written by the object in response to a call to method writeToTelemetry.

Specified by:
getTelemetryImageLength in interface Telemeterable
Overrides:
getTelemetryImageLength in class AocsObject
Returns:
the length in bits of the telemetry image

writeToTelemetry

public void writeToTelemetry(TelemetryStream stream)
Causes the object to write its own state to the telemetry stream.

Specified by:
writeToTelemetry in interface Telemeterable
Overrides:
writeToTelemetry in class AocsObject
Parameters:
stream - the telemetry stream

Real-Time Java AOCS Framework v1.0 API Specification

Real-Time Java AOCS Framework project home page

Automatic Control Laboratory, ETH Zuerich
Physikstrasse 3
CH-8092 Zuerich, Switzerland