Data processing on the script language Lua |
For the sake of simplicity and convenience in processing large volumes of data in C++ programs, a scripting programming language Lua is utilized. Lua provides tools for executing mathematical functions, processing files, and handling metadata tables.
Dialog for interactive input and performance of scripts looks like:
For calculations of semantic characteristics, attention is paid to the objects highlighted on the maps or objects for which a search filter is set by clicking the Filter button in the dialog box.
Script window serves to input various computing operations in which the built-in functions, listed in the field of dialog the Hints for writing a script, can be used. By double-clicking with the left mouse button on a hint line, the selected function is copied to the script input field. In one scenario, an arbitrary number of actions for calculating semantic characteristics is permissible.
For example, multiply the area of an object by the length from semantics with code 1 and store the resulting value in semantics with code 7 (codes depend on the map classifier):
value = getSquare() * getCodeSem(2) setCodeSem(7, value)
If a symbolic value is the parameter of an embedded function in a script, it must be enclosed in double or single quotes. In the dialogue, you can open and create an arbitrary number of scripts. Scripts are located in dynamically loaded tabs. The script file name is set programmatically (temporary name «temp») or by the user (Save button). To delete a tab, you need to click the cross in the top right corner of the tab header with the left mouse button.
For convenience in selecting semantic codes, a list of classifier map semantics is provided on the right side of the dialogue window. The list of semantics is only available for viewing. Upon completion of the execution process, the script is automatically saved in the LOG folder for the open map. Errors that occur during script execution are placed in the program's work log and can be viewed by activating the Error Log button.
|