diff options
author | Xiao Pan <xyz@flylightning.xyz> | 2025-04-26 16:31:37 -0700 |
---|---|---|
committer | Xiao Pan <xyz@flylightning.xyz> | 2025-04-26 16:31:37 -0700 |
commit | f3d0fb2a307a16f3ab86bf8640e5db07e1588c34 (patch) | |
tree | 29e09ec20b1e2b924a7e2b2becae5c4c3400f190 /remote_plot.c | |
parent | 2d9707e4609552eca377585b4beb9aa16a60ea31 (diff) |
guess temp min max
Diffstat (limited to 'remote_plot.c')
-rw-r--r-- | remote_plot.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/remote_plot.c b/remote_plot.c index 0ef797b..cb2c1a2 100644 --- a/remote_plot.c +++ b/remote_plot.c @@ -386,7 +386,8 @@ static void draw_function (GtkDrawingArea *area, { //printf("draw begin\n"); DATA *data=user_data; - PLFLT xmin = data->t[0], xmax = data->t[LEN-1], ymin = 0, ymax = 6.; + PLFLT xmin = data->t[0], xmax = data->t[LEN-1]; + PLFLT ymin, ymax; int plot_counts=0; gboolean active_checkbutton[VOLTLEN+TEMPLEN]; @@ -429,9 +430,19 @@ static void draw_function (GtkDrawingArea *area, for(int j=0;j<LEN;j++) { if(i<VOLTLEN) + { + // according to .dbc file + ymin=0; + ymax=6.; y[j]=data->volt[j][i]; + } else + { + // according to .dbc file + ymin=-50; + ymax=100; y[j]=data->temp[j][i-VOLTLEN]; + } } // Create a labelled box to hold the plot. |