Skip to content

Commit

Permalink
Merge c085b1d into b9ae939
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-salfelder committed Jul 18, 2015
2 parents b9ae939 + c085b1d commit 8e25b30
Show file tree
Hide file tree
Showing 66 changed files with 344 additions and 129 deletions.
1 change: 1 addition & 0 deletions qucs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
# Boston, MA 02110-1301, USA.
#
ACLOCAL_AMFLAGS=-Im4

SUBDIRS = \
qucs \
Expand Down
2 changes: 2 additions & 0 deletions qucs/autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ echo "done."
echo -n "Creating config.h.in... "
autoheader
echo "done."
echo "Running libtoolize"
libtoolize || exit 1
echo -n "Creating Makefile.in(s)... "
${AUTOMAKE:-automake} -a -f -c
echo "done."
Expand Down
4 changes: 3 additions & 1 deletion qucs/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([no-define])
AM_MAINTAINER_MODE
AC_PREFIX_DEFAULT([/usr/local])
AC_CONFIG_MACRO_DIR([m4])

dnl Checks for programs.
AC_PROG_CXX(clang++ g++)
AC_PROG_CC
AC_PROG_RANLIB
AC_CHECK_TOOL(AR, ar, :)
LT_INIT()

dnl Check for debugging option.
AC_ARG_ENABLE([debug],
Expand Down Expand Up @@ -834,6 +835,7 @@ AC_CONFIG_FILES([Makefile
qucs/diagrams/Makefile
qucs/paintings/Makefile
qucs/dialogs/Makefile
qucs/sim/Makefile
translations/Makefile])

dnl Check for Git short SHA to tag version
Expand Down
9 changes: 6 additions & 3 deletions qucs/qucs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# Boston, MA 02110-1301, USA.
#

SUBDIRS = components diagrams paintings dialogs octave
SUBDIRS = components diagrams paintings dialogs octave sim

if COND_WIN32
bin_SCRIPTS = qucsdigi.bat qucsveri.bat qucsdigilib.bat
Expand All @@ -35,8 +35,8 @@ bin_PROGRAMS = qucs
MOCHEADERS = qucs.h schematic.h textdoc.h octave_window.h messagedock.h
MOCFILES = $(MOCHEADERS:.h=.moc.cpp)

qucs_SOURCES = node.cpp element.cpp qucsdoc.cpp wire.cpp mouseactions.cpp \
qucs.cpp main.cpp wirelabel.cpp qucs_init.cpp qucs_actions.cpp \
qucs_SOURCES = qucs.cpp node.cpp element.cpp qucsdoc.cpp wire.cpp mouseactions.cpp \
main.cpp wirelabel.cpp qucs_init.cpp qucs_actions.cpp \
viewpainter.cpp mnemo.cpp schematic.cpp schematic_element.cpp textdoc.cpp \
schematic_file.cpp syntax.cpp module.cpp octave_window.cpp qrc_qucs.cpp \
messagedock.cpp misc.cpp imagewriter.cpp printerwriter.cpp \
Expand All @@ -53,6 +53,9 @@ qucs_LDADD = components/libcomponents.a diagrams/libdiagrams.a \
paintings/libpaintings.a dialogs/libdialogs.a \
$(X11_LIBS) $(QT_LIBS)

# adding sim/qucsator.la does not work. this is a workaround.
qucs_LDADD+= sim/qucsator_la-qucsator.o

noinst_HEADERS = $(MOCHEADERS) main.h wire.h qucsdoc.h element.h node.h \
wirelabel.h viewpainter.h mnemo.h mouseactions.h syntax.h module.h misc.h

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/EKV26MOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void EKV26MOS::createSymbol()
x2 = 20; y2 = 30;
}

QString EKV26MOS::netlist()
QString EKV26MOS::netlist() const
{
QString s = Model+":"+Name;

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/EKV26MOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class EKV26MOS : public MultiViewComponent
static Element* info_pmos(QString&, char* &, bool getNewOne=false);
protected:
void createSymbol();
QString netlist();
QString netlist() const;
};

#endif /* EKV26MOS_H */
2 changes: 1 addition & 1 deletion qucs/qucs/components/bjt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void BJT::createSymbol()
}

// -------------------------------------------------------
QString BJT::netlist()
QString BJT::netlist() const
{
QString s = "BJT:"+Name;

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/bjt.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BJT : public Basic_BJT {

protected:
void createSymbol();
QString netlist();
QString netlist() const;
};

#endif
43 changes: 7 additions & 36 deletions qucs/qucs/components/component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,42 +611,13 @@ void Component::mirrorY()
}

// -------------------------------------------------------
QString Component::netlist()
{
QString s = Model+":"+Name;

// output all node names
foreach(Port *p1, Ports)
s += " "+p1->Connection->Name; // node names

// output all properties
for(Property *p2 = Props.first(); p2 != 0; p2 = Props.next())
if(p2->Name != "Symbol")
s += " "+p2->Name+"=\""+p2->Value+"\"";

return s + '\n';
}

// -------------------------------------------------------
QString Component::getNetlist()
/*!
* obsolete function. still used for some special components
* just indicate that it's obsolete, so the netlister knows.
*/
QString Component::netlist() const
{
switch(isActive) {
case COMP_IS_ACTIVE:
return netlist();
case COMP_IS_OPEN:
return QString("");
}

// Component is shortened.
int z=0;
QListIterator<Port *> iport(Ports);
Port *pp = iport.next();
QString Node1 = pp->Connection->Name;
QString s = "";
while (iport.hasNext())
s += "R:" + Name + "." + QString::number(z++) + " " +
Node1 + " " + iport.next()->Connection->Name + " R=\"0\"\n";
return s;
return "obsolete";
}

// -------------------------------------------------------
Expand Down Expand Up @@ -1314,7 +1285,7 @@ GateComponent::GateComponent()
}

// -------------------------------------------------------
QString GateComponent::netlist()
QString GateComponent::netlist() const
{
QString s = Model+":"+Name;

Expand Down
18 changes: 13 additions & 5 deletions qucs/qucs/components/component.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Component : public Element {

virtual Component* newOne();
virtual void recreate(Schematic*) {};
QString getNetlist();
QString getNetlist() const {return netlist();}
QString get_VHDL_Code(int);
QString get_Verilog_Code(int);
void paint(ViewPainter*);
Expand All @@ -58,7 +58,7 @@ class Component : public Element {
bool mirroredX; // is it mirrored about X axis or not
int rotated; // rotation angle divided by 90 degrees

virtual QString getSubcircuitFile() { return ""; }
virtual QString getSubcircuitFile() const { return ""; }
// set the pointer scematic associated with the component
virtual void setSchematic (Schematic* p) { containingSchematic = p; }
virtual Schematic* getSchematic () {return containingSchematic; }
Expand All @@ -69,19 +69,27 @@ class Component : public Element {
QList<Area *> Ellips;
QList<Port *> Ports;
QList<Text *> Texts;
Q3PtrList<Property> Props;
mutable //bug: Q3PtrList does not support constness
Q3PtrList<Property> Props;

#define COMP_IS_OPEN 0
#define COMP_IS_ACTIVE 1
#define COMP_IS_SHORTEN 2
bool isShort() const{return isActive==COMP_IS_SHORTEN;}
bool isOpen() const{return isActive==COMP_IS_OPEN;}
QString type() const{return Model;}
QString label() const{return Name;}
Q3PtrList<Property> const& params() const{return Props;}
QList<Port*>const& ports() const{return Ports;}
// private: // not yet
int isActive; // should it be used in simulation or not ?
int tx, ty; // upper left corner of text (position)
bool showName;
QString Model, Name;
QString Description;

protected:
virtual QString netlist();
virtual QString netlist() const;
virtual QString vhdlCode(int);
virtual QString verilogCode(int);

Expand Down Expand Up @@ -112,7 +120,7 @@ class MultiViewComponent : public Component {
class GateComponent : public MultiViewComponent {
public:
GateComponent();
QString netlist();
QString netlist() const;
QString vhdlCode(int);
QString verilogCode(int);

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/digi_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Element* Digi_Source::info(QString& Name, char* &BitmapFile, bool getNewOne)
}

// -------------------------------------------------------
QString Digi_Source::netlist()
QString Digi_Source::netlist() const
{
QString s = Model+":"+Name;

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/digi_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Digi_Source : public Component {
static Element* info(QString&, char* &, bool getNewOne=false);

protected:
QString netlist();
QString netlist() const;
QString vhdlCode(int);
QString verilogCode(int);
};
Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/ecvs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Element* ecvs::info(QString& Name, char* &BitmapFile, bool getNewOne)


// -------------------------------------------------------
QString ecvs::netlist()
QString ecvs::netlist() const
{
QString s = Model+":"+Name;

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/ecvs.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ecvs : public Component {
static Element* info(QString&, char* &, bool getNewOne=false);

protected:
QString netlist();
QString netlist() const;
};

#endif
Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/eqndefined.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Element* EqnDefined::info(QString& Name, char* &BitmapFile, bool getNewOne)
}

// -------------------------------------------------------
QString EqnDefined::netlist()
QString EqnDefined::netlist() const
{
QString s = Model+":"+Name;
QString e = "\n";
Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/eqndefined.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class EqnDefined : public MultiViewComponent {
static Element* info(QString&, char* &, bool getNewOne=false);

protected:
QString netlist();
QString netlist() const;
void createSymbol();
};

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/ground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Element* Ground::info(QString& Name, char* &BitmapFile, bool getNewOne)
}

// -------------------------------------------------------
QString Ground::netlist()
QString Ground::netlist() const
{
return QString("");
}
2 changes: 1 addition & 1 deletion qucs/qucs/components/ground.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Ground : public Component {
static Element* info(QString&, char* &, bool getNewOne=false);

protected:
QString netlist();
QString netlist() const;
};

#endif
2 changes: 1 addition & 1 deletion qucs/qucs/components/hic0_full.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ void hic0_full::createSymbol()
x2 = 30; y2 = 30;
}

QString hic0_full::netlist()
QString hic0_full::netlist() const
{
QString s = "hic0_full:"+Name;

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/hic0_full.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class hic0_full : public MultiViewComponent
static Element* info_pnp(QString&, char* &, bool getNewOne=false);
protected:
void createSymbol();
QString netlist();
QString netlist() const;
};

#endif /* hic0_full_H */
2 changes: 1 addition & 1 deletion qucs/qucs/components/hicumL0V1p2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void hicumL0V1p2::createSymbol()
x2 = 30; y2 = 30;
}

QString hicumL0V1p2::netlist()
QString hicumL0V1p2::netlist() const
{
QString s = "hicumL0V1p2:"+Name;

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/hicumL0V1p2.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class hicumL0V1p2 : public MultiViewComponent
static Element* info_pnp(QString&, char* &, bool getNewOne=false);
protected:
void createSymbol();
QString netlist();
QString netlist() const;
};

#endif /* hicumL0V1p2_H */
2 changes: 1 addition & 1 deletion qucs/qucs/components/hicumL0V1p2g.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ void hicumL0V1p2g::createSymbol()
x2 = 30; y2 = 30;
}

QString hicumL0V1p2g::netlist()
QString hicumL0V1p2g::netlist() const
{
QString s = "hicumL0V1p2g:"+Name;

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/hicumL0V1p2g.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class hicumL0V1p2g : public MultiViewComponent
static Element* info_pnp(QString&, char* &, bool getNewOne=false);
protected:
void createSymbol();
QString netlist();
QString netlist() const;
};

#endif /* hicumL0V1p2g_H */
2 changes: 1 addition & 1 deletion qucs/qucs/components/hicumL0V1p3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void hicumL0V1p3::createSymbol()
x2 = 30; y2 = 30;
}

QString hicumL0V1p3::netlist()
QString hicumL0V1p3::netlist() const
{
QString s = "hicumL0V1p3:"+Name;

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs/components/hicumL0V1p3.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class hicumL0V1p3 : public MultiViewComponent
static Element* info_pnp(QString&, char* &, bool getNewOne=false);
protected:
void createSymbol();
QString netlist();
QString netlist() const;
};

#endif /* hicumL0V1p3_H */
4 changes: 2 additions & 2 deletions qucs/qucs/components/ifile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ Element* iFile::info(QString& Name, char* &BitmapFile, bool getNewOne)
}

// -------------------------------------------------------
QString iFile::getSubcircuitFile()
QString iFile::getSubcircuitFile() const
{
// construct full filename
QString FileName = Props.getFirst()->Value;
return misc::properAbsFileName(FileName);
}

// -------------------------------------------------------
QString iFile::netlist()
QString iFile::netlist() const
{
QString s = Model+":"+Name;

Expand Down
4 changes: 2 additions & 2 deletions qucs/qucs/components/ifile.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class iFile : public Component {
Component* newOne();
static Element* info(QString&, char* &, bool getNewOne=false);

QString getSubcircuitFile();
QString getSubcircuitFile() const;

protected:
QString netlist();
QString netlist() const;
};

#endif

0 comments on commit 8e25b30

Please sign in to comment.