-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API devicesetChannelDelete channel 0 doesn't appear to work correctly if there are multiple channels #625
Comments
There's a glitch in the deletion handling:
|
In deviceuiset.cpp: void DeviceUISet::deleteChannel(int channelIndex)
{
if ((channelIndex >= 0) && (channelIndex < m_channelInstanceRegistrations.count()))
{
qDebug("DeviceUISet::deleteChannel: delete channel [%s] at %d",
qPrintable(m_channelInstanceRegistrations[channelIndex].m_channelName),
channelIndex);
m_channelInstanceRegistrations[channelIndex].m_gui->destroy();
m_channelInstanceRegistrations.removeAt(channelIndex);
renameChannelInstances();
}
} and AMDemodGUI::~AMDemodGUI()
{
m_deviceUISet->removeRxChannelInstance(this);
delete m_amDemod;
delete ui;
} The destructor removes the instance effectively (it uses |
Implemented in v4.15.5 and v5.10.1 |
I would like to delete a channel using the API.
In the documentation for devicesetChannelDelete (http://127.0.0.1:8091/doc/swagger-ui/index.html#/DeviceSet/devicesetChannelDelete) it says: "delete channel (server only)".
Is the "(server only)" bit a mistake? I presume we should be able to delete channels in the GUI? It appears to work if there is a single channel.
There seems to be a bit of an issue if there are multiple channels however. If there are two channels, you can delete channel 1 then channel 0 successfully. However, if you have two channels, and try to delete channel 0 first, SDRangle will say there are no channels left when trying to delete the second channel (Even though one will still be displayed in the GUI).
E.g:
Start SDRangel:
curl -X POST "http://127.0.0.1:8091/sdrangel/deviceset/0/channel" -H "accept: application/json" -H "Content-Type: application/json" -d "{ "channelType": "AMDemod", "direction": 0, "originatorDeviceSetIndex": 0 }"
{
"message": "Message to add a channel (MsgAddChannel) was submitted successfully"
}
curl -X POST "http://127.0.0.1:8091/sdrangel/deviceset/0/channel" -H "accept: application/json" -H "Content-Type: application/json" -d "{ "channelType": "AMDemod", "direction": 0, "originatorDeviceSetIndex": 0 }"
{
"message": "Message to add a channel (MsgAddChannel) was submitted successfully"
}
curl -X DELETE "http://127.0.0.1:8091/sdrangel/deviceset/0/channel/0" -H "accept: application/json"
{
"message": "Message to delete a channel (MsgDeleteChannel) was submitted successfully"
}
curl -X DELETE "http://127.0.0.1:8091/sdrangel/deviceset/0/channel/0" -H "accept: application/json"
{
"message": "There is no channel at index 0. There are 0 channels"
}
The text was updated successfully, but these errors were encountered: