ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
Enlighten.EnlightenApplication Class Reference

This class encapsulates processing of command-line arguments, instantiates a Controller then passes control to the Qt framework. More...

Public Member Functions

 __init__ (self, testing=False)
 
 closeEvent (self)
 Catch the exit signal from the control application, and call QApplication Quit.
 
 create_parser (self)
 Defines the command-line arguments and their defaults.
 
 hide_console (self)
 This isn't needed on Win10 (where pyinstaller's –hide-console hide-early works, though not hide-late), but apparently is on Win11 (where hide-early doesn't work; not sure about hide-late).
 
 parse_args (self, argv)
 Parse command-line arguments.
 
 run (self)
 
 run_from_root (self, pathname)
 ENLIGHTEN loads various settings from its own enlighten/assets/ example_code distribution, which it accesses through relative paths, and it can't find those if run from another directory.
 

Public Attributes

 app = QtWidgets.QApplication()
 
 args = None
 
 closeEvent
 
 controller = None
 
int exit_code = 0
 
 form = BasicWindow(title="Tec5USA" % common.VERSION)
 
 main_logger
 
 parser = self.create_parser()
 
 splash = QSplashScreen()
 
 testing = testing
 

Detailed Description

This class encapsulates processing of command-line arguments, instantiates a Controller then passes control to the Qt framework.

Constructor & Destructor Documentation

◆ __init__()

Enlighten.EnlightenApplication.__init__ ( self,
testing = False )

Member Function Documentation

◆ closeEvent()

Enlighten.EnlightenApplication.closeEvent ( self)

Catch the exit signal from the control application, and call QApplication Quit.

◆ create_parser()

Enlighten.EnlightenApplication.create_parser ( self)

Defines the command-line arguments and their defaults.

◆ hide_console()

Enlighten.EnlightenApplication.hide_console ( self)

This isn't needed on Win10 (where pyinstaller's –hide-console hide-early works, though not hide-late), but apparently is on Win11 (where hide-early doesn't work; not sure about hide-late).

Calling for coverage on Win11.

See also
https://github.com/pyinstaller/pyinstaller/issues/7729#issuecomment-1605503018
https://github.com/pyinstaller/pyinstaller/pull/7735

◆ parse_args()

Enlighten.EnlightenApplication.parse_args ( self,
argv )

Parse command-line arguments.

◆ run()

Enlighten.EnlightenApplication.run ( self)

◆ run_from_root()

Enlighten.EnlightenApplication.run_from_root ( self,
pathname )

ENLIGHTEN loads various settings from its own enlighten/assets/ example_code distribution, which it accesses through relative paths, and it can't find those if run from another directory.

Member Data Documentation

◆ app

Enlighten.EnlightenApplication.app = QtWidgets.QApplication()

◆ args

Enlighten.EnlightenApplication.args = None

◆ closeEvent

Enlighten.EnlightenApplication.closeEvent
Initial value:
= Controller(
app = self.app,
log_level = self.args.log_level,
log_queue = self.main_logger.log_queue,
max_memory_growth = self.args.max_memory_growth,
max_thumbnails = self.args.max_thumbnails,
run_sec = self.args.run_sec,
serial_number = self.args.serial_number,
stylesheet_path = self.args.stylesheet_path,
set_all_dfu = self.args.set_all_dfu,
form = self.form,
splash = self.splash,
window_state = self.args.window_state,
start_batch = self.args.start_batch,
password = self.args.password,
plugin = self.args.plugin)

◆ controller

Enlighten.EnlightenApplication.controller = None

◆ exit_code

Enlighten.EnlightenApplication.exit_code = 0

◆ form

Enlighten.EnlightenApplication.form = BasicWindow(title="Tec5USA" % common.VERSION)

◆ main_logger

Enlighten.EnlightenApplication.main_logger
Initial value:
= applog.MainLogger(
"DEBUG", # we always start in debug logging to catch startup issues
logfile=self.args.logfile,
timeout_sec=5,
enable_stdout=not self.testing,
append_arg=str(self.args.log_append)
)

◆ parser

Enlighten.EnlightenApplication.parser = self.create_parser()

◆ splash

Enlighten.EnlightenApplication.splash = QSplashScreen()

◆ testing

Enlighten.EnlightenApplication.testing = testing

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