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

fix for NumberInput and Gauge: both can now be connected to a signal, fix for Topology: can now be dropped

This commit is contained in:
Laura Fuentes Grau 2020-03-30 16:28:52 +02:00
parent 050d21cf29
commit 2cf7789bb2
3 changed files with 4 additions and 3 deletions

View file

@ -144,7 +144,7 @@ class Widget extends React.Component {
} else if (widget.type === 'Button') {
return <WidgetButton widget={widget} editing={this.props.editing} onInputChanged={(value) => this.inputDataChanged(widget, value)} signals={this.state.signals} />
} else if (widget.type === 'NumberInput') {
return <WidgetInput widget={widget} editing={this.props.editing} onInputChanged={(value) => this.inputDataChanged(widget, value)} />
return <WidgetInput widget={widget} editing={this.props.editing} onInputChanged={(value) => this.inputDataChanged(widget, value)} signals={this.state.signals} />
} else if (widget.type === 'Slider') {
return <WidgetSlider widget={widget} editing={this.props.editing} onWidgetChange={(w) => this.props.onWidgetStatusChange(w, this.props.index) } onInputChanged={value => this.inputDataChanged(widget, value)} signals={this.state.signals}/>
} else if (widget.type === 'Gauge') {

View file

@ -89,6 +89,7 @@ class WidgetGauge extends Component {
|| props.data[ICid].output.values.length === 0
|| props.data[ICid].output.values[0].length === 0) {
returnState["value"] = 0;
return returnState;
}
// memorize if min or max value is updated
@ -191,7 +192,7 @@ class WidgetGauge extends Component {
if (zones != null) {
// adapt range 0-100 to actual min-max
const step = (maxValue - minValue) / 100;
zones = zones.map(zone => {
return Object.assign({}, zone, { min: (zone.min * step) + +minValue, max: zone.max * step + +minValue, strokeStyle: '#' + zone.strokeStyle });
});

View file

@ -139,7 +139,7 @@ class WidgetTopology extends React.Component {
}
} else {
// No file has been selected
if (!this.props.widget.customProperties.file) {
if (!this.props.widget.customProperties.file&& this.state.message !== 'Select a topology model first.') {
this.setState({
'dashboardState': 'show_message',
'message': 'Select a topology model first.'});