MCPcopy Create free account
hub / github.com/Atarity/Lightpack / startLedDeviceManager

Method startLedDeviceManager

Software/src/LightpackApplication.cpp:492–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492void LightpackApplication::startLedDeviceManager()
493{
494 DEBUG_LOW_LEVEL << Q_FUNC_INFO;
495 m_ledDeviceManager = new LedDeviceManager();
496 m_LedDeviceManagerThread = new QThread();
497
498// connect(settings(), SIGNAL(connectedDeviceChanged(const SupportedDevices::DeviceType)), this, SLOT(handleConnectedDeviceChange(const SupportedDevices::DeviceType)), Qt::DirectConnection);
499// connect(settings(), SIGNAL(adalightSerialPortNameChanged(QString)), m_ledDeviceManager, SLOT(recreateLedDevice()), Qt::DirectConnection);
500// connect(settings(), SIGNAL(adalightSerialPortBaudRateChanged(QString)), m_ledDeviceManager, SLOT(recreateLedDevice()), Qt::DirectConnection);
501// connect(m_settingsWindow, SIGNAL(updateLedsColors(const QList<QRgb> &)), m_ledDeviceManager, SLOT(setColors(QList<QRgb>)), Qt::QueuedConnection);
502 m_pluginInterface = new LightpackPluginInterface(NULL);
503
504 connect(m_pluginInterface, SIGNAL(updateDeviceLockStatus(DeviceLocked::DeviceLockStatus, QList<QString>)), this, SLOT(setDeviceLockViaAPI(DeviceLocked::DeviceLockStatus, QList<QString>)));
505 connect(m_pluginInterface, SIGNAL(updateLedsColors(const QList<QRgb> &)), m_ledDeviceManager, SLOT(setColors(QList<QRgb>)), Qt::QueuedConnection);
506 connect(m_pluginInterface, SIGNAL(updateGamma(double)), m_ledDeviceManager, SLOT(setGamma(double)), Qt::QueuedConnection);
507 connect(m_pluginInterface, SIGNAL(updateBrightness(int)), m_ledDeviceManager, SLOT(setBrightness(int)), Qt::QueuedConnection);
508 connect(m_pluginInterface, SIGNAL(updateSmooth(int)), m_ledDeviceManager, SLOT(setSmoothSlowdown(int)), Qt::QueuedConnection);
509 connect(m_pluginInterface, SIGNAL(requestBacklightStatus()), this, SLOT(requestBacklightStatus()));
510// connect(m_pluginInterface, SIGNAL(changeDevice(QString)), m_settingsWindow , SLOT(setDevice(QString)));
511// connect(m_pluginInterface, SIGNAL(updateCountLeds(int)), m_settingsWindow , SLOT(updateUiFromSettings()));
512// connect(m_pluginInterface, SIGNAL(updateCountLeds(int)), this , SLOT(numberOfLedsChanged(int)));
513
514 if (!m_noGui)
515 {
516 connect(m_pluginInterface, SIGNAL(updateLedsColors(const QList<QRgb> &)), m_settingsWindow, SLOT(updateVirtualLedsColors(QList<QRgb>)));
517 connect(m_pluginInterface, SIGNAL(updateDeviceLockStatus(DeviceLocked::DeviceLockStatus, QList<QString>)), m_settingsWindow, SLOT(setDeviceLockViaAPI(DeviceLocked::DeviceLockStatus, QList<QString>)));
518 connect(m_pluginInterface, SIGNAL(updateProfile(QString)), m_settingsWindow, SLOT(profileSwitch(QString)));
519 connect(m_pluginInterface, SIGNAL(updateStatus(Backlight::Status)), m_settingsWindow, SLOT(setBacklightStatus(Backlight::Status)));
520 }
521 else
522 {
523 connect(m_pluginInterface, SIGNAL(updateProfile(QString)), this, SLOT(profileSwitch(QString)));
524 connect(m_pluginInterface, SIGNAL(updateStatus(Backlight::Status)), this, SLOT(setStatusChanged(Backlight::Status)));
525 }
526
527 connect(settings(), SIGNAL(deviceColorDepthChanged(int)), m_ledDeviceManager, SLOT(setColorDepth(int)), Qt::QueuedConnection);
528 connect(settings(), SIGNAL(deviceSmoothChanged(int)), m_ledDeviceManager, SLOT(setSmoothSlowdown(int)), Qt::QueuedConnection);
529 connect(settings(), SIGNAL(deviceRefreshDelayChanged(int)), m_ledDeviceManager, SLOT(setRefreshDelay(int)), Qt::QueuedConnection);
530 connect(settings(), SIGNAL(deviceGammaChanged(double)), m_ledDeviceManager, SLOT(setGamma(double)), Qt::QueuedConnection);
531 connect(settings(), SIGNAL(deviceBrightnessChanged(int)), m_ledDeviceManager, SLOT(setBrightness(int)), Qt::QueuedConnection);
532// connect(settings(), SIGNAL(deviceColorSequenceChanged(QString)),m_ledDeviceManager, SLOT(setColorSequence(QString)), Qt::QueuedConnection);
533 connect(settings(), SIGNAL(luminosityThresholdChanged(int)) ,m_ledDeviceManager, SLOT(setLuminosityThreshold(int)), Qt::QueuedConnection);
534 connect(settings(), SIGNAL(minimumLuminosityEnabledChanged(bool)),m_ledDeviceManager, SLOT(setMinimumLuminosityEnabled(bool)), Qt::QueuedConnection);
535 connect(settings(), SIGNAL(ledCoefBlueChanged(int,double)) ,m_ledDeviceManager, SLOT(updateWBAdjustments()), Qt::QueuedConnection);
536 connect(settings(), SIGNAL(ledCoefRedChanged(int,double)) ,m_ledDeviceManager, SLOT(updateWBAdjustments()), Qt::QueuedConnection);
537 connect(settings(), SIGNAL(ledCoefGreenChanged(int,double)) ,m_ledDeviceManager, SLOT(updateWBAdjustments()), Qt::QueuedConnection);
538
539// connect(settingsObj, SIGNAL(settingsProfileChanged()), m_ledDeviceManager, SLOT(updateDeviceSettings()), Qt::QueuedConnection);
540
541
542 if (!m_noGui)
543 {
544 connect(m_settingsWindow, SIGNAL(requestFirmwareVersion()), m_ledDeviceManager, SLOT(requestFirmwareVersion()), Qt::QueuedConnection);
545 connect(m_settingsWindow, SIGNAL(switchOffLeds()), m_ledDeviceManager, SLOT(switchOffLeds()), Qt::QueuedConnection);
546 connect(m_settingsWindow, SIGNAL(switchOnLeds()), m_ledDeviceManager, SLOT(switchOnLeds()), Qt::QueuedConnection);
547 connect(m_ledDeviceManager, SIGNAL(openDeviceSuccess(bool)), m_settingsWindow, SLOT(ledDeviceOpenSuccess(bool)), Qt::QueuedConnection);
548 connect(m_ledDeviceManager, SIGNAL(ioDeviceSuccess(bool)), m_settingsWindow, SLOT(ledDeviceCallSuccess(bool)), Qt::QueuedConnection);
549 connect(m_ledDeviceManager, SIGNAL(firmwareVersion(QString)), m_settingsWindow, SLOT(ledDeviceFirmwareVersionResult(QString)), Qt::QueuedConnection);

Callers

nothing calls this directly

Calls 2

updateStatusFunction · 0.85
startMethod · 0.45

Tested by

no test coverage detected