mirror of
https://github.com/EEVengers/ThunderScope.git
synced 2025-04-08 06:25:30 +00:00
deleted old defaultValues arrays
This commit is contained in:
parent
4f93d3dade
commit
4e7ce16cb2
Software/waveview/src
components
configuration
redux
initialStates
reducers/widgets
@ -7,10 +7,10 @@ class TimePerDivision extends React.Component<any, any> {
|
||||
render() {
|
||||
return(
|
||||
<div className="TimePerDivisionComponent">
|
||||
{this.props.horizontalWidget.horizontalTimeBase.mode == ControlMode.Course && this.props.horizontalWidget.horizontalTimeBase.course.value.toString()}
|
||||
{this.props.horizontalWidget.horizontalTimeBase.mode == ControlMode.Course && this.props.horizontalWidget.horizontalTimeBase.course.unit.toString() + "/div"}
|
||||
{this.props.horizontalWidget.horizontalTimeBase.mode == ControlMode.Fine && this.props.horizontalWidget.horizontalTimeBase.fine.value.toString()}
|
||||
{this.props.horizontalWidget.horizontalTimeBase.mode == ControlMode.Fine && this.props.horizontalWidget.horizontalTimeBase.fine.unit.toString() + "/div"}
|
||||
{this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Course && this.props.horizontalWidget.horizontalTimeBase.course.value.toString()}
|
||||
{this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Course && this.props.horizontalWidget.horizontalTimeBase.course.unit.toString() + "/div"}
|
||||
{this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Fine && this.props.horizontalWidget.horizontalTimeBase.fine.value.toString()}
|
||||
{this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Fine && this.props.horizontalWidget.horizontalTimeBase.fine.unit.toString() + "/div"}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ class VerticalWidget extends React.Component<any, any> {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{this.props.verticalWidget.settings[this.props.verticalWidget.activeChannel-1].controlMode == ControlMode.Fine &&
|
||||
{this.props.verticalWidget.settings[this.props.verticalWidget.activeChannel-1].controlMode === ControlMode.Fine &&
|
||||
<div className="FineModeUnitButtons">
|
||||
<button
|
||||
className="NanoVoltButtonVertical"
|
||||
|
@ -1,7 +1,7 @@
|
||||
import VoltageUnit from './enums/voltageUnit';
|
||||
import TimeUnit from './enums/timeUnit';
|
||||
|
||||
const x1ProbeValues_New = [
|
||||
const x1ProbeValues = [
|
||||
{
|
||||
value: 10,
|
||||
unit: VoltageUnit.Volt
|
||||
@ -56,7 +56,7 @@ const x1ProbeValues_New = [
|
||||
}
|
||||
];
|
||||
|
||||
const x10ProbeValues_New = [
|
||||
const x10ProbeValues = [
|
||||
{
|
||||
value: 100,
|
||||
unit: VoltageUnit.Volt
|
||||
@ -114,7 +114,7 @@ const x10ProbeValues_New = [
|
||||
// 13 different voltages per divison presets
|
||||
// Start at x1ProbeValues[6] and change accordingly
|
||||
|
||||
const horizontalTimeBases_New = [
|
||||
const horizontalTimeBases = [
|
||||
{
|
||||
value: 1,
|
||||
unit: TimeUnit.NanoSecond
|
||||
@ -244,7 +244,7 @@ const horizontalTimeBases_New = [
|
||||
// Start at horizontalTimeBases[15] and change accordingly
|
||||
|
||||
export default {
|
||||
x1ProbeValues_New,
|
||||
x10ProbeValues_New,
|
||||
horizontalTimeBases_New
|
||||
x1ProbeValues,
|
||||
x10ProbeValues,
|
||||
horizontalTimeBases
|
||||
};
|
@ -7,8 +7,8 @@ const HorizontalWidgetInitialState = {
|
||||
mode: ControlMode.Course,
|
||||
index: 15,
|
||||
course: {
|
||||
value: DefaultValues.horizontalTimeBases_New[15].value,
|
||||
unit: DefaultValues.horizontalTimeBases_New[15].unit
|
||||
value: DefaultValues.horizontalTimeBases[15].value,
|
||||
unit: DefaultValues.horizontalTimeBases[15].unit
|
||||
},
|
||||
fine: {
|
||||
value: 0,
|
||||
|
@ -17,8 +17,8 @@ const VerticalWidgetInitialState = {
|
||||
timePerDivision: [
|
||||
{
|
||||
course: {
|
||||
value: DefaultValues.x1ProbeValues_New[6].value,
|
||||
unit: DefaultValues.x1ProbeValues_New[6].unit
|
||||
value: DefaultValues.x1ProbeValues[6].value,
|
||||
unit: DefaultValues.x1ProbeValues[6].unit
|
||||
},
|
||||
fine: {
|
||||
value: 0,
|
||||
@ -29,8 +29,8 @@ const VerticalWidgetInitialState = {
|
||||
},
|
||||
{
|
||||
course: {
|
||||
value: DefaultValues.x1ProbeValues_New[6].value,
|
||||
unit: DefaultValues.x1ProbeValues_New[6].unit
|
||||
value: DefaultValues.x1ProbeValues[6].value,
|
||||
unit: DefaultValues.x1ProbeValues[6].unit
|
||||
},
|
||||
fine: {
|
||||
value: 0,
|
||||
@ -41,8 +41,8 @@ const VerticalWidgetInitialState = {
|
||||
},
|
||||
{
|
||||
course: {
|
||||
value: DefaultValues.x1ProbeValues_New[6].value,
|
||||
unit: DefaultValues.x1ProbeValues_New[6].unit
|
||||
value: DefaultValues.x1ProbeValues[6].value,
|
||||
unit: DefaultValues.x1ProbeValues[6].unit
|
||||
},
|
||||
fine: {
|
||||
value: 0,
|
||||
@ -53,8 +53,8 @@ const VerticalWidgetInitialState = {
|
||||
},
|
||||
{
|
||||
course: {
|
||||
value: DefaultValues.x1ProbeValues_New[6].value,
|
||||
unit: DefaultValues.x1ProbeValues_New[6].unit
|
||||
value: DefaultValues.x1ProbeValues[6].value,
|
||||
unit: DefaultValues.x1ProbeValues[6].unit
|
||||
},
|
||||
fine: {
|
||||
value: 0,
|
||||
|
@ -13,7 +13,7 @@ export default function(state = HorizontalWidgetInitialState, action: {type: any
|
||||
},
|
||||
horizontalOffset: {
|
||||
...state.horizontalOffset,
|
||||
unit: action.payload == ControlMode.Fine ? state.horizontalTimeBase.fine.unit : state.horizontalTimeBase.course.unit
|
||||
unit: action.payload === ControlMode.Fine ? state.horizontalTimeBase.fine.unit : state.horizontalTimeBase.course.unit
|
||||
}
|
||||
}
|
||||
case "horizontal/changeTimeBaseUnit":
|
||||
@ -40,14 +40,14 @@ export default function(state = HorizontalWidgetInitialState, action: {type: any
|
||||
horizontalTimeBase: {
|
||||
...state.horizontalTimeBase,
|
||||
course: {
|
||||
value: DefaultValues.horizontalTimeBases_New[state.horizontalTimeBase.index + 1].value,
|
||||
unit: DefaultValues.horizontalTimeBases_New[state.horizontalTimeBase.index + 1].unit
|
||||
value: DefaultValues.horizontalTimeBases[state.horizontalTimeBase.index + 1].value,
|
||||
unit: DefaultValues.horizontalTimeBases[state.horizontalTimeBase.index + 1].unit
|
||||
},
|
||||
index: state.horizontalTimeBase.index + 1
|
||||
},
|
||||
horizontalOffset: {
|
||||
...state.horizontalOffset,
|
||||
unit: DefaultValues.horizontalTimeBases_New[state.horizontalTimeBase.index + 1].unit
|
||||
unit: DefaultValues.horizontalTimeBases[state.horizontalTimeBase.index + 1].unit
|
||||
}
|
||||
}
|
||||
case "horizontal/decreaseTimeBase":
|
||||
@ -59,14 +59,14 @@ export default function(state = HorizontalWidgetInitialState, action: {type: any
|
||||
horizontalTimeBase: {
|
||||
...state.horizontalTimeBase,
|
||||
course: {
|
||||
value: DefaultValues.horizontalTimeBases_New[state.horizontalTimeBase.index - 1].value,
|
||||
unit: DefaultValues.horizontalTimeBases_New[state.horizontalTimeBase.index - 1].unit
|
||||
value: DefaultValues.horizontalTimeBases[state.horizontalTimeBase.index - 1].value,
|
||||
unit: DefaultValues.horizontalTimeBases[state.horizontalTimeBase.index - 1].unit
|
||||
},
|
||||
index: state.horizontalTimeBase.index - 1
|
||||
},
|
||||
horizontalOffset: {
|
||||
...state.horizontalOffset,
|
||||
unit: DefaultValues.horizontalTimeBases_New[state.horizontalTimeBase.index - 1].unit
|
||||
unit: DefaultValues.horizontalTimeBases[state.horizontalTimeBase.index - 1].unit
|
||||
}
|
||||
}
|
||||
case "horizontal/increaseTimeBaseFine":
|
||||
|
@ -57,11 +57,11 @@ export default function(state = VerticalWidgetInitialState, action: {type: any,
|
||||
tmp2 = state.timePerDivision;
|
||||
|
||||
tmp2[channelIndex].course.value = action.payload === ProbeMode.x1
|
||||
? DefaultValues.x1ProbeValues_New[state.timePerDivision[channelIndex].index].value
|
||||
: DefaultValues.x10ProbeValues_New[state.timePerDivision[channelIndex].index].value;
|
||||
? DefaultValues.x1ProbeValues[state.timePerDivision[channelIndex].index].value
|
||||
: DefaultValues.x10ProbeValues[state.timePerDivision[channelIndex].index].value;
|
||||
tmp2[channelIndex].course.unit = action.payload === ProbeMode.x1
|
||||
? DefaultValues.x1ProbeValues_New[state.timePerDivision[channelIndex].index].unit
|
||||
: DefaultValues.x10ProbeValues_New[state.timePerDivision[channelIndex].index].unit;
|
||||
? DefaultValues.x1ProbeValues[state.timePerDivision[channelIndex].index].unit
|
||||
: DefaultValues.x10ProbeValues[state.timePerDivision[channelIndex].index].unit;
|
||||
|
||||
tmp3 = state.verticalOffset;
|
||||
|
||||
@ -84,7 +84,7 @@ export default function(state = VerticalWidgetInitialState, action: {type: any,
|
||||
tmp = state.settings;
|
||||
var newTotalChannelsUsed = state.totalChannelsUsed;
|
||||
|
||||
if (tmp[action.payload].status == 0) {
|
||||
if (tmp[action.payload].status === 0) {
|
||||
tmp[action.payload].status = 1;
|
||||
newTotalChannelsUsed++;
|
||||
}
|
||||
@ -121,11 +121,11 @@ export default function(state = VerticalWidgetInitialState, action: {type: any,
|
||||
|
||||
tmp[channelIndex].index = state.timePerDivision[channelIndex].index - 1;
|
||||
tmp[channelIndex].course.value = state.settings[channelIndex].probeMode === ProbeMode.x1
|
||||
? DefaultValues.x1ProbeValues_New[tmp[channelIndex].index].value
|
||||
: DefaultValues.x10ProbeValues_New[tmp[channelIndex].index].value;
|
||||
? DefaultValues.x1ProbeValues[tmp[channelIndex].index].value
|
||||
: DefaultValues.x10ProbeValues[tmp[channelIndex].index].value;
|
||||
tmp[channelIndex].course.unit = state.settings[channelIndex].probeMode === ProbeMode.x1
|
||||
? DefaultValues.x1ProbeValues_New[tmp[channelIndex].index].unit
|
||||
: DefaultValues.x10ProbeValues_New[tmp[channelIndex].index].unit;
|
||||
? DefaultValues.x1ProbeValues[tmp[channelIndex].index].unit
|
||||
: DefaultValues.x10ProbeValues[tmp[channelIndex].index].unit;
|
||||
|
||||
tmp2 = state.verticalOffset;
|
||||
|
||||
@ -143,11 +143,11 @@ export default function(state = VerticalWidgetInitialState, action: {type: any,
|
||||
|
||||
tmp[channelIndex].index = state.timePerDivision[channelIndex].index + 1;
|
||||
tmp[channelIndex].course.value = state.settings[channelIndex].probeMode === ProbeMode.x1
|
||||
? DefaultValues.x1ProbeValues_New[tmp[channelIndex].index].value
|
||||
: DefaultValues.x10ProbeValues_New[tmp[channelIndex].index].value;
|
||||
? DefaultValues.x1ProbeValues[tmp[channelIndex].index].value
|
||||
: DefaultValues.x10ProbeValues[tmp[channelIndex].index].value;
|
||||
tmp[channelIndex].course.unit = state.settings[channelIndex].probeMode === ProbeMode.x1
|
||||
? DefaultValues.x1ProbeValues_New[tmp[channelIndex].index].unit
|
||||
: DefaultValues.x10ProbeValues_New[tmp[channelIndex].index].unit;
|
||||
? DefaultValues.x1ProbeValues[tmp[channelIndex].index].unit
|
||||
: DefaultValues.x10ProbeValues[tmp[channelIndex].index].unit;
|
||||
|
||||
tmp2 = state.verticalOffset;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user