Merge branch 'origin/next'
Conflicts: companion/src/CMakeLists.txt companion/src/apppreferencesdialog.ui companion/src/companion.qrc companion/src/mdichild.cpp
This commit is contained in:
@@ -10,18 +10,24 @@ Channels::Channels(QWidget * parent, ModelData & model):
|
||||
ModelPanel(parent, model)
|
||||
{
|
||||
QGridLayout * gridLayout = new QGridLayout(this);
|
||||
bool minimize = false;
|
||||
|
||||
int col = 1;
|
||||
if (GetEepromInterface()->getCapability(ChannelsName))
|
||||
{
|
||||
minimize=true;
|
||||
addLabel(gridLayout, tr("Name"), col++);
|
||||
addLabel(gridLayout, tr("Offset"), col++);
|
||||
addLabel(gridLayout, tr("Min"), col++);
|
||||
addLabel(gridLayout, tr("Max"), col++);
|
||||
addLabel(gridLayout, tr("Invert"), col++);
|
||||
}
|
||||
addLabel(gridLayout, tr("Offset"), col++, minimize);
|
||||
addLabel(gridLayout, tr("Min"), col++, minimize);
|
||||
addLabel(gridLayout, tr("Max"), col++, minimize);
|
||||
addLabel(gridLayout, tr("Invert"), col++, minimize);
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard()))
|
||||
addLabel(gridLayout, tr("Curve"), col++, minimize);
|
||||
if (GetEepromInterface()->getCapability(PPMCenter))
|
||||
addLabel(gridLayout, tr("Center"), col++);
|
||||
addLabel(gridLayout, tr("Center"), col++, minimize);
|
||||
if (GetEepromInterface()->getCapability(SYMLimits))
|
||||
addLabel(gridLayout, tr("Sym"), col++);
|
||||
addLabel(gridLayout, tr("Sym"), col++, true);
|
||||
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) {
|
||||
col = 0;
|
||||
@@ -29,6 +35,7 @@ Channels::Channels(QWidget * parent, ModelData & model):
|
||||
// Channel label
|
||||
QLabel *label = new QLabel(this);
|
||||
label->setText(tr("Channel %1").arg(i+1));
|
||||
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
|
||||
gridLayout->addWidget(label, i+1, col++, 1, 1);
|
||||
|
||||
// Channel name
|
||||
@@ -88,6 +95,19 @@ Channels::Channels(QWidget * parent, ModelData & model):
|
||||
connect(invCB, SIGNAL(currentIndexChanged(int)), this, SLOT(invEdited()));
|
||||
gridLayout->addWidget(invCB, i+1, col++, 1, 1);
|
||||
|
||||
// Curve
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
QComboBox * curveCB = new QComboBox(this);
|
||||
curveCB->setProperty("index", i);
|
||||
int numcurves = GetEepromInterface()->getCapability(NumCurves);
|
||||
for (int j=-numcurves; j<=numcurves; j++) {
|
||||
curveCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, j).toString(), j);
|
||||
}
|
||||
curveCB->setCurrentIndex(model.limitData[i].curve.value+numcurves);
|
||||
connect(curveCB, SIGNAL(currentIndexChanged(int)), this, SLOT(curveEdited()));
|
||||
gridLayout->addWidget(curveCB, i+1, col++, 1, 1);
|
||||
}
|
||||
|
||||
// PPM center
|
||||
if (GetEepromInterface()->getCapability(PPMCenter)) {
|
||||
QSpinBox * center = new QSpinBox(this);
|
||||
@@ -110,6 +130,8 @@ Channels::Channels(QWidget * parent, ModelData & model):
|
||||
gridLayout->addWidget(symlimits, i+1, col++, 1, 1);
|
||||
}
|
||||
}
|
||||
// Push the rows up
|
||||
addVSpring(gridLayout, 0,GetEepromInterface()->getCapability(Outputs)+1);
|
||||
}
|
||||
|
||||
Channels::~Channels()
|
||||
@@ -168,6 +190,14 @@ void Channels::invEdited()
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void Channels::curveEdited()
|
||||
{
|
||||
QComboBox *cb = qobject_cast<QComboBox*>(sender());
|
||||
int index = cb->property("index").toInt();
|
||||
model.limitData[index].curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, cb->itemData(cb->currentIndex()).toInt());
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void Channels::ppmcenterEdited()
|
||||
{
|
||||
QSpinBox *sb = qobject_cast<QSpinBox*>(sender());
|
||||
|
||||
@@ -18,6 +18,7 @@ class Channels : public ModelPanel
|
||||
void minEdited();
|
||||
void maxEdited();
|
||||
void invEdited();
|
||||
void curveEdited();
|
||||
void ppmcenterEdited();
|
||||
|
||||
};
|
||||
|
||||
@@ -1,217 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="ca_ctype_label_2">
|
||||
<property name="text">
|
||||
<string>Curve type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="ca_coeff_SB_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="ca_coeff_label_2">
|
||||
<property name="text">
|
||||
<string>Coefficient</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="ca_side_CB_2">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Both</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>x>0</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>x<0</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="ca_ymid_label_2">
|
||||
<property name="text">
|
||||
<string>Y at X=0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="ca_ymax_SB_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="ca_ymid_SB_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="ca_side_label_2">
|
||||
<property name="text">
|
||||
<string>Side</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="ca_ymin_label_2">
|
||||
<property name="text">
|
||||
<string>Y at X=-100</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="ca_ymin_SB_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="ca_ymax_label_2">
|
||||
<property name="text">
|
||||
<string>Y at X=100</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="ca_ctype_CB_2">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Linear</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Single Expo</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Symmetrical f(x)=-f(-x)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Symmetrical f(x)=f(-x)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Dialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
+178
-241
@@ -10,24 +10,87 @@
|
||||
|
||||
#define GFX_MARGIN 16
|
||||
|
||||
static const QColor colors[C9X_MAX_CURVES] = {
|
||||
QColor(0,0,127),
|
||||
QColor(0,127,0),
|
||||
QColor(127,0,0),
|
||||
QColor(0,127,127),
|
||||
QColor(127,0,127),
|
||||
QColor(127,127,0),
|
||||
QColor(127,127,127),
|
||||
QColor(0,0,255),
|
||||
QColor(0,127,255),
|
||||
QColor(127,0,255),
|
||||
QColor(0,255,0),
|
||||
QColor(0,255,127),
|
||||
QColor(127,255,0),
|
||||
QColor(255,0,0),
|
||||
QColor(255,0,127),
|
||||
QColor(255,127,0),
|
||||
};
|
||||
#define CURVE_COEFF_ENABLE 1
|
||||
#define CURVE_YMID_ENABLE 2
|
||||
#define CURVE_YMIN_ENABLE 4
|
||||
|
||||
float curveLinear(float x, float coeff, float yMin, float yMid, float yMax)
|
||||
{
|
||||
float a = (yMax-yMin) / 200.0;
|
||||
return yMin + a * (x+100.0);
|
||||
}
|
||||
|
||||
float c9xexpou(float point, float coeff)
|
||||
{
|
||||
float x = point*1024.0/100.0;
|
||||
float k = coeff*256.0/100.0;
|
||||
return ((k*x*x*x/(1024*1024) + x*(256-k) + 128) / 256) / 1024.0 * 100;
|
||||
}
|
||||
|
||||
float curveExpo(float x, float coeff, float yMin, float yMid, float yMax)
|
||||
{
|
||||
float a = (yMax-yMin) / 100.0;
|
||||
|
||||
x += 100.0;
|
||||
x /= 2.0;
|
||||
|
||||
if (coeff >= 0) {
|
||||
return round(c9xexpou(x, coeff)*a + yMin);
|
||||
}
|
||||
else {
|
||||
coeff = -coeff;
|
||||
x = 100 - x;
|
||||
return round((100.0 - c9xexpou(x, coeff))*a + yMin);
|
||||
}
|
||||
}
|
||||
|
||||
float curveSymmetricalY(float x, float coeff, float yMin, float yMid, float yMax)
|
||||
{
|
||||
bool invert;
|
||||
if (x<0) {
|
||||
x = -x;
|
||||
invert = 1;
|
||||
}
|
||||
else {
|
||||
invert = 0;
|
||||
}
|
||||
|
||||
float y;
|
||||
if (coeff >= 0) {
|
||||
y = round(c9xexpou(x, coeff) * (yMax/100.0));
|
||||
}
|
||||
else {
|
||||
coeff = -coeff;
|
||||
x = 100.0 - x;
|
||||
y = round((100.0-c9xexpou(x, coeff)) * (yMax/100.0));
|
||||
}
|
||||
|
||||
if (invert) {
|
||||
y = -y;
|
||||
}
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
float curveSymmetricalX(float x, float coeff, float yMin, float yMid, float yMax)
|
||||
{
|
||||
float a = (yMax-yMid) / 100.0;
|
||||
|
||||
if (x<0)
|
||||
x = -x;
|
||||
|
||||
float y;
|
||||
if (coeff >= 0) {
|
||||
y = round(c9xexpou(x, coeff) * a + yMid);
|
||||
}
|
||||
else {
|
||||
coeff = -coeff;
|
||||
x = 100-x;
|
||||
y = round((100.0-c9xexpou(x, coeff)) * a + yMid);
|
||||
}
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef __APPLE__
|
||||
@@ -145,6 +208,11 @@ Curves::Curves(QWidget * parent, ModelData & model):
|
||||
}
|
||||
}
|
||||
|
||||
addTemplate(tr("Linear"), CURVE_YMIN_ENABLE, curveLinear);
|
||||
addTemplate(tr("Single Expo"), CURVE_COEFF_ENABLE | CURVE_YMIN_ENABLE, curveExpo);
|
||||
addTemplate(tr("Symmetrical f(x)=-f(-x)"), CURVE_COEFF_ENABLE, curveSymmetricalY);
|
||||
addTemplate(tr("Symmetrical f(x)=f(-x)"), CURVE_COEFF_ENABLE | CURVE_YMID_ENABLE, curveSymmetricalX);
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
@@ -189,41 +257,16 @@ void Curves::update()
|
||||
ui->curveName->setText(model.curves[currentCurve].name);
|
||||
}
|
||||
|
||||
int count = model.curves[currentCurve].count;
|
||||
for (int i=0; i<count; i++) {
|
||||
spny[i]->show();
|
||||
spny[i]->setValue(model.curves[currentCurve].points[i].y);
|
||||
if (model.curves[currentCurve].type == CurveData::CURVE_TYPE_CUSTOM) {
|
||||
spnx[i]->show();
|
||||
if (i==0 || i==model.curves[currentCurve].count-1) {
|
||||
spnx[i]->setDisabled(true);
|
||||
spnx[i]->setMaximum(+100);
|
||||
spnx[i]->setMinimum(-100);
|
||||
}
|
||||
else {
|
||||
spnx[i]->setMaximum(model.curves[currentCurve].points[i+1].x);
|
||||
spnx[i]->setMinimum(model.curves[currentCurve].points[i-1].x);
|
||||
}
|
||||
spnx[i]->setValue(model.curves[currentCurve].points[i].x);
|
||||
}
|
||||
else {
|
||||
spnx[i]->hide();
|
||||
}
|
||||
}
|
||||
for (int i=count; i<C9X_MAX_POINTS; i++) {
|
||||
spny[i]->hide();
|
||||
spnx[i]->hide();
|
||||
}
|
||||
|
||||
updateCurveType();
|
||||
updateCurve();
|
||||
updateCurvePoints();
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void Curves::setCurrentCurve(int index)
|
||||
{
|
||||
currentCurve = index;
|
||||
currentCurve = index;
|
||||
}
|
||||
|
||||
void Curves::updateCurveType()
|
||||
@@ -253,6 +296,8 @@ void Curves::updateCurveType()
|
||||
|
||||
void Curves::updateCurve()
|
||||
{
|
||||
lock = true;
|
||||
|
||||
Node * nodel = 0;
|
||||
Node * nodex = 0;
|
||||
QColor color;
|
||||
@@ -317,18 +362,51 @@ void Curves::updateCurve()
|
||||
scene->addItem(nodex);
|
||||
if (i>0) scene->addItem(new Edge(nodel, nodex));
|
||||
}
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void Curves::updateCurvePoints()
|
||||
{
|
||||
lock = true;
|
||||
|
||||
int count = model.curves[currentCurve].count;
|
||||
for (int i=0; i<count; i++) {
|
||||
spny[i]->show();
|
||||
spny[i]->setValue(model.curves[currentCurve].points[i].y);
|
||||
if (model.curves[currentCurve].type == CurveData::CURVE_TYPE_CUSTOM) {
|
||||
spnx[i]->show();
|
||||
if (i==0 || i==model.curves[currentCurve].count-1) {
|
||||
spnx[i]->setDisabled(true);
|
||||
spnx[i]->setMaximum(+100);
|
||||
spnx[i]->setMinimum(-100);
|
||||
}
|
||||
else {
|
||||
spnx[i]->setMaximum(model.curves[currentCurve].points[i+1].x);
|
||||
spnx[i]->setMinimum(model.curves[currentCurve].points[i-1].x);
|
||||
}
|
||||
spnx[i]->setValue(model.curves[currentCurve].points[i].x);
|
||||
}
|
||||
else {
|
||||
spnx[i]->hide();
|
||||
}
|
||||
}
|
||||
for (int i=count; i<C9X_MAX_POINTS; i++) {
|
||||
spny[i]->hide();
|
||||
spnx[i]->hide();
|
||||
}
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void Curves::onPointEdited()
|
||||
{
|
||||
if (!lock) {
|
||||
lock = true;
|
||||
int index = sender()->property("index").toInt();
|
||||
model.curves[currentCurve].points[index].x = spnx[index]->value();
|
||||
model.curves[currentCurve].points[index].y = spny[index]->value();
|
||||
updateCurve();
|
||||
emit modified();
|
||||
lock = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,7 +468,7 @@ void Curves::on_curvePoints_currentIndexChanged(int index)
|
||||
|
||||
// TODO something better + reuse!
|
||||
for (int i=0; i<C9X_MAX_POINTS; i++) {
|
||||
model.curves[currentCurve].points[i].x = (i >= model.curves[currentCurve].count-1 ? +100 : -100 + (200*i)/(numpoints-1));
|
||||
model.curves[currentCurve].points[i].x = (i >= numpoints-1 ? +100 : -100 + (200*i)/(numpoints-1));
|
||||
model.curves[currentCurve].points[i].y = 0;
|
||||
}
|
||||
|
||||
@@ -413,7 +491,7 @@ void Curves::on_curveCustom_currentIndexChanged(int index)
|
||||
|
||||
// TODO something better + reuse!
|
||||
for (int i=0; i<C9X_MAX_POINTS; i++) {
|
||||
model.curves[currentCurve].points[i].x = (i >= model.curves[currentCurve].count-1 ? +100 : -100 + (200*i)/(numpoints-1));
|
||||
model.curves[currentCurve].points[i].x = (i >= numpoints-1 ? +100 : -100 + (200*i)/(numpoints-1));
|
||||
model.curves[currentCurve].points[i].y = 0;
|
||||
}
|
||||
|
||||
@@ -444,213 +522,72 @@ void Curves::resizeEvent(QResizeEvent *event)
|
||||
QRect qr = ui->curvePreview->contentsRect();
|
||||
ui->curvePreview->scene()->setSceneRect(GFX_MARGIN, GFX_MARGIN, qr.width()-GFX_MARGIN*2, qr.height()-GFX_MARGIN*2);
|
||||
updateCurve();
|
||||
|
||||
ModelPanel::resizeEvent(event);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void ModelEdit::on_ca_ctype_CB_currentIndexChanged()
|
||||
void Curves::on_curveType_currentIndexChanged()
|
||||
{
|
||||
int index=ui->ca_ctype_CB->currentIndex();
|
||||
switch (index) {
|
||||
int index = ui->curveType->currentIndex();
|
||||
unsigned int flags = templates[index].flags;
|
||||
ui->curveCoeffLabel->setVisible(flags & CURVE_COEFF_ENABLE);
|
||||
ui->curveCoeff->setVisible(flags & CURVE_COEFF_ENABLE);
|
||||
ui->yMax->setValue(100);
|
||||
ui->yMidLabel->setVisible(flags & CURVE_YMID_ENABLE);
|
||||
ui->yMid->setVisible(flags & CURVE_YMID_ENABLE);
|
||||
ui->yMid->setValue(0);
|
||||
ui->yMinLabel->setVisible(flags & CURVE_YMIN_ENABLE);
|
||||
ui->yMin->setVisible(flags & CURVE_YMIN_ENABLE);
|
||||
ui->yMin->setValue(-100);
|
||||
}
|
||||
|
||||
void Curves::addTemplate(QString name, unsigned int flags, curveFunction function)
|
||||
{
|
||||
CurveCreatorTemplate tmpl;
|
||||
tmpl.name = name;
|
||||
tmpl.flags = flags;
|
||||
tmpl.function = function;
|
||||
templates.append(tmpl);
|
||||
ui->curveType->addItem(name);
|
||||
}
|
||||
|
||||
void Curves::on_curveApply_clicked()
|
||||
{
|
||||
int index = ui->curveType->currentIndex();
|
||||
int numpoints = model.curves[currentCurve].count;
|
||||
|
||||
for (int i=0; i<numpoints; i++) {
|
||||
float x;
|
||||
if (model.curves[currentCurve].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
x = model.curves[currentCurve].points[i].x;
|
||||
else
|
||||
x = -100.0 + (200.0/(numpoints-1))*i;
|
||||
|
||||
bool apply = false;
|
||||
switch (ui->curveSide->currentIndex()) {
|
||||
case 0:
|
||||
ui->ca_coeff_SB->hide();
|
||||
ui->ca_coeff_label->hide();
|
||||
ui->ca_ymid_SB->hide();
|
||||
ui->ca_ymid_label->hide();
|
||||
ui->ca_ymin_SB->show();
|
||||
ui->ca_ymin_label->show();
|
||||
ui->ca_ymin_SB->setValue(-100);
|
||||
ui->ca_ymax_SB->setValue(100);
|
||||
apply = true;
|
||||
break;
|
||||
case 1:
|
||||
ui->ca_coeff_SB->show();
|
||||
ui->ca_coeff_label->show();
|
||||
ui->ca_ymid_SB->hide();
|
||||
ui->ca_ymid_label->hide();
|
||||
ui->ca_ymin_SB->show();
|
||||
ui->ca_ymin_label->show();
|
||||
ui->ca_ymin_SB->setValue(-100);
|
||||
ui->ca_ymax_SB->setValue(100);
|
||||
if (x>=0)
|
||||
apply = true;
|
||||
break;
|
||||
case 2:
|
||||
ui->ca_coeff_SB->show();
|
||||
ui->ca_coeff_label->show();
|
||||
ui->ca_ymid_SB->hide();
|
||||
ui->ca_ymid_label->hide();
|
||||
ui->ca_ymin_SB->hide();
|
||||
ui->ca_ymin_label->hide();
|
||||
ui->ca_ymax_SB->setValue(100);
|
||||
break;
|
||||
case 3:
|
||||
ui->ca_coeff_SB->show();
|
||||
ui->ca_coeff_label->show();
|
||||
ui->ca_ymid_SB->show();
|
||||
ui->ca_ymid_label->show();
|
||||
ui->ca_ymin_SB->hide();
|
||||
ui->ca_ymin_label->hide();
|
||||
ui->ca_ymid_SB->setValue(0);
|
||||
ui->ca_ymax_SB->setValue(100);
|
||||
if (x<0)
|
||||
apply = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float c9xexpou(float point, float coeff)
|
||||
{
|
||||
float x=point*1024.0/100.0;
|
||||
float k=coeff*256.0/100.0;
|
||||
return ((k*x*x*x/(1024*1024) + x*(256-k) + 128) / 256)/1024.0*100;
|
||||
}
|
||||
|
||||
void ModelEdit::on_ca_apply_PB_clicked()
|
||||
{
|
||||
int index=ui->ca_ctype_CB->currentIndex();
|
||||
float x;
|
||||
int y;
|
||||
int invert=0;
|
||||
float a;
|
||||
if (index==0) {
|
||||
a=(ui->ca_ymax_SB->value()-ui->ca_ymin_SB->value())/200.0;
|
||||
int numpoints=model.curves[currentCurve].count;
|
||||
for (int i=0; i<numpoints; i++) {
|
||||
if (model.curves[currentCurve].type == CurveData::CURVE_TYPE_CUSTOM) {
|
||||
x=(model.curves[currentCurve].points[i].x+100);
|
||||
} else {
|
||||
x=(200.0/(numpoints-1))*i;
|
||||
}
|
||||
y=ui->ca_ymin_SB->value()+a*x;
|
||||
switch (ui->ca_side_CB->currentIndex()) {
|
||||
case 0:
|
||||
model.curves[currentCurve].points[i].y=y;
|
||||
break;
|
||||
case 1:
|
||||
if (x>=100) {
|
||||
model.curves[currentCurve].points[i].y=y;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (x<100) {
|
||||
model.curves[currentCurve].points[i].y=y;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (index==1) {
|
||||
int numpoints=model.curves[currentCurve].count;
|
||||
for (int i=0; i<numpoints; i++) {
|
||||
if (model.curves[currentCurve].type == CurveData::CURVE_TYPE_CUSTOM) {
|
||||
x=((model.curves[currentCurve].points[i].x)+100)/2.0;
|
||||
} else {
|
||||
x=(100.0/(numpoints-1))*i;
|
||||
}
|
||||
a=ui->ca_coeff_SB->value();
|
||||
if (a>=0) {
|
||||
y=round(c9xexpou(x,a)*(ui->ca_ymax_SB->value()-ui->ca_ymin_SB->value())/100.0+ui->ca_ymin_SB->value());
|
||||
} else {
|
||||
a=-a;
|
||||
x=100-x;
|
||||
y=round((100.0-c9xexpou(x,a))*(ui->ca_ymax_SB->value()-ui->ca_ymin_SB->value())/100.0+ui->ca_ymin_SB->value());
|
||||
}
|
||||
switch (ui->ca_side_CB->currentIndex()) {
|
||||
case 0:
|
||||
model.curves[currentCurve].points[i].y=y;
|
||||
break;
|
||||
case 1:
|
||||
if (x>=50) {
|
||||
model.curves[currentCurve].points[i].y=y;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (x<50) {
|
||||
model.curves[currentCurve].points[i].y=y;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (index==2) {
|
||||
int numpoints=model.curves[currentCurve].count;
|
||||
for (int i=0; i<numpoints; i++) {
|
||||
if (model.curves[currentCurve].type == CurveData::CURVE_TYPE_CUSTOM) {
|
||||
x=(model.curves[currentCurve].points[i].x);
|
||||
} else {
|
||||
x=-100.0+(200.0/(numpoints-1))*i;
|
||||
}
|
||||
a=ui->ca_coeff_SB->value();
|
||||
if (x<0) {
|
||||
x=-x;
|
||||
invert=1;
|
||||
} else {
|
||||
invert=0;
|
||||
}
|
||||
if (a>=0) {
|
||||
y=round(c9xexpou(x,a)*(ui->ca_ymax_SB->value()/100.0));
|
||||
} else {
|
||||
a=-a;
|
||||
x=100-x;
|
||||
y=round((100.0-c9xexpou(x,a))*(ui->ca_ymax_SB->value()/100.0));
|
||||
}
|
||||
switch (ui->ca_side_CB->currentIndex()) {
|
||||
case 0:
|
||||
if (invert==1) {
|
||||
model.curves[currentCurve].points[i].y=-y;
|
||||
} else {
|
||||
model.curves[currentCurve].points[i].y=y;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (invert==0) {
|
||||
model.curves[currentCurve].points[i].y=y;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (invert==1) {
|
||||
model.curves[currentCurve].points[i].y=-y;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (index==3) {
|
||||
int numpoints=model.curves[currentCurve].count;
|
||||
for (int i=0; i<numpoints; i++) {
|
||||
if (model.curves[currentCurve].type == CurveData::CURVE_TYPE_CUSTOM) {
|
||||
x=(model.curves[currentCurve].points[i].x);
|
||||
} else {
|
||||
x=-100.0+(200.0/(numpoints-1))*i;
|
||||
}
|
||||
int pos=(x>=0);
|
||||
a=ui->ca_coeff_SB->value();
|
||||
if (x<0) {
|
||||
x=-x;
|
||||
}
|
||||
if (a>=0) {
|
||||
y=round(c9xexpou(x,a)*((ui->ca_ymax_SB->value()-ui->ca_ymid_SB->value())/100.0)+ui->ca_ymid_SB->value());
|
||||
} else {
|
||||
a=-a;
|
||||
x=100-x;
|
||||
y=round((100.0-c9xexpou(x,a))*((ui->ca_ymax_SB->value()-ui->ca_ymid_SB->value())/100.0)+ui->ca_ymid_SB->value());
|
||||
}
|
||||
switch (ui->ca_side_CB->currentIndex()) {
|
||||
case 0:
|
||||
model.curves[currentCurve].points[i].y=y;
|
||||
break;
|
||||
case 1:
|
||||
if (pos) {
|
||||
model.curves[currentCurve].points[i].y=y;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (!pos) {
|
||||
model.curves[currentCurve].points[i].y=y;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (apply) {
|
||||
model.curves[currentCurve].points[i].y = templates[index].function(x, ui->curveCoeff->value(), ui->yMin->value(), ui->yMid->value(), ui->yMax->value());
|
||||
}
|
||||
updateSettings();
|
||||
setCurrentCurve(currentCurve);
|
||||
drawCurve();
|
||||
}
|
||||
|
||||
updateCurve();
|
||||
updateCurvePoints();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
#if 0
|
||||
void ModelEdit::clearCurves(bool ask)
|
||||
{
|
||||
if (ask) {
|
||||
|
||||
@@ -8,6 +8,14 @@ namespace Ui {
|
||||
class Curves;
|
||||
}
|
||||
|
||||
typedef float (*curveFunction) (float x, float coeff, float yMin, float yMid, float yMax);
|
||||
|
||||
struct CurveCreatorTemplate {
|
||||
QString name;
|
||||
unsigned int flags;
|
||||
curveFunction function;
|
||||
};
|
||||
|
||||
class Curves : public ModelPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -30,9 +38,12 @@ class Curves : public ModelPanel
|
||||
void onNodeMoved(int x, int y);
|
||||
void onNodeFocus();
|
||||
void onNodeUnfocus();
|
||||
void on_curveType_currentIndexChanged();
|
||||
void on_curveApply_clicked();
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent(QResizeEvent *event);
|
||||
void addTemplate(QString name, unsigned int flags, curveFunction function);
|
||||
|
||||
private:
|
||||
Ui::Curves *ui;
|
||||
@@ -40,10 +51,13 @@ class Curves : public ModelPanel
|
||||
bool visibleCurves[C9X_MAX_CURVES];
|
||||
QSpinBox * spnx[C9X_MAX_POINTS];
|
||||
QSpinBox * spny[C9X_MAX_POINTS];
|
||||
QVector<CurveCreatorTemplate> templates;
|
||||
void setCurrentCurve(int index);
|
||||
void updateCurve();
|
||||
void updateCurveType();
|
||||
void updateCurvePoints();
|
||||
bool allowCurveType(int points, CurveData::CurveType type);
|
||||
void setPointY(int i, int x, int y);
|
||||
|
||||
};
|
||||
|
||||
|
||||
+344
-161
@@ -1,161 +1,344 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Curves</class>
|
||||
<widget class="QWidget" name="Curves">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>638</width>
|
||||
<height>587</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_80" columnstretch="0,0,0,0,0">
|
||||
<item row="0" column="0" rowspan="3">
|
||||
<layout class="QGridLayout" name="curvesLayout"/>
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="3">
|
||||
<layout class="QGridLayout" name="gridLayout_8" rowstretch="0,0,0" columnstretch="1,0">
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QComboBox" name="curvePoints"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="curveCustom">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Standard</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Custom</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="curveSmooth">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Lines</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Smooth</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="curveTypeLabel">
|
||||
<property name="text">
|
||||
<string>Curve type</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="curveNameLabel">
|
||||
<property name="text">
|
||||
<string>Curve name</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="curveName">
|
||||
<property name="maxLength">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGraphicsView" name="curvePreview">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>400</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="2" rowspan="3" colspan="2">
|
||||
<layout class="QGridLayout" name="pointsLayout">
|
||||
<property name="horizontalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="5">
|
||||
<spacer name="verticalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="4" rowspan="3">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Curves</class>
|
||||
<widget class="QWidget" name="Curves">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>718</width>
|
||||
<height>539</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="curvesLayout"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_1">
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGraphicsView" name="curvePreview">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>400</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="curveNameLabel">
|
||||
<property name="text">
|
||||
<string>Curve name</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,0">
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QComboBox" name="curvePoints"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="curveCustom">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Standard</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Custom</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="curveSmooth">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Lines</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Smooth</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="curveName">
|
||||
<property name="maxLength">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="curveTypeLabel">
|
||||
<property name="text">
|
||||
<string>Curve type</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="pointsLayout">
|
||||
<property name="horizontalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="curveCreator">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Curve Creator</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_76" rowstretch="0,0,0,0,0,0,0,0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="yMidLabel">
|
||||
<property name="text">
|
||||
<string>Y at X=0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="3">
|
||||
<widget class="QSpinBox" name="yMax">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="yMaxLabel">
|
||||
<property name="text">
|
||||
<string>Y at X=100</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="3">
|
||||
<widget class="QSpinBox" name="curveCoeff">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="curveSide">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Both</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>x>0</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>x<0</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="3">
|
||||
<widget class="QSpinBox" name="yMin">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="4">
|
||||
<widget class="QPushButton" name="curveApply">
|
||||
<property name="text">
|
||||
<string>Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="curveSideLabel">
|
||||
<property name="text">
|
||||
<string>Side</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="3">
|
||||
<widget class="QSpinBox" name="yMid">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="curveType"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="curveTypeLabel_2">
|
||||
<property name="text">
|
||||
<string>Curve type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="yMinLabel">
|
||||
<property name="text">
|
||||
<string>Y at X=-100</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="curveCoeffLabel">
|
||||
<property name="text">
|
||||
<string>Coefficient</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -54,11 +54,11 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
{
|
||||
QGridLayout * gridLayout = new QGridLayout(this);
|
||||
|
||||
int col = 1;
|
||||
addLabel(gridLayout, tr("Switch"), col++);
|
||||
addLabel(gridLayout, tr("Action"), col++);
|
||||
addLabel(gridLayout, tr("Parameters"), col++);
|
||||
addLabel(gridLayout, tr("Enable"), col++);
|
||||
addLabel(gridLayout, tr("Switch"), 1);
|
||||
addLabel(gridLayout, tr("Action"), 2);
|
||||
addLabel(gridLayout, tr("Parameters"), 3);
|
||||
addLabel(gridLayout, tr("Enable"), 4, true );
|
||||
addEmptyLabel(gridLayout, 5 );
|
||||
|
||||
lock = true;
|
||||
int num_fsw = GetEepromInterface()->getCapability(CustomFunctions);
|
||||
@@ -104,13 +104,15 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
label->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
label->setMouseTracking(true);
|
||||
label->setProperty("index", i);
|
||||
label->setText(tr("CF%1").arg(i+1));
|
||||
gridLayout->addWidget(label, i+1, 0);
|
||||
label->setText(tr("SF%1").arg(i+1));
|
||||
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
|
||||
connect(label, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(fsw_customContextMenuRequested(QPoint)));
|
||||
gridLayout->addWidget(label, i+1, 0);
|
||||
|
||||
// The switch
|
||||
fswtchSwtch[i] = new QComboBox(this);
|
||||
fswtchSwtch[i]->setProperty("index", i);
|
||||
fswtchSwtch[i]->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
|
||||
connect(fswtchSwtch[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
|
||||
gridLayout->addWidget(fswtchSwtch[i], i+1, 1);
|
||||
populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, POPULATE_ONOFF);
|
||||
@@ -161,6 +163,12 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
connect(fswtchParamArmT[i], SIGNAL(editTextChanged ( const QString)), this, SLOT(customFunctionEdited()));
|
||||
|
||||
#ifdef PHONON
|
||||
phononLock=false;
|
||||
clickObject = new Phonon::MediaObject(this);
|
||||
clickOutput = new Phonon::AudioOutput(Phonon::NoCategory, this);
|
||||
Phonon::createPath(clickObject, clickOutput);
|
||||
connect(clickObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(mediaPlayer_state(Phonon::State,Phonon::State)));
|
||||
|
||||
playBT[i] = new QPushButton(this);
|
||||
playBT[i]->setProperty("index", i);
|
||||
playBT[i]->setProperty("state", "play");
|
||||
@@ -178,11 +186,13 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
fswtchEnable[i] = new QCheckBox(this);
|
||||
fswtchEnable[i]->setProperty("index", i);
|
||||
fswtchEnable[i]->setText(tr("ON"));
|
||||
fswtchEnable[i]->setFixedWidth( 50 );
|
||||
repeatLayout->addWidget(fswtchEnable[i], i+1);
|
||||
fswtchEnable[i]->setChecked(model.funcSw[i].enabled);
|
||||
connect(fswtchEnable[i], SIGNAL(stateChanged(int)), this, SLOT(customFunctionEdited()));
|
||||
}
|
||||
|
||||
// Push rows upward
|
||||
addDoubleSpring(gridLayout, 5, num_fsw+1);
|
||||
lock = false;
|
||||
}
|
||||
|
||||
@@ -203,6 +213,7 @@ void CustomFunctionsPanel::mediaPlayer_state(Phonon::State newState, Phonon::Sta
|
||||
clickObject->clearQueue();
|
||||
clickObject->clear();
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(CustomFunctions); i++) {
|
||||
playBT[i]->setProperty("state", "play");
|
||||
playBT[i]->setObjectName(QString("play_%1").arg(i));
|
||||
playBT[i]->setIcon(CompanionIcon("play.png"));
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "expodialog.h"
|
||||
#include "ui_expodialog.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "helpers.h"
|
||||
|
||||
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, int stickMode) :
|
||||
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, int stickMode, char * inputName) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ExpoDialog),
|
||||
model(model),
|
||||
ed(expoData)
|
||||
ed(expoData),
|
||||
inputName(inputName)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QLabel * lb_fp[] = {ui->lb_FP0,ui->lb_FP1,ui->lb_FP2,ui->lb_FP3,ui->lb_FP4,ui->lb_FP5,ui->lb_FP6,ui->lb_FP7,ui->lb_FP8 };
|
||||
@@ -45,8 +45,6 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, i
|
||||
}
|
||||
|
||||
if (GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||
ui->sideLabel->hide();
|
||||
ui->sideCB->hide();
|
||||
ui->inputName->setMaxLength(4);
|
||||
populateSourceCB(ui->sourceCB, ed->srcRaw, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | POPULATE_TELEMETRY);
|
||||
ui->sourceCB->removeItem(0);
|
||||
@@ -76,7 +74,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, i
|
||||
}
|
||||
|
||||
ui->inputName->setValidator(new QRegExpValidator(rx, this));
|
||||
ui->inputName->setText(model.inputNames[ed->chn]);
|
||||
ui->inputName->setText(inputName);
|
||||
|
||||
ui->lineName->setValidator(new QRegExpValidator(rx, this));
|
||||
ui->lineName->setText(ed->name);
|
||||
@@ -93,6 +91,9 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, i
|
||||
for (int i=0; i<9; i++) {
|
||||
connect(cb_fp[i], SIGNAL(toggled(bool)), this, SLOT(valuesChanged()));
|
||||
}
|
||||
if (GetEepromInterface()->getCapability(VirtualInputs))
|
||||
connect(ui->inputName, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
@@ -137,7 +138,7 @@ void ExpoDialog::valuesChanged()
|
||||
ed->mode = ui->sideCB->currentIndex() + 1;
|
||||
|
||||
strcpy(ed->name, ui->lineName->text().toAscii().data());
|
||||
strcpy(model.inputNames[ed->chn], ui->inputName->text().toAscii().data());
|
||||
strcpy(inputName, ui->inputName->text().toAscii().data());
|
||||
|
||||
ed->phases=0;
|
||||
for (int i=8; i>=0 ; i--) {
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Ui {
|
||||
class ExpoDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, int stickMode);
|
||||
ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, int stickMode, char * inputName);
|
||||
~ExpoDialog();
|
||||
|
||||
protected:
|
||||
@@ -28,6 +28,7 @@ class ExpoDialog : public QDialog {
|
||||
Ui::ExpoDialog * ui;
|
||||
ModelData & model;
|
||||
ExpoData * ed;
|
||||
char * inputName;
|
||||
GVarGroup * gvGroup;
|
||||
CurveGroup * curveGroup;
|
||||
};
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="leftTrims_3" columnstretch="0,1" columnminimumwidth="80,0">
|
||||
<layout class="QGridLayout" name="leftTrims_3" columnstretch="0,1">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="trim1Label">
|
||||
<property name="text">
|
||||
@@ -299,7 +299,7 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="righTrims_2" columnstretch="0,1" columnminimumwidth="80,0">
|
||||
<layout class="QGridLayout" name="righTrims_2" columnstretch="0,1">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="trim4Label">
|
||||
<property name="text">
|
||||
@@ -423,6 +423,19 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -194,33 +194,29 @@ void FlightMode::update()
|
||||
|
||||
for (int i=0; i<gvCount; i++) {
|
||||
gvNames[i]->setText(model.gvars_names[i]);
|
||||
if (phase.gvars[i] < 1024) {
|
||||
gvValues[i]->setValue(phase.gvars[i]);
|
||||
gvValues[i]->setDisabled(false);
|
||||
}
|
||||
else {
|
||||
int idx = phase.gvars[i] - 1025;
|
||||
if (idx >= i) idx++;
|
||||
// TODO no!!!!
|
||||
PhaseData *phasegvar = &model.phaseData[idx];
|
||||
gvValues[i]->setValue(phasegvar->gvars[i]);
|
||||
gvValues[i]->setDisabled(true);
|
||||
gvValues[i]->setDisabled(false);
|
||||
int idx = phase.gvars[i];
|
||||
PhaseData *phasegvar = &phase;
|
||||
while (idx >= 1024) {
|
||||
idx -= 1025;
|
||||
phasegvar = &model.phaseData[idx];
|
||||
idx = phasegvar->gvars[i];
|
||||
gvValues[i]->setDisabled(true);
|
||||
}
|
||||
gvValues[i]->setValue(phasegvar->gvars[i]);
|
||||
}
|
||||
|
||||
for (int i=0; i<reCount; i++) {
|
||||
if (phase.rotaryEncoders[i] < 1024) {
|
||||
reValues[i]->setValue(phase.rotaryEncoders[i]);
|
||||
reValues[i]->setDisabled(false);
|
||||
}
|
||||
else {
|
||||
int idx = phase.rotaryEncoders[i] - 1025;
|
||||
if (idx >= i) idx++;
|
||||
// TODO no!!!!
|
||||
PhaseData *phasere = &model.phaseData[idx];
|
||||
reValues[i]->setValue(phasere->rotaryEncoders[i]);
|
||||
for (int i=0; i<reCount; i++) {
|
||||
reValues[i]->setDisabled(false);
|
||||
int idx = phase.rotaryEncoders[i];
|
||||
PhaseData *phasere = &phase;
|
||||
while (idx >= 1024) {
|
||||
idx -= 1025;
|
||||
phasere = &model.phaseData[idx];
|
||||
idx = phasere->rotaryEncoders[i];
|
||||
reValues[i]->setDisabled(true);
|
||||
}
|
||||
reValues[i]->setValue(phasere->rotaryEncoders[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,21 +307,12 @@ void FlightMode::phaseGVUse_currentIndexChanged(int index)
|
||||
QComboBox *comboBox = qobject_cast<QComboBox*>(sender());
|
||||
int gvar = comboBox->property("index").toInt();
|
||||
if (index == 0) {
|
||||
int value = phase.gvars[gvar];
|
||||
if (value>1024) {
|
||||
value=0;
|
||||
}
|
||||
gvValues[gvar]->setValue(value);
|
||||
gvValues[gvar]->setEnabled(true);
|
||||
phase.gvars[gvar]=value;
|
||||
phase.gvars[gvar]=0;
|
||||
}
|
||||
else {
|
||||
phase.gvars[gvar] = 1024+index;
|
||||
// TOTO it's wrong!!!
|
||||
int value = model.phaseData[index + (index>phaseIdx ? 0 :-1)].gvars[gvar];
|
||||
gvValues[gvar]->setValue(value);
|
||||
gvValues[gvar]->setDisabled(true);
|
||||
}
|
||||
update();
|
||||
emit modified();
|
||||
lock = false;
|
||||
}
|
||||
@@ -348,21 +335,12 @@ void FlightMode::phaseREUse_currentIndexChanged(int index)
|
||||
QComboBox *comboBox = qobject_cast<QComboBox*>(sender());
|
||||
int re = comboBox->property("index").toInt();
|
||||
if (index == 0) {
|
||||
// TODO no!!!
|
||||
int value = phase.rotaryEncoders[re];
|
||||
if (value > 1024) {
|
||||
value = 0;
|
||||
}
|
||||
reValues[re]->setValue(value);
|
||||
reValues[re]->setEnabled(true);
|
||||
phase.rotaryEncoders[re] = value;
|
||||
phase.rotaryEncoders[re] = 0;
|
||||
}
|
||||
else {
|
||||
phase.rotaryEncoders[re] = 1024 + index;
|
||||
int value = model.phaseData[index + (index>phaseIdx ? 0 :-1)].rotaryEncoders[re];
|
||||
reValues[re]->setValue(value);
|
||||
reValues[re]->setDisabled(true) ;
|
||||
phase.rotaryEncoders[re] = 1024 + index; ;
|
||||
}
|
||||
update();
|
||||
lock = false;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -98,12 +98,11 @@ void InputsPanel::update()
|
||||
str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString();
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (md->mode) {
|
||||
case (1): str += " <-"; break;
|
||||
case (2): str += " ->"; break;
|
||||
default: str += " "; break;
|
||||
};
|
||||
|
||||
switch (md->mode) {
|
||||
case (1): str += " <-"; break;
|
||||
case (2): str += " ->"; break;
|
||||
default: str += " "; break;
|
||||
}
|
||||
|
||||
str += " " + tr("Weight(%1)").arg(getGVarString(md->weight));
|
||||
@@ -169,12 +168,18 @@ void InputsPanel::gm_openExpo(int index)
|
||||
if(index<0 || index>=C9X_MAX_EXPOS) return;
|
||||
|
||||
ExpoData mixd(model.expoData[index]);
|
||||
char inputName[4+1];
|
||||
emit modified();
|
||||
update();
|
||||
|
||||
if (GetEepromInterface()->getCapability(VirtualInputs))
|
||||
strcpy(inputName, model.inputNames[mixd.chn]);
|
||||
|
||||
ExpoDialog *g = new ExpoDialog(this, model, &mixd, generalSettings.stickMode);
|
||||
ExpoDialog *g = new ExpoDialog(this, model, &mixd, generalSettings.stickMode, inputName);
|
||||
if (g->exec()) {
|
||||
model.expoData[index] = mixd;
|
||||
if (GetEepromInterface()->getCapability(VirtualInputs))
|
||||
strcpy(model.inputNames[mixd.chn], inputName);
|
||||
emit modified();
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -28,12 +28,10 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model):
|
||||
// The label
|
||||
QLabel * label = new QLabel(this);
|
||||
label->setProperty("index", i);
|
||||
if (i < 9)
|
||||
label->setText(tr("LS%1").arg(i+1));
|
||||
else
|
||||
label->setText(tr("LS%1").arg(QChar('A'+i-9)));
|
||||
label->setText(tr("L%1").arg(i+1));
|
||||
label->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
label->setMouseTracking(true);
|
||||
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
|
||||
connect(label, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(csw_customContextMenuRequested(QPoint)));
|
||||
gridLayout->addWidget(label, i+1, 0);
|
||||
|
||||
@@ -60,10 +58,11 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model):
|
||||
cswitchValue[i]->setVisible(false);
|
||||
|
||||
// V2
|
||||
QHBoxLayout *v2Layout = new QHBoxLayout();
|
||||
cswitchSource2[i] = new QComboBox(this);
|
||||
cswitchSource2[i]->setProperty("index", i);
|
||||
connect(cswitchSource2[i], SIGNAL(currentIndexChanged(int)), this, SLOT(v2Edited(int)));
|
||||
gridLayout->addWidget(cswitchSource2[i], i+1, 3);
|
||||
v2Layout->addWidget(cswitchSource2[i]);
|
||||
cswitchSource2[i]->setVisible(false);
|
||||
cswitchOffset[i] = new QDoubleSpinBox(this);
|
||||
cswitchOffset[i]->setProperty("index",i);
|
||||
@@ -72,8 +71,18 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model):
|
||||
cswitchOffset[i]->setAccelerated(true);
|
||||
cswitchOffset[i]->setDecimals(0);
|
||||
connect(cswitchOffset[i], SIGNAL(editingFinished()), this, SLOT(edited()));
|
||||
gridLayout->addWidget(cswitchOffset[i], i+1, 3);
|
||||
cswitchOffset[i]->setVisible(false);
|
||||
v2Layout->addWidget(cswitchOffset[i]);
|
||||
cswitchOffset2[i] = new QDoubleSpinBox(this);
|
||||
cswitchOffset2[i]->setProperty("index",i);
|
||||
cswitchOffset2[i]->setMaximum(125);
|
||||
cswitchOffset2[i]->setMinimum(-125);
|
||||
cswitchOffset2[i]->setAccelerated(true);
|
||||
cswitchOffset2[i]->setDecimals(0);
|
||||
connect(cswitchOffset2[i], SIGNAL(editingFinished()), this, SLOT(edited()));
|
||||
cswitchOffset2[i]->setVisible(false);
|
||||
v2Layout->addWidget(cswitchOffset2[i]);
|
||||
gridLayout->addLayout(v2Layout, i+1, 3);
|
||||
|
||||
// AND
|
||||
cswitchAnd[i] = new QComboBox(this);
|
||||
@@ -105,7 +114,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model):
|
||||
gridLayout->addWidget(cswitchDelay[i], i+1, 6);
|
||||
}
|
||||
}
|
||||
|
||||
// Push rows upward
|
||||
addVSpring(gridLayout,0,GetEepromInterface()->getCapability(LogicalSwitches)+1);
|
||||
lock = false;
|
||||
}
|
||||
|
||||
@@ -205,19 +215,19 @@ void LogicalSwitchesPanel::edited()
|
||||
switch (model.customSw[i].getFunctionFamily())
|
||||
{
|
||||
case LS_FAMILY_VOFS:
|
||||
{
|
||||
source = RawSource(model.customSw[i].val1, &model);
|
||||
RawSourceRange range = source.getRange();
|
||||
if (model.customSw[i].func == LS_FN_DPOS || model.customSw[i].func == LS_FN_DAPOS) {
|
||||
model.customSw[i].val2 = (cswitchOffset[i]->value() / range.step);
|
||||
cswitchOffset[i]->setValue(model.customSw[i].val2*range.step);
|
||||
}
|
||||
else {
|
||||
model.customSw[i].val2 = ((cswitchOffset[i]->value()-range.offset)/range.step)/* TODO - source.getRawOffset(model)*/;
|
||||
cswitchOffset[i]->setValue((model.customSw[i].val2 /* + TODO source.getRawOffset(model)*/)*range.step+range.offset);
|
||||
}
|
||||
{
|
||||
source = RawSource(model.customSw[i].val1, &model);
|
||||
RawSourceRange range = source.getRange();
|
||||
if (model.customSw[i].func == LS_FN_DPOS || model.customSw[i].func == LS_FN_DAPOS) {
|
||||
model.customSw[i].val2 = (cswitchOffset[i]->value() / range.step);
|
||||
cswitchOffset[i]->setValue(model.customSw[i].val2*range.step);
|
||||
}
|
||||
else {
|
||||
model.customSw[i].val2 = ((cswitchOffset[i]->value()-range.offset)/range.step)/* TODO - source.getRawOffset(model)*/;
|
||||
cswitchOffset[i]->setValue((model.customSw[i].val2 /* + TODO source.getRawOffset(model)*/)*range.step+range.offset);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LS_FAMILY_TIMER:
|
||||
model.customSw[i].val1 = TimToVal(cswitchValue[i]->value());
|
||||
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
|
||||
@@ -225,8 +235,14 @@ void LogicalSwitchesPanel::edited()
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2);
|
||||
break;
|
||||
case LS_FAMILY_STAY:
|
||||
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, true);
|
||||
if (sender() == cswitchOffset[i]) {
|
||||
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, true);
|
||||
}
|
||||
else {
|
||||
model.customSw[i].val3 = TimToVal(cswitchOffset2[i]->value()) - model.customSw[i].val2;
|
||||
}
|
||||
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -243,92 +259,98 @@ void LogicalSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, bool
|
||||
sb->setMinimum(allowZero ? 0.0 : 0.1);
|
||||
sb->setMaximum(175);
|
||||
float value = ValToTim(timer);
|
||||
if (value>60)
|
||||
if (value>=60)
|
||||
sb->setSingleStep(1);
|
||||
else if (value>2)
|
||||
else if (value>=2)
|
||||
sb->setSingleStep(0.5);
|
||||
else
|
||||
sb->setSingleStep(0.1);
|
||||
sb->setValue(value);
|
||||
}
|
||||
|
||||
#define SOURCE1_VISIBLE 0x1
|
||||
#define SOURCE2_VISIBLE 0x2
|
||||
#define VALUE1_VISIBLE 0x4
|
||||
#define VALUE2_VISIBLE 0x8
|
||||
#define VALUE3_VISIBLE 0x10
|
||||
|
||||
void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
{
|
||||
lock = true;
|
||||
|
||||
RawSource source = RawSource(model.customSw[i].val1, &model);
|
||||
RawSourceRange range = source.getRange();
|
||||
unsigned int mask = 0;
|
||||
RawSource source = RawSource(model.customSw[i].val1, &model);
|
||||
RawSourceRange range = source.getRange();
|
||||
|
||||
switch (model.customSw[i].getFunctionFamily())
|
||||
{
|
||||
case LS_FAMILY_VOFS:
|
||||
cswitchSource1[i]->setVisible(true);
|
||||
cswitchSource2[i]->setVisible(false);
|
||||
cswitchValue[i]->setVisible(false);
|
||||
cswitchOffset[i]->setVisible(true);
|
||||
populateSourceCB(cswitchSource1[i], source, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
cswitchOffset[i]->setDecimals(range.decimals);
|
||||
cswitchOffset[i]->setSingleStep(range.step);
|
||||
if (model.customSw[i].func == LS_FN_DPOS || model.customSw[i].func == LS_FN_DAPOS) {
|
||||
cswitchOffset[i]->setMinimum(range.step*-127);
|
||||
cswitchOffset[i]->setMaximum(range.step*127);
|
||||
cswitchOffset[i]->setValue(range.step*model.customSw[i].val2);
|
||||
}
|
||||
else {
|
||||
cswitchOffset[i]->setMinimum(range.min);
|
||||
cswitchOffset[i]->setMaximum(range.max);
|
||||
cswitchOffset[i]->setValue(range.step*(model.customSw[i].val2/* TODO+source.getRawOffset(model)*/)+range.offset);
|
||||
}
|
||||
break;
|
||||
case LS_FAMILY_VBOOL:
|
||||
case LS_FAMILY_STICKY:
|
||||
cswitchSource1[i]->setVisible(true);
|
||||
cswitchSource2[i]->setVisible(true);
|
||||
cswitchValue[i]->setVisible(false);
|
||||
cswitchOffset[i]->setVisible(false);
|
||||
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1));
|
||||
populateSwitchCB(cswitchSource2[i], RawSwitch(model.customSw[i].val2));
|
||||
break;
|
||||
case LS_FAMILY_STAY:
|
||||
cswitchSource1[i]->setVisible(true);
|
||||
cswitchSource2[i]->setVisible(false);
|
||||
cswitchValue[i]->setVisible(false);
|
||||
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1));
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, true);
|
||||
break;
|
||||
case LS_FAMILY_VCOMP:
|
||||
cswitchSource1[i]->setVisible(true);
|
||||
cswitchSource2[i]->setVisible(true);
|
||||
cswitchValue[i]->setVisible(false);
|
||||
cswitchOffset[i]->setVisible(false);
|
||||
populateSourceCB(cswitchSource1[i], RawSource(model.customSw[i].val1), model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
populateSourceCB(cswitchSource2[i], RawSource(model.customSw[i].val2), model, POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
break;
|
||||
case LS_FAMILY_TIMER:
|
||||
cswitchSource1[i]->setVisible(false);
|
||||
cswitchSource2[i]->setVisible(false);
|
||||
updateTimerParam(cswitchValue[i], model.customSw[i].val1);
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2);
|
||||
break;
|
||||
}
|
||||
switch (model.customSw[i].getFunctionFamily())
|
||||
{
|
||||
case LS_FAMILY_VOFS:
|
||||
mask |= SOURCE1_VISIBLE | VALUE2_VISIBLE;
|
||||
populateSourceCB(cswitchSource1[i], source, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
cswitchOffset[i]->setDecimals(range.decimals);
|
||||
cswitchOffset[i]->setSingleStep(range.step);
|
||||
if (model.customSw[i].func == LS_FN_DPOS || model.customSw[i].func == LS_FN_DAPOS) {
|
||||
cswitchOffset[i]->setMinimum(range.step*-127);
|
||||
cswitchOffset[i]->setMaximum(range.step*127);
|
||||
cswitchOffset[i]->setValue(range.step*model.customSw[i].val2);
|
||||
}
|
||||
else {
|
||||
cswitchOffset[i]->setMinimum(range.min);
|
||||
cswitchOffset[i]->setMaximum(range.max);
|
||||
cswitchOffset[i]->setValue(range.step*(model.customSw[i].val2/* TODO+source.getRawOffset(model)*/)+range.offset);
|
||||
}
|
||||
break;
|
||||
case LS_FAMILY_VBOOL:
|
||||
case LS_FAMILY_STICKY:
|
||||
mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE;
|
||||
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1));
|
||||
populateSwitchCB(cswitchSource2[i], RawSwitch(model.customSw[i].val2));
|
||||
break;
|
||||
case LS_FAMILY_STAY:
|
||||
mask |= SOURCE1_VISIBLE | VALUE2_VISIBLE | VALUE3_VISIBLE;
|
||||
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1));
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, true);
|
||||
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, true);
|
||||
break;
|
||||
case LS_FAMILY_VCOMP:
|
||||
mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE;
|
||||
populateSourceCB(cswitchSource1[i], RawSource(model.customSw[i].val1), model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
populateSourceCB(cswitchSource2[i], RawSource(model.customSw[i].val2), model, POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
break;
|
||||
case LS_FAMILY_TIMER:
|
||||
updateTimerParam(cswitchValue[i], model.customSw[i].val1);
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2);
|
||||
break;
|
||||
}
|
||||
|
||||
lock = false;
|
||||
cswitchSource1[i]->setVisible(mask & SOURCE1_VISIBLE);
|
||||
cswitchSource2[i]->setVisible(mask & SOURCE2_VISIBLE);
|
||||
cswitchValue[i]->setVisible(mask & VALUE1_VISIBLE);
|
||||
cswitchOffset[i]->setVisible(mask & VALUE2_VISIBLE);
|
||||
cswitchOffset2[i]->setVisible(mask & VALUE3_VISIBLE);
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void LogicalSwitchesPanel::updateLine(int i)
|
||||
{
|
||||
lock = true;
|
||||
populateCSWCB(csw[i], model.customSw[i].func);
|
||||
lock = true;
|
||||
setSwitchWidgetVisibility(i);
|
||||
lock = true;
|
||||
populateAndSwitchCB(cswitchAnd[i], RawSwitch(model.customSw[i].andsw));
|
||||
if (GetEepromInterface()->getCapability(LogicalSwitchesExt)) {
|
||||
cswitchDuration[i]->setValue(model.customSw[i].duration/10.0);
|
||||
cswitchDelay[i]->setValue(model.customSw[i].delay/10.0);
|
||||
}
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void LogicalSwitchesPanel::update()
|
||||
{
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) {
|
||||
lock = true;
|
||||
populateCSWCB(csw[i], model.customSw[i].func);
|
||||
lock = false;
|
||||
setSwitchWidgetVisibility(i);
|
||||
lock = true;
|
||||
populateAndSwitchCB(cswitchAnd[i], RawSwitch(model.customSw[i].andsw));
|
||||
if (GetEepromInterface()->getCapability(LogicalSwitchesExt)) {
|
||||
cswitchDuration[i]->setValue(model.customSw[i].duration/10.0);
|
||||
cswitchDelay[i]->setValue(model.customSw[i].delay/10.0);
|
||||
}
|
||||
lock = false;
|
||||
updateLine(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,36 +360,27 @@ void LogicalSwitchesPanel::cswPaste()
|
||||
const QMimeData *mimeData = clipboard->mimeData();
|
||||
if (mimeData->hasFormat("application/x-companion-csw")) {
|
||||
QByteArray cswData = mimeData->data("application/x-companion-csw");
|
||||
|
||||
LogicalSwitchData *csw = &model.customSw[selectedSwitch];
|
||||
memcpy(csw, cswData.mid(0, sizeof(LogicalSwitchData)).constData(), sizeof(LogicalSwitchData));
|
||||
emit modified();
|
||||
updateSelectedSwitch();
|
||||
updateLine(selectedSwitch);
|
||||
}
|
||||
}
|
||||
|
||||
void LogicalSwitchesPanel::cswDelete()
|
||||
{
|
||||
model.customSw[selectedSwitch].clear();
|
||||
emit modified();
|
||||
updateSelectedSwitch();
|
||||
model.customSw[selectedSwitch].clear();
|
||||
emit modified();
|
||||
updateLine(selectedSwitch);
|
||||
}
|
||||
|
||||
void LogicalSwitchesPanel::cswCopy()
|
||||
{
|
||||
QByteArray cswData;
|
||||
cswData.append((char*)&model.customSw[selectedSwitch],sizeof(LogicalSwitchData));
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
mimeData->setData("application/x-companion-csw", cswData);
|
||||
QApplication::clipboard()->setMimeData(mimeData,QClipboard::Clipboard);
|
||||
}
|
||||
|
||||
void LogicalSwitchesPanel::updateSelectedSwitch()
|
||||
{
|
||||
lock = true;
|
||||
populateCSWCB(csw[selectedSwitch], model.customSw[selectedSwitch].func);
|
||||
setSwitchWidgetVisibility(selectedSwitch);
|
||||
lock = false;
|
||||
QByteArray cswData;
|
||||
cswData.append((char*)&model.customSw[selectedSwitch],sizeof(LogicalSwitchData));
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
mimeData->setData("application/x-companion-csw", cswData);
|
||||
QApplication::clipboard()->setMimeData(mimeData,QClipboard::Clipboard);
|
||||
}
|
||||
|
||||
void LogicalSwitchesPanel::cswCut()
|
||||
|
||||
@@ -32,6 +32,7 @@ class LogicalSwitchesPanel : public ModelPanel
|
||||
QComboBox * csw[C9X_NUM_CSW];
|
||||
QDoubleSpinBox * cswitchValue[C9X_NUM_CSW];
|
||||
QDoubleSpinBox * cswitchOffset[C9X_NUM_CSW];
|
||||
QDoubleSpinBox * cswitchOffset2[C9X_NUM_CSW];
|
||||
QComboBox * cswitchAnd[C9X_NUM_CSW];
|
||||
QDoubleSpinBox * cswitchDuration[C9X_NUM_CSW];
|
||||
QDoubleSpinBox * cswitchDelay[C9X_NUM_CSW];
|
||||
@@ -40,8 +41,7 @@ class LogicalSwitchesPanel : public ModelPanel
|
||||
void setSwitchWidgetVisibility(int i);
|
||||
int selectedSwitch;
|
||||
|
||||
void updateSelectedSwitch();
|
||||
void updateV2(int index);
|
||||
void updateLine(int index);
|
||||
void updateTimerParam(QDoubleSpinBox *sb, int timer, bool allowZero=false);
|
||||
|
||||
};
|
||||
|
||||
@@ -27,12 +27,6 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, i
|
||||
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, 100, -limit, limit);
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, 0, -limit, limit);
|
||||
|
||||
if (GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||
ui->trimLabel->hide();
|
||||
ui->trimCB->hide();
|
||||
}
|
||||
|
||||
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve);
|
||||
|
||||
ui->MixDR_CB->setChecked(md->noExpo==0);
|
||||
@@ -41,10 +35,13 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, i
|
||||
ui->label_MixDR->hide();
|
||||
}
|
||||
|
||||
ui->trimCB->addItem(tr("Rud"), 1);
|
||||
ui->trimCB->addItem(tr("Ele"), 2);
|
||||
ui->trimCB->addItem(tr("Thr"), 3);
|
||||
ui->trimCB->addItem(tr("Ail"), 4);
|
||||
if (!GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||
ui->trimCB->addItem(tr("Rud"));
|
||||
ui->trimCB->addItem(tr("Ele"));
|
||||
ui->trimCB->addItem(tr("Thr"));
|
||||
ui->trimCB->addItem(tr("Ail"));
|
||||
}
|
||||
|
||||
ui->trimCB->setCurrentIndex(1 - md->carryTrim);
|
||||
|
||||
int namelength = GetEepromInterface()->getCapability(HasMixerNames);
|
||||
|
||||
@@ -43,6 +43,29 @@ MixesPanel::~MixesPanel()
|
||||
{
|
||||
}
|
||||
|
||||
QString MixesPanel::getChannelLabel(int curDest)
|
||||
{
|
||||
QString str;
|
||||
int outputs = GetEepromInterface()->getCapability(Outputs);
|
||||
if (curDest > outputs) {
|
||||
str = QObject::tr("X%1 ").arg(curDest-outputs);
|
||||
}
|
||||
else {
|
||||
str = QObject::tr("CH%1").arg(curDest);
|
||||
str.append(" ");
|
||||
str = str.left(4);
|
||||
if (GetEepromInterface()->getCapability(HasChNames)) {
|
||||
QString name = model.limitData[curDest-1].name;
|
||||
if (!name.isEmpty()) {
|
||||
name = QString("(") + name + QString(")");
|
||||
}
|
||||
name.append(" ");
|
||||
str += name.left(8);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
void MixesPanel::update()
|
||||
{
|
||||
// curDest -> destination channel4
|
||||
@@ -52,26 +75,13 @@ void MixesPanel::update()
|
||||
unsigned int curDest = 0;
|
||||
int i;
|
||||
unsigned int outputs = GetEepromInterface()->getCapability(Outputs);
|
||||
int showNames = false; // TODO in a menu ui->showNames_Ckb->isChecked();
|
||||
for (i=0; i<GetEepromInterface()->getCapability(Mixes); i++) {
|
||||
MixData *md = &model.mixData[i];
|
||||
if ((md->destCh==0) || (md->destCh>outputs+(unsigned int)GetEepromInterface()->getCapability(ExtraChannels))) continue;
|
||||
QString str = "";
|
||||
while (curDest<(md->destCh-1)) {
|
||||
while (curDest < md->destCh-1) {
|
||||
curDest++;
|
||||
if (curDest > outputs) {
|
||||
str = tr("X%1 ").arg(curDest-outputs);
|
||||
}
|
||||
else {
|
||||
str = tr("CH%1%2").arg(curDest/10).arg(curDest%10);
|
||||
if (GetEepromInterface()->getCapability(HasChNames) && showNames) {
|
||||
QString name=model.limitData[curDest-1].name;
|
||||
if (!name.isEmpty()) {
|
||||
name.append(" ");
|
||||
str=name.left(6);
|
||||
}
|
||||
}
|
||||
}
|
||||
str = getChannelLabel(curDest);
|
||||
qba.clear();
|
||||
qba.append((quint8)-curDest);
|
||||
QListWidgetItem *itm = new QListWidgetItem(str);
|
||||
@@ -79,23 +89,12 @@ void MixesPanel::update()
|
||||
MixerlistWidget->addItem(itm);
|
||||
}
|
||||
|
||||
if (md->destCh > outputs) {
|
||||
str = tr("X%1 ").arg(md->destCh-outputs);
|
||||
}
|
||||
else {
|
||||
str = tr("CH%1%2").arg(md->destCh/10).arg(md->destCh%10);
|
||||
str.append(" ");
|
||||
if (GetEepromInterface()->getCapability(HasChNames) && showNames) {
|
||||
QString name=model.limitData[md->destCh-1].name;
|
||||
if (!name.isEmpty()) {
|
||||
name.append(" ");
|
||||
str=name.left(6);
|
||||
}
|
||||
}
|
||||
}
|
||||
str = getChannelLabel(md->destCh);
|
||||
|
||||
if (curDest != md->destCh) {
|
||||
curDest = md->destCh;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
str.fill(' ');
|
||||
}
|
||||
|
||||
@@ -116,13 +115,11 @@ void MixesPanel::update()
|
||||
str += " " + tr("Switch(%1)").arg(md->swtch.toString());
|
||||
}
|
||||
|
||||
if (!GetEepromInterface()->getCapability(VirtualInputs)) {
|
||||
if (md->carryTrim>0) {
|
||||
str += " " + tr("No Trim");
|
||||
}
|
||||
else if (md->carryTrim<0) {
|
||||
str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString();
|
||||
}
|
||||
if (md->carryTrim>0) {
|
||||
str += " " + tr("No Trim");
|
||||
}
|
||||
else if (md->carryTrim<0) {
|
||||
str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString();
|
||||
}
|
||||
|
||||
if (md->noExpo) str += " " + tr("No DR/Expo");
|
||||
@@ -154,21 +151,7 @@ void MixesPanel::update()
|
||||
|
||||
while(curDest<outputs+GetEepromInterface()->getCapability(ExtraChannels)) {
|
||||
curDest++;
|
||||
QString str;
|
||||
|
||||
if (curDest > outputs) {
|
||||
str = tr("X%1 ").arg(curDest-outputs);
|
||||
}
|
||||
else {
|
||||
str = tr("CH%1%2").arg(curDest/10).arg(curDest%10);
|
||||
if (GetEepromInterface()->getCapability(HasChNames) && showNames) {
|
||||
QString name=model.limitData[curDest-1].name;
|
||||
if (!name.isEmpty()) {
|
||||
name.append(" ");
|
||||
str=name.left(6);
|
||||
}
|
||||
}
|
||||
}
|
||||
QString str = getChannelLabel(curDest);
|
||||
qba.clear();
|
||||
qba.append((quint8)-curDest);
|
||||
QListWidgetItem *itm = new QListWidgetItem(str);
|
||||
|
||||
@@ -50,7 +50,7 @@ class MixesPanel : public ModelPanel
|
||||
void mixersDeleteList(QList<int> list);
|
||||
QList<int> createMixListFromSelected();
|
||||
void setSelectedByMixList(QList<int> list);
|
||||
|
||||
QString getChannelLabel(int curDest);
|
||||
};
|
||||
|
||||
#endif // MIXES_H
|
||||
|
||||
@@ -22,6 +22,7 @@ ModelEdit::ModelEdit(RadioData & radioData, int modelId, bool openWizard, bool i
|
||||
generalSettings(radioData.generalSettings)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("edit.png"));
|
||||
restoreGeometry(g.modelEditGeo());
|
||||
ui->pushButton->setIcon(CompanionIcon("simulate.png"));
|
||||
addTab(new Setup(this, model), tr("Setup"));
|
||||
@@ -32,7 +33,7 @@ ModelEdit::ModelEdit(RadioData & radioData, int modelId, bool openWizard, bool i
|
||||
addTab(new Channels(this, model), tr("Channels"));
|
||||
addTab(new LogicalSwitchesPanel(this, model), tr("Logical Switches"));
|
||||
if (GetEepromInterface()->getCapability(CustomFunctions))
|
||||
addTab(new CustomFunctionsPanel(this, model, radioData.generalSettings), tr("Switch Assignment"));
|
||||
addTab(new CustomFunctionsPanel(this, model, radioData.generalSettings), tr("Special Functions"));
|
||||
addTab(new Curves(this, model), tr("Curves"));
|
||||
if (GetEepromInterface()->getCapability(Telemetry) & TM_HASTELEMETRY)
|
||||
addTab(new TelemetryPanel(this, model), tr("Telemetry"));
|
||||
|
||||
@@ -16,15 +16,42 @@ void ModelPanel::update()
|
||||
{
|
||||
}
|
||||
|
||||
void ModelPanel::addLabel(QGridLayout * gridLayout, QString text, int col)
|
||||
void ModelPanel::addLabel(QGridLayout * gridLayout, QString text, int col, bool minimize)
|
||||
{
|
||||
QLabel *label = new QLabel(this);
|
||||
label->setFrameShape(QFrame::Panel);
|
||||
label->setFrameShadow(QFrame::Raised);
|
||||
label->setMidLineWidth(0);
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
label->setMargin(3);
|
||||
label->setMargin(5);
|
||||
label->setText(text);
|
||||
if (!minimize)
|
||||
label->setMinimumWidth(100);
|
||||
gridLayout->addWidget(label, 0, col, 1, 1);
|
||||
}
|
||||
|
||||
void ModelPanel::addEmptyLabel(QGridLayout * gridLayout, int col)
|
||||
{
|
||||
QLabel *label = new QLabel(this);
|
||||
label->setText("");
|
||||
gridLayout->addWidget(label, 0, col, 1, 1);
|
||||
}
|
||||
|
||||
void ModelPanel::addHSpring(QGridLayout * gridLayout, int col, int row)
|
||||
{
|
||||
QSpacerItem * spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
||||
gridLayout->addItem(spacer, row, col);
|
||||
}
|
||||
|
||||
void ModelPanel::addVSpring(QGridLayout * gridLayout, int col, int row)
|
||||
{
|
||||
QSpacerItem * spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
gridLayout->addItem(spacer, row, col);
|
||||
}
|
||||
|
||||
void ModelPanel::addDoubleSpring(QGridLayout * gridLayout, int col, int row)
|
||||
{
|
||||
QSpacerItem * spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding );
|
||||
gridLayout->addItem(spacer, row, col);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,11 @@ class ModelPanel : public QWidget
|
||||
protected:
|
||||
ModelData & model;
|
||||
bool lock;
|
||||
void addLabel(QGridLayout * gridLayout, QString text, int col);
|
||||
|
||||
void addLabel(QGridLayout * gridLayout, QString text, int col, bool mimimize=false);
|
||||
void addEmptyLabel(QGridLayout * gridLayout, int col);
|
||||
void addHSpring(QGridLayout *, int col, int row);
|
||||
void addVSpring(QGridLayout *, int col, int row);
|
||||
void addDoubleSpring(QGridLayout *, int col, int row);
|
||||
};
|
||||
|
||||
#endif // CHANNELS_H
|
||||
|
||||
@@ -112,11 +112,15 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
|
||||
else {
|
||||
ui->label_trainerMode->hide();
|
||||
ui->trainerMode->hide();
|
||||
if (moduleIdx == 0)
|
||||
label = tr("Internal Radio System");
|
||||
else
|
||||
label = tr("External Radio Module");
|
||||
|
||||
if (GetEepromInterface()->getCapability(NumModules) > 1) {
|
||||
if (moduleIdx == 0)
|
||||
label = tr("Internal Radio System");
|
||||
else
|
||||
label = tr("External Radio Module");
|
||||
}
|
||||
else {
|
||||
label = tr("Radio System");
|
||||
}
|
||||
}
|
||||
ui->label_module->setText(label);
|
||||
|
||||
@@ -351,14 +355,13 @@ Setup::Setup(QWidget *parent, ModelData & model):
|
||||
QString path = g.profile[g.id()].sdPath();
|
||||
path.append("/BMP/");
|
||||
QDir qd(path);
|
||||
int vml = GetEepromInterface()->getCapability(VoicesMaxLength)+4;
|
||||
if (qd.exists()) {
|
||||
QStringList filters;
|
||||
filters << "*.bmp" << "*.bmp";
|
||||
foreach ( QString file, qd.entryList(filters, QDir::Files) ) {
|
||||
QFileInfo fi(file);
|
||||
QString temp = fi.completeBaseName();
|
||||
if (!items.contains(temp) && temp.length() <= vml) {
|
||||
if (!items.contains(temp) && temp.length() <= 10+4) {
|
||||
items.append(temp);
|
||||
}
|
||||
}
|
||||
@@ -500,8 +503,10 @@ void Setup::on_trimIncrement_currentIndexChanged(int index)
|
||||
|
||||
void Setup::on_throttleSource_currentIndexChanged(int index)
|
||||
{
|
||||
model.thrTraceSrc = index;
|
||||
emit modified();
|
||||
if (!lock) {
|
||||
model.thrTraceSrc = ui->throttleSource->itemData(index).toInt();
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void Setup::on_name_editingFinished()
|
||||
@@ -514,8 +519,8 @@ void Setup::on_name_editingFinished()
|
||||
void Setup::on_image_currentIndexChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
strncpy(model.bitmap, ui->image->currentText().toAscii(), GetEepromInterface()->getCapability(VoicesMaxLength));
|
||||
QString path=g.profile[g.id()].sdPath();
|
||||
strncpy(model.bitmap, ui->image->currentText().toAscii(), 10);
|
||||
QString path = g.profile[g.id()].sdPath();
|
||||
path.append("/BMP/");
|
||||
QDir qd(path);
|
||||
if (qd.exists()) {
|
||||
@@ -530,7 +535,7 @@ void Setup::on_image_currentIndexChanged(int index)
|
||||
image.load(fileName);
|
||||
}
|
||||
if (!image.isNull()) {
|
||||
ui->imagePreview->setPixmap(QPixmap::fromImage(image.scaled( 64,32)));;
|
||||
ui->imagePreview->setPixmap(QPixmap::fromImage(image.scaled(64, 32)));;
|
||||
}
|
||||
else {
|
||||
ui->imagePreview->clear();
|
||||
@@ -543,12 +548,45 @@ void Setup::on_image_currentIndexChanged(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void Setup::populateThrottleSourceCB()
|
||||
{
|
||||
const QString sources9x[] = { QObject::tr("THR"), QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3")};
|
||||
const QString sourcesTaranis[] = { QObject::tr("THR"), QObject::tr("S1"), QObject::tr("S2"), QObject::tr("S3"), QObject::tr("LS"), QObject::tr("RS")};
|
||||
|
||||
unsigned int i;
|
||||
|
||||
lock = true;
|
||||
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
for (i=0; i<6; i++) {
|
||||
ui->throttleSource->addItem(sourcesTaranis[i], i);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i=0; i<4; i++) {
|
||||
ui->throttleSource->addItem(sources9x[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
if (model.thrTraceSrc < i)
|
||||
ui->throttleSource->setCurrentIndex(model.thrTraceSrc);
|
||||
|
||||
int channels = (IS_ARM(GetEepromInterface()->getBoard()) ? 32 : 16);
|
||||
for (int i=0; i<channels; i++) {
|
||||
ui->throttleSource->addItem(QObject::tr("CH%1").arg(i+1, 2, 10, QChar('0')), THROTTLE_SOURCE_FIRST_CHANNEL+i);
|
||||
if (model.thrTraceSrc == unsigned(THROTTLE_SOURCE_FIRST_CHANNEL+i))
|
||||
ui->throttleSource->setCurrentIndex(ui->throttleSource->count()-1);
|
||||
}
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void Setup::update()
|
||||
{
|
||||
ui->name->setText(model.name);
|
||||
|
||||
ui->throttleReverse->setChecked(model.throttleReversed);
|
||||
populateTTraceCB(ui->throttleSource, model.thrTraceSrc);
|
||||
populateThrottleSourceCB();
|
||||
ui->throttleWarning->setChecked(!model.disableThrottleWarning);
|
||||
|
||||
//trim inc, thro trim, thro expo, instatrim
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <QCheckBox>
|
||||
#include <QSlider>
|
||||
#include <QSpinBox>
|
||||
#include <QComboBox>
|
||||
#include <QLabel>
|
||||
|
||||
namespace Ui {
|
||||
@@ -104,6 +105,7 @@ class Setup : public ModelPanel
|
||||
void updateStartupSwitches();
|
||||
void updatePotWarnings();
|
||||
void updateBeepCenter();
|
||||
void populateThrottleSourceCB();
|
||||
};
|
||||
|
||||
#endif // SETUP_H
|
||||
|
||||
+421
-288
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>787</width>
|
||||
<height>727</height>
|
||||
<width>840</width>
|
||||
<height>520</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -16,175 +16,88 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout_37" columnstretch="0,0,0,0,0,0">
|
||||
<item row="4" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="3">
|
||||
<widget class="QComboBox" name="image"/>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QLabel" name="imagePreview">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<widget class="QCheckBox" name="throttleReverse">
|
||||
<property name="whatsThis">
|
||||
<string>Reverse throttle operation.
|
||||
If this is checked the throttle will be reversed. Idle will be forward, trim will also be reversed and the throttle warning will be reversed as well.
|
||||
|
||||
</string>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>64</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>64</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
<string>Reverse Throttle</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<spacer name="horizontalSpacer_26">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="extendedLimits">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_24">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="modelImage_label">
|
||||
<property name="text">
|
||||
<string>Model Image</string>
|
||||
<string>Extended Limits</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="name">
|
||||
<widget class="QComboBox" name="throttleSource">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>10</number>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QCheckBox" name="extendedTrims">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Extended Trims</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Model Name</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_timer2">
|
||||
<property name="text">
|
||||
<string>Timer2</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Timer1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_ttrace">
|
||||
<property name="text">
|
||||
<string>Throttle Source</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="swwarn_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Switch Warnings</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Center beep</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<layout class="QGridLayout" name="centerBeepLayout"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Trim Increment</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="throttleTrim">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Throttle Trim</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QCheckBox" name="throttleWarning">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Throttle Warning</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QComboBox" name="trimIncrement">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
@@ -219,173 +132,393 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="extendedLimits">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Extended Limits</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="extendedTrims">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Extended Trims</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QCheckBox" name="displayText">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Display Checklist</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QComboBox" name="throttleSource">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="throttleTrim">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Throttle Trim</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="throttleWarning">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Throttle Warning</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="throttleReverse">
|
||||
<property name="whatsThis">
|
||||
<string>Reverse throttle operation.
|
||||
If this is checked the throttle will be reversed. Idle will be forward, trim will also be reversed and the throttle warning will be reversed as well.
|
||||
|
||||
</string>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Reverse Throttle</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<layout class="QGridLayout" name="switchesStartupLayout" rowstretch="0" columnstretch="0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_potWarning">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
<item row="2" column="0" alignment="Qt::AlignRight|Qt::AlignVCenter">
|
||||
<widget class="QLabel" name="label_timer2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Pot Warnings</string>
|
||||
<string>Timer2</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<layout class="QGridLayout" name="potWarningLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QComboBox" name="potWarningMode">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>OFF</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Manual</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Auto</string>
|
||||
</property>
|
||||
</item>
|
||||
<item row="1" column="0" alignment="Qt::AlignRight|Qt::AlignVCenter">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Timer1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="label_ttrace">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Throttle Source</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Trim Increment</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="centerBeepLayout"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Center beep</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="name">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="modelImage_label">
|
||||
<property name="text">
|
||||
<string>Model Image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="imagePreview">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>64</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>64</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="image"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_26">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="8" column="0" alignment="Qt::AlignLeft|Qt::AlignTop">
|
||||
<widget class="QLabel" name="swwarn_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Warnings</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Switch Warnings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="switchesStartupLayout" rowstretch="0" columnstretch="0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="QLabel" name="label_potWarning">
|
||||
<property name="text">
|
||||
<string>Pot Warnings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="potWarningLayout">
|
||||
<item row="0" column="0" alignment="Qt::AlignTop">
|
||||
<widget class="QComboBox" name="potWarningMode">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>OFF</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Manual</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Auto</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" alignment="Qt::AlignLeft|Qt::AlignTop">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Model</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="modulesLayout"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
|
||||
@@ -6,14 +6,46 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>694</width>
|
||||
<height>340</height>
|
||||
<width>628</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_module">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="moduleGB">
|
||||
<property name="sizePolicy">
|
||||
@@ -35,7 +67,41 @@
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_69" rowstretch="0,0,0,0,0,0,0,0,0" columnstretch="0,0,0,0,0,0,0">
|
||||
<item row="7" column="1" colspan="5">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="3" alignment="Qt::AlignLeft">
|
||||
<widget class="QSpinBox" name="channelsStart">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>125</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>ch</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>32</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="5">
|
||||
<widget class="QFrame" name="failsafesFrame">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -56,7 +122,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_failsafeMode">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -72,7 +138,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2" alignment="Qt::AlignRight">
|
||||
<item row="2" column="2" alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="label_channelsStart">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -88,7 +154,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="protocol">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -98,7 +164,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="4" alignment="Qt::AlignRight">
|
||||
<item row="3" column="4" alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="label_ppmDelay">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -114,7 +180,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="5">
|
||||
<item row="3" column="5">
|
||||
<widget class="QSpinBox" name="ppmDelay">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -142,7 +208,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3" alignment="Qt::AlignLeft">
|
||||
<item row="3" column="3" alignment="Qt::AlignLeft">
|
||||
<widget class="QComboBox" name="ppmPolarity">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
@@ -168,23 +234,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_rxNumber">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RX Number</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="trainerMode">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@@ -210,7 +260,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2" alignment="Qt::AlignRight">
|
||||
<item row="3" column="2" alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="label_ppmPolarity">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -226,7 +276,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" alignment="Qt::AlignRight">
|
||||
<item row="0" column="0" alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="label_trainerMode">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -242,38 +292,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QSpinBox" name="rxNumber">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>125</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>125</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="ppmFrameLength">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@@ -307,33 +326,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="label_ppmFrameLength">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PPM Frame Length</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="7">
|
||||
<widget class="QLabel" name="label_module">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">font-weight: bold;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="5" alignment="Qt::AlignLeft">
|
||||
<item row="2" column="5" alignment="Qt::AlignLeft">
|
||||
<widget class="QSpinBox" name="channelsCount">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -361,35 +354,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3" alignment="Qt::AlignLeft">
|
||||
<widget class="QSpinBox" name="channelsStart">
|
||||
<item row="3" column="0" alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="label_ppmFrameLength">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>125</width>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PPM Frame Length</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>ch</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>32</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4" alignment="Qt::AlignRight">
|
||||
<item row="2" column="4" alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="label_channelsCount">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
@@ -411,7 +392,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" alignment="Qt::AlignLeft">
|
||||
<item row="5" column="1" alignment="Qt::AlignLeft">
|
||||
<widget class="QComboBox" name="failsafeMode">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@@ -440,9 +421,14 @@
|
||||
<string>No Pulses</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Receiver</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" alignment="Qt::AlignRight">
|
||||
<item row="6" column="0" alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="failsafesLayoutLabel">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -458,20 +444,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0" alignment="Qt::AlignRight">
|
||||
<item row="2" column="0" alignment="Qt::AlignRight">
|
||||
<widget class="QLabel" name="label_protocol">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -487,6 +460,79 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="6">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="5">
|
||||
<widget class="QSpinBox" name="rxNumber">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>125</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>125</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="4">
|
||||
<widget class="QLabel" name="label_rxNumber">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RX Number</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -28,10 +28,20 @@ TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog):
|
||||
update();
|
||||
|
||||
ui->UnitCB->setCurrentIndex(analog.type);
|
||||
ui->alarm1LevelCB->setCurrentIndex(analog.alarms[0].level);
|
||||
ui->alarm1GreaterCB->setCurrentIndex(analog.alarms[0].greater);
|
||||
ui->alarm2LevelCB->setCurrentIndex(analog.alarms[1].level);
|
||||
ui->alarm2GreaterCB->setCurrentIndex(analog.alarms[1].greater);
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->alarm1LevelCB->setCurrentIndex(analog.alarms[0].level);
|
||||
ui->alarm1GreaterCB->setCurrentIndex(analog.alarms[0].greater);
|
||||
ui->alarm2LevelCB->setCurrentIndex(analog.alarms[1].level);
|
||||
ui->alarm2GreaterCB->setCurrentIndex(analog.alarms[1].greater);
|
||||
}
|
||||
else {
|
||||
ui->alarm1LevelCB->hide();
|
||||
ui->alarm2LevelCB->hide();
|
||||
ui->alarm1GreaterCB->hide();
|
||||
ui->alarm2GreaterCB->hide();
|
||||
ui->alarm1Label->setText(tr("Low Alarm"));
|
||||
ui->alarm2Label->setText(tr("Critical Alarm"));
|
||||
}
|
||||
|
||||
if (!(GetEepromInterface()->getCapability(Telemetry) & TM_HASOFFSET)) {
|
||||
ui->CalibSB->hide();
|
||||
@@ -281,7 +291,7 @@ TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model,
|
||||
for (int c=0; c<GetEepromInterface()->getCapability(TelemetryCustomScreensFieldsPerLine); c++) {
|
||||
fieldsCB[l][c] = new QComboBox(this);
|
||||
fieldsCB[l][c]->setProperty("index", c + (l<<8));
|
||||
populateCustomScreenFieldCB(fieldsCB[l][c], screen.body.lines[l].source[c], (l<4), model.frsky.usrProto);
|
||||
populateTelemetrySourceCB(fieldsCB[l][c], screen.body.lines[l].source[c], l==3, model.frsky.usrProto);
|
||||
ui->screenNumsLayout->addWidget(fieldsCB[l][c], l, c, 1, 1);
|
||||
connect(fieldsCB[l][c], SIGNAL(currentIndexChanged(int)), this, SLOT(customFieldChanged(int)));
|
||||
}
|
||||
@@ -290,7 +300,7 @@ TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model,
|
||||
for (int l=0; l<4; l++) {
|
||||
barsCB[l] = new QComboBox(this);
|
||||
barsCB[l]->setProperty("index", l);
|
||||
populateCustomScreenFieldCB(barsCB[l], screen.body.bars[l].source, false, model.frsky.usrProto);
|
||||
populateTelemetrySourceCB(barsCB[l], screen.body.bars[l].source, false, model.frsky.usrProto);
|
||||
connect(barsCB[l], SIGNAL(currentIndexChanged(int)), this, SLOT(barSourceChanged(int)));
|
||||
ui->screenBarsLayout->addWidget(barsCB[l], l, 0, 1, 1);
|
||||
|
||||
@@ -316,6 +326,31 @@ TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model,
|
||||
update();
|
||||
}
|
||||
|
||||
void TelemetryCustomScreen::populateTelemetrySourceCB(QComboBox *b, unsigned int value, bool last, int hubproto)
|
||||
{
|
||||
int telem_hub[] = {0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,0,2,2,1,1,1,1,1,1};
|
||||
b->clear();
|
||||
|
||||
b->addItem(RawSource(SOURCE_TYPE_NONE, 0).toString());
|
||||
|
||||
for (unsigned int i = 0; i < (last ? TELEMETRY_SOURCES_STATUS_COUNT : TELEMETRY_SOURCES_DISPLAY_COUNT); i++) {
|
||||
b->addItem(RawSource(SOURCE_TYPE_TELEMETRY, i).toString());
|
||||
if (!(i>=sizeof(telem_hub)/sizeof(int) || telem_hub[i]==0 || ((telem_hub[i]>=hubproto) && hubproto!=0))) {
|
||||
QModelIndex index = b->model()->index(i, 0);
|
||||
QVariant v(0);
|
||||
b->model()->setData(index, v, Qt::UserRole - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (value>=sizeof(telem_hub)/sizeof(int))
|
||||
b->setCurrentIndex(0);
|
||||
else if (telem_hub[value]==0 || ((telem_hub[value]>=hubproto) && hubproto!=0)) {
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
|
||||
b->setMaxVisibleItems(10);
|
||||
}
|
||||
|
||||
TelemetryCustomScreen::~TelemetryCustomScreen()
|
||||
{
|
||||
delete ui;
|
||||
@@ -347,6 +382,8 @@ void TelemetryCustomScreen::update()
|
||||
|
||||
void TelemetryCustomScreen::updateBar(int line)
|
||||
{
|
||||
lock = true;
|
||||
|
||||
int index = screen.body.bars[line].source;
|
||||
barsCB[line]->setCurrentIndex(index);
|
||||
if (index) {
|
||||
@@ -372,6 +409,8 @@ void TelemetryCustomScreen::updateBar(int line)
|
||||
minSB[line]->setDisabled(true);
|
||||
maxSB[line]->setDisabled(true);
|
||||
}
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void TelemetryCustomScreen::on_screenType_currentIndexChanged(int index)
|
||||
@@ -393,13 +432,15 @@ void TelemetryCustomScreen::customFieldChanged(int value)
|
||||
|
||||
void TelemetryCustomScreen::barSourceChanged(int index)
|
||||
{
|
||||
QComboBox * cb = qobject_cast<QComboBox*>(sender());
|
||||
int line = cb->property("index").toInt();
|
||||
screen.body.bars[line].source = index;
|
||||
screen.body.bars[line].barMin = 0;
|
||||
screen.body.bars[line].barMax = 0;
|
||||
updateBar(line);
|
||||
emit modified();
|
||||
if (!lock) {
|
||||
QComboBox * cb = qobject_cast<QComboBox*>(sender());
|
||||
int line = cb->property("index").toInt();
|
||||
screen.body.bars[line].source = index;
|
||||
screen.body.bars[line].barMin = 0;
|
||||
screen.body.bars[line].barMax = 0;
|
||||
updateBar(line);
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryCustomScreen::barMinChanged(double value)
|
||||
@@ -447,6 +488,10 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model):
|
||||
ui->customScreens->addTab(tab, tr("Telemetry screen %1").arg(i+1));
|
||||
}
|
||||
|
||||
if (IS_ARM(GetEepromInterface()->getBoard())) {
|
||||
ui->bladesCount->setMinimum(1);
|
||||
}
|
||||
|
||||
setup();
|
||||
}
|
||||
|
||||
@@ -467,8 +512,16 @@ void TelemetryPanel::setup()
|
||||
}
|
||||
ui->rssiAlarm1SB->setValue(model.frsky.rssiAlarms[0].value);
|
||||
ui->rssiAlarm2SB->setValue(model.frsky.rssiAlarms[1].value);
|
||||
ui->rssiAlarm1CB->setCurrentIndex(model.frsky.rssiAlarms[0].level);
|
||||
ui->rssiAlarm2CB->setCurrentIndex(model.frsky.rssiAlarms[1].level);
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->rssiAlarm1CB->setCurrentIndex(model.frsky.rssiAlarms[0].level);
|
||||
ui->rssiAlarm2CB->setCurrentIndex(model.frsky.rssiAlarms[1].level);
|
||||
}
|
||||
else {
|
||||
ui->rssiAlarm1CB->hide();
|
||||
ui->rssiAlarm2CB->hide();
|
||||
ui->rssiAlarm1Label->setText(tr("Low Alarm"));
|
||||
ui->rssiAlarm2Label->setText(tr("Critical Alarm"));
|
||||
}
|
||||
|
||||
if (!GetEepromInterface()->getCapability(HasAltitudeSel)) {
|
||||
ui->AltitudeGPS_ChkB->hide();
|
||||
@@ -585,7 +638,7 @@ void TelemetryPanel::setup()
|
||||
|
||||
ui->frskyProtoCB->setCurrentIndex(model.frsky.usrProto);
|
||||
ui->frskyUnitsCB->setCurrentIndex(model.frsky.imperial);
|
||||
ui->frskyBladesCB->setCurrentIndex(model.frsky.blades);
|
||||
ui->bladesCount->setValue(model.frsky.blades);
|
||||
ui->frskyCurrentCB->setCurrentIndex(model.frsky.currentSource);
|
||||
ui->frskyVoltCB->setCurrentIndex(model.frsky.voltsSource);
|
||||
|
||||
@@ -599,13 +652,13 @@ void TelemetryPanel::onAnalogModified()
|
||||
|
||||
void TelemetryPanel::on_frskyUnitsCB_currentIndexChanged(int index)
|
||||
{
|
||||
model.frsky.imperial=index;
|
||||
model.frsky.imperial = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_frskyBladesCB_currentIndexChanged(int index)
|
||||
void TelemetryPanel::on_bladesCount_editingFinished()
|
||||
{
|
||||
model.frsky.blades=index;
|
||||
model.frsky.blades = ui->bladesCount->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,9 @@ class TelemetryCustomScreen : public ModelPanel
|
||||
void barMinChanged(double value);
|
||||
void barMaxChanged(double value);
|
||||
|
||||
protected:
|
||||
void populateTelemetrySourceCB(QComboBox *b, unsigned int value, bool last, int hubproto);
|
||||
|
||||
private:
|
||||
void updateBar(int line);
|
||||
Ui::TelemetryCustomScreen * ui;
|
||||
@@ -86,7 +89,7 @@ class TelemetryPanel : public ModelPanel
|
||||
void onAnalogModified();
|
||||
void on_frskyProtoCB_currentIndexChanged(int index);
|
||||
void on_frskyUnitsCB_currentIndexChanged(int index);
|
||||
void on_frskyBladesCB_currentIndexChanged(int index);
|
||||
void on_bladesCount_editingFinished();
|
||||
void on_frskyCurrentCB_currentIndexChanged(int index);
|
||||
void on_frskyVoltCB_currentIndexChanged(int index);
|
||||
void on_AltitudeToolbar_ChkB_toggled(bool checked);
|
||||
|
||||
@@ -6,16 +6,19 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>692</width>
|
||||
<width>757</width>
|
||||
<height>457</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0,1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0,0,0,0">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_14" stretch="0,0,0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_14" stretch="0,0,0,0,0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
</property>
|
||||
@@ -33,37 +36,86 @@
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>A1</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="A1Layout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>1</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>A1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="A2GB">
|
||||
<property name="title">
|
||||
<string>A2</string>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="A2Layout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>1</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>A2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="RSSIGB">
|
||||
<property name="sizePolicy">
|
||||
@@ -72,14 +124,52 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>RSSI</string>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_927">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="1" column="3">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<spacer name="verticalSpacer_16">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="rssiAlarm1Label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -98,7 +188,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="rssiAlarm1CB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
@@ -128,7 +218,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<item row="1" column="2">
|
||||
<widget class="QSpinBox" name="rssiAlarm1SB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@@ -156,10 +246,10 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_928">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="rssiAlarm2Label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -175,7 +265,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="rssiAlarm2CB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
@@ -205,7 +295,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<item row="2" column="2">
|
||||
<widget class="QSpinBox" name="rssiAlarm2SB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@@ -233,18 +323,18 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_16">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
<property name="text">
|
||||
<string>RSSI</string>
|
||||
</property>
|
||||
</spacer>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -252,7 +342,17 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13" stretch="1,1">
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13" stretch="1,0,1">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
</property>
|
||||
@@ -264,19 +364,31 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Serial Protocol</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>1</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_34" columnstretch="0,1,1,1">
|
||||
<item row="2" column="0">
|
||||
<property name="horizontalSpacing">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
@@ -289,7 +401,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="frskyUnitsCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@@ -309,7 +421,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="current_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
@@ -328,7 +440,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_112">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
@@ -347,7 +459,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<item row="3" column="3">
|
||||
<widget class="QComboBox" name="frskyCurrentCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@@ -377,7 +489,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="3">
|
||||
<item row="1" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="frskyProtoCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
@@ -397,7 +509,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="frskyVoltCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@@ -427,32 +539,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QComboBox" name="frskyBladesCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>3</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>4</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_113">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
@@ -471,7 +558,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="blades_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
@@ -484,11 +571,53 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Serial Protocol</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QDoubleSpinBox" name="bladesCount">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>2.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>2.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="altimetryGB">
|
||||
<property name="sizePolicy">
|
||||
@@ -497,19 +626,28 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Altimetry / Vario</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_39">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>1</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_40" rowstretch="1,0,0" columnstretch="0,0">
|
||||
<item row="0" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout_40" rowstretch="1,0,0,0" columnstretch="0,0">
|
||||
<property name="horizontalSpacing">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="varioSourceCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
@@ -544,7 +682,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout_66" columnstretch="1,0,0,0">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="VarioLabel_1">
|
||||
@@ -558,7 +696,7 @@
|
||||
<string>Sink Max</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -681,7 +819,7 @@
|
||||
<string>Climb Max</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -697,7 +835,7 @@
|
||||
<string>Sink Min</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -713,27 +851,27 @@
|
||||
<string>Climb Min</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="varioSource_label">
|
||||
<property name="text">
|
||||
<string>Vario source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="varioLimit_label">
|
||||
<property name="text">
|
||||
<string>Vario limits</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_16">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="AltitudeGPS_ChkB">
|
||||
@@ -763,6 +901,19 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Altimetry</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -770,6 +921,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="variousGB">
|
||||
<property name="sizePolicy">
|
||||
@@ -778,19 +936,38 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Various</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>1</number>
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="mahCount_label">
|
||||
<property name="text">
|
||||
<string>mAh count</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QSpinBox" name="mahCount_SB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
@@ -803,34 +980,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" alignment="Qt::AlignHCenter">
|
||||
<widget class="QLabel" name="mahCount_label">
|
||||
<property name="text">
|
||||
<string>mAh count</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" alignment="Qt::AlignHCenter">
|
||||
<widget class="QLabel" name="fasOffset_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>FAS Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="mahCount_ChkB">
|
||||
<property name="text">
|
||||
<string>Persistent mAh</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="fasOffset_DSB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
@@ -852,7 +1002,27 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="fasOffset_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>FAS Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QCheckBox" name="mahCount_ChkB">
|
||||
<property name="text">
|
||||
<string>Persistent mAh</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -865,6 +1035,25 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Various</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>272</width>
|
||||
<width>276</width>
|
||||
<height>118</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -14,6 +14,21 @@
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_11" columnstretch="1,1,1,1" columnminimumwidth="0,0,0,0">
|
||||
<item row="0" column="0">
|
||||
@@ -43,7 +58,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_919">
|
||||
<widget class="QLabel" name="alarm1Label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -106,7 +121,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_921">
|
||||
<widget class="QLabel" name="alarm2Label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -260,7 +275,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<item row="0" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="UnitCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
|
||||
Reference in New Issue
Block a user