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

test[dji8-ios] A2 Battery

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


" Accessing Battery properties "
| battery |
battery := DJISDKManager product battery.
(battery class selectors
  select: [:each| (each startsWith: #is) and: [each argumentCount = 0] ])
  ,#( index numberOfCells )
  do: [:msg| self print: ' ',msg,'=',(battery perform: msg) ].


" Accessing properties... "
| object echo |
object := DJISDKManager product battery.
#(	WarningRecords
	LatestWarningRecord
	CellVoltages
	PairingState
	SelfDischargeInDays
	Level1CellVoltageThreshold
	Level2CellVoltageThreshold
	Level1CellVoltageBehavior
	Level2CellVoltageBehavior
) do: [:each|
	echo := [:value| self print: '// ',each ,'=',value ].
	object perform: #with ,each ,$: with: echo
].