Commit cc4765b8 authored by roangel's avatar roangel
Browse files

added kind of fix for voltage update

parent dbc5e106
......@@ -296,11 +296,11 @@ void MainWindow::updateBatteryVoltage(float battery_voltage)
// Need to take voltage, display it and transform it to percentage
// int percentage = (int) fromVoltageToPercent(m_battery_voltage);
QString qstr = "Raw voltage: ";
QString qstr = "";
qstr.append(QString::number(battery_voltage, 'f', 2));
qstr.append(" V");
ROS_INFO_STREAM("battery voltage " << battery_voltage);
ui->raw_voltage->clear();
ui->raw_voltage->setText(qstr);
ui->voltage_field->setText(qstr);
}
void MainWindow::CFBatteryCallback(const std_msgs::Float32& msg)
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1056</width>
<height>670</height>
<width>1027</width>
<height>619</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -1137,6 +1137,12 @@
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>18</pointsize>
......@@ -1146,8 +1152,14 @@
<string>StudentID # connected to CF #</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="2">
<widget class="QLabel" name="raw_voltage">
<item row="1" column="0">
<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">
<font>
<pointsize>18</pointsize>
......@@ -1159,6 +1171,25 @@
</property>
</widget>
</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>
</widget>
</item>
......@@ -1239,7 +1270,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>1056</width>
<width>1027</width>
<height>25</height>
</rect>
</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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment