Ignore:
Timestamp:
09/12/2022 02:19:40 PM (4 years ago)
Author:
jdalbey
Message:

Replace hard-code scenario folder name in Simulation Manager with config property.

File:
1 edited

Legend:

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

    r559 r658  
    4848    private static final String CONFIG_FILE_NAME = "sim_manager_config.properties"; 
    4949    /* 
    50      * Name of filesystem folder that contains Scenario xml files.   
     50     * Default name of folder that contains Scenario xml files. 
     51     * Actual name retrieved from config file. 
    5152    */ 
    52     public static final String kScenarioFolder = "Scenarios"; 
     53    public static String SCENARIOS_DIR = "Scenarios"; 
    5354    /** 
    5455     * Error logger. 
     
    6667        CAD_SIM_HOST("CADSimulatorHost"), 
    6768        CAD_SIM_PORT("CADSimulatorRMIPort"), 
    68         SCRIPT_DIR("ScriptDir"), 
     69        SCENARIOS_DIR("ScenariosDir"), 
    6970        FAKE_PARAMICS("FakeParamicsConnection"); 
    7071        public String name; 
     
    111112            simManagerProperties.load(new FileInputStream(new File(propertiesFile))); 
    112113 
    113             SimulationManagerView.SCRIPT_DIR = 
    114                     simManagerProperties.getProperty(PROPERTIES.SCRIPT_DIR.name).trim(); 
     114            SCENARIOS_DIR = 
     115                    simManagerProperties.getProperty(PROPERTIES.SCENARIOS_DIR.name).trim(); 
    115116 
    116117            //make sure properties aren't null 
     
    229230            { 
    230231                arg1 = args[0]; 
    231                 File scriptFile = new File(kScenarioFolder+ System.getProperty("file.separator") + arg1); 
     232                File scriptFile = new File(SCENARIOS_DIR+ System.getProperty("file.separator") + arg1); 
    232233                // if the script file exists, load it and show name in title bar 
    233234                if (scriptFile.exists()) 
Note: See TracChangeset for help on using the changeset viewer.