Skip to content

Commit

Permalink
Merge branch 'COVESA:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
bunty95 authored Sep 12, 2024
2 parents 920b37e + 07e1ad5 commit 5874deb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
8 changes: 4 additions & 4 deletions qdlt/qdltargument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,21 +494,21 @@ QString QDltArgument::toString(bool binary) const
{
case 4:
if(endianness == DltEndiannessLittleEndian)
text += QString("%1").arg((double)(*(float*)(data.constData())));
text += QString("%1").arg((double)(*(float*)(data.constData())), 0, 'f', 8);
else
{
const auto tmp = DLT_SWAP_32((unsigned int)(*(unsigned int*)(data.constData())));
void *buf = (void *) &tmp;
text += QString("%1").arg((double)(*((float*)buf)));
text += QString("%1").arg((double)(*((float*)buf)), 0, 'f', 8);
}
break;
case 8:
if(endianness == DltEndiannessLittleEndian)
text += QString("%1").arg((double)(*(double*)(data.constData())));
text += QString("%1").arg((double)(*(double*)(data.constData())), 0, 'f', 8);
else {
const auto tmp = DLT_SWAP_64((unsigned long long)(*(unsigned long long*)(data.constData())));
void *buf = (void *) &tmp;
text += QString("%1").arg((double)(*((double*)buf)));
text += QString("%1").arg((double)(*((double*)buf)), 0, 'f', 8);
}
break;
default:
Expand Down
12 changes: 9 additions & 3 deletions qdlt/qdltoptmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ void QDltOptManager::parse(QStringList *opt)
{
QString c = opt->value(i+1);
postPluginCommands += c;
QStringList args = c.split("|");
commandline_mode = true;
++i;
}
Expand Down Expand Up @@ -287,9 +286,16 @@ void QDltOptManager::parse(QStringList *opt)
* So we have to close it in this case
*/
#if (WIN32)
if ( !commandline_mode)
if (!commandline_mode)
{
FreeConsole();
HWND consoleWnd = GetConsoleWindow();
DWORD dwProcessId;
GetWindowThreadProcessId(consoleWnd, &dwProcessId);
if (GetCurrentProcessId() == dwProcessId)
{
// user launched the application with a double click from explorer: we do not need console
FreeConsole();
}
}
#endif
}
Expand Down
10 changes: 9 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3532,7 +3532,11 @@ void MainWindow::connectECU(EcuItem* ecuitem,bool force)
disconnect(ecuitem->socket,0,0,0);
connect(ecuitem->socket,SIGNAL(connected()),this,SLOT(connected()));
connect(ecuitem->socket,SIGNAL(disconnected()),this,SLOT(disconnected()));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(ecuitem->socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(error(QAbstractSocket::SocketError)));
#else
connect(ecuitem->socket, &QAbstractSocket::errorOccurred, this, &MainWindow::error);
#endif
connect(ecuitem->socket,SIGNAL(readyRead()),this,SLOT(readyRead()));
connect(ecuitem->socket,SIGNAL(stateChanged(QAbstractSocket::SocketState)),this,SLOT(stateChangedIP(QAbstractSocket::SocketState)));
ecuitem->socket->connectToHost(ecuitem->getHostname(),ecuitem->getIpport());
Expand Down Expand Up @@ -3615,7 +3619,11 @@ void MainWindow::connectECU(EcuItem* ecuitem,bool force)

connect(ecuitem->socket,SIGNAL(connected()),this,SLOT(connected()));
connect(ecuitem->socket,SIGNAL(disconnected()),this,SLOT(disconnected()));
connect(ecuitem->socket,&QAbstractSocket::errorOccurred, this, &MainWindow::error);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(ecuitem->socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(error(QAbstractSocket::SocketError)));
#else
connect(ecuitem->socket, &QAbstractSocket::errorOccurred, this, &MainWindow::error);
#endif
connect(ecuitem->socket,SIGNAL(readyRead()),this,SLOT(readyRead()));
connect(ecuitem->socket,SIGNAL(stateChanged(QAbstractSocket::SocketState)),this,SLOT(stateChangedIP(QAbstractSocket::SocketState)));
ecuitem->update();
Expand Down

0 comments on commit 5874deb

Please sign in to comment.