Fix parsing of timestamp in packet logs, change file ending
This commit is contained in:
parent
2111f5844a
commit
9eb2a913b7
@ -156,7 +156,7 @@ nlohmann::json DevicePacketLog::LogEntry::toJSON()
|
|||||||
void DevicePacketLog::LogEntry::fromJSON(nlohmann::json j)
|
void DevicePacketLog::LogEntry::fromJSON(nlohmann::json j)
|
||||||
{
|
{
|
||||||
type = QString::fromStdString(j.value("type", "")) == "Packet" ? Type::Packet : Type::InvalidBytes;
|
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", ""));
|
serial = QString::fromStdString(j.value("serial", ""));
|
||||||
datapoint = nullptr;
|
datapoint = nullptr;
|
||||||
p = nullptr;
|
p = nullptr;
|
||||||
|
@ -28,7 +28,7 @@ DevicePacketLogView::DevicePacketLogView(QWidget *parent) :
|
|||||||
updateTree();
|
updateTree();
|
||||||
});
|
});
|
||||||
connect(ui->buttonBox->button(QDialogButtonBox::Save), &QPushButton::clicked, [=](){
|
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()) {
|
if(filename.isEmpty()) {
|
||||||
// aborted selection
|
// aborted selection
|
||||||
return;
|
return;
|
||||||
@ -42,7 +42,7 @@ DevicePacketLogView::DevicePacketLogView(QWidget *parent) :
|
|||||||
file.close();
|
file.close();
|
||||||
});
|
});
|
||||||
connect(ui->buttonBox->button(QDialogButtonBox::Open), &QPushButton::clicked, [=](){
|
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()) {
|
if(filename.isEmpty()) {
|
||||||
// aborted selection
|
// aborted selection
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user