11"""Widget for user-defined stratigraphic column."""
22
33from typing import Any
4+
45from PyQt5 .QtWidgets import QMessageBox , QVBoxLayout , QWidget
56
67from loopstructural .gui .modelling .stratigraphic_column import StratColumnWidget
@@ -39,7 +40,7 @@ def __init__(self, parent=None, data_manager=None, debug_manager=None):
3940 # Add the stratigraphic column widget to the UI layout
4041 # Assuming the UI has a placeholder widget or layout for this
4142 if hasattr (self , 'stratiColumnWidget' ):
42- # If the UI has a widget called stratiColumnWidget, use its layout
43+ # If the UI has a widget called stratiColumnWidget, use ruits layout
4344 layout = self .stratiColumnWidget .layout ()
4445 if layout is None :
4546 layout = QVBoxLayout (self .stratiColumnWidget )
@@ -65,56 +66,8 @@ def _run_sorter(self):
6566 This method will use the stratigraphic column from the StratColumnWidget
6667 that is already linked to the data manager, ensuring the model is updated.
6768 """
68- from qgis import processing
69- from qgis .core import QgsProcessingFeedback
70-
71- # Get stratigraphic column data from the data manager
72- strati_column = self .get_stratigraphic_column ()
73- self ._log_params ("user_defined_sorter_widget_run" , {'stratigraphic_column' : strati_column })
74-
75- if not strati_column :
76- QMessageBox .warning (
77- self , "Missing Input" , "Please define at least one stratigraphic unit."
78- )
79- return
80-
81- # Prepare parameters
82- params = {
83- 'INPUT_STRATI_COLUMN' : strati_column ,
84- 'OUTPUT' : 'TEMPORARY_OUTPUT' ,
85- }
86-
87- # Run the algorithm
88- try :
89- feedback = QgsProcessingFeedback ()
90- result = processing .run ("plugin_map2loop:loop_sorter_2" , params , feedback = feedback )
91-
92- if self ._debug and self ._debug .is_debug ():
93- try :
94- self ._debug .save_debug_file (
95- "user_defined_sorter_result.txt" , str (result ).encode ("utf-8" )
96- )
97- except Exception as err :
98- self ._debug .plugin .log (
99- message = f"[map2loop] Failed to save user-defined sorter debug output: { err } " ,
100- log_level = 2 ,
101- )
102- if result :
103- QMessageBox .information (
104- self , "Success" , "User-defined stratigraphic column created successfully!"
105- )
106- else :
107- QMessageBox .warning (
108- self , "Error" , "Failed to create user-defined stratigraphic column."
109- )
110-
111- except Exception as e :
112- if self ._debug :
113- self ._debug .plugin .log (
114- message = f"[map2loop] User-defined sorter run failed: { e } " ,
115- log_level = 2 ,
116- )
117- QMessageBox .critical (self , "Error" , f"An error occurred: { str (e )} " )
69+ # this sorter doesn't do anything and the updates are handled by the strat column widget
70+ return True
11871
11972 def get_stratigraphic_column (self ):
12073 """Get the current stratigraphic column from the data manager.
0 commit comments