pyP2Monitor  1.0.0
Monitor a P2 furnace activity reading data on serial port
 All Data Structures Namespaces Functions Variables Groups Pages
Data Structures | Functions | Variables
p2data Namespace Reference

Store functions and object handling P2's data processing. More...

Data Structures

class  P2Query
 Class used to store a range of data in tuples like (time, value) More...
class  P2Datas
 Used to get datas from queries. More...

Functions

def data2List
 Take data and return a well formated integer array.
def colNames
 Return an array with data column's name.
def datas2Json
 Return a json string from datas (OBSOLETE)
def csvDump
 Dump the database in csv format.
def csvLastDataDump
 Print the last data on stdout formated in csv.
def csvOutputData
 Output data in csv format.

Variables

tuple logger = utils.getLogger()
 Use to log.

Detailed Description

Store functions and object handling P2's data processing.

Stores functions used to format raw data from the furnace

Function Documentation

def p2data.colNames ( )

Return an array with data column's name.

Return an array with P2 furnace data's column's name.

See Also
data2List

Definition at line 514 of file p2data.py.

Referenced by csvDump(), csvLastDataDump(), datas2Json(), and P2Datas.getPlotCommand().

def p2data.csvDump (   dbname,
  filename = '-',
  header = True,
  sep = "; " 
)

Dump the database in csv format.

Parameters
filenameThe filename to write csv in. If - output to stdout
headersIf true put a header with colnames
Returns
a string representing the db dump in csv format

Definition at line 566 of file p2data.py.

References colNames(), and csvOutputData().

def p2data.csvLastDataDump (   lfname,
  sep = ";" 
)

Print the last data on stdout formated in csv.

Parameters
lfnameThe name of the file storing the latest data
sepThe csv field separator

Definition at line 595 of file p2data.py.

References colNames(), and csvOutputData().

def p2data.csvOutputData (   fdout,
  timestamp,
  data,
  sep 
)

Output data in csv format.

Parameters
fdoutThe file where we will write the data
dataThe datas
sepThe csv separator

Definition at line 619 of file p2data.py.

References data2List(), and P2Msg.hex2list().

Referenced by csvDump(), and csvLastDataDump().

def p2data.data2List (   timestamp,
  data,
  dateFormat = "%Y/%m/%d_%H:%M:%S" 
)

Take data and return a well formated integer array.

Take a string representing a huge hexadecimal number (the data field of a data frame from the furnace) and format it as an integer array applying number correction on some fields

Parameters
timestampThe timestamp to associate with this datas
dataThe datas
dateFormatThe date's display format
Returns
An integer array (except for the first item wich is a date as a string)

Definition at line 478 of file p2data.py.

Referenced by csvOutputData(), datas2Json(), and P2Datas.fillQuery().

Variable Documentation

tuple logger = utils.getLogger()

Use to log.

See Also
utils.getLogger()

Definition at line 43 of file p2data.py.