Versione finale relazione
[toni-reis.git] / src / simulator-monitor-gui.ads
blob02396b2da8322b0ba12f9a7e334501b5d34d359f
1 with Gdk.Event; use Gdk.Event;
2 with Gtk.Widget; use Gtk.Widget;
4 with Gtk.Window; use Gtk.Window;
5 with Gtk.Box; use Gtk.Box;
6 with Gtk.Frame; use Gtk.Frame;
7 with Gtk.Scrolled_Window; use Gtk.Scrolled_Window;
8 with Gtk.Tree_Model; use Gtk.Tree_Model;
9 with Gtk.List_Store; use Gtk.List_Store;
10 with Gtk.Tree_Sortable; use Gtk.Tree_Sortable;
11 with Gtk.Tree_Model_Sort; use Gtk.Tree_Model_Sort;
12 with Gtk.Tree_View; use Gtk.Tree_View;
13 with Gtk.Tree_View_Column; use Gtk.Tree_View_Column;
14 with Gtk.Cell_Renderer; use Gtk.Cell_Renderer;
15 with Gtk.Cell_Renderer_Text; use Gtk.Cell_Renderer_Text;
16 with Gtk.Label; use Gtk.Label;
17 with Gtk.Alignment; use Gtk.Alignment;
18 with Gtk.Button; use Gtk.Button;
20 with Simulator.Gui; use Simulator.Gui;
22 package Simulator.Monitor.Gui is
23 type ChangePosition_T is array (CarId_T) of Integer;
24 ChangePosition : ChangePosition_T;
25 type Monitor_Record is new Gtk_Window_Record with record
26 -- varabili logica monitor
27 LastLap : Natural := 0;
28 LastInt : Natural := 0;
29 LastTime : Duration := 0.0;
30 Observing : Boolean := False;
31 BestLap_Id : CarId_T := 1;
32 BestLap_Lap : Natural := 0;
33 BestLap : Duration := Duration'Last;
34 MaxSpeed_Id : CarId_T := 1;
35 MaxSpeed : Float := 0.0;
37 -- variabili GUI
38 Hbox1 : Gtk_Hbox;
39 Hbox2 : Gtk_Hbox;
40 Hbox3 : Gtk_Hbox;
41 Vbox1 : Gtk_Vbox;
42 Vbox2 : Gtk_Vbox;
43 Frame1 : Gtk_Frame;
44 Frame2 : Gtk_Frame;
45 Frame3 : Gtk_Frame;
46 Scrolledwindow1 : Gtk_Scrolled_Window;
47 Scrolledwindow2 : Gtk_Scrolled_Window;
48 Model1 : Gtk_List_Store;
49 Model1_Sort : Gtk_Tree_Model_Sort;
50 Model2 : Gtk_List_Store;
51 Treeview1 : Gtk_Tree_View;
52 Treeview2 : Gtk_Tree_View;
53 Col : Gtk_Tree_View_Column;
54 Text_R : Gtk_Cell_Renderer_Text;
55 Label1 : Gtk_Label;
56 Label2 : Gtk_Label;
57 Label3 : Gtk_Label;
58 Alignment1 : Gtk_Alignment;
59 Alignment2 : Gtk_Alignment;
60 Alignment3 : Gtk_Alignment;
61 Int_Info : Gtk_Label;
62 Lock : Gtk_Button;
63 BestLap_Info : Gtk_Label;
64 MaxSpeed_Info : Gtk_Label;
66 end record;
67 type Monitor_Access is access all Monitor_Record'Class;
69 Ref : Monitor_Access;
71 procedure Gtk_New (Monitor : out Monitor_Access);
72 procedure Initialize (Monitor : access Monitor_Record'Class);
73 procedure Update_Model (Pos: Positive;
74 CarId: CarId_T;
75 Name : String;
76 Lap: Natural;
77 Intermediate: Natural;
78 WakeupTime: Duration;
79 Vel: Float;
80 TimeElapsed: Duration);
81 procedure UpdateLapTime ( Id: CarId_T; LastLap : Duration; BestLap: Duration) ;
82 procedure UpdateCarStatus ( Id: CarId_T; Status : CarStatus_T);
83 procedure Update_BestLap(Id : CarId_T; Lap : Positive; Time : Duration);
84 procedure Update_MaxSpeed(Id : CarId_T; Val : Float);
85 procedure ToggleLock (Widget : access Gtk_Widget_Record'Class);
86 procedure EndRace;
87 end Simulator.Monitor.Gui;