Milestone, Software Development Insights, Technical

Extending Milestone Smart Client with Bing Maps

The utilization for Milestone’s Xprotect smart client gets more limitless with every version. It supports hardware accelerated video decoding, and this means that you can be able to view very high resolution streams about 5 times better with your lower CPU and the aid of external graphics card. Amongst all its magnificent SDK has allowed the Gunnebo team to make a great plugin for the Xprotect Smart Client 2018 that now implements Microsoft’s Bing maps.

This operation is possible due to XProtect Smart Client very powerful, adaptable and easy-to-use client application for the daily operations of security installations. Using the Milestone Integration Platform and the unique application plug-in architecture, various types of security and business systems applications can be seamlessly integrated in XProtect Smart Client.

Bing Maps has abilities such as:

  • Buildings can be created with a number of levels which are easily navigated through a pane that will be made available for you after selecting a building.
  • Cameras can be added and attached to different levels. With this you will be able to shift the camera for different levels available.
  • You will be able to have a complete geographical overview of all the camera from different sites on your smart map. With this, you can be able to build live and current feed and as well monitor the recordings from your smart map camera.
  • It can go through seamless operations of jumping to cameras or custom overlays rather than having to navigate to them manually.

Bing maps can be easily embedded into the Xprotect smart clients with the aid of the Gunnebo map plugin which allows for seamless operation and as well shows all camera locations on the map.

blog1

Window presentation foundation, a graphical subsystem from Microsoft was used by the Gunnebo team to work on the Bing map in such a way that the software development kit provides the basic programming pattern for tor the Bing.

The system requirements that this program is compartable with includes: windows 7, windows 8, widow’s server 2008, windows vista, windows 2000 service pack, widow’s server 2003 etc. Make sure you verify that your operating system is compatible with this programming reference before downloading the application or running it.

For its incorporation with milestone’s Xprotect the plugin would automatically generate location names from Milestone Camera groups/folders and groups cameras according to Milestone grouping.

The Milestone Camera and their location entity (parent folder) could be retrieved by MipSDK by the follow calls:

var items = Configuration.Instance.GetItemsByKind(Kind.Camera);

where

  • if FQID.Kind==Kind.Folder that means location(parent folder)
  • if FQID.Kind==Kind.Camera that means camera

Administrator of SmartClient can drag/drop each location into the map or specify the location address and comments.

You can search for different views for the various camera available on the view item types. Take for example if you want to see all of the views for the PTZ cameras, or those fron a particular manufacturer, or those that contain view item types:

  • Map
  • Alarm
  • Matrix
  • HTML
  • Name of camera in view
  • Add on products

With this you can be able to search for the key words available.

Location on the map

The Administrator of SmartClient can drag/drop each location into the map or specify the location address and comments. Also, you can create locations at the points of the map that interests you. with this you can be able to create a location for home office, satellite office. Aside the fact that the location will give you a full picture of your environment, you can also use them in the navigation of the map.

However, you should know that an Xprotect smart client location can only be added depending on your configuration. With this it becomes very easy with go to the general overlay of map when you are zoomed out.

Location data is stored on a central server in XProtect configuration. Administrator needs to set it up only once, then it will be shared between all SmartClients. Also once Administrator edits it in any SmartClient instance, it will be shared between all of them.

public static Guid DefaultLocationGuid = new Guid("AA2BB85A-B965-448f-BBA9-CC4DCE129411");

public static void SaveLocationCoordinates(this IList locations)
  {
   var coordinatesConfig =
         locations.Select(item =>
            new MapLocationConfigItem()
                { Latitude = item.Latitude, Longitude = item.Longitude, Name = item.Name,Address = item.Address}).ToArray();

    var node = coordinatesConfig.ToXmlNode();
    Configuration.Instance.SaveOptionsConfiguration(DefaultLocationGuid, false, node);
   }

To retrieve the stored coordinates from XProtect Central Server the follow code could be used:

var coordinatesConfigXmlNode = Configuration.Instance.GetOptionsConfiguration(DefaultLocationGuid, false);
var coordinatesConfig = coordinatesConfigXmlNode.ToInstance<MapLocationConfigItem[]>();

Where the key element is DefaultLocationGuid that contains a GUID of the our custom configuration entry.

Camera Navigator

The camera navigator is a feature that enables the ability to view all the cameras in relation to one another. This means the camera would be seen as they are laid down on a floor plan or map. With the camera navigator, you will be able to move from one camera to another in just a single view.

blog2

The plugin checks the status of each camera and marks every location on the map with colored icon:

  • green if all cameras inside that particular location are online,
  • yellow if less than half cameras are offline,
  • red if more than half cameras are offline

To get the cameras status we use MessageCommunication mechanism provided by Milestone and implemented in MipSDK.

The plugin checks the status of each camera and marks every location on the map with colored icon:

  • green if all cameras inside that particular location are online,
  • yellow if less than half cameras are offline,
  • red if more than half cameras are offline

To get the cameras status we use MessageCommunication mechanism provided by Milestone and implemented in MipSDK:

Here we initializing  MessageCommunication API and registering callback(ProvideCurrentStateResponseHandler) which should be called once we get data with cameras statuses:

MessageCommunicationManager.Start(EnvironmentManager.Instance.MasterSite.ServerId);
messageCommunication = MessageCommunicationManager.Get(EnvironmentManager.Instance.MasterSite.ServerId);
communicationObject = messageCommunication.RegisterCommunicationFilter(ProvideCurrentStateResponseHandler,
                new CommunicationIdFilter(MessageCommunication.ProvideCurrentStateResponse));

To get the callback called and receive the status (online/offline) of each particular camera we should perform this call:

messageCommunication.TransmitMessage(
               new Message(MessageCommunication.ProvideCurrentStateRequest,
                    cameras.Select(camera => camera.CameraId.ToString()).ToArray()), null, null, null);

Below is an example of the implementation of ProvideCurrentStateResponseHandler callback:

private object ProvideCurrentStateResponseHandler(Message message, FQID dest, FQID source)
   {
     Collection result = message.Data as Collection;
     if (result != null)
       {
          foreach (ItemState itemState in result)
            {

           //itemState.FQID.ObjectId - Camera Id//itemState.State - Camera State             
    }
        }
            return null;
    }

The plugin also supports “Camera Monitoring” mode where all cameras are displayed regardless of location. Each camera has Status indication there and displays the time how long it being offline.

blog3

If you are interested in knowing more about the Milestone SDK or the plugins we can offer, feel free to contact me at bjorn.nostdahl@gunnebo.com 🙂

Leave a Reply