OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
PortSettings.h
Go to the documentation of this file.
1/*********************************************************************
2 * @file PortSettings.h
3 * @brief Contains information about a single port. Mirrors the settings that were selected for the corresponding entity in the UI.
4 *
5 * @author Jan Wagner
6 * @date July 2022
7 *********************************************************************/
8#pragma once
9#include <map>
10#include "EntitySolverPort.h"
11
12#include <string>
13#include "Ports/SourceTarget.h"
14#include "Ports/Signal.h"
16
18{
19public:
21
31 PortSettings(std::string portName, std::string excitationTarget, std::string excitationAxis, std::string excitationSignal);
32
34
35 const index_t GetCoorX() const {return _coordinateX;};
36 const index_t GetCoorY() const {return _coordinateY;};
37 const index_t GetCoorZ() const {return _coordinateZ;};
38
39 const bool LocationIsInCentre() const { return _locationInCentre; }
40
41 const std::string GetPortName() const { return _portName; }
42
44 {
45 return _sourceTypeName.at(_excitationTarget);
46 }
47
48 const axis GetAxis()const
49 {
50 return _sourceAxisName.at(_excitationAxis);
51 }
52
53 const std::string GetExcitationSignalName(void) { return _excitationSignalName; }
54
55 void SetExcitationSignal(Signal excitationSignal) { _excitationSignal = excitationSignal; }
56 const Signal GetExcitationSignal(void) { return _excitationSignal; }
57
58 std::string Print();
59
60private:
61 std::string _portName;
62
63 index_t _coordinateX;
64 index_t _coordinateY;
65 index_t _coordinateZ;
66
67 std::string _excitationTarget;
68 std::string _excitationAxis;
69 std::string _excitationSignalName;
70
71 Signal _excitationSignal;
72
73 bool _locationInCentre = true;
74
75 index_t _index;
76 std::string _specializedPortProperties;
77
78 std::map<std::string, sourceType> _sourceTypeName{ {EntitySolverPort::GetValueExcitationTargetE() ,e }, {EntitySolverPort::GetValueExcitationTargetH(),h} };
79 std::map<std::string, axis> _sourceAxisName{ {EntitySolverPort::GetValueExcitationAxisX(),x_axis }, {EntitySolverPort::GetValueExcitationAxisY(),y_axis },{EntitySolverPort::GetValueExcitationAxisZ(),z_axis } };
80
81};
sourceType
Definition SourceTarget.h:4
@ e
Definition SourceTarget.h:4
@ h
Definition SourceTarget.h:4
axis
Definition SourceTarget.h:5
@ x_axis
Definition SourceTarget.h:5
@ z_axis
Definition SourceTarget.h:5
@ y_axis
Definition SourceTarget.h:5
int64_t index_t
Definition SystemDependentDefines.h:13
Definition PortSettings.h:18
const sourceType GetSourceType() const
Definition PortSettings.h:43
void SetExcitationPoint(index_t x, index_t y, index_t z)
Definition PortSettings.cpp:10
PortSettings(std::string portName, std::string excitationTarget, std::string excitationAxis, std::string excitationSignal)
Definition PortSettings.cpp:3
const std::string GetExcitationSignalName(void)
Definition PortSettings.h:53
const index_t GetCoorZ() const
Definition PortSettings.h:37
const std::string GetPortName() const
Definition PortSettings.h:41
const Signal GetExcitationSignal(void)
Definition PortSettings.h:56
const bool LocationIsInCentre() const
Definition PortSettings.h:39
const axis GetAxis() const
Definition PortSettings.h:48
std::string Print()
Definition PortSettings.cpp:19
void SetExcitationSignal(Signal excitationSignal)
Definition PortSettings.h:55
const index_t GetCoorY() const
Definition PortSettings.h:36
const index_t GetCoorX() const
Definition PortSettings.h:35
PortSettings & operator=(PortSettings &other)=delete
Definition Signal.h:18