Switch to a Smart Client View on Alarm

Hello,

We have some inputs that trigger an alarm .

On some alarms we need to open a Client view Camera as full screen .

I see the example “Dinamic View” that create a temporary View when I select an alarm.

I need a similar but not create a Dinamic View But switch on one of predefined views when an alarm is Fired.

I read the Documentation but I don’t find any command to Switch current view to a desidered View.

You can select specific ViewItem using Message with MessageId = SetSelectedViewItemCommand

Freddy

Hello,

Thanks for you Answer

I try calling

Collection result = EnvironmentManager.Instance.SendMessage(new Message(MessageId.SmartClient.SetSelectedViewItemCommand, myView.FQID),null,null);

But Not wotk.

MyView is extract using Configuration.Instance.GetItems(ItemHierarchy.Both); (Used recursively)

and filtering for the view I need.

What is Worng ?

Probably because the Message is missing the Data part, where you have to specify which index of the view to select

Freddy

My guess is that Frediano is right, just want to add two pieces of advise..

You can debug, and inspecting the Data or generally see it unfold..

https://developer.milestonesys.com/s/article/debugging-techniques-for-Smart-Client-plugins

You can see the MessageId.SmartClient.SetSelectedViewItemCommand in action if you explore the Smart Client View and Window Tool plugin sample.

https://developer.milestonesys.com/s/article/Exploring-the-MIP-SDK-Tool-View-and-Window-Tool

https://doc.developer.milestonesys.com/html/index.html?base=samples/pluginsamples/scviewandwindow/readme.html&tree=tree_1.html

https://github.com/milestonesys

Hello,

thanks for you reply.

I examine the Example in details and I founf that the message I need is the MessageId.SmartClient.MultiWindowCommand with the command “SetViewInWindow”.

But when I launch it from my background task that receive the Alarm Event I receivce an Expetion : MultiWindowCommandHandler Exception .

I think that I cannot call from the background task .