diff --git a/tabs/sensors.css b/tabs/sensors.css index ecf5081b..d0f5ba75 100644 --- a/tabs/sensors.css +++ b/tabs/sensors.css @@ -3,7 +3,7 @@ .tab-sensors .plot_control { float: right; - width: 168px; + width: 158px; border: 1px solid silver; } @@ -31,6 +31,15 @@ margin-left: 20px; height: 22px; } + .tab-sensors .plot_control .x { + color: #00A8F0; + } + .tab-sensors .plot_control .y { + color: #C0D800; + } + .tab-sensors .plot_control .z { + color: #CB4B4B; + } .tab-sensors select { width: 70px; border: 1px solid silver; @@ -39,7 +48,7 @@ .tab-sensors svg { float: right; - width: 730px; + width: 740px; height: 140px; margin-bottom: 10px; diff --git a/tabs/sensors.html b/tabs/sensors.html index d0124d30..74ab06d2 100644 --- a/tabs/sensors.html +++ b/tabs/sensors.html @@ -1,6 +1,6 @@
-
Gyroscope
+
Gyroscope - deg/s
Refresh:
@@ -24,9 +24,9 @@
-
X:
blue
-
Y:
green
-
Z:
red
+
X:
0
+
Y:
0
+
Z:
0
@@ -38,7 +38,7 @@
-
Accelerometer
+
Accelerometer - g
Refresh:
@@ -61,9 +61,9 @@
-
X:
blue
-
Y:
green
-
Z:
red
+
X:
0
+
Y:
0
+
Z:
0
@@ -75,7 +75,7 @@
-
Magnetometer
+
Magnetometer - Ga
Refresh:
@@ -98,9 +98,9 @@
-
X:
blue
-
Y:
green
-
Z:
red
+
X:
0
+
Y:
0
+
Z:
0
@@ -112,7 +112,7 @@
-
Barometer
+
Barometer - meters
Refresh:
@@ -121,14 +121,14 @@ - - + +
-
X:
blue
+
X:
0
@@ -149,14 +149,14 @@ - + - + -
X:
blue
+
X:
0
@@ -170,7 +170,7 @@
Debug 2
-
X:
blue
+
X:
blue
@@ -184,7 +184,7 @@
Debug 3
-
X:
blue
+
X:
0
@@ -198,7 +198,7 @@
Debug 4
-
X:
blue
+
X:
0
diff --git a/tabs/sensors.js b/tabs/sensors.js index ce7e73f9..d94f4d62 100644 --- a/tabs/sensors.js +++ b/tabs/sensors.js @@ -150,6 +150,22 @@ function tab_initialize_sensors() { initGraphHelpers('#debug4', samples_debug_i) ]; + var raw_data_text_ements = { + x: [], + y: [], + z: [], + }; + $('.plot_control .x, .plot_control .y, .plot_control .z').each(function() { + var e = $(this); + if (e.hasClass('x')) { + raw_data_text_ements.x.push(e); + } else if (e.hasClass('y')) { + raw_data_text_ements.y.push(e); + } else { + raw_data_text_ements.z.push(e); + } + }); + // set refresh speeds according to configuration saved in storage chrome.storage.local.get('sensor_refresh_rates', function(result) { if (typeof result.sensor_refresh_rates != 'undefined') { @@ -212,23 +228,34 @@ function tab_initialize_sensors() { function update_imu_graphs() { samples_gyro_i = addSampleToData(gyro_data, samples_gyro_i, SENSOR_DATA.gyroscope); drawGraph(gyroHelpers, gyro_data, samples_gyro_i); + raw_data_text_ements.x[0].text(SENSOR_DATA.gyroscope[0].toFixed(2)); + raw_data_text_ements.y[0].text(SENSOR_DATA.gyroscope[1].toFixed(2)); + raw_data_text_ements.z[0].text(SENSOR_DATA.gyroscope[2].toFixed(2)); samples_accel_i = addSampleToData(accel_data, samples_accel_i, SENSOR_DATA.accelerometer); drawGraph(accelHelpers, accel_data, samples_accel_i); + raw_data_text_ements.x[1].text(SENSOR_DATA.accelerometer[0].toFixed(2)); + raw_data_text_ements.y[1].text(SENSOR_DATA.accelerometer[1].toFixed(2)); + raw_data_text_ements.z[1].text(SENSOR_DATA.accelerometer[2].toFixed(2)); samples_mag_i = addSampleToData(mag_data, samples_mag_i, SENSOR_DATA.magnetometer); drawGraph(magHelpers, mag_data, samples_mag_i); + raw_data_text_ements.x[2].text(SENSOR_DATA.magnetometer[0].toFixed(2)); + raw_data_text_ements.y[2].text(SENSOR_DATA.magnetometer[1].toFixed(2)); + raw_data_text_ements.z[2].text(SENSOR_DATA.magnetometer[2].toFixed(2)); } function update_altitude_graph() { samples_baro_i = addSampleToData(baro_data, samples_baro_i, [SENSOR_DATA.altitude]); drawGraph(baroHelpers, baro_data, samples_baro_i); + raw_data_text_ements.x[3].text(SENSOR_DATA.altitude.toFixed(2)); } function update_debug_graphs() { for (var i = 0; i < 4; i++) { addSampleToData(debug_data[i], samples_debug_i, [SENSOR_DATA.debug[i]]); drawGraph(debugHelpers[i], debug_data[i], samples_debug_i); + raw_data_text_ements.x[4 + i].text(SENSOR_DATA.debug[i]); } samples_debug_i++; }