mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-23 20:58:42 -04:00
LimeSDR input: optimize get device info by checking buddy leadership in the GUI
This commit is contained in:
parent
37df628719
commit
b867cf2335
plugins/samplesource/limesdrinput
@ -443,42 +443,39 @@ bool LimeSDRInput::handleMessage(const Message& message)
|
||||
}
|
||||
else if (MsgGetDeviceInfo::match(message))
|
||||
{
|
||||
if (m_deviceAPI->isBuddyLeader())
|
||||
double temp = 0.0;
|
||||
|
||||
if (m_deviceShared.m_deviceParams->getDevice() && (LMS_GetChipTemperature(m_deviceShared.m_deviceParams->getDevice(), 0, &temp) == 0))
|
||||
{
|
||||
double temp = 0.0;
|
||||
//qDebug("LimeSDRInput::handleMessage: MsgGetDeviceInfo: temperature: %f", temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("LimeSDRInput::handleMessage: MsgGetDeviceInfo: cannot get temperature");
|
||||
}
|
||||
|
||||
if (m_deviceShared.m_deviceParams->getDevice() && (LMS_GetChipTemperature(m_deviceShared.m_deviceParams->getDevice(), 0, &temp) == 0))
|
||||
{
|
||||
//qDebug("LimeSDRInput::handleMessage: MsgGetDeviceInfo: temperature: %f", temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("LimeSDRInput::handleMessage: MsgGetDeviceInfo: cannot get temperature");
|
||||
}
|
||||
// send to oneself
|
||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp);
|
||||
m_deviceAPI->getDeviceOutputMessageQueue()->push(report);
|
||||
|
||||
// send to oneself
|
||||
// send to source buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp);
|
||||
m_deviceAPI->getDeviceOutputMessageQueue()->push(report);
|
||||
(*itSource)->getDeviceOutputMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
// send to source buddies
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
// send to sink buddies
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp);
|
||||
(*itSource)->getDeviceOutputMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
// send to sink buddies
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp);
|
||||
(*itSink)->getDeviceOutputMessageQueue()->push(report);
|
||||
}
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp);
|
||||
(*itSink)->getDeviceOutputMessageQueue()->push(report);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -348,8 +348,12 @@ void LimeSDRInputGUI::updateStatus()
|
||||
}
|
||||
else
|
||||
{
|
||||
LimeSDRInput::MsgGetDeviceInfo* message = LimeSDRInput::MsgGetDeviceInfo::create();
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
if (m_deviceAPI->isBuddyLeader())
|
||||
{
|
||||
LimeSDRInput::MsgGetDeviceInfo* message = LimeSDRInput::MsgGetDeviceInfo::create();
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
m_deviceStatusCounter = 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user