Skip to content

Commit

Permalink
Add notice about resetting gear adaptation to map tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
rnd-ash committed May 7, 2023
1 parent 6e8e447 commit f7c035f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
25 changes: 24 additions & 1 deletion config_app/src/ui/map_editor/map_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"RPM",
None,
Some(&["1->2", "2->3", "3->4", "4->5"]),
false
//None
),
MapData::new(
Expand All @@ -25,6 +26,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"RPM",
None,
Some(&["1->2", "2->3", "3->4", "4->5"]),
false
//None
),
MapData::new(
Expand All @@ -38,6 +40,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"RPM",
None,
Some(&["1->2", "2->3", "3->4", "4->5"]),
false
//None
),
MapData::new(
Expand All @@ -51,6 +54,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"RPM",
None,
Some(&["2->1", "3->2", "4->3", "5->4"]),
false
//None
),
MapData::new(
Expand All @@ -64,6 +68,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"RPM",
None,
Some(&["2->1", "3->2", "4->3", "5->4"]),
false
//None
),
MapData::new(
Expand All @@ -77,6 +82,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"RPM",
None,
Some(&["2->1", "3->2", "4->3", "5->4"]),
false
//None
),
MapData::new(
Expand All @@ -90,6 +96,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"mBar",
None,
Some(&["P/N", "R1/R2", "1", "2", "3", "4", "5"]),
true
//None
),
MapData::new(
Expand All @@ -103,6 +110,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"mA",
None,
None,
false
//None
),
MapData::new(
Expand All @@ -116,6 +124,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"/4096",
None,
None,
false
//None
),
MapData::new(
Expand All @@ -129,6 +138,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"ms",
None,
Some(&["K1", "K2", "K3", "B1", "B2"]),
true
//None
),
MapData::new(
Expand All @@ -142,6 +152,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"mBar",
None,
Some(&["K1", "K2", "K3", "B1", "B2"]),
true
//None
),
MapData::new(
Expand All @@ -155,6 +166,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"mBar",
None,
Some(&["K1", "K2", "K3", "B1", "B2"]),
true
//None
),
MapData::new(
Expand All @@ -168,6 +180,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"ms",
None,
None,
false
//None
),
MapData::new(
Expand All @@ -181,6 +194,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"ms",
None,
None,
false
//None
),
MapData::new(
Expand All @@ -194,6 +208,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"ms",
None,
None,
false
//None
),
MapData::new(
Expand All @@ -207,6 +222,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"ms",
None,
None,
false
//None
),
MapData::new(
Expand All @@ -220,6 +236,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"ms",
None,
None,
false
//None
),
MapData::new(
Expand All @@ -233,6 +250,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"ms",
None,
None,
false
//None
),
MapData::new(
Expand All @@ -246,6 +264,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"ms",
None,
None,
false
//None
),
MapData::new(
Expand All @@ -259,6 +278,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"ms",
None,
None,
false
//None
),
MapData::new(
Expand All @@ -272,6 +292,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"ms",
None,
None,
false
//None
),
MapData::new(
Expand All @@ -285,6 +306,7 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"ms",
None,
None,
false
//None
),
MapData::new(
Expand All @@ -297,7 +319,8 @@ pub(crate) const MAP_ARRAY: &[MapData] = &[
"Locking pressure(mBar)",
"mBar",
Some(&["D1", "D2", "D3", "D4", "D5"]),
None
None,
false
//None
),
];
6 changes: 6 additions & 0 deletions config_app/src/ui/map_editor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ impl Map {
};
let header_color = raw_ui.visuals().warn_fg_color;
let cell_edit_color = raw_ui.visuals().error_fg_color;
if self.meta.reset_adaptation {
raw_ui.strong("Warning. Modifying this map resets adaptation!");
}
if !self.meta.x_desc.is_empty() {
raw_ui.label(format!("X: {}", self.meta.x_desc));
}
Expand Down Expand Up @@ -652,6 +655,7 @@ pub struct MapData {
x_replace: Option<&'static [&'static str]>,
y_replace: Option<&'static [&'static str]>,
show_help: bool,
reset_adaptation: bool
}

impl MapData {
Expand All @@ -666,6 +670,7 @@ impl MapData {
value_unit: &'static str,
x_replace: Option<&'static [&'static str]>,
y_replace: Option<&'static [&'static str]>,
reset_adaptation: bool,
) -> Self {
Self {
id,
Expand All @@ -679,6 +684,7 @@ impl MapData {
x_replace,
y_replace,
show_help: false,
reset_adaptation
}
}
}
Expand Down

0 comments on commit f7c035f

Please sign in to comment.