|
|
|
@ -116,11 +116,16 @@ SignalEdit::SignalEdit(int index, QWidget *parent) : form_idx(index), QWidget(pa |
|
|
|
|
hline->setFrameShadow(QFrame::Sunken); |
|
|
|
|
main_layout->addWidget(hline); |
|
|
|
|
|
|
|
|
|
save_timer = new QTimer(this); |
|
|
|
|
save_timer->setInterval(300); |
|
|
|
|
save_timer->setSingleShot(true); |
|
|
|
|
save_timer->callOnTimeout(this, &SignalEdit::saveSignal); |
|
|
|
|
|
|
|
|
|
QObject::connect(title, &ElidedLabel::clicked, this, &SignalEdit::showFormClicked); |
|
|
|
|
QObject::connect(plot_btn, &QToolButton::clicked, [this](bool checked) { emit showChart(msg_id, sig, checked); }); |
|
|
|
|
QObject::connect(seek_btn, &QToolButton::clicked, [this]() { SignalFindDlg(msg_id, sig, this).exec(); }); |
|
|
|
|
QObject::connect(remove_btn, &QToolButton::clicked, [this]() { emit remove(sig); }); |
|
|
|
|
QObject::connect(form, &SignalForm::changed, this, &SignalEdit::saveSignal); |
|
|
|
|
QObject::connect(form, &SignalForm::changed, [this]() { save_timer->start(); }); |
|
|
|
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -174,7 +179,9 @@ void SignalEdit::setChartOpened(bool opened) { |
|
|
|
|
void SignalEdit::updateForm(bool visible) { |
|
|
|
|
if (visible && sig) { |
|
|
|
|
form->changed_by_user = false; |
|
|
|
|
form->name->setText(sig->name.c_str()); |
|
|
|
|
if (form->name->text() != sig->name.c_str()) { |
|
|
|
|
form->name->setText(sig->name.c_str()); |
|
|
|
|
} |
|
|
|
|
form->endianness->setCurrentIndex(sig->is_little_endian ? 0 : 1); |
|
|
|
|
form->sign->setCurrentIndex(sig->is_signed ? 0 : 1); |
|
|
|
|
form->factor->setText(QString::number(sig->factor)); |
|
|
|
|