forked from blechdom/node-red-flows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Robot_Arm_Control.json
1 lines (1 loc) · 15.3 KB
/
Robot_Arm_Control.json
1
[{"id":"31686c0f.8b5064","type":"ui_template","z":"3b6c97c6.3d4888","group":"58439175.ff9d1","name":"DMX LOG","order":1,"width":"6","height":"12","format":"<ul>\n <li ng-repeat=\"x in msg.payload\">\n <font color=\"red\">{{x.topic}}</font>\n <ul>\n <li>{{x.payload}}</li>\n </ul>\n </li>\n</ul>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1781,"y":228.5,"wires":[[]]},{"id":"e7420806.bf4398","type":"ui_slider","z":"3b6c97c6.3d4888","name":"DMX2","label":"DMX 2","group":"8fc5a5bf.97fba8","order":2,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"255","step":1,"x":1077,"y":288.5,"wires":[["9f15bcef.9755f"]]},{"id":"9d6f6a49.5cb768","type":"ui_slider","z":"3b6c97c6.3d4888","name":"DMX12","label":"DMX 12","group":"8fc5a5bf.97fba8","order":12,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"255","step":1,"x":1080,"y":654.5,"wires":[["1618c3a4.a2c88c"]]},{"id":"49bb5848.d54af8","type":"ui_slider","z":"3b6c97c6.3d4888","name":"DMX11","label":"DMX 11","group":"8fc5a5bf.97fba8","order":11,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"255","step":1,"x":1081,"y":617.5,"wires":[["74e7dd9d.322584"]]},{"id":"39e9a69c.6829ba","type":"ui_slider","z":"3b6c97c6.3d4888","name":"DMX10","label":"DMX 10","group":"8fc5a5bf.97fba8","order":10,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"255","step":1,"x":1080,"y":581.5,"wires":[["6f089c0c.6a93e4"]]},{"id":"720fe0eb.d0b7e","type":"ui_slider","z":"3b6c97c6.3d4888","name":"DMX9","label":"DMX 9","group":"8fc5a5bf.97fba8","order":9,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"255","step":1,"x":1072,"y":544.5,"wires":[["3169fb5e.de26b4"]]},{"id":"ee135468.6fcb38","type":"ui_slider","z":"3b6c97c6.3d4888","name":"DMX8","label":"DMX 8","group":"8fc5a5bf.97fba8","order":8,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"255","step":1,"x":1072,"y":508.5,"wires":[["c3483667.b8c548"]]},{"id":"9a8343c2.e3745","type":"ui_slider","z":"3b6c97c6.3d4888","name":"DMX7","label":"DMX 7","group":"8fc5a5bf.97fba8","order":7,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"255","step":1,"x":1071,"y":471.5,"wires":[["41740032.36ee"]]},{"id":"51da304f.d9d81","type":"ui_slider","z":"3b6c97c6.3d4888","name":"DMX6","label":"DMX 6","group":"8fc5a5bf.97fba8","order":6,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"255","step":1,"x":1072,"y":436.5,"wires":[["c4d4e44d.99f888"]]},{"id":"6dbb7189.cc221","type":"ui_slider","z":"3b6c97c6.3d4888","name":"DMX5","label":"DMX 5","group":"8fc5a5bf.97fba8","order":5,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"255","step":1,"x":1073,"y":399.5,"wires":[["e8e9117f.4adb6"]]},{"id":"77ca45d0.8a01fc","type":"ui_slider","z":"3b6c97c6.3d4888","name":"DMX4","label":"DMX 4","group":"8fc5a5bf.97fba8","order":4,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"255","step":1,"x":1074,"y":363.5,"wires":[["4b3d9f7e.a5059"]]},{"id":"f2c6164e.f34128","type":"ui_slider","z":"3b6c97c6.3d4888","name":"DMX3","label":"DMX 3","group":"8fc5a5bf.97fba8","order":3,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"255","step":1,"x":1075,"y":325.5,"wires":[["27f55b51.ba2264"]]},{"id":"1c1436c6.c529a9","type":"change","z":"3b6c97c6.3d4888","name":"save to Global DMX1","rules":[{"t":"set","p":"dmx_preset[0]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1279,"y":250.5,"wires":[[]]},{"id":"9f15bcef.9755f","type":"change","z":"3b6c97c6.3d4888","name":"save to Global DMX2","rules":[{"t":"set","p":"dmx_preset[1]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1279,"y":288.5,"wires":[[]]},{"id":"27f55b51.ba2264","type":"change","z":"3b6c97c6.3d4888","name":"save to Global DMX3","rules":[{"t":"set","p":"dmx_preset[2]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1277,"y":326.5,"wires":[[]]},{"id":"4b3d9f7e.a5059","type":"change","z":"3b6c97c6.3d4888","name":"save to Global DMX4","rules":[{"t":"set","p":"dmx_preset[3]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1277,"y":363.5,"wires":[[]]},{"id":"e8e9117f.4adb6","type":"change","z":"3b6c97c6.3d4888","name":"save to Global DMX5","rules":[{"t":"set","p":"dmx_preset[4]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1275,"y":401.5,"wires":[[]]},{"id":"c4d4e44d.99f888","type":"change","z":"3b6c97c6.3d4888","name":"save to Global DMX6","rules":[{"t":"set","p":"dmx_preset[5]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1276,"y":439.5,"wires":[[]]},{"id":"41740032.36ee","type":"change","z":"3b6c97c6.3d4888","name":"save to Global DMX7","rules":[{"t":"set","p":"dmx_preset[6]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1274,"y":477.5,"wires":[[]]},{"id":"c3483667.b8c548","type":"change","z":"3b6c97c6.3d4888","name":"save to Global DMX8","rules":[{"t":"set","p":"dmx_preset[7]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1273,"y":513.5,"wires":[[]]},{"id":"3169fb5e.de26b4","type":"change","z":"3b6c97c6.3d4888","name":"save to Global DMX9","rules":[{"t":"set","p":"dmx_preset[8]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1273,"y":550.5,"wires":[[]]},{"id":"6f089c0c.6a93e4","type":"change","z":"3b6c97c6.3d4888","name":"save to Global DMX10","rules":[{"t":"set","p":"dmx_preset[9]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1271,"y":588.5,"wires":[[]]},{"id":"74e7dd9d.322584","type":"change","z":"3b6c97c6.3d4888","name":"save to Global DMX11","rules":[{"t":"set","p":"dmx_preset[10]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1274,"y":626.5,"wires":[[]]},{"id":"1618c3a4.a2c88c","type":"change","z":"3b6c97c6.3d4888","name":"save to Global DMX12","rules":[{"t":"set","p":"dmx_preset[11]","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1270,"y":664.5,"wires":[[]]},{"id":"b54a9919.7a8758","type":"function","z":"3b6c97c6.3d4888","name":"Just get preset","func":"global.set(\"dmx_preset\", msg.payload.payload);\n\nvar preset = [];\nvar m = [];\npreset = global.get(\"dmx_preset\");\n\n\nfor (var i=0;i<12;i++)\n{\n m[i] = { payload: preset[i] };\n}\nreturn m;\n","outputs":12,"noerr":0,"x":878,"y":308.5,"wires":[["e65ceccc.17115"],["e7420806.bf4398"],["f2c6164e.f34128"],["77ca45d0.8a01fc"],["6dbb7189.cc221"],["51da304f.d9d81"],["9a8343c2.e3745"],["ee135468.6fcb38"],["720fe0eb.d0b7e"],["39e9a69c.6829ba"],["49bb5848.d54af8"],["9d6f6a49.5cb768"]]},{"id":"917485d5.4e6ad8","type":"function","z":"3b6c97c6.3d4888","name":"insert preset","func":"var preset = [];\npreset = global.get(\"dmx_preset\");\nvar newMsg = {};\nnewMsg.collection = 'dmx_presets';\nnewMsg.payload = [\n {topic: msg.payload},\n {\n \"$set\": {\n \"payload\": preset\n }\n },\n {upsert:true}\n];\n\nreturn newMsg;\n","outputs":1,"noerr":0,"x":375,"y":21.5,"wires":[["22a0cc81.e1a404"]]},{"id":"22a0cc81.e1a404","type":"mongodb2 in","z":"3b6c97c6.3d4888","service":"_ext_","configNode":"10b19456.f31fac","name":"Store Data into MongoDB","collection":"dmx_presets","operation":"findOneAndUpdate","x":586,"y":22.5,"wires":[["b0b8834.0e2e48","6af7b445.7848cc"]]},{"id":"b7c1c4b9.501e08","type":"function","z":"3b6c97c6.3d4888","name":"init global variables","func":"global.set(\"dmx_preset\",[0,0,0,0,0,0,0,0,0,0,0,0]); \nmsg.payload = global.get(\"dmx_preset\");\nreturn msg;","outputs":1,"noerr":0,"x":394,"y":436.5,"wires":[["bccf97bc.c7e018","cebc1d43.6453c"]]},{"id":"947363fa.75328","type":"inject","z":"3b6c97c6.3d4888","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":199,"y":437,"wires":[["b7c1c4b9.501e08"]]},{"id":"bccf97bc.c7e018","type":"debug","z":"3b6c97c6.3d4888","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":601,"y":436.5,"wires":[]},{"id":"a07aeb12.03b5e8","type":"debug","z":"3b6c97c6.3d4888","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":600,"y":518.5,"wires":[]},{"id":"f29c8fdc.eac68","type":"function","z":"3b6c97c6.3d4888","name":"check global preset","func":"msg.payload = global.get(\"dmx_preset\");\nreturn msg;","outputs":1,"noerr":0,"x":393,"y":519.5,"wires":[["a07aeb12.03b5e8","cebc1d43.6453c"]]},{"id":"1e9c87a6.95e578","type":"inject","z":"3b6c97c6.3d4888","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":192,"y":514,"wires":[["f29c8fdc.eac68"]]},{"id":"cebc1d43.6453c","type":"function","z":"3b6c97c6.3d4888","name":"Reset from global","func":"var preset = [];\nvar m = [];\npreset = global.get(\"dmx_preset\");\n\n\nfor (var i=0;i<12;i++)\n{\n m[i] = { payload: preset[i] };\n}\nreturn m;\n","outputs":12,"noerr":0,"x":842.5,"y":528.5,"wires":[["e65ceccc.17115"],["e7420806.bf4398"],["f2c6164e.f34128"],["77ca45d0.8a01fc"],["6dbb7189.cc221"],["51da304f.d9d81"],["9a8343c2.e3745"],["ee135468.6fcb38"],["720fe0eb.d0b7e"],["39e9a69c.6829ba"],["49bb5848.d54af8"],["9d6f6a49.5cb768"]]},{"id":"6af7b445.7848cc","type":"function","z":"3b6c97c6.3d4888","name":"DASHBOARD FORMATTING","func":"var dashboardLog = context.get('dashboardLog')|| [];\n\ndashboardLog.push(msg);\nif (dashboardLog.length > 20){\n // Supprime le plus anciens message si > 20\n // Delete oldest message if > 20\n dashboardLog.shift();\n dashboardLog.length = 20;\n} \n\n// Enregistre les messages du dashboard pour le prochain affichage\n// store the value back\ncontext.set('dashboardLog',dashboardLog);\n\n// Affiche le journal des messages\n// make it part of the outgoing msg object\nmsg = {};\nmsg.payload = dashboardLog;\nreturn msg;\n","outputs":1,"noerr":0,"x":1549,"y":231.5,"wires":[["31686c0f.8b5064"]]},{"id":"e65ceccc.17115","type":"ui_slider","z":"3b6c97c6.3d4888","name":"DMX1","label":"DMX 1","group":"8fc5a5bf.97fba8","order":1,"width":0,"height":0,"passthru":true,"topic":"Slider","min":0,"max":"255","step":1,"x":1077,"y":250.5,"wires":[["1c1436c6.c529a9"]]},{"id":"3e7b4f5.567e3b","type":"mongodb2 in","z":"3b6c97c6.3d4888","service":"_ext_","configNode":"10b19456.f31fac","name":"Mongo DB dynamic operation","collection":"dmx_presets","operation":"","x":496,"y":142.5,"wires":[["b355794f.377df8"]]},{"id":"b0b8834.0e2e48","type":"function","z":"3b6c97c6.3d4888","name":"findOne","func":"var newMsg = {};\nnewMsg.operation = 'find.toArray';\nnewMsg.payload = {};\nreturn newMsg;","outputs":1,"noerr":0,"x":262,"y":139.5,"wires":[["3e7b4f5.567e3b"]]},{"id":"18c333e1.15034c","type":"ui_dropdown","z":"3b6c97c6.3d4888","name":"Recall Pulldown","label":"Recall","place":"Select option","group":"9398d2a.468cc3","order":2,"width":0,"height":0,"passthru":false,"options":[],"payload":"","topic":"","x":976,"y":68.5,"wires":[["b54a9919.7a8758","6af7b445.7848cc","e0d633af.d2b9d"]]},{"id":"b355794f.377df8","type":"function","z":"3b6c97c6.3d4888","name":"Format Preset Pulldown","func":"//var preset_array = msg.payload;\nvar msg_array = [];\nfor (var i=0; i< msg.payload.length; i++)\n{\n var tmp_object = {};\n var msg_object = msg.payload[i];\n if (msg_object.topic != undefined){\n tmp_object[msg_object.topic] = {\"topic\": msg_object.topic, \"payload\": msg_object.payload};\n msg_array[i] = tmp_object;\n }\n}\nmsg.options = msg_array;\nreturn msg;","outputs":1,"noerr":0,"x":778,"y":142,"wires":[["18c333e1.15034c"]]},{"id":"1e424502.1ba1cb","type":"inject","z":"3b6c97c6.3d4888","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":113,"y":138,"wires":[["b0b8834.0e2e48"]]},{"id":"fa7ffe59.72c09","type":"ui_text_input","z":"3b6c97c6.3d4888","name":"","label":"Edit Preset Name","group":"9398d2a.468cc3","order":4,"width":0,"height":0,"passthru":true,"mode":"text","delay":"300","topic":"","x":1359,"y":65.5,"wires":[["bf16f4bb.81cfe8"]]},{"id":"d467c5f5.33f828","type":"ui_button","z":"3b6c97c6.3d4888","name":"Save","group":"9398d2a.468cc3","order":5,"width":0,"height":0,"passthru":false,"label":"Save Preset","color":"#FFF","bgcolor":"#FF0000","icon":"","payload":"","payloadType":"date","topic":"","x":55,"y":20,"wires":[["8c54d5c0.b272a8"]]},{"id":"bf16f4bb.81cfe8","type":"function","z":"3b6c97c6.3d4888","name":"set global preset name","func":"global.set(\"preset_name\", msg.payload);","outputs":1,"noerr":0,"x":1519,"y":65.5,"wires":[[]]},{"id":"8c54d5c0.b272a8","type":"function","z":"3b6c97c6.3d4888","name":"save preset","func":"msg.payload = global.get(\"preset_name\");\nreturn msg;","outputs":1,"noerr":0,"x":207,"y":20.5,"wires":[["917485d5.4e6ad8"]]},{"id":"e0d633af.d2b9d","type":"function","z":"3b6c97c6.3d4888","name":"get preset name","func":"msg.payload = msg.payload.topic;\nreturn msg;","outputs":1,"noerr":0,"x":1164,"y":67,"wires":[["fa7ffe59.72c09"]]},{"id":"1da0dc71.decd14","type":"ui_text","z":"3b6c97c6.3d4888","group":"9398d2a.468cc3","order":3,"width":0,"height":0,"name":"","label":"SAVE PRESET","format":"{{msg.payload}}","layout":"row-left","x":231,"y":271.5,"wires":[]},{"id":"d867d0ce.0e55e","type":"ui_text","z":"3b6c97c6.3d4888","group":"9398d2a.468cc3","order":1,"width":0,"height":0,"name":"","label":"RECALL PRESET","format":"{{msg.payload}}","layout":"row-left","x":241,"y":193.5,"wires":[]},{"id":"bb9adb8d.10be78","type":"function","z":"3b6c97c6.3d4888","name":"delete preset","func":"var newMsg = {};\nnewMsg.operation = 'deleteOne';\nnewMsg.payload = {'topic' : msg.payload};\nreturn newMsg;","outputs":1,"noerr":0,"x":376,"y":80.5,"wires":[["cd64e91b.5591a8"]]},{"id":"cd64e91b.5591a8","type":"mongodb2 in","z":"3b6c97c6.3d4888","service":"_ext_","configNode":"10b19456.f31fac","name":"Store Data into MongoDB","collection":"dmx_presets","operation":"","x":587,"y":81.5,"wires":[["b0b8834.0e2e48","6af7b445.7848cc"]]},{"id":"74c45ff0.af533","type":"ui_button","z":"3b6c97c6.3d4888","name":"Delete","group":"9398d2a.468cc3","order":5,"width":0,"height":0,"passthru":false,"label":"Delete Preset","color":"#FFF","bgcolor":"#FF00FF","icon":"","payload":"","payloadType":"date","topic":"","x":56,"y":79,"wires":[["dd9efda9.1f917"]]},{"id":"dd9efda9.1f917","type":"function","z":"3b6c97c6.3d4888","name":"delete preset","func":"msg.payload = global.get(\"preset_name\");\nreturn msg;","outputs":1,"noerr":0,"x":208,"y":79.5,"wires":[["bb9adb8d.10be78"]]},{"id":"58439175.ff9d1","type":"ui_group","z":"3b6c97c6.3d4888","name":"DMX LOG","tab":"45caa18f.53906","order":4,"disp":true,"width":"6","collapse":true},{"id":"8fc5a5bf.97fba8","type":"ui_group","z":"","name":"DMX SLIDERS","tab":"45caa18f.53906","order":3,"disp":true,"width":"8","collapse":true},{"id":"10b19456.f31fac","type":"mongodb2","z":"","uri":"mongodb://127.0.0.1:27017/cinebrain","name":"cinebrain db","options":"","parallelism":"-1"},{"id":"9398d2a.468cc3","type":"ui_group","z":"","name":"PRESETS","tab":"45caa18f.53906","order":1,"disp":false,"width":"6","collapse":false},{"id":"45caa18f.53906","type":"ui_tab","z":"","name":"KCAT DMX DASHBOARD","icon":"home","order":2}]