desktop

3.7 Modules

The functionality of MicroCity can be extended by modules, one type of which is SAGA Module (*.dll). SAGA Modules contains many useful libraries for Shapes and Grids. Another type of Module is MicroCity Script (*.mcs), which can be edited and debugged with icon_script_editorScriptEditor (see 4.1).

Loading, Closing and Executing Modules

Modules can be loaded to MicroCity by clicking Load button button or Modules->Load Module Library menu item. The Modules Tab of the Workspace Panel will display the loaded Librariesicon_module_lib (each of which corresponding to a file) and their inside Modules icon_module. One can close or reload a Module Library from the context menu. Executing a moule has many ways: double clicking it, clicking the Execute button from the Settings Panel, or click the Execute context menu item. One can also Debug a MicroCity Script module by clicking the Debug context menu item, that needs the ScriptEditor running in the background. MicroCity can also capture runtime errors and pause the execution of modules.

module_file_menu    module_menu

Accelerating, Stopping the Execution of a Module

MicroCity Script module is created with Lua language which is very fast. In some cases, if you want much more faster execution speed, you can click the icon_module_lib Module Libraries in the Modules Tab of the Workspace Panel and switch the Script Running Mode in the Settings Panel from the Safe Mode to the Fast Mode. Then MicroCity will use LuaJIT to execute modules.

If a module is being executed, one can stop it by click the Execute button in the corresponding Settings. In Safe Mode the execution can be immediately stopped, but in Fast Mode the stopping is depend on the GetReady() function called in the script (see 4.2.

module_libraries_settings    module_settings

< 3.6 Maps and Layers Table of Contents 4.1 SI Overview >