mirror of
https://github.com/EEVengers/ThunderScope.git
synced 2025-04-11 23:19:16 +00:00
Merge pull request #198 from EEVengers/features/vertical-divisions
Features/vertical divisions
This commit is contained in:
commit
b1b9982779
Software/waveview
electron
src
@ -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,
|
||||
|
@ -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