node-red-contrib-modbus-modpackqt 3.3.28 → 3.3.29

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.
@@ -26,8 +26,7 @@
26
26
  oneditprepare: function () {
27
27
  const node = this;
28
28
 
29
- // ── My Slaves picker
30
- let selectedProtocol = 'tcp'; // track selected slave protocol for renderLink
29
+ // ── My Slaves picker (TCP only — this node runs a TCP server, not serial RTU)
31
30
  const $sel = $('#node-input-modpackqt-slave-picker');
32
31
  const reload = function () {
33
32
  $sel.empty().append('<option value="">— Loading… —</option>');
@@ -38,17 +37,15 @@
38
37
  $.getJSON('modpackqt/slaves?probe=' + encodeURIComponent(node.id))
39
38
  .done(function (rows) {
40
39
  $sel.empty().append('<option value="">— Manual entry —</option>');
41
- (rows || [])
42
- .filter(function (s) { return !!s; })
43
- .forEach(function (s) {
44
- const isRtu = s.protocol === 'rtu';
45
- const proto = isRtu ? ' [RTU]' : ' [TCP]';
46
- const conn = isRtu
47
- ? ' — unit #' + (s.unitId || 1)
48
- : ' — :' + (s.port || 1502) + ' #' + (s.unitId || 1);
49
- const label = (s.name || '(unnamed)') + conn + proto;
40
+ const tcpSlaves = (rows || []).filter(function (s) { return !!s && s.protocol !== 'rtu'; });
41
+ if (tcpSlaves.length === 0) {
42
+ $sel.empty().append($('<option>').val('').text('— No TCP slaves saved yet —'));
43
+ } else {
44
+ tcpSlaves.forEach(function (s) {
45
+ const label = (s.name || '(unnamed)') + ' — :' + (s.port || 1502) + ' #' + (s.unitId || 1);
50
46
  $('<option>').val(s.id).text(label).data('row', s).appendTo($sel);
51
47
  });
48
+ }
52
49
  })
53
50
  .fail(function (xhr) {
54
51
  const msg = (xhr.responseJSON && xhr.responseJSON.error) || ('HTTP ' + xhr.status);
@@ -60,10 +57,8 @@
60
57
  const row = $(this).find('option:selected').data('row');
61
58
  if (!row) return;
62
59
  if (!node.name) $('#node-input-name').val(row.name || '');
63
- // RTU slaves have no port — keep whatever TCP port is already set
64
- if (row.protocol !== 'rtu' && row.port) $('#node-input-bindPort').val(row.port);
60
+ if (row.port) $('#node-input-bindPort').val(row.port);
65
61
  $('#node-input-unitId').val(row.unitId || 1);
66
- selectedProtocol = row.protocol || 'tcp';
67
62
  buildLink();
68
63
  });
69
64
  reload();
@@ -79,7 +74,6 @@
79
74
  const bindPort = $('#node-input-bindPort').val() || node.bindPort || 1502;
80
75
  const unitId = $('#node-input-unitId').val() || node.unitId || 1;
81
76
  const name = $('#node-input-name').val() || node.name || '';
82
- const isRtu = selectedProtocol === 'rtu';
83
77
  const url = 'https://modpackqt.com/slave'
84
78
  + '?probe=' + encodeURIComponent(node.id || '')
85
79
  + '&probeHost=' + encodeURIComponent(probeHost)
@@ -89,10 +83,7 @@
89
83
  + (name ? '&name=' + encodeURIComponent(name) : '');
90
84
  $('#modpackqt-slave-server-link').attr('href', url);
91
85
  $('#modpackqt-slave-server-runtime').text(probeHost + ':' + probePort);
92
- const targetText = isRtu
93
- ? 'RTU · unit ' + unitId
94
- : ':' + bindPort + ' · unit ' + unitId;
95
- $('#modpackqt-slave-server-target').text(targetText);
86
+ $('#modpackqt-slave-server-target').text(':' + bindPort + ' · unit ' + unitId);
96
87
  };
97
88
  buildLink();
98
89
  $('#node-input-bindPort, #node-input-unitId').on('change input', buildLink);
@@ -121,7 +112,7 @@
121
112
  <button type="button" id="modpackqt-slave-server-picker-refresh" class="red-ui-button" title="Reload" style="margin-left:4px"><i class="fa fa-refresh"></i></button>
122
113
  </div>
123
114
  <div class="form-tips" style="font-size:11px;color:#6b7280;margin:-8px 0 12px 105px">
124
- Required pick a saved slave to set the port and unit ID.
115
+ Loads your saved <strong>TCP</strong> slaves. RTU slaves are not shown this node runs a Modbus TCP server only.
125
116
  Register layout and limits are managed from the web console.
126
117
  </div>
127
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-modbus-modpackqt",
3
- "version": "3.3.28",
3
+ "version": "3.3.29",
4
4
  "description": "Modbus commissioning, testing & analysis tools for Node-RED. Embedded Modbus TCP/RTU master + slave server, FC1/FC2/FC3/FC4 reads, FC5/FC6/FC15/FC16 writes, built-in slave register store, and a passive traffic monitor for debugging. 100% free, MIT, no usage limits. By ModPackQT — open the matching web console at modpackqt.com for register decoding, simulation and AI assistance.",
5
5
  "keywords": [
6
6
  "node-red",