1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
node-red/packages/node_modules/@node-red/nodes/examples/sequence/batch/03 - Concatenate mode.json

1 line
4.1 KiB
JSON
Raw Normal View History

[{"id":"cf1fd796.197678","type":"inject","z":"e6e2a04b.1fb51","name":"","topic":"SEQ","payload":"[1,2,3,4,5]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":140,"wires":[["d1c8ddf0.99b4e"]]},{"id":"d1c8ddf0.99b4e","type":"split","z":"e6e2a04b.1fb51","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":370,"y":140,"wires":[["f727a5d3.ea1a28"]]},{"id":"f727a5d3.ea1a28","type":"batch","z":"e6e2a04b.1fb51","name":"","mode":"concat","count":10,"overlap":0,"interval":10,"allowEmptySequence":false,"topics":[{"topic":"SEQ"},{"topic":"SEQ"}],"x":510,"y":140,"wires":[["f4d6dba4.7e8ab8"]]},{"id":"f4d6dba4.7e8ab8","type":"join","z":"e6e2a04b.1fb51","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":650,"y":140,"wires":[["31b81865.611788"]]},{"id":"31b81865.611788","type":"debug","z":"e6e2a04b.1fb51","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":810,"y":140,"wires":[]},{"id":"8ad6b9c.7ee8548","type":"comment","z":"e6e2a04b.1fb51","name":"Duplicate","info":"","x":140,"y":100,"wires":[]},{"id":"5137b2d0.f4838c","type":"inject","z":"e6e2a04b.1fb51","name":"","topic":"SEQ","payload":"[1,-6,-8,7,2,-3]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":260,"wires":[["408f3032.eafc1"]]},{"id":"408f3032.eafc1","type":"split","z":"e6e2a04b.1fb51","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":370,"y":260,"wires":[["dbd6e8b8.cbf2b8"]]},{"id":"c70a7fad.9ee08","type":"comment","z":"e6e2a04b.1fb51","name":"Filter & Concat","info":"","x":160,"y":220,"wires":[]},{"id":"dbd6e8b8.cbf2b8","type":"switch","z":"e6e2a04b.1fb51","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"},{"t":"else"}],"checkall":"true","repair":true,"outputs":2,"x":430,"y":320,"wires":[["c11e5c5f.876d6"],["e99c703b.f404"]]},{"id":"356c8654.2ad1aa","type":"comment","z":"e6e2a04b.1fb51","name":"↑ Duplicate SEQ","info":"","x":540,"y":180,"wires":[]},{"id":"c11e5c5f.876d6","type":"change","z":"e6e2a04b.1fb51","name":"Topic←POS","rules":[{"t":"set","p":"topic","pt":"msg","to":"POS","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":280,"wires":[["3412e439.eda55c"]]},{"id":"e99c703b.f404","type":"change","z":"e6e2a04b.1fb51","name":"Topic←NEG","rules":[{"t":"set","p":"topic","pt":"msg","to":"NEG","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":340,"wires":[["3412e439.eda55c"]]},{"id":"3412e439.eda55c","type":"batch","z":"e6e2a04b.1fb51","name":"","mode":"concat","count":10,"overlap":0,"interval":10,"allowEmptySequence":false,"topics":[{"topic":"NEG"},{"topic":"POS"}],"x":750,"y":320,"wires":[["7f1ce95c.7ddbc8"]]},{"id":"e6f01877.16d558","type":"debug","z":"e6e2a04b.1fb51","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":970,"y":260,"wires":[]},{"id":"7f1ce95c.7ddbc8","type":"join","z":"e6e2a04b.1fb51","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":810,"y":260,"wires":[["e6f01877.16d558"]]},{"id":"c548f2c.641141","type":"comment","z":"e6e2a04b.1fb51","name":"↑ Order sequence: negative→positive","info":"","x":850,"y":360,"wires":[]},{"id":"c571b56c.ae63b8","type":"comment","z":"e6e2a04b.1fb51","name":"Filter pos/neg and make separate sequence↑ (but not a simple sort) ","info":"","x":360,"y":380,"wires":[]},{"id":"c851c021.a9688","type":"comment","z":"e6e2a04b.1fb51","name":"Example: Concatenate Mode","info":"*Concatenate mode* of batch node can be used to combine input message sequences to create a new message sequence. Order of the sequences can be specified using message topic assigned to