I have a doubt about how to set up an MP on a spectrum analyzer client via script.
I see a question here in the dojo that helps me a lot to understand how to customize the MP.
But my question is about, how I can set this MP on the client (cube or Low-Code App) via script?
The method SetMeasurementPoints seems to receive an entire list of MPs, but it now gives the possibility to set one of them, and if I miss passing another MP in the list, it will delete the already existing in the spectrum analyzer.
Edit to explain better my idea:
At the moment in the MP i setup only the input port, and via script I want to "tick" the MP on the client that could be the Cube or Low Code App. (Below an image to explain better)
So my point is to "active" one of this MP via script, is something possible?
As far as I know, this is not possible via the API.
In DataMiner Cube a workaround is possible by making these configurations:
- In the spectrum element, enable "visualize measurement points" from the "measurement points" tab in the ribbon
- In the "Card" tab of the user settings, select "Open spectrum Analyzer" as "Default opening behavior for cards showing measurement points"
That way, you will get a list of measurement points in the surveyor:
Opening one of these measurement points will open up your spectrum element with the measurement point already selected:
These measurement point cards can also be included in workspaces for easier opening together with other cards.
As far as I know, there is no similar method to do this in low-code apps.
Thanks for adding extra information in the question. This sure helps to better understand your question.
As far as I gather, you want clients to automatically have a certain measurement point selected when they open a spectrum display.
Which measurement points are checked in the measurement point list as displayed on a spectrum card in Cube is a user-specific setting that applies to the sessions of that user only. If one user selects MP1 this MP1 will re-open when opening a new card, while a second user might have MP2 configured.
I'm afraid that there is no API to updated these presets/settings for all users in one go, or for active sessions.
Saving/updating this "measurement cycle" in a shared preset might be an option, but one will have to manually load those presets from Cube, which doesn't really sound as what you want.
If it can be of any help: Cube does allow for a measpt input argument which will select the specified measurement point.
You are correct: the SetMeasurementPoints method does expect definitions for ALL of the measurement points at once and will consider previously existing measurement points that do not appear in the new data as deleted.
There is currently no method to add or update a single measurement point.
Best approach here would be to call GetMeasurementPoints first and then extend/update the data returned from there. This updated data can then be sent back through SetMeasurementPoints. This will make sure that previously existing measurement points keep their configuration.
As far as I remember, the "object" type output of GetMeasurementPoints can be cast to object where each entry in there can be cast to string, which is the same format as what SetMeasurementPoints expects as input.