Changeset 382 in tmcsimulator for trunk/src


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.

Location:
trunk/src/tmcsim
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/application.properties

    r376 r382  
    1 #Tue, 16 Apr 2019 11:04:30 -0700 
     1#Wed, 17 Apr 2019 10:55:08 -0700 
    22 
    3 Application.revision=372 
     3Application.revision=381 
    44 
    5 Application.buildnumber=132 
     5Application.buildnumber=134 
  • trunk/src/tmcsim/cadsimulator/CADServer.java

    r360 r382  
    6868{ 
    6969 
    70     private static final String CONFIG_FILE_NAME = "cad_simulator_config.properties"; 
     70    private static String CONFIG_FILE_NAME = "cad_simulator_config.properties"; 
    7171    /** 
    7272     * Error logger. 
     
    425425            System.setProperty("CONFIG_DIR", "config"); 
    426426        } 
     427        if (System.getProperty("PROP_FILE") != null) 
     428        { 
     429            CONFIG_FILE_NAME = System.getProperty("PROP_FILE"); 
     430        } 
    427431        try 
    428432        { 
  • 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.