About rendering of Smart Client plugins

We are developing a plugin for XProtect’s SmartClient.

Our plugin was working as expected with versions of XProtect up to 2022R3, but it no longer works with XProtect 2024R1. No changes have been made to the source code during this period.

Regarding the issue:

With XProtect 2024R1, immediately after launching SmartClient, the view with the pre-configured plugin does not render. After updating from 2021R2 to 2024R1, it no longer functions correctly. Further investigation revealed that it works correctly up to 2022R3 but stops functioning properly from 2023R1 onwards. Therefore, we suspect that changes between 2022R3 and 2023R1 may be responsible.

Specifically, we have created a class that inherits from the VideoOS.Platform.PluginDefinition class and perform rendering processing within the ViewChangedHandler method. However, it has been confirmed that the ViewChangedHandler, which used to be called at the time of SmartClient launch (up to XProtect 2022R3), is not being called in XProtect 2024R1.

To add further details, there are patterns where ViewChangedHandler is and isn’t called. The following two patterns do not call ViewChangedHandler:

- At the time of SmartClient launch (immediately after login)

- After switching views, when re-selecting a specific view after choosing another

However, in the following pattern, ViewChangedHandler is called as expected:

- After switching tabs at the top of the SmartClient screen, when re-selecting the view tab after choosing the export, search, or alarm manager tab

If there have been any specification changes regarding view rendering in XProtect 2024R1, please provide the details and specific solutions.

You name the handler but not the message you are subscribing to. My guess is the SmartClient.SelectedViewItemChangedIndication

You would have a _object = EnvironmentManager.Instance.RegisterReceiver(ViewChangedHandler, ..

Am I on the right track?

Where (in which class) is the RegisterReciever and the ViewChangedHandler?

Please see if the MessageTester plugin sample works for you in your test setup, and you see “SelectedViewItemChangedIndication” coming in on the Message Trace.

https://doc.developer.milestonesys.com/html/index.html?base=samples/pluginsamples/messagetester/readme.html&tree=tree_search.html?search=messagetest

If the sample works where your plugin fails it might be a clue for us to understand how the plugin stopped working. If there are differences in how the sample and your code does this please share that information.

General debugging advise..

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

Thank you very much for your response. Thanks to your guidance, we were able to resolve the issue.

As you pointed out, we registered the event in `EnvironmentManager.Instance.RegisterReceiver` using `ViewChangedHandler`. By changing the event from `MessageId.SmartClient.SelectedViewChangedIndication` to `MessageId.SmartClient.SelectedViewItemChangedIndication`, the plugin rendering process is now correctly executed at the following times:

- Immediately after logging into SmartClient.

- After switching views.

Old:

`EnvironmentManager.Instance.RegisterReceiver(ViewChangedHandler, new MessageIdFilter(MessageId.SmartClient.SelectedViewChangedIndication))`

New:

`EnvironmentManager.Instance.RegisterReceiver(ViewChangedHandler, new MessageIdFilter(MessageId.SmartClient.SelectedViewItemChangedIndication))`

Thank you very much.