7
mirror of https://github.com/EEVengers/ThunderScope.git synced 2025-04-22 17:43:44 +00:00

Bugfix: update measurements during Single

This commit is contained in:
Ratan Varghese 2021-03-22 02:37:01 -04:00
parent ec2caa0088
commit 1459089da8
2 changed files with 7 additions and 0 deletions
Software/waveview/src/components/sidebar

View File

@ -2,6 +2,7 @@ import React from 'react';
import { connect } from 'react-redux';
import './../../../css/sidebar/core/singleButton.css';
import Graph from '../../graph/graph';
import MeasurementsWidget from '../widgets/measurementsWidget';
class SingleButton extends React.Component<any, any> {
@ -11,6 +12,10 @@ class SingleButton extends React.Component<any, any> {
this.props.dispatch({type: 'graph/tick'});
Graph.instanceList[0].generator.update();
}
if(MeasurementsWidget.instanceList.length > 0) {
this.props.dispatch({type: 'measurements/tick'});
MeasurementsWidget.instanceList[0].update();
}
}
render() {

View File

@ -8,9 +8,11 @@ import CMD from '../../../configuration/enums/cmd';
import {Plumber, PlumberArgs} from '../../../util/plumber';
class MeasurementsWidget extends React.Component<any, any> {
static instanceList: MeasurementsWidget[] = [];
timerID: number = 0;
componentDidMount() {
MeasurementsWidget.instanceList.push(this);
this.timerID = window.setInterval(
() => this.tick(),
1000