public class WattsUp
extends org.lsst.ccs.drivers.ascii.Ascii
| Modifier and Type | Class and Description |
|---|---|
static interface |
WattsUp.Listener
Defines an event listener.
|
org.lsst.ccs.drivers.ascii.Ascii.DataBits, org.lsst.ccs.drivers.ascii.Ascii.FlowCtrl, org.lsst.ccs.drivers.ascii.Ascii.Option, org.lsst.ccs.drivers.ascii.Ascii.Parity, org.lsst.ccs.drivers.ascii.Ascii.StopBits, org.lsst.ccs.drivers.ascii.Ascii.Terminator| Modifier and Type | Field and Description |
|---|---|
static int |
FLD_AMPS
Data field - amps
|
static int |
FLD_AMPS_MAX
Data field - maximum amps during interval
|
static int |
FLD_AMPS_MIN
Data field - minimum amps during interval
|
static int |
FLD_COST
Data field - cost over collection period
|
static int |
FLD_COST_MONTH
Data field - cost per month
|
static int |
FLD_DUTY_CYCLE
Data field - duty cycle (fraction of time over power threshold)
|
static int |
FLD_FREQUENCY
Data field - line frequency
|
static int |
FLD_POWER_CYCLE
Data field - power cycle (number of times power was cycled)
|
static int |
FLD_POWER_FACTOR
Data field - power factor (watts / volt-amps)
|
static int |
FLD_VOLT_AMPS
Data field - volt-amps (product of volts and amps)
|
static int |
FLD_VOLTS
Data field - volts
|
static int |
FLD_VOLTS_MAX
Data field - maximum volts during interval
|
static int |
FLD_VOLTS_MIN
Data field - minimum volts during interval
|
static int |
FLD_WATT_HOURS
Data field - watt-hours over collection period
|
static int |
FLD_WATTS
Data field - watts
|
static int |
FLD_WATTS_MAX
Data field - maximum watts during interval
|
static int |
FLD_WATTS_MIN
Data field - minimum watts during interval
|
static int |
FLD_WH_MONTH
Data field - watt-hours per month
|
static int |
LOG_STA_EXTERNAL
Logging status - external
|
static int |
LOG_STA_INTERNAL
Logging status - active internal
|
static int |
LOG_STA_SUSPENDED
Logging status - suspended (memory full)
|
static int |
MEM_OPT_CONDENSE
Memory-full option - condense (sparsify) the data
|
static int |
MEM_OPT_OVERWRITE
Memory-full option - overwrite oldest data
|
static int |
MEM_OPT_SUSPEND
Memory-full option - suspend logging
|
static int |
N_CAL_FIELDS
Number of calibration fields
|
static int |
N_FIELDS
Number of data fields
|
static int |
N_VER_FIELDS
Number of version fields
|
static int |
VER_FLD_CHECKSUM
Version field - checksum
|
static int |
VER_FLD_FWMAJOR
Version field - major firmware version
|
static int |
VER_FLD_FWMINOR
Version field - minor firmware version
|
static int |
VER_FLD_FWTSTAMP
Version field - firmware time stamp (YYYYMMDDHHMM)
|
static int |
VER_FLD_HW_MINOR
Version field - minor hardware version
|
static int |
VER_FLD_HWMAJOR
Version field - major hardware version
|
static int |
VER_FLD_MEMORY
Version field - memory size
|
static int |
VER_FLD_MODEL
Version field - model
|
| Constructor and Description |
|---|
WattsUp()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(WattsUp.Listener listener)
Adds an event listener.
|
void |
close()
Initiates closing the connection to the meter.
|
void |
closeAscii()
Really closes the connection to the meter.
|
int[] |
getCalibrationData()
Gets the calibration data.
|
int |
getFullOption()
Gets the memory-full handling option.
|
String[] |
getHeaderRecord()
Gets the header record.
|
int |
getLoggedData()
Gets all the logged data.
|
int |
getLoggedFields()
Gets the bit mask of fields being logged.
|
int |
getLoggingInterval()
Gets the logging interval.
|
int |
getLoggingState()
Gets the logging state.
|
int |
getRecordLimit()
Gets the record count limit.
|
boolean |
getUserEuro()
Gets the user-set euro flag.
|
double |
getUserRate()
Gets the user-set electricity rate.
|
int |
getUserThreshold()
Gets the user-set duty cycle threshold.
|
String[] |
getVersionData()
Gets the version information.
|
void |
open(org.lsst.ccs.drivers.commons.DriverConstants.ConnType connType,
String ident,
int baud,
int dataChar)
Opens a connection to the meter.
|
void |
removeListener()
Removes the event listener.
|
void |
resetMemory()
Resets (clears) data memory.
|
void |
restart()
Restarts the meter.
|
void |
setExternalLogging(int interval)
Sets external logging.
|
void |
setFullOption(int option)
Sets the memory-full handling option.
|
int |
setInternalLogging(int interval)
Sets internal logging.
|
int |
setLoggedFields(int mask)
Sets the fields to be logged.
|
void |
setLoggingInterval(int interval)
Sets the logging interval.
|
void |
setUserParameters(double rate,
int threshold,
boolean euro)
Sets the user parameters.
|
closeSilent, flush, getConnTimeout, getTimeout, isOpen, makeDataCharacteristics, open, open, openFtdi, openFtdi, openFtdi, openNet, openNet, openSerial, openSerial, openSerial, read, read, readBytes, readBytes, setCommandTerm, setConnTimeout, setConnTimeout, setDefaultParm, setMultidrop, setOptions, setResponseTerm, setTerminator, setTimeout, setTimeout, write, writeBytes, writeBytespublic static final int FLD_WATTS
public static final int FLD_VOLTS
public static final int FLD_AMPS
public static final int FLD_WATT_HOURS
public static final int FLD_COST
public static final int FLD_WH_MONTH
public static final int FLD_COST_MONTH
public static final int FLD_WATTS_MAX
public static final int FLD_VOLTS_MAX
public static final int FLD_AMPS_MAX
public static final int FLD_WATTS_MIN
public static final int FLD_VOLTS_MIN
public static final int FLD_AMPS_MIN
public static final int FLD_POWER_FACTOR
public static final int FLD_DUTY_CYCLE
public static final int FLD_POWER_CYCLE
public static final int FLD_FREQUENCY
public static final int FLD_VOLT_AMPS
public static final int N_FIELDS
public static final int N_CAL_FIELDS
public static final int MEM_OPT_SUSPEND
public static final int MEM_OPT_OVERWRITE
public static final int MEM_OPT_CONDENSE
public static final int LOG_STA_SUSPENDED
public static final int LOG_STA_INTERNAL
public static final int LOG_STA_EXTERNAL
public static final int VER_FLD_MODEL
public static final int VER_FLD_MEMORY
public static final int VER_FLD_HWMAJOR
public static final int VER_FLD_HW_MINOR
public static final int VER_FLD_FWMAJOR
public static final int VER_FLD_FWMINOR
public static final int VER_FLD_FWTSTAMP
public static final int VER_FLD_CHECKSUM
public static final int N_VER_FIELDS
public void open(org.lsst.ccs.drivers.commons.DriverConstants.ConnType connType,
String ident,
int baud,
int dataChar)
throws org.lsst.ccs.drivers.commons.DriverException
open in class org.lsst.ccs.drivers.ascii.AsciiconnType - The connection type (FTDI or SERIAL)ident - The identification (USB S/N or port)baud - The baud ratedataChar - The data characteristics - always set to 0org.lsst.ccs.drivers.commons.DriverExceptionpublic void close()
throws org.lsst.ccs.drivers.commons.DriverException
close in class org.lsst.ccs.drivers.ascii.Asciiorg.lsst.ccs.drivers.commons.DriverExceptionpublic void closeAscii()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void addListener(WattsUp.Listener listener)
listener - The event listener object, containing the
processData, setPowered and
setClosed methods.public void removeListener()
public int getLoggedFields()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic int setLoggedFields(int mask)
throws org.lsst.ccs.drivers.commons.DriverException
mask - A bit mask where each set bit represents a field to be logged.org.lsst.ccs.drivers.commons.DriverExceptionpublic int[] getCalibrationData()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic String[] getHeaderRecord() throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic int getLoggedData()
throws org.lsst.ccs.drivers.commons.DriverException
processData method, one record
at a time. This may take many seconds, depending on the amount of
logged data.org.lsst.ccs.drivers.commons.DriverExceptionpublic int setInternalLogging(int interval)
throws org.lsst.ccs.drivers.commons.DriverException
getLoggedData.interval - The logging interval to set. This is ignored if
the memory-full option is set to 2 (sparsify).org.lsst.ccs.drivers.commons.DriverExceptionpublic void setExternalLogging(int interval)
throws org.lsst.ccs.drivers.commons.DriverException
process
method of the data listener object.interval - The logging interval to set.org.lsst.ccs.drivers.commons.DriverExceptionpublic int getRecordLimit()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic int getFullOption()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setFullOption(int option)
throws org.lsst.ccs.drivers.commons.DriverException
option - The memory-full option to set, encoded as follows:
0 = pause; 1 = wrap; 2 = sparsify by deleting every
other record and doubling the logging interval.org.lsst.ccs.drivers.commons.DriverExceptionpublic void resetMemory()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic int getLoggingInterval()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic int getLoggingState()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setLoggingInterval(int interval)
throws org.lsst.ccs.drivers.commons.DriverException
interval - The logging interval to set. This is ignored for
internal logging with the memory-full option set to
2 (sparsify).org.lsst.ccs.drivers.commons.DriverExceptionpublic double getUserRate()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic int getUserThreshold()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic boolean getUserEuro()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setUserParameters(double rate,
int threshold,
boolean euro)
throws org.lsst.ccs.drivers.commons.DriverException
rate - The electricity rate in currency units (dollars or euros) per KWH.threshold - The power threshold (watts) used for calculating the duty cycle.euro - The euro flag, true if the currency is euros and false if dollars.
This is used to display the correct currency symbol on the meter.org.lsst.ccs.drivers.commons.DriverExceptionpublic String[] getVersionData() throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void restart()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionCopyright © 2020 LSST. All rights reserved.