Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Commit

Permalink
[teleop] fix generate report (#1135)
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronTressler authored Jun 1, 2022
1 parent 263edbd commit dd4a10d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 28 deletions.
32 changes: 12 additions & 20 deletions base_station/gui/src/components/Chlorophyll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@
</tr>
<tr>
<td class = "tableElement">Spec 1</td>
<td class = "tableElement">{{ spectral_1_conversion(spectral_data.d1_1).toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_1_conversion(spectral_data.d1_2).toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_1_conversion(spectral_data.d1_3).toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_1_conversion(spectral_data.d1_4).toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_1_conversion(spectral_data.d1_5).toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_1_conversion(spectral_data.d1_6).toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_data.d1_1.toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_data.d1_2.toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_data.d1_3.toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_data.d1_4.toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_data.d1_5.toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_data.d1_6.toFixed(0) }}</td>
</tr>
<tr>
<td class = "tableElement">Spec 2</td>
<td class = "tableElement">{{ spectral_2_conversion(spectral_data.d2_1).toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_2_conversion(spectral_data.d2_2).toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_2_conversion(spectral_data.d2_3).toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_2_conversion(spectral_data.d2_4).toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_2_conversion(spectral_data.d2_5).toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_2_conversion(spectral_data.d2_6).toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_data.d2_1.toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_data.d2_2.toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_data.d2_3.toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_data.d2_4.toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_data.d2_5.toFixed(0) }}</td>
<td class = "tableElement">{{ spectral_data.d2_6.toFixed(0) }}</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -114,14 +114,6 @@ export default {
'device': id,
'enable': enabled
})
},
spectral_1_conversion: function(sensor_reading) {
return (1 / 0.94) * (sensor_reading - 23.28)
},
spectral_2_conversion: function(sensor_reading) {
return (1 / 0.9969) * (sensor_reading + 32.8575)
}
},
components: {
Expand Down
12 changes: 6 additions & 6 deletions base_station/gui/src/components/GenerateReport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export default {
const timeString = time.toTimeString().substring(0,17) +" "+time.toDateString()
this.csvFileData = [
[timeString, spectral_data.d0_1, spectral_data.d1_1, spectral_data.d2_1],
[timeString, spectral_data.d0_2, spectral_data.d1_2, spectral_data.d2_2],
[timeString, spectral_data.d0_3, spectral_data.d1_3, spectral_data.d2_3],
[timeString, spectral_data.d0_4, spectral_data.d1_4, spectral_data.d2_4],
[timeString, spectral_data.d0_5, spectral_data.d1_5, spectral_data.d2_5],
[timeString, spectral_data.d0_6, spectral_data.d1_6, spectral_data.d2_6]
[timeString, spectral_data.d0_1.toFixed(0), spectral_data.d1_1.toFixed(0), spectral_data.d2_1.toFixed(0)],
[timeString, spectral_data.d0_2.toFixed(0), spectral_data.d1_2.toFixed(0), spectral_data.d2_2.toFixed(0)],
[timeString, spectral_data.d0_3.toFixed(0), spectral_data.d1_3.toFixed(0), spectral_data.d2_3.toFixed(0)],
[timeString, spectral_data.d0_4.toFixed(0), spectral_data.d1_4.toFixed(0), spectral_data.d2_4.toFixed(0)],
[timeString, spectral_data.d0_5.toFixed(0), spectral_data.d1_5.toFixed(0), spectral_data.d2_5.toFixed(0)],
[timeString, spectral_data.d0_6.toFixed(0), spectral_data.d1_6.toFixed(0), spectral_data.d2_6.toFixed(0)]
];
//define the heading for each row of the data
Expand Down
32 changes: 30 additions & 2 deletions base_station/gui/src/components/ISHTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ export default {
console.error("Callback Function is invalid (should take 1 parameter)")
}
this.lcm_.subscribe(channel, callbackFn)
},
spectral_1_conversion: function(sensor_reading) {
return (1 / 0.94) * (sensor_reading - 23.28)
},
spectral_2_conversion: function(sensor_reading) {
return (1 / 0.9969) * (sensor_reading + 32.8575)
}
},
Expand All @@ -122,8 +130,28 @@ export default {
// Subscribed LCM message received
(msg) => {
if (msg.topic ==='/spectral_data'){
this.spectral_data = msg.message
} else if (msg.topic ==='/thermistor_data'){
this.spectral_data.d0_1 = msg.message.d0_1
this.spectral_data.d0_2 = msg.message.d0_2
this.spectral_data.d0_3 = msg.message.d0_3
this.spectral_data.d0_4 = msg.message.d0_4
this.spectral_data.d0_5 = msg.message.d0_5
this.spectral_data.d0_6 = msg.message.d0_6
this.spectral_data.d1_1 = this.spectral_1_conversion(msg.message.d1_1)
this.spectral_data.d1_2 = this.spectral_1_conversion(msg.message.d1_2)
this.spectral_data.d1_3 = this.spectral_1_conversion(msg.message.d1_3)
this.spectral_data.d1_4 = this.spectral_1_conversion(msg.message.d1_4)
this.spectral_data.d1_5 = this.spectral_1_conversion(msg.message.d1_5)
this.spectral_data.d1_6 = this.spectral_1_conversion(msg.message.d1_6)
this.spectral_data.d2_1 = this.spectral_2_conversion(msg.message.d2_1)
this.spectral_data.d2_2 = this.spectral_2_conversion(msg.message.d2_2)
this.spectral_data.d2_3 = this.spectral_2_conversion(msg.message.d2_3)
this.spectral_data.d2_4 = this.spectral_2_conversion(msg.message.d2_4)
this.spectral_data.d2_5 = this.spectral_2_conversion(msg.message.d2_5)
this.spectral_data.d2_6 = this.spectral_2_conversion(msg.message.d2_6)
}
else if (msg.topic ==='/thermistor_data'){
this.thermistor_data = msg.message
}
},
Expand Down

0 comments on commit dd4a10d

Please sign in to comment.