Skip to content
Merged
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
7 changes: 7 additions & 0 deletions loopstructural/gui/map2loop_tools/sorter_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def __init__(self, parent=None, data_manager=None, debug_manager=None):
self.sortingAlgorithmComboBox.currentIndexChanged.connect(self._on_algorithm_changed)
self.geologyLayerComboBox.layerChanged.connect(self._on_geology_layer_changed)
self.structureLayerComboBox.layerChanged.connect(self._on_structure_layer_changed)
self.contactsLayerComboBox.layerChanged.connect(self._on_contacts_layer_changed)
self.runButton.clicked.connect(self._run_sorter)
self.orientationTypeComboBox.setCurrentIndex(1) # Default to Dip Direction
self._guess_layers()
Expand Down Expand Up @@ -278,6 +279,12 @@ def _on_structure_layer_changed(self):
if dipdir_match := matcher.find_match('DIPDIR'):
self.dipDirFieldComboBox.setField(dipdir_match)

def _on_contacts_layer_changed(self):
"""Update field combo boxes when contacts layer changes."""
layer = self.contactsLayerComboBox.currentLayer()
self.unitName1FieldComboBox.setLayer(layer)
self.unitName2FieldComboBox.setLayer(layer)

def _on_algorithm_changed(self):
"""Update UI based on selected sorting algorithm and map2loop requirements."""
algorithm_index = self.sortingAlgorithmComboBox.currentIndex()
Expand Down
Loading