Changeset 167 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/TimeSlice.java


Ignore:
Timestamp:
12/16/2019 03:55:46 PM (6 years ago)
Author:
sdanthin
Message:

TimeSlice?.java modified remove/getcorrespondingAudioEvent to work with ID system. CHPRadioEvent.java modified to implement setID and ids in the I_AudioEvent.java. ScriptIncident? "adding event" modified to account for ID system. AudioEvent? has ids added. Preliminary tests show working.

File:
1 edited

Legend:

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

    r162 r167  
    320320        } 
    321321    } 
     322    //these two following functions should not be necessary. 
    322323    /** 
    323324     * this method removes an audioevent that corresponds to the input I_AudioEvent. NEEDS VERIFICATION 
    324325     */ 
    325326    public void removeCorrespondingAudioEvent(I_AudioEvent comparisonEvent){ 
    326         String id = comparisonEvent.getFileName().split("/")[1]; 
     327        String id = comparisonEvent.getID(); 
    327328        for(I_ScriptEvent event : events) 
    328329        { 
    329330            if(event instanceof AudioEvent) 
    330331            { 
    331                 System.out.println("removed an audioevent \n" + ((AudioEvent)event).audioPath.split("/")[2].substring(0,((AudioEvent)event).audioPath.split("/")[2].length() - 4)); 
    332                 System.out.println(id); 
    333                 System.out.println(id.equals(((AudioEvent)event).audioPath.split("/")[2].substring(0,((AudioEvent)event).audioPath.split("/")[2].length() - 4))); 
    334  
    335                 if(id.equals(((AudioEvent)event).audioPath.split("/")[2].substring(0,((AudioEvent)event).audioPath.split("/")[2].length() - 4))) 
     332                if(id.equals(((AudioEvent) event).id)) 
    336333                { 
    337334                    System.out.println("the event was deleted"); 
     
    342339        } 
    343340    } 
    344     public AudioEvent getCorrespondingAudioEvent(I_AudioEvent compariosonEvent) 
    345     { 
    346         String id = compariosonEvent.getFileName(); 
     341    public AudioEvent getCorrespondingAudioEvent(I_AudioEvent comparisonEvent) 
     342    { 
     343        String id = comparisonEvent.getID(); 
    347344        AudioEvent retVal = null; 
    348345        for(I_ScriptEvent event: events) 
    349346        { 
    350             if(event instanceof AudioEvent && ((AudioEvent)event).audioPath.split("/")[2].equals(id)) 
     347            if(event instanceof AudioEvent && id.equals(((AudioEvent) event).id)) 
    351348            { 
    352349                retVal = (AudioEvent) event; 
Note: See TracChangeset for help on using the changeset viewer.