-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from jkittley/dev
Documentation refactoring and better Purge tools
- Loading branch information
Showing
32 changed files
with
745 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
|
||
old/ | ||
*.pyc | ||
server/config/secure.py | ||
server/data/tinydb/*.json | ||
server/data/*.db | ||
backups/ | ||
docs/build/ | ||
docs/make.bat | ||
docs/Makefile | ||
*.afdesign | ||
*.afdesign | ||
server/test/.pytest_cache/ | ||
server/.pytest_cache/ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,179 @@ | ||
.. include:: global.rst | ||
|
||
Add/Edit Dashboards | ||
=================== | ||
Coming soon | ||
Dashboards | ||
========== | ||
Dashboards are just a collections of plots and can be defined in a Dashboard JSON files. These files can be found in the ```data/dashboards``` directory. |project| automatically scans this folder and adds new dashboards to the menu. Below we dicuss how dashboard files are constructed. | ||
|
||
At the top level dashboards have 3 sections: A *header*, a *footer* and an array of *plots*. The header and footer can either be "null" as per the footer in the example below, or it can be an object with a title and text attribute, see header in example. | ||
|
||
.. code:: | ||
{ | ||
"header": { | ||
"title": "Some title", | ||
"text": "Some descriptive text" | ||
}, | ||
"footer": null, | ||
"plots": [ "-- See below --" ] | ||
} | ||
.. warning:: JSON does not like trailing commas (unlike Python) and is very strict! Curious Concept have a nice `validation tool <https://jsonformatter.curiousconcept.com/>`_ which will happlily point out all your mistakes. | ||
|
||
Plots | ||
----- | ||
Each item in the plots array must be an object like the one in the example below. | ||
|
||
.. code:: | ||
"plots": [ | ||
{ | ||
"id": 1, | ||
"pos": 1, | ||
"title": "Plot 1", | ||
"width": 6, | ||
"help": "Some help text for the viewer", | ||
"metrics": [ '-- See below --' ], | ||
"time": {}, | ||
"type": "timeseries", | ||
"refresh_interval_seconds": 5 | ||
}, | ||
... | ||
] | ||
:id: Must be unique. | ||
:pos: Used to order the plots. Starts in the top left. | ||
:title: The plot title | ||
:width: The plot width. A vaulue from 1 to 12 | ||
:help: Help text for the user | ||
:metrics: See below | ||
:time: See below | ||
:type: The type of plot. Must be one of the following: "timeseries", more soon. | ||
:refresh_interval_seconds: Number of seconds between each refresh of the plot. Can be set to null to disable automatic refresh. | ||
|
||
Time | ||
---- | ||
The time attribute must be an object and be structured as follows: | ||
|
||
.. code:: | ||
"time": { | ||
"start": null, | ||
"end": null, | ||
"reading_interval_seconds": 10, | ||
"period": { | ||
"days": 0, | ||
"hours": 0, | ||
"minutes": 5 | ||
}, | ||
"fill": "none" | ||
} | ||
:start: The start of the time period to be displayed. If null the default will be the end minus the period. | ||
:end: The end of the time period to be displayed. If null then the current time is used and will auto update to the current time each refresh. | ||
:reading_interval_seconds: Group readings into intervals of this many seconds. | ||
:period: A period of time messured in days, hours and minutes. If start and end are set this is ignored. | ||
:fill: If "none" then reading_intervals which contain no readings will be skipped. If "null" then reading_intervals with no readings return a null value. | ||
|
||
Metrics | ||
------- | ||
Metrics represent the data to be displayed and how to present it. | ||
|
||
.. code:: | ||
"metrics": [ | ||
{ | ||
"name": "Device 1: Signal (dB)", | ||
"field_id": "float_signal_db", | ||
"device_id": "test_device_1", | ||
"aggrfunc": "mean" | ||
}, | ||
... | ||
] | ||
:name: A friendly name for the user to read | ||
:field_id: The id of the field to be displayed | ||
:device_id: The device from which the field should be obtained | ||
:aggrfunc: The method of aggregating readings when grouped by intervals. The values should be set to one of the following depending on the data type of the field. | ||
|
||
- Numeric: 'count', 'mean', 'mode', 'median', 'sum', 'max', 'min', 'first' or 'last'. | ||
- Booleans: 'count', 'first' or 'last' and | ||
- Strings: 'count', 'first' or 'last'. | ||
|
||
Full example | ||
------------ | ||
|
||
.. code-block:: json | ||
{ | ||
"header": null, | ||
"footer": null, | ||
"plots": [ | ||
{ | ||
"id": 1, | ||
"pos": 1, | ||
"title": "Plot 1", | ||
"width": 6, | ||
"help": "Some help text for the viewer", | ||
"metrics": [{ | ||
"name": "Device 1: Signal (dB)", | ||
"field_id": "float_signal_db", | ||
"device_id": "test_device_1", | ||
"aggrfunc": "mean" | ||
},{ | ||
"name": "Device 1: Max Light Level (Lux)", | ||
"field_id": "int_light_level_lux", | ||
"device_id": "test_device_1", | ||
"aggrfunc": "max" | ||
},{ | ||
"name": "Device 2: Switch State (OnOff)", | ||
"field_id": "bool_switch_state", | ||
"device_id": "test_device_2", | ||
"aggrfunc": "count" | ||
}], | ||
"time": { | ||
"start": null, | ||
"end": null, | ||
"reading_interval_seconds": 10, | ||
"period": { | ||
"days": 0, | ||
"hours": 0, | ||
"minutes": 5 | ||
}, | ||
"fill": "none" | ||
}, | ||
"type": "timeseries", | ||
"refresh_interval_seconds": 5 | ||
}, | ||
{ | ||
"id": 2, | ||
"pos": 2, | ||
"title": "Plot 2", | ||
"width": 6, | ||
"help": "Some help text for the viewer", | ||
"metrics": [{ | ||
"name": "Device 2: Temp (C)", | ||
"field_id": "float_temp_c", | ||
"device_id": "test_device_2", | ||
"agrfunc": "mean" | ||
},{ | ||
"name": "Device 2: Switch State (OnOff)", | ||
"field_id": "bool_switch_state", | ||
"device_id": "test_device_2", | ||
"aggrfunc": "count" | ||
}], | ||
"time": { | ||
"start": null, | ||
"end": null, | ||
"reading_interval_seconds": 5, | ||
"period": { | ||
"days": 0, | ||
"hours": 0, | ||
"minutes": 5 | ||
}, | ||
"fill": "none" | ||
}, | ||
"type": "timeseries", | ||
"refresh_interval_seconds": 5 | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.. include:: global.rst | ||
|
||
Change the look and feel | ||
======================== | ||
Making |project| your own couldn't be easier. There are a few things you need to know before you get started. | ||
|
||
1. ```static/img/``` holds all the images. | ||
2. ```templates/``` is where all the HTML, CSS and Javascript lives. The CSS and Javascript needed by each is either included in the template itself or in its parent. For experienced programmers this may appear as we have gone mad, but we chose to structure things this was so it is really obvious to novices what effects what. | ||
3. ```templates/base.html``` is extended by all other templates. For more information about how to manipulate the templates see http://flask.pocoo.org/docs/templating/. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.. include:: global.rst | ||
|
||
Getting Data | ||
============ | ||
Now you have a |project| Raspberry Pi server up and running we need to start collecting some data. You can begin by generating some test data (see receiving data for more details). | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
receive | ||
device | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.. include:: global.rst | ||
|
||
Getting Started | ||
=============== | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
server_install | ||
server_extra | ||
|
||
Video Overview | ||
^^^^^^^^^^^^^^ | ||
|
||
This is a 10 minute video which walks you through the setup process from installing NOOBs on your Pi to having the server ready to collect data. | ||
|
||
.. raw:: html | ||
|
||
<iframe width="690" height="380" src="https://www.youtube.com/embed/gAPfL7tdLxY" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> | ||
<br> | ||
<br> | ||
|
||
|
||
|
Oops, something went wrong.