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

basic groundwork for single button functionality

This commit is contained in:
Jason Bonnell 2021-03-21 16:10:00 -04:00
parent 099ae0dcd4
commit 04088779e5
3 changed files with 9 additions and 4 deletions
Software/waveview/src
components/sidebar/core
redux

View File

@ -4,7 +4,7 @@ import './../../../css/sidebar/core/singleButton.css';
class SingleButton extends React.Component<any, any> {
singleClickHandler = () => {
toggleSingleMode = () => {
this.props.dispatch({type: 'graph/singleMode'});
}
@ -13,7 +13,7 @@ class SingleButton extends React.Component<any, any> {
<div className={"SingleButtonComponent"}>
<button
className={"SingleButton"}
onClick={() => this.singleClickHandler()}
onClick={() => this.toggleSingleMode()}
>
<label
className={"SingleButtonText"}>

View File

@ -2,6 +2,7 @@ import GraphStatus from "../../configuration/enums/graphStatus";
const GraphInitialState = {
currentStatus: GraphStatus.On,
singleMode: false,
xDomain: [0,0],
yDomain: [0,0]
};

View File

@ -10,8 +10,12 @@ export default function(state = GraphInitialState, action: {type: any, payload:
currentStatus: newStatus
};
case "graph/singleMode":
// Handle what needs to happen when clicking the Single button
return state;
// Need to implement this in the tick generator to stop/pause polling when in single mode
return {
...state,
currentStatus: GraphStatus.Off,
singleMode: !state.singleMode
};
default:
return state;
}