mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
General tidy up
This commit is contained in:
@@ -13,14 +13,10 @@ QString _usbProductDescription = "Hyperion led controller";
|
||||
}
|
||||
|
||||
LedDeviceHyperionUsbasp::LedDeviceHyperionUsbasp(const QJsonObject &deviceConfig)
|
||||
: LedDevice()
|
||||
: LedDevice(deviceConfig)
|
||||
, _libusbContext(nullptr)
|
||||
, _deviceHandle(nullptr)
|
||||
{
|
||||
_devConfig = deviceConfig;
|
||||
_isDeviceReady = false;
|
||||
|
||||
_activeDeviceType = deviceConfig["type"].toString("UNSPECIFIED").toLower();
|
||||
}
|
||||
|
||||
LedDeviceHyperionUsbasp::~LedDeviceHyperionUsbasp()
|
||||
|
@@ -33,7 +33,7 @@ enum DATA_VERSION_INDEXES{
|
||||
};
|
||||
|
||||
LedDeviceLightpack::LedDeviceLightpack(const QJsonObject &deviceConfig)
|
||||
: LedDevice()
|
||||
: LedDevice(deviceConfig)
|
||||
, _libusbContext(nullptr)
|
||||
, _deviceHandle(nullptr)
|
||||
, _busNumber(-1)
|
||||
@@ -41,12 +41,8 @@ LedDeviceLightpack::LedDeviceLightpack(const QJsonObject &deviceConfig)
|
||||
, _firmwareVersion({-1,-1})
|
||||
, _bitsPerChannel(-1)
|
||||
, _hwLedCount(-1)
|
||||
,_isOpen(false)
|
||||
, _isOpen(false)
|
||||
{
|
||||
_devConfig = deviceConfig;
|
||||
_isDeviceReady = false;
|
||||
|
||||
_activeDeviceType = deviceConfig["type"].toString("UNSPECIFIED").toLower();
|
||||
}
|
||||
|
||||
LedDeviceLightpack::~LedDeviceLightpack()
|
||||
|
@@ -18,23 +18,16 @@ bool compareLightpacks(LedDeviceLightpack * lhs, LedDeviceLightpack * rhs)
|
||||
}
|
||||
|
||||
LedDeviceMultiLightpack::LedDeviceMultiLightpack(const QJsonObject &deviceConfig)
|
||||
: LedDevice()
|
||||
: LedDevice(deviceConfig)
|
||||
, _lightpacks()
|
||||
{
|
||||
_devConfig = deviceConfig;
|
||||
_isDeviceReady = false;
|
||||
|
||||
_activeDeviceType = deviceConfig["type"].toString("UNSPECIFIED").toLower();
|
||||
}
|
||||
|
||||
LedDeviceMultiLightpack::~LedDeviceMultiLightpack()
|
||||
{
|
||||
for (LedDeviceLightpack * device : _lightpacks)
|
||||
{
|
||||
if ( device != nullptr)
|
||||
{
|
||||
delete device;
|
||||
}
|
||||
delete device;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2,14 +2,9 @@
|
||||
|
||||
// Use out report HID device
|
||||
LedDevicePaintpack::LedDevicePaintpack(const QJsonObject &deviceConfig)
|
||||
: ProviderHID()
|
||||
: ProviderHID(deviceConfig)
|
||||
{
|
||||
_devConfig = deviceConfig;
|
||||
_isDeviceReady = false;
|
||||
|
||||
_useFeature = false;
|
||||
|
||||
_activeDeviceType = deviceConfig["type"].toString("UNSPECIFIED").toLower();
|
||||
}
|
||||
|
||||
LedDevice* LedDevicePaintpack::construct(const QJsonObject &deviceConfig)
|
||||
|
@@ -2,13 +2,8 @@
|
||||
|
||||
// Use feature report HID device
|
||||
LedDeviceRawHID::LedDeviceRawHID(const QJsonObject &deviceConfig)
|
||||
: ProviderHID()
|
||||
: ProviderHID(deviceConfig)
|
||||
{
|
||||
_devConfig = deviceConfig;
|
||||
_isDeviceReady = false;
|
||||
|
||||
_activeDeviceType = deviceConfig["type"].toString("UNSPECIFIED").toLower();
|
||||
|
||||
_useFeature = true;
|
||||
}
|
||||
|
||||
|
@@ -9,8 +9,9 @@
|
||||
// Local Hyperion includes
|
||||
#include "ProviderHID.h"
|
||||
|
||||
ProviderHID::ProviderHID()
|
||||
: _VendorId(0)
|
||||
ProviderHID::ProviderHID(const QJsonObject &deviceConfig)
|
||||
: LedDevice(deviceConfig)
|
||||
, _VendorId(0)
|
||||
, _ProductId(0)
|
||||
, _useFeature(false)
|
||||
, _deviceHandle(nullptr)
|
||||
|
@@ -21,7 +21,7 @@ public:
|
||||
///
|
||||
/// @param deviceConfig Device's configuration as JSON-Object
|
||||
///
|
||||
ProviderHID();
|
||||
ProviderHID(const QJsonObject &deviceConfig);
|
||||
|
||||
///
|
||||
/// @brief Destructor of the LedDevice
|
||||
|
Reference in New Issue
Block a user