From f6d86ddd0a8d2b389ad233efeea4c9fcff8c6a1a Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Mon, 6 Jan 2025 10:13:15 +0300 Subject: [PATCH 1/2] Show Symbol property for some devices --- qucs/components/componentdialog.cpp | 14 ++++++++++++-- qucs/components/componentdialog.h | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/qucs/components/componentdialog.cpp b/qucs/components/componentdialog.cpp index ca9439912..4f94f71e8 100644 --- a/qucs/components/componentdialog.cpp +++ b/qucs/components/componentdialog.cpp @@ -324,6 +324,10 @@ ComponentDialog::ComponentDialog(Component* schematicComponent, Schematic* schem component = schematicComponent; document = schematic; + // TODO: Hack; This list holds the devices with valid "Symbol" property + excludeList<<"Diode"<<"MCROSS"<<"MTEE" + <<"R"<<"C"<<"Buf"<<"Inv"; + // qDebug() << component->Model; restoreGeometry(_settings::Get().item("ComponentDialog/geometry")); @@ -635,8 +639,13 @@ void ComponentDialog::updatePropertyTable(const Component* updateComponent) continue; /* TODO: ***HACK*** to be fixed */ - if (property->Name == "Symbol" || property->Name == "Values") + if (property->Name == "Values") continue; + if (property->Name == "Symbol") { + QString model = updateComponent->Model; + // HACK: Symbol property may be valid + if (!excludeList.contains(model)) continue; + } propertyTable->setRowCount(propertyTable->rowCount() + 1); propertyTable->setItem(row, 0, new QTableWidgetItem(property->Name, LabelCell)); @@ -797,7 +806,8 @@ void ComponentDialog::slotApplyButton() continue; /* TODO: ***HACK*** to be fixed */ - if (property->Name == "Symbol") + if (property->Name == "Symbol" && + !excludeList.contains(component->Model)) continue; else diff --git a/qucs/components/componentdialog.h b/qucs/components/componentdialog.h index fd43b0396..7cb95dc34 100644 --- a/qucs/components/componentdialog.h +++ b/qucs/components/componentdialog.h @@ -83,6 +83,9 @@ private slots: QHash, QString> sweepTypeSpecialLabels; QHash sweepTypeEnabledParams; QHash paramsHiddenBySim; + + // TODO: Hack; This list holds the devices with valid "Symbol" property + QStringList excludeList; // TODO: It would be better for simulations with sweeps to have a flag saying so. bool isEquation; From 7a6813c4c1c2b58889c553daa901b6f28ae27b6a Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Mon, 6 Jan 2025 10:15:33 +0300 Subject: [PATCH 2/2] Add CD4069 device model --- library/Digital_CD.lib | 63 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 4 deletions(-) diff --git a/library/Digital_CD.lib b/library/Digital_CD.lib index 737b16e77..4640fe788 100644 --- a/library/Digital_CD.lib +++ b/library/Digital_CD.lib @@ -1196,7 +1196,6 @@ X1 _net7 _net8 _net9 _net10 _net0 _net1 _net2 _net3 _net4 _net5 _net6 _net11 _ne -CD4066 CMOS Quad Bilateral Switch Component Level Model @@ -1211,8 +1210,8 @@ Sub:X1 _net0 _net1 _net2 _net3 _net4 gnd Type="CD4066_cir" * Helmut Sennewald @LTspice * Transistor models by kcin_melnick * -* C I O Vd Vs -.SUBCKT CD4066B 2 11 4 10 7 +* C I O Vdd Vss +.SUBCKT CD4066B 2 11 4 10 7 X1 2 6 10 7 INVERT X2 6 1 10 7 INVERT M1 14 6 7 7 CD4007N @@ -1222,7 +1221,7 @@ M4 11 1 4 14 CD4007N M8 11 6 4 10 CD4007P * .SUBCKT INVERT 1 2 3 4 -* Inverter In Out Vcc Vss +* Inverter In Out Vdd Vss M1 2 1 3 3 CD4007P M2 2 1 4 4 CD4007N .ENDS INVERT @@ -1271,3 +1270,59 @@ X1 _net0 _net1 _net2 _net3 _net4 CD4066B <.PortSym 20 30 5 0 VSS> + + + +Unbuffered Inverter +Component Level Model + + +.Def:Digital_CD_CD4069UB _net0 _net1 _net2 _net3 +Sub:X1 _net0 _net1 _net2 _net3 gnd Type="CD4069UB_cir" +.Def:End + + + +* CD4069UB CMOS HEX INVERTER +.SUBCKT CD4069UB A Y VDD VSS +* +D1 GND A D4069 +D2 A VDD D4069 +Rg A 1 100 +M2 Y 1 VSS VSS CD4069BN +M3 Y 1 VDD VDD CD4069BP +* +.MODEL CD4069BN NMOS (LEVEL=1 VTO=2.1 KP=2.9M GAMMA=3.97U ++ PHI=.75 LAMBDA=1.87M RD=20.2 RS=184.1 IS=31.2F PB=.8 MJ=.46 ++ CBD=47.6P CBS=57.2P CGSO=70.2N CGDO=58.5N CGBO=96.3N) +* +.MODEL CD4069BP PMOS (LEVEL=1 VTO=-2.9 KP=2M GAMMA=3.97U ++ PHI=.75 LAMBDA=1.87M RD=28.2 RS=145.2 IS=31.2F PB=.8 MJ=.46 ++ CBD=47.6P CBS=57.2P CGSO=70.2N CGDO=58.5N CGBO=96.3N) +* +.model D4069 D(Is=1e-14 N=1.5 Rs=10 Cjo=2p) +* +.ENDS 4069UB + +.SUBCKT Digital_CD_CD4069UB gnd _net0 _net1 _net2 _net3 +X1 _net0 _net1 _net2 _net3 CD4069UB +.ENDS + + + + + + + + + + + <.PortSym -20 0 1 0 A> + <.PortSym 40 0 2 180 Y> + + + <.PortSym 10 20 4 0 VSS> + <.PortSym 10 -20 3 0 VDD> + <.ID 39 14 Y> + +