Add position field and proper logging configuration
This commit is contained in:
@@ -107,6 +107,11 @@
|
|||||||
window.EVOLV.nodes['advancedReactor'].loggerMenu.saveEditor(this);
|
window.EVOLV.nodes['advancedReactor'].loggerMenu.saveEditor(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// save position field
|
||||||
|
if (window.EVOLV?.nodes?.measurement?.positionMenu?.saveEditor) {
|
||||||
|
window.EVOLV.nodes.rotatingMachine.positionMenu.saveEditor(this);
|
||||||
|
}
|
||||||
|
|
||||||
let volume = parseFloat($("#node-input-volume").typedInput("value"));
|
let volume = parseFloat($("#node-input-volume").typedInput("value"));
|
||||||
if (isNaN(volume) || volume <= 0) {
|
if (isNaN(volume) || volume <= 0) {
|
||||||
RED.notify("Fluid volume not set correctly", {type: "error"});
|
RED.notify("Fluid volume not set correctly", {type: "error"});
|
||||||
@@ -215,6 +220,10 @@
|
|||||||
<!-- Logger fields injected here -->
|
<!-- Logger fields injected here -->
|
||||||
<div id="logger-fields-placeholder"></div>
|
<div id="logger-fields-placeholder"></div>
|
||||||
|
|
||||||
|
<!-- Position fields will be injected here -->
|
||||||
|
<div id="position-fields-placeholder"></div>
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" data-help-name="advancedReactor">
|
<script type="text/html" data-help-name="advancedReactor">
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module.exports = function (RED) {
|
|||||||
// Serve /advancedReactor/menu.js
|
// Serve /advancedReactor/menu.js
|
||||||
RED.httpAdmin.get(`/${nameOfNode}/menu.js`, (req, res) => {
|
RED.httpAdmin.get(`/${nameOfNode}/menu.js`, (req, res) => {
|
||||||
try {
|
try {
|
||||||
const script = menuMgr.createEndpoint(nameOfNode, ['logger']);
|
const script = menuMgr.createEndpoint(nameOfNode, ['logger', 'position']);
|
||||||
res.type('application/javascript').send(script);
|
res.type('application/javascript').send(script);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
res.status(500).send(`// Error generating menu: ${err.message}`);
|
res.status(500).send(`// Error generating menu: ${err.message}`);
|
||||||
|
|||||||
@@ -73,9 +73,14 @@ class nodeClass {
|
|||||||
general: {
|
general: {
|
||||||
name: uiConfig.name || this.name,
|
name: uiConfig.name || this.name,
|
||||||
id: this.node.id,
|
id: this.node.id,
|
||||||
unit: null
|
unit: null,
|
||||||
|
logging: {
|
||||||
|
enabled: uiConfig.enableLog,
|
||||||
|
logLevel: uiConfig.logLevel
|
||||||
|
}
|
||||||
},
|
},
|
||||||
functionality: {
|
functionality: {
|
||||||
|
positionVsParent: uiConfig.positionVsParent || 'atEquipment', // Default to 'atEquipment' if not specified
|
||||||
softwareType: "reactor" // should be set in config manager
|
softwareType: "reactor" // should be set in config manager
|
||||||
},
|
},
|
||||||
reactor_type: uiConfig.reactor_type,
|
reactor_type: uiConfig.reactor_type,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class Reactor {
|
|||||||
constructor(config) {
|
constructor(config) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
// EVOLV stuff
|
// EVOLV stuff
|
||||||
this.logger = new logger(undefined, undefined, config.general.name);
|
this.logger = new logger(this.config.general.logging.enabled, this.config.general.logging.logLevel, config.general.name);
|
||||||
this.emitter = new EventEmitter();
|
this.emitter = new EventEmitter();
|
||||||
this.measurements = new MeasurementContainer();
|
this.measurements = new MeasurementContainer();
|
||||||
this.upstreamReactor = null;
|
this.upstreamReactor = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user