In the following we show how server commands, variable substitution and client commands can be combined in order to create a small environment which can be used for generating Enif plots automatically.
In the following header file named plotgen.sen, all necessary Enif parameters are created and grouped to the corresponding Enif system parameters with which they have to synchronize their values, and some functions are defined which can afterward be called to perform specific tasks:
new Integer Scenario Scenario : $LoadScenario/ new String PlotConf PlotConf : $LoadPlotConfiguration/ new Box View View : $CurrentView/ new Click FullView FullView : $FullView/ new Integer ExportEnlargementFactor ExportEnlargementFactor : $ExportEnlargementFactor/ new String ExportScreenView ExportScreenView : $ExportScreenViewToFile/ new Click PrintView PrintView : $PrintCurrentViewNoSetup/ !function scenario SCENARIO !begin !if 0 < {SCENARIO} Scenario[1] = {SCENARIO} echo Scenario %<$ScenarioNumber>%: %<$ScenarioTitle>% !end !function view VIEW !begin !print Changing view to {VIEW} ... !if full == {VIEW} FullView = 1 !if airport == {VIEW} View = -10;-3;-7;3;Airport; !if cbd == {VIEW} View = -3;-3;3;3;CBD; !if kildonan == {VIEW} View = -1.2;1.5;4.2;4.8;Kildonan corridor; !end !function plot CONFIGURATION !begin !print Loading {CONFIGURATION} ... PlotConf = {CONFIGURATION} !end !function action !begin # variable ACTION is defined outside! !if prompt == {ACTION} !prompt Continue? !if wait == {ACTION} !wait 5 !if print == {ACTION} !begin PrintView = 1 !print Printing view ... !end !end !function export FILENAME !begin ExportScreenView = {FILENAME} !if export == {ACTION} !print Exporting view to file {FILENAME} ... !end
The above header file does not produce itself any visible results, but it implements the five simple functions which can afterward be called by the task definition file as follows:
Based on the commands defined in the header file plotgen.sen it is now possible to define a specific plot generation task quite easily. E.g. the following task file volumeplots generates auto volume plots for three different views and one transit volume plot for the CBD:
!include plotgen.sen !call scenario {SCENARIO} !call plot autovol.e2p !call action !call view cbd !call action !call view kildonan !call action !call plot transitvol.e2p !call view cbd !call action
If we now call SEnC with the header and the task file, i.e.
senc -l volumeplots
The four plots will be generated one after the other for the default scenario of the data bank. But this will be done very quickly and except for a rapidly flickering screen, not much will be seen.
We can now use variable substitution to define the scenario to be used with a command line argument of the form ``SCENARIO=...'', as well as the action to be taken for each plot with an argument ``ACTION=...''. Note that for achieving the desired results, these variable specifications should be put after the header file and before the task file.
Thus, the command
senc -l ACTION=wait SCENARIO=1000 volumeplots
will generate the same plots as before, but this time for the specified scenario 1000, and after each plot it will pause for a few seconds to give the user a chance to look at it.
Similarly, the command
senc -l ACTION=print SCENARIO=3000 volumeplots
will generate the four plots for scenario 3000 and send them to the default printer. Reduced versions of the four resulting printouts are shown below: