pyP2Monitor
1.0.0
Monitor a P2 furnace activity reading data on serial port
|
Class used to store a range of data in tuples like (time, value) More...
Public Member Functions | |
def | __init__ |
Instanciate a new P2Query object. | |
def | setContent |
Set the data's content of the query object Set the content with an array of the form [[timestamp0,val0],[timestamp1,val1], ... | |
def | getVal |
Return a value given a timestamp. | |
def | getBeg |
Return the first timestamp ( P2Query::beg ) | |
def | getEnd |
Return the last timestamp ( P2Query::end ) | |
def | getKeys |
Static Public Member Functions | |
def | fromInterval |
Return a number of seconds from an interval. |
Data Fields | |
beg | |
The higher date and time of the date range. | |
end | |
The smaller date and time of the date range. | |
datas | |
A dict storing query's data. | |
colNum | |
Store the column number. |
Class used to store a range of data in tuples like (time, value)
This class is used by pyP2DataReader to store query result.
def __init__ | ( | self, | |
dateFormat, | |||
colNum, | |||
firstTs, | |||
beg = None , |
|||
end = None , |
|||
time = None |
|||
) |
Instanciate a new P2Query object.
dateFormat | The format used to convert beg and end |
colNum | The data's column number handled by this object |
beg | A timestamp representing the lower handled date and time |
end | A timestamp representing the biggest handled date and time |
time | Used if one of param beg or end is set to None. Represent length of the time range. |
|
static |
Return a number of seconds from an interval.
Return a number of seconds from a interval composed by a signed integer and a suffix. Allowed suffixes are 's' for seconds, 'm' for minutes, 'h' for hours and 'd' for days
interval | A string representing a time interval |
def getVal | ( | self, | |
timestamp | |||
) |
Return a value given a timestamp.
timestamp | The wanted timestamp |
Definition at line 159 of file p2data.py.
References P2Query.datas.
def setContent | ( | self, | |
content | |||
) |
Set the data's content of the query object Set the content with an array of the form [[timestamp0,val0],[timestamp1,val1], ...
] with val the array of value associated with a data
content | An array storing arrays of the form [timestamp,val] |
Definition at line 148 of file p2data.py.
References P2Query.colNum, and P2Query.datas.
beg |
The higher date and time of the date range.
Stored as a timestamp.
Definition at line 61 of file p2data.py.
Referenced by P2Query.getBeg().
datas |
A dict storing query's data.
Keys are timestamp, and value are data
Definition at line 65 of file p2data.py.
Referenced by P2Msg.calcChecksum(), P2Msg.dispInitMsg(), P2Msg.dump(), P2Msg.getData(), P2Msg.getStr(), P2Query.getVal(), P2Msg.prepare(), P2Query.setContent(), P2Msg.setData(), and P2Msg.setDataSz().
end |
The smaller date and time of the date range.
Stored as a timestamp.
Definition at line 63 of file p2data.py.
Referenced by P2Query.getEnd().