Skip to content
Snippets Groups Projects
Commit ed895625 authored by Wortman, Elliot (UG - Comp Sci & Elec Eng)'s avatar Wortman, Elliot (UG - Comp Sci & Elec Eng)
Browse files

Use real acceptable ranges for value indicators

parent b406cb5b
No related branches found
No related tags found
No related merge requests found
...@@ -20,14 +20,14 @@ def values(): ...@@ -20,14 +20,14 @@ def values():
@app.route("/past-values") @app.route("/past-values")
def pastValues(): def pastValues():
past_values = {"npkData": { past_values = {"npkData": {
"nitrogen": [120, 118, 119, 121, 120, 122, 120], "nitrogen": [40, 60, 55, 80, 48, 18, 43],
"phosphorus": [110, 112, 111, 113, 110, 112, 111], "phosphorus": [36, 20, 8, 42, 87, 77, 111],
"potassium": [115, 116, 117, 115, 114, 116, 117] "potassium": [90, 100, 160, 183, 200, 120, 99]
}, },
"thmData": { "thmData": {
"temperature": [18, 19, 20, 18, 17, 18, 19], "temperature": [18, 19, 20, 24, 28, 15, 19],
"humidity": [50, 52, 53, 50, 49, 51, 52], "humidity": [50, 52, 53, 50, 46, 51, 54],
"moisture": [40, 42, 45, 43, 41, 40, 44] "moisture": [55, 50, 44, 52, 57, 55, 49]
}} }}
return jsonify(past_values) return jsonify(past_values)
......
...@@ -6,9 +6,11 @@ export default { ...@@ -6,9 +6,11 @@ export default {
data() { data() {
return { return {
values: { 0: { N: 0 }, 1: { P: 0 }, 2: { K: 0 }, 3: { T: 0 }, 4: { H: 0 }, 5: { M: 0 } }, values: { 0: { N: 0 }, 1: { P: 0 }, 2: { K: 0 }, 3: { T: 0 }, 4: { H: 0 }, 5: { M: 0 } },
rangeNPK: [80, 100, 150, 170], rangeN: [20, 50, 70, 350],
rangeT: [12, 15, 22, 25], rangeP: [9, 14, 150, 200],
rangeHM: [30, 40, 60, 70], rangeK: [100, 180, 600, 800],
rangeT: [6, 10, 12, 27],
rangeHM: [15, 50, 70, 85],
} }
}, },
mounted() { mounted() {
...@@ -45,25 +47,25 @@ export default { ...@@ -45,25 +47,25 @@ export default {
<div class="valueBox"> <div class="valueBox">
Nitrogen (N):&nbsp; Nitrogen (N):&nbsp;
<li class="list-group-item" <li class="list-group-item"
v-bind:class="getClass(values[0].N, this.rangeNPK[0], this.rangeNPK[1], this.rangeNPK[2], this.rangeNPK[3])" v-bind:class="getClass(values[0].N, this.rangeN[0], this.rangeN[1], this.rangeN[2], this.rangeN[3])"
data-bs-toggle="tooltip" data-bs-toggle="tooltip"
:data-bs-title="'Ideal conditions: ' + this.rangeNPK[1] + '-' + this.rangeNPK[2] + ' ppm'">{{ :data-bs-title="'Ideal conditions: ' + this.rangeN[1] + '-' + this.rangeN[2] + ' ppm'">{{
values[0].N }} ppm</li> values[0].N }} ppm</li>
</div> </div>
<div class="valueBox"> <div class="valueBox">
Phosphorus (P):&nbsp; Phosphorus (P):&nbsp;
<li class="list-group-item" <li class="list-group-item"
v-bind:class="getClass(values[1].P, this.rangeNPK[0], this.rangeNPK[1], this.rangeNPK[2], this.rangeNPK[3])" v-bind:class="getClass(values[1].P, this.rangeP[0], this.rangeP[1], this.rangeP[2], this.rangeP[3])"
data-bs-toggle="tooltip" data-bs-toggle="tooltip"
:data-bs-title="'Ideal conditions: ' + this.rangeNPK[1] + '-' + this.rangeNPK[2] + ' ppm'">{{ :data-bs-title="'Ideal conditions: ' + this.rangeP[1] + '-' + this.rangeP[2] + ' ppm'">{{
values[1].P }} ppm</li> values[1].P }} ppm</li>
</div> </div>
<div class="valueBox"> <div class="valueBox">
Potassium (K):&nbsp; Potassium (K):&nbsp;
<li class="list-group-item" <li class="list-group-item"
v-bind:class="getClass(values[2].K, this.rangeNPK[0], this.rangeNPK[1], this.rangeNPK[2], this.rangeNPK[3])" v-bind:class="getClass(values[2].K, this.rangeK[0], this.rangeK[1], this.rangeK[2], this.rangeK[3])"
data-bs-toggle="tooltip" data-bs-toggle="tooltip"
:data-bs-title="'Ideal conditions: ' + this.rangeNPK[1] + '-' + this.rangeNPK[2] + ' ppm'">{{ :data-bs-title="'Ideal conditions: ' + this.rangeK[1] + '-' + this.rangeK[2] + ' ppm'">{{
values[2].K }} ppm</li> values[2].K }} ppm</li>
</div> </div>
<div class="valueBox"> <div class="valueBox">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment