Changeset 195 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/ScriptIncident.java


Ignore:
Timestamp:
01/20/2020 08:06:39 PM (6 years ago)
Author:
sdanthin
Message:

SimulationScript?.java now prepends a zero if the number of the incident is less than 0, and starts incidents at index 1.
ScriptIncident?.java modified where the ID is set to accommodate for the above logic. see #222

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/ScriptIncident.java

    r168 r195  
    327327            if(((I_AudioEvent) ev).getID().equals("")) 
    328328            { 
    329                 ((I_AudioEvent) ev).setID(number+Integer.toString(audioEventCount)); 
    330329                audioEventCount++; 
     330                //ternary expression here just prepends an extra 0 to the ID of the audioEvent if its eventcount is less than 10 
     331                ((I_AudioEvent) ev).setID(number+((audioEventCount<10)? "0"+Integer.toString(audioEventCount):Integer.toString(audioEventCount))); 
     332                 
    331333            } 
    332334            if(t.getCorrespondingAudioEvent((I_AudioEvent)ev)==null) 
Note: See TracChangeset for help on using the changeset viewer.