From 0deec453833654da2a5370599e83984239b6eaf8 Mon Sep 17 00:00:00 2001 From: Laura Fuentes Grau Date: Wed, 28 Oct 2020 20:35:39 +0100 Subject: [PATCH] Category and type of IC (in edit and add) are now selectable via drop down menu #266 --- src/ic/edit-ic.js | 41 +++++++++++++++++++++++++++++++++++------ src/ic/new-ic.js | 42 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 71 insertions(+), 12 deletions(-) diff --git a/src/ic/edit-ic.js b/src/ic/edit-ic.js index 9e8fe4a..7386131 100644 --- a/src/ic/edit-ic.js +++ b/src/ic/edit-ic.js @@ -99,6 +99,26 @@ class EditICDialog extends React.Component { } render() { + let typeOptions = []; + switch(this.state.category){ + case "Simulator": + typeOptions = ["Dummy","Generic","DPsim","RTLAB","RSCAD"]; + break; + case "Controller": + typeOptions = ["Kubernetes","VILLAS-controller"]; + break; + case "Gateway": + typeOptions = ["VILLAS-node","VILLAS-relay"]; + break; + case "Service": + typeOptions = ["EMS","Custom"]; + break; + case "Equipment": + typeOptions = ["Chroma-emulator","Chroma-loads","SMA-sunnyboy","FLEPS","Sonnenbatterie"]; + break; + default: + typeOptions =[]; + } return ( - Category (e.g. Simulator, Gateway, ...) - this.handleChange(e)} /> - + Category + this.handleChange(e)}> + + + + + + - Type (e.g. RTDS, VILLASnode, ...) - this.handleChange(e)} /> - + Type + this.handleChange(e)}> + + {typeOptions.map((name,index) => ( + + ))} + Properties diff --git a/src/ic/new-ic.js b/src/ic/new-ic.js index 78c67a8..466ead5 100644 --- a/src/ic/new-ic.js +++ b/src/ic/new-ic.js @@ -116,6 +116,26 @@ class NewICDialog extends React.Component { } render() { + let typeOptions = []; + switch(this.state.category){ + case "Simulator": + typeOptions = ["Dummy","Generic","DPsim","RTLAB","RSCAD"]; + break; + case "Controller": + typeOptions = ["Kubernetes","VILLAS-controller"]; + break; + case "Gateway": + typeOptions = ["VILLAS-node","VILLAS-relay"]; + break; + case "Service": + typeOptions = ["EMS","Custom"]; + break; + case "Equipment": + typeOptions = ["Chroma-emulator","Chroma-loads","SMA-sunnyboy","FLEPS","Sonnenbatterie"]; + break; + default: + typeOptions =[]; + } return ( this.onClose(c)} onReset={() => this.resetState()} valid={this.valid}>
@@ -137,14 +157,24 @@ class NewICDialog extends React.Component { - Category of component (e.g. Simulator, Gateway, ...) - this.handleChange(e)} /> - + Category of component + this.handleChange(e)}> + + + + + + + - Type of component (e.g. RTDS, VILLASnode, ...) - this.handleChange(e)} /> - + Type of component + this.handleChange(e)}> + + {typeOptions.map((name,index) => ( + + ))} + UUID