-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix beamstop and capillary not shown #1447
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<object class="ExporterNStateMockup"> | ||
<username>beamstop</username> | ||
<values>{"OUT": "OFF", "IN": "BEAM"}</values> | ||
<values>{"IN": "BEAM", "OUT": "OFF"}</values> | ||
<use_hwstate>True</use_hwstate> | ||
</object> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,9 +100,9 @@ beamline_setup: | |
id: beamline_setup | ||
components: | ||
- label: Beamstop | ||
attribute: beamstop | ||
attribute: diffractometer.beamstop | ||
- label: Capillary | ||
attribute: capillary | ||
attribute: diffractometer.capillary | ||
Comment on lines
+103
to
+105
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes the two attributes appear in the UI. |
||
- label: Fast Shutter | ||
attribute: fast_shutter | ||
- label: Safety shutter | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ import InOutSwitch from '../components/InOutSwitch/InOutSwitch'; | |
import DeviceState from '../components/DeviceState/DeviceState'; | ||
import MachInfo from '../components/MachInfo/MachInfo'; | ||
import OneAxisTranslationControl from '../components/MotorInput/OneAxisTranslationControl'; | ||
import * as sampleViewActions from '../actions/sampleview'; // eslint-disable-line import/no-namespace | ||
|
||
import { find, filter } from 'lodash'; | ||
|
||
|
@@ -23,32 +22,27 @@ function BeamlineSetupContainer(props) { | |
beamline, | ||
sampleChanger, | ||
sampleview, | ||
sampleViewActions, | ||
uiproperties, | ||
setAttribute, | ||
stopBeamlineAction, | ||
sendCommand, | ||
} = props; | ||
|
||
function handleSetAttribute(name, value) { | ||
setAttribute(name, value); | ||
} | ||
|
||
function renderBeamstopAlignmentOverlay() { | ||
const { hardwareObjects } = beamline; | ||
const motorInputList = []; | ||
let popover = null; | ||
|
||
const motor = hardwareObjects.beamstop_alignemnt_x; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a typo, but the hardware object is no longer called This and the changes below fix the beamstop distance overlay as shown in the third screenshot (the cog icon + overlay with |
||
const motor = hardwareObjects['diffractometer.beamstop_distance']; | ||
const step = sampleview.motorSteps.beamstop_distance; | ||
|
||
if (motor !== undefined && motor.state !== 0) { | ||
if (motor) { | ||
motorInputList.push( | ||
<div key={`bsao-${motor.name}`} style={{ padding: '0.5em' }}> | ||
<p className="motor-name"> Beamstop distance: </p> | ||
<div key={`bsao-${motor.name} d-flex`} style={{ padding: '0.5em' }}> | ||
<p className="motor-name mb-1"> Beamstop distance:</p> | ||
<OneAxisTranslationControl | ||
save={sampleViewActions.updateMotorPosition} | ||
value={motor.position} | ||
save={setAttribute} | ||
value={motor.value} | ||
min={motor.limits[0]} | ||
max={motor.limits[1]} | ||
step={step} | ||
|
@@ -92,7 +86,7 @@ function BeamlineSetupContainer(props) { | |
labelText={uiprop.label} | ||
pkey={key} | ||
value={beamline.hardwareObjects[key].value} | ||
onSave={handleSetAttribute} | ||
onSave={setAttribute} | ||
optionsOverlay={renderBeamstopAlignmentOverlay()} | ||
/> | ||
</Nav.Item>, | ||
|
@@ -108,7 +102,7 @@ function BeamlineSetupContainer(props) { | |
labelText={uiprop.label} | ||
pkey={key} | ||
value={beamline.hardwareObjects[key].value} | ||
onSave={handleSetAttribute} | ||
onSave={setAttribute} | ||
/> | ||
</Nav.Item>, | ||
); | ||
|
@@ -164,7 +158,7 @@ function BeamlineSetupContainer(props) { | |
format={uiprop.format} | ||
precision={uiprop.precision} | ||
suffix={uiprop.suffix} | ||
onSave={(value) => handleSetAttribute(uiprop.attribute, value)} | ||
onSave={(value) => setAttribute(uiprop.attribute, value)} | ||
onCancel={() => stopBeamlineAction(uiprop.attribute)} | ||
/> | ||
</td>, | ||
|
@@ -268,7 +262,6 @@ function mapStateToProps(state) { | |
|
||
function mapDispatchToProps(dispatch) { | ||
return { | ||
sampleViewActions: bindActionCreators(sampleViewActions, dispatch), | ||
setAttribute: bindActionCreators(setAttribute, dispatch), | ||
sendCommand: bindActionCreators(sendCommand, dispatch), | ||
stopBeamlineAction: bindActionCreators(stopBeamlineAction, dispatch), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The front-end expects the "good" state (green) to come first.