"Error: PlatformViewItem ():Unable to identify parent of a ViewItem. FQID not initialized." even in ServerSideCarrousel plugin sample

We created our SmartClient ViewItem plugins based on the code in the ServerSideCarrousel sample.

However we found that this sample throw some debug logs and errors at runtime that can be catched in client MIPLog.txt

When the ServerSideCarrousel ViewItemUserControl is displayed in Smart Client, if we move from Live to Setup mode and back to Live the debug log reports:

“Debug: ImageViewerControl:Initialize ():ImageViewerControl:Initialize called twice without a call to Close()”

I think we found the reason why the ImageViewerControl is Initialized twice.

Is there any drawback doing this double initialization?

In this sample I see no reason for initializing again at every mode change the ImageViewerControl outside the Init function. Which could be the reason for having it disposed and closed outside the Close function?

The second most important issue is the error:

“Error: PlatformViewItem ():Unable to identify parent of a ViewItem. FQID not initialized.”

This is thrown when server configuration is manually reloaded from client.

After this reload the first camera of th carrousel is not loaded in the ImageViewerControl.

We need to move to Setup mode and back to Live mode or to push the Next/Previous button in the ViewItem for having the ImageViewerControl starting displaying correctly the cameras.

We faced similar issue when reloading server configuration with our plugins (based on this code).

Which is the root cause of this error?

How can we avoid it?

Is there some missing parent reference in the items initialization in the sample?

I will try to reproduce the observations, hopefully I can learn something that will help me find a reply for you.

I’m testing this with XProtect Essential+ 64 bit running on Windows 10 Pro

The client is 2017 R3 64bit and running on the same machine.

I could reproduce the observations. However it did not lead me to a bigger realization of what to do about it. I will discuss it with Milestone Development..

With the help of Milestone Development there is now an answer:

The sample is reloading the properties after the PropertyChangedEvent is fired.

Please apply the following changes:

in CarrouselViewItemUserControl.cs line 443

private void viewItem_PropertyChangedEvent(object sender, EventArgs e) 
{ 
if (_imageViewerControl != null) 
{ 
_imageViewerControl.UpdateStates(); 
if (_loadCameraTimer.Enabled == false) 
ShowNext(); 
} 
} 

The ‘if’ statement will start loading next camera in the view.

Also, in CarrouselViewItemManager.cs, line 39:

public Guid SelectedCarrouselId 
{ 
get { return _selectedCarrouselId; } 
set 
{ 
if (_selectedCarrouselId != value) 
{ 
_selectedCarrouselId = value; 
SetProperty("SelectedGUID", _selectedCarrouselId.ToString()); 
 
Item item = Configuration.Instance.GetItemConfiguration(ServerSideCarrouselDefinition.CarrouselPluginId, ServerSideCarrouselDefinition.CarrouselKind, _selectedCarrouselId); 
CarrouselConfigUtil.BuildCarrouselList(item, CarrouselItems); 
 
SaveProperties(); // Moved down to after the re-build of camera list 
} 
} 
} 

Notice that the ‘SaveProperties()’ has been moved down AFTER the re-build method, as the SaveProperties will fire the event the UserControl is reacting on.

PS.

We will make sure the Server Side Caroussel is corrected in MIP SDK 2018R2 when released.

Hi Bo,

please help me in understanding.

This change, in case of server configuration reloading, prevents the ViewItemUserControl to access data (the camera list in this case) before they have been completely reinitialized by the ViewItemManager?

And in case the timer is not running loads the first camera in the list?

The plugins are reloaded in case of server configuration reloading. I hope that answers it.