From 1ca6a199d4557b3bc30a17e9b333674beba8131c Mon Sep 17 00:00:00 2001 From: Jean-Christian Paul Denis Date: Sat, 27 Apr 2024 13:24:08 +0200 Subject: [PATCH] Delete src directory --- src/K_Routine/minute_to_HH_mm.js | 7 --- src/Kernel/check_device.js | 42 ------------- src/Kernel/check_device2.js | 34 ----------- src/Kernel/check_device2_finalizejs | 1 - src/Kernel/check_device2_initializejs | 1 - src/Kernel/check_device_finalizejs | 1 - src/Kernel/check_device_initializejs | 1 - src/Kernel/check_metric.js | 50 ---------------- src/Kernel/set_gate_message.js | 11 ---- src/Kernel/set_gate_message2.js | 11 ---- src/Kernel/set_gate_message2_finalizejs | 1 - src/Kernel/set_gate_message2_initializejs | 1 - src/Kernel/set_gate_message_finalizejs | 1 - src/Kernel/set_gate_message_initializejs | 1 - src/manifest.json | 72 ----------------------- 15 files changed, 235 deletions(-) delete mode 100644 src/K_Routine/minute_to_HH_mm.js delete mode 100644 src/Kernel/check_device.js delete mode 100644 src/Kernel/check_device2.js delete mode 100644 src/Kernel/check_device2_finalizejs delete mode 100644 src/Kernel/check_device2_initializejs delete mode 100644 src/Kernel/check_device_finalizejs delete mode 100644 src/Kernel/check_device_initializejs delete mode 100644 src/Kernel/check_metric.js delete mode 100644 src/Kernel/set_gate_message.js delete mode 100644 src/Kernel/set_gate_message2.js delete mode 100644 src/Kernel/set_gate_message2_finalizejs delete mode 100644 src/Kernel/set_gate_message2_initializejs delete mode 100644 src/Kernel/set_gate_message_finalizejs delete mode 100644 src/Kernel/set_gate_message_initializejs delete mode 100644 src/manifest.json diff --git a/src/K_Routine/minute_to_HH_mm.js b/src/K_Routine/minute_to_HH_mm.js deleted file mode 100644 index c7707fb..0000000 --- a/src/K_Routine/minute_to_HH_mm.js +++ /dev/null @@ -1,7 +0,0 @@ -var d = Number(msg.payload); -var h = Math.floor(d / 60); -var m = Math.floor(d % 60); -if (h < 10) { h = h < 5 ? '00' : '0' + h; } -if (m < 10) { m = m < 5 ? '00' : '0' + m; } -msg.payload = h + ':' + m; -return msg; \ No newline at end of file diff --git a/src/Kernel/check_device.js b/src/Kernel/check_device.js deleted file mode 100644 index 01dda35..0000000 --- a/src/Kernel/check_device.js +++ /dev/null @@ -1,42 +0,0 @@ -// Check and recreate clean message of device description -// output 1 : error message -// output 2 : device registration - -// script var -var msg = msg; -var newmsg = {}; - -// no message -if (typeof msg === 'undefined'){ - return [null,null]; -} - -// check possible var existence -if (typeof msg.bucket === 'undefined' || - typeof msg.measurement === 'undefined' || - typeof msg.field === 'undefined' || - typeof msg.format === 'undefined' || - typeof msg.default === 'undefined' -) { - node.status({ - fill: "red", shape: "ring", text: 'undefined device'}); - return [msg,null]; -} - -// recreate msg -newmsg = { - 'bucket': msg.bucket, - 'measurement': msg.measurement, - 'field': msg.field, - 'format': msg.format, - 'path': msg.bucket + '/' + msg.measurement + '/' + msg.field, - 'payload': msg.default, - - 'protocol': typeof msg.protocol === 'undefined' ? '' : msg.protocol, - 'model': typeof msg.model === 'undefined' ? '' : msg.model, - 'id': typeof msg.id === 'undefined' ? '' : msg.id, - 'option': typeof msg.option === 'undefined' ? 0 : msg.option -}; - -node.status({ fill: 'green', shape: "ring", text: newmsg.path + ' = ' + newmsg.payload }); -return [null,newmsg]; \ No newline at end of file diff --git a/src/Kernel/check_device2.js b/src/Kernel/check_device2.js deleted file mode 100644 index f82dfee..0000000 --- a/src/Kernel/check_device2.js +++ /dev/null @@ -1,34 +0,0 @@ -// output 1 : error message -// output 2 : device registration - -// script var -var msg = msg; -var newmsg = {}; - -if (typeof msg === 'undefined'){ - return [null,null]; -} - -// check var existence -if (typeof msg.bucket === 'undefined' || - typeof msg.model === 'undefined' || - typeof msg.id === 'undefined' -) { - node.status({ - fill: "red", shape: "ring", text: 'undefined device'}); - return [msg,null]; -} - -// recreate msg -newmsg = { - 'bucket': msg.bucket, - 'measurement': typeof msg.measurement === 'undefined' ? '' : msg.measurement, - 'field': typeof msg.field === 'undefined' ? '' : msg.field, - 'model': msg.model, - 'option': typeof msg.option === 'undefined' ? 0 : msg.option, - 'id': msg.id, - 'payload':'' -}; - -node.status({ fill: 'green', shape: "ring", text: newmsg.model + ' / ' + newmsg.id }); -return [null,newmsg]; \ No newline at end of file diff --git a/src/Kernel/check_device2_finalizejs b/src/Kernel/check_device2_finalizejs deleted file mode 100644 index 8b13789..0000000 --- a/src/Kernel/check_device2_finalizejs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/Kernel/check_device2_initializejs b/src/Kernel/check_device2_initializejs deleted file mode 100644 index 8b13789..0000000 --- a/src/Kernel/check_device2_initializejs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/Kernel/check_device_finalizejs b/src/Kernel/check_device_finalizejs deleted file mode 100644 index 8b13789..0000000 --- a/src/Kernel/check_device_finalizejs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/Kernel/check_device_initializejs b/src/Kernel/check_device_initializejs deleted file mode 100644 index 8b13789..0000000 --- a/src/Kernel/check_device_initializejs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/Kernel/check_metric.js b/src/Kernel/check_metric.js deleted file mode 100644 index 2a8c3a4..0000000 --- a/src/Kernel/check_metric.js +++ /dev/null @@ -1,50 +0,0 @@ -// output 1 : error message -// output 2 : device registration - -// script var -var msg = msg; -var newmsg = {}; - -// try if msg.topic is a path -if (typeof msg.topic === 'string' && - typeof msg.bucket === 'undefined' && - typeof msg.measurement === 'undefined' && - typeof msg.field === 'undefined' -) { - const device = msg.topic.split('/'); - if (typeof device[1] === 'string' && - typeof device[2] === 'string' && - typeof device[3] === 'string' - ) { - msg.source = device[0]; - msg.bucket = device[1]; - msg.measurement = device[2]; - msg.field = device[3]; - - } -} - -// check var existence -if (typeof msg.bucket === 'undefined' || - typeof msg.measurement === 'undefined' || - typeof msg.field === 'undefined' -) { - node.status({ - fill: "red", shape: "ring", text: 'undefined device'}); - return [msg,null]; -} - -// recreate msg -newmsg = { - 'topic': 'metric', - 'source': typeof msg.source === 'string' ? msg.source : 'unknow', - 'bucket': msg.bucket, - 'measurement': msg.measurement, - 'field': msg.field, - 'path': msg.bucket + '/' + msg.measurement + '/' + msg.field, - 'payload': msg.payload, - 'repeat': typeof msg.repeat === 'boolean' ? msg.repeat : false -}; - -node.status({ fill: 'green', shape: "ring", text: newmsg.source + ' : ' + newmsg.path + ' = ' + newmsg.payload }); -return [null,newmsg]; \ No newline at end of file diff --git a/src/Kernel/set_gate_message.js b/src/Kernel/set_gate_message.js deleted file mode 100644 index 7b5b47f..0000000 --- a/src/Kernel/set_gate_message.js +++ /dev/null @@ -1,11 +0,0 @@ -// script var -var msg = msg; -var newmsg = {}; - -// recreate msg -newmsg = { - 'topic':'gate', - 'payload':'open' -}; - -return newmsg; \ No newline at end of file diff --git a/src/Kernel/set_gate_message2.js b/src/Kernel/set_gate_message2.js deleted file mode 100644 index 60960ba..0000000 --- a/src/Kernel/set_gate_message2.js +++ /dev/null @@ -1,11 +0,0 @@ -// script var -var msg = msg; -var newmsg = {}; - -// recreate msg -newmsg = { - 'topic':'gate', - 'payload': msg.payload -}; - -return newmsg; \ No newline at end of file diff --git a/src/Kernel/set_gate_message2_finalizejs b/src/Kernel/set_gate_message2_finalizejs deleted file mode 100644 index 8b13789..0000000 --- a/src/Kernel/set_gate_message2_finalizejs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/Kernel/set_gate_message2_initializejs b/src/Kernel/set_gate_message2_initializejs deleted file mode 100644 index 8b13789..0000000 --- a/src/Kernel/set_gate_message2_initializejs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/Kernel/set_gate_message_finalizejs b/src/Kernel/set_gate_message_finalizejs deleted file mode 100644 index 8b13789..0000000 --- a/src/Kernel/set_gate_message_finalizejs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/Kernel/set_gate_message_initializejs b/src/Kernel/set_gate_message_initializejs deleted file mode 100644 index 8b13789..0000000 --- a/src/Kernel/set_gate_message_initializejs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/manifest.json b/src/manifest.json deleted file mode 100644 index d9c8d08..0000000 --- a/src/manifest.json +++ /dev/null @@ -1,72 +0,0 @@ -[ - { - "id": "fabb645e0d88c91c", - "property": "func", - "file": "Kernel/check_device.js" - }, - { - "id": "fabb645e0d88c91c", - "property": "initialize", - "file": "Kernel/check_device_initializejs" - }, - { - "id": "fabb645e0d88c91c", - "property": "finalize", - "file": "Kernel/check_device_finalizejs" - }, - { - "id": "2ba23548e87b0292", - "property": "func", - "file": "Kernel/set_gate_message.js" - }, - { - "id": "2ba23548e87b0292", - "property": "initialize", - "file": "Kernel/set_gate_message_initializejs" - }, - { - "id": "2ba23548e87b0292", - "property": "finalize", - "file": "Kernel/set_gate_message_finalizejs" - }, - { - "id": "82229e46e51f94f5", - "property": "func", - "file": "Kernel/check_metric.js" - }, - { - "id": "e6a4e861a99b196c", - "property": "func", - "file": "Kernel/set_gate_message2.js" - }, - { - "id": "e6a4e861a99b196c", - "property": "initialize", - "file": "Kernel/set_gate_message2_initializejs" - }, - { - "id": "e6a4e861a99b196c", - "property": "finalize", - "file": "Kernel/set_gate_message2_finalizejs" - }, - { - "id": "c3d88e1872a9789b", - "property": "func", - "file": "Kernel/check_device2.js" - }, - { - "id": "c3d88e1872a9789b", - "property": "initialize", - "file": "Kernel/check_device2_initializejs" - }, - { - "id": "c3d88e1872a9789b", - "property": "finalize", - "file": "Kernel/check_device2_finalizejs" - }, - { - "id": "0385dd3208b83d41", - "property": "func", - "file": "K_Routine/minute_to_HH_mm.js" - } -] \ No newline at end of file