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

test[dji8-ios] A4 Gimbal

" Accessing the Gimbal of product "
| product |
product := DJISDKManager product.
product isNil ifTrue: [ ^self abortPage ].
self print: 'Accessing product gimbal: ' ,product gimbal.


" Accessing properties... "
| object echo |
object := DJISDKManager product gimbal.
#(	MovementSettingsProfile
	PitchRangeExtensionEnabled
	MotorEnabled
) do: [:each|
	echo := [:value| self print: '// ',each ,'=',value ].
	object perform: #with ,each ,$: with: echo
].


" Accessing Gimbal properties "
| value |
value := DJISDKManager product gimbal.
(value class selectors
  select: [:each| (each startsWith: #is) and: [each argumentCount = 0] ])
  ,#( capabilities )
  do: [:msg| self print: ' ',msg,'=',(value perform: msg) ].


" Accessing Gimbal capabilities "
| value |
value := DJISDKManager product gimbal capabilities.
value isNil ifTrue: [ ^self print: 'Missing value' ].
value keys sorted do: [:key| |each|
  each := value at: key. 
  self print: key ,' supported=', each isSupported.
  #(min max) do: [:msg|
    (each respondsTo: msg) ifTrue: [
      self print: '  ',msg,'=',(each perform: msg)
    ].
  ].
]