Skip to content

Commit

Permalink
fix set baud rate
Browse files Browse the repository at this point in the history
  • Loading branch information
DowJhob committed Jan 17, 2022
1 parent 5209dee commit 1d14b53
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/DMA-proto/jcsbanksDMA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void jcsbanksDMA::sendDMAcomand(char command, unsigned long addr, unsigned long
if ( buf != nullptr)
{
memcpy((*devComm)->p_out_buff, buf, count);
qDebug() << "jcsbanksDMA::sendDMAcomand payload data" << count;
//qDebug() << "jcsbanksDMA::sendDMAcomand payload data" << count;
(*devComm)->write( count);
}

Expand Down
9 changes: 7 additions & 2 deletions src/comm-device-interface/devicemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ void deviceManager::addDevice(device dev)
default : return; // но поскольку тут вылетим без добавления то вроде и не важно
}
devComm->setBaudRate(el_baudRate.text().toUInt());
connect(this, &deviceManager::baudRateChanged, this, [&devComm](uint baudRate){devComm->setBaudRate(baudRate);});
// connect(this, &deviceManager::baudRateChanged, this, [&devComm](uint baudRate){
// devComm->setBaudRate(baudRate);
// });

availCommDev.addItem(dev.DeviceDesc + " / " + dev.DeviceUniqueID, QVariant::fromValue<comm_device_interface*>(devComm));
}
Expand Down Expand Up @@ -80,7 +82,10 @@ void deviceManager::_deviceSelected(int index)

void deviceManager::baudRateUpdate() // Обновляем скорость обмена
{
comm_device_interface *devComm = qvariant_cast<comm_device_interface*>(availCommDev.currentData());

baudRate = el_baudRate.text().toUInt();
emit baudRateChanged(el_baudRate.text().toUInt());
devComm->setBaudRate(baudRate);
//emit baudRateChanged(el_baudRate.text().toUInt());
qDebug() << "=========== deviceManager::baudRateUpdate ================" << baudRate;
}
1 change: 1 addition & 0 deletions src/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ void controller::updateRAM(abstractMemoryScaled memory)
{
_dataLogger->stop();
ECUproto->directDMAwrite(memory.addr, memory.data(), memory.size());
//_dataLogger->start();
//QThread::msleep(50);
}

Expand Down
2 changes: 2 additions & 0 deletions src/deviceNativeFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ device deviceNativeFilter::getDevProp(HDEVINFO hDevInfo, SP_DEVINFO_DATA DeviceI

device deviceNativeFilter::getDevProp(PDEV_BROADCAST_DEVICEINTERFACE pDevInf)
{
if(pDevInf == NULL)
return device();
QStringList qDevInf = QString::fromWCharArray((wchar_t*)pDevInf->dbcc_name).split('#');
//qDebug() << "enumerator::getDevProp pDevInf->dbcc_name" << qDevInf << "pDevInf->dbcc_classguid" << pDevInf->dbcc_classguid << endl;
if (qDevInf.length() >= 3)
Expand Down

0 comments on commit 1d14b53

Please sign in to comment.