mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-24 11:12:27 -04:00
LimeSDR output: optimize get device info by checking buddy leadership in the GUI
This commit is contained in:
parent
b867cf2335
commit
efe921ffe7
@ -432,42 +432,39 @@ bool LimeSDROutput::handleMessage(const Message& message)
|
|||||||
}
|
}
|
||||||
else if (MsgGetDeviceInfo::match(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("LimeSDROutput::handleMessage: MsgGetDeviceInfo: temperature: %f", temp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qDebug("LimeSDROutput::handleMessage: MsgGetDeviceInfo: cannot get temperature");
|
||||||
|
}
|
||||||
|
|
||||||
if (m_deviceShared.m_deviceParams->getDevice() && (LMS_GetChipTemperature(m_deviceShared.m_deviceParams->getDevice(), 0, &temp) == 0))
|
// send to oneself
|
||||||
{
|
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp);
|
||||||
qDebug("LimeSDROutput::handleMessage: MsgGetDeviceInfo: temperature: %f", temp);
|
m_deviceAPI->getDeviceOutputMessageQueue()->push(report);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qDebug("LimeSDROutput::handleMessage: MsgGetDeviceInfo: cannot get temperature");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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);
|
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp);
|
||||||
m_deviceAPI->getDeviceOutputMessageQueue()->push(report);
|
(*itSource)->getDeviceOutputMessageQueue()->push(report);
|
||||||
|
}
|
||||||
|
|
||||||
// send to source buddies
|
// send to sink buddies
|
||||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||||
|
|
||||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||||
{
|
{
|
||||||
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp);
|
DeviceLimeSDRShared::MsgReportDeviceInfo *report = DeviceLimeSDRShared::MsgReportDeviceInfo::create(temp);
|
||||||
(*itSource)->getDeviceOutputMessageQueue()->push(report);
|
(*itSink)->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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -342,8 +342,12 @@ void LimeSDROutputGUI::updateStatus()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LimeSDROutput::MsgGetDeviceInfo* message = LimeSDROutput::MsgGetDeviceInfo::create();
|
if (m_deviceAPI->isBuddyLeader())
|
||||||
m_sampleSink->getInputMessageQueue()->push(message);
|
{
|
||||||
|
LimeSDROutput::MsgGetDeviceInfo* message = LimeSDROutput::MsgGetDeviceInfo::create();
|
||||||
|
m_sampleSink->getInputMessageQueue()->push(message);
|
||||||
|
}
|
||||||
|
|
||||||
m_deviceStatusCounter = 0;
|
m_deviceStatusCounter = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user