Skip to content

Commit b38b98c

Browse files
committed
Show texture index
Signed-off-by: Patrick Avery <[email protected]>
1 parent 1699096 commit b38b98c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

hexrdgui/calibration/wppf_options_dialog.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,6 +2136,7 @@ def on_texture_plot_pole_figures_clicked(self):
21362136
def on_texture_params_modified(self):
21372137
self.update_simulated_polar_dialog()
21382138
self.update_pole_figure_plots()
2139+
self.update_texture_index_label()
21392140

21402141
def update_simulated_polar_dialog(self):
21412142
# FIXME: recalculate `self._last_texture_pv_sim`
@@ -2231,6 +2232,22 @@ def texture_model_dict(self) -> dict[str, HarmonicModel]:
22312232
})
22322233
return ret
22332234

2235+
def update_texture_index_label(self):
2236+
obj = self._wppf_object
2237+
mat_name = self.ui.selected_texture_material.currentText()
2238+
w = self.ui.texture_index_label
2239+
2240+
if (
2241+
not isinstance(obj, Rietveld) or
2242+
obj.texture_model.get(mat_name) is None
2243+
):
2244+
v = 'None'
2245+
else:
2246+
j = obj.texture_model[mat_name].J(self.params)
2247+
v = f'{j:.2f}'
2248+
2249+
w.setText(f'Texture index: {v}')
2250+
22342251

22352252
def generate_params(method, materials, peak_shape, bkgmethod, amorphous_model,
22362253
texture_model):

hexrdgui/resources/ui/wppf_options_dialog.ui

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,13 @@
637637
</property>
638638
</widget>
639639
</item>
640+
<item row="2" column="0">
641+
<widget class="QLabel" name="texture_index_label">
642+
<property name="text">
643+
<string>Texture Index: None</string>
644+
</property>
645+
</widget>
646+
</item>
640647
</layout>
641648
</widget>
642649
</item>

0 commit comments

Comments
 (0)