Difference between revisions of "READERNAME ReaderModuleOffPowerState.java"

From RifidiWiki

Jump to: navigation, search
m
 
Line 1: Line 1:
 +
[[category:developerDoc]][[category:emulatorDoc]]
 
This class needs to be implemented for each reader to handle the state transitions from off->on.  It should extend AbstractOffPowerState.
 
This class needs to be implemented for each reader to handle the state transitions from off->on.  It should extend AbstractOffPowerState.
  

Latest revision as of 00:36, 12 February 2008

This class needs to be implemented for each reader to handle the state transitions from off->on. It should extend AbstractOffPowerState.

turnOn

This method should turn the reader and all of its components on

public void turnOn(PowerControllable pcObject)

Arguments

  1. pcObject - The ReaderModule

Reference Implementation

This is the implementation of the turnOn() in the symbol reader. It first turns on the communication, then turns on the controllers. Next it sets the power signals for the communication to true, but makes sure the connection signal is set to false. Finally it puts the reader into the 'on' state using the changePowerState method. This method just changes a variable in the module that records which state of the reader.

	public void turnOn(PowerControllable pcObject) {
		SymbolReaderModule rm = (SymbolReaderModule) pcObject;
		rm.getByteComm().turnOn();
		rm.getHttpComm().turnOn();
		rm.getInteractiveBitController().turnOn();
		rm.getInteractiveHttpController().turnOn();
		rm.getSharedResources().getInteractiveBytePowerSignal().setControlVariableValue(true);
		rm.getSharedResources().getInteractiveHttpPowerSignal().setControlVariableValue(true);
		rm.getSharedResources().getInteractiveByteConnectionSignal().setControlVariableValue(false);
		rm.getSharedResources().getInteractiveHttpConnectionSignal().setControlVariableValue(false);

		/* Turn on Tag Buffer*/
		
		SymbolReaderSharedResources ssr = rm.getSharedResources();
		
		rm.changePowerState(SymbolReaderModuleOnPowerState.getInstance());
		
		String readername = rm.getSharedResources().getReaderName();
		LogFactory.getLog("console." + readername).info(readername + " on");
	}
Personal tools