|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.EventObject
util.rmi.RmiEvent
stella.DataEvent
stella.sensor.RawDataEvent
public class RawDataEvent
The generic data event for sensors that produce raw data. The measurement
of
the data event is set to the raw value, no other side information is
available.
Sensors produce single numbers as a measurement, therefore the measurement
is of Double type. Note that as a 'dirty trick' we leave the original
measurement of the DataEvent untouched and use it as an escape pod
to stuff bad/good weather information into it.
| Field Summary | |
|---|---|
private Double |
raw
The raw measurement. |
private ConvertToPhysical |
rawconvert
An instance to convert raw readings into physically meaningful values. |
private NumberFormat |
rawformat
A formatter for the raw measurements. |
private NumberFormat |
sigformat
A formatter for the raw deviation. |
private Double |
sigma
The sigma of the individual measurement. |
| Fields inherited from class stella.DataEvent |
|---|
FORMAT |
| Fields inherited from class util.rmi.RmiEvent |
|---|
localHost, sourceName |
| Fields inherited from class java.util.EventObject |
|---|
source |
| Constructor Summary | |
|---|---|
RawDataEvent(DataEvent source)
Constructs the raw data event from a single data event. |
|
RawDataEvent(Object src)
Constructs a raw data event specifiying only the source. |
|
| Method Summary | |
|---|---|
protected String |
formatPhysical(Double meas)
Formats a physical reading according to the rawconvert rule. |
protected String |
formatRaw(Double meas)
Formats a raw reading according to the rawformat rule. |
protected String |
getDateString()
Returns the date of the measurement and, if set, the measurement value converted to clear/bad, depending on its Boolean value. |
String |
getFormattedPhysical()
Returns the physical quantity formatted to its converter's format. |
String |
getFormattedPhysicalDeviation()
Returns the physical quantity formatted to its converter's format. |
String |
getFormattedRaw()
Returns the raw reading as a string, formatted according to the raw formatter. |
String |
getFormattedRawDeviation()
Returns the raw reading sigma as a string, formatted according to the raw formatter. |
double |
getPhysical()
Returns the measurement as a physical meaningful quantity. |
double |
getPhysicalDeviation()
Returns the error of the measurement in physical quantities. |
double |
getRaw()
Returns the measurement as a primitive double. |
ConvertToPhysical |
getRawConvert()
Retrieves the conversion class to transform raw measurements into physically meaningful quantities. |
double |
getRawDeviation()
Returns the error of the measurement. |
NumberFormat |
getRawFormat()
gets the raw-data formatter. |
protected String |
getRawString()
Returns the raw measures, if possible with the error and both in their representation as physical quantities. |
NumberFormat |
getSigmaFormat()
gets the raw-data formatter. |
void |
setRaw(double rw)
Sets the measurement of this data event as a primitive double. |
void |
setRawConvert(ConvertToPhysical conv)
Sets the conversion class to transform raw measurements into physically meaningful quantities. |
void |
setRawDeviation(double sig)
Sets the error of the measurement. |
void |
setRawFormat(NumberFormat forraw)
Sets the raw-data formatter. |
void |
setSigmaFormat(NumberFormat forraw)
Sets the raw-data formatter. |
String |
toString()
Returns a string representation of this raw data event. |
| Methods inherited from class stella.DataEvent |
|---|
getMeasurement, getTimeOfMeasure, isValid, setMeasurement, setTimeOfMeasure, setValid |
| Methods inherited from class util.rmi.RmiEvent |
|---|
getHost, getSourceName, setSourceName |
| Methods inherited from class java.util.EventObject |
|---|
getSource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Double raw
private Double sigma
private ConvertToPhysical rawconvert
private NumberFormat rawformat
private NumberFormat sigformat
| Constructor Detail |
|---|
public RawDataEvent(Object src)
public RawDataEvent(DataEvent source)
rawconvert and the decimal formatters
rawformat and sigformat are only pointer-copied and
not cloned.
| Method Detail |
|---|
public void setRawFormat(NumberFormat forraw)
public NumberFormat getRawFormat()
public void setSigmaFormat(NumberFormat forraw)
public NumberFormat getSigmaFormat()
public void setRawConvert(ConvertToPhysical conv)
public ConvertToPhysical getRawConvert()
public void setRaw(double rw)
public double getRaw()
public String getFormattedRaw()
public double getPhysical()
rawconvert conversion object has been set. If conversion
fails for some reason, nan is returned.
public String getFormattedPhysical()
public void setRawDeviation(double sig)
public double getRawDeviation()
public String getFormattedRawDeviation()
public double getPhysicalDeviation()
rawconvert conversion object has been set. If conversion
fails for some reason, nan is returned.
public String getFormattedPhysicalDeviation()
public String toString()
toString in class DataEventprotected String getDateString()
protected String getRawString()
protected String formatRaw(Double meas)
rawformat rule. If
the measurement is NaN or null, nan is included in the string.
formatPhysical(java.lang.Double)protected String formatPhysical(Double meas)
rawconvert rule. If
the measurement is NaN or null, the empty string is returned.
meas - The raw measurement value.formatRaw(java.lang.Double)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||