@@ -17,6 +17,7 @@ import { MuButton, commonStyle, focusStyle } from './common';
17
17
import { LIST_UI_SWEEP_TYPE } from '../../constants/list_ui' ;
18
18
import TriBtn from './tri_btn' ;
19
19
import { clearAllPeaks } from '../../actions/edit_peak' ;
20
+ import { extractPeaksEdit } from '../../helpers/extractPeaksEdit' ;
20
21
21
22
const styles = ( ) => (
22
23
Object . assign (
@@ -32,13 +33,15 @@ const Peak = ({
32
33
isFocusSetRefSt, disableSetRefSt,
33
34
isHandleMaxAndMinPeaksSt,
34
35
cyclicVotaSt, curveSt,
35
- clearAllPeaksAct,
36
+ clearAllPeaksAct, feature,
37
+ editPeakSt, thresSt, shiftSt, layoutSt,
36
38
} ) => {
37
39
let onSweepPeakAdd = ( ) => setUiSweepTypeAct ( LIST_UI_SWEEP_TYPE . PEAK_ADD ) ;
38
40
let onSweepPeakDELETE = ( ) => setUiSweepTypeAct ( LIST_UI_SWEEP_TYPE . PEAK_DELETE ) ;
39
41
let onSweepAnchorShift = ( ) => setUiSweepTypeAct ( LIST_UI_SWEEP_TYPE . ANCHOR_SHIFT ) ;
40
42
const { curveIdx } = curveSt ;
41
- const onClearAll = ( ) => clearAllPeaksAct ( { curveIdx } ) ;
43
+ const dataPeaks = extractPeaksEdit ( feature , editPeakSt , thresSt , shiftSt , layoutSt ) ;
44
+ const onClearAll = ( ) => clearAllPeaksAct ( { curveIdx, dataPeaks } ) ;
42
45
if ( isHandleMaxAndMinPeaksSt ) {
43
46
const { spectraList } = cyclicVotaSt ;
44
47
const spectra = spectraList [ curveIdx ] ;
@@ -120,7 +123,7 @@ const Peak = ({
120
123
) ;
121
124
} ;
122
125
123
- const mapStateToProps = ( state , _ ) => ( // eslint-disable-line
126
+ const mapStateToProps = ( state , props ) => ( // eslint-disable-line
124
127
{
125
128
isFocusAddPeakSt : state . ui . sweepType === LIST_UI_SWEEP_TYPE . PEAK_ADD || state . ui . sweepType === LIST_UI_SWEEP_TYPE . CYCLIC_VOLTA_ADD_MAX_PEAK || state . ui . sweepType === LIST_UI_SWEEP_TYPE . CYCLIC_VOLTA_ADD_MIN_PEAK ,
126
129
disableAddPeakSt : Cfg . btnCmdAddPeak ( state . layout ) ,
@@ -131,6 +134,10 @@ const mapStateToProps = (state, _) => ( // eslint-disable-line
131
134
isHandleMaxAndMinPeaksSt : ! Cfg . hidePanelCyclicVolta ( state . layout ) ,
132
135
cyclicVotaSt : state . cyclicvolta ,
133
136
curveSt : state . curve ,
137
+ editPeakSt : state . editPeak . present ,
138
+ thresSt : state . threshold ,
139
+ layoutSt : state . layout ,
140
+ shiftSt : state . shift ,
134
141
}
135
142
) ;
136
143
@@ -154,6 +161,11 @@ Peak.propTypes = {
154
161
cyclicVotaSt : PropTypes . object . isRequired ,
155
162
curveSt : PropTypes . object . isRequired ,
156
163
clearAllPeaksAct : PropTypes . func . isRequired ,
164
+ feature : PropTypes . object . isRequired ,
165
+ editPeakSt : PropTypes . object . isRequired ,
166
+ thresSt : PropTypes . object . isRequired ,
167
+ layoutSt : PropTypes . string . isRequired ,
168
+ shiftSt : PropTypes . object . isRequired ,
157
169
} ;
158
170
159
171
export default compose (
0 commit comments