[Horus] Companion simulator
This commit is contained in:
@@ -9,6 +9,8 @@ set(simulation_SRCS
|
||||
set(simulation_UIS
|
||||
simulatordialog-9x.ui
|
||||
simulatordialog-taranis.ui
|
||||
simulatordialog-horus.ui
|
||||
simulatordialog-flamenco.ui
|
||||
telemetrysimu.ui
|
||||
trainersimu.ui
|
||||
debugoutput.ui
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef lcd_widget_h
|
||||
#define lcd_widget_h
|
||||
#ifndef _LCD_WIDGET_H_
|
||||
#define _LCD_WIDGET_H_
|
||||
|
||||
#include <QWidget>
|
||||
#include "appdata.h"
|
||||
|
||||
class lcdWidget : public QWidget {
|
||||
class LcdWidget : public QWidget {
|
||||
public:
|
||||
lcdWidget(QWidget * parent = 0):
|
||||
LcdWidget(QWidget * parent = 0):
|
||||
QWidget(parent),
|
||||
lcdBuf(NULL),
|
||||
previousBuf(NULL),
|
||||
@@ -30,10 +30,11 @@ class lcdWidget : public QWidget {
|
||||
{
|
||||
}
|
||||
|
||||
~lcdWidget()
|
||||
~LcdWidget()
|
||||
{
|
||||
if (previousBuf)
|
||||
if (previousBuf) {
|
||||
free(previousBuf);
|
||||
}
|
||||
}
|
||||
|
||||
void setData(unsigned char *buf, int width, int height, int depth=1)
|
||||
@@ -43,7 +44,7 @@ class lcdWidget : public QWidget {
|
||||
lcdHeight = height;
|
||||
lcdDepth = depth;
|
||||
if (depth >= 8)
|
||||
lcdSize = (width * height) * (depth / 8);
|
||||
lcdSize = (width * height) * ((depth+7) / 8);
|
||||
else
|
||||
lcdSize = (width * ((height+7)/8)) * depth;
|
||||
previousBuf = (unsigned char *)malloc(lcdSize);
|
||||
@@ -109,7 +110,17 @@ class lcdWidget : public QWidget {
|
||||
{
|
||||
QRgb rgb;
|
||||
|
||||
if (lcdDepth >= 8) {
|
||||
if (lcdDepth == 16) {
|
||||
for (int x=0; x<lcdWidth; x++) {
|
||||
for (int y=0; y<lcdHeight; y++) {
|
||||
uint16_t z = ((uint16_t *)lcdBuf)[y * lcdWidth + x];
|
||||
rgb = qRgb(255*((z&0xF800)>>11)/0x1F, 255*((z&0x07E0)>>5)/0x3F, 255*(z&0x001F)/0x1F);
|
||||
p.setPen(rgb);
|
||||
p.drawPoint(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lcdDepth == 12) {
|
||||
for (int x=0; x<lcdWidth; x++) {
|
||||
for (int y=0; y<lcdHeight; y++) {
|
||||
uint16_t z = ((uint16_t *)lcdBuf)[y * lcdWidth + x];
|
||||
@@ -175,4 +186,4 @@ class lcdWidget : public QWidget {
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // _LCD_WIDGET_H_
|
||||
|
||||
@@ -1305,7 +1305,7 @@ QPushButton:checked {
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="lcdWidget" name="lcd" native="true">
|
||||
<widget class="LcdWidget" name="lcd" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -1469,7 +1469,7 @@ QPushButton:checked {
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>lcdWidget</class>
|
||||
<class>LcdWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>lcdwidget.h</header>
|
||||
<container>1</container>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -146,7 +146,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="lcdWidget" name="lcd" native="true">
|
||||
<widget class="LcdWidget" name="lcd" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -1735,7 +1735,7 @@ QPushButton:checked {
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>lcdWidget</class>
|
||||
<class>LcdWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>lcdwidget.h</header>
|
||||
<container>1</container>
|
||||
|
||||
@@ -217,6 +217,7 @@ SimulatorDialogTaranis::~SimulatorDialogTaranis()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
SimulatorDialog::~SimulatorDialog()
|
||||
{
|
||||
traceCallbackInstance = 0;
|
||||
@@ -1134,3 +1135,6 @@ void SimulatorDialog::onjoystickAxisValueChanged(int axis, int value)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "simulatordialogflamenco.cpp"
|
||||
#include "simulatordialoghorus.cpp"
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
namespace Ui {
|
||||
class SimulatorDialog9X;
|
||||
class SimulatorDialogTaranis;
|
||||
class SimulatorDialogFlamenco;
|
||||
class SimulatorDialogHorus;
|
||||
}
|
||||
|
||||
// TODO rename + move?
|
||||
class lcdWidget;
|
||||
class LcdWidget;
|
||||
class mySlider;
|
||||
|
||||
#define SIMULATOR_FLAGS_NOTX 1
|
||||
@@ -38,6 +40,8 @@ class mySlider;
|
||||
#define SIMULATOR_FLAGS_S3_MULTI 256
|
||||
#define SIMULATOR_FLAGS_S4_MULTI 512 // reserved for the future
|
||||
|
||||
void traceCb(const char * text);
|
||||
|
||||
class SimulatorDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -56,7 +60,7 @@ class SimulatorDialog : public QDialog
|
||||
virtual void updateBeepButton() { }
|
||||
|
||||
unsigned int flags;
|
||||
lcdWidget * lcd;
|
||||
LcdWidget * lcd;
|
||||
QGraphicsView * leftStick, * rightStick;
|
||||
QVector<QDial *> pots;
|
||||
QVector<QLabel *> potLabels;
|
||||
@@ -205,4 +209,48 @@ class SimulatorDialogTaranis: public SimulatorDialog
|
||||
void on_switchH_sliderReleased();
|
||||
};
|
||||
|
||||
class SimulatorDialogFlamenco: public SimulatorDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SimulatorDialogFlamenco(QWidget * parent, SimulatorInterface *simulator, unsigned int flags=0);
|
||||
virtual ~SimulatorDialogFlamenco();
|
||||
|
||||
protected:
|
||||
virtual void getValues();
|
||||
void saveSwitches(void);
|
||||
void restoreSwitches(void);
|
||||
|
||||
private:
|
||||
Ui::SimulatorDialogFlamenco * ui;
|
||||
static uint32_t switchstatus;
|
||||
|
||||
private slots:
|
||||
void resetSH();
|
||||
void on_switchH_sliderReleased();
|
||||
};
|
||||
|
||||
class SimulatorDialogHorus: public SimulatorDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SimulatorDialogHorus(QWidget * parent, SimulatorInterface *simulator, unsigned int flags=0);
|
||||
virtual ~SimulatorDialogHorus();
|
||||
|
||||
protected:
|
||||
virtual void getValues();
|
||||
void saveSwitches(void);
|
||||
void restoreSwitches(void);
|
||||
|
||||
private:
|
||||
Ui::SimulatorDialogHorus * ui;
|
||||
static uint32_t switchstatus;
|
||||
|
||||
private slots:
|
||||
void resetSH();
|
||||
void on_switchH_sliderReleased();
|
||||
};
|
||||
|
||||
#endif // SIMULATORDIALOG_H
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
#include "simulatordialog.h"
|
||||
#include "ui_simulatordialog-flamenco.h"
|
||||
#include "helpers.h"
|
||||
|
||||
uint32_t SimulatorDialogFlamenco::switchstatus = 0;
|
||||
|
||||
SimulatorDialogFlamenco::SimulatorDialogFlamenco(QWidget * parent, SimulatorInterface *simulator, unsigned int flags):
|
||||
SimulatorDialog(parent, simulator, flags),
|
||||
ui(new Ui::SimulatorDialogFlamenco)
|
||||
{
|
||||
lcdWidth = 320;
|
||||
lcdHeight = 240;
|
||||
lcdDepth = 12;
|
||||
|
||||
initUi<Ui::SimulatorDialogFlamenco>(ui);
|
||||
|
||||
// install simulator TRACE hook
|
||||
simulator->installTraceHook(traceCb);
|
||||
|
||||
// TODO dialP_4 = ui->dialP_4;
|
||||
|
||||
ui->lcd->setBackgroundColor(47, 123, 227);
|
||||
|
||||
//restore switches
|
||||
if (g.simuSW())
|
||||
restoreSwitches();
|
||||
|
||||
ui->trimHR_L->setText(QString::fromUtf8(leftArrow));
|
||||
ui->trimHR_R->setText(QString::fromUtf8(rightArrow));
|
||||
ui->trimVR_U->setText(QString::fromUtf8(upArrow));
|
||||
ui->trimVR_D->setText(QString::fromUtf8(downArrow));
|
||||
ui->trimHL_L->setText(QString::fromUtf8(leftArrow));
|
||||
ui->trimHL_R->setText(QString::fromUtf8(rightArrow));
|
||||
ui->trimVL_U->setText(QString::fromUtf8(upArrow));
|
||||
ui->trimVL_D->setText(QString::fromUtf8(downArrow));
|
||||
|
||||
connect(ui->cursor, SIGNAL(buttonPressed(int)), this, SLOT(onButtonPressed(int)));
|
||||
connect(ui->menu, SIGNAL(buttonPressed(int)), this, SLOT(onButtonPressed(int)));
|
||||
connect(ui->trimHR_L, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHR_R, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVR_U, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVR_D, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHL_R, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHL_L, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVL_U, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVL_D, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHR_L, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimHR_R, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVR_U, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVR_D, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimHL_R, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimHL_L, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVL_U, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVL_D, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
}
|
||||
|
||||
SimulatorDialogFlamenco::~SimulatorDialogFlamenco()
|
||||
{
|
||||
saveSwitches();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SimulatorDialogFlamenco::resetSH()
|
||||
{
|
||||
ui->switchH->setValue(0);
|
||||
}
|
||||
|
||||
void SimulatorDialogFlamenco::on_switchH_sliderReleased()
|
||||
{
|
||||
QTimer::singleShot(400, this, SLOT(resetSH()));
|
||||
}
|
||||
|
||||
void SimulatorDialogFlamenco::getValues()
|
||||
{
|
||||
TxInputs inputs = {
|
||||
{
|
||||
int(1024*nodeLeft->getX()), // LEFT HORZ
|
||||
int(-1024*nodeLeft->getY()), // LEFT VERT
|
||||
int(-1024*nodeRight->getY()), // RGHT VERT
|
||||
int(1024*nodeRight->getX()) // RGHT HORZ
|
||||
},
|
||||
|
||||
{
|
||||
-ui->dialP_1->value(),
|
||||
ui->dialP_2->value(),
|
||||
0,
|
||||
-ui->dialP_3->value(),
|
||||
ui->dialP_4->value()
|
||||
},
|
||||
|
||||
{
|
||||
ui->switchA->value() - 1,
|
||||
ui->switchB->value() - 1,
|
||||
ui->switchC->value() - 1,
|
||||
ui->switchD->value() - 1,
|
||||
ui->switchE->value() - 1,
|
||||
ui->switchF->value(),
|
||||
ui->switchG->value() - 1,
|
||||
ui->switchH->value(), 0, 0
|
||||
},
|
||||
|
||||
{
|
||||
buttonPressed == Qt::Key_PageUp,
|
||||
buttonPressed == Qt::Key_Escape,
|
||||
buttonPressed == Qt::Key_Enter,
|
||||
buttonPressed == Qt::Key_PageDown,
|
||||
buttonPressed == Qt::Key_Plus,
|
||||
buttonPressed == Qt::Key_Minus
|
||||
},
|
||||
|
||||
middleButtonPressed,
|
||||
|
||||
{
|
||||
trimPressed == TRIM_LH_L,
|
||||
trimPressed == TRIM_LH_R,
|
||||
trimPressed == TRIM_LV_DN,
|
||||
trimPressed == TRIM_LV_UP,
|
||||
trimPressed == TRIM_RV_DN,
|
||||
trimPressed == TRIM_RV_UP,
|
||||
trimPressed == TRIM_RH_L,
|
||||
trimPressed == TRIM_RH_R
|
||||
}
|
||||
};
|
||||
|
||||
simulator->setValues(inputs);
|
||||
}
|
||||
|
||||
void SimulatorDialogFlamenco::saveSwitches(void)
|
||||
{
|
||||
// qDebug() << "SimulatorDialogTaranis::saveSwitches()";
|
||||
switchstatus=ui->switchA->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchB->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchC->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchD->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchE->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchF->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchG->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchH->value();
|
||||
}
|
||||
|
||||
void SimulatorDialogFlamenco::restoreSwitches(void)
|
||||
{
|
||||
// qDebug() << "SimulatorDialogTaranis::restoreSwitches()";
|
||||
ui->switchH->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchG->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchF->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchE->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchD->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchC->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchB->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchA->setValue(switchstatus & 0x3);
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
#include "simulatordialog.h"
|
||||
#include "ui_simulatordialog-horus.h"
|
||||
#include "helpers.h"
|
||||
|
||||
uint32_t SimulatorDialogHorus::switchstatus = 0;
|
||||
|
||||
SimulatorDialogHorus::SimulatorDialogHorus(QWidget * parent, SimulatorInterface *simulator, unsigned int flags):
|
||||
SimulatorDialog(parent, simulator, flags),
|
||||
ui(new Ui::SimulatorDialogHorus)
|
||||
{
|
||||
lcdWidth = 480;
|
||||
lcdHeight = 270;
|
||||
lcdDepth = 16;
|
||||
|
||||
initUi<Ui::SimulatorDialogHorus>(ui);
|
||||
|
||||
// install simulator TRACE hook
|
||||
simulator->installTraceHook(traceCb);
|
||||
|
||||
// TODO dialP_4 = ui->dialP_4;
|
||||
|
||||
ui->lcd->setBackgroundColor(47, 123, 227);
|
||||
|
||||
//restore switches
|
||||
if (g.simuSW())
|
||||
restoreSwitches();
|
||||
|
||||
ui->trimHR_L->setText(QString::fromUtf8(leftArrow));
|
||||
ui->trimHR_R->setText(QString::fromUtf8(rightArrow));
|
||||
ui->trimVR_U->setText(QString::fromUtf8(upArrow));
|
||||
ui->trimVR_D->setText(QString::fromUtf8(downArrow));
|
||||
ui->trimHL_L->setText(QString::fromUtf8(leftArrow));
|
||||
ui->trimHL_R->setText(QString::fromUtf8(rightArrow));
|
||||
ui->trimVL_U->setText(QString::fromUtf8(upArrow));
|
||||
ui->trimVL_D->setText(QString::fromUtf8(downArrow));
|
||||
|
||||
connect(ui->cursor, SIGNAL(buttonPressed(int)), this, SLOT(onButtonPressed(int)));
|
||||
connect(ui->menu, SIGNAL(buttonPressed(int)), this, SLOT(onButtonPressed(int)));
|
||||
connect(ui->trimHR_L, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHR_R, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVR_U, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVR_D, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHL_R, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHL_L, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVL_U, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimVL_D, SIGNAL(pressed()), this, SLOT(onTrimPressed()));
|
||||
connect(ui->trimHR_L, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimHR_R, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVR_U, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVR_D, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimHL_R, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimHL_L, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVL_U, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
connect(ui->trimVL_D, SIGNAL(released()), this, SLOT(onTrimReleased()));
|
||||
}
|
||||
|
||||
SimulatorDialogHorus::~SimulatorDialogHorus()
|
||||
{
|
||||
saveSwitches();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SimulatorDialogHorus::resetSH()
|
||||
{
|
||||
ui->switchH->setValue(0);
|
||||
}
|
||||
|
||||
void SimulatorDialogHorus::on_switchH_sliderReleased()
|
||||
{
|
||||
QTimer::singleShot(400, this, SLOT(resetSH()));
|
||||
}
|
||||
|
||||
void SimulatorDialogHorus::getValues()
|
||||
{
|
||||
TxInputs inputs = {
|
||||
{
|
||||
int(1024*nodeLeft->getX()), // LEFT HORZ
|
||||
int(-1024*nodeLeft->getY()), // LEFT VERT
|
||||
int(-1024*nodeRight->getY()), // RGHT VERT
|
||||
int(1024*nodeRight->getX()) // RGHT HORZ
|
||||
},
|
||||
|
||||
{
|
||||
-ui->dialP_1->value(),
|
||||
ui->dialP_2->value(),
|
||||
0,
|
||||
-ui->dialP_3->value(),
|
||||
ui->dialP_4->value()
|
||||
},
|
||||
|
||||
{
|
||||
ui->switchA->value() - 1,
|
||||
ui->switchB->value() - 1,
|
||||
ui->switchC->value() - 1,
|
||||
ui->switchD->value() - 1,
|
||||
ui->switchE->value() - 1,
|
||||
ui->switchF->value(),
|
||||
ui->switchG->value() - 1,
|
||||
ui->switchH->value(), 0, 0
|
||||
},
|
||||
|
||||
{
|
||||
buttonPressed == Qt::Key_PageUp,
|
||||
buttonPressed == Qt::Key_Escape,
|
||||
buttonPressed == Qt::Key_Enter,
|
||||
buttonPressed == Qt::Key_PageDown,
|
||||
buttonPressed == Qt::Key_Plus,
|
||||
buttonPressed == Qt::Key_Minus
|
||||
},
|
||||
|
||||
middleButtonPressed,
|
||||
|
||||
{
|
||||
trimPressed == TRIM_LH_L,
|
||||
trimPressed == TRIM_LH_R,
|
||||
trimPressed == TRIM_LV_DN,
|
||||
trimPressed == TRIM_LV_UP,
|
||||
trimPressed == TRIM_RV_DN,
|
||||
trimPressed == TRIM_RV_UP,
|
||||
trimPressed == TRIM_RH_L,
|
||||
trimPressed == TRIM_RH_R
|
||||
}
|
||||
};
|
||||
|
||||
simulator->setValues(inputs);
|
||||
}
|
||||
|
||||
void SimulatorDialogHorus::saveSwitches(void)
|
||||
{
|
||||
// qDebug() << "SimulatorDialogTaranis::saveSwitches()";
|
||||
switchstatus=ui->switchA->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchB->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchC->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchD->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchE->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchF->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchG->value();
|
||||
switchstatus<<=2;
|
||||
switchstatus+=ui->switchH->value();
|
||||
}
|
||||
|
||||
void SimulatorDialogHorus::restoreSwitches(void)
|
||||
{
|
||||
// qDebug() << "SimulatorDialogTaranis::restoreSwitches()";
|
||||
ui->switchH->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchG->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchF->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchE->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchD->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchC->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchB->setValue(switchstatus & 0x3);
|
||||
switchstatus>>=2;
|
||||
ui->switchA->setValue(switchstatus & 0x3);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ if (inputs.rotenc) pind |= 0x20;
|
||||
if (inputs.rotenc) PIOB->PIO_PDSR &= ~0x40; else PIOB->PIO_PDSR |= 0x40;
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) && defined(REV9E)
|
||||
#if defined(PCBFLAMENCO) || (defined(PCBTARANIS) && defined(REV9E))
|
||||
if (inputs.rotenc) simuSetKey(KEY_ENTER, true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user