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 "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;
location = path;
name = dev_name;
}
ATC800Controller::~ATC800Controller()
@ -29,6 +30,11 @@ std::string ATC800Controller::GetDeviceLocation()
return("HID: " + location);
}
std::string ATC800Controller::GetNameString()
{
return(name);
}
std::string ATC800Controller::GetSerialString()
{
wchar_t serial_string[128];

View file

@ -61,10 +61,11 @@ enum
class ATC800Controller
{
public:
ATC800Controller(hid_device* dev_handle, const char* path);
ATC800Controller(hid_device* dev_handle, const char* path, std::string name);
~ATC800Controller();
std::string GetDeviceLocation();
std::string GetNameString();
std::string GetSerialString();
void DisableTempRPMIndicator();
@ -75,6 +76,7 @@ public:
void SendCoolerMode(uint8_t zone, uint8_t mode, aorus_atc800_mode_config zone_config);
private:
hid_device* dev;
std::string location;
hid_device* dev;
std::string location;
std::string name;
};

View file

@ -36,9 +36,8 @@ void DetectGigabyteAorusCPUCoolerControllers(hid_device_info* info, const std::s
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);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}

View file

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