Tips and Tricks
torsdag, 29 oktober 2015
Forfatter: Bo Andersen
Six tips and tricks for you from the people that developed our MIP SDK. The SDK offers a wide pallet of functions and possibilities. This quarter we explain amongst other things; how to view past events, use the ActionManager, and did you know you can get support via our forum?
#1 viewing past events from a system.
The StatusViewer sample is the best sample for showing you status and events as they happen, but has no methods for past events. The AlarmViewer sample will connect to XProtect and show you alarms (live and past), with very small modification you can change it to ask for events instead of alarms. Instead of using GetAlarmLines() use GetEventLines() (other modification are necessary).
Note: Not using the MIP SDK you can see the event in the Smart Client: Create a new view, use an Alarm List item, and configure the Alarm List item to show events instead of alarms.
#2 Get help from developers
Do you use the SDK forum? This is where you can ask questions regarding the forum, find previously answered questions and find documentation and guides… you can find the forum here.
#3 Milestone Federated Architecture
The MIPSDK contains a number of supportive features and functions for accessing all sites in a Milestone Federated Architecture (MFA). It is important to think about large scale systems and how customers install and configure their systems. If e.g. a camera has been selected by an administrator to be used for a specific purpose ( like input to an analytics engine ), then the service performing this task should only login and get information from the site that owns the camera. This is done by using the camera identification correctly.
The FQID (Fully-Qualitied IDentification) contains these key fields (for a camera!)
- ServerId (host name, URL, Guid) – pointing at a Recording Server
- ParentId - Identifying the Management Server Id
- ObjectId – Identifying the camera
So, for a camera, the FQID contains information for going directly to the recorder, and the FQID.ParentId identifies the Management Server to logon to for getting the token. During the administrators configuration task, the FQID can be saved in the analytics servers configuration, and be used effective to perform these two operations:
- Logon to the Management server, and save the token
- Connect to Recording Server and get video
In this case, only the site’s configuration may be needed.
- The below methods are implemented on the SDK Environment class:
- --- method LoadSiteItem(…)
- A method implemented on the SDK.Environment class to load key information from one site, e.g. URL to the site, and will help getting information about the sub-sites via the .GetChildren() method.
- --- method AddServer(siteItem, …)
- This method can be used when only specific sites should be accessed. Please note that by default, when adding a site then all sub-sites will be accessed as well.
- --- method IsServerConnected( … )
- This method will check if there is network connection to the specified server.
- --- method GetItemConfigurations( ServerId, …)
- This overloaded method is implemented on the Configuration class, has new starting parameter ‘ServerId’, to specify what site (e.g. Managetment Server) the MIP plugin configuration should be loaded from.
Use of “ActionManager” to make better integration with C-code rules As part of the 2014 release, rule integration can now be made more effective and easier to configure for Corporate and Expert installations. This support can for some installations reduce a requirement for defining a number of ‘User-Defined’ and related rules.
Check out the “Introduction to Rule System Integration” part of the MIPSDK documentation.
#5 Best way to see and understand the configuration.
When starting development using the MIP SDK you will need to understand the configuration that holds the information about the system, devices, cameras etc. Seeing it presented graphically can help this understanding. To this end, explore the ConfigDump tool sample. (Tool samples is a group of especially interesting samples in the sense that they provide overview in a way that can be generally useful.) The ConfigDump tool sample plugin will run in the Smart Client, in the Management Client, in the Management Application and in the Event Server. Similar to it is the ConfigAccessViaSDK sample that will run standalone.
Screen capture of the Configuration Access sample
#6 Use the MIP SDK templates
Use the MIP SDK templates; they do a huge job in getting the right environment ready for you, complicated gets easy. Especially doing MIP plugins it is hard to remember all the classes that must be implemented, using the template it is not hard.
The templates are:
- MIPLibraryVS2010 - for developing stand-alone MIP applications.
- MIPPluginAllVS2010 - for developing MIP Plugins for the Smart Client, the Management Client/Appplication or the Event Server.
- MIPAccessControlvs2010 - for developing MIP Plugins for the Access Control Module (ACM) framework.
NOTE: MIP SDK was built for Visual Studio 2010. This means that the old templates are in ...\My Documents\Visual Studio 2010\Templates\ProjectTemplates\
Copy the relevant templates from the 2010 folders into: ...\My Documents\Visual Studio 2012\Templates\ProjectTemplates\ ...\My Documents\Visual Studio 2013\Templates\ProjectTemplates\ depending on your Visual Studio version.
New Project dialog in Visual Studio with the Milestone Integration Platform templates.