RobotControlUI.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package ArmarX::Applications
19  * @author Jan Issac (jan dot issac at gmx dot net)
20  * @date 2011
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #include "RobotControlUI.h"
27 
28 #include <iostream>
30 
31 namespace armarx
32 {
34  {
35  usingProxy("RobotControl");
36  stateId = -1;
37  controlTask = new RunningTask<RobotControlUI>(this, &RobotControlUI::run, "RobotControlUI");
38  }
39 
41  {
42  robotProxy = getProxy<RobotControlInterfacePrx>("RobotControl");
43  controlTask->start();
44  }
45 
47  {
48  controlTask->stop();
49  }
50 
52  {
53  std::string eventstring;
54  std::cout << "Please insert the event string: " << std::flush;
55  // cin >> eventstring;
56  eventstring = "EvLoadScenario";
57 
58  if (eventstring == "q")
59  {
60  // shutdown();
61  }
62  else
63  {
64  std::cout << "Please insert the state id of the state that should process the event: " << std::flush;
65  int id;
66  // cin >> id;
67  id = 11;
68  std::cout << "sending to id:" << id << std::endl;
69  EventPtr evt = new Event("EVENTTOALL", eventstring);
70  StateUtilFunctions::addToDictionary(evt, "proxyName", "RemoteStateOfferer");
71  StateUtilFunctions::addToDictionary(evt, "stateName", "MoveArm");
72  //robotProxy->issueEvent(id, evt);
73  }
74 
75  // cin >> eventstring;
76  }
77 }
armarx::RobotControlUI::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: RobotControlUI.cpp:46
armarx::RunningTask
Definition: ArmarXMultipleObjectsScheduler.h:35
IceInternal::Handle< Event >
armarx::RobotControlUI::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: RobotControlUI.cpp:33
ObserverObjectFactories.h
armarx::Event
An Event is used to communicate between e.g. condition handlers and statecharts.
Definition: Event.h:52
armarx::flush
const LogSender::manipulator flush
Definition: LogSender.h:251
armarx::RobotControlUI::run
void run()
Definition: RobotControlUI.cpp:51
armarx::StateUtilFunctions::addToDictionary
bool addToDictionary(EventPtr event, const std::string key, const Variant &value)
Adds the (key,defaulfValue) pair to the event-dictionary.
Definition: StateUtilFunctions.cpp:83
armarx::RobotControlUI::stateId
int stateId
Definition: RobotControlUI.h:40
armarx::RobotControlUI::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: RobotControlUI.cpp:40
armarx::RobotControlUI::robotProxy
RobotControlInterfacePrx robotProxy
Definition: RobotControlUI.h:41
RobotControlUI.h
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition: ManagedIceObject.cpp:151
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
Application.h