1 //Create a class for three axis
3 import Timer.SimulatedTimer
4 import groovy.json.JsonSlurper
7 import gov.nasa.jpf.vm.Verify
9 public class ThreeAxis {
12 private String displayName
13 private LinkedHashMap threeAxis
15 ThreeAxis(String id, String label, String displayName, LinkedHashMap threeAxis) {
18 this.displayName = displayName
19 this.threeAxis = threeAxis
22 def setValue(LinkedHashMap eventDataMap) {
23 threeAxis = new groovy.json.JsonSlurper().parseText(eventDataMap["value"])
24 println("the three axis of cube is chagned to $threeAxis!")
27 def currentState(String deviceFeature) {
28 currentValue(deviceFeature)
31 def currentValue(String deviceFeature) {
32 if (deviceFeature == "threeAxis" || deviceFeature == "status")
36 def latestValue(String deviceFeature) {
37 if (deviceFeature == "threeAxis" || deviceFeature == "status")