Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/digi_sim.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                                 digi_sim.cpp
00003                                --------------
00004     begin                : Oct 3 2005
00005     copyright            : (C) 2005 by Michael Margraf
00006     email                : michael.margraf@alumni.tu-berlin.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 #include "digi_sim.h"
00018 #include "main.h"
00019 
00020 
00021 Digi_Sim::Digi_Sim()
00022 {
00023   Type = isDigitalComponent;
00024   Description = QObject::tr("digital simulation");
00025 
00026   QString  s = Description;
00027   int a = s.indexOf(" ");
00028   if (a != -1) s[a] = '\n';  // break line before the word "simulation"
00029 
00030   Texts.append(new Text(0, 0, s.left(a), Qt::darkBlue, QucsSettings.largeFontSize));
00031   if (a != -1)
00032     Texts.append(new Text(0, 0, s.mid(a+1), Qt::darkBlue, QucsSettings.largeFontSize));
00033 
00034   x1 = -10; y1 = -9;
00035   x2 = x1+120; y2 = y1+59;
00036 
00037   tx = 0;
00038   ty = y2+1;
00039   Model = ".Digi";
00040   Name  = "Digi";
00041 
00042   // Property list must keeps its order !
00043   Props.append(new Property("Type", "TruthTable", true,
00044   QObject::tr("type of simulation")+" [TruthTable, TimeList]"));
00045   Props.append(new Property("time", "10 ns", false,
00046   QObject::tr("duration of TimeList simulation")));
00047   Props.append(new Property("Model", "VHDL", false,
00048   QObject::tr("netlist format")+" [VHDL, Verilog]"));
00049 }
00050 
00051 // -------------------------------------------------------
00052 Digi_Sim::~Digi_Sim()
00053 {
00054 }
00055 
00056 // -------------------------------------------------------
00057 Component* Digi_Sim::newOne()
00058 {
00059   return new Digi_Sim();
00060 }
00061 
00062 // -------------------------------------------------------
00063 Element* Digi_Sim::info(QString& Name, char* &BitmapFile, bool getNewOne)
00064 {
00065   Name = QObject::tr("digital simulation");
00066   BitmapFile = (char *) "digi";
00067 
00068   if(getNewOne)  return new Digi_Sim();
00069   return 0;
00070 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines