minor adjustments to Qt layout
This commit is contained in:
parent
8865de81b7
commit
ba62925b67
@ -223,6 +223,8 @@ SOURCES += \
|
|||||||
unit.cpp
|
unit.cpp
|
||||||
|
|
||||||
LIBS += -lusb-1.0
|
LIBS += -lusb-1.0
|
||||||
|
unix:LIBS += -L/usr/lib/
|
||||||
|
win32:LIBS += -L"$$_PRO_FILE_PWD_" # Github actions placed libusb here
|
||||||
|
|
||||||
QT += widgets
|
QT += widgets
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ SignalgeneratorWidget::SignalgeneratorWidget(QWidget *parent) :
|
|||||||
ui->span->setUnit("Hz");
|
ui->span->setUnit("Hz");
|
||||||
ui->span->setPrefixes(" kMG");
|
ui->span->setPrefixes(" kMG");
|
||||||
ui->span->setPrecision(6); // show enough digits
|
ui->span->setPrecision(6); // show enough digits
|
||||||
|
ui->span->setValue(0);
|
||||||
|
|
||||||
ui->current->setUnit("Hz");
|
ui->current->setUnit("Hz");
|
||||||
ui->current->setPrefixes(" kMG");
|
ui->current->setPrefixes(" kMG");
|
||||||
@ -21,10 +22,10 @@ SignalgeneratorWidget::SignalgeneratorWidget(QWidget *parent) :
|
|||||||
ui->dwell->setUnit("s");
|
ui->dwell->setUnit("s");
|
||||||
ui->dwell->setPrefixes(" m");
|
ui->dwell->setPrefixes(" m");
|
||||||
ui->dwell->setPrecision(6); // show enough digits
|
ui->dwell->setPrecision(6); // show enough digits
|
||||||
ui->dwell->setValueQuiet(1);
|
ui->dwell->setValue(1);
|
||||||
m_timerId = startTimer(1000);
|
m_timerId = startTimer(1000);
|
||||||
|
|
||||||
ui->steps->setValueQuiet(100);
|
ui->steps->setValue(100);
|
||||||
ui->steps->setPrefixes(" k");
|
ui->steps->setPrefixes(" k");
|
||||||
ui->steps->setPrecision(0);
|
ui->steps->setPrecision(0);
|
||||||
|
|
||||||
@ -57,8 +58,9 @@ SignalgeneratorWidget::SignalgeneratorWidget(QWidget *parent) :
|
|||||||
ui->frequency->setValueQuiet(ui->span->value()/2);
|
ui->frequency->setValueQuiet(ui->span->value()/2);
|
||||||
}
|
}
|
||||||
newF = ui->frequency->value() + ui->span->value()/2;
|
newF = ui->frequency->value() + ui->span->value()/2;
|
||||||
if (newF > Device::Info().limits_maxFreq)
|
if (newF > Device::Info().limits_maxFreq) {
|
||||||
ui->frequency->setValueQuiet(Device::Info().limits_maxFreq - ui->span->value()/2);
|
ui->frequency->setValueQuiet(Device::Info().limits_maxFreq - ui->span->value()/2);
|
||||||
|
}
|
||||||
|
|
||||||
newval = ui->frequency->value() - ui->span->value()/2;
|
newval = ui->frequency->value() - ui->span->value()/2;
|
||||||
|
|
||||||
@ -76,8 +78,8 @@ SignalgeneratorWidget::SignalgeneratorWidget(QWidget *parent) :
|
|||||||
});
|
});
|
||||||
|
|
||||||
connect(ui->dwell, &SIUnitEdit::valueChanged, [=](double newval) {
|
connect(ui->dwell, &SIUnitEdit::valueChanged, [=](double newval) {
|
||||||
if(newval < 0 ) {
|
if(newval < 0.01 ) {
|
||||||
newval = 0;
|
newval = 0.01;
|
||||||
} else if (newval > 60) {
|
} else if (newval > 60) {
|
||||||
newval = 60;
|
newval = 60;
|
||||||
}
|
}
|
||||||
@ -102,8 +104,9 @@ SignalgeneratorWidget::SignalgeneratorWidget(QWidget *parent) :
|
|||||||
}
|
}
|
||||||
emit SettingsChanged();
|
emit SettingsChanged();
|
||||||
});
|
});
|
||||||
connect(ui->EnabledSweep, &QCheckBox::clicked, [=](){
|
connect(ui->EnabledSweep, &QCheckBox::toggled, [=](bool enabled){
|
||||||
if(ui->EnabledSweep->isChecked()) {
|
ui->current->setEnabled(enabled);
|
||||||
|
if(enabled) {
|
||||||
double newF = ui->frequency->value() - ui->span->value()/2;
|
double newF = ui->frequency->value() - ui->span->value()/2;
|
||||||
if (newF < 0) {
|
if (newF < 0) {
|
||||||
ui->frequency->setValueQuiet(ui->frequency->value() - newF);
|
ui->frequency->setValueQuiet(ui->frequency->value() - newF);
|
||||||
|
@ -38,6 +38,19 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@ -59,7 +72,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Frequency:</string>
|
<string>Frequency</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
@ -148,125 +161,96 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Sweep</string>
|
<string>Sweep</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="SIUnitEdit" name="span">
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
|
||||||
<x>60</x>
|
|
||||||
<y>40</y>
|
|
||||||
<width>133</width>
|
|
||||||
<height>20</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>0MHz</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>40</y>
|
|
||||||
<width>47</width>
|
|
||||||
<height>13</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Span:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="SIUnitEdit" name="steps">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>60</x>
|
|
||||||
<y>70</y>
|
|
||||||
<width>133</width>
|
|
||||||
<height>20</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>100</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>70</y>
|
|
||||||
<width>47</width>
|
|
||||||
<height>13</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Steps:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>100</y>
|
|
||||||
<width>47</width>
|
|
||||||
<height>13</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Dwell:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="SIUnitEdit" name="dwell">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>60</x>
|
|
||||||
<y>100</y>
|
|
||||||
<width>133</width>
|
|
||||||
<height>20</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>100ms</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QCheckBox" name="EnabledSweep">
|
<widget class="QCheckBox" name="EnabledSweep">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>60</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>101</width>
|
|
||||||
<height>17</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Enabled</string>
|
<string>Enabled</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLabel" name="label_5">
|
</item>
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<x>10</x>
|
<item row="0" column="0">
|
||||||
<y>130</y>
|
<widget class="QLabel" name="label_2">
|
||||||
<width>47</width>
|
|
||||||
<height>13</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Current:</string>
|
<string>Span:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="SIUnitEdit" name="current">
|
</item>
|
||||||
<property name="geometry">
|
<item row="0" column="1">
|
||||||
<rect>
|
<widget class="SIUnitEdit" name="span">
|
||||||
<x>60</x>
|
|
||||||
<y>130</y>
|
|
||||||
<width>133</width>
|
|
||||||
<height>20</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>0MHz</string>
|
<string>0MHz</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Steps:</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="SIUnitEdit" name="steps">
|
||||||
|
<property name="text">
|
||||||
|
<string>100</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Dwell time:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="SIUnitEdit" name="dwell">
|
||||||
|
<property name="text">
|
||||||
|
<string>100ms</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>Current frequency:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="SIUnitEdit" name="current">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>0MHz</string>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
Loading…
Reference in New Issue
Block a user