Features/bottombar redux #97
@ -1,12 +1,21 @@
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import './../../../css/bottombar/subscomponents/trigger.css';
|
||||
|
||||
function Trigger() {
|
||||
class Trigger extends React.Component<any, any> {
|
||||
render() {
|
||||
return (
|
||||
<div className="TriggerStatus">
|
||||
Trig:CH1, Mode:RisingEdge
|
||||
Trig:CH{this.props.triggerWidget.triggerChannel}, Mode:{this.props.triggerWidget.triggerType}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Trigger;
|
||||
function mapStateToProps(state: { triggerWidget: any; }) {
|
||||
return {
|
||||
triggerWidget: state.triggerWidget
|
||||
};
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps)(Trigger);
|
@ -0,0 +1,6 @@
|
||||
enum TriggerType {
|
||||
RisingEdge = "RisingEdge",
|
||||
FallingEdge = "FallingEdge"
|
||||
}
|
||||
|
||||
export default TriggerType;
|
@ -2,11 +2,13 @@ import { combineReducers } from 'redux';
|
||||
import horizontalWidgetReducer from './horizontalWidgetReducer';
|
||||
import verticalWidgetReducer from './verticalWidgetReducer';
|
||||
import measurementsWidgetReducer from './measurementsWidgetReducer';
|
||||
import triggerWidgetReducer from './triggerWidgetReducer';
|
||||
|
||||
export default combineReducers(
|
||||
{
|
||||
horizontalWidget: horizontalWidgetReducer,
|
||||
verticalWidget: verticalWidgetReducer,
|
||||
measurementsWidget: measurementsWidgetReducer
|
||||
measurementsWidget: measurementsWidgetReducer,
|
||||
triggerWidget: triggerWidgetReducer
|
||||
}
|
||||
);
|
||||
|
@ -0,0 +1,16 @@
|
||||
import TriggerType from '../../configuration/enums/triggerType';
|
||||
|
||||
const initialState = {
|
||||
triggerChannel: 1,
|
||||
triggerType: TriggerType.RisingEdge,
|
||||
triggerLevel: 0
|
||||
};
|
||||
|
||||
export default function(state = initialState, action: {type: any, payload: any}) {
|
||||
switch(action.type) {
|
||||
case "trigger/test":
|
||||
return { ...state };
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user