2
0
forked from Ivasoft/DSView

The device can only be accessed by one process

This commit is contained in:
dreamsourcelabTAI
2023-05-11 10:36:52 +08:00
parent 1f8487e0f1
commit ae5c4e63c3
6 changed files with 45 additions and 13 deletions

View File

@@ -1837,20 +1837,20 @@ namespace pv
case DSV_MSG_NEW_USB_DEVICE:
{
_sampling_bar->update_device_list();
if (_session->get_device()->is_demo() == false)
{
QString msgText = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TO_SWITCH_DEVICE), "To switch the new device?");
if (MsgBox::Confirm(msgText) == false){
_sampling_bar->update_device_list(); // Update the list only.
if (MsgBox::Confirm(msgText) == false){
return;
}
}
// The store confirm is not processed.
if (_is_save_confirm_msg){
_is_auto_switch_device = true;
_sampling_bar->update_device_list();
_is_auto_switch_device = true;
return;
}

View File

@@ -225,6 +225,8 @@ namespace pv
_device_status = ST_INIT;
ds_device_handle old_dev = _device_agent.handle();
if (ds_active_device(dev_handle) != SR_OK)
{
dsv_err("%s", "Switch device error!");
@@ -258,6 +260,12 @@ namespace pv
delay_prop_msg(strMsg);
}
if (_device_agent.handle() != dev_handle && old_dev != NULL_HANDLE)
{
QString strMsg = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DEVICE_BUSY_SWITCH_FAILED), "Device is busy!");
MsgBox::Show("",strMsg);
}
return true;
}