Skip to content

Commit

Permalink
UI to set voltage for power supplies
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmucde committed May 7, 2022
1 parent ffde8ca commit 99e0f2e
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 22 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ Github Sponsors:

## Changes

v0.1.3:

* UI to set voltage for power supplies

v0.1.2:

* Fix PS/MM setVoltage to match the 3-digit syntax
Expand Down
12 changes: 12 additions & 0 deletions dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,11 +880,13 @@ void Dialog::injection(QString text)
{
float value = list[1].toFloat();
dltMultimeter1.setVoltage(value);
ui->doubleSpinBoxPower1->setValue(value);
}
else if(list[0]=="VOLTAGE2")
{
float value = list[1].toFloat();
dltMultimeter2.setVoltage(value);
ui->doubleSpinBoxPower2->setValue(value);
}
else if(dltRelais1.getRelaisName(1) == list[0])
{
Expand Down Expand Up @@ -1108,4 +1110,14 @@ void Dialog::injection(QString text)

}

void Dialog::on_SetPower1_clicked()
{
dltMultimeter1.setVoltage(ui->doubleSpinBoxPower1->value());
}


void Dialog::on_pushButtonSetPower2_clicked()
{
dltMultimeter2.setVoltage(ui->doubleSpinBoxPower2->value());
}

4 changes: 4 additions & 0 deletions dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ private slots:

void on_pushButtonRelais8Trigger_clicked();

void on_SetPower1_clicked();

void on_pushButtonSetPower2_clicked();

private:
Ui::Dialog *ui;

Expand Down
82 changes: 61 additions & 21 deletions dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>922</width>
<height>723</height>
<width>928</width>
<height>628</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -84,50 +84,70 @@
<string>Value</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="0">
<widget class="QLineEdit" name="lineEditValueA1">
<item row="0" column="3">
<widget class="QLineEdit" name="lineEditUnitV1">
<property name="font">
<font>
<family>Arial</family>
<pointsize>16</pointsize>
</font>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLineEdit" name="lineEditValueV1">
<item row="1" column="0">
<widget class="QLineEdit" name="lineEditValueA1">
<property name="font">
<font>
<family>Arial</family>
<pointsize>16</pointsize>
</font>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditUnitV1">
<item row="1" column="3">
<widget class="QLineEdit" name="lineEditUnitA1">
<property name="font">
<font>
<family>Arial</family>
<pointsize>16</pointsize>
</font>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditUnitA1">
<item row="0" column="0">
<widget class="QLineEdit" name="lineEditValueV1">
<property name="font">
<font>
<family>Arial</family>
<pointsize>16</pointsize>
</font>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QDoubleSpinBox" name="doubleSpinBoxPower1">
<property name="maximum">
<double>24.000000000000000</double>
</property>
<property name="singleStep">
<double>0.500000000000000</double>
</property>
<property name="value">
<double>12.000000000000000</double>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="SetPower1">
<property name="text">
<string>Set</string>
</property>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -184,8 +204,8 @@
<string>Value</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QLineEdit" name="lineEditValueV2">
<item row="0" column="3">
<widget class="QLineEdit" name="lineEditUnitV2">
<property name="font">
<font>
<family>Arial</family>
Expand All @@ -197,8 +217,8 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditUnitV2">
<item row="0" column="0">
<widget class="QLineEdit" name="lineEditValueV2">
<property name="font">
<font>
<family>Arial</family>
Expand All @@ -220,7 +240,7 @@
</property>
</widget>
</item>
<item row="1" column="1">
<item row="1" column="3">
<widget class="QLineEdit" name="lineEditUnitA2">
<property name="font">
<font>
Expand All @@ -230,6 +250,26 @@
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QDoubleSpinBox" name="doubleSpinBoxPower2">
<property name="maximum">
<double>24.000000000000000</double>
</property>
<property name="singleStep">
<double>0.500000000000000</double>
</property>
<property name="value">
<double>12.000000000000000</double>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="pushButtonSetPower2">
<property name="text">
<string>Set</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
#ifndef VERSION_H
#define VERSION_H

#define DLT_POWER_VERSION "v0.1.2"
#define DLT_POWER_VERSION "v0.1.3"

#endif // VERSION_H

0 comments on commit 99e0f2e

Please sign in to comment.