Changeset 33 in tmcsimulator
- Timestamp:
- 04/29/2016 12:55:04 AM (10 years ago)
- Location:
- trunk/src/tmcsim
- Files:
-
- 5 edited
-
cadsimulator/CADSimulator.java (modified) (2 diffs)
-
client/CADClient.java (modified) (4 diffs)
-
paramicscommunicator/ParamicsCommunicator.java (modified) (3 diffs)
-
paramicslog/ParamicsLog.java (modified) (2 diffs)
-
simulationmanager/SimulationManager.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/cadsimulator/CADSimulator.java
r5 r33 135 135 private Properties cadSimulatorProperties; 136 136 137 private static final String CONFIG_FILE_NAME = "cad_simulator_config.properties"; 137 138 138 139 /** … … 329 330 */ 330 331 public static void main(String[] args) { 331 System.setProperty("CAD_SIM_PROPERTIES", "config/cad_simulator_config.properties"); 332 333 try 334 { 335 if(System.getProperty("CAD_SIM_PROPERTIES") != null) 336 { 337 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 338 339 new CADSimulator(System.getProperty("CAD_SIM_PROPERTIES")); 340 } 341 else 342 { 343 throw new Exception ("CAD_SIM_PROPERTIES system property not defined."); 344 } 332 if(System.getProperty("CONFIG_DIR") == null){ 333 System.setProperty("CONFIG_DIR", "config"); 334 } 335 try { 336 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 337 new CADSimulator(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME); 345 338 } 346 339 catch (Exception e) { -
trunk/src/tmcsim/client/CADClient.java
r2 r33 60 60 * @version $Date: 2009/04/17 16:27:47 $ $Revision: 1.8 $ 61 61 */ 62 /*Hai :3 yeeeee*/ 62 63 63 public class CADClient extends UnicastRemoteObject implements 64 64 CADClientInterface { … … 113 113 private CADClientInterface client = this; 114 114 115 private static final String CONFIG_FILE_NAME = "cad_client_config.properties"; 116 115 117 /** 116 118 * Constructor. Initialize data from parsed properties file. Create a socket … … 319 321 e); 320 322 } 323 321 324 322 325 // Ensure that the properties file does not have null values for the … … 473 476 */ 474 477 public static void main(String[] args) { 475 System.setProperty("CAD_CLIENT_PROPERTIES", 476 "config/cad_client_config.properties"); 478 if(System.getProperty("CONFIG_DIR") == null){ 479 System.setProperty("CONFIG_DIR", "config"); 480 } 477 481 478 482 try { 479 if (System.getProperty("CAD_CLIENT_PROPERTIES") != null) { 480 UIManager.setLookAndFeel(UIManager 481 .getSystemLookAndFeelClassName()); 482 483 new CADClient(System.getProperty("CAD_CLIENT_PROPERTIES")); 484 } else { 485 throw new Exception( 486 "CAD_CLIENT_PROPERTIES system property not defined."); 487 } 483 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 484 new CADClient(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME); 485 488 486 } catch (Exception e) { 489 487 cadClientLogger.logp(Level.SEVERE, "SimulationManager", "Main", -
trunk/src/tmcsim/paramicscommunicator/ParamicsCommunicator.java
r26 r33 19 19 import java.util.logging.Level; 20 20 import java.util.logging.Logger; 21 21 22 import javax.swing.JOptionPane; 22 23 import javax.swing.UIManager; 24 23 25 import org.w3c.dom.Document; 24 26 import org.w3c.dom.Element; 27 25 28 import tmcsim.common.CADProtocol.PARAMICS_ACTIONS; 26 29 import tmcsim.common.CADProtocol.PARAMICS_COMM_TAGS; … … 60 63 { 61 64 62 /** 65 private static final String CONFIG_FILE_NAME = "paramics_communicator_config.properties"; 66 /** 63 67 * Error logger. 64 68 */ … … 480 484 * @param args Command line arguments. 481 485 */ 482 public static void main(String[] args) 483 { 484 System.setProperty("PARAMICS_COMM_PROPERTIES", "config/paramics_communicator_config.properties"); 485 486 try 487 { 488 if (System.getProperty("PARAMICS_COMM_PROPERTIES") != null) 489 { 490 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 491 492 new Thread(new ParamicsCommunicator(System.getProperty( 493 "PARAMICS_COMM_PROPERTIES"))).start(); 494 } else 495 { 496 throw new Exception("PARAMICS_COMM_PROPERTIES system property not defined."); 497 } 498 } catch (Exception e) 499 { 486 public static void main(String[] args) { 487 if(System.getProperty("CONFIG_DIR") == null){ 488 System.setProperty("CONFIG_DIR", "config"); 489 } 490 491 try{ 492 493 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 494 new Thread(new ParamicsCommunicator(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME)).start(); 495 496 } catch (Exception e) { 500 497 paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", "Main", 501 498 "Error occured initializing application", e); -
trunk/src/tmcsim/paramicslog/ParamicsLog.java
r2 r33 62 62 } 63 63 } 64 65 private static final String CONFIG_FILE_NAME = "paramics_communicator_logging.properties"; 64 66 65 67 /** Error logger. */ … … 87 89 * Creates the singleton instance of this class. 88 90 */ 89 static 90 { 91 try 92 { 93 if (System.getProperty("PARAMICS_LOG_PROPERTIES") != null) 94 { 95 instance = new ParamicsLog(System.getProperty("PARAMICS_LOG_PROPERTIES")); 96 } 97 else 98 { 99 throw new Exception("PARAMICS_LOG_PROPERTIES system property not defined."); 100 } 91 static { 92 try { 93 if(System.getProperty("CONFIG_DIR") == null){ 94 System.setProperty("CONFIG_DIR", "config"); 95 } 96 97 instance = new ParamicsLog(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME); 101 98 } 102 99 catch (Exception e) -
trunk/src/tmcsim/simulationmanager/SimulationManager.java
r14 r33 9 9 import java.util.logging.Level; 10 10 import java.util.logging.Logger; 11 11 12 import javax.swing.JOptionPane; 12 13 import javax.swing.UIManager; 14 13 15 import tmcsim.common.CADEnums.PARAMICS_STATUS; 14 16 import tmcsim.common.SimulationException; … … 45 47 { 46 48 47 /** 49 private static final String CONFIG_FILE_NAME = "sim_manager_config.properties"; 50 /** 48 51 * Error logger. 49 52 */ … … 193 196 * @param args Command line arguments. 194 197 */ 195 static public void main(String[] args) 196 { 197 //System.setProperty("SIM_MGR_PROPERTIES", "config/sim_manager_config.properties"); 198 static public void main(String[] args) { 198 199 //System.setProperty("swing.defaultlaf", "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); 199 200 try 201 { 202 if (System.getProperty("SIM_MGR_PROPERTIES") != null) 203 { 204 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 205 206 new SimulationManager(System.getProperty("SIM_MGR_PROPERTIES")); 207 } else 208 { 209 throw new Exception("SIM_MGR_PROPERTIES system property not defined."); 210 } 211 } catch (Exception e) 212 { 200 if(System.getProperty("CONFIG_DIR") == null){ 201 System.setProperty("CONFIG_DIR", "config"); 202 } 203 204 try { 205 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 206 new SimulationManager(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME); 207 } catch (Exception e) { 213 208 simManLogger.logp(Level.SEVERE, "SimulationManager", "Main", 214 209 "Error occured initializing application", e);
Note: See TracChangeset
for help on using the changeset viewer.
