-
Notifications
You must be signed in to change notification settings - Fork 22
graph_presets
THIS IS OBSOLETE INFORMATION NOW THE GRAPH PRESET SYSTEM IS UPDATED IN THE NEW GUI, DISREGARD AND USE THE NEWER BETTER SYSTEM. https://github.com/Pragmatismo/Pigrow/wiki/graphs
The Graph Presets (soon to be renamed log presets) allow you to save the data extraction settings which are used when loading information from sensor or system logs allowing you to set how the log is read, what time range to show, and how it's labelled.
Graph presets can be used to streamline the process of creating graphs in the gui but are also used in the creation of Datawalls which can create graphs directly on the Raspberry Pi to upload to the internet or show on local displays.
Currently located in ~/Pigrow/scripts/gui/graph_presets/ the files are named as they appear in the GUI's graph tab dropdown box for data source presets, they can be created by manually selecting a log file ('select log file' button), setting the required options in the data extraction settings (test your settings by pressing 'Add' to load the data then making a graph as normal) once happy press 'Save' in the data extraction area and select a name for your preset.
The gui only shows presets which the currently connected Pigrow has the required log file (on the original gui this must already be downloaded into the local files folder)
The preset files are simple key=value text files which contain the data extraction settings
log_path=<log file name>
log_path=selflog.txt
The name of the log file as found in the ~/Pigrow/logs folder or the local frompigrow/>/logs folder.
split_chr=>
the character used to split the fields in a log entry, e.g. 'temp=20**>**humid=60'
date_pos=10
date_split==
date_split_pos=1
The position of the date field, it's split character and the side of the split to get the date information. For most pigrow logs the date will be in position 0, use an '=' as the split character and have the information on the right side of that character in position 1 (left side is 0).
There are two ways of selecting which value to use from the log, the locational way;
value_pos=8
value_split==
value_split_pos=1
value_rem='C
Same as the date field with the added option to remove a character string for logs that include units which cause problems when converting to numbers.
Also the value position can be set to match_text in which case the value_split_pos points to the side of the value to find the key, normally 0 which is the left side. key_pos becomes the name of the field;
value_pos=match_text
value_split==
value_split_pos=0
value_rem='C
key_pos=cpu_temp
The key field is not very important in most uses (it will likely be mostly removed soon). it's split chr and split pos are not used when value_pos=match_text, when used positionally it's similar to the other two;
key_pos=8
key_split==
key_split_pos=0
key_match=cpu_temp
the key_match field allows an extra check and filters out any keys that do not match the field, this is generally only useful for parsing more complex logs like the error and switch logs under normal use if you want to ensure you're only using cpu_temp then us the value_pos method as that'll still find it if it's not in the expected place in that line for whatever reason.
key_manual=CPU Temperature
allows you to manually label the data, this is the text that will appear in graph ledgers if using more than one log to create a graph.
limit_date=hour/day/week/month/year
when the graph is made it will read the current date and show only information in the requested date range. (the updated version will include an option to set a value for this, e.g. 3 hour)
limit_date=first_log
used when loading more than one log to conform this log to the prior loaded.
limit_date=custom
start_time=%Y-%m-%d %H:%M:%S
end_time=%Y-%m-%d %H:%M:%S
set a fixed date range, can be useful when creating graphs to show everything from a set date such as the start of a new grow or grow stage.