Writing scripts in Field-Map Data Collector
Writing scripts directly in Field-Map Data Collector (using the inbuilt Script Editor) has one big advantage compared to using the "Run Data Processing Tools" function available in Field-Map Project Manager, that is: you can see the effect of your script right on the form of the desired layer without having to switch between the two Field-Map modules (Field-Map Project Manager and Field-Map Data Collector).
Writing On-Validate / On-Change / Layer scripts in Field-Map Data Collector
On-Validate, On-Change and Layer scripts can be written for the individual attributes in Script editor, a powerful tool which Field-Map Data Collector is equipped with.
The button "Script editor" is disabled by default. To activate it, open the System2.ini file stored in "C:\Users\Public\FieldMap" (Win Vista and 7) or "C:\Documents and Settings\All Users\FieldMap" (Win XP). Using Notepad, change the property "ScriptEditor=0" in the [Developer] section to "ScriptEditor=1". If the property name "ScriptEditor" is set to "1", the Script editor is made available in Field-Map Data Collector. For more information and options, see the Script editor chapter in the Field-Map Data Collector User Guide.
Opening and using Script editor
1. Switch to the Plots form and click the Script editor button. (You can also use the keys Alt+E to run the Script editor in Field-Map Data Collector or to switch between the Script editor and the active form.).
![]()
2. When the Script editor windows appears, first choose the type of a script (A)and the attribute (B) you want the script to be assigned to in the left side of the window.
![]()
3. Write your script in the text editor window (L) or import a script (Open button (I)) (*.fms) from the Project/File/Repository folder. Make use of the Script editor features designed for a more effective programming - they are placed on the upper bar as speed buttons: the Search and replace tools - Find button (G), Find next button (A), Find previous button (H), Replace button (B); the Compile button (J); the Insert attribute names into code button (D); the Enable script check box (E); and the Status info (F). You can also export your script by saving it (Save button - C) in the File/Repository folder so that it can be used in other Field-Map projects. Another very useful tool is the Script Monitor (hotkey - Alt+D) (K), which displays the names of all the scripts that get triggered and executed during project run. This tool is very useful when you develop a complex project where one script might run other scripts. For more information, see the Field-Map Data Collector User Guide.
![]()
Writing On-Demand scripts in Field-Map Data Collector
By definition, On-Demand scripts are never executed automatically: they are only run by Field-Map Data Collector users when needed. These scripts are available as a list of extensions at three different places in Field-Map Data Collector: in the Quick menu, in the Tools menu and in the Extensions menu. For more information on where to find these menus, please, see the Arrange extension menus chapter of the Field-Map Data Collector User Guide.
On-Demand scripts can be written in the Programming Extensions tool of Field-Map Project Manager. They cannot be written directly in Field-Map Data Collector. However, there is an alternative contradicting the previous sentence: If you add a button (i.e. an attribute of type button) to your Field-Map layer (this needs to be done in Field-Map Project Manager) and write an On-Change script assigned to this button in the Script editor, then pressing this button will run this In-Change script, which, in principle, will work as an On-Demand script.
See also:
Writing On-Validate / On-Change scripts in Project Manager;Writing On-Demand scripts in Project Manager; Writing Layer scripts in Project Manager; Writing scripts in Data Collector
© 2024 IFER-Monitoring and Mapping Solutions