mirror of
https://github.com/EEVengers/ThunderScope.git
synced 2025-04-08 06:25:30 +00:00
moved division checks to widget rather than redux
This commit is contained in:
parent
0aedf40185
commit
66790da52e
Software/waveview/src
@ -18,11 +18,24 @@ class VerticalWidget extends React.Component<any, any> {
|
||||
|
||||
// Time Per Division
|
||||
incrementTimePerDivision = () => {
|
||||
this.props.dispatch({type: 'vertical/increaseTimePerDivision'});
|
||||
let currentChannel = this.props.verticalWidget.activeChannel - 1;
|
||||
let index = this.props.verticalWidget.timePerDivision[currentChannel].index;
|
||||
|
||||
if (index !== 0)
|
||||
{
|
||||
// Call C
|
||||
this.props.dispatch({type: 'vertical/increaseTimePerDivision'});
|
||||
};
|
||||
}
|
||||
|
||||
decrementTimePerDivision = () => {
|
||||
this.props.dispatch({type: 'vertical/decreaseTimePerDivision'});
|
||||
let currentChannel = this.props.verticalWidget.activeChannel - 1;
|
||||
let index = this.props.verticalWidget.timePerDivision[currentChannel].index;
|
||||
|
||||
if (index < 12) {
|
||||
// Call C
|
||||
this.props.dispatch({type: 'vertical/decreaseTimePerDivision'});
|
||||
}
|
||||
}
|
||||
|
||||
incrementTimePerDivisionFine = () => {
|
||||
|
@ -114,9 +114,6 @@ export default function VerticalWidgetReducer(state = VerticalWidgetInitialState
|
||||
verticalOffset: tmp
|
||||
}
|
||||
case "vertical/increaseTimePerDivision":
|
||||
if (state.timePerDivision[state.activeChannel - 1].index === 0) {
|
||||
return { ...state }
|
||||
};
|
||||
tmp = state.timePerDivision;
|
||||
|
||||
tmp[channelIndex].index = state.timePerDivision[channelIndex].index - 1;
|
||||
@ -136,9 +133,6 @@ export default function VerticalWidgetReducer(state = VerticalWidgetInitialState
|
||||
verticalOffset: tmp2
|
||||
}
|
||||
case "vertical/decreaseTimePerDivision":
|
||||
if (state.timePerDivision[state.activeChannel - 1].index >= 12) {
|
||||
return { ...state }
|
||||
};
|
||||
tmp = state.timePerDivision;
|
||||
|
||||
tmp[channelIndex].index = state.timePerDivision[channelIndex].index + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user