Loading optimization (no GUI changes)

This commit is contained in:
Dmitry K 2024-09-26 22:20:48 +00:00 committed by Adam Honse
parent 7e96e0efa5
commit 2c952a54d2
7 changed files with 277 additions and 182 deletions

View file

@ -191,13 +191,15 @@ public:
void SetConfigurationDirectory(const filesystem::path &directory);
void ProcessPreDetectionHooks();
void ProcessDynamicDetectors();
void ProcessPreDetectionHooks(); // Consider making private
void ProcessDynamicDetectors(); // Consider making private
void UpdateDeviceList();
void DeviceListChanged();
void DetectionProgressChanged();
void I2CBusListChanged();
void Initialize(bool tryConnect, bool detectDevices, bool startServer, bool applyPostOptions);
void Cleanup();
void DetectDevices();
@ -212,17 +214,36 @@ private:
void DetectDevicesThreadFunction();
void UpdateDetectorSettings();
void SetupConfigurationDirectory();
bool AttemptLocalConnection();
void InitThreadFunction();
bool ProcessPreDetection();
void ProcessPostDetection();
/*-------------------------------------------------------------------------------------*\
| Static pointer to shared instance of ResourceManager |
\*-------------------------------------------------------------------------------------*/
static ResourceManager* instance;
/*-------------------------------------------------------------------------------------*\
| Auto connection permitting flag |
\*-------------------------------------------------------------------------------------*/
bool tryAutoConnect;
/*-------------------------------------------------------------------------------------*\
| Detection enabled flag |
\*-------------------------------------------------------------------------------------*/
bool detection_enabled;
/*-------------------------------------------------------------------------------------*\
| Auto connection permitting flag |
\*-------------------------------------------------------------------------------------*/
bool start_server;
/*-------------------------------------------------------------------------------------*\
| Auto connection permitting flag |
\*-------------------------------------------------------------------------------------*/
bool apply_post_options;
/*-------------------------------------------------------------------------------------*\
| Profile Manager |
\*-------------------------------------------------------------------------------------*/
@ -275,7 +296,8 @@ private:
/*-------------------------------------------------------------------------------------*\
| Detection Thread and Detection State |
\*-------------------------------------------------------------------------------------*/
std::thread * DetectDevicesThread;
std::thread * DetectDevicesThread; // Used for rescan
std::thread * InitThread; // Used for initial scan, initial network scan, server startup
std::mutex DetectDeviceMutex;
std::atomic<bool> detection_is_required;