mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
41 lines
2.0 KiB
HTML
41 lines
2.0 KiB
HTML
<!--
|
||
Copyright JS Foundation and other contributors, http://js.foundation
|
||
|
||
Licensed under the Apache License, Version 2.0 (the "License");
|
||
you may not use this file except in compliance with the License.
|
||
You may obtain a copy of the License at
|
||
|
||
http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
Unless required by applicable law or agreed to in writing, software
|
||
distributed under the License is distributed on an "AS IS" BASIS,
|
||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
See the License for the specific language governing permissions and
|
||
limitations under the License.
|
||
-->
|
||
|
||
<script type="text/x-red" data-help-name="range">
|
||
<p>将数值映射为另一个区间的数值</p>
|
||
<h3>输入</h3>
|
||
<dl class="message-properties">
|
||
<dt>payload<span class="property-type">数值</span></dt>
|
||
<dd>payload<i>一定</i>得是一个数值. 否则则会映射失败。</dd>
|
||
</dl>
|
||
<h3>输出</h3>
|
||
<dl class="message-properties">
|
||
<dt>payload<span class="property-type">数值</span></dt>
|
||
<dd>被映射到新区间的数值。</dd>
|
||
</dl>
|
||
<h3>详细</h3>
|
||
<p>该节点将线性缩放所接收到的数值。在默认情况下,结果不限于节点中定义的范围。</p>
|
||
<p><i>缩放并限制到目标范围</i>表示结果永远不会超出目标范围内指定的范围。</p>
|
||
<p><i>在目标范围内缩放并折叠</i>表示结果将会被限制(折叠)在目标范围内。</p>
|
||
<p>例如,输入0-10映射到0-100。</p>
|
||
<table style="outline-width:#888 solid thin">
|
||
<tr><th width="80px">模式</th><th width="80px">输入</th><th width="80px">输出</th></tr>
|
||
<tr><td><center>scale</center></td><td><center>12</center></td><td><center>120</center></td></tr>
|
||
<tr><td><center>limit</center></td><td><center>12</center></td><td><center>100</center></td></tr>
|
||
<tr><td><center>wrap</center></td><td><center>12</center></td><td><center>20</center></td></tr>
|
||
</table>
|
||
</script>
|