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

View File

@ -75,7 +75,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="4,2,3"> <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="4,2,3">
<item> <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"> <property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum> <enum>QLayout::SetDefaultConstraint</enum>
</property> </property>
@ -110,21 +110,28 @@
<item> <item>
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="label_9">
<property name="text"> <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> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="label_10">
<property name="text"> <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> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<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> <item>
<widget class="QLabel" name="idLabel"> <widget class="QLabel" name="idLabel">
<property name="text"> <property name="text">
@ -166,7 +173,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="clutchLabel"> <widget class="QLabel" name="stateLabel">
<property name="text"> <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> <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>
@ -176,7 +183,17 @@
</widget> </widget>
</item> </item>
<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"> <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> <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>