nodeskini 1.0.2 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,9 +29,6 @@ var sockData; // = dgram.createSocket('udp4');
29
29
  var sockMidi; // = dgram.createSocket('udp4');
30
30
  var sockMiniWI;
31
31
 
32
- var debug = true;
33
- var debug1 = true;
34
-
35
32
  var dataPort = 3005;
36
33
  var midiPort = 3006;
37
34
  var miniWiPort = 8888;
@@ -42,7 +39,7 @@ var interfaceZAddress = "192.168.1.250";
42
39
  var interfaceZMidiPort = 1000;
43
40
 
44
41
  var debug = false;
45
- var debug1 = false;
42
+ var debug1 = true;
46
43
  var tempoSensorsInit = [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,];
47
44
  var tempoSensors = tempoSensorsInit.slice();
48
45
  var previousSensorsValues = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
@@ -52,6 +49,7 @@ var sensorsRunning = false;
52
49
  console.log("INFO: workerInterfaceZ: Start Interface Z worker");
53
50
 
54
51
  function displaySignal(sensor, value) {
52
+ if(debug) console.log("worker IZ : ");
55
53
  process.stdout.write(sensor.toString() + ': ');
56
54
  for (var i = 0; i < value/100; i++) {
57
55
  process.stdout.write("*");
@@ -62,7 +60,6 @@ function displaySignal(sensor, value) {
62
60
  function displaySignalMiniWi(value) {
63
61
  var val;
64
62
  for (var j = 0; j < 4; j++) {
65
-
66
63
  val = value[j] / 100;
67
64
  if (val !== 0) {
68
65
  process.stdout.write(j + 8 + ': ');
@@ -162,7 +159,7 @@ function initWorker() {
162
159
  if (
163
160
  message.args[i].value < previousSensorsValues[i] - sensorsSensibilities[i] ||
164
161
  message.args[i].value > previousSensorsValues[i] + sensorsSensibilities[i]) {
165
- if (debug1) displaySignal(i, Math.round(message.args[i].value));
162
+ if (debug) displaySignal(i, Math.round(message.args[i].value));
166
163
 
167
164
  messageToSend = {
168
165
  type: "INTERFACEZ_RC" + i,
@@ -288,7 +285,7 @@ function initWorker() {
288
285
  tempoSensors[i]--;
289
286
  }
290
287
  }
291
- displaySignalMiniWi(messMiniWi);
288
+ if(debug1) displaySignalMiniWi(messMiniWi);
292
289
  break;
293
290
 
294
291
  default: