merge i18n-info-jp-logic

This commit is contained in:
Hiroyasu Nishiyama
2018-02-15 22:46:58 +09:00
6 changed files with 314 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<!--
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="switch">
<p>プロパティの値によってメッセージの振り分けを行います</p>
<h3>詳細</h3>
<p>受信したメッセージに対し指定されたルールを順に評価しマッチしたルールに対応する出力ポートにメッセージを送出します</p>
<p>最初にルールがマッチしたところで評価を止めることも可能です</p>
<p>評価ルールにはメッセージプロパティフローコンテキスト/グローバルコンテキストのプロパティJSONata式の評価結果が利用できます</p>
<h3>ルール</h3>
<p>振り分けルールは以下の4つに分類されます</p>
<ol>
<li><b>(value)</b> - </li>
<li><b>(sequence)</b> - (split)</li>
<li><b>JSONata式</b> - </li>
<li><b>その他</b> - </li>
</ol>
<h3>メッセージ列の扱い</h3>
<p>switchードは入力メッセージの列に関する情報を保持する<code>msg.parts</code></p>
<p><b>メッセージ列の補正</b>switch<code>nodeMessageBufferMaxLength</code></p>
</script>

View File

@@ -0,0 +1,34 @@
<!--
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="change">
<p>メッセージフローコンテキストグローバルコンテキストのプロパティを変更削除移動します</p>
<p>ルールを複数指定した場合定義した順に適用します</p>
<h3>詳細</h3>
<p>利用可能な処理</p>
<dl class="message-properties">
<dt>代入</dt>
<dd>プロパティをセットします設定値にはさまざまな型の値メッセージやコンテキストの既存プロパティを利用できます<dd>
<dt>置換</dt>
<dd>プロパティに対して検索と置換を行います正規表現を指定した場合置換後の文字列には<code>$1</code></dd>
<dt>削除</dt>
<dd>プロパティを削除します</dd>
<dt>移動</dt>
<dd>プロパティの移動または名前の変更を行います</dd>
</dl>
<p>expressionには<a href="http://jsonata.org/" target="_new">JSONata</a>
</p>
</script>

View File

@@ -0,0 +1,33 @@
<!--
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>数値以外の場合は数値に変換します変換不能な場合はラーとなります</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>
</script>

View File

@@ -0,0 +1,137 @@
<!--
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="split">
<p>メッセージをメッセージ列に分割します</p>
<h3>入力</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">オブジェクト | 文字列 | 配列 | バッファ</span></dt>
<dd><code>msg.payload</code>
<ul>
<li><b>文字列</b>/<b>バッファ</b> - (: <code>\n</code>)</li>
<li><b>配列</b> - </li>
<li><b>オブジェクト</b> - /</li>
</ul>
</dd>
</dl>
<h3>出力</h3>
<dl class="message-properties">
<dt>parts<span class="property-type">オブジェクト</span></dt>
<dd>元のメッセージをどのように分割したかに関する情報をこのプロパティに保持します例えば<b>join</b><code>parts</code>
<ul>
<li><code>id</code> - </li>
<li><code>index</code> - </li>
<li><code>count</code> - </li>
<li><code>type</code> - - ///</li>
<li><code>ch</code> - </li>
<li><code>key</code> -
ノードの設定によりキーを<code>msg.topic</code></li>
<li><code>len</code> - </li>
</ul>
</dd>
</dl>
<h3>詳細</h3>
<p>このノードはメッセージ列を構成するメッセージに対して共通処理を行い<b>join</b></p>
<p><code>msg.parts</code></p>
<h4>ストリームモード</h4>
<p>このノードはメッセージ列を再構成して送信する際にも有用です例えば改行終端のコマンドを送信するようなシリアルデバイスではメッセージの最後のコマンド部分が途切れたメッセージを送出する場合がありますストリームモードを用いることで完結した個別コマンドにメッセージを分割することができます入力メッセージの最後に未完部分がある場合<b>split</b></p>
<p>このモードで処理する際にはメッセージ数を予め知ることができないため<code>msg.parts.count</code><b>join</b></p>
</script>
<script type="text/x-red" data-help-name="join">
<p>メッセージ列を結合して一つのメッセージにします</p>
<p>メッセージの結合には次の3つのモードが利用できます</p>
<dl>
<dt>自動</dt>
<dd><b>split</b>split</dd>
<dt>手動</dt>
<dd>メッセージ列をさまざまな方法で結合します</dd>
<dt>列の集約</dt>
<dd>メッセージ列に対して指定した式を適用し1つのメッセージに集約します</dd>
</dl>
<h3>入力</h3>
<dl class="message-properties">
<dt class="optional">parts<span class="property-type">オブジェクト</span></dt>
<dd>自動的にメッセージ列を結合するには全メッセージがこのプロパティを持っていなければなりません<b>split</b><code>parts</code>
<ul>
<li><code>id</code> - </li>
<li><code>index</code> - </li>
<li><code>count</code> - </li>
<li><code>type</code> - - string/array/object/buffer</li>
<li><code>ch</code> - </li>
<li><code>key</code> - </li>
<li><code>len</code> - </li>
</ul>
</dd>
<dt class="optional">complete</dt>
<dd>設定されている場合保持しているメッセージを結合して送信します</dd>
</dl>
<h3>詳細</h3>
<h4>自動モード</h4>
<p>自動モードでは入力メッセージの<code>parts</code><b>split</b></p>
<h4>手動モード</h4>
<p>手動モードではメッセージ列をさまざまな結果に結合できます</p>
<ul>
<li><b>文字列</b><b></b> - </li>
<li><b>配列</b> - </li>
<li><b>key/valueオブジェクト</b> - </li>
<li><b>統合オブジェクト</b> - </li>
</ul>
<p>出力メッセージのその他のプロパティはメッセージを送信する直前のメッセージをコピーします</p>
<p><i>合計値</i></p>
<p><i></i></p>
<p><code>msg.complete</code></p>
<h4>列の集約モード</h4>
<p>列の集約モードを選択するとメッセージ列を構成する各々のメッセージに対して式を適用し集約した値を用いて一つのメッセージを構成します</p>
<dl class="message-properties">
<dt>初期値</dt>
<dd>
集約の初期値(<code>$A</code>)
</dd>
<dt>集約式</dt>
<dd>メッセージグループを構成する各メッセージに適用するJSONata式
式の評価結果は次回の呼び出しの際に集約値として渡します
<ul>
<li><code>$A</code> </li>
<li><code>$I</code> </li>
<li><code>$N</code> </li>
</ul>
</dd>
<dt>最終調整式</dt>
<dd>メッセージグループの集約が完了した後で適用されるJSONata式任意で指定可能です式中では以下の特殊変数を参照できます
<ul>
<li><code>$A</code> </li>
<li><code>$N</code> </li>
</ul>
</dd>
<p>メッセージグループのメッセージに対しデフォルトでは集約式は最初のメッセージから最後のメッセージに対し順に適用します指定により適用を逆順にすることも可能です</p>
</dl>
<p><b>:</b>
<ul>
<li><b>集約式</b>: <code>$A+payload</code></li>
<li><b>初期値</b>: <code>0</code></li>
<li><b>最終調整式</b>: <code>$A/$N</code></li>
</ul>
</p>
<h4>メッセージの蓄積</h4>
<p>このノードの処理ではメッセージ列の処理のためメッセージを内部に蓄積します<code>nodeMessageBufferMaxLength</code></p>
</script>

View File

@@ -0,0 +1,40 @@
<!--
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="sort">
<p>メッセージ列もしくは配列型のペイロードをソートします</p>
<p><b>split</b></p>
<p>ソート順序は以下が指定可能です</p>
<ul>
<li><b>昇順</b></li>
<li><b>降順</b></li>
</ul>
<p>数値による並べ替えを選択することもできます</p>
<p>メッセージの並べ替えを行うためのソートキーは<code>payload</code>JSONataJSONata</p>
<p>sortードの処理では受信したメッセージが<code>msg.parts</code>split<code>parts</code></p>
<p>
<ul>
<li><code>id</code> - </li>
<li><code>index</code> - </li>
<li><code>count</code> - </li>
</ul>
</p>
<p><b>:</b> 使
<ul>
<li><b>settings.js</b><code>nodeMessageBufferMaxLength</code></li>
</ul>
</p>
</script>

View File

@@ -0,0 +1,34 @@
<!--
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="batch">
<p>指定したルールによりメッセージ列を生成します</p>
<h3>詳細</h3>
<p>メッセージ列の生成には以下の3つのモードが利用できます</p>
<dl>
<dt>入力メッセージ数でグループ化</dt>
<dd>入力メッセージを指定した長さのメッセージ列にグループ化しますメッセージ列の最後の部分を次のメッセージ列の先頭で繰り返すメッセージ数を<b>オーバラップ</b></dd>
<dt>入力間隔()でグループ化</dt>
<dd>指定時間間隔内に受信した入力メッセージをメッセージ列にグループ化します指定した時間内にメッセージを受信しない場合に空のメッセージを送信するように設定することもできます</dd>
<dt>メッセージグループの結合</dt>
<dd>入力メッセージ列を結合し1つのメッセージ列にしますメッセージ列の識別のため各メッセージは<code>msg.topic</code><code>msg.parts</code><code>topic</code>batch
</dd>
</dl>
<h4>メッセージの蓄積</h4>
<p>このノードの処理ではメッセージ列の処理のためメッセージを内部に蓄積します<code>nodeMessageBufferMaxLength</code></p>
</script>