Store name in PNYLovelaceGPUController to avoid setting it in detector
This commit is contained in:
parent
67e08d3415
commit
2134323bf8
4 changed files with 22 additions and 14 deletions
|
|
@ -11,10 +11,11 @@
|
|||
|
||||
#include "PNYLovelaceGPUController.h"
|
||||
|
||||
PNYLovelaceGPUController::PNYLovelaceGPUController(i2c_smbus_interface* bus, pny_dev_id dev)
|
||||
PNYLovelaceGPUController::PNYLovelaceGPUController(i2c_smbus_interface* bus, pny_dev_id dev, std::string dev_name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->name = dev_name;
|
||||
}
|
||||
|
||||
PNYLovelaceGPUController::~PNYLovelaceGPUController()
|
||||
|
|
@ -32,6 +33,11 @@ std::string PNYLovelaceGPUController::GetDeviceLocation()
|
|||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string PNYLovelaceGPUController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
void PNYLovelaceGPUController::SetOff()
|
||||
{
|
||||
unsigned char data[7] = {};
|
||||
|
|
|
|||
|
|
@ -34,19 +34,22 @@ enum
|
|||
class PNYLovelaceGPUController
|
||||
{
|
||||
public:
|
||||
PNYLovelaceGPUController(i2c_smbus_interface* bus, pny_dev_id dev);
|
||||
PNYLovelaceGPUController(i2c_smbus_interface* bus, pny_dev_id dev, std::string dev_name);
|
||||
~PNYLovelaceGPUController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
void SetOff();
|
||||
void SetBreath(unsigned char speed, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetCycle(unsigned char speed, unsigned char brightness);
|
||||
void SetWave(unsigned char speed, unsigned char brightness);
|
||||
void SetFlash(unsigned char speed, unsigned char brightness, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetDirect(unsigned char led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
|
||||
void SetOff();
|
||||
void SetBreath(unsigned char speed, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetCycle(unsigned char speed, unsigned char brightness);
|
||||
void SetWave(unsigned char speed, unsigned char brightness);
|
||||
void SetFlash(unsigned char speed, unsigned char brightness, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetDirect(unsigned char led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
|
||||
private:
|
||||
i2c_smbus_interface* bus;
|
||||
pny_dev_id dev;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -31,9 +31,8 @@ void DetectPNYLovelaceGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr,
|
|||
return;
|
||||
}
|
||||
|
||||
PNYLovelaceGPUController* controller = new PNYLovelaceGPUController(bus, i2c_addr);
|
||||
PNYLovelaceGPUController* controller = new PNYLovelaceGPUController(bus, i2c_addr, name);
|
||||
RGBController_PNYLovelaceGPU* rgb_controller = new RGBController_PNYLovelaceGPU(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
} /* DetectPNYLovelaceGPUControllers() */
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ RGBController_PNYLovelaceGPU::RGBController_PNYLovelaceGPU(PNYLovelaceGPUControl
|
|||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "PNY GPU";
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "PNY";
|
||||
description = "PNY RGB GPU Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue