[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[dji8-ios] B2 FlightController

" Accessing flightController "
| value |
DJISDKManager product isNil ifTrue: [ ^self abortPage ].
value := DJISDKManager product flightController.
value isNil ifTrue: [ ^self print: 'Missing value' ].
(value class selectors
  select: [:each| (each startsWith: #is) and: [each argumentCount = 0] ])
  ,#( "IMUCount" RTK compass flightAssistant landingGear rollPitchControlMode rollPitchCoordinateSystem  simulator verticalControlMode yawControlMode )
  do: [:msg| self print: ' ',msg,'=',(value perform: msg) ].


" Accessing properties... "
| object echo |
object := DJISDKManager product flightController.
#(	MaxFlightHeight
	MaxFlightRadius
	MaxFlightRadiusLimitationEnabled
	HomeLocation
	GoHomeHeightInMeters
	ConnectionFailSafeBehavior
	GoHomeBatteryThreshold
	LandImmediatelyBatteryThreshold
	LEDsEnabled
	ControlMode
	TripodModeEnabled
	TerrainFollowModeEnabled
	AutoQuickSpinEnabled
	RCSwitchFlightModeMapping
	VisionAssistedPositioningEnabled
	VirtualStickModeEnabled
) do: [:each|
	echo := [:value| self print: '// ',each ,'=',value ].
	object perform: #with ,each ,$: with: echo
].


" Accessing flightController's compass "
| value |
value := DJISDKManager product flightController compass.
value isNil ifTrue: [ ^self print: 'Missing value' ].
(value class selectors
  select: [:each| (each startsWith: #is) and: [each argumentCount = 0] ])
  ,#( hasError calibrationState heading )
  do: [:msg| self print: ' ',msg,'=',(value perform: msg) ].


" Accessing flightController's flightAssistant "
| value |
value := DJISDKManager product flightController flightAssistant.
value isNil ifTrue: [ ^self print: 'Missing value' ].
(value class selectors
  select: [:each| (each startsWith: #is) and: [each argumentCount = 0] ])
  ,#( )
  do: [:msg| self print: ' ',msg,'=',(value perform: msg) ].


" Accessing flightController's landingGear "
| value |
value := DJISDKManager product flightController landingGear.
value isNil ifTrue: [ ^self print: 'Missing value' ].
(value class selectors
  select: [:each| (each startsWith: #is) and: [each argumentCount = 0] ])
  ,#( )
  do: [:msg| self print: ' ',msg,'=',(value perform: msg) ].


" Accessing flightController's simulator "
| value |
value := DJISDKManager product flightController simulator.
value isNil ifTrue: [ ^self print: 'Missing value' ].
(value class selectors
  select: [:each| (each startsWith: #is) and: [each argumentCount = 0] ])
  ,#( )
  do: [:msg| self print: ' ',msg,'=',(value perform: msg) ].