38 |
match lst with |
match lst with |
39 |
[] -> acc |
[] -> acc |
40 |
| x::xs -> reverseAux xs (x::acc) |
| x::xs -> reverseAux xs (x::acc) |
41 |
in reverseAux lst [] |
in reverseAux lst [] |
42 |
|
|
43 |
let rec sumlist lst = |
let rec sumlist lst = |
44 |
match lst with |
match lst with |
45 |
[] -> 0 |
[] -> 0 |
46 |
| x::xs -> if (x > 0) then x + sumlist xs else sumlist xs |
| x::xs -> if (x > 0) then x + sumlist xs else sumlist xs |
47 |
|
|
48 |
let rec maxlist lst = match lst with |
let rec maxlist lst = match lst with |
49 |
[] -> 0 |
[] -> 0 |
50 |
| [x] -> x |
| [x] -> x |
55 |
let samples_time = 5 |
let samples_time = 5 |
56 |
let samples_h_time = 720 |
let samples_h_time = 720 |
57 |
|
|
58 |
|
(* set _x and _y with boundaries *) |
59 |
let tag_x() = if !!html_mods_vd_gfx_tag_x_size < 130 then 130 |
let tag_x() = if !!html_mods_vd_gfx_tag_x_size < 130 then 130 |
60 |
else if !!html_mods_vd_gfx_tag_x_size > 3600 then 3600 |
else if !!html_mods_vd_gfx_tag_x_size > 3600 then 3600 |
61 |
else !!html_mods_vd_gfx_tag_x_size |
else !!html_mods_vd_gfx_tag_x_size |
70 |
else !!html_mods_vd_gfx_y_size |
else !!html_mods_vd_gfx_y_size |
71 |
|
|
72 |
let vtext = "0" |
let vtext = "0" |
73 |
let x_divisions() = (win_x()) / 80 |
let x_divisions() = (win_x()) / 80 |
74 |
let y_divisions() = (win_y()) / 30 |
let y_divisions() = (win_y()) / 30 |
75 |
let x_fdivisions() = float_of_int (x_divisions()) |
let x_fdivisions() = float_of_int (x_divisions()) |
76 |
let y_fdivisions() = float_of_int (y_divisions()) |
let y_fdivisions() = float_of_int (y_divisions()) |
77 |
|
|
78 |
(* todo: limit to 4 max *) |
(* todo: limit to 4 max *) |
79 |
let xmult = 1 |
let xmult = 1 |
80 |
let xgmult = 16 |
let xgmult = 16 |
81 |
(* todo: limit to 4 max *) |
(* todo: limit to 4 max *) |
82 |
let ymult = 1 |
let ymult = 1 |
83 |
let xdivisions() = (x_divisions()) * xmult |
let xdivisions() = (x_divisions()) * xmult |
84 |
let fxdivisions() = float_of_int (xdivisions()) |
let fxdivisions() = float_of_int (xdivisions()) |
85 |
let xgdivisions() = (x_divisions()) * xgmult |
let xgdivisions() = (x_divisions()) * xgmult |
86 |
let fxgdivisions() = float_of_int (xgdivisions()) |
let fxgdivisions() = float_of_int (xgdivisions()) |
87 |
let ydivisions() = (y_divisions()) * ymult |
let ydivisions() = (y_divisions()) * ymult |
88 |
let fydivisions() = float_of_int (ydivisions()) |
let fydivisions() = float_of_int (ydivisions()) |
89 |
let vmax_auto() = if detected_downlink_capacity () < detected_uplink_capacity () then |
let vmax_auto() = if detected_downlink_capacity () < detected_uplink_capacity () then |
90 |
(detected_uplink_capacity ()) |
(detected_uplink_capacity ()) |
91 |
else |
else |
93 |
|
|
94 |
let vmax link = (detected_link_capacity link) |
let vmax link = (detected_link_capacity link) |
95 |
|
|
96 |
let vx() = (fxgdivisions()) /. (x_fdivisions()) |
let vx() = (fxgdivisions()) /. (x_fdivisions()) |
97 |
let vy() = (((float_of_int(vmax_auto())) /. 1024.) +. 2.) /. (y_fdivisions()) |
let vy() = (((float_of_int(vmax_auto())) /. 1024.) +. 2.) /. (y_fdivisions()) |
98 |
let vy_m link = (((float_of_int(vmax link)) /. 1024.) +. 2.) /. (y_fdivisions()) |
let vy_m link = (((float_of_int(vmax link)) /. 1024.) +. 2.) /. (y_fdivisions()) |
99 |
|
|
107 |
|
|
108 |
let xbl = left_margin |
let xbl = left_margin |
109 |
let xbr() = win_x() - right_margin |
let xbr() = win_x() - right_margin |
110 |
let xbs() = xbr() - xbl |
let xbs() = xbr() - xbl |
111 |
let ybt = top_margin |
let ybt = top_margin |
112 |
let ybb() = win_y() - bottom_margin |
let ybb() = win_y() - bottom_margin |
113 |
let ybs() = ybb() - ybt |
let ybs() = ybb() - ybt |
114 |
let vdt() = float_of_int(ybs()) /. float_of_int(vmax_auto()) |
let vdt() = float_of_int(ybs()) /. float_of_int(vmax_auto()) |
115 |
let vdt_m link = float_of_int(ybs()) /. float_of_int(vmax link) |
let vdt_m link = float_of_int(ybs()) /. float_of_int(vmax link) |
116 |
let vdt_stack link = float_of_int(ybs() / 2) /. float_of_int(vmax link) |
let vdt_stack link = float_of_int(ybs() / 2) /. float_of_int(vmax link) |
178 |
mypic#fill ~x:(my_x - 1) ~y:(my_y - 1) gcolor; |
mypic#fill ~x:(my_x - 1) ~y:(my_y - 1) gcolor; |
179 |
mypic#fill ~x:(my_x - 1) ~y:(my_y + 1) gcolor; |
mypic#fill ~x:(my_x - 1) ~y:(my_y + 1) gcolor; |
180 |
mypic#fill ~x:(my_x + 1) ~y:(my_y) gcolor |
mypic#fill ~x:(my_x + 1) ~y:(my_y) gcolor |
181 |
|
|
182 |
let draw_tag mypic title gdown gup gcolor = |
let draw_tag mypic title gdown gup gcolor = |
183 |
let my_sum gl = List.fold_left (+) 0 (Fifo2.to_list gl) in |
let my_sum gl = List.fold_left (+) 0 (Fifo2.to_list gl) in |
184 |
let meanx gl = ((float_of_int (my_sum gl)) /. (float_of_int ((Fifo2.length gl) - 1))) in |
let meanx gl = ((float_of_int (my_sum gl)) /. (float_of_int ((Fifo2.length gl) - 1))) in |
248 |
let basetime = Unix.gettimeofday () in |
let basetime = Unix.gettimeofday () in |
249 |
let timer n = Unix.localtime (basetime -. ((float_of_int(n)) *. float_of_int(my_time) *. vx())) in |
let timer n = Unix.localtime (basetime -. ((float_of_int(n)) *. float_of_int(my_time) *. vx())) in |
250 |
let time_string n = |
let time_string n = |
251 |
let time = timer n in |
let time = timer n in |
252 |
let h0 = string_of_int(time.Unix.tm_hour ) and (* H *) |
let h0 = string_of_int(time.Unix.tm_hour ) and (* H *) |
253 |
m0 = string_of_int(time.Unix.tm_min ) and (* M *) |
m0 = string_of_int(time.Unix.tm_min ) and (* M *) |
254 |
s0 = string_of_int(time.Unix.tm_sec ) in (* S *) |
s0 = string_of_int(time.Unix.tm_sec ) in (* S *) |
255 |
(if String.length h0 = 2 then h0 else "0"^h0) ^":"^ |
(if String.length h0 = 2 then h0 else "0"^h0) ^":"^ |
256 |
(if String.length m0 = 2 then m0 else "0"^m0) ^":"^ |
(if String.length m0 = 2 then m0 else "0"^m0) ^":"^ |
257 |
(if String.length s0 = 2 then s0 else "0"^s0) in |
(if String.length s0 = 2 then s0 else "0"^s0) in |
258 |
|
|
259 |
for n = 1 to ((x_divisions()) - 1) do |
for n = 1 to ((x_divisions()) - 1) do |
260 |
mypic#string ~font:Gd.Font.small ~x:((fx n) - ((String.length (time_string n) * 5) / 2)) ~y:(my_y + 5) ~s:(time_string n) gcolor; |
mypic#string ~font:Gd.Font.small ~x:((fx n) - ((String.length (time_string n) * 5) / 2)) ~y:(my_y + 5) ~s:(time_string n) gcolor; |
272 |
and y_c2 n = (my_y - (int_of_float(float_of_int(datas g (n+1)) *. (vdt_m g)))) in |
and y_c2 n = (my_y - (int_of_float(float_of_int(datas g (n+1)) *. (vdt_m g)))) in |
273 |
(if !!html_mods_vd_gfx_fill then begin |
(if !!html_mods_vd_gfx_fill then begin |
274 |
mypic#line ~x1:(fx 0) ~y1:my_y |
mypic#line ~x1:(fx 0) ~y1:my_y |
275 |
~x2:(fx 0) ~y2:(if y_c1 0 >= my_y - 3 then |
~x2:(fx 0) ~y2:(if y_c1 0 >= my_y - 3 then |
276 |
((y_c1 0) - 3) else ((y_c1 0))) shadow_color; |
((y_c1 0) - 3) else ((y_c1 0))) shadow_color; |
277 |
for n = 0 to ((graph_length(g)) - 1) do |
for n = 0 to ((graph_length(g)) - 1) do |
278 |
(* trick to make sure filling will not fail *) |
(* trick to make sure filling will not fail *) |
279 |
if n = ((graph_length(g)) - 1) then |
if n = ((graph_length(g)) - 1) then |
280 |
mypic#line ~x1:((fx n)) ~y1:(if y_c1 n >= my_y - 3 then |
mypic#line ~x1:((fx n)) ~y1:(if y_c1 n >= my_y - 3 then |
281 |
((y_c1 n) - 3) else ((y_c1 n))) ~x2:((fx (n+1))) ~y2:((y_c2 n)) shadow_color |
((y_c1 n) - 3) else ((y_c1 n))) ~x2:((fx (n+1))) ~y2:((y_c2 n)) shadow_color |
282 |
else begin |
else begin |
283 |
mypic#line ~x1:((fx n)) ~y1:(if y_c1 n >= my_y - 3 then |
mypic#line ~x1:((fx n)) ~y1:(if y_c1 n >= my_y - 3 then |
284 |
((y_c1 n) - 3) else ((y_c1 n))) |
((y_c1 n) - 3) else ((y_c1 n))) |
285 |
~x2:((fx (n+1))) ~y2:(if y_c2 n >= my_y - 3 then |
~x2:((fx (n+1))) ~y2:(if y_c2 n >= my_y - 3 then |
286 |
((y_c2 n) - 3) else ((y_c2 n))) shadow_color |
((y_c2 n) - 3) else ((y_c2 n))) shadow_color |
287 |
end |
end |
288 |
done; |
done; |
307 |
and y_c2 n = (my_y - (int_of_float(float_of_int(datas g (n+1)) *. (vdt_stack g)))) in |
and y_c2 n = (my_y - (int_of_float(float_of_int(datas g (n+1)) *. (vdt_stack g)))) in |
308 |
(if !!html_mods_vd_gfx_fill then begin |
(if !!html_mods_vd_gfx_fill then begin |
309 |
mypic#line ~x1:(fx 0) ~y1:my_y |
mypic#line ~x1:(fx 0) ~y1:my_y |
310 |
~x2:(fx 0) ~y2:(if y_c1 0 >= my_y - 3 then |
~x2:(fx 0) ~y2:(if y_c1 0 >= my_y - 3 then |
311 |
((y_c1 0) - 3) else ((y_c1 0))) shadow_color; |
((y_c1 0) - 3) else ((y_c1 0))) shadow_color; |
312 |
for n = 0 to ((graph_length(g)) - 1) do |
for n = 0 to ((graph_length(g)) - 1) do |
313 |
(* trick to make sure filling will not fail *) |
(* trick to make sure filling will not fail *) |
314 |
if n = ((graph_length(g)) - 1) then |
if n = ((graph_length(g)) - 1) then |
315 |
mypic#line ~x1:((fx n)) ~y1:(if y_c1 n >= my_y - 2 then |
mypic#line ~x1:((fx n)) ~y1:(if y_c1 n >= my_y - 2 then |
316 |
((y_c1 n) - 2) else ((y_c1 n))) ~x2:((fx (n+1))) ~y2:((y_c2 n)) shadow_color |
((y_c1 n) - 2) else ((y_c1 n))) ~x2:((fx (n+1))) ~y2:((y_c2 n)) shadow_color |
317 |
else begin |
else begin |
318 |
mypic#line ~x1:((fx n)) ~y1:(if y_c1 n >= my_y - 2 then |
mypic#line ~x1:((fx n)) ~y1:(if y_c1 n >= my_y - 2 then |
319 |
((y_c1 n) - 2) else ((y_c1 n))) |
((y_c1 n) - 2) else ((y_c1 n))) |
320 |
~x2:((fx (n+1))) ~y2:(if y_c2 n >= my_y - 2 then |
~x2:((fx (n+1))) ~y2:(if y_c2 n >= my_y - 2 then |
321 |
((y_c2 n) - 2) else ((y_c2 n))) shadow_color |
((y_c2 n) - 2) else ((y_c2 n))) shadow_color |
322 |
end |
end |
323 |
done; |
done; |
342 |
and y_c2 n = (my_y + (int_of_float(float_of_int(datas g (n+1)) *. (vdt_stack g)))) in |
and y_c2 n = (my_y + (int_of_float(float_of_int(datas g (n+1)) *. (vdt_stack g)))) in |
343 |
(if !!html_mods_vd_gfx_fill then begin |
(if !!html_mods_vd_gfx_fill then begin |
344 |
mypic#line ~x1:(fx 0) ~y1:my_y |
mypic#line ~x1:(fx 0) ~y1:my_y |
345 |
~x2:(fx 0) ~y2:(if y_c1 0 >= my_y - 3 then |
~x2:(fx 0) ~y2:(if y_c1 0 >= my_y - 3 then |
346 |
((y_c1 0) - 3) else ((y_c1 0))) shadow_color; |
((y_c1 0) - 3) else ((y_c1 0))) shadow_color; |
347 |
for n = 0 to ((graph_length(g)) - 1) do |
for n = 0 to ((graph_length(g)) - 1) do |
348 |
(* trick to make sure filling will not fail *) |
(* trick to make sure filling will not fail *) |
349 |
if n = ((graph_length(g)) - 1) then |
if n = ((graph_length(g)) - 1) then |
350 |
mypic#line ~x1:((fx n)) ~y1:(if y_c1 n >= my_y + 2 then |
mypic#line ~x1:((fx n)) ~y1:(if y_c1 n >= my_y + 2 then |
351 |
((y_c1 n) + 2) else ((y_c1 n))) ~x2:((fx (n+1))) ~y2:((y_c2 n)) shadow_color |
((y_c1 n) + 2) else ((y_c1 n))) ~x2:((fx (n+1))) ~y2:((y_c2 n)) shadow_color |
352 |
else begin |
else begin |
353 |
mypic#line ~x1:((fx n)) ~y1:(if y_c1 n >= my_y + 2 then |
mypic#line ~x1:((fx n)) ~y1:(if y_c1 n >= my_y + 2 then |
354 |
((y_c1 n) + 2) else ((y_c1 n))) |
((y_c1 n) + 2) else ((y_c1 n))) |
355 |
~x2:((fx (n+1))) ~y2:(if y_c2 n >= my_y + 2 then |
~x2:((fx (n+1))) ~y2:(if y_c2 n >= my_y + 2 then |
356 |
((y_c2 n) + 2) else ((y_c2 n))) shadow_color |
((y_c2 n) + 2) else ((y_c2 n))) shadow_color |
357 |
end |
end |
358 |
done; |
done; |
384 |
(* init pic *) |
(* init pic *) |
385 |
( |
( |
386 |
let g_y = win_y() in |
let g_y = win_y() in |
387 |
(* declare colors *) |
(* set colors *) |
388 |
let white = mypic#colors#white in |
let white = mypic#colors#white in |
389 |
let black = mypic#colors#black in |
let black = mypic#colors#black in |
390 |
let red = mypic#colors#red in |
let red = mypic#colors#red in |
392 |
let darkgrey = mypic#colors#resolve ~red:128 ~blue:128 ~green:128 in |
let darkgrey = mypic#colors#resolve ~red:128 ~blue:128 ~green:128 in |
393 |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
394 |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
395 |
|
|
396 |
(* draw graph *) |
(* draw graph *) |
397 |
draw_borders mypic black; |
draw_borders mypic black; |
398 |
draw_title mypic ttl black g_y; |
draw_title mypic ttl black g_y; |
417 |
|
|
418 |
let mypic = Gd.create ~x:win_x() ~y:win_y in |
let mypic = Gd.create ~x:win_x() ~y:win_y in |
419 |
|
|
420 |
(* declare colors *) |
(* set colors *) |
421 |
let white = mypic#colors#white in |
let white = mypic#colors#white in |
422 |
let black = mypic#colors#black in |
let black = mypic#colors#black in |
423 |
let red = mypic#colors#red in |
let red = mypic#colors#red in |
450 |
let g_y = win_y() in |
let g_y = win_y() in |
451 |
let mypic = Gd.create ~x:(win_x()) ~y:g_y in |
let mypic = Gd.create ~x:(win_x()) ~y:g_y in |
452 |
|
|
453 |
(* declare colors *) |
(* set colors *) |
454 |
let white = mypic#colors#white in |
let white = mypic#colors#white in |
455 |
let black = mypic#colors#black in |
let black = mypic#colors#black in |
456 |
let red = mypic#colors#red in |
let red = mypic#colors#red in |
459 |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
460 |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
461 |
|
|
462 |
if !!html_mods_vd_gfx_transparent then |
if !!html_mods_vd_gfx_transparent then |
463 |
mypic#colors#set_transparent white; |
mypic#colors#set_transparent white; |
464 |
(* draw graph *) |
(* draw graph *) |
465 |
draw_title mypic ttl black g_y; |
draw_title mypic ttl black g_y; |
474 |
draw_stack_download mypic gdown green darkgrey; |
draw_stack_download mypic gdown green darkgrey; |
475 |
draw_stack_upload mypic gup red darkgrey; |
draw_stack_upload mypic gup red darkgrey; |
476 |
draw_x_grid mypic black; |
draw_x_grid mypic black; |
477 |
draw_y_grid mypic black |
draw_y_grid mypic black |
478 |
end |
end |
479 |
else begin |
else begin |
480 |
draw_borders mypic black; |
draw_borders mypic black; |
505 |
let g_y = win_y() in |
let g_y = win_y() in |
506 |
let mypic = Gd.create ~x:g_x ~y:g_y in |
let mypic = Gd.create ~x:g_x ~y:g_y in |
507 |
|
|
508 |
(* declare colors *) |
(* set colors *) |
509 |
let white = mypic#colors#white in |
let white = mypic#colors#white in |
510 |
let black = mypic#colors#black in |
let black = mypic#colors#black in |
511 |
let red = mypic#colors#red in |
let red = mypic#colors#red in |
513 |
let darkgrey = mypic#colors#resolve ~red:128 ~blue:128 ~green:128 in |
let darkgrey = mypic#colors#resolve ~red:128 ~blue:128 ~green:128 in |
514 |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
515 |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
516 |
|
|
517 |
if !!html_mods_vd_gfx_transparent then |
if !!html_mods_vd_gfx_transparent then |
518 |
mypic#colors#set_transparent white; |
mypic#colors#set_transparent white; |
519 |
(* draw graph *) |
(* draw graph *) |
520 |
draw_borders mypic black; |
draw_borders mypic black; |
528 |
draw_arrow mypic darkred; |
draw_arrow mypic darkred; |
529 |
if !!html_mods_vd_gfx_mean then |
if !!html_mods_vd_gfx_mean then |
530 |
draw_mean_line mypic gdown green black; |
draw_mean_line mypic gdown green black; |
531 |
|
|
532 |
(if !!html_mods_vd_gfx_png then |
(if !!html_mods_vd_gfx_png then |
533 |
mypic#save_as_png "bw_download.png" |
mypic#save_as_png "bw_download.png" |
534 |
else |
else |
543 |
let g_y = win_y() in |
let g_y = win_y() in |
544 |
let mypic = Gd.create ~x:g_x ~y:g_y in |
let mypic = Gd.create ~x:g_x ~y:g_y in |
545 |
|
|
546 |
(* declare colors *) |
(* set colors *) |
|
|
|
547 |
let white = mypic#colors#white in |
let white = mypic#colors#white in |
548 |
let black = mypic#colors#black in |
let black = mypic#colors#black in |
549 |
let red = mypic#colors#red in |
let red = mypic#colors#red in |
552 |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
553 |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
554 |
|
|
555 |
if !!html_mods_vd_gfx_transparent then |
if !!html_mods_vd_gfx_transparent then |
556 |
mypic#colors#set_transparent white; |
mypic#colors#set_transparent white; |
557 |
(* draw graph *) |
(* draw graph *) |
558 |
draw_borders mypic black; |
draw_borders mypic black; |
581 |
let g_y = win_y() in |
let g_y = win_y() in |
582 |
let mypic = Gd.create ~x:(win_x()) ~y:g_y in |
let mypic = Gd.create ~x:(win_x()) ~y:g_y in |
583 |
|
|
584 |
(* declare colors *) |
(* set colors *) |
585 |
let white = mypic#colors#white in |
let white = mypic#colors#white in |
586 |
let black = mypic#colors#black in |
let black = mypic#colors#black in |
587 |
let red = mypic#colors#red in |
let red = mypic#colors#red in |
590 |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
591 |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
592 |
|
|
593 |
if !!html_mods_vd_gfx_transparent then |
if !!html_mods_vd_gfx_transparent then |
594 |
mypic#colors#set_transparent white; |
mypic#colors#set_transparent white; |
595 |
(* draw graph *) |
(* draw graph *) |
596 |
draw_borders mypic black; |
draw_borders mypic black; |
604 |
draw_load mypic gup red darkgrey; |
draw_load mypic gup red darkgrey; |
605 |
draw_x_grid mypic black; |
draw_x_grid mypic black; |
606 |
draw_y_grid mypic black; |
draw_y_grid mypic black; |
607 |
draw_arrow mypic darkred; |
draw_arrow mypic darkred; |
608 |
(if !!html_mods_vd_gfx_mean then |
(if !!html_mods_vd_gfx_mean then |
609 |
draw_mean_line mypic gdown green black; |
draw_mean_line mypic gdown green black; |
610 |
draw_mean_line mypic gup red black |
draw_mean_line mypic gup red black |
623 |
let g_y = win_y() in |
let g_y = win_y() in |
624 |
let mypic = Gd.create ~x:g_x ~y:g_y in |
let mypic = Gd.create ~x:g_x ~y:g_y in |
625 |
|
|
626 |
(* declare colors *) |
(* set colors *) |
627 |
let white = mypic#colors#white in |
let white = mypic#colors#white in |
628 |
let black = mypic#colors#black in |
let black = mypic#colors#black in |
629 |
let red = mypic#colors#red in |
let red = mypic#colors#red in |
632 |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
633 |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
634 |
|
|
635 |
if !!html_mods_vd_gfx_transparent then |
if !!html_mods_vd_gfx_transparent then |
636 |
mypic#colors#set_transparent white; |
mypic#colors#set_transparent white; |
637 |
(* draw graph *) |
(* draw graph *) |
638 |
draw_borders mypic black; |
draw_borders mypic black; |
661 |
let g_y = win_y() in |
let g_y = win_y() in |
662 |
let mypic = Gd.create ~x:g_x ~y:g_y in |
let mypic = Gd.create ~x:g_x ~y:g_y in |
663 |
|
|
664 |
(* declare colors *) |
(* set colors *) |
|
|
|
665 |
let white = mypic#colors#white in |
let white = mypic#colors#white in |
666 |
let black = mypic#colors#black in |
let black = mypic#colors#black in |
667 |
let red = mypic#colors#red in |
let red = mypic#colors#red in |
670 |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
let darkgreen = mypic#colors#resolve ~red:0 ~blue:0 ~green:128 in |
671 |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
let darkred = mypic#colors#resolve ~red:128 ~blue:0 ~green:0 in |
672 |
|
|
673 |
if !!html_mods_vd_gfx_transparent then |
if !!html_mods_vd_gfx_transparent then |
674 |
mypic#colors#set_transparent white; |
mypic#colors#set_transparent white; |
675 |
(* draw graph *) |
(* draw graph *) |
676 |
draw_borders mypic black; |
draw_borders mypic black; |
697 |
( |
( |
698 |
let g_x = tag_x() in |
let g_x = tag_x() in |
699 |
let g_y = tag_y() in |
let g_y = tag_y() in |
700 |
let mypic = if !!html_mods_vd_gfx_tag_use_source then |
let mypic = if !!html_mods_vd_gfx_tag_use_source then |
701 |
(if !!html_mods_vd_gfx_tag_png then |
(if !!html_mods_vd_gfx_tag_png then |
702 |
Gd.open_png (!!html_mods_vd_gfx_tag_source ^ ".png") |
Gd.open_png (!!html_mods_vd_gfx_tag_source ^ ".png") |
703 |
else |
else |
704 |
Gd.open_jpeg (!!html_mods_vd_gfx_tag_source ^ ".jpg") |
Gd.open_jpeg (!!html_mods_vd_gfx_tag_source ^ ".jpg") |
705 |
) |
) |
706 |
else |
else |
707 |
Gd.create ~x:g_x ~y:g_y in |
Gd.create ~x:g_x ~y:g_y in |
708 |
|
|
709 |
(* declare colors *) |
(* set colors *) |
710 |
let white = mypic#colors#white in |
let white = mypic#colors#white in |
711 |
let black = mypic#colors#black in |
let black = mypic#colors#black in |
712 |
let red = mypic#colors#red in |
let red = mypic#colors#red in |
724 |
) |
) |
725 |
|
|
726 |
let really_remove_files () = |
let really_remove_files () = |
727 |
let files = |
let files = |
728 |
["bw_updown"; "bw_download"; "bw_upload"; "bw_h_updown"; "bw_h_download"; "bw_h_upload"; "tag"] |
["bw_updown"; "bw_download"; "bw_upload"; "bw_h_updown"; "bw_h_download"; "bw_h_upload"; "tag"] |
729 |
in |
in |
730 |
let f file = |
let f file = |