Web de MiraMon

MiraMon Support Modules (MSA)


In addition to the Windows interface for viewing, consulting, printing, etc, of raster and vector data, MiraMon offers a set of advanced tools in the GIS, remote sensing and general cartography fields. These applications allow importing/exporting operations, layer clipping, geometric corrections, reprojections, analysis, etc. The generic name of this toolkit is MiraMon Support Modules (MSA)

MSAs are separate programs, independent of the MiraMon executable that run transparently with the same Windows interface that MiraMon uses. They can also be executed independently, as explained below. The two most important reasons that have led to this design are:

  • MiraMon functionalities that are not usually used have been separated from the main core, allowing it to be much faster than if the applications were included as a single executable. This feature is especially important when running the program on a local network, through the Internet or on machines with few resources: a small-sized MiraMon benefits users with less powerful machines, benefits multitasking processes on any computer and benefits the other users of the network in which MiraMon is on the server.
  • Medium and advanced user levels, including professional practice, often need to repeat certain tasks in large numbers (conversion of format for a large number of cartographic series files, geometric corrections of a huge quantity of satellite spectral bands, etc). Although the Windows interface is friendlier for first approaches or for eventual executions, when it is necessary to repeat tasks, this interface is cumbersome and not very operative. In these situations, the possibility of writing Batch processing programs and leaving relatively small applications working in the background (multitasking) is the preferred best alternative.

In summary, MSAs are applications that can be executed either from the system's command line or from the Windows graphical interface. The functionalities are exactly the same; the only difference is the way that parameters are prepared.

1. Execution of the MSA from MiraMon

The MSA graphic interface can be accessed from the MiraMon menus (for example, most of the import/export functions are in the "File" menu). With this interface it is possible to enter the file names (browsing the directory tree with the standard browser), select different options with buttons, blinds, etc, and access the help if necessary using the button . When the parameters are correct, it is possible to press the button , so the application is launched and the interface closes. The process information that is executed is the same as if it had been executed from the command line.

Each interface of the MSA "remembers" the last parameters used, even if the program is closed (this is because the parameters are saved in the *.par file, where * is the name of the application that has been used). This works even in network configurations.

Those MSA (or groups of MSA) that use Windows interface and that are present in the MiraMon menus are marked with a (*). This informs the user that, on the one hand, they are functionalities implemented as external applications (and that, if desired, they can be part of a metaprogram or BAT process), and on the other hand, the inputs and outputs of these applications are totally independent of the files displayed at that time with MiraMon. The files generated by any module are offered to be opened in the MiraMon session from which the corresponding module has been called. This functionality is configurable from the ObrirResultatMSAaMiraMon= key of the [MSA] section of the MiraMon.par. If this new functionality is activated (activated by default), as the Director asks which session the user wants to open the result (by preselecting the session that originated the result), the user can also cancel, thereby maintaining the original philosophy of the program of not wasting time waiting for the results if they are not desired. For example, if a clipping of a MiraMon layer is executed it is possible to select in which MiraMon session visualize the results once the clipping process is finished.

2. Execution of the MSA from the command line (C:\>)

The MSAs can also be run from the command line of the system, which will show the execution syntax. If the user writes the name of the application followed by a blank space and the question mark the user will get more extensive help. For example:

CreaTop (help on basic syntax)

CreaTop ? (full help)

When the desired parameters are known, write the complete command line:

CreaTop T C:\CARTO\PUNTS\POUS

In the previous example it is assumed that the MiraMon directory is included in the path (see the operating system manual for more details). Otherwise, add the address to the name of the MSA:

F:\SERVIDOR\MIRAMON\CreaTop T C:\CARTO\PUNTS\POUS

3.Execution of the Windows Interface of the MSA from the Command Line (C:\>)

When working with Windows, the graphical interface of any MSA can be run simply by entering the name of the application preceded by a "W" in Start | Run or from an operating system window:

If the name of the application has 8 characters, the last one must be cut. For example "WCORRGEO" to execute the graphical interface of "CorrGeom". As explained above, if the MiraMon directory is not in the path, the user must add the complete directory before the name of the application:

C:\MIRAMON\wCreaTop

Many of the users who prefer to work from the command line can use this method to introduce, in an easier way, the necessary parameters for each application. The advantage of launching the graphic interfaces of the MSA from the command line is that the user does not have to look for the functionality in the MiraMon menu, so it is not essential to have MiraMon open.

With the intention of offering (and improving) the functionality of the system by repeating the last command line using the "up arrow" of the keyboard, each Windows interface of the MSA "remembers" the parameters of the last execution, even after the computer is turned off (this is due to the fact that the parameters are saved in a *.par file, where * is the program that has been executed).

4. Write BAT files from the Windows MSA interface

Some users write metaprograms using MSA, both from BAT files and from programs written in C, Pascal, etc. To facilitate this task, MiraMon provides a batch process generator accessible from the Windows MSA interface with the button .

The batch process generator visualizes the current command line, built from the Windows interface in a clear and differentiated way. It provides a method of manipulating the command line to modify general syntax parameters such as the Working Directory.

By clicking on the text with the right mouse button the user can copy the line to the clipboard and attach it to other editors. The user can also copy the plain text on a command prompt to execute the program immediately.

Through the "Add to BAT" button, the current command line is written to any BAT file. Once introduced in the file, it is possible to open it with an editor and replace the names of the files with variables and environment parameters (%1,%2, etc, for arguments and %VAR% for environment variables, etc). In this way it is possible to build metaprograms in a simple, fast and reliable way.

The last created BAT file is always "remembered" by the other MSA because its name is written in the "LastBatName" field of the [Batch] section of the MiraMon.par file.

Some Considerations

  • MSA Windows Interfaces shortcut personalization
  • Users of the MSA and its graphic interface can create a shortcut icon to any of them on the desktop.

    When editing the properties of the shortcut it is possible to configure "hotkeys" to run the application (for example Control + Alt + T for TIFIMG). See the Windows manual for more details on shortcut properties.

  • Fine-tuned execution of the MSA

In addition to the parameters of each MiraMon Support Application, any of them support the following parameters. These allow a fine control execution of the application, especially when they are executed from BATs or from other programs that user can write. The parameters can be indicated in any order and position on the command line.

a) GENERAL SYNTAX PARAMETERS

Without any parameter: Shows the syntax of the application.

? (single parameter): Shows the complete help of the application.

/DT: Specifies the current working directory from where the application launches (for more information see Command line parameters). When the specified directory contains a MiraMon configuration file (MiraMon.par) or geodesy tables, these prevail over the configuration file of the MiraMon directory. The path of all the files specified in the command lines of the console application are relative to this directory.

/MUT: The application runs without saying anything (mute), even in case of error. The screen is not cleared either.

/SIL: This setting prevents apps from emitting audible alerts (like /MUT, but the new setting does display screen messages).

/BAN: The application does not show the presentation screen. The screen is not cleared either.

/ERR: The application does not show the presentation screen. The screen is not cleared either.

/SAC: The application never stops before a question, unless the introduction of data by the user becomes necessary, which is very rare in the MSA. In these cases, remember that it is possible to indicate to the Operating System the parameters that would be introduced through a redirector. All "Press any key" requests are bypassed using /SAC.

/STP: The application stops (STOP) at the end of the program waiting for any key to be pressed. This is useful when calling the program from a Windows interface (as MiraMon does), or from an "Execute" Program Manager or the Windows "Start" menu.

Examples:

VECPNT 2 C:\PROJECTE\PUNTS C:\PROJECTE\PUNTS /MUT 5

VECPNT /SAC /ERR 2 C:\PROJECTE\PUNTS C:\PROJECTE\PUNTS 5

Some applications also share other syntax parameters.

b) REDIRECTORS

The MSA supports the standard DOS and UNIX redirectors "<" and ">".

  • With the redirector "<" it is possible to pass the parameters that would be entered from the keyboard to the program, but doing so through a text file in which all the parameters are written, one in each line (the returns are written simply as blank lines). Its most typical use in MiraMon along with the /SAC parameter.

    VECPNT /SAC 2 C:\PROJECTE\PUNTS C:\PROJECTE\PUNTS 5 < param.txt

  • With the redirector ">" it is possible to send all the messages that appear on the screen to a text file. This is useful for recording errors, collecting certain relevant information in texts, etc. The error messages, however, continue to be sent to the screen unless, of course, the user indicates /MUT.

    The redirectors must be at the end of the command line. Consult the manual of your Operating System for a complete description of the properties and use of the redirectors

c) ERROR LEVELS

The a MSA return the following error levels to the Operating System:

0: The process has finished properly.

1: An error has occurred, which is explained in the messages that are displayed on the screen before the end of the program.

2: The help of the program has been requested or the syntax was incorrect.

Error levels are useful for controlling the flow of metaprograms built with BATCH processes or through calls from other applications.

d) COMMAND LINES OF MORE THAN 128 CHARACTERS

The Operating System does not support command lines of more than 128 characters. In some cases, especially when the user has the data in "very long" directories, this limit can be exceeded. For example, imagine trying to write the following statement on the command line of the system:

LinArc 3 C:\USUARIS\DADES\MAPES\HOLANDA\CANALS C:\USUARIS\DADES\MAPES\HOLANDA\CANALS 0 "Nivell de navegabilitat del canal" NIV_NAVEGA

The user will notice that this command line can not be written because it is too long. In some configurations of the system it may be possible to execute it if the user writes the command in a BAT file, but it is possible to not obtain a correct result if the user extends the line beyond 260 characters.

When this happens it is possible to dodge the problem in one of two ways:

1: Use the SUBST command of the operating system. For example, if the user types:

SUBST Z: C:\USUARIS\DADES\MAPES

The user can write the previous syntax:

LinArc 3 Z:CANALS Z:CANALS 0 "Nivell de navegabilitat del canal" NIV_NAVEGA

and have it run without problems. See the Operating System manual for more information about the SUBST command.

2: Write the parameters inside a text file, a parameter in each line, and execute the application followed by the name of the file, preceded by the symbol '@'. For example, if the user edits a PARAM.TXT file with the following content:

3
C:\USUARIS\DADES\MAPES\HOLANDA\CANALS
C:\USUARIS\DADES\MAPES\HOLANDA\CANALS
0
"Nivell de navegabilitat del canal"
NIV_NAVEGA

The user can write the previous syntax:

LinArc @PARAM.TX