NCL Composer  0.1.5
 All Classes Functions Variables Pages
qnstgraphicsmapping.cpp
1 #include "qnstgraphicsmapping.h"
2 
3 QnstGraphicsMapping::QnstGraphicsMapping(QnstGraphicsEntity* parent)
4  : QnstGraphicsReference(parent)
5 {
6  setnstType(Qnst::Mapping);
7 }
8 
9 
10 QnstGraphicsMapping::~QnstGraphicsMapping()
11 {
12 
13 }
14 
15 QString QnstGraphicsMapping::getComponent() const
16 {
17  return component;
18 }
19 
20 void QnstGraphicsMapping::setComponent(QString component)
21 {
22  this->component = component;
23 }
24 
25 QString QnstGraphicsMapping::getComponentUid() const
26 {
27  return componentUid;
28 }
29 
30 void QnstGraphicsMapping::setComponentUid(QString componentUid)
31 {
32  this->componentUid = componentUid;
33 }
34 
35 QString QnstGraphicsMapping::getSwitchPortUid() const
36 {
37  return switchportUid;
38 }
39 
40 void QnstGraphicsMapping::setSwitchPortUid(QString switchportUid)
41 {
42  this->switchportUid = switchportUid;
43 }
44 
45 QString QnstGraphicsMapping::getInterface() const
46 {
47  return interface;
48 }
49 
50 void QnstGraphicsMapping::setInterface(QString interface)
51 {
52  this->interface = interface;
53 }
54 
55 QString QnstGraphicsMapping::getInterfaceUid() const
56 {
57  return interfaceUid;
58 }
59 
60 void QnstGraphicsMapping::setInterfaceUid(QString interfaceUid)
61 {
62  this->interfaceUid = interfaceUid;
63 }
64 
65 void QnstGraphicsMapping::setProperties(const QMap<QString, QString> &props)
66 {
67  QnstGraphicsReference::setProperties(props);
68 
69  setComponent(props["component"]);
70 
71  if (props["componentUid"] != "")
72  setComponentUid(props["componentUid"]);
73  else
74  setComponentUid("");
75 
76  setInterface(props["interface"]);
77 
78  if (props["interfaceUid"] != "")
79  setInterfaceUid(props["interfaceUid"]);
80  else
81  setInterfaceUid("");
82 }
83 
84 void QnstGraphicsMapping::getProperties(QMap<QString, QString> &properties)
85 {
86  QnstGraphicsReference::getProperties(properties);
87 
88  properties["component"] = getComponent();
89  properties["componentUid"] = getComponentUid();
90 
91  properties["interface"] = getInterface();
92  properties["interfaceUid"] = getInterfaceUid();
93 }