General tidy up

This commit is contained in:
Murat
2020-08-08 00:21:19 +02:00
parent 13205a9d11
commit dd2d5e4b40
62 changed files with 117 additions and 296 deletions

View File

@@ -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()

View File

@@ -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()

View File

@@ -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;
}
}

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -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)

View File

@@ -21,7 +21,7 @@ public:
///
/// @param deviceConfig Device's configuration as JSON-Object
///
ProviderHID();
ProviderHID(const QJsonObject &deviceConfig);
///
/// @brief Destructor of the LedDevice