summaryrefslogtreecommitdiffhomepage
path: root/logic/mappings.cpp
blob: 5767354038117627e5d8614a97f051305b7c94bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "mappings.hpp"

#include <utility>

Map::Map(const QString& spline_name, const QString& alt_spline_name, axis_opts& opts) :
    opts(opts),
    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())
{
}

void Map::save()
{
    spline_main.save();
    spline_alt.save();
}

void Map::load()
{
    spline_main.reload();
    spline_alt.reload();
}


Mappings::Mappings(axis_opts_impl::axis_opts** opts) :
    axes {
        { "spline-X",       "alt-spline-X",    *opts[TX] },
        { "spline-Y",       "alt-spline-Y",    *opts[TY] },
        { "spline-Z",       "alt-spline-Z",    *opts[TZ] },
        { "spline-yaw",     "alt-spline-yaw",  *opts[Yaw] },
        { "spline-pitch",   "alt-spline-pitch",*opts[Pitch] },
        { "spline-roll",    "alt-spline-roll", *opts[Roll] }
    }
{}