BotNavSim  v0.4.3
Mobile Robot Simulation
UI_Log Class Reference

IToolbar class for providing controls of data logging. Includes editing parameters to log and enable/disable logging. Calls functions to Log class More...

Inheritance diagram for UI_Log:
Collaboration diagram for UI_Log:

Public Member Functions

 UI_Log ()
 

Properties

bool contextual [get]
 
bool hidden [get, set]
 
string windowTitle [get]
 
Rect windowRect [get, set]
 
GUI.WindowFunction windowFunction [get]
 
- Properties inherited from IToolbar
bool contextual [get]
 Gets a value indicating whether this IToolbar is contextual. More...
 
bool hidden [get, set]
 Gets or sets a value indicating whether this IToolbar is hidden. More...
 
- Properties inherited from IWindowFunction
string windowTitle [get]
 Gets the window title. More...
 
Rect windowRect [get, set]
 Gets or sets the window rect (window size and position). More...
 
GUI.WindowFunction windowFunction [get]
 Gets the window function definition for GUILayout.Window() More...
 

Private Member Functions

void LogSettingsWindow (int windowID)
 GUI Window function provides controls for logging data. More...
 

Detailed Description

IToolbar class for providing controls of data logging. Includes editing parameters to log and enable/disable logging. Calls functions to Log class

Definition at line 9 of file UI_Log.cs.

Constructor & Destructor Documentation

UI_Log.UI_Log ( )

Definition at line 11 of file UI_Log.cs.

11  {
12  hidden = true;
13  }
bool hidden
Definition: UI_Log.cs:22

Member Function Documentation

void UI_Log.LogSettingsWindow ( int  windowID)
private

GUI Window function provides controls for logging data.

Definition at line 45 of file UI_Log.cs.

45  {
46  float w = UI_Toolbar.I.innerWidth/2f;
47 
48  // close window button
49  GUILayout.BeginHorizontal();
50  if (GUILayout.Button("<", GUILayout.Width(30f))) {
51  hidden = true;
52  }
53  GUILayout.EndHorizontal();
54 
55  // toggle logging
56  GUILayout.BeginHorizontal();
57  GUILayout.Label("Log to file: ", GUILayout.Width(w));
58  Simulation.loggingEnabled = GUILayout.Toggle(Simulation.loggingEnabled, "");
59  GUILayout.EndHorizontal();
60 
61  GUILayout.BeginHorizontal();
62  GUILayout.Label("Available Parameters", GUILayout.Width(w));
63  GUILayout.Label("Parameters To Be Logged", GUILayout.Width(w));
64  GUILayout.EndHorizontal();
65 
66  int max = Mathf.Max(Log.availableParams.Count, Log.selectedParams.Count);
67 
68  for(int i = 0; i < max; i++) {
69  GUILayout.BeginHorizontal();
70  if (i < Log.availableParams.Count) {
71  if (GUILayout.Button(Log.availableParams[i].ToString(), GUILayout.Width(w))) {
73  }
74  }
75  else {
76  GUILayout.Button("", GUILayout.Width(w));
77  }
78  if (i < Log.selectedParams.Count) {
79  if(GUILayout.Button(Log.selectedParams[i].ToString(),GUILayout.Width(w))) {
81  }
82  }
83  else {
84  GUILayout.Button("", GUILayout.Width(w));
85  }
86  GUILayout.EndHorizontal();
87  }
88 
89  }
bool hidden
Definition: UI_Log.cs:22
float innerWidth
Definition: UI_Toolbar.cs:33
static UI_Toolbar I
Singleton pattern.
Definition: UI_Toolbar.cs:16
static void LogParameter(Parameters parameter, bool log)
Moves parameters between availableParams and selectedParams lists.
Definition: Log.cs:95
static List< Parameters > availableParams
List of parameters that haven't been selected for logging.
Definition: Log.cs:52
UI Toolbar provides controls for choosing which UI windows to display
Definition: UI_Toolbar.cs:11
This is a manager class used to overlook the running of a simulation.
Definition: Simulation.cs:8
Provides data logging capabilities. Data is logged in CSV format.
Definition: Log.cs:10
static bool loggingEnabled
If true, simulation will be logged to a file via Log class.
Definition: Simulation.cs:347
static List< Parameters > selectedParams
List of parameters selected for logging.
Definition: Log.cs:57

Here is the call graph for this function:

Property Documentation

bool UI_Log.contextual
get

Definition at line 15 of file UI_Log.cs.

bool UI_Log.hidden
getset

Definition at line 22 of file UI_Log.cs.

GUI.WindowFunction UI_Log.windowFunction
get

Definition at line 36 of file UI_Log.cs.

Rect UI_Log.windowRect
getset

Definition at line 32 of file UI_Log.cs.

string UI_Log.windowTitle
get

Definition at line 26 of file UI_Log.cs.


The documentation for this class was generated from the following file: