forked from Ivasoft/DSView
The device can only be accessed by one process
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user