]> sigrok.org Git - libsigrokflow.git/commitdiff
Create 8 logic channels on dummy device used for output.
authorMartin Ling <redacted>
Thu, 10 Jan 2019 00:24:32 +0000 (00:24 +0000)
committerUwe Hermann <redacted>
Thu, 10 Jan 2019 01:06:01 +0000 (02:06 +0100)
include/libsigrokflow/libsigrokflow.hpp
src/legacy_output.cpp

index 8f188248749e6bcf6693d22b5409650349e872c9..56e248d7a61aa0a3497b2595bfceb96a2385997d 100644 (file)
@@ -175,7 +175,7 @@ public:
 
 private:
        shared_ptr<sigrok::OutputFormat> libsigrok_output_format_;
-       shared_ptr<sigrok::Device> libsigrok_device_;
+       shared_ptr<sigrok::UserDevice> libsigrok_device_;
        shared_ptr<sigrok::Output> libsigrok_output_;
        map<string, Glib::VariantBase> options_;
 };
index 6e32c8bb309fae8a836bca240124d73c0cf7069b..21d8c2fd6989b01ec548cb102a5daea173007508 100644 (file)
@@ -67,6 +67,11 @@ Glib::RefPtr<LegacyOutput>LegacyOutput::create(
        output->libsigrok_output_format_ = libsigrok_output_format;
        auto context = libsigrok_output_format->parent();
        output->libsigrok_device_ = context->create_user_device("Vendor", "Model", "Version");
+       for (int i = 0; i < 8; ++i) {
+               gchar *name = g_strdup_printf("D%d", i);
+               output->libsigrok_device_->add_channel(i, sigrok::ChannelType::LOGIC, name);
+               g_free(name);
+       }
        output->options_ = options;
 
        return output;