How to add device PTZpreset to PTZPresetFolder if i can obtain information about preset from camera through camera api?

PTZ and Presets might be helpful for you, please see this link -

https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/ptzandpresets/readme.html&tree=tree_2.html

Hello. In this example i’ve already tryed both approaches with Ccode and ECode

createEcodePreset();

createCcodePreset();

I understand that i can’t chanche presets on camera. But I want to add information about already created presets on camera through code (i can get information about preset from camera by myself)

Can you please check if your camera is supported as an absolute type PTZ?

https://www.milestonesys.com/community/business-partner-tools/supported-devices/xprotect-corporate-and-xprotect-expert/

If the camera is supported as a relative type PTZ, this means that the device is not capable of giving its absolute position to the XProtect Recording Server. Relative type PTZ will enable you to move the camera in direction and go to presets that are defined in the camera, this contrasts with absolute type PTZ, where the camera can give coordinates and go to coordinates. Coordinates does not work for relative positioning PTZ cameras.

There is a similar question on the Forum, please refer this link -

https://developer.milestonesys.com/s/feed/0D53X00007sU0pUSAS

So, let me ask you some questions. Are you using an absolute type camera? If so, have you setup the camera Absolute type on Management Client?

Does “Get absolute position from camera” work for you in the unmodified sample on C-Code VMS? Have you tried to use administrator user?

My camera is relative type. And returning position is all “NaN”. I want to implement functionality of XProtect client when we get Presets from camera and add them to the Milestone configuration.

Coordinates does not work for relative positioning PTZ cameras so, it is not possible.

Ok. Thanks.

But I need add to server information about ptz.

How I can change in PtzPreset Class properties:

DevicePreset to true

DevicePresetInternalId to preset Id on camera.

Whitch function I need to use?

Or how to use “PtzPresetFolder.GetDevicePresets()” from SDK

I am afraid to say but it is not possible. As I posted in the previous comment, coordinates does not work for relative positioning PTZ cameras.