From 3ad313b4914c313f21311ea92dd2c618273c554f Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Mon, 6 Sep 2021 09:13:20 +0200 Subject: [PATCH] static options ok --- dist/r3.js | 26 +++++++++++++------ package.json | 2 +- src/r3/r3-component/r3-component.js | 2 +- src/r3/r3-r3-object.js | 2 +- src/r3/r3-r3.js | 4 +-- src/r3/r3-system/r3-system-input.js | 2 +- src/r3/r3-system/r3-system-linking.js | 2 +- src/r3/r3-system/r3-system-socket.js | 2 +- src/r3/r3-system/r3-system-test.js | 2 +- src/r3/r3-system/r3-system.js | 7 ++++- .../generated_custom_options_init.template | 2 +- src/templates/system-base.template | 3 ++- version | 2 +- 13 files changed, 37 insertions(+), 21 deletions(-) diff --git a/dist/r3.js b/dist/r3.js index 3c4aa40..64db8ed 100644 --- a/dist/r3.js +++ b/dist/r3.js @@ -1,8 +1,14 @@ class R3 { - static version = '2.0.132'; - static compileDate = '2021 Sep 06 - 08:50:36 am'; + static version = '2.0.136'; + static compileDate = '2021 Sep 06 - 09:13:00 am'; } +/** + + Started=false + + **/ + class System { constructor(options) { @@ -13,6 +19,10 @@ class System { options = {}; } + if (typeof options.started === 'undefined') { + options.started = false; + } + Object.assign(this, options); Event.Emit(Event.OBJECT_INITIALIZED, this); @@ -1612,7 +1622,7 @@ class Utils { Properties: - + - started (Default value false) Methods: @@ -1994,7 +2004,7 @@ class SystemInput extends System { Properties: - + - started (Default value false) Methods: @@ -2172,7 +2182,7 @@ class SystemLinking extends System { Properties: - + - started (Default value false) Methods: @@ -2301,7 +2311,7 @@ class SystemSocket extends System { Properties: - + - started (Default value false) Methods: @@ -2486,7 +2496,7 @@ class R3Object extends Event { this.emit(Event.OBJECT_CREATED, this); - if (typeof options.register === 'undefined')) { + if (typeof options.register === 'undefined') { options.register = true; } @@ -2667,7 +2677,7 @@ class Component extends R3Object { this.emit(Event.OBJECT_CREATED, this); - if (typeof options.runtime === 'undefined')) { + if (typeof options.runtime === 'undefined') { options.runtime = R3.Runtime.DEFAULT; } diff --git a/package.json b/package.json index 9660466..8ec0d96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "r3", - "version" : "2.0.132", + "version" : "2.0.136", "description": "", "private": true, "dependencies": { diff --git a/src/r3/r3-component/r3-component.js b/src/r3/r3-component/r3-component.js index f15e082..f563cc0 100644 --- a/src/r3/r3-component/r3-component.js +++ b/src/r3/r3-component/r3-component.js @@ -120,7 +120,7 @@ class Component extends R3Object { this.emit(Event.OBJECT_CREATED, this); //GENERATED_OPTIONS_INIT_START - if (typeof options.runtime === 'undefined')) { + if (typeof options.runtime === 'undefined') { options.runtime = R3.Runtime.DEFAULT; } //GENERATED_OPTIONS_INIT_END diff --git a/src/r3/r3-r3-object.js b/src/r3/r3-r3-object.js index 1006161..d5a59de 100644 --- a/src/r3/r3-r3-object.js +++ b/src/r3/r3-r3-object.js @@ -91,7 +91,7 @@ class R3Object extends Event { this.emit(Event.OBJECT_CREATED, this); //GENERATED_OPTIONS_INIT_START - if (typeof options.register === 'undefined')) { + if (typeof options.register === 'undefined') { options.register = true; } //GENERATED_OPTIONS_INIT_END diff --git a/src/r3/r3-r3.js b/src/r3/r3-r3.js index 96ad50e..73b3d5c 100644 --- a/src/r3/r3-r3.js +++ b/src/r3/r3-r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '2.0.132'; - static compileDate = '2021 Sep 06 - 08:50:36 am'; + static version = '2.0.136'; + static compileDate = '2021 Sep 06 - 09:13:00 am'; } //GENERATED_IMPORTS_START diff --git a/src/r3/r3-system/r3-system-input.js b/src/r3/r3-system/r3-system-input.js index 65d3bdf..7d35a4b 100644 --- a/src/r3/r3-system/r3-system-input.js +++ b/src/r3/r3-system/r3-system-input.js @@ -11,7 +11,7 @@ const System = require('./r3-system.js'); Properties: - + - started (Default value false) Methods: diff --git a/src/r3/r3-system/r3-system-linking.js b/src/r3/r3-system/r3-system-linking.js index d8a018b..cc74f8c 100644 --- a/src/r3/r3-system/r3-system-linking.js +++ b/src/r3/r3-system/r3-system-linking.js @@ -11,7 +11,7 @@ const System = require('./r3-system.js'); Properties: - + - started (Default value false) Methods: diff --git a/src/r3/r3-system/r3-system-socket.js b/src/r3/r3-system/r3-system-socket.js index 039e969..2832840 100644 --- a/src/r3/r3-system/r3-system-socket.js +++ b/src/r3/r3-system/r3-system-socket.js @@ -11,7 +11,7 @@ const System = require('./r3-system.js'); Properties: - + - started (Default value false) Methods: diff --git a/src/r3/r3-system/r3-system-test.js b/src/r3/r3-system/r3-system-test.js index 1539ddc..4b484c6 100644 --- a/src/r3/r3-system/r3-system-test.js +++ b/src/r3/r3-system/r3-system-test.js @@ -11,7 +11,7 @@ const System = require('./r3-system.js'); Properties: - + - started (Default value false) Methods: diff --git a/src/r3/r3-system/r3-system.js b/src/r3/r3-system/r3-system.js index 2cc0598..069f249 100644 --- a/src/r3/r3-system/r3-system.js +++ b/src/r3/r3-system/r3-system.js @@ -4,9 +4,11 @@ const Utils = require('.././r3-utils'); /** CUSTOM_OPTIONS_START + started=false CUSTOM_OPTIONS_END CUSTOM_STATIC_OPTIONS_START + Started=false CUSTOM_STATIC_OPTIONS_END CUSTOM_METHODS_START @@ -33,6 +35,9 @@ class System { } //GENERATED_OPTIONS_INIT_START + if (typeof options.started === 'undefined') { + options.started = false; + } //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -144,10 +149,10 @@ class System { } //GENERATED_STATIC_OPTIONS_INIT_START +System.Started = false; //GENERATED_STATIC_OPTIONS_INIT_END //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START -System.Started = false; //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END module.exports = System; diff --git a/src/templates/generated_custom_options_init.template b/src/templates/generated_custom_options_init.template index 03699cf..e44bbd6 100644 --- a/src/templates/generated_custom_options_init.template +++ b/src/templates/generated_custom_options_init.template @@ -1,3 +1,3 @@ - if (typeof options.KEY === 'undefined')) { + if (typeof options.KEY === 'undefined') { options.KEY = VALUE; } diff --git a/src/templates/system-base.template b/src/templates/system-base.template index a62bb4c..ae449b4 100644 --- a/src/templates/system-base.template +++ b/src/templates/system-base.template @@ -4,9 +4,11 @@ const Utils = require('INCLUDE_PATH/r3-utils'); /** CUSTOM_OPTIONS_START + started=false CUSTOM_OPTIONS_END CUSTOM_STATIC_OPTIONS_START + Started=false CUSTOM_STATIC_OPTIONS_END CUSTOM_METHODS_START @@ -41,7 +43,6 @@ class CLASS_NAME { //GENERATED_STATIC_OPTIONS_INIT_END //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START -CLASS_NAME.Started = false; //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END module.exports = CLASS_NAME; diff --git a/version b/version index c89c8e3..ff4939c 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.0.132 \ No newline at end of file +2.0.136 \ No newline at end of file