| Wheelchair Control for Windows Mobile Diploma Thesis, Author: Ondrej Vozda, FEEC BUT, 2013

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Members

All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
WheelchairControlWM.FormMain Class Reference

Main screen. More...

Inherits Form.

## Public Types
enum | UserResponseCode : byte { END = 0, LOOK_FURTHER, MARKS_FOUND }
| Enum to determine user response (when mark confirmation via WiFi is demanded). More...
enum | AutoParkingPhase : byte { WAITING_FOR_START = 0, WALL_FOLLOWING, GOING_BACKWARDS, MARKS_TRACKING, PATH_FOLLOWING, END }
| Determines current phase of auto parking algorithm. More...
enum | PhaseError : byte { ERROR = 0, NO_ERROR }
| Determines whether auto parking phase is in error state. More...

## Public Member Functions
| FormMain ()
| Defualt constructor. More...

## Protected Member Functions
override void | Dispose (bool disposing)
| Clean up any resources being used. More...

## Private Types
enum | PacketHeader : byte { WATCHDOG_NOP = 0xC0, JOYSTICK_COMMAND = 0xC1, STOP_BUTTON = 0xC2, START_BUTTON = 0xC3, AUTO_PARKING_START_BUTTON = 0xC4, CAMERA_FRAME_REQUEST = 0xC5, USER_RESPONSE = 0xC6, AUTOPARKING_PHASE = 0xC7, CAMERA_FRAME_RESPONSE = 0xD0, CAMERA_FRAME_TO_BE_CONFIRMED = 0xD1 }
| Enum to determine UDP packet message header type. More...
enum | JoystickAxisValue : byte { MAX = 255, MIN = 0, ZERO = 127 }
| Artificial joystick axis value for arrow button press. More...
enum | DetectedMarksTransmit : byte { DONT_TRANSMIT = 0, TRANSMIT }
| Enum to determine whether detected marks should be transmitted with the frame. More...
enum | MainTabIndexes : byte { MAIN, CAMERA, PARKING, SETTINGS }
| Main tab control tabs' indexes. More...

## Private Member Functions
delegate void | InvokeThreadSafeDelegate ()
| Delegate for invoking subroutines thread-safely. More...
void | VisualizePhase (AutoParkingPhase phase, Boolean isError)
| More...
void | GetCameraFrame (Boolean includeDetectedMarks)
| Receives camera frame via UDP. More...
void | UDPDataReceiver ()
| Function to be run in separate thread and receive data via UDP. More...
void | EnableArrows (Boolean enableState)
| Enables / disables arrow buttons. More...
void | RightSlideHandler ()
| Handler to be called when user performs right slide. More...
void | SendUDPPacket (Byte[] data)
| Send packet via UDP, handle errors here. More...
void | BlinkSendErrorLabel ()
| Blink send error label to indicate transfer error. More...
void | DeviceIdleResetTimerCallback (Object param)
| Device idle reset timer callback function. More...
void | LeftSlideHandler ()
| Handler to be called when user performs left slide. More...
void | InitializeComponent ()
| Required method for Designer support - do not modify the contents of this method with the code editor. More...

## Private Attributes
const Byte | SLIDE_TO_FORM_WIDTH_RATIO = 4
| Slide length as a fraction of form width. More...
const UInt16 | SEND_ERROR_LABEL_BLINK_TIMEOUT_MS = 1000
| Send error label blink timeout in ms. More...
const UInt16 | FRAME_RECEIVE_TIMEOUT_MS = 2000
| Timeout for frame receiving. More...
const Byte | ARROW_BORDER_THICKNESS = 5
| Thickness of borders drawn around arrows [pixels]. More...
const UInt16 | UDP_PORT = 50005
| Random (not well-known) UDP port. More...
const Byte | CAMERA_FRAME_OFFSET = 1
| Offset of the camera frame data in the packet. More...
Thread | UDPreceiveThread
| Thread to be run separately and receive UDP communication asynchronously. More...
IPEndPoint | ipEp = new IPEndPoint(IPAddress.Any, UDP_PORT)
| IP Endpoint to receive data. More...
UdpClient | incomingUDPClient
| UDP client to receive data. More...
UdpClient | outgoingUDPClient
| UDP client to send data. More...
AutoResetEvent | resetEventFrameSync
| AutoResetEvent to synchronize frame receiving. More...
Int32 | slideDetectXcoordinate = -1
| Horizontal slide initial point. More...
Byte | slideLength = 0
| Length of slide to be detected. More...
SettingsClass | mySettings
| Class to load & save settings. More...
Bitmap | cameraFrame
| Last received camera frame. More...
System.Threading.Timer | deviceIdleTimer
| Timer to reset device's idle timer periodically. More...
System.ComponentModel.IContainer | components = null
| Required designer variable. More...

## Static Private Attributes
static readonly Color | PRESSED_BUTON_BACKGROUD_COLOR = Color.DarkBlue
| Color to paint pressed button background with. More...

## Detailed Description

Main screen.

Definition at line 14 of file FormMain.cs.

## Member Enumeration Documentation

enum WheelchairControlWM.FormMain.AutoParkingPhase : byte

Determines current phase of auto parking algorithm.

Enumerator
WAITING_FOR_START | Idle phase - waiting for start.
WALL_FOLLOWING | Wall-following phase.
GOING_BACKWARDS | Backward drive.
MARKS_TRACKING | Trying to find marks.
PATH_FOLLOWING | Driving to next waypoint.
END | Algorithm ended.

Definition at line 133 of file FormMain.cs.

enum WheelchairControlWM.FormMain.DetectedMarksTransmit : byte
| private

Enum to determine whether detected marks should be transmitted with the frame.

Enumerator
DONT_TRANSMIT | Don't transmit marks flag.
TRANSMIT | Transmit marks flag.

Definition at line 206 of file FormMain.cs.

enum WheelchairControlWM.FormMain.JoystickAxisValue : byte
| private

Artificial joystick axis value for arrow button press.

Enumerator
MAX | Maximal value.
MIN | Minimal value.
ZERO | Joystick zero state.

Definition at line 185 of file FormMain.cs.

enum WheelchairControlWM.FormMain.MainTabIndexes : byte
| private

Main tab control tabs' indexes.

Enumerator
MAIN | Main tab index.
CAMERA | Service tab index.
PARKING | Auto parking phases tab index.
SETTINGS | Settings tab index.

Definition at line 222 of file FormMain.cs.

enum WheelchairControlWM.FormMain.PacketHeader : byte
| private

Enum to determine UDP packet message header type.

Enumerator
WATCHDOG_NOP | Empty packet to reset watchdog.
JOYSTICK_COMMAND | Artificial joystick data.
STOP_BUTTON | Press remote stop button.
START_BUTTON | Press remote start button.
AUTO_PARKING_START_BUTTON | Press auto parking start button remotely.
CAMERA_FRAME_REQUEST | Request to send camera frame.
USER_RESPONSE | User's confirmation of mark detection correctness.
AUTOPARKING_PHASE | Transmitt current auto parking phase.
CAMERA_FRAME_RESPONSE | Camera frame data packet.
CAMERA_FRAME_TO_BE_CONFIRMED | Camera frame with detected marks to be confirmed by user.

Definition at line 56 of file FormMain.cs.

enum WheelchairControlWM.FormMain.PhaseError : byte

Determines whether auto parking phase is in error state.

Enumerator
ERROR | Error occured.
NO_ERROR | No error occured.

Definition at line 169 of file FormMain.cs.

enum WheelchairControlWM.FormMain.UserResponseCode : byte

Enum to determine user response (when mark confirmation via WiFi is demanded).

Enumerator
END | User demanded script end.
LOOK_FURTHER | Wrong detection, look further.
MARKS_FOUND | Marks detected, go on.

Definition at line 112 of file FormMain.cs.

## Constructor & Destructor Documentation

WheelchairControlWM.FormMain.FormMain | ( |  | ) |

Defualt constructor.

Definition at line 599 of file FormMain.cs.

## Member Function Documentation

void WheelchairControlWM.FormMain.BlinkSendErrorLabel | ( |  | ) |
| private

Blink send error label to indicate transfer error.

Definition at line 538 of file FormMain.cs.

void WheelchairControlWM.FormMain.DeviceIdleResetTimerCallback | ( | Object | param | ) |
| private

Device idle reset timer callback function.

Parameters

  param | Parameters.

Definition at line 569 of file FormMain.cs.

override void WheelchairControlWM.FormMain.Dispose | ( | bool | disposing | ) |
| protected

Clean up any resources being used.

Parameters

  disposing | true if managed resources should be disposed; otherwise, false.

Definition at line 15 of file FormMain.Designer.cs.

void WheelchairControlWM.FormMain.EnableArrows | ( | Boolean | enableState | ) |
| private

Enables / disables arrow buttons.

Parameters

  enableState |

Definition at line 492 of file FormMain.cs.

void WheelchairControlWM.FormMain.GetCameraFrame | ( | Boolean | includeDetectedMarks | ) |
| private

Receives camera frame via UDP.

Parameters

  includeDetectedMarks | If set to true, detected marks will also be transmitted.

Definition at line 375 of file FormMain.cs.

void WheelchairControlWM.FormMain.InitializeComponent | ( |  | ) |
| private

Required method for Designer support - do not modify the contents of this method with the code editor.

Definition at line 30 of file FormMain.Designer.cs.

delegate void WheelchairControlWM.FormMain.InvokeThreadSafeDelegate | ( |  | ) |
| private

Delegate for invoking subroutines thread-safely.

void WheelchairControlWM.FormMain.LeftSlideHandler | ( |  | ) |
| private

Handler to be called when user performs left slide.

Definition at line 587 of file FormMain.cs.

void WheelchairControlWM.FormMain.RightSlideHandler | ( |  | ) |
| private

Handler to be called when user performs right slide.

Definition at line 503 of file FormMain.cs.

void WheelchairControlWM.FormMain.SendUDPPacket | ( | Byte[] | data | ) |
| private

Send packet via UDP, handle errors here.

Parameters

  data | Data array.

Definition at line 514 of file FormMain.cs.

void WheelchairControlWM.FormMain.UDPDataReceiver | ( |  | ) |
| private

Function to be run in separate thread and receive data via UDP.

Definition at line 403 of file FormMain.cs.

void WheelchairControlWM.FormMain.VisualizePhase | ( | AutoParkingPhase | phase,
|  | Boolean | isError
| ) |  |
| private

Visualize current phase.

Parameters

  phase | Current phase.
  isError | True if error occured.

Definition at line 315 of file FormMain.cs.

## Member Data Documentation

const Byte WheelchairControlWM.FormMain.ARROW_BORDER_THICKNESS = 5
| private

Thickness of borders drawn around arrows [pixels].

Definition at line 41 of file FormMain.cs.

const Byte WheelchairControlWM.FormMain.CAMERA_FRAME_OFFSET = 1
| private

Offset of the camera frame data in the packet.

Definition at line 51 of file FormMain.cs.

Bitmap WheelchairControlWM.FormMain.cameraFrame
| private

Last received camera frame.

Definition at line 299 of file FormMain.cs.

System.ComponentModel.IContainer WheelchairControlWM.FormMain.components = null
| private

Required designer variable.

Definition at line 8 of file FormMain.Designer.cs.

System.Threading.Timer WheelchairControlWM.FormMain.deviceIdleTimer
| private

Timer to reset device's idle timer periodically.

Definition at line 304 of file FormMain.cs.

const UInt16 WheelchairControlWM.FormMain.FRAME_RECEIVE_TIMEOUT_MS = 2000
| private

Timeout for frame receiving.

Definition at line 31 of file FormMain.cs.

UdpClient WheelchairControlWM.FormMain.incomingUDPClient
| private

UDP client to receive data.

Definition at line 264 of file FormMain.cs.

IPEndPoint WheelchairControlWM.FormMain.ipEp = new IPEndPoint(IPAddress.Any, UDP_PORT)
| private

IP Endpoint to receive data.

Definition at line 259 of file FormMain.cs.

SettingsClass WheelchairControlWM.FormMain.mySettings
| private

Class to load & save settings.

Definition at line 294 of file FormMain.cs.

UdpClient WheelchairControlWM.FormMain.outgoingUDPClient
| private

UDP client to send data.

Definition at line 269 of file FormMain.cs.

readonly Color WheelchairControlWM.FormMain.PRESSED_BUTON_BACKGROUD_COLOR = Color.DarkBlue
| static private

Color to paint pressed button background with.

Definition at line 36 of file FormMain.cs.

AutoResetEvent WheelchairControlWM.FormMain.resetEventFrameSync
| private

AutoResetEvent to synchronize frame receiving.

Definition at line 274 of file FormMain.cs.

const UInt16 WheelchairControlWM.FormMain.SEND_ERROR_LABEL_BLINK_TIMEOUT_MS = 1000
| private

Send error label blink timeout in ms.

Definition at line 26 of file FormMain.cs.

const Byte WheelchairControlWM.FormMain.SLIDE_TO_FORM_WIDTH_RATIO = 4
| private

Slide length as a fraction of form width.

Definition at line 21 of file FormMain.cs.

Int32 WheelchairControlWM.FormMain.slideDetectXcoordinate = -1
| private

Horizontal slide initial point.

Definition at line 284 of file FormMain.cs.

Byte WheelchairControlWM.FormMain.slideLength = 0
| private

Length of slide to be detected.

Definition at line 289 of file FormMain.cs.

const UInt16 WheelchairControlWM.FormMain.UDP_PORT = 50005
| private

Random (not well-known) UDP port.

Definition at line 46 of file FormMain.cs.

Thread WheelchairControlWM.FormMain.UDPreceiveThread
| private

Thread to be run separately and receive UDP communication asynchronously.

Definition at line 254 of file FormMain.cs.

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

- C:/Users/Ondra/Desktop/Wheelchair Control WM/FormMain.cs
- C:/Users/Ondra/Desktop/Wheelchair Control WM/FormMain.Designer.cs