|
Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
|
Controller class for the application orchestrating services and UI. More...
#include <AppController.hpp>

Public Member Functions | |
Constructors & Methods | |
| AppController (AppWindow &window, TrajectoryLoader &loader, AnalysisDispatcher &dispatcher, ProgramOptions &options) | |
| Constructs the AppController with injected domain services. | |
| AppController (AppWindow &window, TrajectoryLoader &loader, AnalysisDispatcher &dispatcher, BondCutoffService &cutoff_service, ProgramOptions &options) | |
| Constructs the AppController with injected domain services (transitional). | |
| ~AppController () | |
| Destructor. Ensures analysis threads are joined before destruction. | |
| void | loadSettings () |
| Loads application layout settings and applies window/column geometry. | |
| void | saveSettings () const |
| Saves current layout settings and window geometry to disk. | |
| void | loadTrajectory (const std::string &filepath, std::function< void(bool)> on_complete=nullptr) |
| Loads a structure or trajectory file asynchronously. | |
| void | addRecentFile (const std::string &filepath) |
| Appends a path to MRU recent files and updates UI. | |
| void | runAnalysis () |
| Executes configured analyses on the active trajectory. | |
| ProgramOptions | handleOptionsfromUI () |
| Retrieves the current user-selected options from the UI. | |
| void | handleOptionstoUI () |
| Populates the UI with options from the backend. | |
| void | populateExportAnalyses () |
| Populates the export analyses selection list with computed histograms. | |
| void | setBondCutoffs () |
| Updates the UI with the recommended bond cutoffs from the backend. | |
| correlation::analysis::BondCutoffMatrix | getBondCutoffs () |
| Parses and retrieves the user-modified bond cutoff matrix from the UI. | |
| void | populateCalculatorGroups () |
| Populates the UI calculator groups from CalculatorFactory. | |
| void | setCalculatorsEnabled (bool enabled, std::string_view group_filter={}) |
| Enables or disables every calculator, optionally restricted to a single group. | |
| void | setCalculatorGroupsExpanded (bool expanded, std::string_view group_filter={}) |
| Sets the expansion state of calculator selection sub-trees. | |
| void | updateActiveGroupFlags () |
| Updates active group flags in the UI based on active calculators. | |
| void | markResultsStaleIfDone () noexcept |
| Flags current plot results as stale if an analysis has already completed. | |
| InputValidator * | getInputValidator () |
| Returns the InputValidator instance. | |
| PlotController * | getPlotController () |
| Returns the PlotController instance. | |
| BondCutoffController & | getBondCutoffController () |
| Returns the BondCutoffController instance. | |
| const BondCutoffController & | getBondCutoffController () const |
| Returns the const BondCutoffController instance. | |
| Structure3DController * | getStructure3DController () noexcept |
| Returns the Structure3DController instance. | |
Private Member Functions | |
| bool | isCalculatorGroupExpanded (std::string_view group_name, size_t group_index) const |
| void | registerActionCallbacks () |
| void | registerAnalysesCallbacks () |
| void | registerPlotCallbacks () |
| void | registerStructure3DCallbacks () |
| void | registerCameraCallbacks () |
| void | registerPhaseSearchCallbacks () |
| void | handleSelectDualLeftPlot (int idx) |
| void | registerPresetAndOptionCallbacks () |
| void | registerExportCallbacks () |
Private Attributes | |
| AppWindow & | window_ |
| TrajectoryLoader & | loader_ |
| AnalysisDispatcher & | dispatcher_ |
| ProgramOptions & | options_ |
| BondCutoffController | bond_cutoff_controller_ |
| std::unique_ptr< AnalysisRunner > | analysis_runner_ |
| std::unique_ptr< FileIOHandler > | file_io_handler_ |
| std::unique_ptr< InputValidator > | input_validator_ |
| std::unique_ptr< PlotController > | plot_controller_ |
| std::unique_ptr< PresetController > | preset_controller_ |
| std::unique_ptr< Structure3DController > | structure_3d_controller_ |
| std::shared_ptr< std::atomic< bool > > | alive_ {std::make_shared<std::atomic<bool>>(true)} |
| std::atomic< bool > | export_3d_busy_ {false} |
| std::jthread | export_3d_thread_ |
| AppSettings | settings_ |
| std::map< std::string, bool, std::less<> > | calculator_group_expanded_ |
Friends | |
| class | ::AppControllerTests |
Controller class for the application orchestrating services and UI.
This class handles the interaction between the User Interface (AppWindow) and domain services (TrajectoryLoader, AnalysisDispatcher, BondCutoffService). It manages event handling, threading for analysis, and data synchronization.
| correlation::app::AppController::AppController | ( | AppWindow & | window, |
| TrajectoryLoader & | loader, | ||
| AnalysisDispatcher & | dispatcher, | ||
| ProgramOptions & | options ) |
Constructs the AppController with injected domain services.
| window | Reference to the main application window. |
| loader | Reference to the trajectory loading service. |
| dispatcher | Reference to the analysis dispatching service. |
| options | Reference to application configuration options. |
| correlation::app::AppController::AppController | ( | AppWindow & | window, |
| TrajectoryLoader & | loader, | ||
| AnalysisDispatcher & | dispatcher, | ||
| BondCutoffService & | cutoff_service, | ||
| ProgramOptions & | options ) |
Constructs the AppController with injected domain services (transitional).
| window | Reference to the main application window. |
| loader | Reference to the trajectory loading service. |
| dispatcher | Reference to the analysis dispatching service. |
| cutoff_service | Reference to the bond cutoff service. |
| options | Reference to application configuration options. |
| correlation::app::AppController::~AppController | ( | ) |
Destructor. Ensures analysis threads are joined before destruction.


| void correlation::app::AppController::addRecentFile | ( | const std::string & | filepath | ) |
Appends a path to MRU recent files and updates UI.
| filepath | Loaded file path. |


|
inline |
Returns the BondCutoffController instance.
|
inline |
Returns the const BondCutoffController instance.
| correlation::analysis::BondCutoffMatrix correlation::app::AppController::getBondCutoffs | ( | ) |
Parses and retrieves the user-modified bond cutoff matrix from the UI.


|
inline |
Returns the InputValidator instance.


|
inline |
Returns the PlotController instance.
|
inlinenodiscardnoexcept |
Returns the Structure3DController instance.
| ProgramOptions correlation::app::AppController::handleOptionsfromUI | ( | ) |
Retrieves the current user-selected options from the UI.


| void correlation::app::AppController::handleOptionstoUI | ( | ) |
Populates the UI with options from the backend.


|
private |

|
nodiscardprivate |

| void correlation::app::AppController::loadSettings | ( | ) |
Loads application layout settings and applies window/column geometry.


| void correlation::app::AppController::loadTrajectory | ( | const std::string & | filepath, |
| std::function< void(bool)> | on_complete = nullptr ) |
Loads a structure or trajectory file asynchronously.
| filepath | Path to the structure or trajectory file. |
| on_complete | Optional callback invoked on event loop when loading finishes. |


|
noexcept |
Flags current plot results as stale if an analysis has already completed.


| void correlation::app::AppController::populateCalculatorGroups | ( | ) |
Populates the UI calculator groups from CalculatorFactory.
Rebuilds the calculator selection tree (per-group enabled counts, short symbols, and persisted sub-tree expansion state). When the existing Slint group model has the same group layout, rows are updated in place so that open sub-trees and scroll position are preserved across selection changes.


| void correlation::app::AppController::populateExportAnalyses | ( | ) |
Populates the export analyses selection list with computed histograms.
|
private |

|
private |


|
private |

|
private |
|
private |


|
private |

|
private |

|
private |

| void correlation::app::AppController::runAnalysis | ( | ) |
Executes configured analyses on the active trajectory.


| void correlation::app::AppController::saveSettings | ( | ) | const |
Saves current layout settings and window geometry to disk.


| void correlation::app::AppController::setBondCutoffs | ( | ) |
Updates the UI with the recommended bond cutoffs from the backend.


| void correlation::app::AppController::setCalculatorGroupsExpanded | ( | bool | expanded, |
| std::string_view | group_filter = {} ) |
Sets the expansion state of calculator selection sub-trees.
| expanded | Target expansion state. |
| group_filter | Group name to restrict the operation to; empty applies to all groups. |


| void correlation::app::AppController::setCalculatorsEnabled | ( | bool | enabled, |
| std::string_view | group_filter = {} ) |
Enables or disables every calculator, optionally restricted to a single group.
| enabled | Target activation state. |
| group_filter | Group name to restrict the operation to; empty applies to all groups. |


| void correlation::app::AppController::updateActiveGroupFlags | ( | ) |
Updates active group flags in the UI based on active calculators.


|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |