1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

Merge pull request #1560 from srcejon/fix_1559

Fix rotator controller protocol setting
This commit is contained in:
Edouard Griffiths 2023-01-06 23:22:36 +01:00 committed by GitHub
commit 301d1f5d85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,6 +139,13 @@ void GS232ControllerWorker::applySettings(const GS232ControllerSettings& setting
}
}
// Must update m_settings before calling setAzimuthElevation, so m_settings.m_protocol is correct
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
if (m_device != nullptr)
{
// Apply offset then clamp
@ -159,12 +166,6 @@ void GS232ControllerWorker::applySettings(const GS232ControllerSettings& setting
setAzimuth(azimuth);
}
}
if (force) {
m_settings = settings;
} else {
m_settings.applySettings(settingsKeys, settings);
}
}
QIODevice *GS232ControllerWorker::openSerialPort(const GS232ControllerSettings& settings)
@ -271,7 +272,9 @@ void GS232ControllerWorker::setAzimuthElevation(float azimuth, float elevation)
qDebug() << "GS232ControllerWorker::setAzimuthElevation: Not sent, waiting for status reply";
m_spidSetOutstanding = true;
}
} else {
}
else
{
QString cmd = QString("P %1 %2\n").arg(azimuth).arg(elevation);
QByteArray data = cmd.toLatin1();
m_device->write(data);