Skip to content

Commit

Permalink
reworked output
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypnos3 committed May 5, 2020
1 parent 16d2760 commit aef6cc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
15 changes: 2 additions & 13 deletions nodes/time-comp.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,8 @@ module.exports = function (RED) {
throw new Error('could not evaluate ' + config.result1ValueType + '.' + config.result1Value);
} else if (resultObj.error) {
node.error('error on getting result: ' + resultObj.error);
} else if (config.result1Type === 'msgPayload') {
msg.payload = resultObj;
} else if (config.result1Type === 'msgTs') {
msg.ts = resultObj;
} else if (config.result1Type === 'msgLc') {
msg.lc = resultObj;
} else if (config.result1Type === 'msgValue') {
msg.value = resultObj;
} else if (config.result1Type === 'msg') {
RED.util.setMessageProperty(msg, config.result1Value, resultObj, true);
} else if (config.result1Type === 'flow' || config.result1Type === 'global') {
const contextKey = RED.util.parseContextStore(config.result1Value);
node.context()[config.result1Type].set(contextKey.key, resultObj, contextKey.store);
} else {
node.positionConfig.setMessageProp(this, msg, config.result1Type, config.result1, resultObj);
}
}

Expand Down
15 changes: 2 additions & 13 deletions nodes/time-span.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,19 +353,8 @@ module.exports = function (RED) {
throw new Error('could not evaluate ' + config.result1ValueType + '.' + config.result1Value);
} else if (resultObj.error) {
node.error('error on getting result: ' + resultObj.error);
} else if (config.result1Type === 'msgPayload') {
msg.payload = resultObj;
} else if (config.result1Type === 'msgTs') {
msg.ts = resultObj;
} else if (config.result1Type === 'msgLc') {
msg.lc = resultObj;
} else if (config.result1Type === 'msgValue') {
msg.value = resultObj;
} else if (config.result1Type === 'msg') {
RED.util.setMessageProperty(msg, config.result1, resultObj);
} else if (config.result1Type === 'flow' || config.result1Type === 'global') {
const contextKey = RED.util.parseContextStore(config.result1);
node.context()[config.result1Type].set(contextKey.key, resultObj, contextKey.store);
} else {
node.positionConfig.setMessageProp(this, msg, config.result1Type, config.result1, resultObj);
}
}

Expand Down

0 comments on commit aef6cc4

Please sign in to comment.