OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
FixtureTouchstoneHandler.h
Go to the documentation of this file.
1#pragma once
2#include <gtest/gtest.h>
3
4#include "TouchstoneHandler.h"
6
7class FixtureTouchstoneHandler : public testing::Test
8{
9public:
11 :m_handler("testFile.s2p")
12 {
13
14 }
15 const ts::OptionSettings& analyseOptionSettings(std::string& text)
16 {
17 m_handler.analyseLine(text);
18 return m_handler.getOptionSettings();
19 }
20
21 void analyseLine(std::string& text)
22 {
23 m_handler.analyseLine(text);
24 }
25
26 void analyseFile(const std::string& fileContent)
27 {
28 m_handler.analyseFile(fileContent,m_handler.m_portNumber);
29 }
30
31 const std::string& getComments()
32 {
33 return m_handler.getComments();
34 }
35
36 void cleansLineOfComments(std::string& line)
37 {
38 m_handler.cleansOfComments(line);
39 }
40
41 void setNumberOfPorts(uint32_t portNumber)
42 {
43 m_handler.m_portNumber = portNumber;
44 }
45
46 const QuantityDescriptionSParameter& getQuantityDescriptionData()
47 {
48 return m_handler.getQuantityDescription();
49 }
50
52 {
53 return m_handler.getOptionSettings();
54 }
55
56 const MetadataParameter& getFrequencyParameter()
57 {
58 return m_handler.getMetadataFrequencyParameter();
59 }
60
62 {
63 std::string line = "2.000 0.894 -12.136\n";
65 analyseLine(line);
66 }
67
68 const std::string& getFullExampleFourPorts() const { return m_exampleFourPorts; };
69private:
70 TouchstoneHandler m_handler;
71
72 const std::string m_exampleFourPorts =
73 "!4 - port S - parameter data, taken at three frequency points\n"
74 "!note that data points need not be aligned\n"
75 "# Hz Y RI R 90\n"
76 "5.00000 0.60 161.24 0.40 -42.20 0.42 -66.58 0.53 -79.34 !row 1\n"
77 "0.40 -42.20 0.60 161.20 0.53 -79.34 0.42 -66.58 !row 2\n"
78 "0.42 -66.58 0.53 -79.34 0.60 161.24 0.40 -42.20 !row 3\n"
79 "0.53 -79.34 0.42 -66.58 0.40 -42.20 0.60 161.24 !row 4\n"
80 "6.00000 0.57 150.37 0.40 -44.34 0.41 -81.24 0.57 -95.77 !row 1\n"
81 "0.40 -44.34 0.57 150.37 0.57 -95.77 0.41 -81.24 !row 2\n"
82 "0.41 -81.24 0.57 -95.77 0.57 150.37 0.40 -44.34 !row 3\n"
83 "0.57 -95.77 0.41 -81.24 0.40 -44.34 0.57 150.37 !row 4\n"
84 "7.00000 0.50 136.69 0.45 -46.41 0.37 -99.09 0.62 -114.19 !row 1\n"
85 "0.45 -46.41 0.50 136.69 0.62 -114.19 0.37 -99.09 !row 2\n"
86 "0.37 -99.09 0.62 -114.19 0.50 136.69 0.45 -46.41 !row 3\n"
87 "0.62 -114.19 0.37 -99.09 0.45 -46.41 0.50 136.69 !row 4\n";
88};
Definition FixtureTouchstoneHandler.h:8
void cleansLineOfComments(std::string &line)
Definition FixtureTouchstoneHandler.h:36
void setNumberOfPorts(uint32_t portNumber)
Definition FixtureTouchstoneHandler.h:41
const MetadataParameter & getFrequencyParameter()
Definition FixtureTouchstoneHandler.h:56
const ts::OptionSettings & getOptionSettings()
Definition FixtureTouchstoneHandler.h:51
void analyseLine(std::string &text)
Definition FixtureTouchstoneHandler.h:21
void setup1PortTest()
Definition FixtureTouchstoneHandler.h:61
const ts::OptionSettings & analyseOptionSettings(std::string &text)
Definition FixtureTouchstoneHandler.h:15
const QuantityDescriptionSParameter & getQuantityDescriptionData()
Definition FixtureTouchstoneHandler.h:46
const std::string & getFullExampleFourPorts() const
Definition FixtureTouchstoneHandler.h:68
const std::string & getComments()
Definition FixtureTouchstoneHandler.h:31
void analyseFile(const std::string &fileContent)
Definition FixtureTouchstoneHandler.h:26
FixtureTouchstoneHandler()
Definition FixtureTouchstoneHandler.h:10
Definition TouchstoneHandler.h:11
MetadataParameter & getMetadataFrequencyParameter()
Definition TouchstoneHandler.h:30
const std::string & getComments() const
Definition TouchstoneHandler.h:23
void analyseFile(const std::string &_fileContent, int32_t _numberOfPorts)
Definition TouchstoneHandler.cpp:31
const ts::OptionSettings & getOptionSettings() const
Definition TouchstoneHandler.h:22
Definition OptionSettings.h:7