TransitionMappingTable.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-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
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
25 
26 
27 #include <QTableWidget>
28 
30 
31 #include "../../../StatechartViewerPlugin/model/State.h"
32 
33 
34 class QComboBox;
35 
36 namespace armarx
37 {
38 
39  class TransitionMappingTable : public QTableWidget
40  {
41  Q_OBJECT
42  public:
43  enum
44  {
50  };
51 
52  explicit TransitionMappingTable(QWidget* parent = 0);
53  void setup(const statechartmodel::StateParameterMap& targetDict, const statechartmodel::ParameterMappingList& sourceMapping, statechartmodel::TransitionCPtr transition, statechartmodel::StatePtr state, QStringList profileNames, Ice::CommunicatorPtr ic = NULL, VariantInfoPtr variantInfo = VariantInfoPtr());
55  QList<std::pair<QString, QString> > mapByCriteria(std::function<std::pair<bool, float>(QString, QString)> compare);
56  signals:
57 
58  public slots:
59  protected slots:
60  void setSourceSpecificMappingParameters(int index, int tablerow = -1, QString initialValue = "");
61 
62  private:
63  QComboBox* getFilteredOutputItems(QString key, statechartmodel::TransitionCPtr transition);
64  QList<QPair<QString, QString>> getFilteredParams(const statechartmodel::StateParameterMap& source, const statechartmodel::StateParameter& argumentToMatch) const;
65  QString getInputTypeString(int row);
67  statechartmodel::StatePtr parentState;
70  QStringList profileNames;
72 
73  VariantInfoPtr variantInfo;
74  };
75 
76 }
77 
armarx::TransitionMappingTable::eDestType
@ eDestType
Definition: TransitionMappingTable.h:46
index
uint8_t index
Definition: EtherCATFrame.h:59
armarx::TransitionMappingTable
Definition: TransitionMappingTable.h:39
armarx::TransitionMappingTable::setSourceSpecificMappingParameters
void setSourceSpecificMappingParameters(int index, int tablerow=-1, QString initialValue="")
Definition: TransitionMappingTable.cpp:270
armarx::TransitionMappingTable::mapByCriteria
QList< std::pair< QString, QString > > mapByCriteria(std::function< std::pair< bool, float >(QString, QString)> compare)
Definition: TransitionMappingTable.cpp:201
IceInternal::Handle< ::Ice::Communicator >
armarx::TransitionMappingTable::eMappingRequired
@ eMappingRequired
Definition: TransitionMappingTable.h:47
armarx::statechartmodel::StateParameter
Definition: StateParameter.h:49
armarx::statechartmodel::StateParameterMap
QMap< QString, StateParameterPtr > StateParameterMap
Definition: StateParameter.h:46
armarx::TransitionMappingTable::TransitionMappingTable
TransitionMappingTable(QWidget *parent=0)
Definition: TransitionMappingTable.cpp:53
armarx::TransitionMappingTable::setup
void setup(const statechartmodel::StateParameterMap &targetDict, const statechartmodel::ParameterMappingList &sourceMapping, statechartmodel::TransitionCPtr transition, statechartmodel::StatePtr state, QStringList profileNames, Ice::CommunicatorPtr ic=NULL, VariantInfoPtr variantInfo=VariantInfoPtr())
Definition: TransitionMappingTable.cpp:58
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
armarx::detail::compare
int compare(const T &lhs, const T &rhs)
Definition: TreeWidgetBuilder.h:278
armarx::VariantInfoPtr
std::shared_ptr< VariantInfo > VariantInfoPtr
Definition: VariantInfo.h:39
armarx::statechartmodel::TransitionCPtr
std::shared_ptr< const Transition > TransitionCPtr
Definition: Transition.h:94
armarx::statechartmodel::ParameterMappingList
QList< ParameterMappingPtr > ParameterMappingList
Definition: XmlWriter.h:49
armarx::statechartmodel::StatePtr
std::shared_ptr< State > StatePtr
Definition: State.h:46
armarx::TransitionMappingTable::getMapping
statechartmodel::ParameterMappingList getMapping() const
Definition: TransitionMappingTable.cpp:161
armarx::TransitionMappingTable::eSourceKey
@ eSourceKey
Definition: TransitionMappingTable.h:49
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::TransitionMappingTable::eDestKey
@ eDestKey
Definition: TransitionMappingTable.h:45
armarx::TransitionMappingTable::eSource
@ eSource
Definition: TransitionMappingTable.h:48
VariantInfo.h