Check for existing pipes after GUI is created. For #1484

This commit is contained in:
Jon Beniston 2022-10-27 19:15:46 +01:00
parent 9b7a41ad4e
commit a618dae6e7
3 changed files with 25 additions and 0 deletions

View File

@ -44,6 +44,7 @@ MESSAGE_CLASS_DEFINITION(GS232Controller::MsgConfigureGS232Controller, Message)
MESSAGE_CLASS_DEFINITION(GS232Controller::MsgStartStop, Message)
MESSAGE_CLASS_DEFINITION(GS232Controller::MsgReportWorker, Message)
MESSAGE_CLASS_DEFINITION(GS232Controller::MsgReportAvailableChannelOrFeatures, Message)
MESSAGE_CLASS_DEFINITION(GS232Controller::MsgScanAvailableChannelOrFeatures, Message)
const char* const GS232Controller::m_featureIdURI = "sdrangel.feature.gs232controller";
const char* const GS232Controller::m_featureId = "GS232Controller";
@ -197,6 +198,11 @@ bool GS232Controller::handleMessage(const Message& cmd)
}
return true;
}
else if (MsgScanAvailableChannelOrFeatures::match(cmd))
{
scanAvailableChannelsAndFeatures();
return true;
}
else if (GS232ControllerReport::MsgReportAzAl::match(cmd))
{
GS232ControllerReport::MsgReportAzAl& report = (GS232ControllerReport::MsgReportAzAl&) cmd;

View File

@ -119,6 +119,22 @@ public:
{}
};
class MsgScanAvailableChannelOrFeatures : public Message {
MESSAGE_CLASS_DECLARATION
public:
static MsgScanAvailableChannelOrFeatures* create() {
return new MsgScanAvailableChannelOrFeatures();
}
protected:
MsgScanAvailableChannelOrFeatures() :
Message()
{ }
};
GS232Controller(WebAPIAdapterInterface *webAPIAdapterInterface);
virtual ~GS232Controller();
virtual void destroy() { delete this; }

View File

@ -178,6 +178,9 @@ GS232ControllerGUI::GS232ControllerGUI(PluginAPI* pluginAPI, FeatureUISet *featu
displaySettings();
applySettings(true);
makeUIConnections();
// Get pre-existing pipes
m_gs232Controller->getInputMessageQueue()->push(GS232Controller::MsgScanAvailableChannelOrFeatures::create());
}
GS232ControllerGUI::~GS232ControllerGUI()