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

fixed most electron warnings

This commit is contained in:
Jason Bonnell 2021-03-25 13:52:18 -04:00
parent bec9281a31
commit ec6794d9a2
15 changed files with 21 additions and 19 deletions

View File

@ -65,7 +65,7 @@ class HorizontalWidget extends React.Component<any, any> {
<label
className=""
style={{fontWeight: this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Coarse ? "bold" : "normal"}}>
coarse
Coarse
</label>
</button>
<button

View File

@ -17,7 +17,7 @@ class TriggerWidget extends React.Component<any, any> {
changeChannel1 = (channelNumber: number) => {
let w = this.props.mathWidget;
if(w.channel2 != channelNumber) {
if(w.channel2 !== channelNumber) {
Plumber.getInstance().handleMath(w.mathEnabled, channelNumber, w.channel2, w.mathOperator);
}
this.props.dispatch({type: 'math/changeChannel1', payload: channelNumber });
@ -25,7 +25,7 @@ class TriggerWidget extends React.Component<any, any> {
changeChannel2 = (channelNumber: number) => {
let w = this.props.mathWidget;
if(w.channel1 != channelNumber) {
if(w.channel1 !== channelNumber) {
Plumber.getInstance().handleMath(w.mathEnabled, w.channel1, channelNumber, w.mathOperator);
}
this.props.dispatch({type: 'math/changeChannel2', payload: channelNumber });

View File

@ -31,7 +31,7 @@ class MeasurementsWidget extends React.Component<any, any> {
//TODO: unit analysis
let channels = this.props.measurementsWidget.displayChannel as boolean[];
let channelNum = channels.map(v => v ? 1 : 0) as number[];
if(channelNum.reduce((a, b) => a + b) == 0) {
if(channelNum.reduce((a, b) => a + b) === 0) {
return; //Don't bother C if we don't need to.
}
let maxArgs: PlumberArgs = {

View File

@ -30,7 +30,7 @@ class TriggerWidget extends React.Component<any, any> {
// Trigger Type
changeTriggerType = (triggerType: TriggerType) => {
let edgeNum = (triggerType == TriggerType.RisingEdge) ? 1 : 2;
let edgeNum = (triggerType === TriggerType.RisingEdge) ? 1 : 2;
let args: PlumberArgs = {
headCheck: () => true,
bodyCheck: () => true,

View File

@ -248,9 +248,11 @@ let divisions = {
time: 10
}
export default {
let DefaultValues = {
x1ProbeValues,
x10ProbeValues,
horizontalTimeBases,
divisions
};
}
export default DefaultValues;

View File

@ -1,7 +1,7 @@
import GraphStatus from '../../configuration/enums/graphStatus';
import GraphInitialState from '../initialStates/graphInitialState';
export default function(state = GraphInitialState, action: {type: any, payload: any}) {
export default function GraphReducer(state = GraphInitialState, action: {type: any, payload: any}) {
switch(action.type) {
case "graph/changeStatus":
var newStatus = state.currentStatus === GraphStatus.On ? GraphStatus.Off : GraphStatus.On;

View File

@ -1,6 +1,6 @@
import SettingsInitialState from '../initialStates/settingsInitialState';
export default function(state = SettingsInitialState, action: {type: any, payload: any}) {
export default function SettingsReducer(state = SettingsInitialState, action: {type: any, payload: any}) {
switch(action.type) {
default:
return state;

View File

@ -2,7 +2,7 @@ import DefaultValues from '../../../configuration/defaultValues';
import ControlMode from '../../../configuration/enums/controlMode';
import HorizontalWidgetInitialState from '../../initialStates/horizontalWidgetInitialState';
export default function(state = HorizontalWidgetInitialState, action: {type: any, payload: any}) {
export default function HorizontalWidgetReducer(state = HorizontalWidgetInitialState, action: {type: any, payload: any}) {
switch(action.type) {
case "horizontal/changeTimeBaseMode":
return {

View File

@ -1,6 +1,6 @@
import MathWidgetInitialState from '../../initialStates/mathWidgetInitialState';
export default function(state = MathWidgetInitialState, action: {type: any, payload: any}) {
export default function MathWidgetReducer(state = MathWidgetInitialState, action: {type: any, payload: any}) {
switch(action.type) {
case "math/toggleMathMode":
return {

View File

@ -1,7 +1,7 @@
import MeasurementsWidgetInitialState from '../../initialStates/measurementsWidgetInitialState';
import { MaxMinResult } from '../../../util/plumber';
export default function(state = MeasurementsWidgetInitialState, action: {type: any, payload: any}) {
export default function MeasurementsWidgetReducer(state = MeasurementsWidgetInitialState, action: {type: any, payload: any}) {
var tmp;
switch(action.type) {

View File

@ -1,6 +1,6 @@
import TriggerWidgetInitialState from '../../initialStates/triggerWidgetInitialState';
export default function(state = TriggerWidgetInitialState, action: {type: any, payload: any}) {
export default function TriggerWidgetReducer(state = TriggerWidgetInitialState, action: {type: any, payload: any}) {
var channelIndex = state.triggerChannel - 1;
var tmp;

View File

@ -3,7 +3,7 @@ import ProbeMode from '../../../configuration/enums/probeMode';
import DefaultValues from '../../../configuration/defaultValues';
import VerticalWidgetInitialState from '../../initialStates/verticalWidgetInitialState';
export default function(state = VerticalWidgetInitialState, action: {type: any, payload: any}) {
export default function VerticalWidgetReducer(state = VerticalWidgetInitialState, action: {type: any, payload: any}) {
var channelIndex = state.activeChannel - 1;
var tmp;
var tmp2;

View File

@ -134,7 +134,7 @@ export class Plumber {
public handleMath(enable: boolean, lhsChan: number, rhsChan: number, op: MathOperators) {
var protcolOp = 0;
if(enable) {
protcolOp = (op == MathOperators.Addition) ? 1 : 2;
protcolOp = (op === MathOperators.Addition) ? 1 : 2;
}
let mathArgs: PlumberArgs = {
headCheck: () => true,

View File

@ -17,9 +17,9 @@ export function setChHelper(
let triggerChIdx = triggerCh - 1;
let quadChOrder = [1, 2, 3, 4];
var chOrder = quadChOrder.filter((a, i) => chList[i] || triggerChIdx == i);
var chOrder = quadChOrder.filter((a, i) => chList[i] || triggerChIdx === i);
var setCh = chOrder.length as setChMode;
if(setCh == 3) {
if(setCh === 3) {
chOrder = quadChOrder;
setCh = quadChOrder.length;
}

View File

@ -83,12 +83,12 @@ class TestPoints {
let xOffset = (this.lastX < xLimit) ? this.lastX : 0;
var cppChannel = 0;
for(var uiChannel = 0; uiChannel < this.getDataMaxCh; uiChannel++) {
let mathCh = (uiChannel == this.getDataMaxCh-1) && doMath;
let mathCh = (uiChannel === this.getDataMaxCh-1) && doMath;
let dataCh = order.includes(uiChannel + 1);
if(mathCh || dataCh) {
for(var i = 0; i < perChannel; i++) {
var x = xOffset + i;
if(x != 0 && !this.scope_data[uiChannel][x-1]) {
if(x !== 0 && !this.scope_data[uiChannel][x-1]) {
//Adding a channel while other channels in middle of screen
//causes an error.
break;