Skip to content

Commit e460b30

Browse files
lachlangroseclaude
andauthored
fix: connect layer change to update field combo boxes (#111)
* test: pin training-value/isovalue direction agreement for stratigraphic columns Guards against the swap fixed in 814be12: model_manager.py's per-unit training value and LoopStructural's get_isovalues() must agree on which direction values increase, or extracted isosurfaces get labelled with the wrong unit while keeping correct geometry. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: connect layer change to update field combo boxes * style: fix black formatting and ruff lint (unnecessary generator) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 537da39 commit e460b30

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

loopstructural/gui/map2loop_tools/sorter_widget.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def __init__(self, parent=None, data_manager=None, debug_manager=None):
7070
self.sortingAlgorithmComboBox.currentIndexChanged.connect(self._on_algorithm_changed)
7171
self.geologyLayerComboBox.layerChanged.connect(self._on_geology_layer_changed)
7272
self.structureLayerComboBox.layerChanged.connect(self._on_structure_layer_changed)
73+
self.contactsLayerComboBox.layerChanged.connect(self._on_contacts_layer_changed)
7374
self.runButton.clicked.connect(self._run_sorter)
7475
self.orientationTypeComboBox.setCurrentIndex(1) # Default to Dip Direction
7576
self._guess_layers()
@@ -278,6 +279,12 @@ def _on_structure_layer_changed(self):
278279
if dipdir_match := matcher.find_match('DIPDIR'):
279280
self.dipDirFieldComboBox.setField(dipdir_match)
280281

282+
def _on_contacts_layer_changed(self):
283+
"""Update field combo boxes when contacts layer changes."""
284+
layer = self.contactsLayerComboBox.currentLayer()
285+
self.unitName1FieldComboBox.setLayer(layer)
286+
self.unitName2FieldComboBox.setLayer(layer)
287+
281288
def _on_algorithm_changed(self):
282289
"""Update UI based on selected sorting algorithm and map2loop requirements."""
283290
algorithm_index = self.sortingAlgorithmComboBox.currentIndex()

0 commit comments

Comments
 (0)