Rename 'probe group' to 'channel group' everywhere.
authorUwe Hermann <uwe@hermann-uwe.de>
Fri, 14 Mar 2014 20:46:10 +0000 (21:46 +0100)
committerUwe Hermann <uwe@hermann-uwe.de>
Tue, 25 Mar 2014 17:59:10 +0000 (18:59 +0100)
This is required to adapt to the same rename in libsigrok.

The --probe-group command-line option is now called --channel-group
(however, the short version -g remains the same as it means "group").

This is an update related to bug #259.

device.c
doc/sigrok-cli.1
main.c
session.c
show.c
sigrok-cli.h

index cfd456609f30bf63ec333d9d178cb4eb580e5958..b8709dc2bf0a7a4cca8eb559fdb21f34cc7ecf70 100644 (file)
--- a/device.c
+++ b/device.c
@@ -24,7 +24,7 @@
 
 extern struct sr_context *sr_ctx;
 extern gchar *opt_drv;
-extern gchar *opt_probe_group;
+extern gchar *opt_channel_group;
 
 /* Convert driver options hash to GSList of struct sr_config. */
 static GSList *hash_to_hwopt(GHashTable *hash)
@@ -116,23 +116,23 @@ GSList *device_scan(void)
        return devices;
 }
 
-struct sr_probe_group *select_probe_group(struct sr_dev_inst *sdi)
+struct sr_channel_group *select_channel_group(struct sr_dev_inst *sdi)
 {
-       struct sr_probe_group *pg;
+       struct sr_channel_group *cg;
        GSList *l;
 
-       if (!opt_probe_group)
+       if (!opt_channel_group)
                return NULL;
 
-       if (!sdi->probe_groups) {
-               g_critical("This device does not have any probe groups.");
+       if (!sdi->channel_groups) {
+               g_critical("This device does not have any channel groups.");
                return NULL;
        }
 
-       for (l = sdi->probe_groups; l; l = l->next) {
-               pg = l->data;
-               if (!strcasecmp(opt_probe_group, pg->name)) {
-                       return pg;
+       for (l = sdi->channel_groups; l; l = l->next) {
+               cg = l->data;
+               if (!strcasecmp(opt_channel_group, cg->name)) {
+                       return cg;
                }
        }
 
index ce93cd214adeeefa071cb2c77d2fe9424967b637..400152eab29840b94c2844df11cb5d81e6da563c 100644 (file)
@@ -169,11 +169,11 @@ for probes 5 and 6 will be reset to the defaults by the
 .B "1\-8"
 probe selection.
 .TP
-.BR "\-g, \-\-probe\-group "<probe\ group>
-Specify the probe group to operate on.
+.BR "\-g, \-\-channel\-group "<channel\ group>
+Specify the channel group to operate on.
 
-Some devices organize probes into groups, the settings of which can
-only be changed as a group. The list of probe groups, if any, is displayed
+Some devices organize channels into groups, the settings of which can
+only be changed as a group. The list of channel groups, if any, is displayed
 with the \-\-show command.
 .TP
 .BR "\-t, \-\-triggers " <triggerlist>
diff --git a/main.c b/main.c
index 271d28a99271f6c61f77570e897fe45aee32b1d4..41335a7f482f6914bea15914521ec6a6d757948f 100644 (file)
--- a/main.c
+++ b/main.c
@@ -36,7 +36,7 @@ gchar *opt_output_file = NULL;
 gchar *opt_drv = NULL;
 gchar *opt_config = NULL;
 static gchar *opt_probes = NULL;
-gchar *opt_probe_group = NULL;
+gchar *opt_channel_group = NULL;
 gchar *opt_triggers = NULL;
 gchar *opt_pds = NULL;
 #ifdef HAVE_SRD
@@ -73,8 +73,8 @@ static GOptionEntry optargs[] = {
                        "Output format", NULL},
        {"probes", 'p', 0, G_OPTION_ARG_STRING, &opt_probes,
                        "Probes to use", NULL},
-       {"probe-group", 'g', 0, G_OPTION_ARG_STRING, &opt_probe_group,
-                       "Probe groups", NULL},
+       {"channel-group", 'g', 0, G_OPTION_ARG_STRING, &opt_channel_group,
+                       "Channel groups", NULL},
        {"triggers", 't', 0, G_OPTION_ARG_STRING, &opt_triggers,
                        "Trigger configuration", NULL},
        {"wait-trigger", 'w', 0, G_OPTION_ARG_NONE, &opt_wait_trigger,
index 65c4c60c51b6a8f5ff8a9f27ccede18189e802c4..e05cebc5e88f0174637498b45648f9c5b9fa595d 100644 (file)
--- a/session.c
+++ b/session.c
@@ -506,7 +506,7 @@ int opt_to_gvar(char *key, char *value, struct sr_config *src)
 int set_dev_options(struct sr_dev_inst *sdi, GHashTable *args)
 {
        struct sr_config src;
-       struct sr_probe_group *pg;
+       struct sr_channel_group *cg;
        GHashTableIter iter;
        gpointer key, value;
        int ret;
@@ -515,8 +515,8 @@ int set_dev_options(struct sr_dev_inst *sdi, GHashTable *args)
        while (g_hash_table_iter_next(&iter, &key, &value)) {
                if ((ret = opt_to_gvar(key, value, &src)) != 0)
                        return ret;
-               pg = select_probe_group(sdi);
-               ret = sr_config_set(sdi, pg, src.key, src.data);
+               cg = select_channel_group(sdi);
+               ret = sr_config_set(sdi, cg, src.key, src.data);
                if (ret != SR_OK) {
                        g_critical("Failed to set device option '%s'.", (char *)key);
                        return ret;
diff --git a/show.c b/show.c
index d546376cd6b1275045183d1607bb934a3bde6b7b..b8560be30e2d7970a9a987f96ed871a2ab0f28cc 100644 (file)
--- a/show.c
+++ b/show.c
@@ -200,8 +200,8 @@ void show_dev_detail(void)
        struct sr_dev_inst *sdi;
        const struct sr_config_info *srci;
        struct sr_probe *probe;
-       struct sr_probe_group *probe_group, *pg;
-       GSList *devices, *pgl, *prl;
+       struct sr_channel_group *channel_group, *cg;
+       GSList *devices, *cgl, *prl;
        GVariant *gvar_opts, *gvar_dict, *gvar_list, *gvar;
        gsize num_opts, num_elements;
        double dlow, dhigh, dcur_low, dcur_high;
@@ -246,23 +246,23 @@ void show_dev_detail(void)
                g_variant_unref(gvar_opts);
        }
 
-       /* Selected probes and probe group may affect which options are
+       /* Selected channels and channel group may affect which options are
         * returned, or which values for them. */
        select_probes(sdi);
-       probe_group = select_probe_group(sdi);
+       channel_group = select_channel_group(sdi);
 
-       if ((sr_config_list(sdi->driver, sdi, probe_group, SR_CONF_DEVICE_OPTIONS,
+       if ((sr_config_list(sdi->driver, sdi, channel_group, SR_CONF_DEVICE_OPTIONS,
                        &gvar_opts)) != SR_OK)
                /* Driver supports no device instance options. */
                return;
 
-       if (sdi->probe_groups) {
-               printf("Probe groups:\n");
-               for (pgl = sdi->probe_groups; pgl; pgl = pgl->next) {
-                       pg = pgl->data;
-                       printf("    %s: channel%s", pg->name,
-                                       g_slist_length(pg->probes) > 1 ? "s" : "");
-                       for (prl = pg->probes; prl; prl = prl->next) {
+       if (sdi->channel_groups) {
+               printf("Channel groups:\n");
+               for (cgl = sdi->channel_groups; cgl; cgl = cgl->next) {
+                       cg = cgl->data;
+                       printf("    %s: channel%s", cg->name,
+                                       g_slist_length(cg->channels) > 1 ? "s" : "");
+                       for (prl = cg->channels; prl; prl = prl->next) {
                                probe = prl->data;
                                printf(" %s", probe->name);
                        }
@@ -271,11 +271,11 @@ void show_dev_detail(void)
        }
 
        printf("Supported configuration options");
-       if (sdi->probe_groups) {
-               if (!probe_group)
-                       printf(" across all probe groups");
+       if (sdi->channel_groups) {
+               if (!channel_group)
+                       printf(" across all channel groups");
                else
-                       printf(" on probe group %s", probe_group->name);
+                       printf(" on channel group %s", channel_group->name);
        }
        printf(":\n");
        opts = g_variant_get_fixed_array(gvar_opts, &num_opts, sizeof(int32_t));
@@ -284,7 +284,7 @@ void show_dev_detail(void)
                        continue;
 
                if (srci->key == SR_CONF_TRIGGER_TYPE) {
-                       if (sr_config_list(sdi->driver, sdi, probe_group, srci->key,
+                       if (sr_config_list(sdi->driver, sdi, channel_group, srci->key,
                                        &gvar) != SR_OK) {
                                printf("\n");
                                continue;
@@ -305,7 +305,7 @@ void show_dev_detail(void)
                         * only to those that don't support compression, or
                         * have it turned off by default. The values returned
                         * are the low/high limits. */
-                       if (sr_config_list(sdi->driver, sdi, probe_group, srci->key,
+                       if (sr_config_list(sdi->driver, sdi, channel_group, srci->key,
                                        &gvar) != SR_OK) {
                                continue;
                        }
@@ -316,7 +316,7 @@ void show_dev_detail(void)
                } else if (srci->key == SR_CONF_SAMPLERATE) {
                        /* Supported samplerates */
                        printf("    %s", srci->id);
-                       if (sr_config_list(sdi->driver, sdi, probe_group, SR_CONF_SAMPLERATE,
+                       if (sr_config_list(sdi->driver, sdi, channel_group, SR_CONF_SAMPLERATE,
                                        &gvar_dict) != SR_OK) {
                                printf("\n");
                                continue;
@@ -359,7 +359,7 @@ void show_dev_detail(void)
                } else if (srci->key == SR_CONF_BUFFERSIZE) {
                        /* Supported buffer sizes */
                        printf("    %s", srci->id);
-                       if (sr_config_list(sdi->driver, sdi, probe_group,
+                       if (sr_config_list(sdi->driver, sdi, channel_group,
                                        SR_CONF_BUFFERSIZE, &gvar_list) != SR_OK) {
                                printf("\n");
                                continue;
@@ -374,7 +374,7 @@ void show_dev_detail(void)
                } else if (srci->key == SR_CONF_TIMEBASE) {
                        /* Supported time bases */
                        printf("    %s", srci->id);
-                       if (sr_config_list(sdi->driver, sdi, probe_group,
+                       if (sr_config_list(sdi->driver, sdi, channel_group,
                                        SR_CONF_TIMEBASE, &gvar_list) != SR_OK) {
                                printf("\n");
                                continue;
@@ -393,7 +393,7 @@ void show_dev_detail(void)
                } else if (srci->key == SR_CONF_VDIV) {
                        /* Supported volts/div values */
                        printf("    %s", srci->id);
-                       if (sr_config_list(sdi->driver, sdi, probe_group,
+                       if (sr_config_list(sdi->driver, sdi, channel_group,
                                        SR_CONF_VDIV, &gvar_list) != SR_OK) {
                                printf("\n");
                                continue;
@@ -411,14 +411,14 @@ void show_dev_detail(void)
 
                } else if (srci->datatype == SR_T_CHAR) {
                        printf("    %s: ", srci->id);
-                       if (sr_config_get(sdi->driver, sdi, probe_group, srci->key,
+                       if (sr_config_get(sdi->driver, sdi, channel_group, srci->key,
                                        &gvar) == SR_OK) {
                                tmp_str = g_strdup(g_variant_get_string(gvar, NULL));
                                g_variant_unref(gvar);
                        } else
                                tmp_str = NULL;
 
-                       if (sr_config_list(sdi->driver, sdi, probe_group, srci->key,
+                       if (sr_config_list(sdi->driver, sdi, channel_group, srci->key,
                                        &gvar) != SR_OK) {
                                printf("\n");
                                continue;
@@ -439,7 +439,7 @@ void show_dev_detail(void)
 
                } else if (srci->datatype == SR_T_UINT64_RANGE) {
                        printf("    %s: ", srci->id);
-                       if (sr_config_list(sdi->driver, sdi, probe_group, srci->key,
+                       if (sr_config_list(sdi->driver, sdi, channel_group, srci->key,
                                        &gvar_list) != SR_OK) {
                                printf("\n");
                                continue;
index 278eb8fcaa5ba3ea991886ccd8c3a85cf6da8e64..7a5c3f5fd870513a369b620a0d20e8e1c848c637 100644 (file)
@@ -41,7 +41,7 @@ void show_pd_detail(void);
 
 /* device.c */
 GSList *device_scan(void);
-struct sr_probe_group *select_probe_group(struct sr_dev_inst *sdi);
+struct sr_channel_group *select_channel_group(struct sr_dev_inst *sdi);
 
 /* session.c */
 int setup_output_format(void);