mirror of
https://github.com/EEVengers/ThunderScope.git
synced 2025-04-22 17:43:44 +00:00
added electron side of hiding waveforms
This commit is contained in:
parent
280b4f1686
commit
0479626684
Software/waveview/src
components
redux
initialStates
reducers/widgets
@ -81,12 +81,14 @@ class Graph extends React.Component<any, any> {
|
||||
/>
|
||||
{
|
||||
this.generator.getData().map((data: any, index: any) => {
|
||||
return <LineSeries
|
||||
return (
|
||||
<LineSeries
|
||||
className="data-series"
|
||||
data={data}
|
||||
style={{fill:"none", transform: "translate(0,0)"}}
|
||||
style={{fill:"none", transform: "translate(0,0)", opacity: this.props.verticalWidget.settings[index].status}}
|
||||
color={this.props.settings.colors.channel[index]}
|
||||
/>
|
||||
)
|
||||
})
|
||||
}
|
||||
</FlexibleXYPlot>
|
||||
@ -95,10 +97,11 @@ class Graph extends React.Component<any, any> {
|
||||
}
|
||||
}
|
||||
|
||||
function mapStateToProps(state: { graph: any, settings: any }) {
|
||||
function mapStateToProps(state: { graph: any, settings: any, verticalWidget: any }) {
|
||||
return {
|
||||
graph: state.graph,
|
||||
settings: state.settings
|
||||
settings: state.settings,
|
||||
verticalWidget: state.verticalWidget
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ class TriggerWidget extends React.Component<any, any> {
|
||||
|
||||
toggleMathMode = (mathEnabled: boolean) => {
|
||||
this.props.dispatch({type: 'math/toggleMathMode', payload: mathEnabled });
|
||||
this.props.dispatch({type: 'vertical/toggleMathWaveform' });
|
||||
}
|
||||
|
||||
changeChannel1 = (channelNumber: number) => {
|
||||
@ -179,9 +180,10 @@ class TriggerWidget extends React.Component<any, any> {
|
||||
}
|
||||
}
|
||||
|
||||
function mapStateToProps(state: { mathWidget: any, settings: any}) {
|
||||
function mapStateToProps(state: { mathWidget: any, verticalWidget: any, settings: any}) {
|
||||
return {
|
||||
mathWidget: state.mathWidget,
|
||||
verticalWidget: state.verticalWidget,
|
||||
settings: state.settings
|
||||
};
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import MathOperators from '../../configuration/enums/mathOperators';
|
||||
|
||||
const MathWidgetInitialState = {
|
||||
mathEnabled: true,
|
||||
mathEnabled: false,
|
||||
mathOperator: MathOperators.Addition,
|
||||
channel1: 1,
|
||||
channel2: 2
|
||||
|
@ -6,9 +6,9 @@ const SettingsInitialState = {
|
||||
DefaultColors.Channel1,
|
||||
DefaultColors.Channel2,
|
||||
DefaultColors.Channel3,
|
||||
DefaultColors.Channel4
|
||||
],
|
||||
math: DefaultColors.Math
|
||||
DefaultColors.Channel4,
|
||||
DefaultColors.Math
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -85,6 +85,9 @@ const VerticalWidgetInitialState = {
|
||||
coupling: MeasurementType.DC,
|
||||
bandwidth: 100,
|
||||
status: 1
|
||||
},
|
||||
{
|
||||
status: 0
|
||||
}
|
||||
],
|
||||
verticalOffset: [
|
||||
|
@ -81,6 +81,7 @@ export default function(state = VerticalWidgetInitialState, action: {type: any,
|
||||
settings: tmp
|
||||
};
|
||||
case "vertical/changeChannelStatus":
|
||||
// TODO: Call C and tell them that we want to either start getting or stop receiving data from the channel
|
||||
tmp = state.settings;
|
||||
var newTotalChannelsUsed = state.totalChannelsUsed;
|
||||
|
||||
@ -175,6 +176,15 @@ export default function(state = VerticalWidgetInitialState, action: {type: any,
|
||||
...state,
|
||||
timePerDivision: tmp
|
||||
};
|
||||
case "vertical/toggleMathWaveform":
|
||||
tmp = state.settings;
|
||||
var newStatus = (state.settings[4].status === 1) ? 0 : 1;
|
||||
|
||||
state.settings[4].status = newStatus;
|
||||
return {
|
||||
...state,
|
||||
settings: tmp
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user