Skip to content

Commit

Permalink
Merge pull request Samsung#15 from D5MI/rename/log-node
Browse files Browse the repository at this point in the history
Rename/log node
  • Loading branch information
Garo-o authored Oct 3, 2022
2 parents 506f633 + 4768589 commit 6614edd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions log/log.html → ...t-detection-log/object-detection-log.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script type="text/javascript">
RED.nodes.registerType("log", {
RED.nodes.registerType("object-detection-log", {
category: 'D5MI',
color: "#03bafc",
defaults: {
Expand All @@ -9,13 +9,13 @@
outputs: 1,
icon: "font-awesome/fa-object-ungroup",
label: function () {
return this.name || "log"
return this.name || "object-detection-log"
},
});
</script>


<script type="text/html" data-template-name="log">
<script type="text/html" data-template-name="object-detection-log">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
Expand All @@ -27,7 +27,7 @@
</div>
</script>

<script type="text/html" data-help-name="log">
<script type="text/html" data-help-name="object-detection-log">
<p>A node that records information of pose and object detected in log file</p>

<h3>Properties</h3>
Expand Down
9 changes: 4 additions & 5 deletions log/log.js → object-detection-log/object-detection-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = function (RED) {

function logNode(config) {
function ObjectDetectionNode(config) {
RED.nodes.createNode(this, config)
var node = this;
const fs = require('fs')
Expand All @@ -11,8 +11,7 @@ module.exports = function (RED) {

let today = new Date();

let date = today.toLocaleString()
msg.payload.Date = date
msg.payload.Date = today
let directory = `${config.logDirectory}`
const isExists = fs.existsSync(directory)
if (!isExists) {
Expand All @@ -25,9 +24,9 @@ module.exports = function (RED) {
if (err) throw err
})

return
return msg.payload
})
}

RED.nodes.registerType("log", logNode);
RED.nodes.registerType("object-detection-log", ObjectDetectionNode);
}
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"object-detection" : "/object_detection/object-detection.js",
"object-detection-iot" : "/object-detection-iot/object-detection-iot.js",
"object-person-determine" : "/object-person-determine/object-person-determine.js",
"log" : "/log/log.js"
"object-detection-log" : "/object-detection-log/object-detection-log.js"
}
},
"author": "",
Expand Down

0 comments on commit 6614edd

Please sign in to comment.