@@ -13,7 +13,8 @@ import {
13
13
} from '../../helpers/chem' ;
14
14
import { resetAll } from '../../actions/manager' ;
15
15
import { selectUiSweep , scrollUiWheel , clickUiTarget } from '../../actions/ui' ;
16
- import { selectWavelength } from '../../actions/hplcms' ;
16
+ import { selectWavelength , changeTic } from '../../actions/hplcms' ;
17
+ import { selectCurve } from '../../actions/curve' ;
17
18
import RectFocus from './rect_focus' ;
18
19
import MultiFocus from './multi_focus' ;
19
20
import LineFocus from './line_focus' ;
@@ -30,7 +31,8 @@ const W = Math.round(window.innerWidth * 0.90 * 9 / 12); // ROI
30
31
const H = Math . round ( window . innerHeight * 0.90 * 0.85 / 3 ) ; // ROI
31
32
32
33
const waveLengthSelect = ( classes , hplcMsSt , updateWaveLengthAct ) => {
33
- const { listWaveLength, selectedWaveLength } = hplcMsSt ;
34
+ const { uvvis } = hplcMsSt ;
35
+ const { listWaveLength, selectedWaveLength } = uvvis ;
34
36
const options = listWaveLength . map ( ( d ) => (
35
37
< MenuItem value = { d } key = { d } >
36
38
< span className = { classNames ( classes . txtOpt , 'option-sv-bar-decimal' ) } >
@@ -60,6 +62,38 @@ const waveLengthSelect = (classes, hplcMsSt, updateWaveLengthAct) => {
60
62
) ;
61
63
} ;
62
64
65
+ const ticSelect = ( classes , hplcMsSt , updateTicAct ) => {
66
+ const { tic } = hplcMsSt ;
67
+ const { isNegative } = tic ;
68
+ const listTIC = [ { name : 'PLUS' , value : 0 } , { name : 'MINUS' , value : 1 } ] ;
69
+ const options = listTIC . map ( ( d ) => (
70
+ < MenuItem value = { d . value } key = { d . value } >
71
+ < span className = { classNames ( classes . txtOpt , 'option-sv-bar-decimal' ) } >
72
+ { d . name }
73
+ </ span >
74
+ </ MenuItem >
75
+ ) ) ;
76
+
77
+ return (
78
+ < FormControl
79
+ className = { classNames ( classes . fieldDecimal ) }
80
+ variant = "outlined"
81
+ >
82
+ < InputLabel id = "select-decimal-label" className = { classNames ( classes . selectLabel , 'select-sv-bar-label' ) } >
83
+ TIC
84
+ </ InputLabel >
85
+ < Select
86
+ labelId = "select-decimal-label"
87
+ label = "Decimal"
88
+ value = { isNegative ? 1 : 0 }
89
+ onChange = { updateTicAct }
90
+ className = { classNames ( classes . selectInput , 'input-sv-bar-decimal' ) }
91
+ >
92
+ { options }
93
+ </ Select >
94
+ </ FormControl >
95
+ ) ;
96
+ } ;
63
97
class ViewerLineRect extends React . Component {
64
98
constructor ( props ) {
65
99
super ( props ) ;
@@ -97,6 +131,8 @@ class ViewerLineRect extends React.Component {
97
131
resetAllAct,
98
132
} = this . props ;
99
133
drawDestroy ( this . rootKlassMulti ) ;
134
+ drawDestroy ( this . rootKlassLine ) ;
135
+ drawDestroy ( this . rootKlassRect ) ;
100
136
resetAllAct ( feature ) ;
101
137
102
138
const uvvisViewFeature = this . extractUvvisView ( ) ;
@@ -155,6 +191,26 @@ class ViewerLineRect extends React.Component {
155
191
} = this . props ;
156
192
this . normChange ( prevProps ) ;
157
193
194
+ const uvvisViewFeature = this . extractUvvisView ( ) ;
195
+ if ( uvvisViewFeature ) {
196
+ const { data } = uvvisViewFeature ;
197
+ const currentData = data [ 0 ] ;
198
+ const { x, y } = currentData ;
199
+ const uvvisSeed = x . map ( ( d , index ) => {
200
+ const s = { x : d , y : y [ index ] } ;
201
+ return s ;
202
+ } ) ;
203
+ this . lineFocus . update ( {
204
+ filterSeed : uvvisSeed ,
205
+ filterPeak : [ ] ,
206
+ tTrEndPts,
207
+ isUiNoBrushSt : true ,
208
+ sweepExtentSt : sweepExtentSubViewSt ,
209
+ } ) ;
210
+ drawLabel ( this . rootKlassLine , null , 'M/Z' , 'Intensity' ) ;
211
+ drawDisplay ( this . rootKlassLine , false ) ;
212
+ }
213
+
158
214
const filterSeed = seed ;
159
215
160
216
this . multiFocus . update ( {
@@ -208,14 +264,16 @@ class ViewerLineRect extends React.Component {
208
264
const {
209
265
features,
210
266
} = extractParams ( subEntities [ 0 ] , 0 , 1 ) ;
211
- const { wavelengthIdx } = hplcMsSt ;
267
+ const { uvvis } = hplcMsSt ;
268
+ const { wavelengthIdx } = uvvis ;
212
269
return features [ wavelengthIdx ] ;
213
270
}
214
271
215
272
extractSubView ( ) {
216
- const { uiSt, subEntities, curveSt } = this . props ;
217
- const { curveIdx } = curveSt ;
218
- const entityIdx = curveIdx === 0 ? 1 : 2 ;
273
+ const { uiSt, subEntities, hplcMsSt } = this . props ;
274
+ const { tic } = hplcMsSt ;
275
+ const { isNegative } = tic ;
276
+ const entityIdx = isNegative ? 2 : 1 ;
219
277
const { subViewerAt } = uiSt ;
220
278
let selectFeature = null ;
221
279
@@ -235,13 +293,22 @@ class ViewerLineRect extends React.Component {
235
293
}
236
294
237
295
render ( ) {
238
- const { hplcMsSt, selectWavelengthAct } = this . props ;
296
+ const {
297
+ hplcMsSt, selectWavelengthAct, updateTicAct, selectCurveAct,
298
+ } = this . props ;
299
+ const handleTicChanged = ( event ) => {
300
+ updateTicAct ( event ) ;
301
+ selectCurveAct ( event . target . value ) ;
302
+ } ;
239
303
return (
240
304
< div >
241
305
{
242
306
waveLengthSelect ( classNames , hplcMsSt , selectWavelengthAct )
243
307
}
244
308
< div className = { LIST_ROOT_SVG_GRAPH . LINE } />
309
+ {
310
+ ticSelect ( classNames , hplcMsSt , handleTicChanged )
311
+ }
245
312
< div className = { LIST_ROOT_SVG_GRAPH . MULTI } />
246
313
< Zoom isSubView />
247
314
< div className = { LIST_ROOT_SVG_GRAPH . RECT } />
@@ -271,6 +338,8 @@ const mapDispatchToProps = (dispatch) => (
271
338
selectUiSweepAct : selectUiSweep ,
272
339
scrollUiWheelAct : scrollUiWheel ,
273
340
selectWavelengthAct : selectWavelength ,
341
+ updateTicAct : changeTic ,
342
+ selectCurveAct : selectCurve ,
274
343
} , dispatch )
275
344
) ;
276
345
@@ -297,6 +366,8 @@ ViewerLineRect.propTypes = {
297
366
isHidden : PropTypes . bool . isRequired ,
298
367
hplcMsSt : PropTypes . bool . isRequired ,
299
368
selectWavelengthAct : PropTypes . func . isRequired ,
369
+ updateTicAct : PropTypes . func . isRequired ,
370
+ selectCurveAct : PropTypes . func . isRequired ,
300
371
} ;
301
372
302
373
export default connect ( mapStateToProps , mapDispatchToProps ) ( ViewerLineRect ) ;
0 commit comments