Skip to content
Snippets Groups Projects
Commit 9f4bfdff authored by Sandro Weber's avatar Sandro Weber
Browse files

WIP

parent 82f18930
No related branches found
No related tags found
No related merge requests found
...@@ -7,22 +7,22 @@ const SINGLETON_ENFORCER = Symbol(); ...@@ -7,22 +7,22 @@ const SINGLETON_ENFORCER = Symbol();
/** /**
* Service handling server resources for simulating experiments. * Service handling server resources for simulating experiments.
*/ */
class SimulationToolsService { class ExperimentToolsService {
constructor(enforcer) { constructor(enforcer) {
if (enforcer !== SINGLETON_ENFORCER) { if (enforcer !== SINGLETON_ENFORCER) {
throw new Error('Use ' + this.constructor.name + '.instance'); throw new Error('Use ' + this.constructor.name + '.instance');
} }
this.tools = new Map(); this.tools = new Map();
for (const toolEntry in SimulationToolsService.TOOLS) { for (const toolEntry in ExperimentToolsService.TOOLS) {
this.registerToolConfig(SimulationToolsService.TOOLS[toolEntry]); this.registerToolConfig(ExperimentToolsService.TOOLS[toolEntry]);
} }
this.registerToolConfig(NrpCoreDashboard.CONSTANTS.TOOL_CONFIG); this.registerToolConfig(NrpCoreDashboard.CONSTANTS.TOOL_CONFIG);
} }
static get instance() { static get instance() {
if (_instance == null) { if (_instance == null) {
_instance = new SimulationToolsService(SINGLETON_ENFORCER); _instance = new ExperimentToolsService(SINGLETON_ENFORCER);
} }
return _instance; return _instance;
...@@ -62,7 +62,7 @@ class SimulationToolsService { ...@@ -62,7 +62,7 @@ class SimulationToolsService {
} }
} }
SimulationToolsService.TOOLS = Object.freeze({ ExperimentToolsService.TOOLS = Object.freeze({
NEST_DESKTOP: { NEST_DESKTOP: {
singleton: true, singleton: true,
flexlayoutNode: { flexlayoutNode: {
...@@ -99,11 +99,11 @@ SimulationToolsService.TOOLS = Object.freeze({ ...@@ -99,11 +99,11 @@ SimulationToolsService.TOOLS = Object.freeze({
} }
}); });
SimulationToolsService.CONSTANTS = Object.freeze({ ExperimentToolsService.CONSTANTS = Object.freeze({
CATEGORY: { CATEGORY: {
EXTERNAL_IFRAME: 'EXTERNAL_IFRAME', EXTERNAL_IFRAME: 'EXTERNAL_IFRAME',
REACT_COMPONENT: 'REACT_COMPONENT' REACT_COMPONENT: 'REACT_COMPONENT'
} }
}); });
export default SimulationToolsService; export default ExperimentToolsService;
.leave-simulation-dialog-header { .leave-workbench-dialog-header {
color: black; color: black;
background-color: white; background-color: white;
} }
\ No newline at end of file
...@@ -7,22 +7,22 @@ const SINGLETON_ENFORCER = Symbol(); ...@@ -7,22 +7,22 @@ const SINGLETON_ENFORCER = Symbol();
/** /**
* Service handling server resources for simulating experiments. * Service handling server resources for simulating experiments.
*/ */
class ExperimentToolsService { class SimulationToolsService {
constructor(enforcer) { constructor(enforcer) {
if (enforcer !== SINGLETON_ENFORCER) { if (enforcer !== SINGLETON_ENFORCER) {
throw new Error('Use ' + this.constructor.name + '.instance'); throw new Error('Use ' + this.constructor.name + '.instance');
} }
this.tools = new Map(); this.tools = new Map();
for (const toolEntry in ExperimentToolsService.TOOLS) { for (const toolEntry in SimulationToolsService.TOOLS) {
this.registerToolConfig(ExperimentToolsService.TOOLS[toolEntry]); this.registerToolConfig(SimulationToolsService.TOOLS[toolEntry]);
} }
this.registerToolConfig(NrpCoreDashboard.CONSTANTS.TOOL_CONFIG); this.registerToolConfig(NrpCoreDashboard.CONSTANTS.TOOL_CONFIG);
} }
static get instance() { static get instance() {
if (_instance == null) { if (_instance == null) {
_instance = new ExperimentToolsService(SINGLETON_ENFORCER); _instance = new SimulationToolsService(SINGLETON_ENFORCER);
} }
return _instance; return _instance;
...@@ -62,7 +62,7 @@ class ExperimentToolsService { ...@@ -62,7 +62,7 @@ class ExperimentToolsService {
} }
} }
ExperimentToolsService.TOOLS = Object.freeze({ SimulationToolsService.TOOLS = Object.freeze({
NEST_DESKTOP: { NEST_DESKTOP: {
singleton: true, singleton: true,
flexlayoutNode: { flexlayoutNode: {
...@@ -99,11 +99,11 @@ ExperimentToolsService.TOOLS = Object.freeze({ ...@@ -99,11 +99,11 @@ ExperimentToolsService.TOOLS = Object.freeze({
} }
}); });
ExperimentToolsService.CONSTANTS = Object.freeze({ SimulationToolsService.CONSTANTS = Object.freeze({
CATEGORY: { CATEGORY: {
EXTERNAL_IFRAME: 'EXTERNAL_IFRAME', EXTERNAL_IFRAME: 'EXTERNAL_IFRAME',
REACT_COMPONENT: 'REACT_COMPONENT' REACT_COMPONENT: 'REACT_COMPONENT'
} }
}); });
export default ExperimentToolsService; export default SimulationToolsService;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment