void service_zoom_full(GtkWidget *text, gpointer data) { gdouble estimated; int fixedwidth; if(GLOBALS->helpbox_is_active) { help_text_bold("\n\nZoom Full"); help_text( " attempts a \"best fit\" to get the whole trace onscreen." " Note that the trace may be more or less than a whole screen since" " this isn't a \"perfect fit.\"" ); return; } if(GLOBALS->wavewidth>4) { fixedwidth=GLOBALS->wavewidth-4; } else { fixedwidth=GLOBALS->wavewidth; } estimated=-log(((gdouble)(GLOBALS->tims.last-GLOBALS->tims.first+1))/((gdouble)fixedwidth)*((gdouble)200.0))/log(GLOBALS->zoombase); if(estimated>((gdouble)(0.0))) estimated=((gdouble)(0.0)); GLOBALS->tims.prevzoom=GLOBALS->tims.zoom; GLOBALS->tims.timecache=0; calczoom(estimated); GLOBALS->tims.zoom=estimated; fix_wavehadj(); gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(GLOBALS->wave_hslider)), "changed"); /* force zoom update */ gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(GLOBALS->wave_hslider)), "value_changed"); /* force zoom update */ DEBUG(printf("Zoombuttons Full\n")); }
void service_left_page(GtkWidget *text, gpointer data) { TimeType ntinc, ntfrac; if(GLOBALS->helpbox_is_active) { help_text_bold("\n\nPage Left"); help_text( " scrolls the display window left one page worth of data." " The net action is that the data scrolls right a page." #ifdef WAVE_USE_GTK2 " Scrollwheel Up also hits this button in non-alternative wheel mode." #endif ); return; } ntinc=(TimeType)(((gdouble)GLOBALS->wavewidth)*GLOBALS->nspx); /* really don't need this var but the speed of ui code is human dependent.. */ ntfrac=ntinc*GLOBALS->page_divisor; if((ntfrac<1)||(ntinc<1)) ntfrac= /*ntinc=*/ 1; /* scan-build */ if((GLOBALS->tims.start-ntfrac)>GLOBALS->tims.first) GLOBALS->tims.timecache=GLOBALS->tims.start-ntfrac; else GLOBALS->tims.timecache=GLOBALS->tims.first; GTK_ADJUSTMENT(GLOBALS->wave_hslider)->value=GLOBALS->tims.timecache; time_update(); DEBUG(printf("Left Page\n")); }
void service_zoom_undo(GtkWidget *text, gpointer data) { gdouble temp; if(GLOBALS->helpbox_is_active) { help_text_bold("\n\nZoom Undo"); help_text( " is used to revert to the previous zoom value used. Undo" " only works one level deep." ); return; } temp=GLOBALS->tims.zoom; GLOBALS->tims.zoom=GLOBALS->tims.prevzoom; GLOBALS->tims.prevzoom=temp; GLOBALS->tims.timecache=0; calczoom(GLOBALS->tims.zoom); fix_wavehadj(); gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(GLOBALS->wave_hslider)), "changed"); /* force zoom update */ gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(GLOBALS->wave_hslider)), "value_changed"); /* force zoom update */ DEBUG(printf("Zoombuttons Undo\n")); }
void service_zoom_in(GtkWidget *text, gpointer data) { if(GLOBALS->helpbox_is_active) { help_text_bold("\n\nZoom In"); help_text( " is used to increase the zoom factor around the marker." #ifdef WAVE_USE_GTK2 " Alt + Scrollwheel Down also hits this button in non-alternative wheel mode." #endif ); return; } if(GLOBALS->tims.zoom<0) /* otherwise it's ridiculous and can cause */ { /* overflow problems in the scope */ TimeType middle=0, width; if(GLOBALS->do_zoom_center) { if((GLOBALS->tims.marker<0)||(GLOBALS->tims.marker<GLOBALS->tims.first)||(GLOBALS->tims.marker>GLOBALS->tims.last)) { if(GLOBALS->tims.end>GLOBALS->tims.last) GLOBALS->tims.end=GLOBALS->tims.last; middle=(GLOBALS->tims.start/2)+(GLOBALS->tims.end/2); if((GLOBALS->tims.start&1)&&(GLOBALS->tims.end&1)) middle++; } else { middle=GLOBALS->tims.marker; } } GLOBALS->tims.prevzoom=GLOBALS->tims.zoom; GLOBALS->tims.zoom++; calczoom(GLOBALS->tims.zoom); if(GLOBALS->do_zoom_center) { width=(TimeType)(((gdouble)GLOBALS->wavewidth)*GLOBALS->nspx); GLOBALS->tims.start=time_trunc(middle-(width/2)); if(GLOBALS->tims.start+width>GLOBALS->tims.last) GLOBALS->tims.start=time_trunc(GLOBALS->tims.last-width); if(GLOBALS->tims.start<GLOBALS->tims.first) GLOBALS->tims.start=GLOBALS->tims.first; GTK_ADJUSTMENT(GLOBALS->wave_hslider)->value=GLOBALS->tims.timecache=GLOBALS->tims.start; } else { GLOBALS->tims.timecache=0; } fix_wavehadj(); gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(GLOBALS->wave_hslider)), "changed"); /* force zoom update */ gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(GLOBALS->wave_hslider)), "value_changed"); /* force zoom update */ DEBUG(printf("Zoombuttons in\n")); } }
void service_zoom_left(GtkWidget *text, gpointer data) { GtkAdjustment *hadj; if(GLOBALS->helpbox_is_active) { help_text_bold("\n\nZoom To Start"); help_text( " is used to jump scroll to the trace's beginning." ); return; } hadj=GTK_ADJUSTMENT(GLOBALS->wave_hslider); hadj->value=GLOBALS->tims.timecache=GLOBALS->tims.first; time_update(); }
void service_zoom_fit(GtkWidget *text, gpointer data) { gdouble estimated; int fixedwidth; if(GLOBALS->helpbox_is_active) { help_text_bold("\n\nZoom Best Fit"); help_text( " attempts a \"best fit\" to get the whole trace onscreen." " Note that the trace may be more or less than a whole screen since" " this isn't a \"perfect fit.\" Also, if the middle button baseline" " marker is nailed down, the zoom instead of getting the whole trace" " onscreen will use the part of the trace between the primary" " marker and the baseline marker." ); return; } if((GLOBALS->tims.baseline>=0)&&(GLOBALS->tims.marker>=0)) { service_dragzoom(GLOBALS->tims.baseline, GLOBALS->tims.marker); /* new semantics added to zoom between the two */ } else { if(GLOBALS->wavewidth>4) { fixedwidth=GLOBALS->wavewidth-4; } else { fixedwidth=GLOBALS->wavewidth; } estimated=-log(((gdouble)(GLOBALS->tims.last-GLOBALS->tims.first+1))/((gdouble)fixedwidth)*((gdouble)200.0))/log(GLOBALS->zoombase); if(estimated>((gdouble)(0.0))) estimated=((gdouble)(0.0)); GLOBALS->tims.prevzoom=GLOBALS->tims.zoom; GLOBALS->tims.timecache=0; calczoom(estimated); GLOBALS->tims.zoom=estimated; fix_wavehadj(); gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(GLOBALS->wave_hslider)), "changed"); /* force zoom update */ gtk_signal_emit_by_name (GTK_OBJECT (GTK_ADJUSTMENT(GLOBALS->wave_hslider)), "value_changed"); /* force zoom update */ } DEBUG(printf("Zoombuttons Fit\n")); }
void service_right_edge(GtkWidget *text, gpointer data) { (void)text; (void)data; if(GLOBALS->helpbox_is_active) { help_text_bold("\n\nFind Next Edge"); help_text( " moves the marker to the closest transition to the right of the marker" " of the first highlighted trace. If the marker is not nailed down, it starts from min time." ); return; } edge_search(STRACE_FORWARD); DEBUG(printf("Edge Right\n")); }
void service_right_page(GtkWidget *text, gpointer data) { TimeType ntinc, ntfrac; if(GLOBALS->helpbox_is_active) { help_text_bold("\n\nPage Right"); help_text( " scrolls the display window right one page worth of data." " The net action is that the data scrolls left a page." #ifdef WAVE_USE_GTK2 " Scrollwheel Down also hits this button in non-alternative wheel mode." #endif ); return; } ntinc=(TimeType)(((gdouble)GLOBALS->wavewidth)*GLOBALS->nspx); ntfrac=ntinc*GLOBALS->page_divisor; if((ntfrac<1)||(ntinc<1)) ntfrac=ntinc=1; if((GLOBALS->tims.start+ntfrac)<(GLOBALS->tims.last-ntinc+1)) { GLOBALS->tims.timecache=GLOBALS->tims.start+ntfrac; } else { GLOBALS->tims.timecache=GLOBALS->tims.last-ntinc+1; if(GLOBALS->tims.timecache<GLOBALS->tims.first) GLOBALS->tims.timecache=GLOBALS->tims.first; } GTK_ADJUSTMENT(GLOBALS->wave_hslider)->value=GLOBALS->tims.timecache; time_update(); DEBUG(printf("Right Page\n")); }
void service_zoom_right(GtkWidget *text, gpointer data) { GtkAdjustment *hadj; TimeType ntinc; if(GLOBALS->helpbox_is_active) { help_text_bold("\n\nZoom To End"); help_text( " is used to jump scroll to the trace's end." ); return; } ntinc=(TimeType)(((gdouble)GLOBALS->wavewidth)*GLOBALS->nspx); GLOBALS->tims.timecache=GLOBALS->tims.last-ntinc+1; if(GLOBALS->tims.timecache<GLOBALS->tims.first) GLOBALS->tims.timecache=GLOBALS->tims.first; hadj=GTK_ADJUSTMENT(GLOBALS->wave_hslider); hadj->value=GLOBALS->tims.timecache; time_update(); }