Can debugger

Add send can message
This commit is contained in:
2026-02-01 19:02:10 +01:00
parent 5938645654
commit 35545ef873
3 changed files with 259 additions and 19 deletions
+26
View File
@@ -6,6 +6,32 @@ Can_Debugger::Can_Debugger(Web_socket_wrapper* web_socket, QWidget *parent) :
ui(new Ui::Can_Debugger) {
ui->setupUi(this);
this->setWindowTitle("CAN Debugger");
can_send_hexspinboxes = {
ui->s_can_send_data0,
ui->s_can_send_data1,
ui->s_can_send_data2,
ui->s_can_send_data3,
ui->s_can_send_data4,
ui->s_can_send_data5,
ui->s_can_send_data6,
ui->s_can_send_data7,
};
enable_can_send_data();
connect(ui->c_can_send_dlc, &QComboBox::currentIndexChanged, this, [=]{enable_can_send_data();});
}
void Can_Debugger::enable_can_send_data()
{
uint8_t selected = atoi(ui->c_can_send_dlc->currentText().toLocal8Bit());
for (size_t i = 0; i < can_send_hexspinboxes.size(); i++)
{
can_send_hexspinboxes[i]->setEnabled(i < selected);
if (i >= selected)
{
can_send_hexspinboxes[i]->setValue(0);
}
}
}
Can_Debugger::~Can_Debugger() {