8 #include <QtConcurrent/QtConcurrentRun> 15 setObjectName(
"PostProcessorWidget_");
17 QLabel* program_name_label =
new QLabel(
"Program name:");
19 QHBoxLayout* program_name_layout =
new QHBoxLayout;
20 program_name_layout->addWidget(program_name_label);
23 QLabel* comment_label =
new QLabel(
"Comment (optional):");
25 QHBoxLayout* comment_layout_ =
new QHBoxLayout();
26 comment_layout_->addWidget(comment_label);
27 comment_layout_->addWidget(
comment_);
29 QLabel* machining_speed_label =
new QLabel(
"Machining speed (cm/min): ");
32 QHBoxLayout* machining_speed_layout_ =
new QHBoxLayout();
33 machining_speed_layout_->addWidget(machining_speed_label);
36 QLabel* extrication_speed_label =
new QLabel(
"Extrication speed (cm/min): ");
39 QHBoxLayout* extrication_speed_layout_ =
new QHBoxLayout();
40 extrication_speed_layout_->addWidget(extrication_speed_label);
43 QLabel* trajectory_z_offset_label =
new QLabel(
"Z offset for trajectory: ");
47 QHBoxLayout* trajectory_z_offset_layout =
new QHBoxLayout();
48 trajectory_z_offset_layout->addWidget(trajectory_z_offset_label);
51 QLabel* upload_label =
new QLabel(
"Upload program:");
53 QHBoxLayout* upload_layout_ =
new QHBoxLayout();
54 upload_layout_->addWidget(upload_label);
55 upload_layout_->addStretch(1);
57 upload_layout_->addStretch(9);
63 QHBoxLayout* ip_adress_layout =
new QHBoxLayout;
67 QLabel* program_location_label =
new QLabel(
"Program location:");
70 QHBoxLayout* program_location_layout =
new QHBoxLayout;
71 program_location_layout->addWidget(program_location_label);
77 QVBoxLayout* post_processor_layout =
new QVBoxLayout(
this);
78 post_processor_layout->addLayout(program_name_layout);
79 post_processor_layout->addLayout(comment_layout_);
80 post_processor_layout->addLayout(machining_speed_layout_);
81 post_processor_layout->addLayout(extrication_speed_layout_);
82 post_processor_layout->addLayout(trajectory_z_offset_layout);
83 post_processor_layout->addLayout(upload_layout_);
84 post_processor_layout->addLayout(ip_adress_layout);
85 post_processor_layout->addLayout(program_location_layout);
86 post_processor_layout->addStretch(2);
88 post_processor_layout->addStretch(8);
166 program_name = program_name.remove(
".ls", Qt::CaseInsensitive);
167 program_name = program_name.remove(
".l", Qt::CaseInsensitive);
168 program_name = program_name.remove(
".", Qt::CaseInsensitive);
187 for(std::vector<geometry_msgs::Pose>::const_iterator iter (robot_poses.begin());
188 iter != robot_poses.end();
198 for (std::vector<bool>::const_iterator iter(is_grinding_pose.begin()); iter != is_grinding_pose.end(); ++iter)
212 "The program name cannot be empty",
"");
267 ROS_INFO_STREAM(objectName().toStdString() +
" service connections have been made");
291 if (config.
mapGetString(objectName() +
"program_name", &tmp))
293 if (config.
mapGetString(objectName() +
"comment", &tmp))
296 if (config.
mapGetFloat(objectName() +
"machining_speed", &int_tmp))
301 if (config.
mapGetFloat(objectName() +
"extrication_speed", &int_tmp))
306 if (config.
mapGetFloat(objectName() +
"trajectory_z_offset", &int_tmp))
312 if (config.
mapGetBool(objectName() +
"upload_program", &state_tmp))
316 if (config.
mapGetString(objectName() +
"ip_adress", &tmp))
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
void updateInternalValues()
QSpinBox * extrication_speed_
QSpinBox * trajectory_z_offset_
PostProcessorWidget(QWidget *parent=NULL)
bool call(MReq &req, MRes &res)
bool mapGetFloat(const QString &key, float *value_out) const
void save(rviz::Config config)
void sendStatus(const QString status)
void getRobotTrajectoryData()
void load(const rviz::Config &config)
bool mapGetString(const QString &key, QString *value_out) const
void mapSetValue(const QString &key, QVariant value)
QPushButton * generate_program_button_
QLineEdit * program_location_
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
QSpinBox * machining_speed_
void setRobotPoses(const std::vector< geometry_msgs::Pose > &robot_poses)
void sendMsgBox(const QString title, const QString msg, const QString info_msg)
bool mapGetBool(const QString &key, bool *value_out) const
fanuc_grinding_post_processor::PostProcessorService srv_post_processor_
#define ROS_WARN_STREAM(args)
void enablePanel(const bool)
ROSLIB_DECL std::string getPath(const std::string &package_name)
QLineEdit * program_name_
#define ROS_INFO_STREAM(args)
void setIpAddressEnable(const int state)
void generateProgramButtonHandler()
void setIsGrindingPose(const std::vector< bool > &is_grinding_pose)
void setProgramLocation(const std::string &location)
QLabel * ip_adress_label_
void setPostProcessorParams(const fanuc_grinding_post_processor::PostProcessorService::Request ¶ms)
QCheckBox * upload_program_
ros::ServiceClient post_processor_service_