pyP2Monitor  1.0.0
Monitor a P2 furnace activity reading data on serial port
 All Data Structures Namespaces Functions Variables Groups Pages
Public Member Functions | Static Public Member Functions | Data Fields
P2Query Class Reference

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.

Detailed Description

Class used to store a range of data in tuples like (time, value)

This class is used by pyP2DataReader to store query result.

Definition at line 49 of file p2data.py.

Constructor & Destructor Documentation

def __init__ (   self,
  dateFormat,
  colNum,
  firstTs,
  beg = None,
  end = None,
  time = None 
)

Instanciate a new P2Query object.

Parameters
dateFormatThe format used to convert beg and end
colNumThe data's column number handled by this object
begA timestamp representing the lower handled date and time
endA timestamp representing the biggest handled date and time
timeUsed if one of param beg or end is set to None. Represent length of the time range.

Definition at line 58 of file p2data.py.

Member Function Documentation

def fromInterval (   interval)
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

Parameters
intervalA string representing a time interval
Returns
The number of seconds represented by this interval

Definition at line 122 of file p2data.py.

def getVal (   self,
  timestamp 
)

Return a value given a timestamp.

Parameters
timestampThe wanted timestamp
Returns
An integer value or False if there is no data's associated with this 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

Parameters
contentAn array storing arrays of the form [timestamp,val]
Returns
True

Definition at line 148 of file p2data.py.

References P2Query.colNum, and P2Query.datas.

Field Documentation

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().


The documentation for this class was generated from the following file: