MainWindow Class Reference

Main part of the program, behavior of main window More...

Inheritance diagram for MainWindow:
[legend]
Collaboration diagram for MainWindow:
[legend]

## Public Member Functions

| MainWindow ()
| Initializes a new instance of the MainWindow class. More...
void | AdjustControls ()
| Make some adjustement to controls, like disabling some controls More...
void | OnCommandReceivedEvent (string header, string data, byte[] buffer)
| Callback called when new message is received from server More...

## Protected Member Functions

void | OnDeleteEvent (object sender, DeleteEventArgs a)
| Callback called when delete event is sent by window More...
void | OnQuitActionActivated (object sender, EventArgs e)
| Callback called by "quit" menu More...
void | OnShowLogWindowActionActivated (object sender, EventArgs e)
| Callback called by "show log" menu More...
void | OnButtonServerConnectionClicked (object sender, EventArgs e)
| Callback called by "buttonServerConnection" button More...
void | OnButtonRobotActivationClicked (object sender, EventArgs e)
| Callback called when "buttonRobotactivation" is clicked More...
void | OnButtonMouvClicked (object sender, EventArgs e)
| Callback called when user click on direction button More...
void | OnCheckButtonCameraOnClicked (object sender, EventArgs e)
| Callback called when checkbutton for camera is clicked More...
void | OnCheckButtonRobotPositionClicked (object sender, EventArgs e)
| Callback called when checkbutton robot position is clicked More...
void | OnDrawingAreaCameraExposeEvent (object o, ExposeEventArgs args)
| Callback called when drawingarea need refresh More...
void | DetectArena ()
| Show a popup asking user to tell if arena is correct or not More...
void | OnButtonAskArenaClicked (object sender, EventArgs e)
| Callback called when "detect Arena " button is clicked More...

## Private Types

enum | SystemState { SystemState.NotConnected, SystemState.ServerConnected, SystemState.RobotConnected }
| List of availble state for the application More...

## Private Member Functions

void | ChangeState (SystemState newState)
| Method used to change controls visibility (greyed or not) depending on current state More...
void | MessagePopup (MessageType type, ButtonsType buttons, string title, string message)
| Display a popup message window More...
void | OnBatteryTimerElapsed (object sender, System.Timers.ElapsedEventArgs e)
| Callback called when battery timer expired More...

## Private Attributes

DestijlCommandManager | cmdManager
| Destijl command manager reference More...
Pixbuf | drawingareaCameraPixbuf
| Pixbuffer used for displaying image More...
SystemState | systemState = SystemState.NotConnected
| The state of the system. Can take a value from SystemState More...
System.Timers.Timer | batteryTimer
| Timer for battery request More...

## Detailed Description

Main part of the program, behavior of main window

Definition at line 32 of file MonitorUI.cs.

## Member Enumeration Documentation

## SystemState

enum MainWindow.SystemState

strongprivate

List of availble state for the application

Enumerator
NotConnected |
ServerConnected |
RobotConnected |

Definition at line 47 of file MonitorUI.cs.

## Constructor & Destructor Documentation

## MainWindow()

MainWindow.MainWindow | ( |  | ) |

Initializes a new instance of the MainWindow class.

Definition at line 67 of file MonitorUI.cs.

## Member Function Documentation

## AdjustControls()

void MainWindow.AdjustControls | ( |  | ) |

Make some adjustement to controls, like disabling some controls

Definition at line 84 of file MonitorUI.cs.

## ChangeState()

void MainWindow.ChangeState | ( | SystemState | newState | ) |

private

Method used to change controls visibility (greyed or not) depending on current state

Parameters

  newState | New state

Definition at line 103 of file MonitorUI.cs.

## DetectArena()

void MainWindow.DetectArena | ( |  | ) |

protected

Show a popup asking user to tell if arena is correct or not

Definition at line 610 of file MonitorUI.cs.

## MessagePopup()

void MainWindow.MessagePopup | ( | MessageType | type,
|  | ButtonsType | buttons,
|  | string | title,
|  | string | message
| ) |  |

private

Display a popup message window

Parameters

  type | Type of popup window (question, error, information,...)
  buttons | Buttons available on popup window
  title | Title of window
  message | Message

Definition at line 176 of file MonitorUI.cs.

## OnBatteryTimerElapsed()

void MainWindow.OnBatteryTimerElapsed | ( | object | sender,
|  | System.Timers.ElapsedEventArgs | e
| ) |  |

private

Callback called when battery timer expired

Parameters

  sender | Sender object
  e | Event

Definition at line 457 of file MonitorUI.cs.

## OnButtonAskArenaClicked()

void MainWindow.OnButtonAskArenaClicked | ( | object | sender,
|  | EventArgs | e
| ) |  |

protected

Callback called when "detect Arena " button is clicked

Parameters

  sender | Sender object
  e | Event

Definition at line 644 of file MonitorUI.cs.

## OnButtonMouvClicked()

void MainWindow.OnButtonMouvClicked | ( | object | sender,
|  | EventArgs | e
| ) |  |

protected

Callback called when user click on direction button

Parameters

  sender | Sender button
  e | Event

Definition at line 427 of file MonitorUI.cs.

## OnButtonRobotActivationClicked()

void MainWindow.OnButtonRobotActivationClicked | ( | object | sender,
|  | EventArgs | e
| ) |  |

protected

Callback called when "buttonRobotactivation" is clicked

Parameters

  sender | Sender object
  e | Event

Definition at line 363 of file MonitorUI.cs.

## OnButtonServerConnectionClicked()

void MainWindow.OnButtonServerConnectionClicked | ( | object | sender,
|  | EventArgs | e
| ) |  |

protected

Callback called by "buttonServerConnection" button

Parameters

  sender | Sender object
  e | Event

Definition at line 282 of file MonitorUI.cs.

## OnCheckButtonCameraOnClicked()

void MainWindow.OnCheckButtonCameraOnClicked | ( | object | sender,
|  | EventArgs | e
| ) |  |

protected

Callback called when checkbutton for camera is clicked

Parameters

  sender | Sender object
  e | Event

Definition at line 501 of file MonitorUI.cs.

## OnCheckButtonRobotPositionClicked()

void MainWindow.OnCheckButtonRobotPositionClicked | ( | object | sender,
|  | EventArgs | e
| ) |  |

protected

Callback called when checkbutton robot position is clicked

Parameters

  sender | Sender object
  e | Event

Definition at line 530 of file MonitorUI.cs.

## OnCommandReceivedEvent()

void MainWindow.OnCommandReceivedEvent | ( | string | header,
|  | string | data,
|  | byte [] | buffer
| ) |  |

Callback called when new message is received from server

Parameters

  header | Header of message
  data | Data of message
  buffer | Raw buffer corresponding of received message

Definition at line 207 of file MonitorUI.cs.

## OnDeleteEvent()

void MainWindow.OnDeleteEvent | ( | object | sender,
|  | DeleteEventArgs | a
| ) |  |

protected

Callback called when delete event is sent by window

Parameters

  sender | Sender object
  a | Not really sure of what it is...

Definition at line 192 of file MonitorUI.cs.

## OnDrawingAreaCameraExposeEvent()

void MainWindow.OnDrawingAreaCameraExposeEvent | ( | object | o,
|  | ExposeEventArgs | args
| ) |  |

protected

Callback called when drawingarea need refresh

Parameters

  o | Sender object
  args | Expose arguments

Definition at line 560 of file MonitorUI.cs.

## OnQuitActionActivated()

void MainWindow.OnQuitActionActivated | ( | object | sender,
|  | EventArgs | e
| ) |  |

protected

Callback called by "quit" menu

Parameters

  sender | Sender object
  e | Event

Definition at line 257 of file MonitorUI.cs.

## OnShowLogWindowActionActivated()

void MainWindow.OnShowLogWindowActionActivated | ( | object | sender,
|  | EventArgs | e
| ) |  |

protected

Callback called by "show log" menu

Parameters

  sender | Sender object
  e | Event

Definition at line 270 of file MonitorUI.cs.

## Member Data Documentation

## batteryTimer

System.Timers.Timer MainWindow.batteryTimer

private

Timer for battery request

Definition at line 62 of file MonitorUI.cs.

## cmdManager

DestijlCommandManager MainWindow.cmdManager

private

Destijl command manager reference

Definition at line 37 of file MonitorUI.cs.

## drawingareaCameraPixbuf

Pixbuf MainWindow.drawingareaCameraPixbuf

private

Pixbuffer used for displaying image

Definition at line 42 of file MonitorUI.cs.

## systemState

SystemState MainWindow.systemState = SystemState.NotConnected

private

The state of the system. Can take a value from SystemState

Definition at line 57 of file MonitorUI.cs.

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

- MonitorUI.cs