select_tasks_state.cpp
Go to the documentation of this file.
1 //
2 // Created by yijiangh on 6/28/17.
3 //
4 //#include "choreo_gui/states/scanning_state.h"
5 
6 #include <ros/console.h>
11 //#include <QtConcurrent/QtConcurrentRun>
12 
14 {
15  ptr_gui_ = &gui;
16 
17  gui.setText("Select Path State.\n"
18  "Select the desired path to be planned in selection window and click <select for plan>.\n"
19  "Close the selection widget to continue.");
20  gui.setButtonsEnabled(false);
21 
22  std::string full_file_name = gui.params().taskSequenceInputParams().file_path;
23  std::replace(full_file_name.begin(), full_file_name.end(), '/', '_');
24  gui.selection_widget().setModelFileName(full_file_name);
25 
26  connect(&gui.selection_widget(), SIGNAL(closeWidgetAndContinue()), this, SLOT(toNextState()));
27 // connect(&gui.selection_widget(), SIGNAL(exitSelectionWidget()), this, SLOT(toBackState()));
28 
29  selectTask(gui);
30 }
31 
33 
35 {
36  gui.setButtonsEnabled(false);
37 
38  // fetch ids (slider or input lineedit value from user) for planning from selection_widget
39  int selected_id_for_planning = gui.selection_widget().getSelectedValueForPlanning();
40 
41  // fetch use_record decision (push_button choice from user) from selection_widget
42  bool use_ladder_graph_record = gui.selection_widget().getUseSavedResult();
43 
44  // proceed to Process Planning State
45  // params: selected_id_for_planning, (bool) use_record
46  Q_EMIT newStateAvailable(new ProcessPlanningState(selected_id_for_planning, use_ladder_graph_record));
47 }
48 
50 {
53 }
54 
56 {
58  Q_EMIT newStateAvailable(new SystemInitState());
59 }
60 
62 {
64 
65  // invoke the selection widget add waiting for a click on <close_widget>
66  // and <Next> to move on to next state
67  gui.selection_widget().show();
69 }
70 
72 {
73  this->onNext(*ptr_gui_);
74 }
75 
77 {
78  this->onBack(*ptr_gui_);
79 }
void setMode(const MODE &_mode)
void setText(const std::string &txt)
virtual void onExit(ChoreoWidget &gui)
The ChoreoWidget class works in states:
Definition: choreo_widget.h:34
virtual void onStart(ChoreoWidget &gui)
virtual void onBack(ChoreoWidget &gui)
ParamsSubmenu & params()
Definition: choreo_widget.h:54
void setModelFileName(const std::string &m)
const choreo_msgs::TaskSequenceInputParameters & taskSequenceInputParams() const
SelectionWidget & selection_widget()
Definition: choreo_widget.h:55
void selectTask(ChoreoWidget &gui)
virtual void onNext(ChoreoWidget &gui)
void setButtonsEnabled(bool enabled)
int getSelectedValueForPlanning() const
virtual void onReset(ChoreoWidget &gui)
void newStateAvailable(GuiState *)


choreo_gui
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:58:56