stdr_robot_creator_loader.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  STDR Simulator - Simple Two DImensional Robot Simulator
3  Copyright (C) 2013 STDR Simulator
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 3 of the License, or
7  (at your option) any later version.
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software Foundation,
14  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 
16  Authors :
17  * Manos Tsardoulias, etsardou@gmail.com
18  * Aris Thallas, aris.thallas@gmail.com
19  * Chris Zalidis, zalidis@gmail.com
20 ******************************************************************************/
21 
23 
24 namespace stdr_gui
25 {
33  robotPropLoader(argc,argv),
34  robotFootLoader(argc,argv),
35  laserPropLoader(argc,argv),
36  sonarPropLoader(argc,argv),
37  kinematicPropLoader(argc,argv),
38  rfidAntennaPropLoader(argc,argv),
39  co2SensorPropLoader(argc,argv),
40  thermalSensorPropLoader(argc,argv),
41  soundSensorPropLoader(argc,argv),
42  argc_(argc),
43  argv_(argv)
44  {
45  setupUi(this);
46 
48  robotPreviewLabel->setScaledContents(true);
49 
50  robotPreviewImage = QImage(500,500,QImage::Format_RGB32);
51  robotPreviewImage.fill(QColor(220,220,220,1));
52  }
53 
59  {
60  addIcon.addFile(QString::fromUtf8((
62  std::string("/resources/images/add_icon.png")).c_str()),
63  QSize(16,16),
64  QIcon::Normal,
65  QIcon::Off);
66  editIcon.addFile(QString::fromUtf8((
68  std::string("/resources/images/edit_icon.png")).c_str()),
69  QSize(16,16),
70  QIcon::Normal,
71  QIcon::Off);
72  removeIcon.addFile(QString::fromUtf8((
74  std::string("/resources/images/remove_icon.png")).c_str()),
75  QSize(16,16),
76  QIcon::Normal,
77  QIcon::Off);
78  saveIcon.addFile(QString::fromUtf8((
80  std::string("/resources/images/save_icon.png")).c_str()),
81  QSize(16,16),
82  QIcon::Normal,
83  QIcon::Off);
84  loadIcon.addFile(QString::fromUtf8((
86  std::string("/resources/images/load_icon.png")).c_str()),
87  QSize(16,16),
88  QIcon::Normal,
89  QIcon::Off);
90 
91  robotTreeWidget->setColumnWidth(0,150);
92  robotTreeWidget->setColumnWidth(1,60);
93  robotTreeWidget->setColumnWidth(2,20);
94  robotTreeWidget->setColumnWidth(3,20);
95  robotTreeWidget->setColumnWidth(4,20);
96 
97  QStringList ColumnNames;
98  ColumnNames << "Robot parts" << "Info" << "" << "" << "";
99 
100  robotTreeWidget->setHeaderLabels(ColumnNames);
101 
102  robotNode.setText(0,"Robot");
103  lasersNode.setText(0,"Lasers");
104  sonarsNode.setText(0,"Sonars");
105  rfidAntennasNode.setText(0,"Rfid readers");
106  co2SensorsNode.setText(0,"CO2 sensors");
107  thermalSensorsNode.setText(0,"Thermal sensors");
108  soundSensorsNode.setText(0,"Sound sensors");
109  kinematicNode.setText(0,"Kinematic model");
110 
111  robotNode.setIcon(2,editIcon);
112  robotNode.setIcon(3,saveIcon);
113  robotNode.setIcon(4,loadIcon);
114  lasersNode.setIcon(2,addIcon);
115  sonarsNode.setIcon(2,addIcon);
116  rfidAntennasNode.setIcon(2,addIcon);
117  co2SensorsNode.setIcon(2,addIcon);
118  thermalSensorsNode.setIcon(2,addIcon);
119  soundSensorsNode.setIcon(2,addIcon);
120  kinematicNode.setIcon(2,loadIcon);
121 
122  robotTreeWidget->addTopLevelItem(&robotNode);
123  robotTreeWidget->addTopLevelItem(&lasersNode);
124  robotTreeWidget->addTopLevelItem(&sonarsNode);
125  robotTreeWidget->addTopLevelItem(&rfidAntennasNode);
126  robotTreeWidget->addTopLevelItem(&co2SensorsNode);
127  robotTreeWidget->addTopLevelItem(&thermalSensorsNode);
128  robotTreeWidget->addTopLevelItem(&soundSensorsNode);
129  robotTreeWidget->addTopLevelItem(&kinematicNode);
130 
131  robotInfoOrientation.setText(0,"Orientation");
132  robotInfoOrientation.setText(1,"0");
133 
134  robotInfoFootprint.setText(0,"Footprint");
135  robotInfoFootprint.setIcon(2,addIcon);
136 
137  robotNode.addChild(&robotInfoRadius);
138  robotNode.addChild(&robotInfoOrientation);
139  robotNode.addChild(&robotInfoFootprint);
140 
141  robotNode.setExpanded(true);
142  lasersNode.setExpanded(true);
143  sonarsNode.setExpanded(true);
144  rfidAntennasNode.setExpanded(true);
145  co2SensorsNode.setExpanded(true);
146  thermalSensorsNode.setExpanded(true);
147  soundSensorsNode.setExpanded(true);
148 
149  robotTreeWidget->resizeColumnToContents(0);
150  robotTreeWidget->resizeColumnToContents(1);
151  robotTreeWidget->resizeColumnToContents(2);
152  robotTreeWidget->resizeColumnToContents(3);
153  robotTreeWidget->resizeColumnToContents(4);
154  }
155 }
CRobotCreatorLoader(int argc, char **argv)
Default contructor.
QTreeWidgetItem robotInfoFootprint
Holds the tree items that contain the footprint points.
std::string getRosPackagePath(std::string package)
Returns the global path of the ROS package provided.
Definition: stdr_tools.cpp:31
QTreeWidgetItem sonarsNode
Tree item for the rfid antennas root.
QTreeWidgetItem robotInfoOrientation
Tree item for the robot radius.
QTreeWidgetItem kinematicNode
Tree item for the robot orientation.
QTreeWidgetItem robotNode
Tree item for the lasers root.
QTreeWidgetItem soundSensorsNode
Tree item for the kinematic.
QTreeWidgetItem robotInfoRadius
Tree item for the robot footprint.
QTreeWidgetItem lasersNode
Tree item for the sonars root.
The main namespace for STDR GUI.
QIcon loadIcon
Object of robot properties widget.
void setupInitialTree(void)
Sets up the information tree in robot creator widget.


stdr_gui
Author(s): Manos Tsardoulias
autogenerated on Mon Jun 10 2019 15:15:17