Skip to content

Commit 9c4608f

Browse files
committed
Documented TouchstoneParser
1 parent ac14185 commit 9c4608f

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

scopehal/TouchstoneParser.cpp

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/***********************************************************************************************************************
22
* *
3-
* libscopehal v0.1 *
3+
* libscopehal *
44
* *
5-
* Copyright (c) 2012-2021 Andrew D. Zonenberg and contributors *
5+
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -31,6 +31,7 @@
3131
@file
3232
@author Andrew D. Zonenberg
3333
@brief Implementation of TouchstoneParser
34+
@ingroup core
3435
*/
3536
#include "scopehal.h"
3637
#include <math.h>
@@ -40,17 +41,28 @@ using namespace std;
4041
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4142
// TouchstoneParser
4243

44+
/**
45+
@brief Default constructor, does nothing
46+
*/
4347
TouchstoneParser::TouchstoneParser()
4448
{
4549
}
4650

51+
/**
52+
@brief Default destructor, does nothing
53+
*/
4754
TouchstoneParser::~TouchstoneParser()
4855
{
4956

5057
}
5158

5259
/**
5360
@brief Reads a SxP file
61+
62+
@param fname Path to the .s*p file
63+
@param[out] params The parsed S-parameters (if successful)
64+
65+
@return True on success, false on failure
5466
*/
5567
bool TouchstoneParser::Load(string fname, SParameters& params)
5668
{
@@ -238,6 +250,13 @@ bool TouchstoneParser::Load(string fname, SParameters& params)
238250

239251
/**
240252
@brief Reads a single ASCII float from the input buffer
253+
254+
@param buf Input buffer
255+
@param i Index of the cursor within the buffer
256+
@param len Size of the buffer
257+
@param[out] f Output value
258+
259+
@param True on success, false on EOF or malformed data
241260
*/
242261
bool TouchstoneParser::ReadFloat(const char* buf, size_t& i, size_t len, float& f)
243262
{
@@ -259,6 +278,9 @@ bool TouchstoneParser::ReadFloat(const char* buf, size_t& i, size_t len, float&
259278

260279
/**
261280
@brief Converts a complex number in (real, imaginary) form to (magnitude, angle)
281+
282+
@param f1 Input real part, output magnitude part
283+
@param f2 Input imaginary part, output angle part
262284
*/
263285
void TouchstoneParser::ComplexToPolar(float& f1, float& f2)
264286
{

scopehal/TouchstoneParser.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/***********************************************************************************************************************
22
* *
3-
* libscopehal v0.1 *
3+
* libscopehal *
44
* *
5-
* Copyright (c) 2012-2021 Andrew D. Zonenberg and contributors *
5+
* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -31,13 +31,15 @@
3131
@file
3232
@author Andrew D. Zonenberg
3333
@brief Declaration of TouchstoneParser
34+
@ingroup core
3435
*/
3536

3637
#ifndef TouchstoneParser_h
3738
#define TouchstoneParser_h
3839

3940
/**
4041
@brief Touchstone (SxP) file parser
42+
@ingroup core
4143
*/
4244
class TouchstoneParser
4345
{

0 commit comments

Comments
 (0)