You can save a lot of time and effort by using commands. Designers that have been using computers for many years remember using legacy software that only provided a command interface and could scarcely be used without consulting the manual. Fortunately, a lot has changed to make commands easier to use, and OSLO employs several recent developments in software technology that make command operation much easier than before.
Probably the most important advance is that commands are now optional. You can accomplish about 95% of all operations in OSLO using the graphical user interface. Alternately, you can accomplish about 95% of all operations in OSLO without using the graphical user interface. You should learn something about both modes of operation and thereby obtain the freedom to choose the one that best fits a particular task.
A command, in the context of the present discussion, is a text object that is typed into OSLO to cause something to happen. A command is similar to a function, but a function returns a value, while a command does not. The number of commands available is huge (OSLO SIX contains more than 1500), but many are rarely used and serve only to enter or update lens data. Commands consist of one or more letters, possibly including a numerical suffix. An attempt has been made to make command names mnemonic of their action, but this often conflicts with the need for brevity. Many commands have aliases, which are generally alternate names that are more descriptive of the action.
Arguments and Prompts
Most commands include arguments, which are data that are used by the command to carry out its action. Arguments can be numerical or string values, and may be elements of a list of allowed values. All commands have command definitions (see below) that show the names, types, and allowed values of the arguments.
OSLO provides two formats for entering commands, one similar to a C function in which the arguments are enclosed in parentheses and separated by commas, and the other in which the arguments are separated by blanks. Thus the following three commands are the same:
pxt 2 3
pxt(2,3)
paraxial_trace(2,3) // long form
You can execute multiple commands in a single input line. When you do this, each command must be terminated by a semicolon. In fact, when you terminate commands with semicolons, they dont have to be on the same line. You can enter a number of commands on successive lines in the text editor, select the range, and then execute all of them at once by pressing the CTRL+E key.
A key to making commands easy to use is an extensive set of default values provided in the command definitions, and an elaborate set of rules for processing missing arguments. These are described in some detail in the Program Reference Manual. To use commands, you only need to know that if you leave out an argument, OSLO will try to fill in it automatically for you. If this is not possible, it will prompt you for a value.
An important innovation in OSLO is the Help argument, represented as a question mark. When you enter a command, you can include a question mark instead of a value for any or all arguments. If you do this, the program will prompt you to supply a value for the missing argument(s). For example, consider the following dialog (the echo preference has been turned on so you can see the development). In the first case, the pxt command is given without any arguments. The command is executed, and uses the defaults that have been assigned in the command definition (all commands are defined in the help system). Next the pxt command is given with the Help argument. Now, the defaults are not used, and the user is prompted for all necessary arguments. It should be noted that the necessary arguments vary according to previous arguments. For example, if in the following command "x" had been given instead of "y" for the paraxial meridian, additional arguments specifying the beam would have been requested.
>> pxt
*PARAXIAL TRACE
SRF PY PU PI PYC PUC PIC
7 0.016319 -0.124999 -0.124999 18.154007 0.342398 0.342398
>> pxt ?
<< Select parax trace surf range:
>> Srf
<< Enter first surf nbr:
>> 3
<< Enter last surf nbr:
>> 4
<< Select paraxial meridian:
>> y
*PARAXIAL TRACE
SRF PY PU PI PYC PUC PIC
3 4.788578 -0.037255 -0.442507 -0.296163 0.296163 0.502418
4 4.751323 0.091568 0.208927 -1.2212e-15 0.478775 0.296163
SmartCells and Modes
OSLO works differently from many programs in that it allows you to enter many commands while a spreadsheet or dialog box field is highlighted. If the surface data spreadsheet is open, for example, you can enter the command pxc into a numeric field, and the paraxial constants command will be executed. The field knows the difference between a command and a numeric entry, and the program acts according to its input. This is called a SmartCell. Similarly, you can execute many commands when a dialog box is open. For example, you can execute the wav command while the Show >> Lens drawing dialog box is open. This is called modeless execution. Both of the above make commands easier to use and more helpful. Neither of these capabilities work all the time, but are instead intended as convenience options that expedite your work.
Environments and Modules
There are sometimes conditions in the program when certain commands are not available. Each command has a certain environment associated with it which describes when the command is valid. If the environment flag is not set, a command cannot be executed. For example, when the lens spreadsheet is open, you cannot execute lens surface data editing commands; instead, you must move the cursor to the surface where you want to enter data and key in a value. Environments are set up to prevent data entry or command execution that could corrupt data or hang up execution.
In addition to environment flags, OSLO uses what it calls modules to provide context-dependent meaning for commands. For example, the th command enters a thickness in normal lens input, but in the configuration data routine, the same th command enters an item of configuration data. In one case, the arguments are a surface number and a value, in the other the arguments are surface number, configuration number, and value. OSLO keeps track of commands that have different meaning in different parts of the program by adding a suffix consisting of an underscore followed by a single letter, which indicates the module. For example, module C is the configuration data input module. You will see modular commands listed in the help system, although you normally dont need to be concerned with the details. In any case, you never enter the suffix letter yourself; OSLO adds it automatically when necessary.
If you dont know the name of a command, use the menu system. However, it is quite feasible to remember the most common commands and use them as needs arise. To learn these commands, it is helpful to break them into three groups:
Star Command Programming (SCP)
Copyright © 1997 Sinclair Optics Inc. All rights reserved.
Page last updated 19970601