Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions src/hal/utils/scope_disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
};


Expand Down Expand Up @@ -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;
Expand All @@ -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);
}


Expand Down
2 changes: 1 addition & 1 deletion src/hal/utils/scope_trig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion src/hal/utils/scope_vert.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -1067,9 +1068,14 @@ 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----"));
/* 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),
Expand Down
Loading