Skip to content

Commit

Permalink
preview : draw SUBST & Pac, add 2D & true 3D depending on format, add…
Browse files Browse the repository at this point in the history
… transparency, add themes
  • Loading branch information
thomaslepoix committed Sep 23, 2024
1 parent bca9cf8 commit 84dfd99
Show file tree
Hide file tree
Showing 8 changed files with 385 additions and 151 deletions.
27 changes: 26 additions & 1 deletion doc/qucsrflayout.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Use directory as output (default current directory).
\fB-f\fR \fIFORMAT\fR
Use format as output layout format.

FORMAT can be:
\fIFORMAT\fR can be:
.PD 0
.RS
.TP
Expand Down Expand Up @@ -111,6 +111,31 @@ Order metal resolution mesh lines by edge coordinate. Default is grouped by comp
.TP
\fB--oems-pkg\fR
Look for 'openems' and 'csxcad' Octave packages. Requires properly packaged Octaves packages such as 'octave-openems' and 'octave-csxcad' from Debian repositories.
.TP
\fB--gui-theme\fR \fITHEME\fR
Choose GUI color theme.

\fITHEME\fR can be:
.PD 0
.RS
.TP
\fBFlashy\fR (default theme)
.".TP
." \fBCAD\fR
.TP
\fBHighContrast\fR
.TP
\fBHighContrast2\fR
.TP
\fBQucsGUI\fR
.TP
\fBQucsIcon\fR
.TP
\fBSolvespace\fR
.TP
\fBTranscalc\fR
.RE
.PD

.SH NOTES
Microstrip components are supported except the lange coupler. Coplanar waveguide components are not yet. Any other component is not supported.
Expand Down
3 changes: 3 additions & 0 deletions src/data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ class Data {
bool oems_sort_metalresmesh;
bool oems_pkg;

#ifndef QRFL_MINIMAL
std::string gui_theme;
#endif // QRFL_MINIMAL
Data();

void reset();
Expand Down
19 changes: 18 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,19 @@ int main(int argc, char* argv[]) {
" Default is grouped by component label.\n"
" --oems-pkg Look for 'openems' and 'csxcad' Octave packages. Requires properly\n"
" packaged Octaves packages such as 'octave-openems' and 'octave-csxcad'\n"
" from Debian repositories.\n";
" from Debian repositories.\n"
#ifndef QRFL_MINIMAL
" --gui-theme THEME Choose GUI color theme.\n"
" THEME can be:\n"
" - Flashy (default theme)\n"
" - HighContrast\n"
" - HighContrast2\n"
" - QucsGUI\n"
" - QucsIcon\n"
" - Solvespace\n"
" - Transcalc\n"
#endif // QRFL_MINIMAL
;
return EXIT_SUCCESS;
} else if(string(argv[i])=="--version") {
cout << "Qucs-RFlayout " << VERSION
Expand Down Expand Up @@ -193,6 +205,11 @@ int main(int argc, char* argv[]) {
data.oems_sort_metalresmesh=true;
} else if(string(argv[i])=="--oems-pkg") {
data.oems_pkg=true;
#ifndef QRFL_MINIMAL
} else if(string(argv[i])=="--gui-theme" && argv[i+1]) {
i++;
data.gui_theme=string(argv[i]);
#endif // QRFL_MINIMAL
} else if(string(argv[i])=="-v" || string(argv[i])=="--verbose") {
verbose=true;
#ifndef QRFL_MINIMAL
Expand Down
17 changes: 17 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ MainWindow::MainWindow(Data& _data, QWidget* parent) :
ui->le_oems_timeres->setText(QString::number(data.oems_timeres));
ui->cb_oems_pkg->setCheckState(_data.oems_pkg ? Qt::Checked : Qt::Unchecked);
ui->cb_oems_sort_metalresmesh->setCheckState(_data.oems_sort_metalresmesh ? Qt::Checked : Qt::Unchecked);
ui->cb_transparency->setCheckState(Qt::Unchecked);
ui->glw_preview->setTheme(_data.gui_theme);
ui->tw_actions->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);

for(std::tuple<unsigned long, std::string, std::string> arg : data.port_shift_args) {
Expand Down Expand Up @@ -190,6 +192,12 @@ void MainWindow::write() {
//******************************************************************************
void MainWindow::on_cb_format_currentTextChanged(QString const& out_format) {
ui->gb_oems->setEnabled((out_format==".m") ? true : false);
ui->glw_preview->setF2D((out_format==".kicad_pcb"
||out_format==".kicad_mod"
||out_format==".lht"
||out_format==".svg")
? true : false);
ui->glw_preview->resetView();
data.out_format=out_format.toStdString();
}

Expand All @@ -208,6 +216,15 @@ void MainWindow::on_cb_specify_netlist_stateChanged(int const state) {
}
}

//******************************************************************************
void MainWindow::on_cb_transparency_stateChanged(int const state) {
if(state==Qt::Unchecked) {
ui->glw_preview->setTransparency(false);
} else if(state==Qt::Checked) {
ui->glw_preview->setTransparency(true);
}
}

//******************************************************************************
void MainWindow::on_cb_oems_pkg_stateChanged(int const state) {
if(state==Qt::Unchecked) {
Expand Down
1 change: 1 addition & 0 deletions src/mainwindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class MainWindow : public QMainWindow, public Loggable {
private slots:
void on_cb_format_currentTextChanged(QString const& out_format);
void on_cb_specify_netlist_stateChanged(int const state);
void on_cb_transparency_stateChanged(int const state);
void on_cb_oems_pkg_stateChanged(int const state);
void on_cb_oems_sort_metalresmesh_stateChanged(int const state);
void on_le_oems_end_criteria_textChanged(QString const& oems_end_criteria);
Expand Down
32 changes: 31 additions & 1 deletion src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,39 @@ Should be a component label</string>
</property>
</widget>
</item>

<item row="2" column="0" rowspan="16" colspan="2">
<widget class="Preview" name="glw_preview" native="true"/>
<widget class="QFrame" name="f_preview">
<layout class="QGridLayout" name="gl_preview">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0" rowspan="1" colspan="1">
<widget class="QCheckBox" name="cb_transparency">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Transparency</string>
</property>
</widget>
</item>
<item row="1" column="0" rowspan="15" colspan="2">
<widget class="Preview" name="glw_preview" native="true"/>
</item>
</layout>
</widget>
</item>

<item row="0" column="2" colspan="2">
<widget class="QPushButton" name="pb_browse_in">
<property name="text">
Expand Down
Loading

0 comments on commit 84dfd99

Please sign in to comment.