- if (device) {
- if (!session_device)
- {
- session_ = device_manager_.context()->create_session();
-
- try {
- device->open();
- } catch(const sigrok::Error &e) {
- throw QString(e.what());
- }
-
- session_->add_device(device);
- }
-
- device_ = device;
- session_->add_datafeed_callback([=]
- (shared_ptr<Device> device, shared_ptr<Packet> packet) {
- data_feed_in(device, packet);
- });
- device_manager_.update_display_name(device);
- update_signals(device);
- } else
- device_ = nullptr;
-