diff --git a/qucs/components/iexp.cpp b/qucs/components/iexp.cpp index 2ba26d5ae..90281e64f 100644 --- a/qucs/components/iexp.cpp +++ b/qucs/components/iexp.cpp @@ -88,11 +88,9 @@ Element* iExp::info(QString& Name, char* &BitmapFile, bool getNewOne) QString iExp::spice_netlist(bool) { QString s = spicecompat::check_refdes(Name,SpiceModel); - for (Port *p1 : Ports) { - QString nam = p1->Connection->Name; - if (nam=="gnd") nam = "0"; - s += " "+ nam; // node names - } + + s += " " + spicecompat::normalize_node_name(Ports.at(1)->Connection->Name); + s += " " + spicecompat::normalize_node_name(Ports.at(0)->Connection->Name); QString U1= spicecompat::normalize_value(Props.at(0)->Value); QString U2 = spicecompat::normalize_value(Props.at(1)->Value); diff --git a/qucs/components/ipulse.cpp b/qucs/components/ipulse.cpp index 72fd07c67..e553e9222 100644 --- a/qucs/components/ipulse.cpp +++ b/qucs/components/ipulse.cpp @@ -93,11 +93,8 @@ QString iPulse::spice_netlist(bool) { QString s = spicecompat::check_refdes(Name,SpiceModel); - for (Port *p1 : Ports) { - QString nam = p1->Connection->Name; - if (nam=="gnd") nam = "0"; - s += " "+ nam; // node names - } + s += " " + spicecompat::normalize_node_name(Ports.at(1)->Connection->Name); + s += " " + spicecompat::normalize_node_name(Ports.at(0)->Connection->Name); double T1,T2, TrVal, TfVal, Pw,fac,Per; QString unit; diff --git a/qucs/components/irect.cpp b/qucs/components/irect.cpp index ea721b104..4166224b2 100644 --- a/qucs/components/irect.cpp +++ b/qucs/components/irect.cpp @@ -60,7 +60,7 @@ iRect::iRect() Name = "I"; SpiceModel = "I"; - Props.append(new Property("U", "1 mA", true, + Props.append(new Property("I", "1 mA", true, QObject::tr("current at high pulse"))); Props.append(new Property("TH", "1 ms", true, QObject::tr("duration of high pulses"))); diff --git a/qucs/spicecomponents/iPWL.cpp b/qucs/spicecomponents/iPWL.cpp index 1144251a8..a808c8725 100644 --- a/qucs/spicecomponents/iPWL.cpp +++ b/qucs/spicecomponents/iPWL.cpp @@ -92,38 +92,36 @@ QString iPWL::netlist() QString iPWL::spice_netlist(bool) { - QString s = spicecompat::check_refdes(Name,SpiceModel); - for (Port *p1 : Ports) { - QString nam = p1->Connection->Name; - if (nam=="gnd") nam = "0"; - s += " "+ nam+" "; // node names - } - - -QString PWL= Props.at(0)->Value; -QString Line_2= Props.at(1)->Value; -QString Line_3= Props.at(2)->Value; -QString Line_4= Props.at(3)->Value; -QString Line_5= Props.at(4)->Value; -QString Line_6= Props.at(5)->Value; -QString Line_7= Props.at(6)->Value; -QString Line_8= Props.at(7)->Value; -QString Line_9= Props.at(8)->Value; -QString Line_10= Props.at(9)->Value; - - s += QString(); - - if( PWL.length() > 0) s += QStringLiteral("%1").arg(PWL); - if( Line_2.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_2); - if( Line_3.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_3); - if( Line_4.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_4); - if( Line_5.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_5); - if( Line_6.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_6); - if( Line_7.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_7); - if( Line_8.length() > 0) s += QStringLiteral("\n%1").arg(Line_8); - if( Line_9.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_9); - if( Line_10.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_10); - s += "\n"; - - return s; + QString s = spicecompat::check_refdes(Name,SpiceModel); + + s += " " + spicecompat::normalize_node_name(Ports.at(1)->Connection->Name); + s += " " + spicecompat::normalize_node_name(Ports.at(0)->Connection->Name); + + + QString PWL= Props.at(0)->Value; + QString Line_2= Props.at(1)->Value; + QString Line_3= Props.at(2)->Value; + QString Line_4= Props.at(3)->Value; + QString Line_5= Props.at(4)->Value; + QString Line_6= Props.at(5)->Value; + QString Line_7= Props.at(6)->Value; + QString Line_8= Props.at(7)->Value; + QString Line_9= Props.at(8)->Value; + QString Line_10= Props.at(9)->Value; + + s += " "; + + if( PWL.length() > 0) s += QStringLiteral("%1").arg(PWL); + if( Line_2.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_2); + if( Line_3.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_3); + if( Line_4.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_4); + if( Line_5.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_5); + if( Line_6.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_6); + if( Line_7.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_7); + if( Line_8.length() > 0) s += QStringLiteral("\n%1").arg(Line_8); + if( Line_9.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_9); + if( Line_10.length() > 0 ) s += QStringLiteral("\n%1").arg(Line_10); + s += "\n"; + + return s; }