Development Environment for O-Calc Pro Plugins

  Plugin development

Introduction

This document describes the development process to create a customized O-Calc Pro Plugins and Reports. O-Calc Pro Plugins can be created to perform a wide verity of functions within the O-Calc Pro interface from importing data from some type of field data collection device to exporting the data to different formats or into specialized databases. Plugins can also be developed that manipulate the data right within the O-Calc Pro interface.

Before You Get Started

Before you can start to develop an O-Calc Pro Plugin, a few prerequisites are necessary.

  1. You must have O-Calc Pro Version 5.01 or later installed on the development machine at the following location: C:\Program Files (x86)\Osmose\O-Calc Pro\Bin
  2. You must have Microsoft Visual Studio install on the development machine, this can be Visual Studio Express
  3. Optionally you can install the O-Calc Pro Plugin and Report visual studio template to the following location:

    C:\Users\<username>\Documents\Visual Studio 2012\Templates\ProjectTemplates

    A zip file of the O-Calc Pro Visual Studio Templates can be downloaded from the O-Calc Pro User’s Website (http://www.osmoseutilities.com/o-calcpro). The ‘O-Calc Pro Visual Studio Templates.zip’ file contains two additional zip files in an ‘O-Calc Pro’ subfolder that would be exacted and placed right in the ProjectTemplates folder list above without further unzipping of the files.


    Note: You must use Visual Studio 2012 or Visual Studio Express 2012 for these templates to work. This document uses examples from Visual Studio Express 2012 for Windows Desktop which can be download at http://www.microsoft.com/en-us/download/details.aspx?id=34673

Templates

There are two Microsoft Visual Studio templates that can help jumpstart your O-Calc Pro custom development. Within in Visual Studio Express 2012, a new development project can be started by selecting File -> New Project. The O-Calc Pro templates are Visual C# Templates with the names:

O-Calc Pro Plugin

O-Calc Pro Report

In the screenshot below, the O-Calc Pro Plugin template has been selected and a unique project name of ‘MyOCalcProPlugin’ has been entered.

The O-Calc Pro Plugin visual studio project includes three components that developer can make use of:

  • AssemblyInfo.cs – can be used to change various general properties of the plugin
  • References – A number of O-Calc Pro library references are include that the developer can use. These references enable the normal Visual C# IntelliSence drop-down menus for the developer.
  • Plugin.cs – This is the main source file of the O-Calc Pro Plugin. Within this file, the developer can determine the type of plugin (Menu Item, Docked Tab, or both) and write the code to perform the plugin tool’s operation.

The O-Calc Pro Report visual studio project includes four components that the developer can make use of:

  • AssemblyInfo.cs – can be used to change various general properties of the report
  • References – A number of O-Calc Pro library references are include that the developer can use. These references enable the normal Visual C# IntelliSence drop-down menus for the developer.
  • Helpers.cs – This a helper source file of the O-Calc Pro Report template. This source file contains various helper methods that aid in formatting the report. Items such as creating and formatting tables, color coding text based on loading values, and manipulating images and graphics.
  • Report.cs – This is the main source file of the O-Calc Pro Report template. This source file enables the developer to define the various aspects of the report format including colors, fonts, and data to be displayed. There are also methods to implement more than one report subtype and determining the structure type that is applicable for this report.

Facebooktwitterlinkedinmail