Using Parameter Presets

The Ensenso SDK installation comes with a set of parameter presets for different purposes. You can use the GetPresets command to load them as demonstrated in the following code snippet.

NxLibItem root;                              //  References the tree's root item at path "/"
NxLibItem camera = root[itmCameras]["1234"]; //  References the camera's item at path "/Cameras/BySerialNo/1234"

NxLibCommand open(cmdOpen);
open.parameters()[itmCameras] = camera[itmSerialNumber].asString();
open.execute();

// Load a camera parameter preset with a known name
NxLibCommand getPresets(cmdGetPresets);
getPresets.parameters()[itmName] = "PatchMatchSingleShotOneIteration";
getPresets.execute();

// Apply the preset to the camera
camera << getPresets.result()[itmPresets][0][itmData];