Added restrictions images. Also small fix in Restrictions __init__()

This commit is contained in:
Olek Bojda 2018-09-27 11:42:55 +02:00
parent 62e7d10641
commit 067b13c862
10 changed files with 83 additions and 91 deletions

View File

@ -2,13 +2,12 @@
class Restrictions:
def __init__(self,distance,linear_velocity,angular_velocity):
self.distance = distance
self.linear_velocity = linear_velocity
self.angular_velocity = angular_velocity
def __init__(self,distance,angular_velocity,linear_velocity):
self.distance = distance
self.angular_velocity = angular_velocity
self.linear_velocity = linear_velocity
def update_restrictions(self,restrictions_msg):
self.distance = restrictions_msg.distance.data
self.linear_velocity = restrictions_msg.linear_velocity.data
self.angular_velocity = restrictions_msg.angular_velocity.data
def update_restrictions(self,restrictions_msg):
self.distance = restrictions_msg.distance.data
self.linear_velocity = restrictions_msg.linear_velocity.data
self.angular_velocity = restrictions_msg.angular_velocity.data

View File

@ -33,8 +33,12 @@ class QtWrapper:
# self.disable_sliders_tracking()
# self.ok_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_user_plugin/ui/Ok.jpg')
# self.cancel_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_user_plugin/ui/Cancel.jpg')
self.distance_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_master_plugin/ui/Distance.png')
self.angular_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_master_plugin/ui/Angular.png')
self.linear_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_master_plugin/ui/Linear.png')
self.widget.distanceImage.setPixmap(self.distance_pixmap)
self.widget.angularImage.setPixmap(self.angular_pixmap)
self.widget.linearImage.setPixmap(self.linear_pixmap)
def set_sliders_to_initial_values(self):
self.widget.distanceSlider.setMaximum(200)
@ -164,16 +168,6 @@ class QtWrapper:
item.setTextAlignment(Qt.AlignCenter)
item.setEditable(0)
self.stdItemModel.setItem(row_number,i,item)
# new_robot_info2=QStandardItem('PIONIER'+str(robot_id))
# new_robot_info3=QStandardItem('PIONIER'+str(robot_id))
# new_robot_info4=QStandardItem('PIONIER'+str(robot_id))
# new_robot_info5=QStandardItem('PIONIER'+str(robot_id))
# new_robot_info6=QStandardItem('PIONIER'+str(robot_id))
# items_list = [new_robot_info,new_robot_info2,new_robot_info3,new_robot_info4,new_robot_info5,new_robot_info6]
# self.stdItemModel.insertRow(self.stdItemModel.rowCount(),items_list)
# raise NotImplementedError
def master_stopped(self):
self.master_stop_state = SS.STOPPED

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

View File

@ -21,7 +21,14 @@ class QtWrapper:
self.displayed_robots_id_list = []
self.clear_robot_info()
# self.ok_pixmap = QPixmap('../ui/Ok.jpg')
self.distance_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_user_plugin/ui/Distance.png')
self.angular_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_user_plugin/ui/Angular.png')
self.linear_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_user_plugin/ui/Linear.png')
self.widget.distanceImage.setPixmap(self.distance_pixmap.scaled(66,46))
self.widget.angularImage.setPixmap(self.angular_pixmap)
self.widget.linearImage.setPixmap(self.linear_pixmap.scaled(20,48))
self.ok_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_user_plugin/ui/Ok.jpg')
self.cancel_pixmap = QPixmap('/home/olek/safetysystemL1.5/src/SafetySystem/safety_user_plugin/ui/Cancel.jpg')

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

View File

@ -188,8 +188,11 @@
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1">
<layout class="QGridLayout" name="gridLayout" columnstretch="4,0,0">
<property name="verticalSpacing">
<number>15</number>
</property>
<item row="1" column="2">
<widget class="QLabel" name="distanceRestrictionLabel">
<property name="minimumSize">
<size>
@ -205,42 +208,7 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QGraphicsView" name="distanceGraphics">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="linearRestrictionLabel">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<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 row="3" column="1">
<item row="2" column="2">
<widget class="QLabel" name="angularRestrictionLabel">
<property name="minimumSize">
<size>
@ -256,51 +224,75 @@
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<item row="3" column="2">
<widget class="QLabel" name="linearRestrictionLabel">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<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 row="0" column="1" colspan="2">
<widget class="QLabel" name="label_12">
<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;Ograniczenia&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QGraphicsView" name="angularGrpahics">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLabel" name="distanceImage">
<property name="text">
<string>TextLabel</string>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QGraphicsView" name="linearGraphics">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="2" column="1">
<widget class="QLabel" name="angularImage">
<property name="text">
<string>TextLabel</string>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="linearImage">
<property name="text">
<string>TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>50</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>