IQ.Pilot Release Commit @ e46d557

This commit is contained in:
IQ.Lvbs CI [bot]
2026-08-07 00:13:39 -05:00
parent 03c3158b81
commit 824bb9ddfd
216 changed files with 7457 additions and 3151 deletions

View File

@@ -1,41 +1,41 @@
#include "tools/cabana/utils/export.h"
#include <QFile>
#include <QTextStream>
#include <fstream>
#include <iomanip>
#include "tools/cabana/streams/abstractstream.h"
namespace utils {
void exportToCSV(const QString &file_name, std::optional<MessageId> msg_id) {
QFile file(file_name);
if (file.open(QIODevice::ReadWrite | QIODevice::Truncate)) {
QTextStream stream(&file);
void exportToCSV(const std::string &file_name, std::optional<MessageId> msg_id) {
std::ofstream stream(file_name, std::ios::trunc);
if (stream) {
stream << "time,addr,bus,data\n";
for (auto e : msg_id ? can->events(*msg_id) : can->allEvents()) {
stream << QString::number(can->toSeconds(e->mono_time), 'f', 3) << ","
<< "0x" << QString::number(e->address, 16) << "," << e->src << ","
<< "0x" << QByteArray::fromRawData((const char *)e->dat, e->size).toHex().toUpper() << "\n";
stream << std::fixed << std::setprecision(3) << can->toSeconds(e->mono_time) << ","
<< "0x" << std::hex << e->address << std::dec << "," << static_cast<int>(e->src) << ",0x"
<< std::uppercase << std::hex << std::setfill('0');
for (int i = 0; i < e->size; ++i) stream << std::setw(2) << static_cast<int>(e->dat[i]);
stream << std::nouppercase << std::dec << "\n";
}
}
}
void exportSignalsToCSV(const QString &file_name, const MessageId &msg_id) {
QFile file(file_name);
if (auto msg = dbc()->msg(msg_id); msg && msg->sigs.size() && file.open(QIODevice::ReadWrite | QIODevice::Truncate)) {
QTextStream stream(&file);
void exportSignalsToCSV(const std::string &file_name, const MessageId &msg_id) {
std::ofstream stream(file_name, std::ios::trunc);
if (auto msg = dbc()->msg(msg_id); msg && !msg->sigs.empty() && stream) {
stream << "time,addr,bus";
for (auto s : msg->sigs)
stream << "," << s->name;
stream << "," << s->name.c_str();
stream << "\n";
for (auto e : can->events(msg_id)) {
stream << QString::number(can->toSeconds(e->mono_time), 'f', 3) << ","
<< "0x" << QString::number(e->address, 16) << "," << e->src;
stream << std::fixed << std::setprecision(3) << can->toSeconds(e->mono_time) << ","
<< "0x" << std::hex << e->address << std::dec << "," << static_cast<int>(e->src);
for (auto s : msg->sigs) {
double value = 0;
s->getValue(e->dat, e->size, &value);
stream << "," << QString::number(value, 'f', s->precision);
stream << "," << std::fixed << std::setprecision(s->precision) << value;
}
stream << "\n";
}