Re: [Gtkwave-users] (no subject)
Brought to you by:
gtkwave,
joel1234567
From: <by...@nc...> - 2018-05-24 04:31:31
|
In zoombuttons.c, you can first look at the function service_zoom_fit(), specifically for the equations involving the variable "estimated". You'll have to add some printf() statements to see what the variables leading into it are in case they have changed from the defaults in globals.c. That example would specifically show how to fit the whole time range into the waves portion of the screen and calculate the appropriate zoom value. In wavewindow.c there is a function calczoom() that shows how a given zoom value translates into nanoseconds per pixel and pixels per nanosecond. The "nano" part of those names is a misnomer, and is really whatever the time units are supposed to be for a given trace such as that seen in a VCD file's $timescale directive. The mapping itself is fairly simple: frame=pow(GLOBALS->zoombase,-z0); There are some extra tricks to get mapping of the divider lines to powers of ten for the units, also seen in that function. At first it all looks complicated, but it's not too bad. Those equations are probably unchanged since way back in the gtkwave 1.3 series. -Tony |