1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

Add label widget

This commit is contained in:
Markus Grigull 2017-03-14 22:00:23 +01:00
parent 245188e1df
commit e504b4d726
3 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,20 @@
/**
* File: widget-label.js
* Author: Markus Grigull <mgrigull@eonerc.rwth-aachen.de>
* Date: 14.03.2017
* Copyright: 2017, Institute for Automation of Complex Power Systems, EONERC
* This file is part of VILLASweb. All Rights Reserved. Proprietary and confidential.
* Unauthorized copying of this file, via any medium is strictly prohibited.
**********************************************************************************/
import React, { Component } from 'react';
class WidgetLabel extends Component {
render() {
return (
<h4>{this.props.widget.name}</h4>
);
}
}
export default WidgetLabel;

View file

@ -125,6 +125,8 @@ class Visualization extends Component {
widget.simulator = this.state.simulation.models[0].simulator;
widget.width = 400;
widget.height = 200;
} else if (item.name === 'Label') {
}
var visualization = this.state.visualization;
@ -209,6 +211,7 @@ class Visualization extends Component {
<ToolboxItem name="Value" type="widget" />
<ToolboxItem name="Plot" type="widget" />
<ToolboxItem name="Table" type="widget" />
<ToolboxItem name="Label" type="widget" />
</div>
}

View file

@ -17,6 +17,7 @@ import SimulatorDataStore from '../stores/simulator-data-store';
import WidgetValue from '../components/widget-value';
import WidgetPlot from '../components/widget-plot';
import WidgetTable from '../components/widget-table';
import WidgetLabel from '../components/widget-label';
import '../styles/widgets.css';
@ -76,6 +77,8 @@ class Widget extends Component {
element = <WidgetPlot widget={widget} data={this.state.simulatorData} dummy={this.state.sequence} simulation={this.props.simulation} />
} else if (widget.type === 'Table') {
element = <WidgetTable widget={widget} data={this.state.simulatorData} dummy={this.state.sequence} simulation={this.props.simulation} />
} else if (widget.type === 'Label') {
element = <WidgetLabel widget={widget} />
}
if (this.props.editing) {