mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 01:55:48 -05:00
LimeSDR: moved MsgReportDeviceInfo to shared structure
This commit is contained in:
parent
8a19a66af0
commit
87ccef02b6
@ -17,3 +17,4 @@
|
||||
#include "devicelimesdrshared.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(DeviceLimeSDRShared::MsgCrossReportToGUI, Message)
|
||||
MESSAGE_CLASS_DEFINITION(DeviceLimeSDRShared::MsgReportDeviceInfo, Message)
|
||||
|
@ -47,6 +47,26 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgReportDeviceInfo : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
float getTemperature() const { return m_temperature; }
|
||||
|
||||
static MsgReportDeviceInfo* create(float temperature)
|
||||
{
|
||||
return new MsgReportDeviceInfo(temperature);
|
||||
}
|
||||
|
||||
private:
|
||||
float m_temperature;
|
||||
|
||||
MsgReportDeviceInfo(float temperature) :
|
||||
Message(),
|
||||
m_temperature(temperature)
|
||||
{ }
|
||||
};
|
||||
|
||||
class ThreadInterface
|
||||
{
|
||||
public:
|
||||
|
@ -35,7 +35,6 @@ MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgGetDeviceInfo, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgSetReferenceConfig, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgReportLimeSDRToGUI, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgReportStreamInfo, Message)
|
||||
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgReportDeviceInfo, Message)
|
||||
|
||||
|
||||
LimeSDRInput::LimeSDRInput(DeviceSourceAPI *deviceAPI) :
|
||||
@ -458,7 +457,7 @@ bool LimeSDRInput::handleMessage(const Message& message)
|
||||
}
|
||||
|
||||
// send to oneself
|
||||
MsgReportDeviceInfo *report = MsgReportDeviceInfo::create(temp);
|
||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp);
|
||||
m_deviceAPI->getDeviceOutputMessageQueue()->push(report);
|
||||
|
||||
// send to source buddies
|
||||
@ -467,7 +466,7 @@ bool LimeSDRInput::handleMessage(const Message& message)
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
MsgReportDeviceInfo *report = MsgReportDeviceInfo::create(temp);
|
||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp);
|
||||
(*itSource)->getDeviceOutputMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
@ -477,7 +476,7 @@ bool LimeSDRInput::handleMessage(const Message& message)
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
MsgReportDeviceInfo *report = MsgReportDeviceInfo::create(temp);
|
||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp);
|
||||
(*itSink)->getDeviceOutputMessageQueue()->push(report);
|
||||
}
|
||||
}
|
||||
|
@ -208,26 +208,6 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgReportDeviceInfo : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
float getTemperature() const { return m_temperature; }
|
||||
|
||||
static MsgReportDeviceInfo* create(float temperature)
|
||||
{
|
||||
return new MsgReportDeviceInfo(temperature);
|
||||
}
|
||||
|
||||
private:
|
||||
float m_temperature;
|
||||
|
||||
MsgReportDeviceInfo(float temperature) :
|
||||
Message(),
|
||||
m_temperature(temperature)
|
||||
{ }
|
||||
};
|
||||
|
||||
LimeSDRInput(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~LimeSDRInput();
|
||||
|
||||
|
@ -236,9 +236,9 @@ void LimeSDRInputGUI::handleMessagesToGUI()
|
||||
ui->streamStatusLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
|
||||
}
|
||||
}
|
||||
else if (LimeSDRInput::MsgReportDeviceInfo::match(*message))
|
||||
else if (DeviceLimeSDRShared::MsgReportDeviceInfo::match(*message))
|
||||
{
|
||||
LimeSDRInput::MsgReportDeviceInfo *report = (LimeSDRInput::MsgReportDeviceInfo *) message;
|
||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = (DeviceLimeSDRShared::MsgReportDeviceInfo *) message;
|
||||
ui->temperatureText->setText(tr("%1C").arg(QString::number(report->getTemperature(), 'f', 0)));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user