Ignore:
Timestamp:
04/17/2019 04:15:29 PM (7 years ago)
Author:
jdalbey
Message:

CADserver.java modified to look for a system property PROP_FILE provided at the command line so it's property file can be provided dynamically. SimulationManager?.java modified to accept an optional command line argument, the name of the script file to load when the pgm launches. Create a bin folder with shell scripts to start the complete system in different configurations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/simulationmanager/SimulationManager.java

    r47 r382  
    215215            System.setProperty("CONFIG_DIR", "config"); 
    216216        } 
    217  
     217        SimulationManager app; 
    218218        try 
    219219        { 
    220220            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 
    221             new SimulationManager(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME); 
     221            app = new SimulationManager(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME); 
     222            // Check if a script filename has been given as an argument 
     223            String arg1; 
     224            if (args.length > 0) 
     225            { 
     226                arg1 = args[0]; 
     227                File scriptFile = new File("scripts"+ System.getProperty("file.separator") + arg1); 
     228                if (scriptFile.exists()) 
     229                { 
     230                    app.loadScript(scriptFile); 
     231                    simManLogger.logp(Level.INFO,"SimulationManager","Main", 
     232                            "Sim Mgr starting with script file: " + arg1 + "."); 
     233                } 
     234                else 
     235                { 
     236                    simManLogger.logp(Level.INFO,"SimulationManager","Main", 
     237                            "Script file not found: " + arg1 + 
     238                            ". Starting with no script."); 
     239                } 
     240            } 
    222241        } catch (Exception e) 
    223242        { 
     
    230249            System.exit(-1); 
    231250        } 
    232  
    233251    } 
    234252} 
Note: See TracChangeset for help on using the changeset viewer.