Fix parsing of timestamp in packet logs, change file ending

This commit is contained in:
Jan Käberich 2023-03-21 13:03:10 +01:00
parent 2111f5844a
commit 9eb2a913b7
2 changed files with 3 additions and 3 deletions

View File

@ -156,7 +156,7 @@ nlohmann::json DevicePacketLog::LogEntry::toJSON()
void DevicePacketLog::LogEntry::fromJSON(nlohmann::json j)
{
type = QString::fromStdString(j.value("type", "")) == "Packet" ? Type::Packet : Type::InvalidBytes;
timestamp = QDateTime::fromMSecsSinceEpoch(j.value("timestamp", 0UL), Qt::TimeSpec::UTC);
timestamp = QDateTime::fromMSecsSinceEpoch(j.value("timestamp", 0ULL), Qt::TimeSpec::UTC);
serial = QString::fromStdString(j.value("serial", ""));
datapoint = nullptr;
p = nullptr;

View File

@ -28,7 +28,7 @@ DevicePacketLogView::DevicePacketLogView(QWidget *parent) :
updateTree();
});
connect(ui->buttonBox->button(QDialogButtonBox::Save), &QPushButton::clicked, [=](){
QString filename = QFileDialog::getSaveFileName(nullptr, "Load USB log data", "", "USB log files (*.usblog)", nullptr, QFileDialog::DontUseNativeDialog);
QString filename = QFileDialog::getSaveFileName(nullptr, "Load LibreVNA log data", "", "LibreVNA log files (*.vnalog)", nullptr, QFileDialog::DontUseNativeDialog);
if(filename.isEmpty()) {
// aborted selection
return;
@ -42,7 +42,7 @@ DevicePacketLogView::DevicePacketLogView(QWidget *parent) :
file.close();
});
connect(ui->buttonBox->button(QDialogButtonBox::Open), &QPushButton::clicked, [=](){
QString filename = QFileDialog::getOpenFileName(nullptr, "Load USB log data", "", "USB log files (*.usblog)", nullptr, QFileDialog::DontUseNativeDialog);
QString filename = QFileDialog::getOpenFileName(nullptr, "Load LibreVNA log data", "", "LibreVNA log files (*.vnalog)", nullptr, QFileDialog::DontUseNativeDialog);
if(filename.isEmpty()) {
// aborted selection
return;