Rev 1770 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1770 | Rev 1899 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | function TouchPanel(aliasnameRGBLED_red,aliasnameRGBLED_green, aliasnameRGBLED_blue, aliasnameTouch, aliasnameDimmer1, aliasnameDimmer2, aliasnameDimmer3) |
3 | function TouchPanel(aliasnameRGBLED_red,aliasnameRGBLED_green, aliasnameRGBLED_blue, aliasnameTouch, aliasnameDimmer1, aliasnameDimmer2, aliasnameDimmer3, aliasnameDimmer4, aliasnameDimmer5, aliasnameDimmer6) |
| 4 | { |
4 | { |
| 5 | 5 | ||
| 6 | /* Declaration of instance variables, for static variables remove prototype */ |
6 | /* Declaration of instance variables, for static variables remove prototype */ |
| 7 | 7 | ||
| 8 | /* We must always call the parent constructor, initialization |
8 | /* We must always call the parent constructor, initialization |
| Line 13... | Line 13... | ||
| 13 | this.myRGBLED_blue = aliasnameRGBLED_blue; |
13 | this.myRGBLED_blue = aliasnameRGBLED_blue; |
| 14 | this.myRGBLED_green = aliasnameRGBLED_green; |
14 | this.myRGBLED_green = aliasnameRGBLED_green; |
| 15 | this.myDimmer1 = aliasnameDimmer1; |
15 | this.myDimmer1 = aliasnameDimmer1; |
| 16 | this.myDimmer2 = aliasnameDimmer2; |
16 | this.myDimmer2 = aliasnameDimmer2; |
| 17 | this.myDimmer3 = aliasnameDimmer3; |
17 | this.myDimmer3 = aliasnameDimmer3; |
| - | 18 | this.myDimmer4 = aliasnameDimmer4; |
|
| - | 19 | this.myDimmer5 = aliasnameDimmer5; |
|
| - | 20 | this.myDimmer6 = aliasnameDimmer6; |
|
| 18 | this.myTouchMode = "Gesture"; |
21 | this.myTouchMode = "Gesture"; |
| 19 | this.myTouchRawX = 0; |
22 | this.myTouchRawX = 0; |
| 20 | this.myTouchRawY = 0; |
23 | this.myTouchRawY = 0; |
| 21 | this.myTouchRawYlast = 0; |
24 | this.myTouchRawYlast = 0; |
| 22 | Module_RegisterToOnMessage(aliasnameTouch, function(alias_name, command, variables) { self.touchOnMessage(alias_name, command, variables) }); |
25 | Module_RegisterToOnMessage(aliasnameTouch, function(alias_name, command, variables) { self.touchOnMessage(alias_name, command, variables) }); |
| Line 30... | Line 33... | ||
| 30 | 33 | ||
| 31 | /* Declaration of instance variables, for static variables remove prototype */ |
34 | /* Declaration of instance variables, for static variables remove prototype */ |
| 32 | TouchPanel.prototype.myDimmer1 = null; |
35 | TouchPanel.prototype.myDimmer1 = null; |
| 33 | TouchPanel.prototype.myDimmer2 = null; |
36 | TouchPanel.prototype.myDimmer2 = null; |
| 34 | TouchPanel.prototype.myDimmer3 = null; |
37 | TouchPanel.prototype.myDimmer3 = null; |
| - | 38 | TouchPanel.prototype.myDimmer4 = null; |
|
| - | 39 | TouchPanel.prototype.myDimmer5 = null; |
|
| - | 40 | TouchPanel.prototype.myDimmer6 = null; |
|
| 35 | TouchPanel.prototype.myTouch = null; |
41 | TouchPanel.prototype.myTouch = null; |
| 36 | TouchPanel.prototype.myRGBLED_red = null; |
42 | TouchPanel.prototype.myRGBLED_red = null; |
| 37 | TouchPanel.prototype.myRGBLED_green = null; |
43 | TouchPanel.prototype.myRGBLED_green = null; |
| 38 | TouchPanel.prototype.myRGBLED_blue = null; |
44 | TouchPanel.prototype.myRGBLED_blue = null; |
| 39 | //TouchPanel.prototype.outputStatus = "Low"; |
45 | //TouchPanel.prototype.outputStatus = "Low"; |
| Line 73... | Line 79... | ||
| 73 | //getDimmerService('TakHall').absFade(0,132, 255); |
79 | //getDimmerService('TakHall').absFade(0,132, 255); |
| 74 | //getDimmerService('TakSovrum').absFade(0,132, 255); |
80 | //getDimmerService('TakSovrum').absFade(0,132, 255); |
| 75 | //Dimmer_AbsoluteFade(this.myDimmer1, 132, 255); |
81 | //Dimmer_AbsoluteFade(this.myDimmer1, 132, 255); |
| 76 | Dimmer_AbsoluteFade(this.myDimmer2, 132, 255); |
82 | Dimmer_AbsoluteFade(this.myDimmer2, 132, 255); |
| 77 | Dimmer_AbsoluteFade(this.myDimmer3, 132, 255); |
83 | Dimmer_AbsoluteFade(this.myDimmer3, 132, 255); |
| - | 84 | Dimmer_AbsoluteFade(this.myDimmer4, 132, 255); |
|
| - | 85 | Dimmer_AbsoluteFade(this.myDimmer5, 132, 255); |
|
| - | 86 | Dimmer_AbsoluteFade(this.myDimmer6, 132, 255); |
|
| 78 | this.setLED(0,255,0); |
87 | this.setLED(0,255,0); |
| 79 | Timer_Cancel(this.myInterval); |
88 | Timer_Cancel(this.myInterval); |
| 80 | this.myInterval = Timer_SetTimer(function(timer) {self.timerUpdate(timer)}, 5000, true); |
89 | this.myInterval = Timer_SetTimer(function(timer) {self.timerUpdate(timer)}, 5000, true); |
| 81 | } |
90 | } |
| 82 | else if (gesture == "JOIN") |
91 | else if (gesture == "JOIN") |
| Line 85... | Line 94... | ||
| 85 | //getDimmerService('TakHall').absFade(0,132, 0); |
94 | //getDimmerService('TakHall').absFade(0,132, 0); |
| 86 | //getDimmerService('TakSovrum').absFade(0,132, 0); |
95 | //getDimmerService('TakSovrum').absFade(0,132, 0); |
| 87 | Dimmer_AbsoluteFade(this.myDimmer1, 132, 0); |
96 | Dimmer_AbsoluteFade(this.myDimmer1, 132, 0); |
| 88 | Dimmer_AbsoluteFade(this.myDimmer2, 132, 0); |
97 | Dimmer_AbsoluteFade(this.myDimmer2, 132, 0); |
| 89 | Dimmer_AbsoluteFade(this.myDimmer3, 132, 0); |
98 | Dimmer_AbsoluteFade(this.myDimmer3, 132, 0); |
| - | 99 | Dimmer_AbsoluteFade(this.myDimmer4, 132, 0); |
|
| - | 100 | Dimmer_AbsoluteFade(this.myDimmer5, 132, 0); |
|
| - | 101 | Dimmer_AbsoluteFade(this.myDimmer6, 132, 0); |
|
| 90 | this.setLED(0,0,255); |
102 | this.setLED(0,0,255); |
| 91 | Timer_Cancel(this.myInterval); |
103 | Timer_Cancel(this.myInterval); |
| 92 | this.myInterval = Timer_SetTimer(function(timer) {self.timerUpdate(timer)}, 5000, true); |
104 | this.myInterval = Timer_SetTimer(function(timer) {self.timerUpdate(timer)}, 5000, true); |
| 93 | 105 | ||
| 94 | } |
106 | } |
| Line 106... | Line 118... | ||
| 106 | //getDimmerService('TakHall').absFade(0,117, 0); |
118 | //getDimmerService('TakHall').absFade(0,117, 0); |
| 107 | //getDimmerService('TakSovrum').absFade(0,105, 0); |
119 | //getDimmerService('TakSovrum').absFade(0,105, 0); |
| 108 | Dimmer_AbsoluteFade(this.myDimmer1, 132, 0); |
120 | Dimmer_AbsoluteFade(this.myDimmer1, 132, 0); |
| 109 | Dimmer_AbsoluteFade(this.myDimmer2, 117, 0); |
121 | Dimmer_AbsoluteFade(this.myDimmer2, 117, 0); |
| 110 | Dimmer_AbsoluteFade(this.myDimmer3, 103, 0); |
122 | Dimmer_AbsoluteFade(this.myDimmer3, 103, 0); |
| - | 123 | Dimmer_AbsoluteFade(this.myDimmer4, 132, 0); |
|
| - | 124 | Dimmer_AbsoluteFade(this.myDimmer5, 132, 0); |
|
| - | 125 | Dimmer_AbsoluteFade(this.myDimmer6, 132, 0); |
|
| 111 | Timer_Cancel(this.myInterval); |
126 | Timer_Cancel(this.myInterval); |
| 112 | this.myInterval = Timer_SetTimer(function(timer) {self.timerUpdate(timer)}, 5000, true); |
127 | this.myInterval = Timer_SetTimer(function(timer) {self.timerUpdate(timer)}, 5000, true); |
| 113 | } |
128 | } |
| 114 | } |
129 | } |
| 115 | 130 | ||