C# Class MissionPlanner.Joystick.Joystick

Inheritance: IDisposable
显示文件 Open project: ArduPilot/MissionPlanner Class Usage Examples

Public Properties

Property Type Description
elevons bool
enabled bool
name string
self Joystick

Public Methods

Method Description
AcquireJoystick ( string name ) : SharpDX.DirectInput.Joystick
Dispose ( ) : void
DoJoystickButtonFunction ( ) : void
Expo ( double input, double expo, double min, double max, double mid ) : double
Joystick ( ) : System
UnAcquireJoyStick ( ) : void
changeButton ( int buttonid, int newid ) : void
clearRCOverride ( ) : void
getButton ( int arrayoffset ) : JoyButton
getChannel ( int channel ) : JoyChannel
getDevices ( ) : IList
getHatSwitchDirection ( ) : int
getJoyStickByName ( string name ) : SharpDX.DirectInput.Joystick
getJoystickAxis ( int channel ) : joystickaxis
getMovingAxis ( string name, int threshold ) : joystickaxis
getNumButtons ( ) : int
getNumberPOV ( ) : int
getPressedButton ( string name ) : int
getRawValueForChannel ( int channel ) : ushort
getValueForChannel ( int channel, string name ) : ushort
isButtonPressed ( int buttonno ) : bool
loadconfig ( string joystickconfigbutton = "joystickbuttons.xml", string joystickconfigaxis = "joystickaxis.xml" ) : void
saveconfig ( ) : void
setAxis ( int channel, joystickaxis axis ) : void
setButton ( int arrayoffset, JoyButton buttonconfig ) : void
setChannel ( JoyChannel chan ) : void
setChannel ( int channel, joystickaxis axis, bool reverse, int expo ) : void
setReverse ( int channel, bool reverse ) : void
start ( string name ) : bool

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Implement reccomended best practice dispose pattern http://msdn.microsoft.com/en-us/library/b1yfkh5e%28v=vs.110%29.aspx

Private Methods

Method Description
BOOL_TO_SIGN ( bool input ) : int
ButtonDown ( JoyButton but ) : void
ButtonUp ( JoyButton but ) : void
Constrain ( double value, double min, double max ) : double
ProcessButtonEvent ( JoyButton but, bool buttondown ) : void
getButtonState ( JoyButton but, int buttonno ) : bool

Button press check with debounce

mainloop ( ) : void

Updates the rcoverride values and controls the mode changes

map ( double x, double in_min, double in_max, double out_min, double out_max ) : double
pickchannel ( int chan, joystickaxis axis, bool rev, int expo ) : ushort

Method Details

AcquireJoystick() public method

public AcquireJoystick ( string name ) : SharpDX.DirectInput.Joystick
name string
return SharpDX.DirectInput.Joystick

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

Implement reccomended best practice dispose pattern http://msdn.microsoft.com/en-us/library/b1yfkh5e%28v=vs.110%29.aspx
protected Dispose ( bool disposing ) : void
disposing bool
return void

DoJoystickButtonFunction() public method

public DoJoystickButtonFunction ( ) : void
return void

Expo() public static method

public static Expo ( double input, double expo, double min, double max, double mid ) : double
input double
expo double
min double
max double
mid double
return double

Joystick() public method

public Joystick ( ) : System
return System

UnAcquireJoyStick() public method

public UnAcquireJoyStick ( ) : void
return void

changeButton() public method

public changeButton ( int buttonid, int newid ) : void
buttonid int
newid int
return void

clearRCOverride() public method

public clearRCOverride ( ) : void
return void

getButton() public method

public getButton ( int arrayoffset ) : JoyButton
arrayoffset int
return JoyButton

getChannel() public method

public getChannel ( int channel ) : JoyChannel
channel int
return JoyChannel

getDevices() public static method

public static getDevices ( ) : IList
return IList

getHatSwitchDirection() public method

public getHatSwitchDirection ( ) : int
return int

getJoyStickByName() public static method

public static getJoyStickByName ( string name ) : SharpDX.DirectInput.Joystick
name string
return SharpDX.DirectInput.Joystick

getJoystickAxis() public method

public getJoystickAxis ( int channel ) : joystickaxis
channel int
return joystickaxis

getMovingAxis() public static method

public static getMovingAxis ( string name, int threshold ) : joystickaxis
name string
threshold int
return joystickaxis

getNumButtons() public method

public getNumButtons ( ) : int
return int

getNumberPOV() public method

public getNumberPOV ( ) : int
return int

getPressedButton() public static method

public static getPressedButton ( string name ) : int
name string
return int

getRawValueForChannel() public method

public getRawValueForChannel ( int channel ) : ushort
channel int
return ushort

getValueForChannel() public method

public getValueForChannel ( int channel, string name ) : ushort
channel int
name string
return ushort

isButtonPressed() public method

public isButtonPressed ( int buttonno ) : bool
buttonno int
return bool

loadconfig() public method

public loadconfig ( string joystickconfigbutton = "joystickbuttons.xml", string joystickconfigaxis = "joystickaxis.xml" ) : void
joystickconfigbutton string
joystickconfigaxis string
return void

saveconfig() public method

public saveconfig ( ) : void
return void

setAxis() public method

public setAxis ( int channel, joystickaxis axis ) : void
channel int
axis joystickaxis
return void

setButton() public method

public setButton ( int arrayoffset, JoyButton buttonconfig ) : void
arrayoffset int
buttonconfig JoyButton
return void

setChannel() public method

public setChannel ( JoyChannel chan ) : void
chan JoyChannel
return void

setChannel() public method

public setChannel ( int channel, joystickaxis axis, bool reverse, int expo ) : void
channel int
axis joystickaxis
reverse bool
expo int
return void

setReverse() public method

public setReverse ( int channel, bool reverse ) : void
channel int
reverse bool
return void

start() public method

public start ( string name ) : bool
name string
return bool

Property Details

elevons public_oe property

public bool elevons
return bool

enabled public_oe property

public bool enabled
return bool

name public_oe property

public string name
return string

self public_oe static_oe property

public static Joystick self
return Joystick