Skip to content

Commit

Permalink
Fixed different bugs in XspiceGeneric
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3xdh committed Jan 24, 2016
1 parent d832a8a commit 14c635c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
12 changes: 6 additions & 6 deletions qucs/qucs/spicecomponents/xspicegeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

XspiceGeneric::XspiceGeneric()
{
Description = QObject::tr("SPICE netlist file");
Description = QObject::tr("XSPICE generic device");
// Property descriptions not needed, but must not be empty !
Props.append(new Property("Npins", "2", true, tr("Number of pins")));
Props.append(new Property("Model", "generic_model", false, tr(".MODEL definition reference")));
Props.append(new Property("Npins", "2", true, QObject::tr("Number of pins")));
Props.append(new Property("Model", "generic_model", false, QObject::tr(".MODEL definition reference")));

Model = "XSPICE_A";
SpiceModel = "A";
Expand Down Expand Up @@ -92,7 +92,7 @@ void XspiceGeneric::createSymbol()

i = 1;
int y = 15-h;
while(i<No) { // add ports lines and numbers
while(i<=No) { // add ports lines and numbers
Lines.append(new Line(-40, y,-HALFWIDTH, y,QPen(Qt::darkBlue,2)));
Ports.append(new Port(-40, y));
// tmp = PortNames.section(',', i, i).mid(4);
Expand All @@ -101,7 +101,7 @@ void XspiceGeneric::createSymbol()
Texts.append(new Text(-40-w, y-fHeight-2, tmp)); // text right-aligned
i++;

// if(i == No) break; // if odd number of ports there will be one port less on the right side
if(i == No+1) break; // if odd number of ports there will be one port less on the right side
Lines.append(new Line(HALFWIDTH, y, 40, y,QPen(Qt::darkBlue,2)));
Ports.append(new Port( 40, y));
tmp = QString::number(i);
Expand Down Expand Up @@ -131,7 +131,7 @@ QString XspiceGeneric::netlist()

QString XspiceGeneric::spice_netlist(bool)
{
QString s = SpiceModel;
QString s = spicecompat::check_refdes(Name,SpiceModel);

foreach(Port *pp,Ports) {
s += " " + spicecompat::normalize_node_name(pp->Connection->Name);
Expand Down
8 changes: 3 additions & 5 deletions qucs/qucs/spicecomponents/xspicegeneric.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,16 @@
* *
***************************************************************************/

#ifndef XspiceGeneric_H
#define XspiceGeneric_H
#ifndef XSPICEGENERIC_H
#define XSPICEGENERIC_H
#include "components/component.h"

#include <QObject>
#include <QDateTime>

class QProcess;
class QTextStream;
class QString;

class XspiceGeneric : public QObject, public MultiViewComponent {
class XspiceGeneric : public MultiViewComponent {
public:
XspiceGeneric();
~XspiceGeneric() {};
Expand Down

0 comments on commit 14c635c

Please sign in to comment.