Improvements and new methods
authorrtrimana <rtrimana@uci.edu>
Sat, 10 Aug 2019 14:06:27 +0000 (07:06 -0700)
committerrtrimana <rtrimana@uci.edu>
Sat, 10 Aug 2019 14:06:27 +0000 (07:06 -0700)
Extractor/Extractor.groovy
Methods/schedule.groovy
MusicPlayer/MusicPlayer.groovy
MusicPlayer/MusicPlayers.groovy

index 5872125..2e82fb3 100644 (file)
@@ -102,7 +102,7 @@ import Timer.SimulatedTimer
 @Field File extractedObjectsConstructorApp2 = new File("Extractor/App2/extractedObjectsConstructorApp2.groovy")
 
 //Set this to true for global-state variable conflict
-@Field assignDifferentModes = false
+@Field assignDifferentModes = true
 @Field chooseMode = 0
 //Empty the files
 if (App == "App1") {
@@ -115,7 +115,7 @@ if (App == "App1") {
        extractedObjectsApp2.write("")
        extractedObjectsConstructorApp2.write("")
        if (assignDifferentModes)
-               chooseMode = 1
+               chooseMode = 2
 }
 
 
index 1d8c810..f4fcf24 100644 (file)
@@ -22,6 +22,11 @@ def schedule(String time, String nameOfFunction) {
        }*/
        "$nameOfFunction"()
 }
+/////////////////////////////////////////////////////////////////////
+////schedule(Date, nameOfFunction as String)
+def schedule(Date date, String nameOfFunction) {
+       "$nameOfFunction"()
+}
 ////schedule(time, nameOfFunction as Closure)
 def schedule(String time, Closure nameOfFunction) {
        /*def _inputTime = time.split(':')
index 8372772..67db554 100644 (file)
@@ -2,6 +2,8 @@
 package MusicPlayer
 import Timer.SimulatedTimer
 
+//JPF's Verify API
+import gov.nasa.jpf.vm.Verify
 
 public class MusicPlayer {
        private String id
index a9693db..92f6c55 100644 (file)
@@ -172,6 +172,15 @@ public class MusicPlayers {
                        this.level = level
                }
        }
+       def playSoundAndTrack(String trackData, int duration, int trackNumber, int level) {
+               playTrackAndResume(trackData, duration)
+               if (level != this.level) {
+                       this.level = level
+               }
+               if (trackNumber!= this.trackNumber) {
+                       this.trackNumber = trackNumber
+               }
+       }
        def playTrackAtVolume(String trackData, int level) {
                playTrack(trackData)
                if (level != this.level) {
@@ -238,7 +247,7 @@ public class MusicPlayers {
                }
        }
        def statesSince(String info, Date dateObj, LinkedHashMap map) {
-               return presenceSensors[0].statesSince()
+               return musicPlayers[0].statesSince()
        }
        def playText(LinkedHashMap metaData) {
                playText()