diff --git a/src/components/dialogs/edit-widget-control-creator.js b/src/components/dialogs/edit-widget-control-creator.js index ebcfcf1..927e967 100644 --- a/src/components/dialogs/edit-widget-control-creator.js +++ b/src/components/dialogs/edit-widget-control-creator.js @@ -42,6 +42,11 @@ export default function createControls(widgetType = null, widget = null, session var dialogControls = []; switch(widgetType) { + case 'Action': + dialogControls.push( + validateForm(id)} simulationModels={simulationModels} handleChange={(e) => handleChange(e)} />, + ) + break; case 'Value': let valueBoundOnChange = (e) => { handleChange([e, {target: {id: 'signal', value: 0}}]); diff --git a/src/components/widget-factory.js b/src/components/widget-factory.js index 434d3aa..b190f81 100644 --- a/src/components/widget-factory.js +++ b/src/components/widget-factory.js @@ -39,6 +39,9 @@ class WidgetFactory { // set type specific properties switch(type) { + case 'Action': + widget.simulationModel = defaultSimulationModel; + break; case 'Lamp': widget.simulationModel = defaultSimulationModel; widget.signal = 0; diff --git a/src/components/widgets/action.js b/src/components/widgets/action.js new file mode 100644 index 0000000..24e105c --- /dev/null +++ b/src/components/widgets/action.js @@ -0,0 +1,48 @@ +/** + * File: action.js + * Author: Steffen Vogel + * Date: 17.06.2018 + * Copyright: 2018, Institute for Automation of Complex Power Systems, EONERC + * + * 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 { Button, ButtonGroup } from 'react-bootstrap'; +import Icon from '../icon'; + +class WidgetAction extends Component { + constructor(props) { + super(props); + + this.state = { + }; + } + + onClick(e) { + + } + + render() { + return + + + + ; + } +} + +export default WidgetAction; diff --git a/src/containers/visualization.js b/src/containers/visualization.js index 8b0641c..3ae300b 100644 --- a/src/containers/visualization.js +++ b/src/containers/visualization.js @@ -485,6 +485,7 @@ class Visualization extends React.Component { { editingControls } + diff --git a/src/containers/widget.js b/src/containers/widget.js index f0018ca..ebcf7d1 100644 --- a/src/containers/widget.js +++ b/src/containers/widget.js @@ -31,6 +31,7 @@ import SimulatorDataStore from '../stores/simulator-data-store'; import SimulationModelStore from '../stores/simulation-model-store'; import FileStore from '../stores/file-store'; +import WidgetAction from '../components/widgets/action'; import WidgetLamp from '../components/widgets/lamp'; import WidgetValue from '../components/widgets/value'; import WidgetPlot from '../components/widgets/plot'; @@ -203,7 +204,9 @@ class Widget extends React.Component { } // dummy is passed to widgets to keep updating them while in edit mode - if (widget.type === 'Lamp') { + if (widget.type === 'Action') { + element = + } else if (widget.type === 'Lamp') { element = } else if (widget.type === 'Value') { element =