From baddee0df33197bc168fc2b472fc9f830df8177f Mon Sep 17 00:00:00 2001 From: Ricardo Hernandez-Montoya Date: Mon, 3 Apr 2017 15:56:48 +0200 Subject: [PATCH] display signal type in gauge --- src/components/widget-gauge.js | 8 +++++++- src/containers/widget.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/widget-gauge.js b/src/components/widget-gauge.js index 84dad58..bc820f0 100644 --- a/src/components/widget-gauge.js +++ b/src/components/widget-gauge.js @@ -90,12 +90,18 @@ class WidgetGauge extends Component { render() { var componentClass = this.props.editing ? "gauge-widget editing" : "gauge-widget"; + var signalType = null; + + if (this.props.simulation) { + var simulationModel = this.props.simulation.models.filter((model) => model.simulator === this.props.widget.simulator)[0]; + signalType = simulationModel && simulationModel.length > 0? simulationModel.mapping[this.props.widget.signal].type : ''; + } return (
{ this.props.widget.name }
this.gaugeCanvas = node } /> -
Voltage (V)
+
{ signalType }
{ this.state.value }
); diff --git a/src/containers/widget.js b/src/containers/widget.js index c34bc1c..0aff5d1 100644 --- a/src/containers/widget.js +++ b/src/containers/widget.js @@ -139,7 +139,7 @@ class Widget extends Component { } else if (widget.type === 'Slider') { element = } else if (widget.type === 'Gauge') { - element = + element = } if (this.props.editing) {