org.lsst.ccs.drivers.wattsup
Class TestWattsUp

java.lang.Object
  extended by org.lsst.ccs.drivers.wattsup.TestWattsUp
All Implemented Interfaces:
WattsUp.Listener, org.lsst.ccs.utilities.sa.CmndProcess.Dispatch

public class TestWattsUp
extends Object
implements org.lsst.ccs.utilities.sa.CmndProcess.Dispatch, WattsUp.Listener

Program to test a WattsUp power meter

Author:
Owen Saxton

Constructor Summary
TestWattsUp()
           
 
Method Summary
 boolean dispatch(int code, int found, Object[] args)
          Dispatches command for processing
static void main(String[] args)
          Main program
 void processData(float[] data)
          Processes logged data
 void run()
          Runs the test
 void setClosed()
          Handles error-induced port closure
 void setPowered(boolean on)
          Handles powered state change
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestWattsUp

public TestWattsUp()
Method Detail

main

public static void main(String[] args)
Main program


run

public void run()
Runs the test

Loops reading and processing each new typed command line.


dispatch

public boolean dispatch(int code,
                        int found,
                        Object[] args)
Dispatches command for processing

Specified by:
dispatch in interface org.lsst.ccs.utilities.sa.CmndProcess.Dispatch

setPowered

public void setPowered(boolean on)
Handles powered state change

Specified by:
setPowered in interface WattsUp.Listener
Parameters:
on - Whether the power is on

setClosed

public void setClosed()
Handles error-induced port closure

Specified by:
setClosed in interface WattsUp.Listener

processData

public void processData(float[] data)
Description copied from interface: WattsUp.Listener
Processes logged data

Specified by:
processData in interface WattsUp.Listener
Parameters:
data - An 18-element float array containing the data.


Copyright © 2013 LSST. All Rights Reserved.