mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-09-28 15:56:33 -04:00
LimeRFE feature: move calibration to settings
This commit is contained in:
parent
d0c2b24694
commit
41901fed25
@ -128,10 +128,7 @@ bool LimeRFE::handleMessage(const Message& cmd)
|
|||||||
QByteArray LimeRFE::serialize() const
|
QByteArray LimeRFE::serialize() const
|
||||||
{
|
{
|
||||||
SimpleSerializer s(1);
|
SimpleSerializer s(1);
|
||||||
|
|
||||||
s.writeBlob(1, m_settings.serialize());
|
s.writeBlob(1, m_settings.serialize());
|
||||||
s.writeBlob(2, m_calib.serialize());
|
|
||||||
|
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,31 +145,21 @@ bool LimeRFE::deserialize(const QByteArray& data)
|
|||||||
if (d.getVersion() == 1)
|
if (d.getVersion() == 1)
|
||||||
{
|
{
|
||||||
QByteArray bytetmp;
|
QByteArray bytetmp;
|
||||||
bool ret;
|
|
||||||
|
|
||||||
d.readBlob(1, &bytetmp);
|
d.readBlob(1, &bytetmp);
|
||||||
|
|
||||||
if (m_settings.deserialize(bytetmp))
|
if (m_settings.deserialize(bytetmp))
|
||||||
{
|
{
|
||||||
MsgConfigureLimeRFE *msg = MsgConfigureLimeRFE::create(m_settings, true);
|
MsgConfigureLimeRFE *msg = MsgConfigureLimeRFE::create(m_settings, true);
|
||||||
m_inputMessageQueue.push(msg);
|
m_inputMessageQueue.push(msg);
|
||||||
ret = true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_settings.resetToDefaults();
|
m_settings.resetToDefaults();
|
||||||
MsgConfigureLimeRFE *msg = MsgConfigureLimeRFE::create(m_settings, true);
|
MsgConfigureLimeRFE *msg = MsgConfigureLimeRFE::create(m_settings, true);
|
||||||
m_inputMessageQueue.push(msg);
|
m_inputMessageQueue.push(msg);
|
||||||
ret = false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
d.readBlob(2, &bytetmp);
|
|
||||||
|
|
||||||
if (!m_calib.deserialize(bytetmp)) {
|
|
||||||
ret = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
#include "util/message.h"
|
#include "util/message.h"
|
||||||
|
|
||||||
#include "limerfesettings.h"
|
#include "limerfesettings.h"
|
||||||
#include "limerfeusbcalib.h"
|
|
||||||
|
|
||||||
class QNetworkReply;
|
class QNetworkReply;
|
||||||
class QNetworkAccessManager;
|
class QNetworkAccessManager;
|
||||||
@ -137,8 +136,6 @@ public:
|
|||||||
const QStringList& featureSettingsKeys,
|
const QStringList& featureSettingsKeys,
|
||||||
SWGSDRangel::SWGFeatureSettings& response);
|
SWGSDRangel::SWGFeatureSettings& response);
|
||||||
|
|
||||||
LimeRFEUSBCalib *getCalib() { return &m_calib; }
|
|
||||||
|
|
||||||
int openDevice(const std::string& serialDeviceName);
|
int openDevice(const std::string& serialDeviceName);
|
||||||
void closeDevice();
|
void closeDevice();
|
||||||
|
|
||||||
@ -162,7 +159,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
LimeRFESettings m_settings;
|
LimeRFESettings m_settings;
|
||||||
LimeRFEUSBCalib m_calib;
|
|
||||||
bool m_rxOn;
|
bool m_rxOn;
|
||||||
bool m_txOn;
|
bool m_txOn;
|
||||||
|
|
||||||
|
@ -147,7 +147,6 @@ LimeRFEGUI::LimeRFEGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature
|
|||||||
|
|
||||||
m_limeRFE = reinterpret_cast<LimeRFE*>(feature);
|
m_limeRFE = reinterpret_cast<LimeRFE*>(feature);
|
||||||
m_limeRFE->setMessageQueueToGUI(&m_inputMessageQueue);
|
m_limeRFE->setMessageQueueToGUI(&m_inputMessageQueue);
|
||||||
m_limeRFEUSBCalib = m_limeRFE->getCalib();
|
|
||||||
|
|
||||||
for (const auto& comPortName : m_limeRFE->getComPorts()) {
|
for (const auto& comPortName : m_limeRFE->getComPorts()) {
|
||||||
ui->device->addItem(comPortName);
|
ui->device->addItem(comPortName);
|
||||||
@ -556,9 +555,9 @@ double LimeRFEGUI::getPowerCorrection()
|
|||||||
{
|
{
|
||||||
int index = getPowerCorectionIndex();
|
int index = getPowerCorectionIndex();
|
||||||
|
|
||||||
QMap<int, double>::const_iterator it = m_limeRFEUSBCalib->m_calibrations.find(index);
|
QMap<int, double>::const_iterator it = m_settings.m_calib.m_calibrations.find(index);
|
||||||
|
|
||||||
if (it != m_limeRFEUSBCalib->m_calibrations.end()) {
|
if (it != m_settings.m_calib.m_calibrations.end()) {
|
||||||
return it.value();
|
return it.value();
|
||||||
} else {
|
} else {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
@ -573,7 +572,7 @@ void LimeRFEGUI::setPowerCorrection(double dbValue)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_limeRFEUSBCalib->m_calibrations[index] = dbValue;
|
m_settings.m_calib.m_calibrations[index] = dbValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LimeRFEGUI::updateAbsPower(double powerCorrDB)
|
void LimeRFEGUI::updateAbsPower(double powerCorrDB)
|
||||||
|
@ -31,7 +31,6 @@ class PluginAPI;
|
|||||||
class FeatureUISet;
|
class FeatureUISet;
|
||||||
class Feature;
|
class Feature;
|
||||||
class LimeRFE;
|
class LimeRFE;
|
||||||
class LimeRFEUSBCalib;
|
|
||||||
class DSPDeviceSourceEngine;
|
class DSPDeviceSourceEngine;
|
||||||
class DSPDeviceSinkEngine;
|
class DSPDeviceSinkEngine;
|
||||||
|
|
||||||
@ -63,7 +62,6 @@ private:
|
|||||||
PluginAPI* m_pluginAPI;
|
PluginAPI* m_pluginAPI;
|
||||||
FeatureUISet* m_featureUISet;
|
FeatureUISet* m_featureUISet;
|
||||||
LimeRFESettings m_settings;
|
LimeRFESettings m_settings;
|
||||||
LimeRFEUSBCalib* m_limeRFEUSBCalib;
|
|
||||||
RollupState m_rollupState;
|
RollupState m_rollupState;
|
||||||
bool m_rxOn;
|
bool m_rxOn;
|
||||||
bool m_txOn;
|
bool m_txOn;
|
||||||
|
@ -93,6 +93,7 @@ QByteArray LimeRFESettings::serialize() const
|
|||||||
s.writeS32(38, m_workspaceIndex);
|
s.writeS32(38, m_workspaceIndex);
|
||||||
s.writeBlob(39, m_geometryBytes);
|
s.writeBlob(39, m_geometryBytes);
|
||||||
s.writeString(40, m_devicePath);
|
s.writeString(40, m_devicePath);
|
||||||
|
s.writeBlob(41, m_calib.serialize());
|
||||||
|
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
@ -168,6 +169,8 @@ bool LimeRFESettings::deserialize(const QByteArray& data)
|
|||||||
d.readS32(38, &m_workspaceIndex, 0);
|
d.readS32(38, &m_workspaceIndex, 0);
|
||||||
d.readBlob(39, &m_geometryBytes);
|
d.readBlob(39, &m_geometryBytes);
|
||||||
d.readString(40, &m_devicePath, "");
|
d.readString(40, &m_devicePath, "");
|
||||||
|
d.readBlob(41, &bytetmp);
|
||||||
|
m_calib.deserialize(bytetmp);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
#include "limerfeusbcalib.h"
|
||||||
|
|
||||||
class Serializable;
|
class Serializable;
|
||||||
|
|
||||||
struct LimeRFESettings
|
struct LimeRFESettings
|
||||||
@ -109,6 +111,7 @@ struct LimeRFESettings
|
|||||||
Serializable *m_rollupState;
|
Serializable *m_rollupState;
|
||||||
int m_workspaceIndex;
|
int m_workspaceIndex;
|
||||||
QByteArray m_geometryBytes;
|
QByteArray m_geometryBytes;
|
||||||
|
LimeRFEUSBCalib m_calib;
|
||||||
|
|
||||||
LimeRFESettings();
|
LimeRFESettings();
|
||||||
void resetToDefaults();
|
void resetToDefaults();
|
||||||
|
Loading…
Reference in New Issue
Block a user