mirror of
https://github.com/DreamSourceLab/DSView.git
synced 2025-01-23 13:42:55 +08:00
fix: Can't resotre the 'Hold Off Time' from file
This commit is contained in:
parent
42dd9cfd58
commit
4f21488835
@ -184,7 +184,7 @@ bool bHighScale = true;
|
||||
|
||||
#ifdef DEBUG_INFO
|
||||
if (XLOG_LEVEL_INFO > logLevel){
|
||||
dsv_log_level(XLOG_LEVEL_INFO); // on develop mode, set the default log ldevel
|
||||
dsv_log_level(XLOG_LEVEL_INFO); // on develop mode, set the default log level
|
||||
logLevel = XLOG_LEVEL_INFO;
|
||||
}
|
||||
#endif
|
||||
|
@ -64,9 +64,10 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession *session) :
|
||||
_holdoff_label = new QLabel(_widget);
|
||||
_holdoff_comboBox = new DsComboBox(_widget);
|
||||
//tr
|
||||
_holdoff_comboBox->addItem(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_US), "uS"), QVariant::fromValue(1000));
|
||||
_holdoff_comboBox->addItem(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MS), "mS"), QVariant::fromValue(1000000));
|
||||
_holdoff_comboBox->addItem(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_S), "S"), QVariant::fromValue(1000000000));
|
||||
_holdoff_comboBox->addItem(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MS), "mS"), QVariant::fromValue(1000000));
|
||||
_holdoff_comboBox->addItem(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_US), "uS"), QVariant::fromValue(1000));
|
||||
|
||||
_holdoff_comboBox->setCurrentIndex(0);
|
||||
_holdoff_spinBox = new QSpinBox(_widget);
|
||||
_holdoff_spinBox->setRange(0, 999);
|
||||
@ -442,8 +443,11 @@ void DsoTriggerDock::update_view()
|
||||
uint64_t holdoff = g_variant_get_uint64(gvar);
|
||||
g_variant_unref(gvar);
|
||||
|
||||
for (int i = _holdoff_comboBox->count()-1; i >= 0; i--) {
|
||||
if (holdoff >= _holdoff_comboBox->itemData(i).toDouble()) {
|
||||
auto v = holdoff * 10.0;
|
||||
|
||||
for (int i=0; i<_holdoff_comboBox->count(); i++)
|
||||
{
|
||||
if (v >= _holdoff_comboBox->itemData(i).toDouble()) {
|
||||
_holdoff_comboBox->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
@ -454,8 +458,10 @@ void DsoTriggerDock::update_view()
|
||||
else
|
||||
_holdoff_slider->setRange(0, 999);
|
||||
|
||||
_holdoff_spinBox->setValue(holdoff * 10.0 / _holdoff_comboBox->currentData().toDouble());
|
||||
auto v1 = holdoff * 10.0 / _holdoff_comboBox->currentData().toDouble();
|
||||
_holdoff_spinBox->setValue(v1);
|
||||
}
|
||||
|
||||
connect(_holdoff_slider, SIGNAL(valueChanged(int)), this, SLOT(hold_changed(int)));
|
||||
connect(_holdoff_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(hold_changed(int)));
|
||||
|
||||
|
@ -77,7 +77,7 @@
|
||||
},
|
||||
{
|
||||
"id": "IDS_DLG_EXIT",
|
||||
"text": "推出"
|
||||
"text": "退出"
|
||||
},
|
||||
{
|
||||
"id": "IDS_DLG_MANUAL_CALIBRATION",
|
||||
|
Loading…
x
Reference in New Issue
Block a user