1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

OP-1517 Small adjustments.

This commit is contained in:
m_thread 2014-10-02 21:25:38 +02:00
parent 3aed610c36
commit a7a7d32ec8
4 changed files with 3 additions and 26 deletions

View File

@ -48,7 +48,7 @@
#include <QDesktopServices>
#include <QUrl>
ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(parent), wasItMe(false)
ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(parent)
{
ui = new Ui_OutputWidget();
ui->setupUi(this);
@ -100,13 +100,6 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
disconnect(this, SLOT(refreshWidgetsValues(UAVObject *)));
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
UAVObject *obj = objManager->getObject(QString("ActuatorCommand"));
if (UAVObject::GetGcsTelemetryUpdateMode(obj->getMetadata()) == UAVObject::UPDATEMODE_ONCHANGE) {
this->setEnabled(false);
}
connect(obj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(disableIfNotMe(UAVObject *)));
refreshWidgetsValues();
updateEnableControls();
}
@ -178,7 +171,6 @@ void ConfigOutputWidget::runChannelTests(bool state)
ActuatorCommand *obj = ActuatorCommand::GetInstance(getObjectManager());
UAVObject::Metadata mdata = obj->getMetadata();
if (state) {
wasItMe = true;
accInitialData = mdata;
UAVObject::SetFlightAccess(mdata, UAVObject::ACCESS_READONLY);
UAVObject::SetFlightTelemetryUpdateMode(mdata, UAVObject::UPDATEMODE_ONCHANGE);
@ -186,7 +178,6 @@ void ConfigOutputWidget::runChannelTests(bool state)
UAVObject::SetGcsTelemetryUpdateMode(mdata, UAVObject::UPDATEMODE_ONCHANGE);
mdata.gcsTelemetryUpdatePeriod = 100;
} else {
wasItMe = false;
mdata = accInitialData; // Restore metadata
}
obj->setMetadata(mdata);
@ -425,14 +416,3 @@ void ConfigOutputWidget::stopTests()
{
ui->channelOutTest->setChecked(false);
}
void ConfigOutputWidget::disableIfNotMe(UAVObject *obj)
{
if (UAVObject::GetGcsTelemetryUpdateMode(obj->getMetadata()) == UAVObject::UPDATEMODE_ONCHANGE) {
if (!wasItMe) {
this->setEnabled(false);
}
} else {
this->setEnabled(true);
}
}

View File

@ -67,11 +67,8 @@ private:
UAVObject::Metadata accInitialData;
bool wasItMe;
private slots:
void stopTests();
void disableIfNotMe(UAVObject *obj);
virtual void refreshWidgetsValues(UAVObject *obj = NULL);
void updateObjectsFromWidgets();
void runChannelTests(bool state);

View File

@ -53,7 +53,7 @@ private slots:
private:
static const int LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1000;
static const int HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 2000;
static const int HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1900;
Ui::EscCalibrationPage *ui;
bool m_isCalibrating;

View File

@ -75,7 +75,7 @@ void OutputCalibrationPage::setupActuatorMinMaxAndNeutral(int motorChannelStart,
// Set to motor safe values
m_actuatorSettings[servoid].channelMin = 1000;
m_actuatorSettings[servoid].channelNeutral = 1000;
m_actuatorSettings[servoid].channelMax = 2000;
m_actuatorSettings[servoid].channelMax = 1900;
} else if (servoid < totalUsedChannels) {
// Set to servo safe values
m_actuatorSettings[servoid].channelMin = 1500;