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:
parent
099ae0dcd4
commit
04088779e5
Software/waveview/src
components/sidebar/core
redux
@ -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"}>
|
||||
|
@ -2,6 +2,7 @@ import GraphStatus from "../../configuration/enums/graphStatus";
|
||||
|
||||
const GraphInitialState = {
|
||||
currentStatus: GraphStatus.On,
|
||||
singleMode: false,
|
||||
xDomain: [0,0],
|
||||
yDomain: [0,0]
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user