|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectBasicDrinkMachine
LittleDrinkMachine
Implements the DrinkMachineSpec interface (by way of BasicDrinkMachine extension) for Little Drink (uses a parallel port hardware interface).
| Nested Class Summary | |
private class |
LittleDrinkMachine.ButtonLoop
A class to independantly handle the callbacks for the buttons. |
| Field Summary | |
private ConfigMgr |
configMgr
The class that handles configuration manipulation. |
private Vector |
drinkButtonListeners
The Vector of objects that want Button events. |
private DrinkLoggerSpec |
log
The class we send our log messages to. |
private PPort |
pport
Our interface to the hardware's parrallel port. |
| Fields inherited from class BasicDrinkMachine |
numSlots, slotArray, slotDataFileName, slotMgr |
| Constructor Summary | |
LittleDrinkMachine(ConfigMgr _configMgr,
DrinkLoggerSpec _log)
Construct the LittleDrinkMachine by saving the passed in parameters, reading in the config file, and reading in a few variables. |
|
| Method Summary | |
void |
addDrinkButtonListener(DrinkButtonListener dbl)
Add a listener to the list of objects requesting callbacks from the buttons |
void |
delDrinkButtonListener(DrinkButtonListener dbl)
Remove a listener from the list of objects requesting callbacks from the buttons |
String |
drop(int slot)
Drops a drink. |
Float |
getTempKey(String key)
Returns a Float object representing the temperature of the sensor specified by the key. |
void |
lightOff(int slot)
Turns the given slots empty indicator off. |
void |
lightOn(int slot)
Turns the given slots empty indicator on. |
void |
shutdown(boolean reboot)
Shuts down the drink server, but not the host machine. |
Vector |
slotTemp(int slot)
Returns a Vector of Float's, one for each temp sensor associated with the given slot. |
float |
slotTempAvg(int slot)
Returns the average temperature of the temp sensors listed for the given slot. |
long |
uptime()
Returns the uptime, in milliseconds. |
| Methods inherited from class BasicDrinkMachine |
drinksDropped, drinksLeft, formatSlotLine, getDrinkNames, getName, getNumSlots, getPrice, getSlot, getSlotArray, getSlotPrintout, isEnabled, setSlot |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private DrinkLoggerSpec log
private Vector drinkButtonListeners
private PPort pport
private ConfigMgr configMgr
| Constructor Detail |
public LittleDrinkMachine(ConfigMgr _configMgr,
DrinkLoggerSpec _log)
throws IOException
_configMgr - The ConfigMgr to use for config options._log - The DrinkLoggerSpec to use for printing log messages.| Method Detail |
public void shutdown(boolean reboot)
shutdown in interface DrinkMachineSpecshutdown in class BasicDrinkMachinereboot - If true, reboot the host machine.public long uptime()
uptime in interface DrinkMachineSpecuptime in class BasicDrinkMachinepublic String drop(int slot)
drop in interface DrinkMachineSpecdrop in class BasicDrinkMachineslot - The index of the slot to drop.
public void lightOn(int slot)
lightOn in interface DrinkMachineSpeclightOn in class BasicDrinkMachineslot - The slot index associated with the light to turn on.(int)public void lightOff(int slot)
lightOff in interface DrinkMachineSpeclightOff in class BasicDrinkMachineslot - The slot associated with the light to turn off.BasicDrinkMachine.lightOn(int)public Float getTempKey(String key)
getTempKey in interface DrinkMachineSpecgetTempKey in class BasicDrinkMachinekey - The sensors mnemonic key.
public Vector slotTemp(int slot)
slotTemp in interface DrinkMachineSpecslotTemp in class BasicDrinkMachineslot - The slot to retrieve the temp's of the sensors for.
public float slotTempAvg(int slot)
slotTempAvg in interface DrinkMachineSpecslotTempAvg in class BasicDrinkMachineslot - The slot to retrieve the average temperature for.
public void addDrinkButtonListener(DrinkButtonListener dbl)
addDrinkButtonListener in interface DrinkMachineSpecaddDrinkButtonListener in class BasicDrinkMachinedbl - The DrinkButtonListener to add to the list.delDrinkButtonListener( DrinkButtonListener )public void delDrinkButtonListener(DrinkButtonListener dbl)
delDrinkButtonListener in interface DrinkMachineSpecdelDrinkButtonListener in class BasicDrinkMachinedbl - The DrinkButtonListener to remove.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||