mirror of
https://github.com/jankae/LibreVNA.git
synced 2025-12-06 07:12:10 +01:00
Minor UI improvememts
- Add space between number and unit - Increase width of toolbar items to (hopefully) be fully visible for all operating systems and themes - Adjust order of automatically created calibration measurements to match LibreCAL - Disable edit triggers for calibration measurement table - Show timestamps of calibration measurements in local time - Allow starting calibration measurements by double clicking row
This commit is contained in:
parent
d77215aecb
commit
937b002dfb
|
|
@ -533,8 +533,9 @@ void Calibration::edit(TraceModel *traceModel)
|
|||
ui->table->setCellWidget(i, 1, measurements[i]->createStandardWidget());
|
||||
ui->table->setCellWidget(i, 2, measurements[i]->createSettingsWidget());
|
||||
ui->table->setItem(i, 3, measurements[i]->getStatisticsItem());
|
||||
ui->table->setItem(i, 4, new QTableWidgetItem(measurements[i]->getTimestamp().toString()));
|
||||
ui->table->setItem(i, 4, new QTableWidgetItem(measurements[i]->getTimestamp().toLocalTime().toString()));
|
||||
}
|
||||
ui->table->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
ui->table->selectRow(row);
|
||||
updateTableEditButtons();
|
||||
};
|
||||
|
|
@ -625,6 +626,11 @@ void Calibration::edit(TraceModel *traceModel)
|
|||
emit startMeasurements(m);
|
||||
});
|
||||
|
||||
// double clicking on a row also starts the measurement
|
||||
connect(ui->table, &QTableWidget::doubleClicked, this, [=](){
|
||||
emit ui->measure->clicked();
|
||||
});
|
||||
|
||||
connect(ui->selectMeasurement, &QPushButton::clicked, [=](){
|
||||
auto selected = ui->table->selectionModel()->selectedRows();
|
||||
if(selected.size() != 1) {
|
||||
|
|
@ -1971,12 +1977,12 @@ void Calibration::createDefaultMeasurements(Calibration::DefaultMeasurements dm)
|
|||
{
|
||||
lock_guard<recursive_mutex> guard(access);
|
||||
auto createSOL = [=](int port) {
|
||||
auto _short = new CalibrationMeasurement::Short(this);
|
||||
_short->setPort(port);
|
||||
measurements.push_back(_short);
|
||||
auto open = new CalibrationMeasurement::Open(this);
|
||||
open->setPort(port);
|
||||
measurements.push_back(open);
|
||||
auto _short = new CalibrationMeasurement::Short(this);
|
||||
_short->setPort(port);
|
||||
measurements.push_back(_short);
|
||||
auto load = new CalibrationMeasurement::Load(this);
|
||||
load->setPort(port);
|
||||
measurements.push_back(load);
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ SpectrumAnalyzer::SpectrumAnalyzer(AppWindow *window, QString name)
|
|||
|
||||
auto eStart = new SIUnitEdit("Hz", " kMG", 6);
|
||||
// calculate width required with expected string length
|
||||
auto width = QFontMetrics(eStart->font()).horizontalAdvance("3.00000GHz") + 15;
|
||||
auto width = QFontMetrics(eStart->font()).horizontalAdvance("10.00000 MHz") + 15;
|
||||
eStart->setFixedWidth(width);
|
||||
eStart->setToolTip("Start frequency");
|
||||
connect(eStart, &SIUnitEdit::valueChanged, this, &SpectrumAnalyzer::SetStartFreq);
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ VNA::VNA(AppWindow *window, QString name)
|
|||
|
||||
auto eStart = new SIUnitEdit("Hz", " kMG", 6);
|
||||
// calculate width required with expected string length
|
||||
auto width = QFontMetrics(eStart->font()).horizontalAdvance("3.00000GHz") + 15;
|
||||
auto width = QFontMetrics(eStart->font()).horizontalAdvance("10.00000 MHz") + 15;
|
||||
eStart->setFixedWidth(width);
|
||||
eStart->setToolTip("Start frequency");
|
||||
connect(eStart, &SIUnitEdit::valueChanged, this, &VNA::SetStartFreq);
|
||||
|
|
|
|||
|
|
@ -68,6 +68,10 @@ QString Unit::ToString(double value, QString unit, QString prefixes, int precisi
|
|||
}
|
||||
ss << value;
|
||||
sValue.append(QString::fromStdString(ss.str()));
|
||||
if(!unit.isEmpty() && !unit.startsWith(' ')) {
|
||||
// add space between number and unit
|
||||
sValue.append(' ');
|
||||
}
|
||||
sValue.append(prefixes[prefixIndex]);
|
||||
}
|
||||
sValue.append(unit);
|
||||
|
|
|
|||
Loading…
Reference in a new issue