]> sigrok.org Git - pulseview.git/blobdiff - pv/devicemanager.hpp
Fix #1198 by removing the 1:1 zoom button
[pulseview.git] / pv / devicemanager.hpp
index 145f9e80a44e68fbfa96bafe027a4a2781c89e75..9b8ef3d120a3a4c68f97a9e359156270516ed4eb 100644 (file)
 #include <list>
 #include <map>
 #include <memory>
+#include <set>
 #include <string>
+#include <vector>
+
+using std::list;
+using std::map;
+using std::set;
+using std::shared_ptr;
+using std::string;
+using std::vector;
 
 namespace Glib {
 class VariantBase;
@@ -35,6 +44,8 @@ class Context;
 class Driver;
 }
 
+using sigrok::ConfigKey;
+
 namespace pv {
 
 namespace devices {
@@ -47,34 +58,42 @@ class Session;
 class DeviceManager
 {
 public:
-       DeviceManager(std::shared_ptr<sigrok::Context> context);
+       DeviceManager(shared_ptr<sigrok::Context> context,
+               std::string driver, bool do_scan);
 
        ~DeviceManager() = default;
 
-       const std::shared_ptr<sigrok::Context>& context() const;
+       const shared_ptr<sigrok::Context>& context() const;
 
-       std::shared_ptr<sigrok::Context> context();
+       shared_ptr<sigrok::Context> context();
 
-       const std::list< std::shared_ptr<devices::HardwareDevice> >&
-               devices() const;
+       const list< shared_ptr<devices::HardwareDevice> >& devices() const;
+       shared_ptr<devices::HardwareDevice> user_spec_device() const;
 
-       std::list< std::shared_ptr<devices::HardwareDevice> > driver_scan(
-               std::shared_ptr<sigrok::Driver> driver,
-               std::map<const sigrok::ConfigKey *, Glib::VariantBase> drvopts);
+       bool driver_supported(shared_ptr<sigrok::Driver> driver) const;
 
-       const std::map<std::string, std::string> get_device_info(
-               const std::shared_ptr<devices::Device> device);
+       list< shared_ptr<devices::HardwareDevice> > driver_scan(
+               shared_ptr<sigrok::Driver> driver,
+               map<const sigrok::ConfigKey *, Glib::VariantBase> drvopts);
 
-       const std::shared_ptr<devices::HardwareDevice> find_device_from_info(
-               const std::map<std::string, std::string> search_info);
+       const map<string, string> get_device_info(
+               const shared_ptr<devices::Device> device);
+
+       const shared_ptr<devices::HardwareDevice> find_device_from_info(
+               const map<string, string> search_info);
 
 private:
-       bool compare_devices(std::shared_ptr<devices::Device> a,
-               std::shared_ptr<devices::Device> b);
+       bool compare_devices(shared_ptr<devices::Device> a,
+               shared_ptr<devices::Device> b);
+
+       static map<const ConfigKey *, Glib::VariantBase>
+       drive_scan_options(vector<string> user_spec,
+               set<const ConfigKey *> driver_opts);
 
 protected:
-       std::shared_ptr<sigrok::Context> context_;
-       std::list< std::shared_ptr<devices::HardwareDevice> > devices_;
+       shared_ptr<sigrok::Context> context_;
+       list< shared_ptr<devices::HardwareDevice> > devices_;
+       shared_ptr<devices::HardwareDevice> user_spec_device_;
 };
 
 } // namespace pv