]> sigrok.org Git - pulseview.git/commitdiff
Made SigSession::update_signals take sdi as a parameter
authorJoel Holdsworth <redacted>
Sat, 31 Aug 2013 12:28:02 +0000 (13:28 +0100)
committerJoel Holdsworth <redacted>
Tue, 3 Sep 2013 11:52:42 +0000 (12:52 +0100)
pv/sigsession.cpp
pv/sigsession.h

index cbdbac07c2031d6232af8089bbf51b7f25d403ac..6d8e09d6c231be69e4e9ec65f635b5e3c7c9fd1b 100644 (file)
@@ -79,7 +79,7 @@ void SigSession::set_device(struct sr_dev_inst *sdi)
        if (sdi)
                _device_manager.use_device(sdi, this);
        _sdi = sdi;
        if (sdi)
                _device_manager.use_device(sdi, this);
        _sdi = sdi;
-       update_signals();
+       update_signals(sdi);
 }
 
 void SigSession::release_device(struct sr_dev_inst *sdi)
 }
 
 void SigSession::release_device(struct sr_dev_inst *sdi)
@@ -88,7 +88,7 @@ void SigSession::release_device(struct sr_dev_inst *sdi)
 
        assert(_capture_state == Stopped);
        _sdi = NULL;
 
        assert(_capture_state == Stopped);
        _sdi = NULL;
-       update_signals();
+       update_signals(NULL);
 }
 
 void SigSession::load_file(const string &name,
 }
 
 void SigSession::load_file(const string &name,
@@ -246,7 +246,7 @@ sr_input* SigSession::load_input_file_format(const string &filename,
        return in;
 }
 
        return in;
 }
 
-void SigSession::update_signals()
+void SigSession::update_signals(const sr_dev_inst *const sdi)
 {
        assert(_capture_state == Stopped);
 
 {
        assert(_capture_state == Stopped);
 
@@ -255,8 +255,8 @@ void SigSession::update_signals()
        unsigned int analog_probe_count = 0;
 
        // Detect what data types we will receive
        unsigned int analog_probe_count = 0;
 
        // Detect what data types we will receive
-       if(_sdi) {
-               for (const GSList *l = _sdi->probes; l; l = l->next) {
+       if(sdi) {
+               for (const GSList *l = sdi->probes; l; l = l->next) {
                        const sr_probe *const probe = (const sr_probe *)l->data;
                        if (!probe->enabled)
                                continue;
                        const sr_probe *const probe = (const sr_probe *)l->data;
                        if (!probe->enabled)
                                continue;
@@ -297,8 +297,8 @@ void SigSession::update_signals()
 
                _signals.clear();
 
 
                _signals.clear();
 
-               if(_sdi) {
-                       for (const GSList *l = _sdi->probes; l; l = l->next) {
+               if(sdi) {
+                       for (const GSList *l = sdi->probes; l; l = l->next) {
                                const sr_probe *const probe =
                                        (const sr_probe *)l->data;
                                assert(probe);
                                const sr_probe *const probe =
                                        (const sr_probe *)l->data;
                                assert(probe);
index 6e23c63240b21489e4031d5b1f3066a72d5603e3..296f28d51a1b4150f074c85d197319f29acac8d2 100644 (file)
@@ -92,7 +92,7 @@ public:
 private:
        void set_capture_state(capture_state state);
 
 private:
        void set_capture_state(capture_state state);
 
-       void update_signals();
+       void update_signals(const sr_dev_inst *const sdi);
 
        bool is_trigger_enabled() const;
 
 
        bool is_trigger_enabled() const;