@ncd-io/node-red-enterprise-sensors 1.0.4 → 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.
@@ -1407,28 +1407,51 @@ module.exports = class WirelessSensor{
1407
1407
  }
1408
1408
  config_set_current_calibration_13(sensor_mac, calib){
1409
1409
  console.log('config_set_current_calibration_13');
1410
+ calib = calib * 100;
1410
1411
  var packet = [244, 1, 0, 0, 0];
1411
- var cal_val = int2Bytes(calib, 2);
1412
+ var cal_val = int2Bytes(calib, 4);
1412
1413
  packet.push(...cal_val);
1413
1414
  console.log(packet);
1414
1415
  return this.config_send(sensor_mac, packet);
1415
1416
  }
1416
1417
  config_set_current_calibration_ch2_19(sensor_mac, calib){
1417
1418
  console.log('config_set_current_calibration_ch2_19');
1419
+ calib = calib * 100;
1418
1420
  var packet = [244, 3, 0, 0, 0];
1419
- var cal_val = int2Bytes(calib, 2);
1421
+ var cal_val = int2Bytes(calib, 4);
1420
1422
  packet.push(...cal_val);
1421
1423
  console.log(packet);
1422
1424
  return this.config_send(sensor_mac, packet);
1423
1425
  }
1424
1426
  config_set_current_calibration_ch3_28(sensor_mac, calib){
1425
1427
  console.log('cconfig_set_current_calibration_ch3_28');
1428
+ calib = calib * 100;
1426
1429
  var packet = [244, 5, 0, 0, 0];
1427
- var cal_val = int2Bytes(calib, 2);
1430
+ var cal_val = int2Bytes(calib, 4);
1428
1431
  packet.push(...cal_val);
1429
1432
  console.log(packet);
1430
1433
  return this.config_send(sensor_mac, packet);
1431
1434
  }
1435
+ config_set_rx485_timeout_1011(sensor_mac, value){
1436
+ console.log('config_set_Rx485_timeout_1011');
1437
+ var packet = [244, 48, 0, 0, 23, value];
1438
+ console.log(packet);
1439
+ return this.config_send(sensor_mac, packet);
1440
+ }
1441
+ config_set_mode_1011(sensor_mac, value){
1442
+ console.log('config_set_mode_1011');
1443
+ var packet = [244, 38, 0, 0, 23, value];
1444
+ console.log(packet);
1445
+ return this.config_send(sensor_mac, packet);
1446
+ }
1447
+ config_set_auto_address_timeout_1011(sensor_mac, value){
1448
+ console.log('config_set_auto_address_timeout_1011');
1449
+ var packet = [244, 40, 0, 0, 23];
1450
+ var time_val = int2Bytes(value, 2);
1451
+ packet.push(...time_val);
1452
+ console.log(packet);
1453
+ return this.config_send(sensor_mac, packet);
1454
+ }
1432
1455
  config_get_delay(sensor_mac){
1433
1456
  return new Promise((fulfill, reject) => {
1434
1457
  this.config_send(sensor_mac, [247, 21, 0, 0, 0]).then((res) => {
@@ -5599,12 +5622,12 @@ function sensor_types(parent){
5599
5622
  return error;
5600
5623
  }
5601
5624
  return {
5602
- digital_input_1_counter: d.slice(0, 4).reduce(msbLsb),
5603
- digital_input_1_uptime: d.slice(4, 8).reduce(msbLsb),
5604
- digital_input_2_counter: d.slice(8, 12).reduce(msbLsb),
5605
- digital_input_2_uptime: d.slice(12, 16).reduce(msbLsb),
5606
- digital_input_3_counter: d.slice(16, 20).reduce(msbLsb),
5607
- digital_input_3_uptime: d.slice(20, 24).reduce(msbLsb),
5625
+ digital_input_counter: d.slice(0, 4).reduce(msbLsb),
5626
+ digital_input_uptime: d.slice(4, 8).reduce(msbLsb),
5627
+ ct_input_counter: d.slice(8, 12).reduce(msbLsb),
5628
+ ct_input_uptime: d.slice(12, 16).reduce(msbLsb),
5629
+ opto_input_counter: d.slice(16, 20).reduce(msbLsb),
5630
+ opto_input_uptime: d.slice(20, 24).reduce(msbLsb),
5608
5631
  accelerometer_counter: d.slice(24, 28).reduce(msbLsb),
5609
5632
  accelerometer_uptime: d.slice(28, 32).reduce(msbLsb),
5610
5633
  magnetometer_counter: d.slice(32, 36).reduce(msbLsb),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ncd-io/node-red-enterprise-sensors",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wireless.html CHANGED
@@ -202,13 +202,13 @@
202
202
  change_interval: {value: "0", validate: NCD_validators.number_range(0, 16712198)},
203
203
 
204
204
  current_calibration_13_active: {value: ""},
205
- current_calibration_13: {value: "606", validate: NCD_validators.number_range(0, 65535)},
205
+ current_calibration_13: {value: "606", validate: NCD_validators.number_range(0, 42949672)},
206
206
 
207
207
  current_calibration_ch2_19_active: {value: ""},
208
- current_calibration_ch2_19: {value: "606", validate: NCD_validators.number_range(0, 65535)},
208
+ current_calibration_ch2_19: {value: "606", validate: NCD_validators.number_range(0, 42949672)},
209
209
 
210
210
  current_calibration_ch3_28_active: {value: ""},
211
- current_calibration_ch3_28: {value: "606", validate: NCD_validators.number_range(0, 65535)},
211
+ current_calibration_ch3_28: {value: "606", validate: NCD_validators.number_range(0, 42949672)},
212
212
 
213
213
  bp_altitude: {value: "0", validate: NCD_validators.number_range(0, 65535)},
214
214
  bp_pressure: {value: "0", validate: NCD_validators.number_range(0, 14000)},
@@ -443,7 +443,17 @@
443
443
  smart_interval_110: {value: 0, validate: NCD_validators.number_range(0, 255)},
444
444
 
445
445
  smart_threshold_110_active:{value:""},
446
- smart_threshold_110: {value:0, validate: NCD_validators.number_range(0, 65534)}
446
+ smart_threshold_110: {value:0, validate: NCD_validators.number_range(0, 65534)},
447
+
448
+ rx485_timeout_1011_active:{value:""},
449
+ rx485_timeout_1011:{value: 0, validate: NCD_validators.number_range(0, 255)},
450
+
451
+ mode_1011_active:{value:""},
452
+ mode_1011:{value: 0},
453
+
454
+ auto_address_timeout_1011_active:{value:""},
455
+ auto_address_timeout_1011:{value:0, validate: NCD_validators.number_range(0, 65534)}
456
+
447
457
  },
448
458
  inputs: 0,
449
459
  outputs: 1,
@@ -993,7 +1003,7 @@
993
1003
  <input type="checkbox" id="node-input-current_calibration_13_active" class="ncd-config-toggle" data-target-id="node-input-current_calibration_13_active" value="1">
994
1004
  </div>
995
1005
  <div>
996
- <label for="node-input-current_calibration_13"><i class="icon-tag"></i> Calibration Option (1 - 65535)</label>
1006
+ <label for="node-input-current_calibration_13"><i class="icon-tag"></i> Value:</label>
997
1007
  <input type="text" id="node-input-current_calibration_13">
998
1008
  </div>
999
1009
  </div>
@@ -1006,7 +1016,7 @@
1006
1016
  <input type="checkbox" id="node-input-current_calibration_ch2_19_active" class="ncd-config-toggle" data-target-id="node-input-current_calibration_ch2_19_active" value="1">
1007
1017
  </div>
1008
1018
  <div>
1009
- <label for="node-input-current_calibration_ch2_19"><i class="icon-tag"></i> Calibration Option (1 - 65535)</label>
1019
+ <label for="node-input-current_calibration_ch2_19"><i class="icon-tag"></i> Value:</label>
1010
1020
  <input type="text" id="node-input-current_calibration_ch2_19">
1011
1021
  </div>
1012
1022
  </div>
@@ -1019,7 +1029,7 @@
1019
1029
  <input type="checkbox" id="node-input-current_calibration_ch3_28_active" class="ncd-config-toggle" data-target-id="node-input-current_calibration_ch3_28_active" value="1">
1020
1030
  </div>
1021
1031
  <div>
1022
- <label for="node-input-current_calibration_ch3_28"><i class="icon-tag"></i> Calibration Option (1 - 65535)</label>
1032
+ <label for="node-input-current_calibration_ch3_28"><i class="icon-tag"></i> Value:</label>
1023
1033
  <input type="text" id="node-input-current_calibration_ch3_28">
1024
1034
  </div>
1025
1035
  </div>
@@ -2028,7 +2038,7 @@
2028
2038
  </div>
2029
2039
  </div>
2030
2040
  <div class="form-row ncd-active-check">
2031
- <strong>Set Input One</strong>
2041
+ <strong>Set Contact Closure Detection</strong>
2032
2042
  <div>
2033
2043
  <label for="node-input-input_one_108_active">Active:</label>
2034
2044
  <input type="checkbox" id="node-input-input_one_108_active" class="ncd-config-toggle" data-target-id="node-input-input_one_108" value="1">
@@ -2036,13 +2046,13 @@
2036
2046
  <div>
2037
2047
  <label for="node-input-input_one_108"><i class="icon-tag"></i>Value:</label>
2038
2048
  <select id="node-input-input_one_108">
2039
- <option value="0">Falling Edge trigger</option>
2040
- <option value="1">Rising Edge trigger</option>
2049
+ <option value="0">Falling Edge Trigger</option>
2050
+ <option value="1" selected>Rising Edge Trigger</option>
2041
2051
  </select>
2042
2052
  </div>
2043
2053
  </div>
2044
2054
  <div class="form-row ncd-active-check">
2045
- <strong>Set Input Two</strong>
2055
+ <strong>Set Current Transducer Detection</strong>
2046
2056
  <div>
2047
2057
  <label for="node-input-input_two_108_active">Active:</label>
2048
2058
  <input type="checkbox" id="node-input-input_two_108_active" class="ncd-config-toggle" data-target-id="node-input-input_two_108" value="1">
@@ -2050,13 +2060,13 @@
2050
2060
  <div>
2051
2061
  <label for="node-input-input_two_108"><i class="icon-tag"></i>Value:</label>
2052
2062
  <select id="node-input-input_two_108">
2053
- <option value="0">Falling Edge trigger</option>
2054
- <option value="1">Rising Edge trigger</option>
2063
+ <option value="0">Falling Edge Trigger</option>
2064
+ <option value="1" selected>Rising Edge Trigger</option>
2055
2065
  </select>
2056
2066
  </div>
2057
2067
  </div>
2058
2068
  <div class="form-row ncd-active-check">
2059
- <strong>Set Input Three</strong>
2069
+ <strong>Set Wet Contact/Optical Sensor Detection</strong>
2060
2070
  <div>
2061
2071
  <label for="node-input-input_three_108_active">Active:</label>
2062
2072
  <input type="checkbox" id="node-input-input_three_108_active" class="ncd-config-toggle" data-target-id="node-input-input_three_108" value="1">
@@ -2064,8 +2074,8 @@
2064
2074
  <div>
2065
2075
  <label for="node-input-input_three_108"><i class="icon-tag"></i>Value:</label>
2066
2076
  <select id="node-input-input_three_108">
2067
- <option value="0">Falling Edge trigger</option>
2068
- <option value="1">Rising Edge trigger</option>
2077
+ <option value="0" selected>Falling Edge Trigger</option>
2078
+ <option value="1">Rising Edge Trigger</option>
2069
2079
  </select>
2070
2080
  </div>
2071
2081
  </div>
@@ -2211,6 +2221,8 @@
2211
2221
  </select>
2212
2222
  </div>
2213
2223
  </div>
2224
+ </div>
2225
+ <div class="ncd-dependent" data-sensor-539>
2214
2226
  <div class="form-row ncd-active-check">
2215
2227
  <strong>Set Rx Timeout</strong>
2216
2228
  <div>
@@ -2222,8 +2234,47 @@
2222
2234
  <input type="text" id="node-input-rx_timeout_539" placeholder="10" value="10">
2223
2235
  </div>
2224
2236
  </div>
2225
- </div>
2226
- <div class="ncd-dependent" data-sensor-539>
2237
+ </div>
2238
+ <div class="ncd-dependent" data-sensor-1011>
2239
+ <div class="form-row ncd-active-check">
2240
+ <strong>Set rs485 Timeout</strong>
2241
+ <div>
2242
+ <label for="node-input-rx485_timeout_1011_active">Active:</label>
2243
+ <input type="checkbox" id="node-input-rx485_timeout_1011_active" class="ncd-config-toggle" data-target-id="node-input-rx485_timeout_1011" value="1">
2244
+ </div>
2245
+ <div>
2246
+ <label for="node-input-rx485_timeout_1011"><i class="icon-tag"></i>Value:</label>
2247
+ <input type="text" id="node-input-rx485_timeout_1011" placeholder="10" value="10">
2248
+ </div>
2249
+ </div>
2250
+ <div class="form-row ncd-active-check">
2251
+ <strong>Set Mode</strong>
2252
+ <div>
2253
+ <label for="node-input-mode_1011_active">Active:</label>
2254
+ <input type="checkbox" id="node-input-mode_1011_active" class="ncd-config-toggle" data-target-id="node-input-mode_1011" value="1">
2255
+ </div>
2256
+ <div>
2257
+ <label for="node-input-mode_1011"><i class="icon-tag"></i>Value:</label>
2258
+ <select id="node-input-mode_1011">
2259
+ <option selected="selected" value="0">Auto Encoder</option>
2260
+ <option value="1">Transparent</option>
2261
+ <option value="2">NCD Emulator</option>
2262
+ </select>
2263
+ </div>
2264
+ </div>
2265
+ <div class="form-row ncd-active-check">
2266
+ <strong>Set Auto Address Timeout</strong>
2267
+ <div>
2268
+ <label for="node-input-auto_address_timeout_1011_active">Active:</label>
2269
+ <input type="checkbox" id="node-input-auto_address_timeout_1011_active" class="ncd-config-toggle" data-target-id="node-input-rauto_address_timeout_1011" value="1">
2270
+ </div>
2271
+ <div>
2272
+ <label for="node-input-auto_address_timeout_1011"><i class="icon-tag"></i>Value:</label>
2273
+ <input type="text" id="node-input-auto_address_timeout_1011" placeholder="10" value="10">
2274
+ </div>
2275
+ </div>
2276
+ </div>
2277
+ <div class="ncd-dependent" data-sensor-539>
2227
2278
  <div class="form-row ncd-active-check">
2228
2279
  <strong>Set Bootup Time</strong>
2229
2280
  <div>
package/wireless.js CHANGED
@@ -2061,8 +2061,14 @@ module.exports = function(RED) {
2061
2061
  if(config.baudrate_539_active){
2062
2062
  promises.baudrate_539 = node.config_gateway.config_set_baudrate_539(mac, parseInt(config.baudrate_539));
2063
2063
  }
2064
- if(config.rx_timeout_539_active){
2065
- promises.rx_timeout_539 = node.config_gateway.config_set_rx_timeout_539(mac, parseInt(config.rx_timeout_539));
2064
+ if(config.rx485_timeout_1011_active){
2065
+ promises.rx485_timeout_1011 = node.config_gateway.config_set_rx485_timeout_1011(mac, parseInt(config.rx485_timeout_1011));
2066
+ }
2067
+ if(config.mode_1011_active){
2068
+ promises.mode_1011 = node.config_gateway.config_set_mode_1011(mac, parseInt(config.mode_1011));
2069
+ }
2070
+ if(config.auto_address_timeout_1011_active){
2071
+ promises.auto_address_timeout_1011 = node.config_gateway.config_set_auto_address_timeout_1011(mac, parseInt(config.auto_address_timeout_1011));
2066
2072
  }
2067
2073
  break;
2068
2074
  }