Store name in ZotacTuringGPUController to avoid setting it in detector
This commit is contained in:
parent
ad9fd08a08
commit
eb199dae67
4 changed files with 49 additions and 42 deletions
|
|
@ -24,19 +24,19 @@
|
||||||
|
|
||||||
RGBController_ZotacTuringGPU::RGBController_ZotacTuringGPU(ZotacTuringGPUController* controller_ptr)
|
RGBController_ZotacTuringGPU::RGBController_ZotacTuringGPU(ZotacTuringGPUController* controller_ptr)
|
||||||
{
|
{
|
||||||
controller = controller_ptr;
|
controller = controller_ptr;
|
||||||
|
|
||||||
name = "ZOTAC GPU";
|
name = controller->GetDeviceName();
|
||||||
vendor = "ZOTAC";
|
vendor = "ZOTAC";
|
||||||
description = "ZOTAC Turing-based RGB GPU Device";
|
description = "ZOTAC Turing-based RGB GPU Device";
|
||||||
location = controller->GetDeviceLocation();
|
location = controller->GetDeviceLocation();
|
||||||
type = DEVICE_TYPE_GPU;
|
type = DEVICE_TYPE_GPU;
|
||||||
|
|
||||||
mode Direct;
|
mode Direct;
|
||||||
Direct.name = "Direct";
|
Direct.name = "Direct";
|
||||||
Direct.value = ZOTAC_GPU_MODE_STATIC;
|
Direct.value = ZOTAC_GPU_MODE_STATIC;
|
||||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||||
modes.push_back(Direct);
|
modes.push_back(Direct);
|
||||||
|
|
||||||
mode Flashing;
|
mode Flashing;
|
||||||
|
|
@ -50,33 +50,33 @@ RGBController_ZotacTuringGPU::RGBController_ZotacTuringGPU(ZotacTuringGPUControl
|
||||||
modes.push_back(Flashing);
|
modes.push_back(Flashing);
|
||||||
|
|
||||||
mode Wave;
|
mode Wave;
|
||||||
Wave.name = "Rainbow Wave";
|
Wave.name = "Rainbow Wave";
|
||||||
Wave.value = ZOTAC_GPU_MODE_WAVE;
|
Wave.value = ZOTAC_GPU_MODE_WAVE;
|
||||||
Wave.flags = MODE_FLAG_HAS_SPEED;
|
Wave.flags = MODE_FLAG_HAS_SPEED;
|
||||||
Wave.speed_min = ZOTAC_GPU_SPEED_SLOWEST;
|
Wave.speed_min = ZOTAC_GPU_SPEED_SLOWEST;
|
||||||
Wave.speed_max = ZOTAC_GPU_SPEED_FASTEST;
|
Wave.speed_max = ZOTAC_GPU_SPEED_FASTEST;
|
||||||
Wave.speed = ZOTAC_GPU_SPEED_NORMAL;
|
Wave.speed = ZOTAC_GPU_SPEED_NORMAL;
|
||||||
Wave.color_mode = MODE_COLORS_NONE;
|
Wave.color_mode = MODE_COLORS_NONE;
|
||||||
modes.push_back(Wave);
|
modes.push_back(Wave);
|
||||||
|
|
||||||
mode Breathing;
|
mode Breathing;
|
||||||
Breathing.name = "Breathing";
|
Breathing.name = "Breathing";
|
||||||
Breathing.value = ZOTAC_GPU_MODE_BREATHING;
|
Breathing.value = ZOTAC_GPU_MODE_BREATHING;
|
||||||
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
|
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR;
|
||||||
Breathing.speed_min = ZOTAC_GPU_SPEED_SLOWEST;
|
Breathing.speed_min = ZOTAC_GPU_SPEED_SLOWEST;
|
||||||
Breathing.speed_max = ZOTAC_GPU_SPEED_FASTEST;
|
Breathing.speed_max = ZOTAC_GPU_SPEED_FASTEST;
|
||||||
Breathing.speed = ZOTAC_GPU_SPEED_NORMAL;
|
Breathing.speed = ZOTAC_GPU_SPEED_NORMAL;
|
||||||
Breathing.color_mode = MODE_COLORS_PER_LED;
|
Breathing.color_mode = MODE_COLORS_PER_LED;
|
||||||
modes.push_back(Breathing);
|
modes.push_back(Breathing);
|
||||||
|
|
||||||
mode ColorCycle;
|
mode ColorCycle;
|
||||||
ColorCycle.name = "Spectrum Cycle";
|
ColorCycle.name = "Spectrum Cycle";
|
||||||
ColorCycle.value = ZOTAC_GPU_MODE_COLOR_CYCLE;
|
ColorCycle.value = ZOTAC_GPU_MODE_COLOR_CYCLE;
|
||||||
ColorCycle.flags = MODE_FLAG_HAS_SPEED;
|
ColorCycle.flags = MODE_FLAG_HAS_SPEED;
|
||||||
ColorCycle.speed_min = ZOTAC_GPU_SPEED_SLOWEST;
|
ColorCycle.speed_min = ZOTAC_GPU_SPEED_SLOWEST;
|
||||||
ColorCycle.speed_max = ZOTAC_GPU_SPEED_FASTEST;
|
ColorCycle.speed_max = ZOTAC_GPU_SPEED_FASTEST;
|
||||||
ColorCycle.speed = ZOTAC_GPU_SPEED_NORMAL;
|
ColorCycle.speed = ZOTAC_GPU_SPEED_NORMAL;
|
||||||
ColorCycle.color_mode = MODE_COLORS_NONE;
|
ColorCycle.color_mode = MODE_COLORS_NONE;
|
||||||
modes.push_back(ColorCycle);
|
modes.push_back(ColorCycle);
|
||||||
|
|
||||||
SetupZones();
|
SetupZones();
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,11 @@
|
||||||
|
|
||||||
#include "ZotacTuringGPUController.h"
|
#include "ZotacTuringGPUController.h"
|
||||||
|
|
||||||
ZotacTuringGPUController::ZotacTuringGPUController(i2c_smbus_interface* bus, u8 dev)
|
ZotacTuringGPUController::ZotacTuringGPUController(i2c_smbus_interface* bus, u8 dev, std::string dev_name)
|
||||||
{
|
{
|
||||||
this->bus = bus;
|
this->bus = bus;
|
||||||
this->dev = dev;
|
this->dev = dev;
|
||||||
|
this->name = dev_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZotacTuringGPUController::~ZotacTuringGPUController()
|
ZotacTuringGPUController::~ZotacTuringGPUController()
|
||||||
|
|
@ -31,6 +32,11 @@ std::string ZotacTuringGPUController::GetDeviceLocation()
|
||||||
return("I2C: " + return_string);
|
return("I2C: " + return_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string ZotacTuringGPUController::GetDeviceName()
|
||||||
|
{
|
||||||
|
return(name);
|
||||||
|
}
|
||||||
|
|
||||||
void ZotacTuringGPUController::GetMode(RGBColor& color, int& mode, unsigned int& speed)
|
void ZotacTuringGPUController::GetMode(RGBColor& color, int& mode, unsigned int& speed)
|
||||||
{
|
{
|
||||||
u8 rdata_pkt[I2C_SMBUS_BLOCK_MAX] = { 0x00 };
|
u8 rdata_pkt[I2C_SMBUS_BLOCK_MAX] = { 0x00 };
|
||||||
|
|
|
||||||
|
|
@ -39,16 +39,18 @@ enum
|
||||||
class ZotacTuringGPUController
|
class ZotacTuringGPUController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ZotacTuringGPUController(i2c_smbus_interface* bus, u8 dev);
|
ZotacTuringGPUController(i2c_smbus_interface* bus, u8 dev, std::string dev_name);
|
||||||
~ZotacTuringGPUController();
|
~ZotacTuringGPUController();
|
||||||
|
|
||||||
std::string GetDeviceLocation();
|
std::string GetDeviceLocation();
|
||||||
|
std::string GetDeviceName();
|
||||||
|
|
||||||
void GetMode(RGBColor& color, int& mode, unsigned int& speed);
|
void GetMode(RGBColor& color, int& mode, unsigned int& speed);
|
||||||
void SetMode(RGBColor color, int mode, unsigned int speed);
|
void SetMode(RGBColor color, int mode, unsigned int speed);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
i2c_smbus_interface* bus;
|
i2c_smbus_interface* bus;
|
||||||
u8 dev;
|
u8 dev;
|
||||||
|
std::string name;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,8 @@ void DetectZotacTuringGPUControllers(i2c_smbus_interface* bus, u8 i2c_addr, cons
|
||||||
{
|
{
|
||||||
if(TestForZotacTuringGPUController(bus, i2c_addr))
|
if(TestForZotacTuringGPUController(bus, i2c_addr))
|
||||||
{
|
{
|
||||||
ZotacTuringGPUController* controller = new ZotacTuringGPUController(bus, i2c_addr);
|
ZotacTuringGPUController* controller = new ZotacTuringGPUController(bus, i2c_addr, name);
|
||||||
RGBController_ZotacTuringGPU* rgb_controller = new RGBController_ZotacTuringGPU(controller);
|
RGBController_ZotacTuringGPU* rgb_controller = new RGBController_ZotacTuringGPU(controller);
|
||||||
rgb_controller->name = name;
|
|
||||||
|
|
||||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue