I am creating a Management client plugin where I need to access all avalible states for each device, so when chosing an Input or other device in a TreeView i can populate a listbox with all its known states.
It might be helpful for you to see this sample, if you want to see the status of your device – status viewer sample
Thanks, but this examble does not show how to get the states at forehand. I need a function like when you define an alarm, where you chose the kind first then the states depending on witch kind you chose.
John
Hi John.
Sorry for the delayed response, but we have actually been discussing various approaches to what you are asking. Unfortunately without coming up with a solution.
The system only contains a full list of events supported by any device on the system, but not a specific list of which devices supports which event.
The only option as we see it is that you use the configuration API for the alarm definitions and then you can run through all the device events one by one and pass it on to the system which will then return to you which device types supports that event. It will, however, not tell you if a certain event is only supported by one specific input on the system.
I know this is not an ideal solution and I will add to our backlog to consider whether we can implement a method that can at least tell which events are supported for a specific device type, but that will not be in the near future so for now you will probably have to do with the above.
Also, we cannot give you a fixed list in the SDK documentation as the events are defined by the device drivers and in some cases even the devices themselves, so the list is quite generic for each system.
Best regards,
Peter
Hi Peter
Thank you for your response. I hope you will find time for this somewhere in the future, seems like a fairly usefull function eg. GetSupportedEvents(EventType).
I understand why a static list in the SDK isnt usefull but given that in VideoOS.Platform.Admin.ItemManager there is a GetKnownEventTypes shouldnt it be fairly easy to do a dynamic list?
Ill try with the Alarm configuration API, and do it backwards.
Best regards John
Hi John,
The ItemManager.GetKnownEventTypes is only for a plugin ItemManager to return to the system a list of events defined by the plugin, so not so relevant here.
However, you can also use the SystemStatusClient.GetAllStatusEventMessages() method to get all available events. However, it will not tell you which device types they are associated with.
Br,
Peter
Hi Peter.
I do know this, but it seems it would be easy to gather this i one method.
Anyways. GetAllStatusEventMessages() is that per Recording server.
How is the list in Alarm deffinitions or Create Rule gathered? Still a bit backwards but its better than what i have.
John
Hi Again
I found the multisession version. But is it possible to do this without using a login, seems a bit unclean within a plugin?
John
I am not sure I follow your question. You need to be logged into the environment you are running in, but if your code is in a plugin that will already have been done for you. SystemStatusClient does not require a login of its own.
Hi Peter
Then I must be doing something completly wrong. When trying to call Dim multiSession As New VideoOS.Platform.SDK.StatusClient.SystemStatusClient(x)
if x = Configuration.Instance.ServerFQID multiSession is Empty
but when x = UserContext.Configuration.ServerFQID (and UserContext is set with login) it works. But then I need to have some login information.
John
Hi John,
I had overlooked that you are in a Management Client plugin when I first answered regarding the SystemStatusClient and then in my follow-up answer I had forgotten that SystemStatusClient is in the VideoOS.Platform.SDK dll. This dll should only be used in the standalone environment, since you will otherwise have two environments mixed (which is why you are seeing some semi-strange results).
Unfortunately the only option is then through the alarm definition configuration api as I mentioned initially. ![]()
Br,
Peter
Hi Peter
To save me some time, could you point me more directly i the right direction. Purhapse even if there is an example code that shows how to use alarm definitions?
John
Hi again
We don’t have a sample doing this explicitly, but I wrote a bit of code you can use with the config api client that you can for instance find in the Smart Client Add User sample (same code can be used in a MC plugin):
ConfigurationItem alarmDefFolder = client.GetItem("/AlarmDefinitionFolder");
var method = client.InvokeMethod(alarmDefFolder, "AddAlarmDefinition");
method.Properties.First(p => p.Key == "EventTypeGroup").Value = "1eacbcad-d566-4375-834b-cfbe3d937caa"; // device event group
var result = client.ValidateItem(method);
var eventTypeProperty = result.ResultItem.Properties.First(p => p.Key == "EventType");
foreach (var eventTypeValue in eventTypeProperty.ValueTypeInfos)
{
Console.Write([eventTypeValue.Name](https://eventTypeValue.Name) + ": ");
eventTypeProperty.Value = eventTypeValue.Value;
var tempRes = client.ValidateItem(result.ResultItem);
Console.WriteLine(tempRes.ResultItem.Properties.First(p => p.Key == "SourceList").ValueTypeInfos.First(v => [v.Name](https://v.Name) == "PathItemType").Value);
}
Admittedly not the most beatiful approach and will also take some time to run, so don’t do it too often, but should give you result like the below:
Audio Falling: Microphone
tns1:PTZController/tnsaxis:PTZReady-0: Camera
tns1:PTZController/tnsaxis:Move/Channel_8-1: Camera
CyberAttack: Camera
tns1:Device/tnsaxis:SystemMessage/ActionFailed-2: Camera
tns1:Device/tnsaxis:IO/VirtualInput-1: Camera
Ptz Manual Session Stopped: Camera
Live Client Feed Requested: Camera
GunShotDetected: Camera
tns1:RecordingConfig/DeleteRecording-2: Camera
tns1:VideoSource/GlobalSceneChange/ImagingService-0: Camera
SupervisedInputOpen: InputEvent
Hi Peter
I got it working of what you sent. And beside being slow, it does solve the issues i had. So thanks a bunch.
Regards John