@@ -31,6 +31,7 @@ import {dispatchAddImages,getAViewFromMultiView} from '../visualize/MultiViewCnt
31
31
import WebPlotRequest from '../visualize/WebPlotRequest.js' ;
32
32
import { dispatchPlotImage } from '../visualize/ImagePlotCntlr.js' ;
33
33
import { FileUpload } from '../ui/FileUpload.jsx' ;
34
+ import { getActiveTarget } from '../core/AppDataCntlr.js' ;
34
35
35
36
import './CatalogSearchMethodType.css' ;
36
37
/*
@@ -61,13 +62,14 @@ export class CatalogSearchMethodType extends Component {
61
62
render ( ) {
62
63
const { fields} = this . state ;
63
64
const searchType = get ( fields , 'spatial.value' , SpatialMethod . Cone . value ) ;
65
+ const max = get ( fields , 'conesize.max' , 10 ) ;
64
66
const { groupKey} = this . props ;
65
67
66
68
return (
67
- < div style = { { padding : 10 , display :'flex' , flexDirection :'column' , flexWrap : 'no-wrap ', alignItems :'center' } } >
69
+ < div style = { { display :'flex' , flexDirection :'column' , alignItems :'center' } } >
68
70
{ renderTargetPanel ( groupKey , searchType ) }
69
71
< div
70
- style = { { display :'flex' , flexDirection :'row ' , flexWrap :'no-wrap' , alignItems :'center' } } >
72
+ style = { { display :'flex' , flexDirection :'column ' , flexWrap :'no-wrap' , alignItems :'center' } } >
71
73
< ListBoxInputField
72
74
fieldKey = 'spatial'
73
75
initialState = { {
@@ -77,10 +79,10 @@ export class CatalogSearchMethodType extends Component {
77
79
value :SpatialMethod . Cone . value
78
80
} }
79
81
options = { spatialOptions ( ) }
80
- wrapperStyle = { { marginRight :'15px' } }
82
+ wrapperStyle = { { marginRight :'15px' , padding : '10px 0 5px 0' } }
81
83
multiple = { false }
82
84
/>
83
- { sizeArea ( searchType ) }
85
+ { sizeArea ( searchType , max ) }
84
86
</ div >
85
87
</ div >
86
88
) ;
@@ -119,12 +121,12 @@ const spatialOptions = () => {
119
121
* @param {number } max by default is 1 degree (3600 arcsec)
120
122
* @returns {XML } SizeInputFields component
121
123
*/
122
- function radiusInField ( label = 'Radius:' , tooltip = 'Enter radius of the search' , min = 1 / 3600 , max = 1 ) {
124
+ function radiusInField ( { label = 'Radius:' , tooltip = 'Enter radius of the search' , min = 1 / 3600 , max = 1 } ) {
123
125
return (
124
126
< SizeInputFields fieldKey = 'conesize' showFeedback = { true }
125
127
wrapperStyle = { { padding :5 , margin : '5px 0 5px 0' } }
126
128
initialState = { {
127
- value :initRadiusArcSec ,
129
+ value :initRadiusArcSec ( max ) ,
128
130
tooltip : { tooltip} ,
129
131
unit : 'arcsec' ,
130
132
min : { min} ,
@@ -134,19 +136,19 @@ function radiusInField(label = 'Radius:', tooltip = 'Enter radius of the search'
134
136
label = { label } />
135
137
) ;
136
138
}
137
- function sizeArea ( searchType ) {
139
+ function sizeArea ( searchType , max ) {
138
140
139
141
if ( searchType === SpatialMethod . Cone . value ) {
140
142
return (
141
143
< div style = { { border : '1px solid #a3aeb9' } } >
142
- { radiusInField ( ) }
144
+ { radiusInField ( { max } ) }
143
145
</ div >
144
146
) ;
145
147
} else if ( searchType === SpatialMethod . Elliptical . value ) {
146
148
return (
147
149
< div
148
150
style = { { padding :5 , display :'flex' , flexDirection :'column' , flexWrap :'no-wrap' , alignItems :'center' , border :'solid #a3aeb9 1px' } } >
149
- { radiusInField ( 'Semi-major Axis:' , 'Enter the semi-major axis of the search' ) }
151
+ { radiusInField ( { label : 'Semi-major Axis:' , tooltip : 'Enter the semi-major axis of the search' } ) }
150
152
< ValidationField fieldKey = 'posangle'
151
153
forceReinit = { true }
152
154
initialState = { {
@@ -173,7 +175,7 @@ function sizeArea(searchType) {
173
175
174
176
return (
175
177
< div style = { { border : '1px solid #a3aeb9' } } >
176
- { radiusInField ( 'Side:' , 'Enter side size of the box search' , 1 / 3600 , 7200 / 3600 ) }
178
+ { radiusInField ( { label : 'Side:' , tooltip : 'Enter side size of the box search' , min : 1 / 3600 , max : 7200 / 3600 } ) }
177
179
</ div >
178
180
179
181
) ;
@@ -188,17 +190,17 @@ function sizeArea(searchType) {
188
190
tooltip : 'Select a file to upload' ,
189
191
label : 'Filename:' } }
190
192
/>
191
- { radiusInField ( ) }
193
+ { radiusInField ( { } ) }
192
194
</ div >
193
195
) ;
194
196
} else if ( searchType === SpatialMethod . Polygon . value ) {
195
197
196
198
return (
197
199
< div
198
- style = { { padding :5 , display : 'flex' , flexDirection : 'column' , flexWrap : 'wrap' , alignItems : 'center' , border :'solid #a3aeb9 1px' } } >
200
+ style = { { padding :5 , border :'solid #a3aeb9 1px' } } >
199
201
< InputAreaFieldConnected fieldKey = 'polygoncoords'
200
- wrapperStyle = { { padding :5 , display : 'flex' , flexDirection : 'row' , flexWrap : 'wrap' , alignItems : 'center' } }
201
- style = { { maxWidth : '350px' , width : '200px ', height : '30px ', maxHeight : '150px ', overflow : 'auto '} }
202
+ wrapperStyle = { { padding :5 } }
203
+ style = { { overflow : 'auto' , height : '65px ', maxHeight : '200px ', width : '220px ', maxWidth : '300px '} }
202
204
initialState = { {
203
205
tooltip :'Enter polygon coordinates search' ,
204
206
labelWidth :70
@@ -227,10 +229,9 @@ function sizeArea(searchType) {
227
229
228
230
function renderTargetPanel ( groupKey , searchType ) {
229
231
const visible = searchType === SpatialMethod . Cone . value || searchType === SpatialMethod . Box . value || searchType === SpatialMethod . Elliptical . value ;
230
-
231
232
return (
232
233
visible && < div className = "intarget" >
233
- < TargetPanel groupKey = { groupKey } />
234
+ < TargetPanel wrapperStyle = { { width : '200px' } } labelWidth = { 90 } groupKey = { groupKey } />
234
235
< ListBoxInputField
235
236
fieldKey = 'targettry'
236
237
options = { [ { label : 'Try NED then Simbad' , value : 'NED' } ,
@@ -261,9 +262,15 @@ export const SpatialMethod = new Enum({
261
262
'Box' : 'Box' ,
262
263
'Polygon' : 'Polygon' ,
263
264
'Multi-Object' : 'Table' ,
264
- 'All Sky' : 'NONE '
265
+ 'All Sky' : 'AllSky '
265
266
} ,
266
267
{ ignoreCase : true }
267
268
) ;
268
269
269
- const initRadiusArcSec = parseFloat ( 500 / 3600 ) . toString ( ) ;
270
+ var initRadiusArcSec = ( max ) => {
271
+ if ( max >= 10 / 3600 ) {
272
+ return parseFloat ( 10 / 3600 ) . toString ( ) ;
273
+ } else {
274
+ return parseFloat ( 1 / 3600 ) . toString ( ) ;
275
+ }
276
+ } ;
0 commit comments