qucs_s/qucs-s-spar-viewer/qucs-s-spar-viewer.h

237 lines
6.3 KiB
C
Raw Permalink Normal View History

S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
#ifndef QUCSSPARVIEWER_H
#define QUCSSPARVIEWER_H
#include "codeeditor.h"
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
#include <QMainWindow>
#include <QLabel>
#include <QCheckBox>
#include <QDoubleSpinBox>
#include <QTableWidget>
#include <QGridLayout>
#include <QColorDialog>
#include <QScrollArea>
#include <QtCharts>
#include <QtGlobal>
#include <complex>
class QComboBox;
class QTableWidget;
class QLineEdit;
class QIntValidator;
class QDoubleValidator;
class QLabel;
class QPushButton;
struct tQucsSettings
{
int x, y; // position of main window
QFont font;
QString LangDir;
QString Language;
};
extern struct tQucsSettings QucsSettings;
class Qucs_S_SPAR_Viewer : public QMainWindow
{
Q_OBJECT
public:
Qucs_S_SPAR_Viewer();
~Qucs_S_SPAR_Viewer();
protected:
void resizeEvent(QResizeEvent *event) override {
QMainWindow::resizeEvent(event);
updateTraces();
}
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
private slots:
void slotHelpIntro();
void slotHelpAbout();
void slotHelpAboutQt();
void slotQuit();
2024-09-22 09:49:23 +02:00
void slotSave();
void slotSaveAs();
void slotLoadSession();
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
void addFile();
void addFiles(QStringList);
void removeFile();
void removeFile(int);
void removeAllFiles();
void addTrace();
void addTrace(QString, QString, QColor, int trace_width = 1, QString trace_style = "Solid");
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
void removeTrace();
void removeTrace(int);
void removeTrace(QList<int>);
void updatePlot();
2024-09-19 20:11:18 +02:00
void updateTraces();
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
void updateTracesCombo();
void changeTraceColor();
void changeTraceLineStyle();
void changeTraceWidth();
void changeFreqUnits();
void changeMarkerLimits();
void changeMarkerLimits(QString);
void update_X_axis();
void update_Y_axis();
void lock_unlock_axis_settings(bool toogle = true);
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
void addMarker(double freq = -1);
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
void removeMarker();
void removeMarker(int);
void removeAllMarkers();
void updateMarkerTable();
void updateMarkerNames();
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
void addLimit(double f_limit1=-1, QString f_limit1_unit = "", double f_limit2=-1, QString f_limit2_unit = "", double y_limit1=-1, double y_limit2=-1, bool coupled=false);
2024-09-19 20:11:18 +02:00
void removeLimit();
void removeLimit(int);
void removeAllLimits();
void updateLimits();
void updateLimitNames();
2024-09-19 20:11:18 +02:00
void coupleSpinBoxes();
void updateGridLayout(QGridLayout*);
void calculate_Sparameter_trace(QString, QString);
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
protected:
void dragEnterEvent(QDragEnterEvent *event) override;
void dropEvent(QDropEvent *event) override;
private:
QDockWidget *dockFiles;
QTableWidget * spar_files_Widget;
QPushButton *Button_Add_File, *Delete_All_Files;
// File list
QList<QPushButton*> Button_DeleteFile;
// Filenames and remove buttons
QVBoxLayout *vLayout_Files;
QWidget * FileList_Widget;
QGridLayout * FilesGrid;
QList<QLabel *> List_FileNames;
QList<QToolButton *> List_RemoveButton;
// Trace list
QDockWidget *dockTracesList;
QWidget * TracesList_Widget;
QGridLayout * TracesGrid;
QList<QLabel *> List_TraceNames;
QList<QSpinBox *> List_TraceWidth;
QList<QPushButton *> List_Trace_Color;
QList<QComboBox *> List_Trace_LineStyle;
QList<QComboBox *> List_Trace_Type;
QList<QToolButton*> List_Button_DeleteTrace;
// Axis settings widgets
QDockWidget *dockAxisSettings;
QComboBox *QCombobox_x_axis_units;//, *QCombobox_y_axis_units, *QCombobox_y2_axis_units;
QDoubleSpinBox *QSpinBox_x_axis_min, *QSpinBox_x_axis_max;
QList<double> available_x_axis_div;
QComboBox *QComboBox_x_axis_div;
QDoubleSpinBox *QSpinBox_y_axis_min, *QSpinBox_y_axis_max, *QSpinBox_y_axis_div;
QList<double> available_y_axis_div;
QComboBox *QComboBox_y_axis_div;
QDoubleSpinBox *QSpinBox_y2_axis_min, *QSpinBox_y2_axis_max, *QSpinBox_y2_axis_div;
QPushButton *Lock_axis_settings_Button;
bool lock_axis;
QStringList frequency_units;
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
// Trace management widgets
QComboBox *QCombobox_datasets, *QCombobox_traces;
QPushButton *Button_add_trace;
QTableWidget *Traces_Widget;
// Datasets
QMap<QString, QMap<QString, QList<double>>> datasets;
/*
KEY | DATA
Filename1.s2p | {"freq", "S11_dB", ..., "S22_ang"}
... | ...
Filenamek.s3p | {"freq", "S11_dB", ..., "S33_ang"}
*/
// Trace data
QList<QString> trace_list;
QMap<QString, QList<QString>> trace_properties;
// Chart
QChart *chart;
QDockWidget *dockChart;
QValueAxis *xAxis, *yAxis;
double f_min, f_max, y_min, y_max; // Minimum (maximum) values of the display
QList<QColor> default_colors;
QList<QGraphicsItem*> textLabels;
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
bool removeSeriesByName(QChart*, const QString&);
// Markers
QDockWidget *dockMarkers;
QWidget *Marker_Widget;
QGridLayout * MarkersGrid;
QTableWidget *tableMarkers;
QPushButton *Button_add_marker, *Button_Remove_All_Markers;
QList<QLabel *> List_MarkerNames;
QList<QDoubleSpinBox *> List_MarkerFreq;
QList<QComboBox *> List_MarkerScale;
QList<QToolButton*> List_Button_DeleteMarker;
2024-09-19 20:11:18 +02:00
// Limits
QDockWidget *dockLimits;
QWidget *Limits_Widget;
QGridLayout * LimitsGrid;
QPushButton *Button_add_Limit, *Button_Remove_All_Limits;
QList<QLabel *> List_LimitNames;
QList<QDoubleSpinBox *> List_Limit_Start_Freq, List_Limit_Stop_Freq;
QList<QDoubleSpinBox *> List_Limit_Start_Value, List_Limit_Stop_Value;
QList<QComboBox *> List_Limit_Start_Freq_Scale, List_Limit_Stop_Freq_Scale;
QList<QToolButton*> List_Button_Delete_Limit;
QList<QFrame*> List_Separators;
QList<QPushButton*> List_Couple_Value;
QDoubleSpinBox * Limits_Offset;
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
2024-09-22 09:49:23 +02:00
// Save
QString savepath;
bool save();
void loadSession(QString);
2024-09-22 09:49:23 +02:00
// Notes
QDockWidget *dockNotes;
CodeEditor *Notes_Widget;
// Recent files
std::vector<QString> recentFiles;
QMenu* recentFilesMenu;
void updateRecentFilesMenu();
void loadRecentFiles();
void addRecentFile(const QString&);
void clearRecentFiles();
void saveRecentFiles();
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
// Utilities
void convert_MA_RI_to_dB(double *, double *, double *, double *, QString);
double getFreqScale();
double getFreqScale(QString);
void getMinMaxValues(QString, QString, qreal&, qreal&, qreal&, qreal&);
void checkFreqSettingsLimits(QString filename, double& fmin, double& fmax);
int findClosestIndex(const QList<double>&, double);
void adjust_x_axis_to_file(QString);
void adjust_y_axis_to_trace(QString, QString);
void adjust_x_axis_div();
QPointF findClosestPoint(const QList<double>&, const QList<double>&, qreal);
S-parameter viewer - Initial development (squashed) This commit contains the first draft of the user interface Read Touchstone files It was implemented a basic function to read Touchstone files. It can only read Touchstone files up to 4 ports and only S-parameter data. Please see "Touchstone Specification, Version 2.1, ratified January 26 2024 by the IBIS Open Forum": https://ibis.org/touchstone_ver2.1/ Add QScrollArea widgets to the files and traces lists Large number of files and traces are expected, so there is a need for scrollable areas in the files and traces lists. Basic plotting structure Add default behaviour when loading one single s2p A default behavior is added. When a single s2p file is selected, the program automatically displays S21, S11 and S22 Replace the "Delete" message by a trash image The delete image was taken from here https://commons.wikimedia.org/wiki/File:Delete-button.svg This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original. Read Touchstone files with more than two ports Update traces combobox depending on the selected dataset If the user has loaded data with different number of ports, the traces combobox must be refreshed each time the user changes the dataset selection. Otherwise, this may cause that the user selects a non existing trace Fix style in buttons for removing files The QPushButtons were replaced by QToolButtons. With the QPushButtons the widget was too wide Fix style in buttons for removing traces QPushButton was converted into QToolButton Delete dataset and its traces when the user decides to remove a file Remove files and traces Rework on the logic on how to remove datasets and traces After removing a file, remove the associated widgets Remove trace from Chart Update file widget position in the grid after removing Function handler for changing the color of a trace Change linestyle depending on the combo selection Set initial color of the color pickers Added a spinbox control to control the trace width It was added a spinbox that controls the width of the traces displayed. This is very convenient when a bunch of traces are being displayed and the user wants to highlight one of them easily Added function handler for controlling the x-axis A handler function was added to control the x-axis settings as the user changes the minimum, maximum or the tick interval Update traces when changing the axis settings Fix trace plotting refresh Fix frequency limits when loading a GHz range file Dockable widgets Autoadjust y-axis settings Automatically add K, delta, mu_s, m_p, MAG and MSG traces in S2P files When a Touchtone file has two ports, the stability metrics are automatically computed and added to the dataset Add marker table feature It was added a new dock consisting on a marker table and some widgets for its management Add dot marker and vertical lines in the QChart Make case insensitive the frequency scale Files were found were the frequency scale is all in capital letters. This creates a problem when reading the spar data. This commit fixes this by putting the frequency scale in lower case Auto adjust x-axis when changing the units Put x_div values as a ComboBox It makes no much sense in having a decimal spinbox for defining the tick interval. It leads to decimal ticks. It's better to have a closed list of possible values y axis tick in combobox Fix vertical line markers Fix bad "About Qt" connection The "About Qt" message was not properly connected. As a consequence, when the user went to "Help-> About Qt..." nothing showed up. This commit is intended to fix this by connecting the menu with the handler as it's done in the filter design tool Link S-parameter viewer to Qucs-S Add Re{Zin}, Im{Zin} traces to s1p and s2p files Hide y-axis units It makes no much sense for now to have it since it may happen that the y-axis represent dB, Ohm or simply its unitless (e.g. K, mu, ...) Fix segfault when removing one single file In previous commits, it was observed a segfault when removing one single s-par file. This happened because the program was freeing widgets already freed. This situation is avoided by ordering the list of widgets to remove Autoadjust y-axis Remove widgets for marker placement They are actually not needed. The SpinBox and the combo with units just add clutter. The user can set the marker freq once added Update x-axis limits after removing file Increase maximum x-ticks Get suffix using Qt method This is more robust than the previous approach Fix frequency scale in markers Enable drag and drop to open files Fix segfault when removing file Readjust frequency limits when dataset has no traces Fix read touchstone Files were found whose header contains no ! Fix initial marker step Fix autoscale y-axis Prevent docks from closing It makes no sense the user can close the docks Solve infinite loop when fmax=3000 [unit] Implemented button for removing all files on a row Implement button for removing all markers on a row
2024-09-08 08:33:53 +02:00
double getFreqFromText(QString);
};
#endif