From 3237373fba3fc087963dc804ba4401e7d18fe6ed Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Thu, 19 Sep 2024 19:00:57 +0300 Subject: [PATCH] Add model sweep pattern recognition --- qucs/components/param_sweep.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qucs/components/param_sweep.cpp b/qucs/components/param_sweep.cpp index ee6142312..2a8f69a9d 100644 --- a/qucs/components/param_sweep.cpp +++ b/qucs/components/param_sweep.cpp @@ -151,11 +151,13 @@ QString Param_Sweep::getNgspiceBeforeSim(QString sim, int lvl) if (step_var == "temp" || step_var == "temper") temper_sweep = true; - if (temper_sweep) { + if (temper_sweep) { // Sweep temperature s += QString("option temp = $%1_act%2").arg(step_var).arg(nline_char); - } else if (compfound) { + } else if (compfound) { // Sweep device s += QString("alter %1 = $%2_act%3").arg(par).arg(step_var).arg(nline_char); - } else { + } else if (par.startsWith("@")) { // Sweep model + s += QString("altermod %1 = $%2_act%3").arg(par).arg(step_var).arg(nline_char); + } else { // Sweep .PARAM variable s += QString("alterparam %1 = $%2_act%3reset%3").arg(par).arg(step_var).arg(nline_char); } }