State.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package ArmarX::
17 * @author Mirko Waechter ( mirko.waechter at kit dot edu)
18 * @date 2014
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
24 #include "State.h"
29 
30 #include <IceUtil/UUID.h>
31 
32 #include <cmath>
33 
35 {
36  State::State(const QString& uuid) :
37  QObject(),
38  margin(30, 140, 30, 30),
39  size(StateInstance::StateDefaultSize),
40  dirty(false),
41  editable(true),
42  active(false)
43  {
44  UUID = uuid.isEmpty() ? QString::fromStdString(IceUtil::generateUUID()) : uuid;
45  transitions.append(TransitionPtr(new Transition()));
46  connect(this, SIGNAL(stateChanged(statechartmodel::SignalType)), this, SLOT(setDirty(statechartmodel::SignalType)));
49  }
51  {
52  emit stateDeleted();
53  }
54 
55  void State::addReferences(const QMap<QString, StatePtr>& uuidStateMap)
56  {
58 
59  for (StateInstanceMap::const_iterator i = substates.begin(); i != substates.end(); ++i)
60  {
61  std::shared_ptr<RegularState> regularState = std::dynamic_pointer_cast<RegularState>(*i); // ugly
62 
63  if (regularState && !regularState->getStateClass())
64  {
65  const QString& substateUUID = regularState->getClassUUID();
66 
67  if (uuidStateMap.contains(substateUUID))
68  {
69  regularState->setStateClass(uuidStateMap[substateUUID]);
70  }
71  }
72  }
73 
75  // TODO: Now we can add all detached transitions to state instances
76  }
77 
79  {
81 
82  for (auto p : localParameters.toStdMap())
83  {
84  result.insert(p.first, p.second);
85  }
86 
87  return result;
88  }
89 
90  CTransitionList State::getTransitions(bool withStartTransition) const
91  {
92  CTransitionList result;
93  foreach (TransitionPtr t, transitions)
94  {
95  if (withStartTransition || t->sourceState)
96  {
97  result.append(t);
98  }
99  }
100  return result;
101  }
102 
103  void State::setStateName(const QString& newName)
104  {
105  if (stateName == newName)
106  {
107  emit stateChanged(eUnchanged);
108  }
109  else
110  {
111  stateName = newName;
112  emit stateChanged(eChanged);
113  }
114  }
115 
117  {
119  return t ? t->destinationState : StateInstancePtr();
120  }
121 
123  {
125  return t ? t->mappingToNextStatesInput : ParameterMappingList();
126  }
127 
129  {
130  auto events = getOutgoingEvents();
131  for (const StateInstancePtr& substate : getSubstates())
132  {
133  if (substate->getType() == eFinalState)
134  {
135  bool found = false;
136  for (EventPtr& event : events)
137  {
138  if (event->name == substate->getInstanceName())
139  {
140  found = true;
141  break;
142  }
143  }
144  if (!found)
145  {
146  EventPtr evt(new Event());
147  evt->name = substate->getInstanceName();
148  events.push_back(evt);
149  }
150  }
151  }
152  return events;
153  }
154 
156  {
157  foreach (TransitionPtr t, transitions)
158  {
159  if (!t->sourceState)
160  {
161  return t;
162  }
163  }
164 
165  return TransitionPtr();
166  }
167 
169  {
170  foreach (TransitionPtr t, transitions)
171  {
172  if (!t->sourceState)
173  {
174  return t;
175  }
176  }
177 
178  return TransitionPtr();
179  }
180 
181 
182 
184  {
185  foreach (StateInstancePtr instance, substates)
186  {
187  if (instance->getStateClass())
188  {
189  connect(instance->getStateClass().get(), SIGNAL(outgoingTransitionChanged(QString, statechartmodel::StatePtr, statechartmodel::SignalType)), this, SLOT(updateTransition(QString, statechartmodel::StatePtr, statechartmodel::SignalType)), Qt::UniqueConnection);
190  }
191  }
192 
193  }
194 
195  bool State::isEditable() const
196  {
197  return editable;
198  }
199 
200  void State::setDescription(const QString& newDescription)
201  {
202  if (description == newDescription)
203  {
204  emit stateChanged(eUnchanged);
205  }
206  else
207  {
208  description = newDescription;
209  emit stateChanged(eChanged);
210  }
211  }
212 
213  void State::setSize(const QSizeF& newSize)
214  {
215 
216  // ARMARX_INFO_S << "new size of " << stateName << ": " << newSize.width() << ", " << newSize.height() ;
217  if (size == newSize)
218  {
219  emit stateChanged(eUnchanged);
220  }
221  else
222  {
223  size = newSize;
224  emit stateChanged(eChanged);
225  emit resized();
226  }
227 
228  }
229 
230  void State::setSubstateAreaSize(const QSizeF& newSize)
231  {
232  QSizeF adjustedNewSize(newSize.width() + margin.left() + margin.width(),
233  newSize.height() + margin.top() + margin.height());
234  setSize(adjustedNewSize);
235  }
236 
237  void State::setEditable(bool editable)
238  {
239  this->editable = editable;
240  }
241 
242  StateInstancePtr State::addSubstate(StatePtr newSubstate, QString instanceName, const QPointF& pos)
243  {
244  ARMARX_CHECK_EXPRESSION(newSubstate);
245 
246  if (!checkSubstate(newSubstate))
247  {
248  return StateInstancePtr();
249  }
250 
251  if (instanceName.length() == 0)
252  {
253  instanceName = newSubstate->getStateName();
254  }
255 
256  if (substates.find(instanceName) != substates.end())
257  {
258  return StateInstancePtr();
259  }
260 
261  StateInstancePtr instance(new LocalState(newSubstate, instanceName, shared_from_this()));
262 
263  instance = addSubstate(instance);
264 
265  if (instance)
266  {
267  if (pos.x() != 0 && pos.y() != 0)
268  {
269  instance->setPosition(pos);
270  }
271 
272  connect(newSubstate.get(), SIGNAL(outgoingTransitionChanged(QString, statechartmodel::StatePtr, statechartmodel::SignalType)), this, SLOT(updateTransition(QString, statechartmodel::StatePtr, statechartmodel::SignalType)), Qt::UniqueConnection);
273  addDetachedTransitions(instance);
274  }
275 
276  return instance;
277  }
278 
279  StateInstancePtr State::addRemoteSubstate(StatePtr newRemoteSubstate, const QString& remoteStateOffererName, QString instanceName, const QPointF& pos)
280  {
281  ARMARX_CHECK_EXPRESSION(newRemoteSubstate);
282 
283  if (!checkSubstate(newRemoteSubstate))
284  {
285  return StateInstancePtr();
286  }
287 
288  if (instanceName.length() == 0)
289  {
290  instanceName = newRemoteSubstate->getStateName();
291  }
292 
293  StateInstancePtr instance(new RemoteState(newRemoteSubstate, instanceName, remoteStateOffererName, shared_from_this()));
294 
295 
296 
297  instance = addSubstate(instance);
298 
299  if (instance)
300  {
301  if (pos.x() != 0 && pos.y() != 0)
302  {
303  instance->setPosition(pos);
304  }
305 
306  connect(newRemoteSubstate.get(), SIGNAL(outgoingTransitionChanged(QString, statechartmodel::StatePtr, statechartmodel::SignalType)), this, SLOT(updateTransition(QString, statechartmodel::StatePtr, statechartmodel::SignalType)), Qt::UniqueConnection);
307  addDetachedTransitions(instance);
308  }
309 
310  return instance;
311  }
312 
313  StateInstancePtr State::addDynamicRemoteSubstate(StatePtr state, QString instanceName, const QPointF& pos)
314 
315  {
316 
317  if (!checkSubstate(state))
318  {
319  return StateInstancePtr();
320  }
321 
322  if (instanceName.length() == 0)
323  {
324  instanceName = state->getStateName();
325  }
326 
327  if (substates.find(instanceName) != substates.end())
328  {
329  return StateInstancePtr();
330  }
331 
332  StateInstancePtr newstateInstance(new DynamicRemoteState(state, instanceName, shared_from_this()));
333 
334  newstateInstance = addSubstate(newstateInstance);
335 
336  if (newstateInstance)
337  {
338 
339  if (pos.x() != 0 && pos.y() != 0)
340  {
341  newstateInstance->setPosition(pos);
342  }
343 
344  connect(newstateInstance->getStateClass().get(), SIGNAL(outgoingTransitionChanged(QString, StatePtr, SignalType)), this, SLOT(updateTransition(QString, StatePtr, SignalType)), Qt::UniqueConnection);
345 
346  addDetachedTransitions(newstateInstance);
347  }
348 
349  return newstateInstance;
350 
351  }
352 
353  StateInstancePtr State::addEndSubstate(const QString& endstateName, const QString& eventName, const QPointF& pos)
354  {
355  StateInstancePtr instance(new EndState(endstateName, eventName, shared_from_this()));
356  instance = addSubstate(instance);
357 
358  if (instance)
359  {
360  if (pos.x() != 0 && pos.y() != 0)
361  {
362  instance->setPosition(pos);
363  }
364 
365  emit outgoingTransitionChanged(eventName, shared_from_this(), eAdded);
366  }
367 
368  return instance;
369  }
370 
372  {
373  if (substates.find(stateInstance->getInstanceName()) != substates.end())
374  {
375  return StateInstancePtr();
376  }
377  if (stateInstance->getStateClass() && !checkSubstate(stateInstance->getStateClass()))
378  {
379  return StateInstancePtr();
380  }
381 
382  substates.insert(stateInstance->getInstanceName(), stateInstance);
383 
384 
385 
386  emit substateChanged(stateInstance, eAdded);
387 
388  if (substates.size() == 1) //needs to go after statechanged-> otherwise crash
389  {
390  setStartState(stateInstance);
391  }
392 
393  return stateInstance;
394  }
395 
396 
398  {
400 
401  if (!t)
402  {
403  ARMARX_WARNING << "No start transition found!";
404  return;
405  }
406 
407  if (t->destinationState == newStartState)
408  {
410  }
411  else
412  {
413  t->destinationState = newStartState;
414  t->supportPoints.controlPoints.clear();
415  t->supportPoints.endPoint.reset();
416  t->supportPoints.startPoint.reset();
418  }
419  }
420 
421  void State::setStartStateInputMapping(const ParameterMappingList& newStartStateInputMapping)
422  {
424 
425  if (!t)
426  {
427  ARMARX_WARNING << "No start transition found!";
428  return;
429  }
430 
431  if (t->mappingToNextStatesInput == newStartStateInputMapping)
432  {
433  emit stateChanged(eUnchanged);
434  }
435  else
436  {
437  t->mappingToNextStatesInput = newStartStateInputMapping;
438  emit stateChanged(eChanged);
439  }
440  }
441 
442  bool State::renameSubstate(QString oldName, QString newName)
443  {
444  if (substates.find(newName) != substates.end())
445  {
446  return false;
447  }
448 
449  StateInstanceMap::iterator it = substates.find(oldName);
450 
451  if (it != substates.end())
452  {
453  EndStatePtr endState = std::dynamic_pointer_cast<EndState>(it.value());
454 
455  if (endState)
456  {
457  emit outgoingTransitionChanged(endState->getEventName(), shared_from_this(), eRemoved);
458  }
459 
460  it.value()->setInstanceName(newName);
461  StateInstanceMap::iterator newIt = substates.insert(newName, it.value());
462  substates.remove(oldName);
463 
464  if (endState)
465  {
466  emit outgoingTransitionChanged(endState->getEventName(), shared_from_this(), eAdded);
467  }
468 
469  emit substateChanged(newIt.value(), eChanged);
470  }
471 
472  return true;
473  }
474 
476  {
477  if (!substate)
478  {
479  return false;
480  }
481 
482  return removeSubstate(substate->getInstanceName());
483  }
484 
485  bool containsOutgoingEvent(const QString& eventName, const EventList& events)
486  {
487  for (const EventPtr& evt : events)
488  {
489  if (evt->name == eventName)
490  {
491  return true;
492  }
493  }
494  return false;
495  }
496 
497  bool State::removeSubstate(QString stateInstanceName)
498  {
499  StateInstanceMap::iterator it = substates.find(stateInstanceName);
500 
501  if (it != substates.end())
502  {
503  foreach (TransitionPtr t, transitions)
504  {
505  if (t->sourceState
506  && t->sourceState == it.value() // reflexive edges should not be detached but removed
507  && t->destinationState == it.value()
508  )
509  {
510  removeTransition(t);
511  }
512  else if (t->destinationState == it.value() && t->sourceState)
513  {
514  detachTransitionDestination(t, calcDetachedTransitionLastControlPoint(t->sourceState));
515  }
516  else if (t->destinationState == it.value())
517  {
519  }
520  else if (t->sourceState == it.value())
521  {
522  removeTransition(t);
523  }
524 
525  }
526  EndStatePtr endState = std::dynamic_pointer_cast<EndState>(it.value());
527 
528  if (endState)
529  {
530  emit outgoingTransitionChanged(endState->getEventName(), shared_from_this(), eRemoved);
531  }
532 
533  substates.erase(it);
534  emit substateChanged(it.value(), eRemoved);
535  return true;
536  }
537  else
538  {
539  return false;
540  }
541 
542  }
543 
544  StateInstancePtr State::replaceSubstate(QString stateInstanceName, StateInstancePtr newInstance)
545  {
546  StateInstanceMap::iterator it = substates.find(stateInstanceName);
547 
548  if (it != substates.end())
549  {
550  // TODO: This should also try to keep all transitions
551  if (newInstance->getStateClass() && !checkSubstate(newInstance->getStateClass()))
552  {
553  return StateInstancePtr();
554  }
555  removeSubstate(stateInstanceName);
556  newInstance->setPosition(it.value()->getTopLeft());
557  return addSubstate(newInstance);
558  }
559 
560  return StateInstancePtr();
561  }
562 
564  {
565  while (!substates.empty())
566  {
567  removeSubstate(substates.begin().key());
568  }
569 
570  substates = newSubstateList;
571 
572  foreach (StateInstancePtr instance, substates)
573  {
574  if (instance->getStateClass())
575  {
576  connect(instance->getStateClass().get(), SIGNAL(outgoingTransitionChanged(QString, statechartmodel::StatePtr, statechartmodel::SignalType)), this, SLOT(updateTransition(QString, statechartmodel::StatePtr, statechartmodel::SignalType)), Qt::UniqueConnection);
577  }
578 
579  emit substateChanged(instance, eAdded);
580  addDetachedTransitions(instance);
581  }
582  }
583 
585  {
586  if (activeSubstate == newActiveState)
587  {
588  emit stateChanged(eUnchanged);
589  }
590  else
591  {
592  // ARMARX_INFO << "Setting new substate of state " << getStateName();
593  auto tempState = activeSubstate;
594  activeSubstate = newActiveState;
595  if (tempState)
596  {
597  emit substateChanged(tempState, eChanged);
598  }
599  emit stateChanged(eChanged);
600  if (newActiveState)
601  {
602  emit substateChanged(newActiveState, eChanged);
603  }
604  }
605  }
606 
608  {
609  if (activeSubstate && activeSubstate->getStateClass())
610  {
611  activeSubstate->getStateClass()->clearActiveSubstates();
612  }
613  auto tempState = activeSubstate;
614  activeSubstate.reset();
615  if (tempState)
616  {
617  // tempState->setActive(false);
618  emit substateChanged(tempState, eChanged);
619  }
620  emit stateChanged(eChanged);
621 
622  }
623 
624 
625  void State::setInputParameters(const StateParameterMap& newInputParameters)
626  {
627  // TODO: This should allow for a more fine-granular set operation and emit the signal more intelligently
628  auto keys = newInputParameters.keys();
629 
630  for (const auto& key : keys)
631  {
632  if (localParameters.count(key) > 0)
633  {
634  throw LocalException("Key ") << key << " is already used in localParameters in state " << stateName;
635  }
636  }
637 
638  inputParameters = newInputParameters;
639  emit stateChanged(eChanged);
640  }
641 
642  void State::setLocalParameters(const StateParameterMap& newLocalParameters)
643  {
644  // TODO: This should allow for a more fine-granular set operation and emit the signal more intelligently
645  auto keys = newLocalParameters.keys();
646 
647  for (const auto& key : keys)
648  {
649  if (inputParameters.count(key) > 0)
650  {
651  throw LocalException("Key ") << key << " is already used in inputParameters in state " << stateName;
652  }
653  }
654 
655  localParameters = newLocalParameters;
656  emit stateChanged(eChanged);
657  }
658 
659  void State::setOutputParameters(const StateParameterMap& newOutputParameters)
660  {
661  // TODO: This should allow for a more fine-granular set operation and emit the signal more intelligently
662  outputParameters = newOutputParameters;
663  emit stateChanged(eChanged);
664  }
665 
666 
668  {
669  if (!checkTransition(newTransition))
670  {
671  return;
672  }
673 
674  transitions.push_back(newTransition);
675  emit transitionChanged(newTransition, eAdded);
676  }
677 
678  void State::setTransitionMapping(TransitionCPtr transition, const ParameterMappingList& mappingToNextStateInput
679  , const ParameterMappingList& mappingToParentLocal
680  , const ParameterMappingList& mappingToParentOutput
681  )
682  {
683  TransitionPtr t = findTransition(transition);
684 
685  if (t)
686  {
687  t->mappingToNextStatesInput = mappingToNextStateInput;
688  t->mappingToParentStatesLocal = mappingToParentLocal;
689  t->mappingToParentStatesOutput = mappingToParentOutput;
690  emit transitionChanged(t, eChanged);
691  }
692  else
693  {
694  throw LocalException("Could not find transition in state");
695  }
696  }
697 
698  void State::setTransitionSupportPoints(TransitionCPtr transition, const SupportPoints& points, const QPointPtr& labelCenterPosition, const FloatPtr& labelFontPointSize)
699  {
700  TransitionPtr t = findTransition(transition);
701 
702  if (t)
703  {
704  auto oldPoints = t->supportPoints.toPointList();
705  auto newPoints = points.toPointList();
706  bool changed = newPoints.size() != oldPoints.size();
707 
708  if (!changed)
709  {
710  int size = oldPoints.size();
711 
712  for (int i = 0; i < size; ++i)
713  {
714  if ((oldPoints.at(i) - newPoints.at(i)).manhattanLength() > 2)
715  {
716  changed = true;
717  break;
718  }
719  }
720 
721  }
722  t->labelCenterPosition = labelCenterPosition;
723  t->labelFontPointSize = labelFontPointSize;
724  t->supportPoints = points;
725  emit transitionChanged(t, changed ? eChanged : eUnchanged);
726  }
727  else
728  {
729  throw LocalException("Could not find transition in state");
730  }
731  }
732 
734  {
735  emit transitionChanged(transition, eActivated);
736  }
737 
739  {
740  TransitionPtr t = findTransition(transition);
741 
742  if (t)
743  {
744  t->transitionUserCode = enabled;
745  emit transitionChanged(t, eChanged);
746  }
747  else
748  {
749  throw LocalException("Could not find transition in state");
750  }
751  }
752 
753  void State::addDetachedTransition(const QString& eventName, StateInstancePtr sourceState)
754  {
755  if (!sourceState)
756  {
757  return;
758  }
759 
760  TransitionPtr t(new Transition());
761  t->sourceState = sourceState;
762  t->eventName = eventName;
763 
764  QPointF lastControlPoint = calcDetachedTransitionLastControlPoint(sourceState);
765  t->supportPoints.controlPoints.append(lastControlPoint);
766  t->supportPoints.endPoint = std::make_shared<QPointF>(calcDetachedTransitionEndPoint(sourceState, lastControlPoint));
767  addTransition(t);
768  }
769 
771  {
772  foreach (TransitionPtr t, transitions)
773  {
774  if (t.get() == transition.get())
775  {
776  if (transition->destinationState == newDest)
777  {
778  return;
779  }
780  // if(!t->destinationState)
781  t->supportPoints = SupportPoints(newSupportPoints);
782  t->destinationState = newDest;
783 
784  if (t->destinationState == t->sourceState) // reflexive edge
785  {
786  QPointF p = calcDetachedTransitionLastControlPoint(t->sourceState);
787  QPointList controlPoints;
788  controlPoints.push_back(p - QPointF(30, 30));
789  controlPoints.push_back(p);
790  controlPoints.push_back(p + QPointF(30, 30));
791 
792  t->supportPoints.controlPoints = controlPoints;
793  }
794  else
795  {
796  t->supportPoints.controlPoints.clear();
797  t->supportPoints.endPoint.reset();
798  t->supportPoints.startPoint.reset();
799  bendTransition(t, 50, (rand() % 20) - 10);
800  }
801 
802  if (!t->destinationState->getStateClass())
803  {
805  }
806 
807  emit transitionChanged(t, eChanged);
808  }
809  }
810 
811  }
812 
813  void State::detachTransitionDestination(TransitionCPtr transition, QPointF floatingEndPoint)
814  {
815  // if(!transition->destinationState)
816  // return;
817  TransitionPtr t = findTransition(transition);
818 
819  if (t)
820  {
821  ARMARX_INFO << "Detaching transition " << t->eventName;
822  t->supportPoints = SupportPoints(QPointList({floatingEndPoint}));
823  if (t->sourceState)
824  {
825  t->supportPoints.endPoint = std::make_shared<QPointF>(calcDetachedTransitionEndPoint(t->sourceState, floatingEndPoint));
826  }
827  t->destinationState.reset();
828  t->labelCenterPosition.reset();
829  emit transitionChanged(t, eChanged);
830  }
831  }
832 
833 
835  {
836  if (transition->sourceState)
837  {
838  detachTransitionDestination(transition, calcDetachedTransitionLastControlPoint(transition->sourceState));
839  }
840  }
841 
843  {
845 
846  while (!transitions.empty())
847  {
849  }
850 
851  transitions = newTransitionList;
852  transitions.push_front(startT ? startT : TransitionPtr(new Transition()));
853 
854  foreach (TransitionPtr t, transitions)
855  {
856  emit transitionChanged(t, eAdded);
857  }
858  }
859 
860  void State::addSupportPoint(TransitionCPtr transition, QPointF supportPoint)
861  {
862  ARMARX_ERROR_S << "NYI";
863  // auto t = findTransition(transition);
864  // float minDist = std::numeric_limits<float>::max();
865  // int index = -1;
866  // QList<QPointF> list = t->supportPoints;
867  // if(t->sourceState)
868  // list.push_front(t->sourceState->getBounds().center());
869  // if(t->destinationState)
870  // list.push_back(t->destinationState->getBounds().center());
871  // for(int i = 0; i < t->supportPoints.size(); i++)
872  // {
873  // const QPointF& curP = list.at(i);
874  // float d = (curP-supportPoint).manhattanLength();
875 
876  // if(d < minDist)
877  // {
878  // minDist = d;
879  // index = i;
880  // }
881  // ARMARX_INFO_S << VAROUT(index) << " " << VAROUT(d);
882  // }
883  // float prevDistance = index> 0 ? (list.at(index-1)-supportPoint).manhattanLength() : std::numeric_limits<float>::max();
884  // float distanceToNext = index< list.size()-1 ? (list.at(index+1)-supportPoint).manhattanLength() : std::numeric_limits<float>::max();
885  // if(prevDistance < distanceToNext)
886  // list.insert(index, supportPoint);
887  // else
888  // list.insert(index+1, supportPoint);
889  // if(t->sourceState)
890  // list.pop_front();
891  // if(t->destinationState)
892  // list.pop_back();
893  // t->supportPoints = list;
894  // emit transitionChanged(t, eChanged);
895  }
896 
897  void State::setOutgoingEvents(const EventList& outgoingEvents)
898  {
899  auto checkEventExistsInSubstates = [&, this](EventPtr & e)
900  {
901  for (const StateInstancePtr& substate : substates)
902  {
903  if (substate->getType() == eFinalState)
904  {
905  EndStateCPtr endstate = std::dynamic_pointer_cast<const EndState>(substate);
906 
907  if (endstate && endstate->getEventName() == e->name)
908  {
909  return true;
910  }
911  }
912  }
913 
914  return false;
915  };
916 
917  if (this->outgoingTransitions == outgoingEvents)
918  {
919  emit stateChanged(eUnchanged);
920  }
921  else
922  {
923  auto oldTransitions = outgoingTransitions;
924  this->outgoingTransitions = outgoingEvents;
925  // notify for new events
926  foreach (EventPtr ev, outgoingEvents)
927  {
928  bool found = false;
929  foreach (EventPtr evOld, oldTransitions)
930  {
931  if (evOld->name == ev->name)
932  {
933  found = true;
934  }
935  }
936 
937  if (!found && !checkEventExistsInSubstates(ev))
938  {
939  emit outgoingTransitionChanged(ev->name, shared_from_this(), eAdded);
940  }
941  }
942  // notify for removed events
943  foreach (EventPtr evOld, oldTransitions)
944  {
945  bool found = false;
946  foreach (EventPtr ev, outgoingEvents)
947  {
948  if (evOld->name == ev->name)
949  {
950  found = true;
951  }
952  }
953 
954  if (!found && !checkEventExistsInSubstates(evOld))
955  {
956  emit outgoingTransitionChanged(evOld->name, shared_from_this(), eRemoved);
957  }
958  }
959 
960 
961  emit stateChanged(eChanged);
962  }
963  }
964 
965  void State::updateTransition(const QString& eventName, StatePtr stateClass, SignalType signalType)
966  {
967  ARMARX_INFO_S << getStateName() << " was updated by substate " << stateClass->getStateName();
968 
969  // TODO: Rename transitions is buggy
970  switch (signalType)
971  {
972  case eAdded:
973  {
974  QList<StateInstancePtr> instances = getInstances(stateClass);
975  foreach (StateInstancePtr instance, instances)
976  {
977  addDetachedTransition(eventName, instance);
978  }
979  }
980  break;
981 
982  case eRemoved:
983  {
984  ARMARX_INFO_S << "Removing transitions for event " << eventName;
985  QList<StateInstancePtr> instances = getInstances(stateClass);
986  foreach (StateInstancePtr instance, instances)
987  {
988  TransitionPtr t = getTransition(eventName, instance);
989 
990  if (t && !containsOutgoingEvent(eventName, stateClass->getOutgoingEvents()))
991  {
992  removeTransition(t);
993  }
994  }
995  }
996 
997  break;
998 
999  default:
1000 
1001  break;
1002  }
1003 
1004  }
1005 
1006  void State::setDirty(SignalType signalType)
1007  {
1008  if (signalType != eUnchanged)
1009  {
1010  setDirty(true);
1011  }
1012  }
1013 
1014  void State::setDirty(StateInstancePtr substate, SignalType signalType)
1015  {
1016  if (signalType != eUnchanged)
1017  {
1018  setDirty(true);
1019  }
1020  }
1021 
1022  void State::setDirty(TransitionCPtr transition, SignalType signalType)
1023  {
1024  if (signalType != eUnchanged)
1025  {
1026  setDirty(true);
1027  }
1028  }
1029 
1030  void State::setDirty(bool dirty)
1031  {
1032  if (this->dirty != dirty)
1033  {
1034  emit dirtyStatusChanged(dirty);
1035  }
1036 
1037  this->dirty = dirty;
1038  }
1039 
1040  QList<StateInstancePtr> State::getInstances(StatePtr stateClass) const
1041  {
1042  QList<StateInstancePtr> result;
1043 
1044  for (StateInstanceMap::const_iterator s = substates.begin(); s != substates.end(); s++)
1045  {
1046  if (s.value()->getStateClass() == stateClass)
1047  {
1048  result.push_back(s.value());
1049  }
1050  }
1051 
1052  return result;
1053  }
1054 
1055  TransitionPtr State::getTransition(const QString& eventName, StateInstancePtr sourceInstance) const
1056  {
1057  foreach (TransitionPtr t, transitions)
1058  {
1059  if (t->eventName == eventName && t->sourceState == sourceInstance)
1060  {
1061  return t;
1062  }
1063  }
1064  return TransitionPtr();
1065  }
1066 
1067 
1068 
1070  {
1071  int index = transitions.indexOf(transition);
1072 
1073  if (index != -1)
1074  {
1075  // ARMARX_INFO_S << "Removing transitions for event " << transition->eventName
1076  // << " from " << (transition->sourceState ? transition->sourceState->getInstanceName() : "None")
1077  // << " to " << (transition->destinationState ? transition->destinationState->getInstanceName() : "None");
1078  emit transitionChanged(transition, eRemoved);
1079  transitions.erase(transitions.begin() + index);
1080  return true;
1081  }
1082 
1083  return false;
1084  }
1085 
1086  bool State::checkTransition(TransitionPtr transition) const
1087  {
1088  if (!transition)
1089  {
1090  ARMARX_WARNING << "Transition must not be NULL";
1091  return false;
1092  }
1093 
1094  TransitionPtr t = getTransition(transition->eventName, transition->sourceState);
1095 
1096  if (t)
1097  {
1098  ARMARX_WARNING << "Transition with event " << transition->eventName << " for state " << transition->sourceState->getInstanceName() << " already exists";
1099  return false;
1100  }
1101 
1102  if (!transition->destinationState && transition->supportPoints.controlPoints.size() == 0)
1103  {
1104  ARMARX_WARNING << "If no destination is set for a transition, it must have 1 support point";
1105  return false;
1106  }
1107 
1108  if (!transition->sourceState)
1109  {
1110  ARMARX_WARNING << "A Transition must have a source start";
1111  return false;
1112  }
1113 
1114  return true;
1115  }
1116 
1117  bool State::checkSubstate(StatePtr newState) const
1118  {
1119  ARMARX_INFO << "UUID parent: " << getUUID() << " new: " << newState->getUUID();
1120 
1121  if (getUUID() == newState->getUUID())
1122  {
1123  return false;
1124  }
1125  return true;
1126  }
1127 
1128 
1129 
1131  {
1132  for (int i = 0 ; i < transitions.size(); i++)
1133  {
1134  if (t.get() == transitions.at(i).get())
1135  {
1136  return transitions.at(i);
1137  }
1138  }
1139 
1140  return TransitionPtr();
1141  }
1142 
1143  TransitionPtr State::findTransition(const QString& eventName, const QString& transitionSourceName, const QString& transitionDestinationName) const
1144  {
1145  for (const TransitionPtr& t : transitions)
1146  {
1147  if (t->eventName == eventName && t->sourceState->getInstanceName() == transitionSourceName && t->destinationState->getInstanceName() == transitionDestinationName)
1148  {
1149  return t;
1150  }
1151  }
1152  return TransitionPtr();
1153  }
1154 
1156  {
1157  if (!sC)
1158  {
1159  return false;
1160  }
1161 
1162  for (auto it = substates.begin(); it != substates.end(); it++)
1163  {
1164  StateInstancePtr state = (it.value());
1165  if (!state)
1166  {
1167  continue;
1168  }
1169  if (!state->getStateClass())
1170  {
1171  continue;
1172  }
1173 
1174  if (state->getStateClass()->getUUID() == sC->getUUID())
1175  {
1176  return true;
1177  }
1178 
1179  if (state->getStateClass()->hasDescendant(sC))
1180  {
1181  return true;
1182  }
1183  }
1184  return false;
1185 
1186  }
1187 
1188  QString State::StateTypeToString(eStateType type)
1189  {
1190  switch (type)
1191  {
1192  case eNormalState:
1193  return "Normal State";
1194  break;
1195 
1196  case eRemoteState:
1197  return "Remote State";
1198  break;
1199 
1200  case eDynamicRemoteState:
1201  return "Dynamic Remote State";
1202  break;
1203 
1204  case eFinalState:
1205  return "Final State";
1206  break;
1207 
1208  case eUndefined:
1209  return "";
1210  break;
1211 
1212  default:
1213  return "Unknown State Type";
1214  }
1215  }
1216 
1217  void State::addDetachedTransitions(StateInstancePtr instance)
1218  {
1219  if (!instance->getStateClass())
1220  {
1221  return; // This not only happens for end states but also the class-reference is not existing during loading
1222  }
1223 
1224  QList<EventPtr> events = instance->getStateClass()->getAllEvents();
1225 
1226  float angleStep = 20;
1227  float length = instance->getClassSize().width() * instance->getScale() * 0.8f;
1228  QPointF center = instance->getBounds().center();
1229  int count = events.size();
1230  float startAngle = angleStep * (count - 1) / 2.0f;
1231 
1232  float angle = startAngle;
1233 
1234  foreach (EventPtr event, events)
1235  {
1236  TransitionPtr t(new Transition());
1237  t->sourceState = instance;
1238  t->eventName = event->name;
1239  t->supportPoints.append(center + QPointF(cos(angle / 180.0 * M_PI) * length, sin(angle / 180.0 * M_PI) * length));
1240  addTransition(t);
1241  angle -= angleStep;
1242  }
1243  }
1244 
1245  QPointF State::calcDetachedTransitionLastControlPoint(StateInstancePtr instance) const
1246  {
1247  QPointF p;
1248  float angle = ((double)(rand() % 360));
1249  float length = std::max(instance->getClassSize().width(), instance->getClassSize().height());
1250  length *= instance->getScale() * 0.8;
1251  // ARMARX_INFO << VAROUT(angle) << " " << VAROUT(length);
1252  p = instance->getBounds().center();
1253  // ARMARX_INFO << VAROUT(p);
1254  // p.setX(instance->getBounds().center().x);
1255  p.setX(p.x() + cos(angle / 180.0 * M_PI) * length);
1256  p.setY(p.y() + sin(angle / 180.0 * M_PI) * length);
1257  return p;
1258  }
1259 
1260  QPointF State::calcDetachedTransitionEndPoint(StateInstancePtr instance, const QPointF& lastControlPoint) const
1261  {
1262  QPointF line = lastControlPoint - instance->getBounds().center();
1263  QPointF p = line * 0.1 + lastControlPoint;
1264 
1265  return p;
1266  }
1267 
1268  void State::bendTransition(TransitionCPtr transition, int u, int v)
1269  {
1270  TransitionPtr t = findTransition(transition);
1271 
1272  if (t && t->sourceState && t->destinationState)
1273  {
1274  QPointList supportPoints;
1275  QPointF p1 = t->sourceState->getBounds().center();
1276  QPointF p2 = t->destinationState->getBounds().center();
1277  // t->supportPoints.startPoint = std::make_shared<QPointF>(p1);
1278  // t->supportPoints.endPoint = std::make_shared<QPointF>(p2);
1279  QPointF dirU = p2 - p1;
1280  QPointF dirV = QPointF(dirU.y(), -dirU.x());
1281  supportPoints.push_back(p1 + dirU * u / 100 + dirV * v / 100);
1282  t->supportPoints.setControlPoints(supportPoints);
1283  emit transitionChanged(t, eChanged);
1284  }
1285  }
1286 }
armarx::statechartmodel::State::activeSubstate
StateInstancePtr activeSubstate
Definition: State.h:256
armarx::statechartmodel::State::stateDeleted
void stateDeleted()
stateDeleted Signals that the destructor of this state was called.
armarx::statechartmodel::StateInstance
Definition: StateInstance.h:44
armarx::statechartmodel::State::State
State(const QString &uuid="")
Definition: State.cpp:36
armarx::statechartmodel::State::addRemoteSubstate
StateInstancePtr addRemoteSubstate(StatePtr newRemoteSubstate, const QString &remoteStateOffererName, QString instanceName="", const QPointF &pos=QPointF())
Definition: State.cpp:279
armarx::QPointList
QList< QPointF > QPointList
Definition: Transition.h:39
armarx::statechartmodel::containsOutgoingEvent
bool containsOutgoingEvent(const QString &eventName, const EventList &events)
Definition: State.cpp:485
armarx::statechartmodel::State::editable
bool editable
Definition: State.h:265
armarx::statechartmodel::State::transitionChanged
void transitionChanged(statechartmodel::TransitionCPtr transition, statechartmodel::SignalType signalType)
armarx::statechartmodel::State::replaceSubstate
StateInstancePtr replaceSubstate(QString stateInstanceName, StateInstancePtr newInstance)
Definition: State.cpp:544
armarx::statechartmodel::State::description
QString description
Definition: State.h:247
armarx::statechartmodel::State::bendTransition
void bendTransition(TransitionCPtr transition, int u, int v)
Definition: State.cpp:1268
armarx::statechartmodel::State::setTransitionMapping
void setTransitionMapping(TransitionCPtr transition, const ParameterMappingList &mappingToNextStateInput, const ParameterMappingList &mappingToParentLocal, const ParameterMappingList &mappingToParentOutput)
Definition: State.cpp:678
index
uint8_t index
Definition: EtherCATFrame.h:59
armarx::statechartmodel::State::getStartState
StateInstancePtr getStartState() const
Definition: State.cpp:116
armarx::statechartmodel::State::setStartState
void setStartState(StateInstancePtr newStartState)
Definition: State.cpp:397
armarx::statechartmodel::State::setSize
void setSize(const QSizeF &newSize)
Definition: State.cpp:213
armarx::statechartmodel::State::clearActiveSubstates
void clearActiveSubstates()
Definition: State.cpp:607
armarx::statechartmodel::State::addReferences
void addReferences(const QMap< QString, armarx::statechartmodel::StatePtr > &uuidStateMap)
Annotates the State object created by parseXml() before with references to other states.
Definition: State.cpp:55
armarx::statechartmodel::RemoteState
Definition: RemoteState.h:28
armarx::statechartmodel::EndStatePtr
std::shared_ptr< EndState > EndStatePtr
Definition: EndState.h:44
armarx::statechartmodel::State::localParameters
StateParameterMap localParameters
Definition: State.h:252
armarx::statechartmodel::TransitionPtr
std::shared_ptr< Transition > TransitionPtr
Definition: Transition.h:93
armarx::FloatPtr
std::shared_ptr< float > FloatPtr
Definition: Transition.h:40
armarx::statechartmodel::State::addEndSubstate
StateInstancePtr addEndSubstate(const QString &endstateName, const QString &eventName, const QPointF &pos=QPointF())
Definition: State.cpp:353
armarx::statechartmodel::EventList
QList< EventPtr > EventList
Definition: XmlWriter.h:47
armarx::statechartmodel::eUnchanged
@ eUnchanged
Definition: SignalType.h:36
armarx::statechartmodel::State::resized
void resized()
armarx::statechartmodel::State::addDetachedTransition
void addDetachedTransition(const QString &eventName, StateInstancePtr sourceState)
Definition: State.cpp:753
armarx::statechartmodel::State::dirty
bool dirty
Definition: State.h:264
armarx::statechartmodel::State::StateTypeToString
static QString StateTypeToString(eStateType type)
Definition: State.cpp:1188
armarx::statechartmodel::State::updateTransitionDestination
void updateTransitionDestination(TransitionCPtr transition, StateInstancePtr newDest, QPointList newSupportPoints=QPointList())
Definition: State.cpp:770
armarx::statechartmodel::State::updateTransition
void updateTransition(const QString &eventName, statechartmodel::StatePtr stateClass, statechartmodel::SignalType signalType)
Definition: State.cpp:965
armarx::statechartmodel::State::getOutgoingEvents
const EventList & getOutgoingEvents() const
Definition: State.h:109
armarx::statechartmodel::State::removeTransition
bool removeTransition(TransitionPtr transition)
Definition: State.cpp:1069
armarx::statechartmodel::State::checkTransition
bool checkTransition(TransitionPtr transition) const
Definition: State.cpp:1086
armarx::statechartmodel::State::getTransition
TransitionPtr getTransition(const QString &eventName, StateInstancePtr sourceInstance) const
Definition: State.cpp:1055
armarx::statechartmodel::State::setLocalParameters
void setLocalParameters(const StateParameterMap &newLocalParameters)
Definition: State.cpp:642
armarx::statechartmodel::State::getTransitions
CTransitionList getTransitions(bool withStartTransition=false) const
Definition: State.cpp:90
armarx::statechartmodel::State::transitions
TransitionList transitions
Definition: State.h:258
armarx::statechartmodel::State::margin
const QRectF margin
Definition: State.h:59
armarx::statechartmodel::StateInstancePtr
std::shared_ptr< StateInstance > StateInstancePtr
Definition: StateInstance.h:138
armarx::statechartmodel::State::getInputAndLocalParameters
const StateParameterMap getInputAndLocalParameters() const
Definition: State.cpp:78
armarx::QPointPtr
std::shared_ptr< QPointF > QPointPtr
Definition: Transition.h:41
IceInternal::Handle< Event >
armarx::statechartmodel::State::hasDescendant
bool hasDescendant(statechartmodel::StatePtr state) const
Definition: State.cpp:1155
armarx::statechartmodel::StateInstanceMap
QMap< QString, StateInstancePtr > StateInstanceMap
Definition: State.h:50
armarx::statechartmodel::State::checkSubstate
bool checkSubstate(StatePtr newState) const
Definition: State.cpp:1117
armarx::statechartmodel::State::outputParameters
StateParameterMap outputParameters
Definition: State.h:253
armarx::statechartmodel::State::detachTransitionDestination
void detachTransitionDestination(TransitionCPtr transition, QPointF floatingEndPoint)
Definition: State.cpp:813
armarx::statechartmodel::Transition
Definition: Transition.h:73
armarx::statechartmodel::State::setStateName
void setStateName(const QString &newName)
Definition: State.cpp:103
M_PI
#define M_PI
Definition: MathTools.h:17
armarx::statechartmodel::State::setDescription
void setDescription(const QString &newDescription)
Definition: State.cpp:200
armarx::statechartmodel::State::renameSubstate
bool renameSubstate(QString oldName, QString newName)
Definition: State.cpp:442
armarx::statechartmodel::State::dirtyStatusChanged
void dirtyStatusChanged(bool newStatus)
armarx::statechartmodel::State::outgoingTransitionChanged
void outgoingTransitionChanged(const QString &eventName, statechartmodel::StatePtr stateClass, statechartmodel::SignalType signalType)
armarx::statechartmodel::StateParameterMap
QMap< QString, StateParameterPtr > StateParameterMap
Definition: StateParameter.h:46
armarx::statechartmodel::DynamicRemoteState
Definition: DynamicRemoteState.h:29
ARMARX_ERROR_S
#define ARMARX_ERROR_S
Definition: Logging.h:209
armarx::statechartmodel
Definition: XmlWriter.h:36
armarx::statechartmodel::State::getInstances
QList< StateInstancePtr > getInstances(statechartmodel::StatePtr stateClass) const
Definition: State.cpp:1040
RemoteState.h
armarx::statechartmodel::State::removeSubstate
bool removeSubstate(StateInstancePtr substate)
Definition: State.cpp:475
enabled
std::atomic< bool > * enabled
Definition: RemoteGuiWidgetController.cpp:75
armarx::statechartmodel::State::addDynamicRemoteSubstate
StateInstancePtr addDynamicRemoteSubstate(StatePtr state, QString instanceName, const QPointF &pos)
Definition: State.cpp:313
armarx::statechartmodel::State::getStartTransition
TransitionCPtr getStartTransition() const
Definition: State.cpp:155
armarx::statechartmodel::State::size
QSizeF size
Definition: State.h:263
LocalState.h
max
T max(T t1, T t2)
Definition: gdiam.h:48
armarx::statechartmodel::State::findTransition
TransitionPtr findTransition(TransitionCPtr t) const
Definition: State.cpp:1130
armarx::statechartmodel::State::setTransitionActivated
void setTransitionActivated(TransitionCPtr transition)
Definition: State.cpp:733
armarx::TransitionPtr
std::shared_ptr< Transition > TransitionPtr
Definition: Transition.h:141
armarx::statechartmodel::eAdded
@ eAdded
Definition: SignalType.h:35
armarx::Transition
Definition: Transition.h:36
armarx::statechartmodel::State::setActiveSubstate
void setActiveSubstate(StateInstancePtr newActiveState)
Definition: State.cpp:584
armarx::statechartmodel::State::getSubstates
const StateInstanceMap & getSubstates() const
Definition: State.h:99
armarx::statechartmodel::eActivated
@ eActivated
Definition: SignalType.h:38
armarx::statechartmodel::State::addTransition
void addTransition(TransitionPtr newTransition)
Definition: State.cpp:667
armarx::statechartmodel::State::setOutputParameters
void setOutputParameters(const StateParameterMap &newOutputParameters)
Definition: State.cpp:659
armarx::statechartmodel::State::outgoingTransitions
EventList outgoingTransitions
Definition: State.h:245
armarx::statechartmodel::State::getAllEvents
EventList getAllEvents() const
Definition: State.cpp:128
armarx::statechartmodel::CTransitionList
QList< TransitionCPtr > CTransitionList
Definition: State.h:49
armarx::statechartmodel::EndState
Definition: EndState.h:28
armarx::statechartmodel::TransitionList
QList< TransitionPtr > TransitionList
Definition: State.h:48
armarx::statechartmodel::State::getStateName
QString getStateName() const
Definition: State.h:68
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
armarx::statechartmodel::State::setOutgoingEvents
void setOutgoingEvents(const EventList &outgoingEvents)
Definition: State.cpp:897
armarx::statechartmodel::State::replaceTransitions
void replaceTransitions(TransitionList newTransitionList)
Definition: State.cpp:842
ARMARX_CHECK_EXPRESSION
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
Definition: ExpressionException.h:73
armarx::statechartmodel::eRemoved
@ eRemoved
Definition: SignalType.h:40
ArmarXWidgetController.h
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::statechartmodel::State::addSubstate
StateInstancePtr addSubstate(StateInstancePtr stateInstance)
Definition: State.cpp:371
armarx::statechartmodel::State::getStartStateInputMapping
ParameterMappingList getStartStateInputMapping() const
Definition: State.cpp:122
armarx::statechartmodel::State::UUID
QString UUID
Definition: State.h:260
armarx::statechartmodel::SignalType
SignalType
The SignalType enum.
Definition: SignalType.h:33
armarx::statechartmodel::State::connectToSubclasses
void connectToSubclasses()
Definition: State.cpp:183
armarx::statechartmodel::TransitionCPtr
std::shared_ptr< const Transition > TransitionCPtr
Definition: Transition.h:94
armarx::statechartmodel::State::setTransitionSupportPoints
void setTransitionSupportPoints(statechartmodel::TransitionCPtr transition, const SupportPoints &points, const QPointPtr &labelCenterPosition=QPointPtr(), const FloatPtr &labelFontPointSize=FloatPtr())
Definition: State.cpp:698
armarx::statechartmodel::ParameterMappingList
QList< ParameterMappingPtr > ParameterMappingList
Definition: XmlWriter.h:49
armarx::statechartmodel::StatePtr
std::shared_ptr< State > StatePtr
Definition: State.h:46
angle
double angle(const Point &a, const Point &b, const Point &c)
Definition: point.hpp:100
armarx::statechartmodel::State::stateName
QString stateName
Definition: State.h:246
armarx::statechartmodel::State::setEditable
void setEditable(bool editable)
Definition: State.cpp:237
armarx::statechartmodel::eChanged
@ eChanged
Definition: SignalType.h:37
armarx::statechartmodel::EventPtr
std::shared_ptr< Event > EventPtr
Definition: XmlWriter.h:46
armarx::statechartmodel::State::inputParameters
StateParameterMap inputParameters
Definition: State.h:251
armarx::statechartmodel::State::addSupportPoint
void addSupportPoint(TransitionCPtr transition, QPointF supportPoint)
Definition: State.cpp:860
armarx::statechartmodel::State::stateChanged
void stateChanged(statechartmodel::SignalType signalType)
armarx::statechartmodel::State::setStartStateInputMapping
void setStartStateInputMapping(const ParameterMappingList &newStartStateInputMapping)
Definition: State.cpp:421
ARMARX_INFO_S
#define ARMARX_INFO_S
Definition: Logging.h:195
armarx::statechartmodel::LocalState
Definition: LocalState.h:31
armarx::statechartmodel::State::~State
~State() override
Definition: State.cpp:50
armarx::statechartmodel::State::setTransitionUserCodeEnabled
void setTransitionUserCodeEnabled(TransitionCPtr transition, bool enabled=true)
Definition: State.cpp:738
armarx::SupportPoints
Definition: Transition.h:43
State.h
armarx::statechartmodel::State::isEditable
bool isEditable() const
Definition: State.cpp:195
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::statechartmodel::Event
Definition: Event.h:30
armarx::statechartmodel::State::substateChanged
void substateChanged(statechartmodel::StateInstancePtr substate, statechartmodel::SignalType signalType)
armarx::statechartmodel::State::replaceSubstates
void replaceSubstates(StateInstanceMap newSubstateList)
Definition: State.cpp:563
armarx::statechartmodel::EndStateCPtr
std::shared_ptr< const EndState > EndStateCPtr
Definition: XmlWriter.h:52
armarx::statechartmodel::State::setInputParameters
void setInputParameters(const StateParameterMap &newInputParameters)
Definition: State.cpp:625
armarx::statechartmodel::State::substates
StateInstanceMap substates
Definition: State.h:255
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
DynamicRemoteStateClass.h
armarx::statechartmodel::State::getUUID
QString getUUID() const
Definition: State.h:72
armarx::statechartmodel::State::setSubstateAreaSize
void setSubstateAreaSize(const QSizeF &newSize)
Definition: State.cpp:230
armarx::SupportPoints::toPointList
QList< QPointF > toPointList() const
Definition: GraphvizConverter.cpp:345
DynamicRemoteState.h