Settings update#
Camera 1#
For each settings of camera, there is a field called updating.
When you change a setting value while the drone is connected, a request to change this setting is sent to the drone.
The updating
field is set to true
indicating that a change request has been sent to the drone.
When the drone answers to this request, the updating field is set back to false
.
When you change a setting value while the drone is not connected, the updating
field remains false
.
The request to change this setting will be sent once the drone is connected.
Note
The drone may accept or refuse the change request.
Sample code showing updating flag value when a setting is changed:
/// Sets roll alignment.
func setAlignmentRoll(camera: MainCamera, roll: Double) {
if let alignment = camera.alignment {
// updating is false
print("updating: \(alignment.updating)")
// set setting value
camera.alignment?.roll = roll
// updating is true
print("updating: \(alignment.updating)")
}
}
Camera 2#
Camera2Config
, Camera2WhiteBalanceLock
and Camera2ExposureLock
have an updating
field.
When you change camera configuration, white balance lock or exposure lock, while the drone is connected, a request is sent to the drone.
The updating
field is set to true
indicating that a change request has been sent to the drone.
When the drone answers to this request, the updating
field is set back to false
.
When you change a configuration value while the drone is not connected, the updating
field remains false
.
The request to change the configuration will be sent once the drone is connected.
Note
The drone may accept or refuse the change request.
Sample code showing updating
flag value when camera configuration is changed:
func setAlignmentRoll(camera: MainCamera2, roll: Double) {
// updating is false
print("updating: \(camera.config.updating)")
// create configuration editor, starting from current configuration
let editor = camera.config.edit(fromScratch: false)
// retrieve configuration parameter
if let configParam = editor[Camera2Params.alignmentOffsetRoll] {
// change parameter value
configParam.value = roll
// automatically complete configuration
editor.autoComplete()
// send new configuration to drone
_ = editor.commit()
// updating is true
print("updating: \(camera.config.updating)")
}
}