Skip to content
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

BBXRD #1334

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

BBXRD #1334

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions hexrd/ui/llnl_import_tool_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, cmap=None, parent=None):
self.setup_connections()

def setup_connections(self):
self.ui.instruments.currentIndexChanged.connect(
self.ui.instruments.currentTextChanged.connect(
self.instrument_selected)
self.ui.load.clicked.connect(self.load_images)
self.ui.detectors.currentIndexChanged.connect(self.detector_selected)
Expand Down Expand Up @@ -139,14 +139,13 @@ def load_config(self):
self.ui.config_file_label.setText(os.path.basename(self.config_file))
self.ui.config_file_label.setToolTip(self.config_file)

def instrument_selected(self, idx):
def instrument_selected(self, instrument):
if HexrdConfig().show_beam_marker:
HexrdConfig().show_beam_marker = False

self.detectors.clear()
self.detector_defaults.clear()
instruments = {1: 'TARDIS', 2: 'PXRDIP'}
self.instrument = instruments.get(idx, None)
self.instrument = instrument

if self.instrument is None:
self.import_in_progress = False
Expand Down Expand Up @@ -186,6 +185,8 @@ def load_instrument_config(self):
temp = tempfile.NamedTemporaryFile(delete=False, suffix='.hexrd')
self.config_file = temp.name
HexrdConfig().save_instrument_config(self.config_file)
if self.ui.instruments.currentIndex() == 0: # No instrument selected
return
fname = f'default_{self.instrument.lower()}_config.yml'
with resource_loader.resource_path(
hexrd.ui.resources.calibration, fname) as f:
Expand Down
15 changes: 15 additions & 0 deletions hexrd/ui/resources/calibration/default_bbxrd_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
beam:
energy: 10.2505
vector: {azimuth: 90.0, polar_angle: 67.0}
detectors:
default:
pixels:
columns: 11000
rows: 3000
size: [0.025, 0.025]
transform:
tilt: [0.0, 0.0, 0.0]
translation: [0.0, 0.0, 0.0]
oscillation_stage:
chi: 0.0
translation: [0.0, 0.0, 0.0]
5 changes: 5 additions & 0 deletions hexrd/ui/resources/ui/llnl_import_tool_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
<string>PXRDIP</string>
</property>
</item>
<item>
<property name="text">
<string>BBXRD</string>
</property>
</item>
</widget>
</item>
</layout>
Expand Down