-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da32946
commit f04c05e
Showing
10 changed files
with
322 additions
and
9 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
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 @@ | ||
use std::{cell::RefCell, rc::Rc}; | ||
|
||
use crate::gui::plot::{PlotState, SharedPlotState}; | ||
|
||
use super::color_constants::*; | ||
|
||
pub fn accelerometer_plot(shared_plot: &Rc<RefCell<SharedPlotState>>) -> PlotState { | ||
let accelerometer_plot = PlotState::new("Accelerometers", (Some(-10.0), Some(10.0)), shared_plot.clone()) | ||
.line("Accel 2 (X) [m/s²]", R1, |vs| vs.accelerometer2.map(|a| a.x)) | ||
.line("Accel 2 (Y) [m/s²]", G1, |vs| vs.accelerometer2.map(|a| a.y)) | ||
.line("Accel 2 (Z) [m/s²]", B1, |vs| vs.accelerometer2.map(|a| a.z)) | ||
.line("Accel 1 (X) [m/s²]", R, |vs| vs.accelerometer1.map(|a| a.x)) | ||
.line("Accel 1 (Y) [m/s²]", G, |vs| vs.accelerometer1.map(|a| a.y)) | ||
.line("Accel 1 (Z) [m/s²]", B, |vs| vs.accelerometer1.map(|a| a.z)); | ||
accelerometer_plot | ||
} |
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,14 @@ | ||
use std::{cell::RefCell, rc::Rc}; | ||
|
||
use crate::gui::plot::{PlotState, SharedPlotState}; | ||
|
||
use super::color_constants::*; | ||
|
||
pub fn altitude_plot(shared_plot: &Rc<RefCell<SharedPlotState>>) -> PlotState { | ||
let altitude_plot = PlotState::new("Altitude (ASL)", (None, None), shared_plot.clone()) | ||
.line("Altitude (Ground) [m]", BR, |vs| vs.altitude_ground_asl) | ||
.line("Altitude (Baro) [m]", B1, |vs| vs.altitude_baro) | ||
.line("Altitude [m]", B, |vs| vs.altitude_asl) | ||
.line("Altitude (GPS) [m]", G, |vs| vs.altitude_gps_asl); | ||
altitude_plot | ||
} |
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 @@ | ||
use std::{cell::RefCell, rc::Rc}; | ||
|
||
use crate::gui::plot::{PlotState, SharedPlotState}; | ||
|
||
use super::color_constants::*; | ||
|
||
pub fn barometer_plot(shared_plot: &Rc<RefCell<SharedPlotState>>) -> PlotState { | ||
let barometer_plot = | ||
PlotState::new("Pressures", (None, None), shared_plot.clone()) | ||
.line("Barometer [bar]", C, |vs| vs.pressure_baro.map(|p| p / 1000.0)); | ||
barometer_plot | ||
} |
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,13 @@ | ||
use egui::Color32; | ||
|
||
pub const R: Color32 = Color32::from_rgb(0xfb, 0x49, 0x34); | ||
pub const G: Color32 = Color32::from_rgb(0xb8, 0xbb, 0x26); | ||
pub const B: Color32 = Color32::from_rgb(0x83, 0xa5, 0x98); | ||
pub const R1: Color32 = Color32::from_rgb(0xcc, 0x24, 0x1d); | ||
pub const G1: Color32 = Color32::from_rgb(0x98, 0x97, 0x1a); | ||
pub const B1: Color32 = Color32::from_rgb(0x45, 0x85, 0x88); | ||
pub const O: Color32 = Color32::from_rgb(0xfa, 0xbd, 0x2f); | ||
pub const O1: Color32 = Color32::from_rgb(0xd6, 0x5d, 0x0e); | ||
pub const BR: Color32 = Color32::from_rgb(0x61, 0x48, 0x1c); | ||
// pub const P: Color32 = Color32::from_rgb(0xb1, 0x62, 0x86); | ||
pub const C: Color32 = Color32::from_rgb(0x68, 0x9d, 0x6a); |
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 @@ | ||
pub mod accelerometer_plot; | ||
pub mod altitude_plot; | ||
pub mod barometer_plot; | ||
pub mod color_constants; | ||
pub mod orientation_plot; | ||
pub mod vertical_speed_plot; | ||
|
||
pub use accelerometer_plot::*; | ||
pub use altitude_plot::*; | ||
pub use barometer_plot::*; | ||
pub use orientation_plot::*; | ||
pub use vertical_speed_plot::*; |
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,18 @@ | ||
use std::{cell::RefCell, rc::Rc}; | ||
|
||
use crate::gui::plot::{PlotState, SharedPlotState}; | ||
|
||
use super::color_constants::*; | ||
|
||
pub fn orientation_plot(shared_plot: &Rc<RefCell<SharedPlotState>>) -> PlotState { | ||
let orientation_plot = PlotState::new("Orientation", (Some(-180.0), Some(540.0)), shared_plot.clone()) | ||
.line("Roll (Z) [°]", B, |vs| vs.euler_angles.map(|a| a.z)) | ||
.line("Pitch (X) [°]", R, |vs| vs.euler_angles.map(|a| a.x)) | ||
.line("Yaw (Y) [°]", G, |vs| vs.euler_angles.map(|a| a.y)) | ||
.line("Angle of Attack [°]", O, |vs| vs.angle_of_attack) | ||
.line("Roll (True) (Z) [°]", B1, |vs| vs.true_euler_angles.map(|a| a.z)) | ||
.line("Pitch (True) (X) [°]", R1, |vs| vs.true_euler_angles.map(|a| a.x)) | ||
.line("Yaw (True) (Y) [°]", G1, |vs| vs.true_euler_angles.map(|a| a.y)) | ||
.line("Angle of Attack (True) [°]", O1, |vs| vs.true_angle_of_attack); | ||
orientation_plot | ||
} |
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,15 @@ | ||
use std::{cell::RefCell, rc::Rc}; | ||
|
||
use crate::gui::plot::{PlotState, SharedPlotState}; | ||
|
||
use super::color_constants::*; | ||
|
||
pub fn vertical_speed_plot(shared_plot: &Rc<RefCell<SharedPlotState>>) -> PlotState { | ||
let vertical_speed_plot = PlotState::new("Vert. Speed & Accel.", (None, None), shared_plot.clone()) | ||
.line("Vertical Accel [m/s²]", O1, |vs| vs.vertical_accel) | ||
.line("Vertical Accel (Filt.) [m/s²]", O, |vs| vs.vertical_accel_filtered) | ||
.line("Vario [m/s]", B, |vs| vs.vertical_speed) | ||
.line("True Vertical Accel [m/s²]", G, |vs| vs.true_vertical_accel) | ||
.line("True Vario [m/s]", B1, |vs| vs.true_vertical_speed); | ||
vertical_speed_plot | ||
} |
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
Oops, something went wrong.