diff options
Diffstat (limited to 'logic/mappings.cpp')
-rw-r--r-- | logic/mappings.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/logic/mappings.cpp b/logic/mappings.cpp index 9e81bb01..8144f9b4 100644 --- a/logic/mappings.cpp +++ b/logic/mappings.cpp @@ -2,18 +2,13 @@ #include <utility> -Map::Map(QString primary, QString secondary, int max_x, int max_y, axis_opts& opts) : +Map::Map(const QString& spline_name, const QString& alt_spline_name, axis_opts& opts) : opts(opts), - name1(primary), - name2(secondary), - spline_main(max_x, max_y, primary), - spline_alt(max_x, max_y, secondary) + name(spline_name), + alt_name(alt_spline_name), + spline_main(spline_name, opts.prefix(), opts.axis()), + spline_alt(alt_spline_name, opts.prefix(), opts.axis()) { - spline_main.set_max_input(max_x); - spline_alt.set_max_input(max_x); - - spline_main.set_max_output(max_y); - spline_alt.set_max_output(max_y); } void Map::save() @@ -30,11 +25,11 @@ void Map::load() Mappings::Mappings(std::vector<axis_opts*> opts) : axes { - Map("spline-X", "alt-spline-X", 100, 75, *opts[TX]), - Map("spline-Y", "alt-spline-Y", 100, 75, *opts[TY]), - Map("spline-Z", "alt-spline-Z", 100, 75, *opts[TZ]), - Map("spline-yaw", "alt-spline-yaw", 180, 180, *opts[Yaw]), - Map("spline-pitch", "alt-spline-pitch", 180, std::abs((int)opts[Pitch]->clamp_y), *opts[Pitch]), - Map("spline-roll", "alt-spline-roll", 180, 180, *opts[Roll]) + Map("spline-X", "alt-spline-X", *opts[TX]), + Map("spline-Y", "alt-spline-Y", *opts[TY]), + Map("spline-Z", "alt-spline-Z", *opts[TZ]), + Map("spline-yaw", "alt-spline-yaw", *opts[Yaw]), + Map("spline-pitch", "alt-spline-pitch", *opts[Pitch]), + Map("spline-roll", "alt-spline-roll", *opts[Roll]) } {} |