From ec7efbd11c35f6e66818623bd65d8798399a5d42 Mon Sep 17 00:00:00 2001 From: Ricardo Hernandez-Montoya Date: Wed, 24 May 2017 14:41:47 +0200 Subject: [PATCH] removed unused code --- src/components/dialog/edit-widget-plot.js | 97 ---------------------- src/components/dialog/edit-widget-table.js | 56 ------------- src/components/dialog/edit-widget-value.js | 76 ----------------- 3 files changed, 229 deletions(-) delete mode 100644 src/components/dialog/edit-widget-plot.js delete mode 100644 src/components/dialog/edit-widget-table.js delete mode 100644 src/components/dialog/edit-widget-value.js diff --git a/src/components/dialog/edit-widget-plot.js b/src/components/dialog/edit-widget-plot.js deleted file mode 100644 index 9ff53a2..0000000 --- a/src/components/dialog/edit-widget-plot.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * File: edit-widget-plot.js - * Author: Markus Grigull - * Date: 13.03.2017 - * - * This file is part of VILLASweb. - * - * VILLASweb is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * VILLASweb is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with VILLASweb. If not, see . - ******************************************************************************/ - -import React, { Component } from 'react'; -import { FormGroup, FormControl, ControlLabel, Checkbox, HelpBlock } from 'react-bootstrap'; - -class EditPlotWidget extends Component { - constructor(props) { - super(props); - - this.state = { - widget: { - simulator: '', - signals: [], - time: 0 - } - }; - } - - componentWillReceiveProps(nextProps) { - this.setState({ widget: nextProps.widget }); - } - - handleSignalChange(e, index) { - var signals = this.state.widget.signals; - - if (e.target.checked) { - // add signal - signals.push(index); - } else { - // remove signal - const pos = signals.indexOf(index); - if (pos > -1) { - signals.splice(pos, 1); - } - } - - this.props.handleChange({ target: { id: 'signals', value: signals } }); - } - - render() { - // get selected simulation model - var simulationModel = {}; - - if (this.props.simulation) { - this.props.simulation.models.forEach((model) => { - if (model.simulation === this.state.widget.simulation) { - simulationModel = model; - } - }); - } - - return ( -
- - Time - this.props.handleChange(e)} /> - Time in seconds - - - Simulator - this.props.handleChange(e)}> - {this.props.simulation.models.map((model, index) => ( - - ))} - - - - Signals - {simulationModel.mapping.map((signal, index) => ( - this.handleSignalChange(e, index)}>{signal.name} - ))} - -
- ); - } -} - -export default EditPlotWidget; diff --git a/src/components/dialog/edit-widget-table.js b/src/components/dialog/edit-widget-table.js deleted file mode 100644 index 05b17c2..0000000 --- a/src/components/dialog/edit-widget-table.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * File: edit-widget-table.js - * Author: Markus Grigull - * Date: 14.03.2017 - * - * This file is part of VILLASweb. - * - * VILLASweb is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * VILLASweb is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with VILLASweb. If not, see . - ******************************************************************************/ - - import React, { Component } from 'react'; - import { FormGroup, FormControl, ControlLabel } from 'react-bootstrap'; - - class EditTableWidget extends Component { - constructor(props) { - super(props); - - this.state = { - widget: { - simulator: '' - } - }; - } - - componentWillReceiveProps(nextProps) { - this.setState({ widget: nextProps.widget }); - } - - render() { - return ( -
- - Simulator - this.props.handleChange(e)}> - {this.props.simulation.models.map((model, index) => ( - - ))} - - -
- ); - } - } - - export default EditTableWidget; diff --git a/src/components/dialog/edit-widget-value.js b/src/components/dialog/edit-widget-value.js deleted file mode 100644 index 7061fc9..0000000 --- a/src/components/dialog/edit-widget-value.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * File: edit-widget-value.js - * Author: Markus Grigull - * Date: 04.03.2017 - * - * This file is part of VILLASweb. - * - * VILLASweb is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * VILLASweb is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with VILLASweb. If not, see . - ******************************************************************************/ - -import React, { Component } from 'react'; -import { FormGroup, FormControl, ControlLabel } from 'react-bootstrap'; - -class EditValueWidget extends Component { - constructor(props) { - super(props); - - this.state = { - widget: { - simulator: '', - signal: 0 - } - }; - } - - componentWillReceiveProps(nextProps) { - this.setState({ widget: nextProps.widget }); - } - - render() { - // get selected simulation model - var simulationModel = {}; - - if (this.props.simulation) { - this.props.simulation.models.forEach((model) => { - if (model.simulation === this.state.widget.simulation) { - simulationModel = model; - } - }); - } - - return ( -
- - Simulator - this.props.handleChange(e)}> - {this.props.simulation.models.map((model, index) => ( - - ))} - - - - Signal - this.props.handleChange(e)}> - {simulationModel.mapping.map((signal, index) => ( - - ))} - - -
- ); - } -} - -export default EditValueWidget;