pyP2Monitor
1.0.0
Monitor a P2 furnace activity reading data on serial port
|
Used to get datas from queries. More...
Public Member Functions | |
def | __init__ |
Instanciate a new P2Datas object. | |
def | populate |
Trigger the queries filling with data from the database. | |
def | getPlotData |
Write GnuPlot's datas temporary file. | |
def | getPlotCommand |
Return the GnuPlot's plot command with the good arguments. | |
def | getDateTimeFormats |
Return the time format to use giving the queries. |
Static Public Member Functions | |
def | queryToDict |
Return a dict of "option"=>"value" from a query string. | |
def | fillQuery |
Fill a query with datas. |
Data Fields | |
db | |
The Sqlite database object. | |
queries | |
The query list. | |
maxDiff | |
The larger range between a begin and a end in seconds. | |
sameRange | |
Set to True if every handled query have the same date range. | |
qArgs | |
Store query's arguments. | |
tmpfile | |
Store the GnuPlot's data temporary file name. |
Static Public Attributes | |
dictionary | argsShort = {'b' : 'begin', 'e' : 'end', 't' : 'time', 'f' : 'format', 'd':'data', 'n':'num', 'y':'yaxe', 's':'style', 'c':'color', 'l':'label', 'sc':'scale', 'a':'add' } |
Alias for one letter query parameter to string parameter. | |
list | argsToNone = ['begin','end','time'] |
List of argument that have to be set to None after the P2Query creation. |
Used to get datas from queries.
This object handle multiple query's and make request to the Sqlite database.
def __init__ | ( | self, | |
dbFile, | |||
queries, | |||
queryArgSep | |||
) |
|
static |
Fill a query with datas.
datas | An array of data |
queries | An array of query to fill |
Definition at line 264 of file p2data.py.
References p2data.data2List(), and P2Msg.hex2list().
def getDateTimeFormats | ( | self | ) |
Return the time format to use giving the queries.
Find a good dateTimeFormat for GnuPlot's date display giving the date range of each query
Definition at line 453 of file p2data.py.
References P2Datas.maxDiff, and P2Datas.sameRange.
def getPlotCommand | ( | self | ) |
Return the GnuPlot's plot command with the good arguments.
Definition at line 388 of file p2data.py.
References p2data.colNames(), P2Datas.getPlotData(), P2Datas.qArgs, P2Datas.queries, and P2Datas.tmpfile.
def getPlotData | ( | self, | |
csv = False , |
|||
outfd = None , |
|||
sep = None |
|||
) |
Write GnuPlot's datas temporary file.
Use handled query to create and populate GnuPlot's temporary files.
Definition at line 313 of file p2data.py.
References P2Datas.maxDiff, P2Datas.qArgs, P2Datas.queries, P2Datas.sameRange, and P2Datas.tmpfile.
Referenced by P2Datas.getPlotCommand().
def populate | ( | self | ) |
Trigger the queries filling with data from the database.
When called this function tells to the P2Datas object to get datas from the database and to fill its handled P2Query object.
Definition at line 282 of file p2data.py.
References P2Datas.queries, and P2Datas.sameRange.
|
static |