Skip to content

Commit

Permalink
fix cursor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-demin committed Oct 31, 2016
1 parent b1002af commit 411c1f1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
16 changes: 12 additions & 4 deletions PyQtScope.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,27 @@ def read_data(self):
val = float(curs[8])
if abs(val) > 9.9E9:
self.curs1.setText('%ss' % (metric_prefix(float(curs[3]))))
self.curs2.setText('')
else:
self.curs1.setText('%ss\t%sV' % (metric_prefix(float(curs[3])), metric_prefix(float(curs[8]))))
self.curs1.setText('%ss' % (metric_prefix(float(curs[3]))))
self.curs2.setText('%sV' % (metric_prefix(float(curs[8]))))
val = float(curs[9])
if abs(val) > 9.9E9:
self.curs2.setText('%ss' % (metric_prefix(float(curs[4]))))
self.curs3.setText('%ss' % (metric_prefix(float(curs[4]))))
self.curs4.setText('')
else:
self.curs2.setText('%ss\t%sV' % (metric_prefix(float(curs[4])), metric_prefix(float(curs[9]))))
self.curs3.setText('%ss' % (metric_prefix(float(curs[4]))))
self.curs4.setText('%sV' % (metric_prefix(float(curs[9]))))
elif curs[0] == 'HBARS':
self.curs1.setText('%sV' % metric_prefix(float(curs[6])))
self.curs2.setText('%sV' % metric_prefix(float(curs[7])))
self.curs2.setText('')
self.curs3.setText('%sV' % metric_prefix(float(curs[7])))
self.curs4.setText('')
else:
self.curs1.setText('')
self.curs2.setText('')
self.curs3.setText('')
self.curs4.setText('')
progress.setValue(5)
except:
print('Error: %s' % sys.exc_info()[1])
Expand Down
24 changes: 19 additions & 5 deletions PyQtScope.ui
Original file line number Diff line number Diff line change
Expand Up @@ -160,28 +160,42 @@
<property name="title">
<string>CURSORS</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="curst">
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QLabel" name="curs3">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<item row="1" column="0">
<widget class="QLabel" name="curs1">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<item row="1" column="1">
<widget class="QLabel" name="curs2">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="curst">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="curs4">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down

0 comments on commit 411c1f1

Please sign in to comment.