org.lsst.ccs.subsystems.fcs
Class CompactIOModule

java.lang.Object
  extended by java.util.Observable
      extended by org.lsst.ccs.framework.Module
          extended by org.lsst.ccs.subsystems.fcs.CompactIOModule
All Implemented Interfaces:
Serializable, Observer, Sensor
Direct Known Subclasses:
CanOpenDIO, SimuCompactIOModule

public abstract class CompactIOModule
extends org.lsst.ccs.framework.Module
implements Sensor

This represents a device we use in FCS to connect our numeric sensors(CAN-CBX-DIO8). It has 8 channels. Each channel can be configured to be inputs or output channel. So we can plug up to 8 sensors on one CampactIOModule. We read all the inputs channels in the same commands. This class should be extended for the real hardware and for the simulated hardware.

Author:
virieux
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.lsst.ccs.framework.Module
org.lsst.ccs.framework.Module.ValueUpdate
 
Field Summary
 String hexaValue
           
 
Fields inherited from class org.lsst.ccs.framework.Module
configMethods, log, name, nObserverThreads, registry, tickMillis
 
Constructor Summary
CompactIOModule()
           
 
Method Summary
static String BinaryToHex(String bin)
           
 String getHexaValue()
           
 int getValue()
           
static String HexToBinary(String Hex)
          The String argument represents an integer in hexa.
 void initModule()
           
abstract  String readNewHexaValue()
           
 void updateValue()
          This method reads the current value, controls if this current value is correct depending on the type of the sensor (this value could be between a minimum and a maximum) and if the value is correct, updates the Sensor.value field.
 
Methods inherited from class org.lsst.ccs.framework.Module
change, checkHardware, dropConfigurationContext, getCheckedValueFromConfiguration, getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, newConfigurationContext, notifyChange, notifyChangeWithoutPreliminaryChecks, processUpdate, publishData, publishData, publishData, publishData, register, register, sendToReply, sendToStatus, setBeanName, setContext, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownCommand, shutdownNow, start, startTicking, tick, update
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.lsst.ccs.subsystems.fcs.common.Sensor
readNewValue
 

Field Detail

hexaValue

public String hexaValue
Constructor Detail

CompactIOModule

public CompactIOModule()
Method Detail

initModule

public void initModule()
Overrides:
initModule in class org.lsst.ccs.framework.Module

readNewHexaValue

public abstract String readNewHexaValue()
Returns:
a String which is the value in hexa sent by the device.

getHexaValue

public String getHexaValue()
Returns:
the hexa value converted in decimal.

getValue

public int getValue()
Specified by:
getValue in interface Sensor
Returns:
the hexa value converted in decimal.

updateValue

public void updateValue()
Description copied from interface: Sensor
This method reads the current value, controls if this current value is correct depending on the type of the sensor (this value could be between a minimum and a maximum) and if the value is correct, updates the Sensor.value field.

Specified by:
updateValue in interface Sensor

HexToBinary

public static String HexToBinary(String Hex)
The String argument represents an integer in hexa. This methods eturns a string representation of this integer argument as an unsigned integer in base 2.

Parameters:
Hex -
Returns:
the binary form of this integer examples : HexToBinary(4) returns 100 HexToBinary(AA) returns 10101010 HexToBinary(FF) returns 11111111

BinaryToHex

public static String BinaryToHex(String bin)
Parameters:
bin -
Returns:


Copyright © 2012 LSST. All Rights Reserved.