@mschaeffler/node-red-logic 3.14.1 → 4.0.1
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.
- package/logic_timerelay.html +2 -2
- package/math_hysteresis.html +0 -14
- package/math_hysteresis.js +2 -29
- package/package.json +1 -1
package/logic_timerelay.html
CHANGED
|
@@ -174,9 +174,9 @@
|
|
|
174
174
|
<dt>Property <span class="property-type">string</span></dt>
|
|
175
175
|
<dd> defines the message property to be used as payload.</dd>
|
|
176
176
|
<dt>Delay <span class="property-type">number</span></dt>
|
|
177
|
-
<dd> delay time in msec for switching from on to off.</dd>
|
|
178
|
-
<dt>Postrun <span class="property-type">number</span></dt>
|
|
179
177
|
<dd> delay time in msec for switching from off to on.</dd>
|
|
178
|
+
<dt>Postrun <span class="property-type">number</span></dt>
|
|
179
|
+
<dd> delay time in msec for switching from on to off.</dd>
|
|
180
180
|
<dt>min on time <span class="property-type">number</span></dt>
|
|
181
181
|
<dd> minimal time in msec to be in on state.</dd>
|
|
182
182
|
<dt>max on time <span class="property-type">number</span></dt>
|
package/math_hysteresis.html
CHANGED
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
const raise = $("#node-input-threshold_raise").length ? $("#node-input-threshold_raise").val() : this.threshold_raise;
|
|
13
13
|
return v!=='' && !isNaN(v) && Number(v)<raise;}
|
|
14
14
|
},
|
|
15
|
-
consecutive:{value:1,required:true,validate:RED.validators.number()},
|
|
16
|
-
consecutiveFall:{value:1,required:true,validate:RED.validators.number()},
|
|
17
15
|
outputRise:{value:true,required:true},
|
|
18
16
|
outputRiseType:{value:"bool"},
|
|
19
17
|
outputFall:{value:false,required:true},
|
|
@@ -75,14 +73,6 @@
|
|
|
75
73
|
<label for="node-input-threshold_fall"><i class="fa fa-chevron-down"></i> dn threshold</label>
|
|
76
74
|
<input type="text" id="node-input-threshold_fall">
|
|
77
75
|
</div>
|
|
78
|
-
<div class="form-row">
|
|
79
|
-
<label for="node-input-consecutive"><i class="fa fa-line-chart"></i> rise Consecutive</label>
|
|
80
|
-
<input type="number" id="node-input-consecutive">
|
|
81
|
-
</div>
|
|
82
|
-
<div class="form-row">
|
|
83
|
-
<label for="node-input-consecutiveFall"><i class="fa fa-line-chart"></i> fall Consecutive</label>
|
|
84
|
-
<input type="number" id="node-input-consecutiveFall">
|
|
85
|
-
</div>
|
|
86
76
|
<div class="form-row">
|
|
87
77
|
<label for="node-input-outputRise"><i class="fa fa-sign-out"></i> rise Output</label>
|
|
88
78
|
<input type="text" id="node-input-outputRise">
|
|
@@ -150,10 +140,6 @@
|
|
|
150
140
|
<dd> threshold value for the rising edge detection.</dd>
|
|
151
141
|
<dt>d(ow)n Threshold <span class="property-type">number</span></dt>
|
|
152
142
|
<dd> threshold value for the falling edge detection.</dd>
|
|
153
|
-
<dt>rise Consecutive <span class="property-type">number</span></dt>
|
|
154
|
-
<dd> number of consecutive frames to generate a rising output.</dd>
|
|
155
|
-
<dt>fall Consecutive <span class="property-type">number</span></dt>
|
|
156
|
-
<dd> number of consecutive frames to generate a falling output.</dd>
|
|
157
143
|
<dt>rise Output <span class="property-type">multi</span></dt>
|
|
158
144
|
<dd> Value to be sent in case of a rising edge.</dd>
|
|
159
145
|
<dt>fall Output <span class="property-type">multi</span></dt>
|
package/math_hysteresis.js
CHANGED
|
@@ -11,8 +11,6 @@ module.exports = function(RED) {
|
|
|
11
11
|
this.propertyType = config.propertyType ?? "msg";
|
|
12
12
|
this.threshold_rise = Number( config.threshold_raise );
|
|
13
13
|
this.threshold_fall = Number( config.threshold_fall );
|
|
14
|
-
this.consecutiveRise= Number( config.consecutive ?? 1 );
|
|
15
|
-
this.consecutiveFall= Number( config.consecutiveFall ?? 1 );
|
|
16
14
|
this.outputRise = RED.util.evaluateNodeProperty( config.outputRise ?? "true", config.outputRiseType ?? "bool" );
|
|
17
15
|
this.outputFall = RED.util.evaluateNodeProperty( config.outputFall ?? "false",config.outputFallType ?? "bool" );
|
|
18
16
|
this.noInit = Boolean( config.noInit );
|
|
@@ -27,8 +25,6 @@ module.exports = function(RED) {
|
|
|
27
25
|
return;
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
|
-
node.cntRise = 0;
|
|
31
|
-
node.cntFall = 0;
|
|
32
28
|
node.status( "" );
|
|
33
29
|
|
|
34
30
|
function msgSetEdge(msg,edge)
|
|
@@ -110,34 +106,11 @@ module.exports = function(RED) {
|
|
|
110
106
|
|
|
111
107
|
if( msg.value > node.threshold_rise && last !== true )
|
|
112
108
|
{
|
|
113
|
-
|
|
114
|
-
{
|
|
115
|
-
sendMsg( true );
|
|
116
|
-
node.cntRise = 0;
|
|
117
|
-
}
|
|
118
|
-
else
|
|
119
|
-
{
|
|
120
|
-
status.fill = "gray";
|
|
121
|
-
}
|
|
122
|
-
node.cntFall = 0;
|
|
109
|
+
sendMsg( true );
|
|
123
110
|
}
|
|
124
111
|
else if( msg.value < node.threshold_fall && last !== false )
|
|
125
112
|
{
|
|
126
|
-
|
|
127
|
-
{
|
|
128
|
-
sendMsg( false );
|
|
129
|
-
node.cntFall = 0;
|
|
130
|
-
}
|
|
131
|
-
else
|
|
132
|
-
{
|
|
133
|
-
status.fill = "gray";
|
|
134
|
-
}
|
|
135
|
-
node.cntRise = 0;
|
|
136
|
-
}
|
|
137
|
-
else
|
|
138
|
-
{
|
|
139
|
-
node.cntRise = 0;
|
|
140
|
-
node.cntFall = 0;
|
|
113
|
+
sendMsg( false );
|
|
141
114
|
}
|
|
142
115
|
}
|
|
143
116
|
else
|
package/package.json
CHANGED