JoystickAxis.cc 612 Bytes
Newer Older
1 2 3 4 5 6
#include "JoystickAxis.h"
#include "ui_JoystickAxis.h"
#include <QString>

JoystickAxis::JoystickAxis(int id, QWidget *parent) :
    QWidget(parent),
7
    id(id),
8 9 10 11
    ui(new Ui::JoystickAxis)
{
    ui->setupUi(this);
    ui->label->setText(QString::number(id));
12
    connect(ui->comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(mappingComboBoxChanged(int)));
13 14 15 16 17 18 19
}

JoystickAxis::~JoystickAxis()
{
    delete ui;
}

20
void JoystickAxis::setValue(float value)
21
{
22 23 24 25 26 27
    ui->progressBar->setValue(100.0f * value);
}

void JoystickAxis::mappingComboBoxChanged(int newMapping)
{
    emit mappingChanged(id, newMapping);
28
}