Changeset 228 in tmcsimulator
- Timestamp:
- 11/06/2017 03:27:20 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 8 edited
-
src/atmsdriver/model/Highways.java (modified) (1 diff)
-
src/tmcsim/application.properties (modified) (1 diff)
-
src/tmcsim/cadsimulator/managers/TrafficModelManager.java (modified) (7 diffs)
-
test/atmsdriver/model/HighwaysTest.java (modified) (1 diff)
-
test/atmsdriver/model/LoadSadDotsTest.java (deleted)
-
test/tmcsim/cadsimulator/CADSimulatorConsoleTest.java (modified) (2 diffs)
-
test/tmcsim/cadsimulator/CADSimulatorGUITest.java (modified) (1 diff)
-
test/tmcsim/cadsimulator/viewer/CADSimulatorViewModelTest.java (modified) (1 diff)
-
test/tmcsim/simulationmanager/SimulationManagerSmokeTest.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/atmsdriver/model/Highways.java
r212 r228 350 350 // close the socket 351 351 sock.close(); 352 } catch (java.net.ConnectException ex) 353 { 354 //Logger.getLogger(Highways.class.getName()).log(Level.SEVERE, null, ex); 355 System.out.println("writeToFEP() can't connect, no data sent to FEP."); 356 throw new SimulationException(SimulationException.BINDING); 352 357 } catch (IOException ex) 353 358 { 354 Logger.getLogger(Highways.class.getName()).log(Level.SEVERE, null, ex);359 //Logger.getLogger(Highways.class.getName()).log(Level.SEVERE, null, ex); 355 360 System.out.println("Highway Model failed writing to FEPSim."); 356 361 throw new SimulationException(SimulationException.BINDING); -
trunk/src/tmcsim/application.properties
r227 r228 1 # Sun, 05 Nov 2017 09:02:37 -07001 #Mon, 06 Nov 2017 15:57:48 -0800 2 2 3 Application.revision=22 63 Application.revision=227 4 4 5 Application.buildnumber= 785 Application.buildnumber=82 -
trunk/src/tmcsim/cadsimulator/managers/TrafficModelManager.java
r220 r228 85 85 * Highways in traffic network 86 86 */ 87 finalprivate Highways highways;87 private Highways highways; 88 88 89 89 /** … … 100 100 */ 101 101 private String currentClock = ""; 102 103 102 104 103 /** 105 104 * Constructor. Loads the Properties file and initializes the … … 113 112 throws SimulationException 114 113 { 115 props = loadProperties(propertiesFile); 116 // Initialize the highway model 117 incidents = new HashMap<String, List<TrafficEvent>>(); 118 highways = new Highways( 119 props.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name), 120 props.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name), 121 8080); 122 this.theCoordinator = theCoordinator; 114 try 115 { 116 props = loadProperties(propertiesFile); 117 // Initialize the highway model 118 incidents = new HashMap<String, List<TrafficEvent>>(); 119 highways = new Highways( 120 props.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name), 121 props.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name), 122 8080); 123 this.theCoordinator = theCoordinator; 124 } 125 catch (Exception e) 126 { 127 logger.logp(Level.SEVERE, "Traffic Manager", "Constructor", 128 "Exception in parsing properties file.", e); 129 } 123 130 } 124 131 /** … … 129 136 { 130 137 loadEvents(); 131 138 132 139 // Create a timer that fetches the simulation time every second. 133 140 Timer timer = new Timer(ONE_SECOND, new ActionListener() … … 201 208 wtConsole.start(); 202 209 } 203 204 210 } 205 211 /** Accessor to event queue … … 421 427 System.out.println("WriteToFEP Thread starting."); 422 428 // Run indefinitely 423 while (true) 429 boolean running = true; 430 while (running) 424 431 { 425 432 try … … 431 438 { 432 439 // Ask user if they want to proceed without FEP Sim connection 433 int reply = JOptionPane.showConfirmDialog(null, "Failed to connect to FEP Sim, proceed anyway?", "Network Failure", JOptionPane.YES_NO_OPTION);434 if (reply == JOptionPane.NO_OPTION)435 {436 System.exit(0);437 }440 // int reply = JOptionPane.showConfirmDialog(null, "Failed to connect to FEP Sim, proceed anyway?", "Network Failure", JOptionPane.YES_NO_OPTION); 441 // if (reply == JOptionPane.NO_OPTION) 442 // { 443 // System.exit(0); 444 // } 438 445 System.out.println("Skipping writeToFEP..."); 446 running = false; 439 447 } 440 448 -
trunk/test/atmsdriver/model/HighwaysTest.java
r213 r228 86 86 String result = highways.toString(); 87 87 System.out.println(result); 88 assertEquals(expToString, result); 89 } 90 String expToString = 91 "241 ------------------------------------------------------------\n" 92 +" 5 @-------------------------------------------------------------------------------------------------------------------------------------------\n" 93 +"405 --------------------------------------------------------------------------------\n" 94 +"133 ----------------\n" 95 +"261 -----------------\n" 96 +" 22 ----------------------------------\n" 97 +" 55 ------------------------------------------\n" 98 +" 73 -----------------------------------------------------\n" 99 +" 57 ------------------------------------------\n" 100 +" 91 --------------------------------------------------------------\n" 101 +"605 ---\n"; 88 assertTrue(result.startsWith(expToString1)); 89 } 90 String expToString1 = 91 "241 N -- ------ -- ------- ------------------------------------- \n" + 92 "241 S - --- -- --------- ------------------------------------ \n" + 93 " 5 N - - ------ --- --- -- --- ---- - -- - - -- - - - -- -- - ---- -- -- --- - - -- - ----- ----- --- - - -- -- - - ---- - - - ------- \n" + 94 " 5 S @--"; 95 96 102 97 103 98 -
trunk/test/tmcsim/cadsimulator/CADSimulatorConsoleTest.java
r123 r228 271 271 + "ParamicsProperties = pconfig.txt\n" 272 272 + "ATMSProperties = empty.txt\n" 273 + "TrafficMgrProperties = tconfig.txt\n" 273 274 + "MediaProperties = empty.txt\n"; 275 static final String trafficMgrData = "Highways_Map_File = config/vds_data/highways_fullmap.txt\n" 276 +"Events_File = config/vds_data/atmsBatchEvents.txt\n" 277 +"FEPSim_IP_addr = localhost\n" 278 +"Output_Destination = Console\n"; 274 279 static final String paramicsData = "ParamicsCommHost = 127.0.0.1\n" 275 280 + "ParamicsCommPort = 4450\n" … … 295 300 // Redirect the standard output 296 301 // System.setOut(ps); 302 File cf = new File ("config.txt"); 303 cf.delete(); 297 304 writedata("config.txt", configData); 305 writedata("tconfig.txt", trafficMgrData); 298 306 writedata("pconfig.txt", paramicsData); 299 307 writedata("empty.txt", ""); -
trunk/test/tmcsim/cadsimulator/CADSimulatorGUITest.java
r123 r228 94 94 // Create a UISpec window from the CADSimulator's Viewer (gui) 95 95 // cadwindow = new Window((CADSimulatorViewer) app.theViewer); 96 assertTrue("Title bar incorrect", cadwindow.getTitle().startsWith("CAD S imulator revision:"));96 assertTrue("Title bar incorrect", cadwindow.getTitle().startsWith("CAD Server revision:")); 97 97 Panel mainPanel = cadwindow.getPanel("contentPane"); 98 98 TextBox txtStatus = mainPanel.getTextBox("simulationStatus"); -
trunk/test/tmcsim/cadsimulator/viewer/CADSimulatorViewModelTest.java
r124 r228 40 40 { 41 41 String actual; 42 assertTrue("Title bar incorrect", cadwindow.getTitle().trim().startsWith("CAD S imulator"));42 assertTrue("Title bar incorrect", cadwindow.getTitle().trim().startsWith("CAD Server")); 43 43 TextBox txtStatus = mainPanel.getTextBox("simulationStatus"); 44 44 actual = txtStatus.getText().trim(); -
trunk/test/tmcsim/simulationmanager/SimulationManagerSmokeTest.java
r123 r228 67 67 68 68 // Check CAD Simulator appears with no script and nothing connected 69 assertTrue("Window title incorrect", cadwindow.getTitle().startsWith("CAD S imulator"));69 assertTrue("Window title incorrect", cadwindow.getTitle().startsWith("CAD Server")); 70 70 Panel mainPanel = cadwindow.getPanel("contentPane"); 71 71 TextBox txtStatus = mainPanel.getTextBox("simulationStatus");
Note: See TracChangeset
for help on using the changeset viewer.
