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

renamed course to coarse

This commit is contained in:
Jason Bonnell 2021-03-25 13:43:09 -04:00
parent 1b57c317ee
commit bec9281a31
14 changed files with 67 additions and 67 deletions

View File

@ -11,9 +11,9 @@ class Channel extends React.Component<any, any> {
<label>
CH{this.props.channelNumber}:
{" "}
{this.props.verticalWidget.settings[this.props.channelNumber-1].controlMode === ControlMode.Course
&& this.props.verticalWidget.timePerDivision[this.props.channelNumber-1].course.value.toString()
+ this.props.verticalWidget.timePerDivision[this.props.channelNumber-1].course.unit.toString() + "/div"}
{this.props.verticalWidget.settings[this.props.channelNumber-1].controlMode === ControlMode.Coarse
&& this.props.verticalWidget.timePerDivision[this.props.channelNumber-1].coarse.value.toString()
+ this.props.verticalWidget.timePerDivision[this.props.channelNumber-1].coarse.unit.toString() + "/div"}
{this.props.verticalWidget.settings[this.props.channelNumber-1].controlMode === ControlMode.Fine
&& (this.props.verticalWidget.settings[this.props.channelNumber-1].probeMode === ProbeMode.x1
? this.props.verticalWidget.timePerDivision[this.props.channelNumber-1].fine.value.toString()

View File

@ -7,8 +7,8 @@ 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.Coarse && this.props.horizontalWidget.horizontalTimeBase.coarse.value.toString()}
{this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Coarse && this.props.horizontalWidget.horizontalTimeBase.coarse.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>

View File

@ -42,7 +42,7 @@ class Graph extends React.Component<any, any> {
}
render() {
let base = this.props.horizontalWidget.horizontalTimeBase.course;
let base = this.props.horizontalWidget.horizontalTimeBase.coarse;
let dCount = DefaultValues.divisions.time;
let winSize = dCount * convertTime(base.value, base.unit, TimeUnit.NanoSecond);
let yTicks = [-128, -96, -64, -32, 0, 32, 64, 96, 128]

View File

@ -60,12 +60,12 @@ class HorizontalWidget extends React.Component<any, any> {
<div className="TimeBaseMode">
<button
className="CourseControlButton"
onClick={() => this.changeTimeBaseMode(ControlMode.Course)}>
className="CoarseControlButton"
onClick={() => this.changeTimeBaseMode(ControlMode.Coarse)}>
<label
className=""
style={{fontWeight: this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Course ? "bold" : "normal"}}>
Course
style={{fontWeight: this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Coarse ? "bold" : "normal"}}>
coarse
</label>
</button>
<button
@ -82,21 +82,21 @@ class HorizontalWidget extends React.Component<any, any> {
<div className="HorizontalWidgetAdjustBlock-HorizontalTimeBase">
<button
className="MinusButton"
onClick={() => this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Course ? this.decrementTimeBase() : this.decrementTimeBaseFine()}>
onClick={() => this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Coarse ? this.decrementTimeBase() : this.decrementTimeBaseFine()}>
-
</button>
<label
className="AdjustValueBlockHorizontalTimeBase"
style={{color: "white"}}
>
{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.Coarse && this.props.horizontalWidget.horizontalTimeBase.coarse.value.toString()}
{this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Coarse && this.props.horizontalWidget.horizontalTimeBase.coarse.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"}
</label>
<button
className="PlusButton"
onClick={() => this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Course ? this.incrementTimeBase() : this.incrementTimeBaseFine()}>
onClick={() => this.props.horizontalWidget.horizontalTimeBase.mode === ControlMode.Coarse ? this.incrementTimeBase() : this.incrementTimeBaseFine()}>
+
</button>
</div>

View File

@ -129,8 +129,8 @@ class MeasurementsWidget extends React.Component<any, any> {
className="Channel1-MaxValue"
style={{color: this.props.settings.colors.channel[0]}}>
{this.props.measurementsWidget.max[0].value}
{this.props.verticalWidget.settings[0].controlMode === ControlMode.Course
&& this.props.verticalWidget.timePerDivision[0].course.unit.toString()}
{this.props.verticalWidget.settings[0].controlMode === ControlMode.Coarse
&& this.props.verticalWidget.timePerDivision[0].coarse.unit.toString()}
{this.props.verticalWidget.settings[0].controlMode === ControlMode.Fine
&& + this.props.verticalWidget.timePerDivision[0].fine.unit.toString()}
</label>
@ -144,8 +144,8 @@ class MeasurementsWidget extends React.Component<any, any> {
className="Channel1-MinValue"
style={{color: this.props.settings.colors.channel[0]}}>
{this.props.measurementsWidget.min[0].value}
{this.props.verticalWidget.settings[0].controlMode === ControlMode.Course
&& this.props.verticalWidget.timePerDivision[0].course.unit.toString()}
{this.props.verticalWidget.settings[0].controlMode === ControlMode.Coarse
&& this.props.verticalWidget.timePerDivision[0].coarse.unit.toString()}
{this.props.verticalWidget.settings[0].controlMode === ControlMode.Fine
&& + this.props.verticalWidget.timePerDivision[0].fine.unit.toString()}
</label>
@ -169,8 +169,8 @@ class MeasurementsWidget extends React.Component<any, any> {
className="Channel2-MaxValue"
style={{color: this.props.settings.colors.channel[1]}}>
{this.props.measurementsWidget.max[1].value}
{this.props.verticalWidget.settings[1].controlMode === ControlMode.Course
&& this.props.verticalWidget.timePerDivision[1].course.unit.toString()}
{this.props.verticalWidget.settings[1].controlMode === ControlMode.Coarse
&& this.props.verticalWidget.timePerDivision[1].coarse.unit.toString()}
{this.props.verticalWidget.settings[1].controlMode === ControlMode.Fine
&& + this.props.verticalWidget.timePerDivision[1].fine.unit.toString()}
</label>
@ -184,8 +184,8 @@ class MeasurementsWidget extends React.Component<any, any> {
className="Channel2-MinValue"
style={{color: this.props.settings.colors.channel[1]}}>
{this.props.measurementsWidget.min[1].value}
{this.props.verticalWidget.settings[1].controlMode === ControlMode.Course
&& this.props.verticalWidget.timePerDivision[1].course.unit.toString()}
{this.props.verticalWidget.settings[1].controlMode === ControlMode.Coarse
&& this.props.verticalWidget.timePerDivision[1].coarse.unit.toString()}
{this.props.verticalWidget.settings[1].controlMode === ControlMode.Fine
&& + this.props.verticalWidget.timePerDivision[1].fine.unit.toString()}
</label>
@ -209,8 +209,8 @@ class MeasurementsWidget extends React.Component<any, any> {
className="Channel3-MaxValue"
style={{color: this.props.settings.colors.channel[2]}}>
{this.props.measurementsWidget.max[2].value}
{this.props.verticalWidget.settings[2].controlMode === ControlMode.Course
&& this.props.verticalWidget.timePerDivision[2].course.unit.toString()}
{this.props.verticalWidget.settings[2].controlMode === ControlMode.Coarse
&& this.props.verticalWidget.timePerDivision[2].coarse.unit.toString()}
{this.props.verticalWidget.settings[2].controlMode === ControlMode.Fine
&& + this.props.verticalWidget.timePerDivision[2].fine.unit.toString()}
</label>
@ -224,8 +224,8 @@ class MeasurementsWidget extends React.Component<any, any> {
className="Channel3-MinValue"
style={{color: this.props.settings.colors.channel[2]}}>
{this.props.measurementsWidget.min[2].value}
{this.props.verticalWidget.settings[2].controlMode === ControlMode.Course
&& this.props.verticalWidget.timePerDivision[2].course.unit.toString()}
{this.props.verticalWidget.settings[2].controlMode === ControlMode.Coarse
&& this.props.verticalWidget.timePerDivision[2].coarse.unit.toString()}
{this.props.verticalWidget.settings[2].controlMode === ControlMode.Fine
&& + this.props.verticalWidget.timePerDivision[2].fine.unit.toString()}
</label>
@ -249,8 +249,8 @@ class MeasurementsWidget extends React.Component<any, any> {
className="Channel4-MaxValue"
style={{color: this.props.settings.colors.channel[3]}}>
{this.props.measurementsWidget.max[3].value}
{this.props.verticalWidget.settings[3].controlMode === ControlMode.Course
&& this.props.verticalWidget.timePerDivision[3].course.unit.toString()}
{this.props.verticalWidget.settings[3].controlMode === ControlMode.Coarse
&& this.props.verticalWidget.timePerDivision[3].coarse.unit.toString()}
{this.props.verticalWidget.settings[3].controlMode === ControlMode.Fine
&& + this.props.verticalWidget.timePerDivision[3].fine.unit.toString()}
</label>
@ -264,8 +264,8 @@ class MeasurementsWidget extends React.Component<any, any> {
className="Channel4-MinValue"
style={{color: this.props.settings.colors.channel[3]}}>
{this.props.measurementsWidget.min[3].value}
{this.props.verticalWidget.settings[3].controlMode === ControlMode.Course
&& this.props.verticalWidget.timePerDivision[3].course.unit.toString()}
{this.props.verticalWidget.settings[3].controlMode === ControlMode.Coarse
&& this.props.verticalWidget.timePerDivision[3].coarse.unit.toString()}
{this.props.verticalWidget.settings[3].controlMode === ControlMode.Fine
&& + this.props.verticalWidget.timePerDivision[3].fine.unit.toString()}
</label>

View File

@ -132,12 +132,12 @@ class VerticalWidget extends React.Component<any, any> {
</div>
<div className="DivisionMode">
<button
className="CourseControlButton"
onClick={() => this.changeControlMode(ControlMode.Course)}>
className="CoarseControlButton"
onClick={() => this.changeControlMode(ControlMode.Coarse)}>
<label
className=""
style={{fontWeight: this.props.verticalWidget.settings[this.props.verticalWidget.activeChannel-1].controlMode === ControlMode.Course ? "bold" : "normal"}}>
Course
style={{fontWeight: this.props.verticalWidget.settings[this.props.verticalWidget.activeChannel-1].controlMode === ControlMode.Coarse ? "bold" : "normal"}}>
Coarse
</label>
</button>
<button
@ -154,16 +154,16 @@ class VerticalWidget extends React.Component<any, any> {
<div className="VerticalWidgetAdjustBlock-TimePerDivision">
<button
className="MinusButton"
onClick={() => this.props.verticalWidget.settings[this.props.verticalWidget.activeChannel-1].controlMode === ControlMode.Course ? this.decrementTimePerDivision() : this.decrementTimePerDivisionFine()}>
onClick={() => this.props.verticalWidget.settings[this.props.verticalWidget.activeChannel-1].controlMode === ControlMode.Coarse ? this.decrementTimePerDivision() : this.decrementTimePerDivisionFine()}>
-
</button>
<label
className="AdjustValueBlockTimePerDivision"
style={{color: this.props.settings.colors.channel[this.props.verticalWidget.activeChannel-1]}}
>
{this.props.verticalWidget.settings[this.props.verticalWidget.activeChannel-1].controlMode === ControlMode.Course
&& this.props.verticalWidget.timePerDivision[this.props.verticalWidget.activeChannel-1].course.value.toString()
+ this.props.verticalWidget.timePerDivision[this.props.verticalWidget.activeChannel-1].course.unit.toString() + "/div"}
{this.props.verticalWidget.settings[this.props.verticalWidget.activeChannel-1].controlMode === ControlMode.Coarse
&& this.props.verticalWidget.timePerDivision[this.props.verticalWidget.activeChannel-1].coarse.value.toString()
+ this.props.verticalWidget.timePerDivision[this.props.verticalWidget.activeChannel-1].coarse.unit.toString() + "/div"}
{this.props.verticalWidget.settings[this.props.verticalWidget.activeChannel-1].controlMode === ControlMode.Fine
&& (this.props.verticalWidget.settings[this.props.verticalWidget.activeChannel-1].probeMode === ProbeMode.x1
? this.props.verticalWidget.timePerDivision[this.props.verticalWidget.activeChannel-1].fine.value.toString()
@ -172,7 +172,7 @@ class VerticalWidget extends React.Component<any, any> {
</label>
<button
className="PlusButton"
onClick={() => this.props.verticalWidget.settings[this.props.verticalWidget.activeChannel-1].controlMode === ControlMode.Course ? this.incrementTimePerDivision() : this.incrementTimePerDivisionFine()}>
onClick={() => this.props.verticalWidget.settings[this.props.verticalWidget.activeChannel-1].controlMode === ControlMode.Coarse ? this.incrementTimePerDivision() : this.incrementTimePerDivisionFine()}>
+
</button>
</div>

View File

@ -1,5 +1,5 @@
enum ControlMode {
Course,
Coarse,
Fine
}

View File

@ -32,7 +32,7 @@
font-weight: bold;
}
.CourseControlButton {
.CoarseControlButton {
margin-right: 1vw;
margin-left: 1vw;
margin-bottom: 1vh;

View File

@ -71,7 +71,7 @@
font-weight: bold;
}
.CourseControlButton {
.CoarseControlButton {
margin-right: 1vw;
margin-left: 1vw;
margin-bottom: 1vh;

View File

@ -6,9 +6,9 @@ let index = 3; //originally 15
const HorizontalWidgetInitialState = {
horizontalTimeBase: {
mode: ControlMode.Course,
mode: ControlMode.Coarse,
index: index,
course: {
coarse: {
value: DefaultValues.horizontalTimeBases[index].value, //originally index 15
unit: DefaultValues.horizontalTimeBases[index].unit //originally index 15
},

View File

@ -9,7 +9,7 @@ const VerticalWidgetInitialState = {
totalChannelsUsed: 4,
timePerDivision: [
{
course: {
coarse: {
value: DefaultValues.x1ProbeValues[6].value,
unit: DefaultValues.x1ProbeValues[6].unit
},
@ -21,7 +21,7 @@ const VerticalWidgetInitialState = {
index: 6
},
{
course: {
coarse: {
value: DefaultValues.x1ProbeValues[6].value,
unit: DefaultValues.x1ProbeValues[6].unit
},
@ -33,7 +33,7 @@ const VerticalWidgetInitialState = {
index: 6
},
{
course: {
coarse: {
value: DefaultValues.x1ProbeValues[6].value,
unit: DefaultValues.x1ProbeValues[6].unit
},
@ -45,7 +45,7 @@ const VerticalWidgetInitialState = {
index: 6
},
{
course: {
coarse: {
value: DefaultValues.x1ProbeValues[6].value,
unit: DefaultValues.x1ProbeValues[6].unit
},
@ -59,28 +59,28 @@ const VerticalWidgetInitialState = {
],
settings: [
{
controlMode: ControlMode.Course,
controlMode: ControlMode.Coarse,
probeMode: ProbeMode.x1,
coupling: MeasurementType.DC,
bandwidth: 100,
status: 1
},
{
controlMode: ControlMode.Course,
controlMode: ControlMode.Coarse,
probeMode: ProbeMode.x1,
coupling: MeasurementType.DC,
bandwidth: 100,
status: 1
},
{
controlMode: ControlMode.Course,
controlMode: ControlMode.Coarse,
probeMode: ProbeMode.x1,
coupling: MeasurementType.DC,
bandwidth: 100,
status: 1
},
{
controlMode: ControlMode.Course,
controlMode: ControlMode.Coarse,
probeMode: ProbeMode.x1,
coupling: MeasurementType.DC,
bandwidth: 100,

View File

@ -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.coarse.unit
}
}
case "horizontal/changeTimeBaseUnit":
@ -39,7 +39,7 @@ export default function(state = HorizontalWidgetInitialState, action: {type: any
...state,
horizontalTimeBase: {
...state.horizontalTimeBase,
course: {
coarse: {
value: DefaultValues.horizontalTimeBases[state.horizontalTimeBase.index + 1].value,
unit: DefaultValues.horizontalTimeBases[state.horizontalTimeBase.index + 1].unit
},
@ -58,7 +58,7 @@ export default function(state = HorizontalWidgetInitialState, action: {type: any
...state,
horizontalTimeBase: {
...state.horizontalTimeBase,
course: {
coarse: {
value: DefaultValues.horizontalTimeBases[state.horizontalTimeBase.index - 1].value,
unit: DefaultValues.horizontalTimeBases[state.horizontalTimeBase.index - 1].unit
},

View File

@ -17,7 +17,7 @@ export default function(state = VerticalWidgetInitialState, action: {type: any,
tmp2 = state.verticalOffset;
tmp2[channelIndex].unit = action.payload === ControlMode.Fine ? state.timePerDivision[channelIndex].fine.unit : state.timePerDivision[channelIndex].course.unit;
tmp2[channelIndex].unit = action.payload === ControlMode.Fine ? state.timePerDivision[channelIndex].fine.unit : state.timePerDivision[channelIndex].coarse.unit;
return {
...state,
settings: tmp,
@ -56,16 +56,16 @@ export default function(state = VerticalWidgetInitialState, action: {type: any,
tmp2 = state.timePerDivision;
tmp2[channelIndex].course.value = action.payload === ProbeMode.x1
tmp2[channelIndex].coarse.value = action.payload === ProbeMode.x1
? DefaultValues.x1ProbeValues[state.timePerDivision[channelIndex].index].value
: DefaultValues.x10ProbeValues[state.timePerDivision[channelIndex].index].value;
tmp2[channelIndex].course.unit = action.payload === ProbeMode.x1
tmp2[channelIndex].coarse.unit = action.payload === ProbeMode.x1
? DefaultValues.x1ProbeValues[state.timePerDivision[channelIndex].index].unit
: DefaultValues.x10ProbeValues[state.timePerDivision[channelIndex].index].unit;
tmp3 = state.verticalOffset;
tmp3[channelIndex].unit = tmp2[channelIndex].course.unit;
tmp3[channelIndex].unit = tmp2[channelIndex].coarse.unit;
return {
...state,
settings: tmp,
@ -120,16 +120,16 @@ export default function(state = VerticalWidgetInitialState, action: {type: any,
tmp = state.timePerDivision;
tmp[channelIndex].index = state.timePerDivision[channelIndex].index - 1;
tmp[channelIndex].course.value = state.settings[channelIndex].probeMode === ProbeMode.x1
tmp[channelIndex].coarse.value = state.settings[channelIndex].probeMode === ProbeMode.x1
? DefaultValues.x1ProbeValues[tmp[channelIndex].index].value
: DefaultValues.x10ProbeValues[tmp[channelIndex].index].value;
tmp[channelIndex].course.unit = state.settings[channelIndex].probeMode === ProbeMode.x1
tmp[channelIndex].coarse.unit = state.settings[channelIndex].probeMode === ProbeMode.x1
? DefaultValues.x1ProbeValues[tmp[channelIndex].index].unit
: DefaultValues.x10ProbeValues[tmp[channelIndex].index].unit;
tmp2 = state.verticalOffset;
tmp2[channelIndex].unit = tmp[channelIndex].course.unit;
tmp2[channelIndex].unit = tmp[channelIndex].coarse.unit;
return {
...state,
timePerDivision: tmp,
@ -142,16 +142,16 @@ export default function(state = VerticalWidgetInitialState, action: {type: any,
tmp = state.timePerDivision;
tmp[channelIndex].index = state.timePerDivision[channelIndex].index + 1;
tmp[channelIndex].course.value = state.settings[channelIndex].probeMode === ProbeMode.x1
tmp[channelIndex].coarse.value = state.settings[channelIndex].probeMode === ProbeMode.x1
? DefaultValues.x1ProbeValues[tmp[channelIndex].index].value
: DefaultValues.x10ProbeValues[tmp[channelIndex].index].value;
tmp[channelIndex].course.unit = state.settings[channelIndex].probeMode === ProbeMode.x1
tmp[channelIndex].coarse.unit = state.settings[channelIndex].probeMode === ProbeMode.x1
? DefaultValues.x1ProbeValues[tmp[channelIndex].index].unit
: DefaultValues.x10ProbeValues[tmp[channelIndex].index].unit;
tmp2 = state.verticalOffset;
tmp2[channelIndex].unit = tmp[channelIndex].course.unit;
tmp2[channelIndex].unit = tmp[channelIndex].coarse.unit;
return {
...state,
timePerDivision: tmp,

View File

@ -46,7 +46,7 @@ class TestPoints {
writeData: [74, 0]
}
let base = state.horizontalWidget.horizontalTimeBase.course;
let base = state.horizontalWidget.horizontalTimeBase.coarse;
let dCount = DefaultValues.divisions.time;
let xLimit = dCount * convertTime(base.value, base.unit, TimeUnit.NanoSecond);
this.setWinArgs = {
@ -70,7 +70,7 @@ class TestPoints {
update() {
if(this.setChDone && this.setFileDone && this.setWinDone) {
let state = store.getState();
let base = state.horizontalWidget.horizontalTimeBase.course;
let base = state.horizontalWidget.horizontalTimeBase.coarse;
let xLimit = convertTime(base.value, base.unit, TimeUnit.NanoSecond);
let doMath = state.mathWidget.mathEnabled as boolean;
let order = state.verticalWidget.getDataChannelOrder as number[];