Removed clutch state indicator. Added master_stop and obstacle_stop indicators

This commit is contained in:
Olek Bojda 2018-10-01 12:29:24 +02:00
parent caa4b1a8fc
commit 34fd379f26
2 changed files with 34 additions and 9 deletions

View File

@ -78,12 +78,12 @@ class QtWrapper:
return None
def display_clutch_on(self):
self.widget.clutchLabel.setPixmap(self.ok_pixmap.scaled(40,40))
# self.widget.clutchLabel.setPixmap(self.ok_pixmap.scaled(40,40))
self.widget.clutchButton.setStyleSheet("QPushButton { color: black; background-color: green; font: bold 20px}")
self.widget.clutchButton.setText('Rozlacz sprzeglo')
def display_clutch_off(self):
self.widget.clutchLabel.setPixmap(self.cancel_pixmap.scaled(40,40))
# self.widget.clutchLabel.setPixmap(self.cancel_pixmap.scaled(40,40))
self.widget.clutchButton.setStyleSheet("QPushButton { color: black; background-color: red; font: bold 20px}")
self.widget.clutchButton.setText('Polacz sprzeglo')
@ -196,10 +196,17 @@ class QtWrapper:
else:
self.display_state_off()
if robot_info.obstacle_detected == True:
self.widget.obstaclestopLabel.setPixmap(self.cancel_pixmap.scaled(40,40))
else:
self.widget.obstaclestopLabel.setPixmap(self.ok_pixmap.scaled(40,40))
def master_stopped(self):
self.widget.masterstopLabel.setPixmap(self.cancel_pixmap.scaled(40,40))
self.log_info('Przycisk masterSTOP zostal nacisniety. Zatrzymuje roboty')
def master_started(self):
self.widget.masterstopLabel.setPixmap(self.ok_pixmap.scaled(40,40))
self.log_info('Przycisk masterSTOP odcisniety. Mozesz uruchomic robota')
def user_stopped(self):
@ -288,7 +295,8 @@ class QtWrapper:
self.widget.linearLabel.setText('-')
self.widget.angularLabel.setText('-')
self.widget.stateLabel.setText('-')
self.widget.clutchLabel.setText('-')
self.widget.masterstopLabel.setText('-')
self.widget.obstaclestopLabel.setText('-')
self.widget.choiceButton.setText('Wybierz')

View File

@ -75,7 +75,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="4,2,3">
<item>
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,1,1,1,2,2">
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,1,1,1,2,2,2">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
@ -110,21 +110,28 @@
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Stan sprzegla&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Stan robota&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Stan stopu&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Stop mastera&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Stop przeszkody&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,1,1,1,2,2">
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,1,1,1,2,2,0">
<item>
<widget class="QLabel" name="idLabel">
<property name="text">
@ -166,7 +173,7 @@
</widget>
</item>
<item>
<widget class="QLabel" name="clutchLabel">
<widget class="QLabel" name="stateLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;-&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -176,7 +183,17 @@
</widget>
</item>
<item>
<widget class="QLabel" name="stateLabel">
<widget class="QLabel" name="masterstopLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;-&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="obstaclestopLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;-&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>