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>有效荷載<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>
|