26 #include <ArmarXGui/gui-plugins/StatechartViewerPlugin/ui_StatechartView.h>
31 #include "../IceStateConverter.h"
32 #include "../StateScene.h"
33 #include "../model/State.h"
34 #include "../model/stateinstance/StateInstance.h"
35 #include "../model/stateinstance/EndState.h"
40 #include <ArmarXCore/interface/statechart/RemoteStateOffererIce.h>
50 layoutThread(state, enableLayouting)
54 srand(IceUtil::Time::now().toMilliSeconds());
65 ui->graphicsView->setScene(stateScene);
78 connect(stateScene, SIGNAL(selectionChanged()),
this, SLOT(
onItemChange()));
93 return ui->graphicsView;
119 ui->graphicsView->setTransform(QTransform());
124 QList<QGraphicsItem*> selection = stateScene->selectedItems();
125 foreach (QGraphicsItem* item, selection)
151 ui->graphicsView->fitInView(stateScene->itemsBoundingRect(), Qt::KeepAspectRatio);
156 QList<QGraphicsItem*> selection = stateScene->selectedItems();
158 if (selection.size() > 0)
172 stateScene->update();
179 topState->setStateName(
"TopLevelState");
182 sub1->setStateName(
"sub1");
186 e1->name =
"Success";
187 eventList.append(e1);
189 e2->name =
"Failure";
190 eventList.append(e2);
193 eventList.append(e3);
194 sub1->setOutgoingEvents(eventList);
197 sub2->setStateName(
"sub2");
200 subsub1->setStateName(
"subsub1");
203 topState->addSubstate(sub1);
204 topState->addSubstate(sub2);
205 topState->addRemoteSubstate(sub1,
"ProxyName",
"remotesub1-2");
208 e21->name =
"Success";
209 eventList.append(e21);
211 e22->name =
"Failure";
212 eventList.append(e22);
213 subsub1->setOutgoingEvents(eventList2);
214 sub1->addSubstate(subsub1);
216 subsub1->addEndSubstate(
"EndState",
"Success");
219 t1->eventName =
"GoOn";
220 t1->sourceState = topState->getSubstates()[
"sub1"];
221 t1->destinationState = topState->getSubstates()[
"sub2"];
222 topState->addTransition(t1);
230 return QSize(200, 200);