From ef6e719bd44994454f523c80114731d589a0cf7b Mon Sep 17 00:00:00 2001 From: Mehmet YILMAZ <74335105+mehmet-yilmaz@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:49:22 +0200 Subject: [PATCH 01/10] Matrix Type Added --- emberplus.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/emberplus.html b/emberplus.html index d2d2a9b..af76acb 100755 --- a/emberplus.html +++ b/emberplus.html @@ -7,7 +7,8 @@ server: { value: "", type: "emberplus-server" }, path: { value: "", required: false }, read: { value: true, required: false }, - outputMode: { value: "value", required: true } + outputMode: { value: "value", required: true }, + matrixType: {value: "", required: true} }, inputs: 1, outputs: 1, @@ -61,6 +62,11 @@ +
+ + > +
@@ -124,4 +130,4 @@

References

- \ No newline at end of file + From c839daa9bccde9f6217cb666f31b308116191947 Mon Sep 17 00:00:00 2001 From: Mehmet YILMAZ <74335105+mehmet-yilmaz@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:01:26 +0200 Subject: [PATCH 02/10] Matrix Added --- emberplus.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/emberplus.js b/emberplus.js index 072f395..407f27a 100755 --- a/emberplus.js +++ b/emberplus.js @@ -99,13 +99,7 @@ module.exports = function (RED) { } const element = await node.client.getElementByPathAsync(node.path); const p = (payload.full != undefined && payload.full.path != undefined) ? payload.full.path : node.path; - if (element.isParameter()) { - const v = (payload.full != undefined && payload.full.value != undefined) ? payload.full.value : payload; - if (element.value != v) { - this.log(`Sending new value ${v} to parameter ${element.path}`); - await node.client.setValueAsync(element, v); - } - } else if (element.isFunction()) { + if (element.isFunction()) { /** * @type {NodeRedFunctionArgs}[] */ @@ -114,6 +108,14 @@ module.exports = function (RED) { const invokeResult = await node.client.invokeFunctionAsync(element, args.map(convertArg)); this.log(`Received fonction ${element.path} result ${JSON.stringify(invokeResult.toJSON())}`); updateOutput(invokeResult, send); + } else { + const v = (payload.full != undefined && payload.full.value != undefined) ? payload.full.value : payload; + if (element.isParameter() && element.value != v) { + this.log(`Sending new value ${v} to parameter ${element.path}`); + await node.client.setValueAsync(element, v); + } else if(element.isMatrix()) { + await node.client.matrixConnect(element, v.target, v.sources); + } } } catch(e) { if (done) { From 83d841f04dea60232abff4630c6e6b32400f0e27 Mon Sep 17 00:00:00 2001 From: Mehmet YILMAZ <74335105+mehmet-yilmaz@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:08:56 +0200 Subject: [PATCH 03/10] Matrix Added --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index e6f9494..3ac80e3 100755 --- a/README.md +++ b/README.md @@ -35,6 +35,20 @@ true {"full":{"path":"0.1.0","value":true}} ``` +For a Matrix node, that input pin is used to pass connection to establish the matrix connection on the ember server. +The message payload types are: +- msg.payload takes the matrix connection object as a value to set to the specified node path. Example: +``` +{ + "target": number, // matrix destination port number + "sources": number[] // Array of sources would be activated on the ember server. +} +``` +- msg.payload contains path and value to the specified node. Example: +``` +{"full":{"path":"0.1.0","value":{"target": 1, "sources": [2]}}} +``` + For a Function node, the input pin is used to pass parameters to invoke the function from the ember server. The message payload types are: - msg.payload.args takes a javascript object containing the list of args for the function From 3817a104cd1520f16925bbfbedc2c80178d6b620 Mon Sep 17 00:00:00 2001 From: Mehmet YILMAZ <74335105+mehmet-yilmaz@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:18:43 +0200 Subject: [PATCH 04/10] AddMatrix --- emberplus-server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emberplus-server.js b/emberplus-server.js index 62c7637..c8e344a 100755 --- a/emberplus-server.js +++ b/emberplus-server.js @@ -39,7 +39,7 @@ module.exports = function (RED) { * @param {EmberLib.Element} element */ async function getEmberChildren(element) { - if (element.isParameter()) { + if (element.isParameter() || element.isMatrix()) { node.paths.push({ "path": element.path, "id": element.path + ":/" + element.identifier + "->" + (element.description ? element.description : element.value) }); } else if (element.isFunction()) { node.paths.push({ "path": element.path, "id": element.path + ":/" + element.identifier + "->" + getFunctionDescriptor(element) }); From 5f1384ada7c617112ad30cc4f81697acdd851b09 Mon Sep 17 00:00:00 2001 From: Mehmet YILMAZ <74335105+mehmet-yilmaz@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:19:36 +0200 Subject: [PATCH 05/10] Typo Fix --- emberplus.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emberplus.html b/emberplus.html index af76acb..758d4c2 100755 --- a/emberplus.html +++ b/emberplus.html @@ -64,7 +64,7 @@
-
From fb4300d9385caa55ebebd962f00ad8e1c3bc248e Mon Sep 17 00:00:00 2001 From: Mehmet YILMAZ <74335105+mehmet-yilmaz@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:45:40 +0200 Subject: [PATCH 06/10] Matrix Connection Fixed with Async Method --- emberplus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emberplus.js b/emberplus.js index 407f27a..5b2b6b8 100755 --- a/emberplus.js +++ b/emberplus.js @@ -114,7 +114,7 @@ module.exports = function (RED) { this.log(`Sending new value ${v} to parameter ${element.path}`); await node.client.setValueAsync(element, v); } else if(element.isMatrix()) { - await node.client.matrixConnect(element, v.target, v.sources); + await node.client.matrixConnectAsync(element, v.target, v.sources); } } } catch(e) { From 3e33c865af86a030be5232c3a2366cbd6d0e5958 Mon Sep 17 00:00:00 2001 From: Mehmet YILMAZ <74335105+mehmet-yilmaz@users.noreply.github.com> Date: Tue, 24 Sep 2024 21:06:25 +0200 Subject: [PATCH 07/10] Matrix for Field canceled --- emberplus.html | 5 ----- 1 file changed, 5 deletions(-) diff --git a/emberplus.html b/emberplus.html index 758d4c2..f79306d 100755 --- a/emberplus.html +++ b/emberplus.html @@ -62,11 +62,6 @@ -
- - -
From 0bd10375342f6fe4b6719d2abddaf5253db140e7 Mon Sep 17 00:00:00 2001 From: Mehmet YILMAZ <74335105+mehmet-yilmaz@users.noreply.github.com> Date: Wed, 25 Sep 2024 00:12:49 +0200 Subject: [PATCH 08/10] Matrix Form Element Deleted --- emberplus.html => Matrix Form Element Deleted | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename emberplus.html => Matrix Form Element Deleted (98%) diff --git a/emberplus.html b/Matrix Form Element Deleted similarity index 98% rename from emberplus.html rename to Matrix Form Element Deleted index f79306d..ab0ad2f 100755 --- a/emberplus.html +++ b/Matrix Form Element Deleted @@ -7,8 +7,7 @@ server: { value: "", type: "emberplus-server" }, path: { value: "", required: false }, read: { value: true, required: false }, - outputMode: { value: "value", required: true }, - matrixType: {value: "", required: true} + outputMode: { value: "value", required: true } }, inputs: 1, outputs: 1, From 991d8e674f6194c9de4f3a55513a1da51f36c049 Mon Sep 17 00:00:00 2001 From: Mehmet YILMAZ Date: Fri, 6 Dec 2024 11:54:32 +0000 Subject: [PATCH 09/10] emberplus.html filename fixed --- Matrix Form Element Deleted => emberplus.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Matrix Form Element Deleted => emberplus.html (100%) diff --git a/Matrix Form Element Deleted b/emberplus.html similarity index 100% rename from Matrix Form Element Deleted rename to emberplus.html From a4e3e0687dbfed93ad1eacbea0c6d3e123921f63 Mon Sep 17 00:00:00 2001 From: Mehmet YILMAZ Date: Fri, 6 Dec 2024 12:10:19 +0000 Subject: [PATCH 10/10] Image paths fixed --- README.md | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3ac80e3..b284059 100755 --- a/README.md +++ b/README.md @@ -1,82 +1,102 @@ # node-red-contrib-ember + Simple Ember+ client node for broadcast automation (LAWO, DHD, etc.). Ember+ is open source and implemented in hard- and software products. More information can be found here: [Ember+ control protocol](https://github.com/Lawo/ember-plus/wiki) ## install + Inside your node-red directory, install the NPM node-red-contrib-ember package. ``` npm install node-red-contrib-ember ``` -## emberplus-server node +## emberplus-server node + First of all there is at least one emberplus-server node to be configured. Simply set an IP address and a port (usually 9000). It is possible to add several emberplus-server nodes for different targets (for example all your audio mixers). Optionally, provide a coma separated list of paths to limit the tree. If no path provided, the tool will download the entire tree - this could take a long time if the tree is really big. -![Select/Create an Ember connection](https://github.com/dufourgilles/node-red-contrib-emberplus/blob/master/images/ember_node_start.png) +![Select/Create an Ember connection](./images/ember_node_start.png) -![Define a new Ember connection](https://github.com/dufourgilles/node-red-contrib-emberplus/blob/master/images/server_create.png) +![Define a new Ember connection](./images/server_create.png) ## emberplus node + Each emberplus node is associated with a previously configured emberplus-server node. Further an object path can be selected if the node should subscribe a specific object in the Ember+ tree. If you don't know the path, click on the looking glass symbol on the right. -![Create your node](https://github.com/dufourgilles/node-red-contrib-emberplus/blob/master/images/ember_node_create.png) +![Create your node](./images/ember_node_create.png) ### Input Pin + The input pin of the node takes different type of message payloads. For a Parameter node, the message payload is used to set the value of the parameter. The two types of message payloads are: -- msg.payload takes the plain value to be set to the specified path. Example: + +- msg.payload takes the plain value to be set to the specified path. Example: + ``` true ``` + - msg.payload contains path and value to the specified node. Example: + ``` {"full":{"path":"0.1.0","value":true}} ``` For a Matrix node, that input pin is used to pass connection to establish the matrix connection on the ember server. The message payload types are: + - msg.payload takes the matrix connection object as a value to set to the specified node path. Example: + ``` { "target": number, // matrix destination port number "sources": number[] // Array of sources would be activated on the ember server. } ``` + - msg.payload contains path and value to the specified node. Example: + ``` {"full":{"path":"0.1.0","value":{"target": 1, "sources": [2]}}} ``` For a Function node, the input pin is used to pass parameters to invoke the function from the ember server. The message payload types are: + - msg.payload.args takes a javascript object containing the list of args for the function + ``` [{"type":1,"value":17},{"type":1,"value":88}] ``` + - msg.payload takes a JSON object string that will be parsed to create the javascript object. -The string should be similar to the obejct above. + The string should be similar to the obejct above. The argument types are + ``` 1 integer 2 real 3 string ``` -![Inject a function](https://github.com/dufourgilles/node-red-contrib-emberplus/blob/master/images/function_inject.png) +![Inject a function](./images/function_inject.png) -![Inject a parameter](https://github.com/dufourgilles/node-red-contrib-emberplus/blob/master/images/parameter_inject.png) +![Inject a parameter](./images/parameter_inject.png) ### Output Pin + The data format of the output pin can be configured: + - plain: msg.payload contains the plain value from the Ember+ object -- contents: msg.payload.contents contains the contents Ember+ object from the underlying node-emberplus client +- contents: msg.payload.contents contains the contents Ember+ object from the underlying node-emberplus client - full: msg.payload.full contains the full Ember+ object from the underlying node-emberplus (including the device path) - json: msg.payload contains a JSON object representing the ember element. For function element, the output is always the response to the invokation of the function. + ``` {"invocationId":2,"success":true,"result":[{"type":"integer","value":105}]} ```