Skip to content

Commit

Permalink
Allow outputting lut sens and allow changing lut output resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuuuube committed Jul 30, 2024
1 parent 1c21fea commit 5ba357a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
rawaccel_convert = { git = "https://github.com/Kuuuube/rawaccel_convert.git", rev = "2c9118301e2cb7abd78537047f82fec29c8dea85" }
rawaccel_convert = { git = "https://github.com/Kuuuube/rawaccel_convert.git", rev = "1b090cb684fc47d211ef5c6d1985572fb338ebc9" }
egui = "0.28.1"
eframe = { version = "0.28.1", features = [ "default_fonts", "glow", "persistence" ] }
env_logger = "0.11.3"
Expand Down
25 changes: 13 additions & 12 deletions src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ fn get_point(x: f64, args: &AccelArgs) -> f64 {
PointScaling::Velocity
| PointScaling::Libinput
| PointScaling::LibinputDebug
| PointScaling::Lookup => {
| PointScaling::LookupVelocity
| PointScaling::LookupSens => {
let converted_point = rawaccel_convert::convert_curve::sensitivity_point_to_velocity(
rawaccel_convert::types::Point { x, y },
);
Expand Down Expand Up @@ -1107,8 +1108,13 @@ fn add_points_dump(rawaccel_convert_gui: &mut RawaccelConvertGui, ui: &mut egui:
);
ui.selectable_value(
&mut rawaccel_convert_gui.export_point_scaling,
PointScaling::Lookup,
"Lookup",
PointScaling::LookupVelocity,
"LookupVelocity",
);
ui.selectable_value(
&mut rawaccel_convert_gui.export_point_scaling,
PointScaling::LookupSens,
"LookupSens",
);
})
});
Expand All @@ -1127,12 +1133,6 @@ fn add_points_dump(rawaccel_convert_gui: &mut RawaccelConvertGui, ui: &mut egui:
rawaccel_convert_gui.settings.point_count_string = "64".to_string();
}
}
PointScaling::Lookup => {
if ok != 256 {
color = ui.visuals().error_fg_color;
rawaccel_convert_gui.settings.point_count_string = "256".to_string();
}
}
_ => {
if ok > 1 {
rawaccel_convert_gui.accel_args.point_count = ok;
Expand Down Expand Up @@ -1210,7 +1210,8 @@ fn add_points_dump(rawaccel_convert_gui: &mut RawaccelConvertGui, ui: &mut egui:
PointScaling::Sens
| PointScaling::Velocity
| PointScaling::Gain
| PointScaling::Lookup => true,
| PointScaling::LookupVelocity
| PointScaling::LookupSens => true,
PointScaling::Libinput | PointScaling::LibinputDebug => false,
};

Expand All @@ -1234,10 +1235,10 @@ fn add_points_dump(rawaccel_convert_gui: &mut RawaccelConvertGui, ui: &mut egui:
}
output_string
}
rawaccel_convert::types::PointScaling::Lookup => {
rawaccel_convert::types::PointScaling::LookupVelocity | rawaccel_convert::types::PointScaling::LookupSens => {
let mut output_string = String::default();
for point in &rawaccel_convert_gui.curvegen_export.points {
output_string += &format!("{},{};", point.x, point.y);
output_string += &format!("{},{};\n", point.x, point.y);
}
output_string
}
Expand Down

0 comments on commit 5ba357a

Please sign in to comment.