Refactor reactor constructors to accept a config object for improved clarity and maintainability
This commit is contained in:
@@ -99,22 +99,10 @@ class nodeClass {
|
||||
|
||||
switch (this.config.reactor_type) {
|
||||
case "CSTR":
|
||||
new_reactor = new Reactor_CSTR(
|
||||
this.config.volume,
|
||||
this.config.n_inlets,
|
||||
this.config.kla,
|
||||
this.config.initialState
|
||||
);
|
||||
new_reactor = new Reactor_CSTR(this.config);
|
||||
break;
|
||||
case "PFR":
|
||||
new_reactor = new Reactor_PFR(
|
||||
this.config.volume,
|
||||
this.config.length,
|
||||
this.config.resolution_L,
|
||||
this.config.n_inlets,
|
||||
this.config.kla,
|
||||
this.config.initialState
|
||||
);
|
||||
new_reactor = new Reactor_PFR(this.config);
|
||||
break;
|
||||
default:
|
||||
console.warn("Unknown reactor type: " + uiConfig.reactor_type);
|
||||
|
||||
Reference in New Issue
Block a user