ngscopeclient 0.1-dev+51fbda87c
Public Member Functions | Protected Member Functions | List of all members

Touchstone (SxP) file parser. More...

#include <TouchstoneParser.h>

Public Member Functions

 TouchstoneParser ()
 Default constructor, does nothing.
 
virtual ~TouchstoneParser ()
 Default destructor, does nothing.
 
bool Load (std::string fname, SParameters &params)
 Reads a SxP file. More...
 

Protected Member Functions

void ComplexToPolar (float &f1, float &f2)
 Converts a complex number in (real, imaginary) form to (magnitude, angle) More...
 
bool ReadFloat (const char *buf, size_t &i, size_t len, float &f)
 Reads a single ASCII float from the input buffer. More...
 

Detailed Description

Touchstone (SxP) file parser.

Member Function Documentation

◆ ComplexToPolar()

void TouchstoneParser::ComplexToPolar ( float &  f1,
float &  f2 
)
protected

Converts a complex number in (real, imaginary) form to (magnitude, angle)

Parameters
f1Input real part, output magnitude part
f2Input imaginary part, output angle part

◆ Load()

bool TouchstoneParser::Load ( std::string  fname,
SParameters params 
)

Reads a SxP file.

Parameters
fnamePath to the .s*p file
[out]paramsThe parsed S-parameters (if successful)
Returns
True on success, false on failure

is a comment, ignore everything until the next newline

◆ ReadFloat()

bool TouchstoneParser::ReadFloat ( const char *  buf,
size_t &  i,
size_t  len,
float &  f 
)
protected

Reads a single ASCII float from the input buffer.

Parameters
bufInput buffer
iIndex of the cursor within the buffer
lenSize of the buffer
[out]fOutput value
Trueon success, false on EOF or malformed data

The documentation for this class was generated from the following files: