Мелкое изменение

This commit is contained in:
vlad 2022-01-24 16:38:00 +03:00
parent 2864edb21b
commit b8fb6d361c
3 changed files with 19 additions and 19 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.21)
project(sdp_sniffer_qt)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

View File

@ -2,7 +2,7 @@ QT += core gui serialport
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++20
CONFIG += c++17
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.

View File

@ -18,23 +18,23 @@ MainWindow::MainWindow(QWidget *parent)
updatePortsList();
// это перегон текстовика с заранее сохраненными пакетами
std::fstream f("/home/vlad/Documents/sniffer-dir/test6.txt", std::ios_base::in | std::ios_base::binary);
if (f.good()) {
do {
char chars[22];
f.read((char*) chars, 22);
if (f.good()) {
for (char c: chars) {
printf("%c", c);
putCharToMessage(c);
}
} else {
break;
}
} while (!f.eof());
ui->log->appendHtml("<font style=\"color:green\">[INFO] Файл c данными прочитан. Там " + QString::number(messages.size()) + " записей</font>\n");
}
f.close();
// std::fstream f("test6.txt", std::ios_base::in | std::ios_base::binary);
// if (f.good()) {
// do {
// char chars[22];
// f.read((char*) chars, 22);
// if (f.good()) {
// for (char c: chars) {
// printf("%c", c);
// putCharToMessage(c);
// }
// } else {
// break;
// }
// } while (!f.eof());
// ui->log->appendHtml("<font style=\"color:green\">[INFO] Файл c данными прочитан. Там " + QString::number(messages.size()) + " записей</font>\n");
// }
// f.close();
}
MainWindow::~MainWindow() {