Extensions in the form of dynamically linked libraries (DLL) can be used to to implement custom data processing or validation. A DLL module needs to be registered in the Field-Map Data Collector and after that it can be invoked via Extensions menu. 


The DLL extension can be prepared in any software development environment capable of producing Windows DLL executable files. To be utilized by Data Collector, each extension module has to implement a simple interface which allows Data collector to pass necessary parameters to the module.

Sample and template how to create Field-Map extensions with any version of Delphi development tool is here: %ProgramFiles%\IFER\Field-Map\Extensions\API


Basic functions which has to be implemented by a module (in Object Pascal notation):

function FunctionCaption :PAnsiChar;

returns a module caption which will be displayed in extension menu

function FunctionName :PAnsiChar;

returns name of the main function in the module which performs the required task

function FunctionType :integer;

returns a number in range 0 – 3 indicating which set of additional parameters should be passed to a function specified by FunctionName. The function types are described later.

procedure BasicParameters (const DLLfilename :PAnsiChar;

const ActiveLayerName :PAnsiChar;

const FMDB_FileName :PAnsiChar;

const DatabaseDir :PAnsiChar;

const LicensedFieldMap :integer;

const UseVirtualKeyboard :integer;

const Int2,Int3,Int4,Int5,Int6, Int7,Int8,Int9 :integer;

const CurrentUsername :PAnsiChar;

const Reserved2, Reserved3,

Reserved4, Reserved5

:PansiChar

);

This function is called automatically before a main function (specified by FunctionName) is called and it is used to set the basic paremeters to the extension module : name of a module file, name of an active layer, directory where a project is stored etc.)


In addition to those mandatory functions the module interface needs to implement a single function performing the required task (called right after BasicParamaters). A name of the function is optional but must be returned by the FuncionName call. According to the task the function needs to perform it can receive several sets of parameters. You can specify the type of the function by returning an appropriate value from the FunctionType call. There are four predefined function types:


Function type 0


function MyFunction : integer;        


Function type 1


function MyFunction(const ProjectDir :PAnsiChar; const PlotID : integer) : integer;


Function type 2


function MyFunction(const PlotID :integer; const FullID :PAnsiChar) : integer;


Function type 3


function MyFunction(const PlotID : integer; const Device :integer); register;


If an extension doesn’t need to know ID of currently active plot (works at project level) it is sufficient to use function type 0, otherwise function type 1 or 2 is needed. Function type 3 is intended for special extensions working with measurement devices.


Note:

When an extension module is being used Field-Map Data Collector completely disconnects from a database. The extension needs to connect the database on its own and it is responsible for keeping the database in consistent state.


Please contact IFER for more information on developing custom DLL modules and development support.