Hello,
I found a way to get the name and GUIDs of all the maps using the config API, but I can only do it if I have some AlarmDefinitions.
Is there another way to get the list of maps and SmartMaps from a standalone plugin?
Thanks
Hello,
I found a way to get the name and GUIDs of all the maps using the config API, but I can only do it if I have some AlarmDefinitions.
Is there another way to get the list of maps and SmartMaps from a standalone plugin?
Thanks
There is a handy message for this: MessageId.Server.GetMapRequest / GetMapResponse
Test code..
private MessageCommunication _mc;
private void GetMaps()
{
EnsureMessageCommunicationInitialized();
MapRequestData mapRequestData = new MapRequestData() { MapGuid = "" };
_mc.TransmitMessage(new VideoOS.Platform.Messaging.Message(MessageId.Server.GetMapRequest, mapRequestData), null, null, null);
}
private void EnsureMessageCommunicationInitialized()
{
if (_mc == null)
{
MessageCommunicationManager.Start(EnvironmentManager.Instance.MasterSite.ServerId);
_mc = MessageCommunicationManager.Get(EnvironmentManager.Instance.MasterSite.ServerId);
_mc.RegisterCommunicationFilter(GetMapResponseHandler, new CommunicationIdFilter(MessageId.Server.GetMapResponse));
}
}
private object GetMapResponseHandler(VideoOS.Platform.Messaging.Message message, FQID destination, FQID sender)
{
MapResponseData mapResponseData = (MapResponseData)message.Data;
foreach (var map in mapResponseData.MapCollection)
{
BeginInvoke(new MethodInvoker(delegate ()
{
UpdateLabel(map.DisplayName);
}));
}
return null;
}
Thanks Bo. Is there any way to get the image or CAD file?
No, there’s no way to do it.