Skip to content
Snippets Groups Projects
Commit cc4765b8 authored by Angel's avatar Angel
Browse files

added kind of fix for voltage update

parent dbc5e106
No related branches found
No related tags found
No related merge requests found
...@@ -296,11 +296,11 @@ void MainWindow::updateBatteryVoltage(float battery_voltage) ...@@ -296,11 +296,11 @@ void MainWindow::updateBatteryVoltage(float battery_voltage)
// Need to take voltage, display it and transform it to percentage // Need to take voltage, display it and transform it to percentage
// int percentage = (int) fromVoltageToPercent(m_battery_voltage); // int percentage = (int) fromVoltageToPercent(m_battery_voltage);
QString qstr = "Raw voltage: "; QString qstr = "";
qstr.append(QString::number(battery_voltage, 'f', 2)); qstr.append(QString::number(battery_voltage, 'f', 2));
qstr.append(" V");
ROS_INFO_STREAM("battery voltage " << battery_voltage); ROS_INFO_STREAM("battery voltage " << battery_voltage);
ui->raw_voltage->clear(); ui->voltage_field->setText(qstr);
ui->raw_voltage->setText(qstr);
} }
void MainWindow::CFBatteryCallback(const std_msgs::Float32& msg) void MainWindow::CFBatteryCallback(const std_msgs::Float32& msg)
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1056</width> <width>1027</width>
<height>670</height> <height>619</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
...@@ -1137,6 +1137,12 @@ ...@@ -1137,6 +1137,12 @@
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>18</pointsize> <pointsize>18</pointsize>
...@@ -1146,8 +1152,14 @@ ...@@ -1146,8 +1152,14 @@
<string>StudentID # connected to CF #</string> <string>StudentID # connected to CF #</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="2"> <item row="1" column="0">
<widget class="QLabel" name="raw_voltage"> <widget class="QLabel" name="raw_voltage_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>18</pointsize> <pointsize>18</pointsize>
...@@ -1159,6 +1171,25 @@ ...@@ -1159,6 +1171,25 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1">
<widget class="QLineEdit" name="voltage_field">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
...@@ -1239,7 +1270,7 @@ ...@@ -1239,7 +1270,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1056</width> <width>1027</width>
<height>25</height> <height>25</height>
</rect> </rect>
</property> </property>
......
5,PPS_CF05,0/32/2M/E7E7E7E705,0,-1.10209,-0.137356,-0.2,0.453276,1.22247,2 5,PPS_CF05,0/32/2M/E7E7E7E705,0,-0.868587,-0.673046,-0.2,0.686782,0.686782,2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment