Changeset 59 in tmcsimulator-scriptbuilder


Ignore:
Timestamp:
08/14/2017 03:27:44 PM (9 years ago)
Author:
bmcguffin
Message:

Created new method incidentCount() for testing purposes. Added call to ScriptIncident?.updateLength() in absoluteLength() method.

File:
1 edited

Legend:

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

    r49 r59  
    4949        Color.GRAY 
    5050    }; 
    51      
     51 
    5252    public File saveFile = null; 
    5353 
     
    206206        return output; 
    207207    } 
     208 
    208209    /** 
    209210     * Arranges all timeslices in this script in chronological order, then by 
     
    243244            if (inc != null) 
    244245            { 
     246                inc.updateLength(); 
    245247                int currentLength = inc.length + inc.offset; 
    246248                if (currentLength > length) 
     
    253255    } 
    254256 
     257    public int incidentCount() 
     258    { 
     259        int count = 0; 
     260        for (ScriptIncident inc : incidents) 
     261        { 
     262            if (inc != null) 
     263            { 
     264                count++; 
     265            } 
     266        } 
     267        return count; 
     268    } 
     269 
    255270} 
Note: See TracChangeset for help on using the changeset viewer.