Store name in GigabyteAorusCPUCoolerController to avoid setting it in detector

This commit is contained in:
Adam Honse 2025-08-08 11:35:21 -05:00
parent 6f9e164874
commit 7d0db424ec
4 changed files with 20 additions and 13 deletions

View file

@ -13,10 +13,11 @@
#include "ATC800Controller.h" #include "ATC800Controller.h"
#include "StringUtils.h" #include "StringUtils.h"
ATC800Controller::ATC800Controller(hid_device* dev_handle, const char* path) ATC800Controller::ATC800Controller(hid_device* dev_handle, const char* path, std::string dev_name)
{ {
dev = dev_handle; dev = dev_handle;
location = path; location = path;
name = dev_name;
} }
ATC800Controller::~ATC800Controller() ATC800Controller::~ATC800Controller()
@ -29,6 +30,11 @@ std::string ATC800Controller::GetDeviceLocation()
return("HID: " + location); return("HID: " + location);
} }
std::string ATC800Controller::GetNameString()
{
return(name);
}
std::string ATC800Controller::GetSerialString() std::string ATC800Controller::GetSerialString()
{ {
wchar_t serial_string[128]; wchar_t serial_string[128];

View file

@ -61,10 +61,11 @@ enum
class ATC800Controller class ATC800Controller
{ {
public: public:
ATC800Controller(hid_device* dev_handle, const char* path); ATC800Controller(hid_device* dev_handle, const char* path, std::string name);
~ATC800Controller(); ~ATC800Controller();
std::string GetDeviceLocation(); std::string GetDeviceLocation();
std::string GetNameString();
std::string GetSerialString(); std::string GetSerialString();
void DisableTempRPMIndicator(); void DisableTempRPMIndicator();
@ -77,4 +78,5 @@ public:
private: private:
hid_device* dev; hid_device* dev;
std::string location; std::string location;
std::string name;
}; };

View file

@ -36,9 +36,8 @@ void DetectGigabyteAorusCPUCoolerControllers(hid_device_info* info, const std::s
if(dev) if(dev)
{ {
ATC800Controller* controller = new ATC800Controller(dev, info->path); ATC800Controller* controller = new ATC800Controller(dev, info->path, name);
RGBController_AorusATC800* rgb_controller = new RGBController_AorusATC800(controller); RGBController_AorusATC800* rgb_controller = new RGBController_AorusATC800(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller); ResourceManager::get()->RegisterRGBController(rgb_controller);
} }

View file

@ -26,10 +26,10 @@ RGBController_AorusATC800::RGBController_AorusATC800(ATC800Controller* controlle
{ {
controller = controller_ptr; controller = controller_ptr;
name = "Aorus ATC800 CPU Cooler"; name = controller->GetNameString();
vendor = "Gigabyte"; vendor = "Gigabyte";
type = DEVICE_TYPE_COOLER; type = DEVICE_TYPE_COOLER;
description = "Aorus ATC800 CPU Cooler"; description = "Aorus ATC800 CPU Cooler Device";
location = controller->GetDeviceLocation(); location = controller->GetDeviceLocation();
serial = controller->GetSerialString(); serial = controller->GetSerialString();