7
mirror of https://github.com/EEVengers/ThunderScope.git synced 2025-04-11 23:19:16 +00:00

Merge pull request from EEVengers/features/vertical-divisions

Features/vertical divisions
This commit is contained in:
Jason Bonnell 2021-03-25 16:02:13 -04:00 committed by GitHub
commit b1b9982779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 10 deletions
Software/waveview
electron
src
components/sidebar/widgets
redux/reducers/widgets

View File

@ -8,8 +8,8 @@ let mainWindow: BrowserWindow | null;
function createWindow() {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
width: 1600,
height: 900,
webPreferences: {
preload: path.join(__dirname, "preload.js"),
nodeIntegration: true,

View File

@ -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 = () => {

View File

@ -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;