Skip to content

Commit bb97f01

Browse files
Update the "Detector mode" drop-down menu (found in the "Task" dialogs) to show ROI modes defined on the server side, i.e. in the beamline_config.yml file; replace "detector_mode" with "detector_roi_mode", since that should be the correct name for this parameter (there is an attribute in the AcquisitionParameters object with that name)
1 parent 20978c5 commit bb97f01

File tree

6 files changed

+38
-27
lines changed

6 files changed

+38
-27
lines changed

demo/beamline_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,13 @@ configuration:
100100
skip_existing_images: true
101101
take_snapshots: true
102102
sub_wedge_size: 10
103+
detector_mode_list: ["0", "C18", "C12", "C2"]
103104
# NB 'compression' not added as apparently never used
104105

105106
helical:
106107
# Defaults for helical scan. Missing values are taken from default
107108
number_of_images: 100
109+
detector_mode_list: ["0", "C18", "C2"]
108110

109111
characterisation:
110112
# Defaults for characterisation. Missing values are taken from default
@@ -122,6 +124,7 @@ configuration:
122124
cell_counting: zig-zag
123125
cell_spacing: vertical, horizontal
124126
mesh_center: top-left
127+
detector_mode_list: ["0", "C18", "C2"]
125128

126129
gphlworkflow:
127130
{}

ui/src/components/Tasks/Characterisation.jsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Characterisation extends React.Component {
5151

5252
const stringFields = [
5353
'centringMethod',
54-
'detector_mode',
54+
'detector_roi_mode',
5555
'account_rad_damage',
5656
'opt_sad',
5757
'space_group',
@@ -170,11 +170,13 @@ class Characterisation extends React.Component {
170170
<InputField propName="kappa_phi" type="number" label="Phi" />
171171
</FieldsRow>
172172
<FieldsRow>
173-
<SelectField
174-
propName="detector_mode"
175-
label="Detector mode"
176-
list={['0', 'C18', 'C12', 'C2']}
177-
/>
173+
{this.props.initialValues?.detector_mode_list?.length !== 0 ? (
174+
<SelectField
175+
propName="detector_roi_mode"
176+
label="Detector mode"
177+
list={this.props.initialValues.detector_mode_list}
178+
/>
179+
) : null}
178180
<InputField propName="overlap" label="Overlap" />
179181
</FieldsRow>
180182
</CollapsableRows>

ui/src/components/Tasks/DataCollection.jsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class DataCollection extends React.Component {
5757
'shutterless',
5858
'inverse_beam',
5959
'centringMethod',
60-
'detector_mode',
60+
'detector_roi_mode',
6161
'space_group',
6262
'prefix',
6363
'subdir',
@@ -280,13 +280,15 @@ class DataCollection extends React.Component {
280280
<InputField propName="kappa" type="number" label="Kappa" />
281281
<InputField propName="kappa_phi" type="number" label="Phi" />
282282
</FieldsRow>
283-
<FieldsRow>
284-
<SelectField
285-
propName="detector_mode"
286-
label="Detector mode"
287-
list={['0', 'C18', 'C12', 'C2']}
288-
/>
289-
</FieldsRow>
283+
{this.props.initialValues?.detector_mode_list?.length !== 0 ? (
284+
<FieldsRow>
285+
<SelectField
286+
propName="detector_roi_mode"
287+
label="Detector mode"
288+
list={this.props.initialValues.detector_mode_list}
289+
/>
290+
</FieldsRow>
291+
) : null}
290292
</CollapsableRows>
291293
</Form>
292294

ui/src/components/Tasks/GenericTaskForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class GenericTaskForm extends React.Component {
7272
'shutterless',
7373
'inverse_beam',
7474
'centringMethod',
75-
'detector_mode',
75+
'detector_roi_mode',
7676
'space_group',
7777
'prefix',
7878
'subdir',

ui/src/components/Tasks/Helical.jsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Helical extends React.Component {
5555
'shutterless',
5656
'inverse_beam',
5757
'centringMethod',
58-
'detector_mode',
58+
'detector_roi_mode',
5959
'space_group',
6060
'prefix',
6161
'subdir',
@@ -171,11 +171,13 @@ class Helical extends React.Component {
171171
label="Beam size"
172172
list={this.props.apertureList}
173173
/>
174-
<SelectField
175-
propName="detector_mode"
176-
label="Detector mode"
177-
list={['0', 'C18', 'C2']}
178-
/>
174+
{this.props.initialValues?.detector_mode_list?.length !== 0 ? (
175+
<SelectField
176+
propName="detector_roi_mode"
177+
label="Detector mode"
178+
list={this.props.initialValues.detector_mode_list}
179+
/>
180+
) : null}
179181
</FieldsRow>
180182
<FieldsRow>
181183
<CheckboxField propName="shutterless" label="Shutterless" />

ui/src/components/Tasks/Mesh.jsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Mesh extends React.Component {
6464
'shutterless',
6565
'inverse_beam',
6666
'centringMethod',
67-
'detector_mode',
67+
'detector_roi_mode',
6868
'space_group',
6969
'prefix',
7070
'subdir',
@@ -181,11 +181,13 @@ class Mesh extends React.Component {
181181
label="Beam size"
182182
list={this.props.apertureList}
183183
/>
184-
<SelectField
185-
propName="detector_mode"
186-
label="Detector mode"
187-
list={['0', 'C18', 'C2']}
188-
/>
184+
{this.props.initialValues?.detector_mode_list?.length !== 0 ? (
185+
<SelectField
186+
propName="detector_roi_mode"
187+
label="Detector mode"
188+
list={this.props.initialValues.detector_mode_list}
189+
/>
190+
) : null}
189191
</FieldsRow>
190192
<FieldsRow>
191193
<CheckboxField propName="shutterless" label="Shutterless" />

0 commit comments

Comments
 (0)