dbselect
Loading...
Searching...
No Matches
DBSelectView Class Reference

Qt widget used to select experiment/system configurations from an SQLite geometry database. More...

#include <dbselectView.h>

Public Slots

void reload_geometry ()
 Slot invoked by the Reload button to reload geometry based on current selections.
 

Signals

void geometryAboutToReload ()
 Emitted immediately before detector construction replaces the current geometry.
 
void geometryReloaded ()
 Emitted after detector construction has reloaded geometry from the selected systems.
 

Public Member Functions

 DBSelectView (const std::shared_ptr< GOptions > &gopts, GDetectorConstruction *dc, QWidget *parent=nullptr)
 Construct the view and populate the experiment/system model from the database.
 
 ~DBSelectView () override
 Destructor.
 
SystemList get_gsystems ()
 Build and return the list of selected systems as a SystemList.
 
- Public Member Functions inherited from GBase< DBSelectView >
 GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="")
 
 GBase (const std::shared_ptr< GLogger > &logger)
 
 GBase (const GBase &)=default
 
 GBase (GBase &&) noexcept=default
 
virtual ~GBase ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Additional Inherited Members

- Protected Attributes inherited from GBase< DBSelectView >
std::shared_ptr< GLoggerlog
 

Detailed Description

DBSelectView displays a tree of experiments and their system variations obtained from an SQLite database. Each system/variation row allows:

  • enabling/disabling that variation via a checkbox,
  • selecting a run number from a drop-down list,
  • viewing the number of matching geometry entries for the current selection,
  • seeing an availability indicator (green/red icon) driven by database counts.

The widget is designed to be used as a selection front-end for geometry reload:

Ownership model:

  • The widget owns its Qt child widgets through Qt parent-child relationships.
  • The widget owns and closes the sqlite3 database handle opened read-only.
  • The widget does not own the provided GDetectorConstruction pointer.

Important Qt note: GBase must appear after QWidget derivations; otherwise Qt's MOC expects a staticMetaObject.

Definition at line 46 of file dbselectView.h.

Constructor & Destructor Documentation

◆ DBSelectView()

DBSelectView::DBSelectView ( const std::shared_ptr< GOptions > & gopts,
GDetectorConstruction * dc,
QWidget * parent = nullptr )
explicit

Construction steps (high-level):

  • Read the database location and default experiment from options.
  • Resolve the database path via a search in common locations and open it read-only.
  • Validate that the database contains a non-empty geometry table.
  • Create the UI, populate the model, and apply existing GSystem selections.
Parameters
goptsShared options used for database selection, default experiment, and UI mode.
dcDetector construction instance used to reload geometry on user request.
parentOptional parent widget for Qt ownership.

Definition at line 23 of file dbselectView.cc.

◆ ~DBSelectView()

DBSelectView::~DBSelectView ( )
inlineoverride

Closes the sqlite3 handle if it was successfully opened. Qt child widgets are cleaned up automatically by Qt parent ownership.

Definition at line 72 of file dbselectView.h.

Member Function Documentation

◆ geometryAboutToReload

void DBSelectView::geometryAboutToReload ( )
signal

GUI containers use this signal to clear visualization state while the existing Geant4 geometry is still valid, avoiding stale trajectory/hit references after the reload.

◆ geometryReloaded

void DBSelectView::geometryReloaded ( )
signal

GUI containers use this signal to refresh pages whose models are built from detector construction state, such as the geometry volume tree.

◆ get_gsystems()

SystemList DBSelectView::get_gsystems ( )

The returned SystemList contains one GSystem for each checked system/variation item in the model. For each enabled row, the selected variation and run are taken from the corresponding model columns.

This function does not change the UI state; it is a pure extraction step.

Returns
A SystemList representing the currently checked systems and their selections.

Definition at line 546 of file dbselectView.cc.

◆ reload_geometry

void DBSelectView::reload_geometry ( )
slot

High-level behavior:

  • Build a SystemList from the model selections.
  • Invoke detector construction reload using that list.
  • Clear the modified state and refresh the UI.

Definition at line 614 of file dbselectView.cc.


The documentation for this class was generated from the following files: