Using Parameter Presets

The Ensenso SDK installation comes with a set of parameter presets for different purposes. These presets are located in the installation directory in the form of JSON files. Please first familiarize yourself with JSON schema and our NxLib specific preset schema. You can then define your own presets and use the GetPresets command to load them from the NxLib. Our preset example helps you getting starting with writing your own presets. The following code snippet shows how to get a preset with a known name and how to apply the result to a camera.

Code Example

	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];