- Timestamp:
- 09/05/2017 05:48:12 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
-
jacoco.exec-1504662543350657000 (added)
-
src/scriptbuilder/gui/application.properties (modified) (1 diff)
-
src/scriptbuilder/structures/ScriptIncident.java (modified) (6 diffs)
-
src/scriptbuilder/structures/TimeSlice.java (modified) (3 diffs)
-
test/scriptbuilder/structures/SimulationScriptTest.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/gui/application.properties
r103 r111 1 # Fri, 01 Sep 2017 13:13:39-07001 #Tue, 05 Sep 2017 18:53:17 -0700 2 2 3 3 Application.revision=0 -
trunk/src/scriptbuilder/structures/ScriptIncident.java
r107 r111 158 158 this.offset = offset; 159 159 TreeMap<Integer, TimeSlice> newSlices = new TreeMap<Integer, TimeSlice>(); 160 160 161 161 int latest = 0; 162 163 for (Integer k : slices.keySet())162 163 for (Integer k : slices.keySet()) 164 164 { 165 165 newSlices.put(k + (offset - old), slices.get(k)); 166 166 latest = k + (offset - old); 167 167 } 168 168 169 169 latestStart = latest; 170 170 … … 173 173 ts.shift(offset - old); 174 174 } 175 175 176 176 slices = newSlices; 177 177 updateLength(); … … 188 188 public void addNewEvent(I_ScriptEvent ev, int start) 189 189 { 190 //Check to see if there's already a timeslice here 190 191 TimeSlice t = slices.get(start); 192 //If not, make one; then, add the event to it 191 193 if (t == null) 192 194 { 193 //System.out.println("Generating new slice at time " + start);194 195 t = new TimeSlice(start, this); 195 196 t.addEvent(ev); … … 202 203 eventCount++; 203 204 205 //If this is the latest start time in the incident, update that number 204 206 if (start > latestStart) 205 207 { 206 208 latestStart = start; 207 //System.out.println("Latest Start: " + latestStart); 208 } 209 if (start < offset) 209 } 210 //If this event is earlier than all previous events, or if there are 211 //no other events, the offset is equal to this event's start time 212 if (start < offset || eventCount == 1) 210 213 { 211 214 offset = start; … … 375 378 return this.number + " - " + this.name; 376 379 } 377 380 378 381 /** 379 382 * Remove the timeslice at the given position. 380 * 383 * 381 384 * @param seconds absolute start time of the timeslice to remove. 382 385 */ … … 385 388 //remove the timeslice 386 389 this.slices.remove(seconds); 387 390 388 391 //offset is equivalent to start time of earliest slice 389 if (seconds == offset)392 if (seconds == offset) 390 393 { 391 394 offset = slices.firstKey(); -
trunk/src/scriptbuilder/structures/TimeSlice.java
r107 r111 213 213 } 214 214 215 System.out.println("Seconds:: " + seconds);216 215 String output = XMLWriter.openTag(ELEMENT.SCRIPT_EVENT.tag); 217 216 SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss"); … … 275 274 } 276 275 output += XMLWriter.closeTag(ELEMENT.SCRIPT_EVENT.tag); 277 System.out.println(output);278 276 return output; 279 277 } … … 297 295 || ev instanceof WitnessEvent || ev instanceof CADEvent; 298 296 } 299 297 300 298 public void checkEmpty() 301 299 { -
trunk/test/scriptbuilder/structures/SimulationScriptTest.java
r80 r111 235 235 assertEquals(11, result); 236 236 237 ((ScriptEvent) instance.incidents.get(0).slices.get( 0).events.get(0)).length = 45;237 ((ScriptEvent) instance.incidents.get(0).slices.get(10).events.get(0)).length = 45; 238 238 instance.incidents.get(0).updateLength(); 239 239 assertEquals(10, instance.incidents.get(0).offset);
Note: See TracChangeset
for help on using the changeset viewer.
