Add detector names and display them in the progress bar

This commit is contained in:
Adam Honse 2020-08-06 15:18:32 -05:00
parent 75899f973b
commit f716a05947
50 changed files with 80 additions and 56 deletions

View file

@ -4,6 +4,7 @@
#include <vector>
#include <functional>
#include <thread>
#include <string>
#include "i2c_smbus.h"
#include "RGBController.h"
@ -29,12 +30,13 @@ public:
std::vector<RGBController*> & GetRGBControllers();
void RegisterI2CBusDetector (I2CBusDetectorFunction detector);
void RegisterDeviceDetector (DeviceDetectorFunction detector);
void RegisterI2CDeviceDetector (I2CDeviceDetectorFunction detector);
void RegisterDeviceDetector (std::string name, DeviceDetectorFunction detector);
void RegisterI2CDeviceDetector (std::string name, I2CDeviceDetectorFunction detector);
void RegisterDeviceListChangeCallback(ResourceManagerCallback new_callback, void * new_callback_arg);
unsigned int GetDetectionPercent();
std::string GetDetectionString();
void DeviceListChanged();
@ -46,12 +48,15 @@ private:
static std::unique_ptr<ResourceManager> instance;
unsigned int detection_percent;
std::string detection_string;
std::vector<i2c_smbus_interface*> busses;
std::vector<RGBController*> rgb_controllers;
std::vector<DeviceDetectorFunction> device_detectors;
std::vector<std::string> device_detector_strings;
std::vector<I2CBusDetectorFunction> i2c_bus_detectors;
std::vector<I2CDeviceDetectorFunction> i2c_device_detectors;
std::vector<std::string> i2c_device_detector_strings;
std::thread * DetectDevicesThread;