Changeset 448 in tmcsimulator for trunk/src


Ignore:
Timestamp:
07/16/2019 06:34:33 AM (7 years ago)
Author:
jdalbey
Message:

Add CADcomments.log filename to CADserver config properties so Coordinator know where to write comments log.

Location:
trunk/src/tmcsim
Files:
3 edited

Legend:

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

    r446 r448  
    1 #Mon, 15 Jul 2019 16:19:28 -0700 
     1#Tue, 16 Jul 2019 08:06:49 -0700 
    22 
    3 Application.revision=445 
     3Application.revision=447 
    44 
    5 Application.buildnumber=159 
     5Application.buildnumber=160 
  • trunk/src/tmcsim/cadsimulator/CADServer.java

    r407 r448  
    133133         *  Filepath to which is written the simulation time. 
    134134         */ 
    135         ELAPSED_TIME_FILE("ElapsedTimeFile"); 
     135        ELAPSED_TIME_FILE("ElapsedTimeFile"), 
     136        /** 
     137         *  Filepath to which is written the CADcomments log. 
     138         */ 
     139        CAD_COMMENTS_LOG("CADcommentsLog"); 
    136140         
    137141        public String name; 
     
    255259                throw new SimulationException(SimulationException.PROPERTY_MISSING_ERROR); 
    256260            } 
    257             theCoordinator = new Coordinator(theModel, simTimeFilename); 
     261            /** Load the CAD comments log filename from properties */ 
     262            String commentLogname = 
     263                    cadServerProperties.getProperty( 
     264                    CAD_PROPERTIES.CAD_COMMENTS_LOG.name); 
     265            if (commentLogname == null) 
     266            { 
     267                cadSimLogger.logp(Level.SEVERE, "CADSimulator", "Constructor", 
     268                        propertiesFile + " missing property for " + CAD_PROPERTIES.CAD_COMMENTS_LOG.name); 
     269                throw new SimulationException(SimulationException.PROPERTY_MISSING_ERROR); 
     270            } 
     271            theCoordinator = new Coordinator(theModel, simTimeFilename, commentLogname); 
    258272 
    259273            startRegistry(Integer.parseInt( 
  • trunk/src/tmcsim/cadsimulator/Coordinator.java

    r440 r448  
    100100    private String kSimClockFilename; 
    101101    /** 
    102      * Name of output file for CAD comments  
    103      */ 
    104     private static final String LOG_FILE_NAME = "CADcomments.log"; 
     102     * The name of file where CADcommentLog is written 
     103     */ 
     104    private String kCADcommentLog; 
    105105    /** 
    106106     * Error logger. 
     
    131131     * initializeSimulation. 
    132132     * @param simTimeFilename name of the file where the simulation clock time is written 
    133      * @throws RemoteException 
    134      */ 
    135     public Coordinator(CADSimulatorState model, String simTimeFilename) throws RemoteException 
     133     * @param commentLogname name of file where CADcommentLog is written 
     134     * @throws RemoteException 
     135     */ 
     136    public Coordinator(CADSimulatorState model, String simTimeFilename, String commentLogname) throws RemoteException 
    136137    { 
    137138        super(); 
    138139        cadModel = model; 
    139140        kSimClockFilename = simTimeFilename; 
     141        kCADcommentLog = commentLogname; 
    140142        clientList = new LinkedList<CADClientInterface>(); 
    141143        cadData = new CADData(); 
     
    768770        try  
    769771        { 
    770             PrintWriter writer = new PrintWriter(new FileWriter(LOG_FILE_NAME)); 
     772            PrintWriter writer = new PrintWriter(new FileWriter(kCADcommentLog)); 
    771773            writer.print(output); 
    772774            writer.close(); 
Note: See TracChangeset for help on using the changeset viewer.