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"
26
27#include <iostream>
28
31
32namespace armarx
33{
34 void
36 {
37 usingProxy("RobotControl");
38 stateId = -1;
39 controlTask = new RunningTask<RobotControlUI>(this, &RobotControlUI::run, "RobotControlUI");
40 }
41
42 void
44 {
46 controlTask->start();
47 }
48
49 void
51 {
52 controlTask->stop();
53 }
54
55 void
57 {
58 std::string eventstring;
59 std::cout << "Please insert the event string: " << std::flush;
60 // cin >> eventstring;
61 eventstring = "EvLoadScenario";
62
63 if (eventstring == "q")
64 {
65 // shutdown();
66 }
67 else
68 {
69 std::cout << "Please insert the state id of the state that should process the event: "
70 << std::flush;
71 int id;
72 // cin >> id;
73 id = 11;
74 std::cout << "sending to id:" << id << std::endl;
75 EventPtr evt = new Event("EVENTTOALL", eventstring);
76 StateUtilFunctions::addToDictionary(evt, "proxyName", "RemoteStateOfferer");
77 StateUtilFunctions::addToDictionary(evt, "stateName", "MoveArm");
78 //robotProxy->issueEvent(id, evt);
79 }
80
81 // cin >> eventstring;
82 }
83} // namespace armarx
An Event is used to communicate between e.g.
Definition Event.h:51
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
void onInitComponent() override
Pure virtual hook for the subclass.
RobotControlInterfacePrx robotProxy
void onConnectComponent() override
Pure virtual hook for the subclass.
void onExitComponent() override
Hook for subclass.
bool addToDictionary(EventPtr event, const std::string key, const Variant &value)
Adds the (key,defaulfValue) pair to the event-dictionary.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< Event > EventPtr
Typedef of EventPtr as IceInternal::Handle<Event> for convenience.
Definition Event.h:40