mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
Merge pull request #648 from ra3xdh/rflayout_465
Add Qucs-RFlayout integration
This commit is contained in:
commit
0d8fdbefd4
@ -374,6 +374,13 @@ QucsSettingsDialog::QucsSettingsDialog(QucsApp *parent)
|
|||||||
locationsGrid->addWidget(OpenVAFButt, 5, 2);
|
locationsGrid->addWidget(OpenVAFButt, 5, 2);
|
||||||
connect(OpenVAFButt, SIGNAL(clicked()), SLOT(slotOpenVAFDirBrowse()));
|
connect(OpenVAFButt, SIGNAL(clicked()), SLOT(slotOpenVAFDirBrowse()));
|
||||||
|
|
||||||
|
locationsGrid->addWidget(new QLabel(tr("RF Layout Path:"), locationsTab) ,6,0);
|
||||||
|
RFLayoutEdit = new QLineEdit(locationsTab);
|
||||||
|
locationsGrid->addWidget(RFLayoutEdit,6,1);
|
||||||
|
QPushButton *RFLButt = new QPushButton("Browse");
|
||||||
|
locationsGrid->addWidget(RFLButt, 6, 2);
|
||||||
|
connect(RFLButt, SIGNAL(clicked()), SLOT(slotRFLayoutDirBrowse()));
|
||||||
|
|
||||||
|
|
||||||
// the pathsTableWidget displays the path list
|
// the pathsTableWidget displays the path list
|
||||||
pathsTableWidget = new QTableWidget(locationsTab);
|
pathsTableWidget = new QTableWidget(locationsTab);
|
||||||
@ -394,20 +401,20 @@ QucsSettingsDialog::QucsSettingsDialog(QucsApp *parent)
|
|||||||
pathsTableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
pathsTableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||||
connect(pathsTableWidget, SIGNAL(cellClicked(int,int)), SLOT(slotPathTableClicked(int,int)));
|
connect(pathsTableWidget, SIGNAL(cellClicked(int,int)), SLOT(slotPathTableClicked(int,int)));
|
||||||
connect(pathsTableWidget, SIGNAL(itemSelectionChanged()), SLOT(slotPathSelectionChanged()));
|
connect(pathsTableWidget, SIGNAL(itemSelectionChanged()), SLOT(slotPathSelectionChanged()));
|
||||||
locationsGrid->addWidget(pathsTableWidget,6,0,3,2);
|
locationsGrid->addWidget(pathsTableWidget,7,0,3,2);
|
||||||
|
|
||||||
QPushButton *AddPathButt = new QPushButton("Add Path");
|
QPushButton *AddPathButt = new QPushButton("Add Path");
|
||||||
locationsGrid->addWidget(AddPathButt, 6, 2);
|
locationsGrid->addWidget(AddPathButt, 7, 2);
|
||||||
connect(AddPathButt, SIGNAL(clicked()), SLOT(slotAddPath()));
|
connect(AddPathButt, SIGNAL(clicked()), SLOT(slotAddPath()));
|
||||||
|
|
||||||
QPushButton *AddPathSubFolButt = new QPushButton("Add Path With SubFolders");
|
QPushButton *AddPathSubFolButt = new QPushButton("Add Path With SubFolders");
|
||||||
locationsGrid->addWidget(AddPathSubFolButt, 7, 2);
|
locationsGrid->addWidget(AddPathSubFolButt, 8, 2);
|
||||||
connect(AddPathSubFolButt, SIGNAL(clicked()), SLOT(slotAddPathWithSubFolders()));
|
connect(AddPathSubFolButt, SIGNAL(clicked()), SLOT(slotAddPathWithSubFolders()));
|
||||||
|
|
||||||
RemovePathButt = new QPushButton("Remove Path");
|
RemovePathButt = new QPushButton("Remove Path");
|
||||||
// disable button if no paths in the table are selected
|
// disable button if no paths in the table are selected
|
||||||
RemovePathButt->setEnabled(false);
|
RemovePathButt->setEnabled(false);
|
||||||
locationsGrid->addWidget(RemovePathButt , 8, 2);
|
locationsGrid->addWidget(RemovePathButt , 9, 2);
|
||||||
connect(RemovePathButt, SIGNAL(clicked()), SLOT(slotRemovePath()));
|
connect(RemovePathButt, SIGNAL(clicked()), SLOT(slotRemovePath()));
|
||||||
|
|
||||||
// create a copy of the current global path list
|
// create a copy of the current global path list
|
||||||
@ -468,6 +475,7 @@ QucsSettingsDialog::QucsSettingsDialog(QucsApp *parent)
|
|||||||
ascoEdit->setText(QucsSettings.AscoBinDir.canonicalPath());
|
ascoEdit->setText(QucsSettings.AscoBinDir.canonicalPath());
|
||||||
octaveEdit->setText(QucsSettings.OctaveExecutable);
|
octaveEdit->setText(QucsSettings.OctaveExecutable);
|
||||||
OpenVAFEdit->setText(QucsSettings.OpenVAFExecutable);
|
OpenVAFEdit->setText(QucsSettings.OpenVAFExecutable);
|
||||||
|
RFLayoutEdit->setText(QucsSettings.RFLayoutExecutable);
|
||||||
|
|
||||||
|
|
||||||
resize(300, 200);
|
resize(300, 200);
|
||||||
@ -667,6 +675,7 @@ void QucsSettingsDialog::slotApply()
|
|||||||
QucsSettings.AscoBinDir.setPath(ascoEdit->text());
|
QucsSettings.AscoBinDir.setPath(ascoEdit->text());
|
||||||
QucsSettings.OctaveExecutable = octaveEdit->text();
|
QucsSettings.OctaveExecutable = octaveEdit->text();
|
||||||
QucsSettings.OpenVAFExecutable = OpenVAFEdit->text();
|
QucsSettings.OpenVAFExecutable = OpenVAFEdit->text();
|
||||||
|
QucsSettings.RFLayoutExecutable = RFLayoutEdit->text();
|
||||||
|
|
||||||
if (QucsSettings.IgnoreFutureVersion != checkLoadFromFutureVersions->isChecked())
|
if (QucsSettings.IgnoreFutureVersion != checkLoadFromFutureVersions->isChecked())
|
||||||
{
|
{
|
||||||
@ -1010,12 +1019,21 @@ void QucsSettingsDialog::slotOctaveDirBrowse()
|
|||||||
void QucsSettingsDialog::slotOpenVAFDirBrowse()
|
void QucsSettingsDialog::slotOpenVAFDirBrowse()
|
||||||
{
|
{
|
||||||
QString d = QFileDialog::getOpenFileName(this, tr("Select the OpenVAF executable"),
|
QString d = QFileDialog::getOpenFileName(this, tr("Select the OpenVAF executable"),
|
||||||
octaveEdit->text(), "All files (*)");
|
OpenVAFEdit->text(), "All files (*)");
|
||||||
|
|
||||||
if(!d.isEmpty())
|
if(!d.isEmpty())
|
||||||
OpenVAFEdit->setText(d);
|
OpenVAFEdit->setText(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QucsSettingsDialog::slotRFLayoutDirBrowse()
|
||||||
|
{
|
||||||
|
QString d = QFileDialog::getOpenFileName(this, tr("Select the Qucs-RFLayout executable"),
|
||||||
|
RFLayoutEdit->text(), "All files (*)");
|
||||||
|
|
||||||
|
if(!d.isEmpty())
|
||||||
|
RFLayoutEdit->setText(d);
|
||||||
|
}
|
||||||
|
|
||||||
/*! \brief (seems unused at present)
|
/*! \brief (seems unused at present)
|
||||||
*/
|
*/
|
||||||
void QucsSettingsDialog::slotPathTableClicked(int row, int col)
|
void QucsSettingsDialog::slotPathTableClicked(int row, int col)
|
||||||
|
@ -71,6 +71,7 @@ private slots:
|
|||||||
void slotAscoDirBrowse();
|
void slotAscoDirBrowse();
|
||||||
void slotOctaveDirBrowse();
|
void slotOctaveDirBrowse();
|
||||||
void slotOpenVAFDirBrowse();
|
void slotOpenVAFDirBrowse();
|
||||||
|
void slotRFLayoutDirBrowse();
|
||||||
|
|
||||||
void slotAddPath();
|
void slotAddPath();
|
||||||
void slotAddPathWithSubFolders();
|
void slotAddPathWithSubFolders();
|
||||||
@ -91,7 +92,7 @@ public:
|
|||||||
QPushButton *FontButton, *AppFontButton, *TextFontButton, *BGColorButton;
|
QPushButton *FontButton, *AppFontButton, *TextFontButton, *BGColorButton;
|
||||||
QLineEdit *LargeFontSizeEdit, *undoNumEdit, *editorEdit, *Input_Suffix,
|
QLineEdit *LargeFontSizeEdit, *undoNumEdit, *editorEdit, *Input_Suffix,
|
||||||
*Input_Program, *homeEdit, *admsXmlEdit, *ascoEdit, *octaveEdit,
|
*Input_Program, *homeEdit, *admsXmlEdit, *ascoEdit, *octaveEdit,
|
||||||
*OpenVAFEdit;
|
*OpenVAFEdit, *RFLayoutEdit;
|
||||||
QTableWidget *fileTypesTableWidget, *pathsTableWidget;
|
QTableWidget *fileTypesTableWidget, *pathsTableWidget;
|
||||||
QStandardItemModel *model;
|
QStandardItemModel *model;
|
||||||
QPushButton *ColorComment, *ColorString, *ColorInteger,
|
QPushButton *ColorComment, *ColorString, *ColorInteger,
|
||||||
|
@ -171,6 +171,11 @@ bool loadSettings()
|
|||||||
} else {
|
} else {
|
||||||
QucsSettings.OpenVAFExecutable = "openvaf" + QString(executableSuffix);
|
QucsSettings.OpenVAFExecutable = "openvaf" + QString(executableSuffix);
|
||||||
}
|
}
|
||||||
|
if(settings.contains("RFLayoutExecutable")) {
|
||||||
|
QucsSettings.RFLayoutExecutable = settings.value("RFLayoutExecutable").toString();
|
||||||
|
} else {
|
||||||
|
QucsSettings.RFLayoutExecutable = "qucsrflayout" + QString(executableSuffix);
|
||||||
|
}
|
||||||
if(settings.contains("QucsHomeDir"))
|
if(settings.contains("QucsHomeDir"))
|
||||||
if(settings.value("QucsHomeDir").toString() != "")
|
if(settings.value("QucsHomeDir").toString() != "")
|
||||||
QucsSettings.QucsHomeDir.setPath(settings.value("QucsHomeDir").toString());
|
QucsSettings.QucsHomeDir.setPath(settings.value("QucsHomeDir").toString());
|
||||||
@ -272,6 +277,7 @@ bool saveApplSettings()
|
|||||||
// settings.setValue("OctaveBinDir", QucsSettings.OctaveBinDir.canonicalPath());
|
// settings.setValue("OctaveBinDir", QucsSettings.OctaveBinDir.canonicalPath());
|
||||||
settings.setValue("OctaveExecutable",QucsSettings.OctaveExecutable);
|
settings.setValue("OctaveExecutable",QucsSettings.OctaveExecutable);
|
||||||
settings.setValue("OpenVAFExecutable",QucsSettings.OpenVAFExecutable);
|
settings.setValue("OpenVAFExecutable",QucsSettings.OpenVAFExecutable);
|
||||||
|
settings.setValue("RFLayoutExecutable",QucsSettings.RFLayoutExecutable);
|
||||||
settings.setValue("QucsHomeDir", QucsSettings.QucsHomeDir.canonicalPath());
|
settings.setValue("QucsHomeDir", QucsSettings.QucsHomeDir.canonicalPath());
|
||||||
settings.setValue("IgnoreVersion", QucsSettings.IgnoreFutureVersion);
|
settings.setValue("IgnoreVersion", QucsSettings.IgnoreFutureVersion);
|
||||||
settings.setValue("GraphAntiAliasing", QucsSettings.GraphAntiAliasing);
|
settings.setValue("GraphAntiAliasing", QucsSettings.GraphAntiAliasing);
|
||||||
|
@ -91,6 +91,7 @@ struct tQucsSettings {
|
|||||||
unsigned int NProcs; // Number of processors for Xyce
|
unsigned int NProcs; // Number of processors for Xyce
|
||||||
QString OctaveExecutable; // OctaveExecutable location
|
QString OctaveExecutable; // OctaveExecutable location
|
||||||
QString QucsOctave; // OUCS_OCTAVE variable
|
QString QucsOctave; // OUCS_OCTAVE variable
|
||||||
|
QString RFLayoutExecutable;
|
||||||
|
|
||||||
// registered filename extensions with program to open the file
|
// registered filename extensions with program to open the file
|
||||||
QStringList FileTypes;
|
QStringList FileTypes;
|
||||||
|
@ -355,7 +355,7 @@ public:
|
|||||||
*distrHor, *distrVert, *selectAll, *callMatch, *changeProps,
|
*distrHor, *distrVert, *selectAll, *callMatch, *changeProps,
|
||||||
*addToProj, *editFind, *insEntity, *selectMarker,
|
*addToProj, *editFind, *insEntity, *selectMarker,
|
||||||
*createLib, *importData, *graph2csv, *createPkg, *extractPkg,
|
*createLib, *importData, *graph2csv, *createPkg, *extractPkg,
|
||||||
*callAtt, *centerHor, *centerVert, *loadModule, *buildModule, *callPwrComb;
|
*callAtt, *centerHor, *centerVert, *loadModule, *buildModule, *callPwrComb, *callRFLayout;
|
||||||
|
|
||||||
QAction *helpQucsIndex;
|
QAction *helpQucsIndex;
|
||||||
QAction *simSettings;
|
QAction *simSettings;
|
||||||
@ -406,6 +406,7 @@ public slots:
|
|||||||
void slotCallMatch();
|
void slotCallMatch();
|
||||||
void slotCallAtt();
|
void slotCallAtt();
|
||||||
void slotCallPwrComb();
|
void slotCallPwrComb();
|
||||||
|
void slotCallRFLayout();
|
||||||
void slotHelpIndex(); // shows a HTML docu: Help Index
|
void slotHelpIndex(); // shows a HTML docu: Help Index
|
||||||
void slotHelpQucsIndex();
|
void slotHelpQucsIndex();
|
||||||
void slotGettingStarted(); // shows a HTML docu: Getting started
|
void slotGettingStarted(); // shows a HTML docu: Getting started
|
||||||
|
@ -890,7 +890,6 @@ void QucsApp::slotCallPwrComb()
|
|||||||
launchTool(QUCS_NAME "powercombining", "power combining calculation",QStringList());
|
launchTool(QUCS_NAME "powercombining", "power combining calculation",QStringList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief launch an external application passing arguments
|
* \brief launch an external application passing arguments
|
||||||
*
|
*
|
||||||
@ -930,6 +929,64 @@ void QucsApp::launchTool(const QString& prog, const QString& progDesc, const QSt
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void QucsApp::slotCallRFLayout()
|
||||||
|
{
|
||||||
|
QString input_file, netlist_file, odir;
|
||||||
|
if (!isTextDocument(DocumentTab->currentWidget())) {
|
||||||
|
Schematic *sch = (Schematic*)DocumentTab->currentWidget();
|
||||||
|
if(sch->fileSuffix() == "dpl") {
|
||||||
|
QMessageBox::critical(this,tr("Error"),
|
||||||
|
tr("Layouting of display pages is not supported!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
input_file = sch->DocName;
|
||||||
|
QFileInfo inf(sch->DocName);
|
||||||
|
odir = inf.absolutePath();
|
||||||
|
netlist_file = inf.absolutePath() + QDir::separator()
|
||||||
|
+ inf.baseName() + ".net";
|
||||||
|
QFile f(netlist_file);
|
||||||
|
if (!f.open(QIODevice::WriteOnly)) {
|
||||||
|
QMessageBox::critical(this, tr("Error"), tr("Cannot write netlist!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QTextStream stream(&f);
|
||||||
|
QStringList Collect;
|
||||||
|
QPlainTextEdit *ErrText = new QPlainTextEdit(); //dummy
|
||||||
|
int pNum = sch->prepareNetlist(stream, Collect, ErrText);
|
||||||
|
if (!sch->isAnalog) {
|
||||||
|
QMessageBox::critical(this, tr("Error"), tr("Digital schematic not supported!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
stream << '\n';
|
||||||
|
sch->createNetlist(stream, pNum);
|
||||||
|
f.close();
|
||||||
|
} else {
|
||||||
|
QMessageBox::critical(this,tr("Error"),
|
||||||
|
tr("Layouting of text documents is not supported!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QProcess *tool = new QProcess();
|
||||||
|
QStringList args;
|
||||||
|
args.append("-G");
|
||||||
|
args.append("-i");
|
||||||
|
args.append(input_file);
|
||||||
|
args.append("-n");
|
||||||
|
args.append(netlist_file);
|
||||||
|
args.append("-o");
|
||||||
|
args.append(odir);
|
||||||
|
tool->start(QucsSettings.RFLayoutExecutable,args);
|
||||||
|
|
||||||
|
if(!tool->waitForStarted(1000) ) {
|
||||||
|
QMessageBox::critical(this, tr("Error"),
|
||||||
|
tr("Cannot start Qucs-RFLayout: \n%1")
|
||||||
|
.arg(QucsSettings.RFLayoutExecutable));
|
||||||
|
delete tool;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
connect(this, SIGNAL(signalKillEmAll()), tool, SLOT(kill()));
|
||||||
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
void QucsApp::slotHelpIndex()
|
void QucsApp::slotHelpIndex()
|
||||||
{
|
{
|
||||||
|
@ -537,6 +537,12 @@ void QucsApp::initActions()
|
|||||||
callPwrComb->setWhatsThis(tr("Power combining\n\nStarts power combining calculation program"));
|
callPwrComb->setWhatsThis(tr("Power combining\n\nStarts power combining calculation program"));
|
||||||
connect(callPwrComb, SIGNAL(triggered()), SLOT(slotCallPwrComb()));
|
connect(callPwrComb, SIGNAL(triggered()), SLOT(slotCallPwrComb()));
|
||||||
|
|
||||||
|
callRFLayout = new QAction(tr("RF Layout"), this);
|
||||||
|
callRFLayout->setShortcut(tr("Ctrl+8"));
|
||||||
|
callRFLayout->setStatusTip(tr("Starts Qucs-RFLayout"));
|
||||||
|
callRFLayout->setWhatsThis(tr("Power combining\n\nStarts power combining calculation program"));
|
||||||
|
connect(callRFLayout, SIGNAL(triggered()), SLOT(slotCallRFLayout()));
|
||||||
|
|
||||||
simulate = new QAction(QIcon((":/bitmaps/svg/gear.svg")), tr("Simulate"), this);
|
simulate = new QAction(QIcon((":/bitmaps/svg/gear.svg")), tr("Simulate"), this);
|
||||||
simulate->setShortcut(Qt::Key_F2);
|
simulate->setShortcut(Qt::Key_F2);
|
||||||
simulate->setStatusTip(tr("Simulates the current schematic"));
|
simulate->setStatusTip(tr("Simulates the current schematic"));
|
||||||
@ -774,6 +780,7 @@ void QucsApp::initMenuBar()
|
|||||||
toolMenu->addAction(callMatch);
|
toolMenu->addAction(callMatch);
|
||||||
toolMenu->addAction(callAtt);
|
toolMenu->addAction(callAtt);
|
||||||
toolMenu->addAction(callPwrComb);
|
toolMenu->addAction(callPwrComb);
|
||||||
|
toolMenu->addAction(callRFLayout);
|
||||||
toolMenu->addSeparator();
|
toolMenu->addSeparator();
|
||||||
|
|
||||||
cmMenu = new QMenu(tr("Compact modelling"));
|
cmMenu = new QMenu(tr("Compact modelling"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user