Added feature to create custom plots

This commit is contained in:
Hendrik Borras 2017-10-20 16:34:02 +02:00
parent 34c611fab6
commit 110236313c
3 changed files with 29 additions and 9 deletions

View file

@ -11,9 +11,9 @@ More instructions will follow when the software has reached the state of the V2
## Needed features to match up with the Version 2 mock-up software
* Read data from the detector into the SQLite database [DONE]
* Display basic information in the Web-UI [In development]
* Start application on boot [Not yet started]
* Start hotspot on boot [Not yet started]
* Display basic information in the Web-UI [DONE]
* Start application on boot [In development]
* Start hotspot on boot [In development]
* Connect to a different WiFi via the webinterface [Not yet started]
* Working install procedure [Not yet started]
* SystemD services for all components [Not yet started]
@ -21,7 +21,9 @@ More instructions will follow when the software has reached the state of the V2
* WebUI
* Hotspot
* Database maintainance
* Interface for getting the raw data and database dumps [Not yet started]
* Interface to create custom plots [DONE]
* Include about page [Not yet started]
## Installation
Clone this repository to the home folder of your CosmicPi (e.g. `/home/pi`)

View file

@ -14,7 +14,28 @@
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<div ref="location" style="width: 300px; height: 300px">{{"decoupled-map"|googlemap_html(location_vars['Latitude'], location_vars['Longitude']) }}</div>
{{"decoupled-map"|googlemap_html(location_vars['Latitude'], location_vars['Longitude']) }}
</div>
</div>
</div>
<br>
<div class="col-lg-6">
<div class="panel panel-default">
<div class="panel-heading">
Plot settings
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<form action="/histogram.png" target="_blank">
Start time of the plot in UTCUnixSeconds (negative seconds will mean "seconds before last measurement"):<br>
<input type="text" name="start_time" value="-120"><br>
End time of the plot in UTCUnixSeconds(the plot will not extend further than the available data):<br>
<input type="text" name="end_time" value="9000000000"><br>
The bin size for the histogram (note too many bins will slow down the histogram creation):<br>
<input type="text" name="bin_size_seconds" value="2"><br><br>
<input type="submit" value="Create plot">
</form>
</div>
</div>
</div>

View file

@ -86,11 +86,8 @@ def dashboard():
# fill in values
if f_name in icon_dict.keys():
values_to_display.append({'name':f_name, 'value':latest_datapoint[i], 'icon':icon_dict[f_name]})
# fill in location
if f_name in location_vars.keys():
location_vars[f_name] = latest_datapoint[i]
return render_template('dashboard.html', values_to_display=values_to_display, location_vars=location_vars)
return render_template('dashboard.html', values_to_display=values_to_display)
@app.route('/plotting/', methods=['GET', 'POST'])