1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-27 16:54:15 +01:00

OP-1525 Changed some minor gui stuff.

This commit is contained in:
Fredrik Arvidsson 2014-10-09 20:09:16 +02:00
parent 9fb474d930
commit 0f8336a351
3 changed files with 33 additions and 109 deletions

View File

@ -242,19 +242,28 @@ void ConfigStabilizationWidget::setupExpoPlot()
m_plotGrid.attach(ui->expoPlot);
m_expoPlotCurveRoll.setRenderHint(QwtPlotCurve::RenderAntialiased);
m_expoPlotCurveRoll.setPen(QPen(QColor(Qt::red), 3));
QColor rollColor(Qt::red);
rollColor.setAlpha(180);
m_expoPlotCurveRoll.setPen(QPen(rollColor, 2));
m_expoPlotCurveRoll.attach(ui->expoPlot);
replotExpoRoll(ui->expoSpinnerRoll->value());
m_expoPlotCurveRoll.show();
QColor pitchColor(Qt::green);
pitchColor.setAlpha(180);
m_expoPlotCurvePitch.setRenderHint(QwtPlotCurve::RenderAntialiased);
m_expoPlotCurvePitch.setPen(QPen(QColor(Qt::green), 3));
m_expoPlotCurvePitch.setPen(QPen(pitchColor, 2));
m_expoPlotCurvePitch.attach(ui->expoPlot);
replotExpoPitch(ui->expoSpinnerPitch->value());
m_expoPlotCurvePitch.show();
QColor yawColor(Qt::blue);
yawColor.setAlpha(180);
m_expoPlotCurveYaw.setRenderHint(QwtPlotCurve::RenderAntialiased);
m_expoPlotCurveYaw.setPen(QPen(QColor(Qt::blue), 3));
m_expoPlotCurveYaw.setPen(QPen(yawColor, 2));
m_expoPlotCurveYaw.attach(ui->expoPlot);
replotExpoYaw(ui->expoSpinnerYaw->value());
m_expoPlotCurveYaw.show();
}
void ConfigStabilizationWidget::resetThrottleCurveToDefault()
@ -291,17 +300,16 @@ void ConfigStabilizationWidget::throttleCurveUpdated()
void ConfigStabilizationWidget::replotExpo(int value, QwtPlotCurve &curve)
{
double x[EXPO_CURVE_POINTS] = { 0 };
double y[EXPO_CURVE_POINTS] = { 0 };
double x[EXPO_CURVE_POINTS_COUNT] = { 0 };
double y[EXPO_CURVE_POINTS_COUNT] = { 0 };
double factor = pow(1.03293, value);
double step = 1.0 / (EXPO_CURVE_POINTS - 1);
double step = 1.0 / (EXPO_CURVE_POINTS_COUNT - 1);
for (int i = 0; i < EXPO_CURVE_POINTS; i++) {
for (int i = 0; i < EXPO_CURVE_POINTS_COUNT; i++) {
x[i] = i * step;
y[i] = pow(x[i], factor);
}
curve.setSamples(x, y, EXPO_CURVE_POINTS);
curve.show();
curve.setSamples(x, y, EXPO_CURVE_POINTS_COUNT);
ui->expoPlot->replot();
}

View File

@ -55,7 +55,7 @@ private:
// Milliseconds between automatic 'Instant Updates'
static const int AUTOMATIC_UPDATE_RATE = 500;
static const int EXPO_CURVE_POINTS = 100;
static const int EXPO_CURVE_POINTS_COUNT = 100;
int boardModel;
int m_pidBankCount;

View File

@ -2385,6 +2385,12 @@ border-radius: 5;</string>
</item>
<item row="0" column="1" rowspan="2">
<widget class="QGroupBox" name="groupBox_7">
<property name="maximumSize">
<size>
<width>250</width>
<height>16777215</height>
</size>
</property>
<property name="title">
<string>Expo</string>
</property>
@ -2455,39 +2461,9 @@ border-radius: 5;</string>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
<active/>
<inactive/>
<disabled/>
</palette>
</property>
<property name="text">
@ -2553,39 +2529,9 @@ border-radius: 5;</string>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>170</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>170</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
<active/>
<inactive/>
<disabled/>
</palette>
</property>
<property name="text">
@ -2641,39 +2587,9 @@ border-radius: 5;</string>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
<active/>
<inactive/>
<disabled/>
</palette>
</property>
<property name="text">