READERNAME ReaderModuleOffPowerState.java

From RifidiWiki

Revision as of 00:36, 12 February 2008 by Kyle (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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