summaryrefslogtreecommitdiffhomepage
path: root/logic/mappings.cpp
blob: 8144f9b4542644dc2163a4574d57af4635826733 (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
#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(std::vector<axis_opts*> opts) :
    axes {
        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])
    }
{}