Changeset 407 in tmcsimulator for trunk/src/tmcsim/cadsimulator/CADServer.java


Ignore:
Timestamp:
05/16/2019 01:02:37 PM (7 years ago)
Author:
jdalbey
Message:

Fix for #155 to make simulation time filename configurable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/cadsimulator/CADServer.java

    r382 r407  
    129129         * Class name of desired user interface. 
    130130         */ 
    131         USER_INTERFACE("UserInterface"); 
     131        USER_INTERFACE("UserInterface"), 
     132        /** 
     133         *  Filepath to which is written the simulation time. 
     134         */ 
     135        ELAPSED_TIME_FILE("ElapsedTimeFile"); 
     136         
    132137        public String name; 
    133138 
     
    240245            theModel = new CADSimulatorState(); 
    241246            theModel.addObserver(theViewer); 
    242  
    243             theCoordinator = new Coordinator(theModel); 
     247            /** Load the simulation time filename from properties */ 
     248            String simTimeFilename = 
     249                    cadServerProperties.getProperty( 
     250                    CAD_PROPERTIES.ELAPSED_TIME_FILE.name); 
     251            if (simTimeFilename == null) 
     252            { 
     253                cadSimLogger.logp(Level.SEVERE, "CADSimulator", "Constructor", 
     254                        propertiesFile + " missing property for " + CAD_PROPERTIES.ELAPSED_TIME_FILE.name); 
     255                throw new SimulationException(SimulationException.PROPERTY_MISSING_ERROR); 
     256            } 
     257            theCoordinator = new Coordinator(theModel, simTimeFilename); 
    244258 
    245259            startRegistry(Integer.parseInt( 
Note: See TracChangeset for help on using the changeset viewer.