|
|
|
@ -43,15 +43,15 @@ bool DeviceManage::connectDevice(Device::DeviceParams params)
|
|
|
|
connect(device, &Device::deviceDisconnect, this, &DeviceManage::onDeviceDisconnect);
|
|
|
|
connect(device, &Device::deviceDisconnect, this, &DeviceManage::onDeviceDisconnect);
|
|
|
|
connect(device, &Device::controlStateChange, this, &DeviceManage::onControlStateChange);
|
|
|
|
connect(device, &Device::controlStateChange, this, &DeviceManage::onControlStateChange);
|
|
|
|
m_devices[params.serial] = device;
|
|
|
|
m_devices[params.serial] = device;
|
|
|
|
|
|
|
|
if (!m_script.isEmpty()) {
|
|
|
|
|
|
|
|
device->updateScript(m_script);
|
|
|
|
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DeviceManage::updateScript(QString script)
|
|
|
|
void DeviceManage::updateScript(QString script)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (m_devices.isEmpty()) {
|
|
|
|
m_script = script;
|
|
|
|
qWarning() << "no device connect!!!";
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
QMapIterator<QString, QPointer<Device>> i(m_devices);
|
|
|
|
QMapIterator<QString, QPointer<Device>> i(m_devices);
|
|
|
|
while (i.hasNext()) {
|
|
|
|
while (i.hasNext()) {
|
|
|
|
i.next();
|
|
|
|
i.next();
|
|
|
|
|