From 5185e11e169fedb70cd118f3f79242379cf4df38 Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Tue, 15 Sep 2026 21:44:53 +0200 Subject: [PATCH 1/6] halcope: optimize selection colors The selection colors were to bright, so seen almost as white --- src/hal/utils/scope_disp.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/hal/utils/scope_disp.c b/src/hal/utils/scope_disp.c index 4953b697048..15a6a09f008 100644 --- a/src/hal/utils/scope_disp.c +++ b/src/hal/utils/scope_disp.c @@ -301,22 +301,22 @@ int normal_colors[16][3] = { }; int selected_colors[16][3] = { - {255, 204, 204}, - {204, 255, 255}, - {229, 255, 204}, - {229, 204, 255}, - {255, 242, 204}, - {204, 255, 216}, - {204, 216, 255}, - {255, 204, 242}, - {229, 186, 160}, - {220, 229, 160}, - {169, 229, 160}, - {160, 229, 203}, - {160, 203, 229}, - {169, 160, 229}, - {220, 160, 229}, - {229, 160, 186}, + {255, 128, 128}, + {128, 255, 255}, + {179, 255, 128}, + {179, 128, 255}, + {255, 204, 128}, + {128, 255, 153}, + {128, 153, 255}, + {255, 128, 204}, + {204, 153, 128}, + {204, 255, 153}, + {153, 255, 153}, + {153, 255, 204}, + {153, 204, 255}, + {153, 128, 255}, + {204, 128, 255}, + {255, 128, 179}, }; From 56181536464617737878b02d6efc801d89859046 Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Tue, 15 Sep 2026 21:49:14 +0200 Subject: [PATCH 2/6] halscope: trigger line optimization - change the style of the dotted line - reduce the size of the edge indicator arrow- - swap colors: the trigger arrow now has the color of the channel instead of the trigger line --- src/hal/utils/scope_disp.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/hal/utils/scope_disp.c b/src/hal/utils/scope_disp.c index 15a6a09f008..f55a698c21d 100644 --- a/src/hal/utils/scope_disp.c +++ b/src/hal/utils/scope_disp.c @@ -714,7 +714,7 @@ void draw_triggerline(int chan_num, int highlight) { chan->scale * ((chan->position - trig->level) * 10) + chan->vert_offset; - const double dashes[2] = {2,4}; + const double dashes[2] = {6,6}; int ndash = sizeof(dashes) / sizeof(dashes[0]); int y1 = (fp_level-yfoffset) * yscale + ypoffset; @@ -728,23 +728,26 @@ void draw_triggerline(int chan_num, int highlight) { if(ctrl_shm->trig_edge) dy = -dy; + /* set color for trigger line and edge indicator */ if(highlight) { - gdk_cairo_set_source_rgba(disp->context, &disp->color_selected[chan_num - 1]); + gdk_cairo_set_source_rgba(disp->context, &disp->color_grid); } else { - gdk_cairo_set_source_rgba(disp->context, &disp->color_normal[chan_num - 1]); + gdk_cairo_set_source_rgba(disp->context, &disp->color_baseline); } cairo_set_dash(disp->context, dashes, ndash, 0.0); line(chan_num | 0x200, 0, y1, disp->width, y1); /* setting ndash = 0 to disable dashing */ cairo_set_dash(disp->context, dashes, 0, 0.0); + /* set color for trigger edge indicator */ if(highlight) { - gdk_cairo_set_source_rgba(disp->context, &disp->color_grid); + gdk_cairo_set_source_rgba(disp->context, &disp->color_selected[chan_num - 1]); } else { - gdk_cairo_set_source_rgba(disp->context, &disp->color_baseline); + gdk_cairo_set_source_rgba(disp->context, &disp->color_normal[chan_num - 1]); } + /* draw trigger edge indicator */ line(chan_num | 0x300, 2*dx, y1, 2*dx, y1 + 2*dy); - line(chan_num | 0x300, dx, y1+dy, 2*dx, y1 + 2*dy); - line(chan_num | 0x300, 3*dx, y1+dy, 2*dx, y1 + 2*dy); + line(chan_num | 0x300, (2-0.7)*dx, y1+1.2*dy, 2*dx, y1 + 2*dy); + line(chan_num | 0x300, (2+0.7)*dx, y1+1.2*dy, 2*dx, y1 + 2*dy); } From e0a77a0690da8b8b214da6bcdf9980f15d33dc5b Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Tue, 15 Sep 2026 21:49:33 +0200 Subject: [PATCH 3/6] halscope: change "Gain" to "Scale" This describes the setting better and is consistent with the label named "Scale". Further this is the common way how it is labeled on oscilloscopes. --- src/hal/utils/scope_vert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hal/utils/scope_vert.c b/src/hal/utils/scope_vert.c index daddb16b3c8..ab4557e82fa 100644 --- a/src/hal/utils/scope_vert.c +++ b/src/hal/utils/scope_vert.c @@ -593,7 +593,7 @@ static void init_vert_info_window(void) 0); /* box for the scale slider */ vbox = gtk_vbox_new_in_box(FALSE, 0, 0, hbox, TRUE, TRUE, 0); - gtk_label_new_in_box(_("Gain"), vbox, FALSE, FALSE, 0); + gtk_label_new_in_box(_("Scale"), vbox, FALSE, FALSE, 0); vert->scale_adj = gtk_adjustment_new(0, -5, 5, 1, 1, 0); vert->scale_slider = gtk_scale_new( GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT(vert->scale_adj)); From 60cc36393fce8c74c5a04931bc891787ef116d00 Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Tue, 15 Sep 2026 21:49:43 +0200 Subject: [PATCH 4/6] halscope: show "----" for offset when no channel is selected --- src/hal/utils/scope_vert.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hal/utils/scope_vert.c b/src/hal/utils/scope_vert.c index ab4557e82fa..0441b3b893d 100644 --- a/src/hal/utils/scope_vert.c +++ b/src/hal/utils/scope_vert.c @@ -628,6 +628,7 @@ static void init_vert_info_window(void) /* Offset control */ vert->offset_button = gtk_button_new_with_label(_("Offset\n----")); vert->offset_label = gtk_bin_get_child(GTK_BIN(vert->offset_button)); + gtk_label_set_justify(GTK_LABEL(vert->offset_label), GTK_JUSTIFY_CENTER); gtk_box_pack_start(GTK_BOX(ctrl_usr->vert_info_win), vert->offset_button, FALSE, FALSE, 0); g_signal_connect(vert->offset_button, "clicked", @@ -1067,6 +1068,7 @@ void channel_changed(void) gtk_label_set_text_if(vert->scale_label, "----"); gtk_label_set_text_if(vert->chan_num_label, "--"); gtk_label_set_text_if(vert->source_name_label, "------"); + gtk_label_set_text_if(vert->offset_label, _("Offset\n----")); request_display_refresh(1); return; } From 027271a479574ce33c12c010bee25b6094141ec6 Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Tue, 15 Sep 2026 21:49:53 +0200 Subject: [PATCH 5/6] halscope: gray out vertical box when no channel is selected --- src/hal/utils/scope_vert.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hal/utils/scope_vert.c b/src/hal/utils/scope_vert.c index 0441b3b893d..9622b292417 100644 --- a/src/hal/utils/scope_vert.c +++ b/src/hal/utils/scope_vert.c @@ -1069,9 +1069,13 @@ void channel_changed(void) gtk_label_set_text_if(vert->chan_num_label, "--"); gtk_label_set_text_if(vert->source_name_label, "------"); gtk_label_set_text_if(vert->offset_label, _("Offset\n----")); + /* gray out the Vertical info box when no channel is selected */ + gtk_widget_set_sensitive(ctrl_usr->vert_info_win, FALSE); request_display_refresh(1); return; } + /* enable the Vertical info box when a channel is selected */ + gtk_widget_set_sensitive(ctrl_usr->vert_info_win, TRUE); chan = &(ctrl_usr->chan[vert->selected - 1]); /* set position slider based on new channel */ gtk_adjustment_set_value(GTK_ADJUSTMENT(vert->pos_adj), From 562e54f9798783676f52f60d3b9185acef58ab5b Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Tue, 15 Sep 2026 21:50:03 +0200 Subject: [PATCH 6/6] halscope: change label for trigger level of digital signals from "----" to "digital" --- src/hal/utils/scope_trig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hal/utils/scope_trig.c b/src/hal/utils/scope_trig.c index 68d436ed783..b254f75d30c 100644 --- a/src/hal/utils/scope_trig.c +++ b/src/hal/utils/scope_trig.c @@ -177,7 +177,7 @@ void refresh_trigger(void) break; } if (chan->data_type == HAL_BOOL) { - snprintf(buf, BUFLEN, " ---- "); + snprintf(buf, BUFLEN, "digital"); gtk_widget_set_sensitive(GTK_WIDGET(trig->level_slider), 0); } else { format_signal_value(buf, BUFLEN, fp_level);