Qucs-GUI
0.0.19
|
00001 /* 00002 * log_amp.cpp - device implementations for log_amp module 00003 * 00004 * This is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2, or (at your option) 00007 * any later version. 00008 * 00009 */ 00010 00011 #include "log_amp.h" 00012 00013 log_amp::log_amp() 00014 { 00015 Description = QObject::tr ("Logarithmic Amplifier verilog device"); 00016 00017 Props.append (new Property ("Kv", "1.0", false, 00018 QObject::tr ("scale factor"))); 00019 Props.append (new Property ("Dk", "0.3", false, 00020 QObject::tr ("scale factor error") 00021 +" ("+QObject::tr ("%")+")")); 00022 Props.append (new Property ("Ib1", "5e-12", false, 00023 QObject::tr ("input I1 bias current") 00024 +" ("+QObject::tr ("A")+")")); 00025 Props.append (new Property ("Ibr", "5e-12", false, 00026 QObject::tr ("input reference bias current") 00027 +" ("+QObject::tr ("A")+")")); 00028 Props.append (new Property ("M", "5", false, 00029 QObject::tr ("number of decades"))); 00030 Props.append (new Property ("N", "0.1", false, 00031 QObject::tr ("conformity error") 00032 +" ("+QObject::tr ("%")+")")); 00033 Props.append (new Property ("Vosout", "3e-3", false, 00034 QObject::tr ("output offset error") 00035 +" ("+QObject::tr ("V")+")")); 00036 Props.append (new Property ("Rinp", "1e6", false, 00037 QObject::tr ("amplifier input resistance") 00038 +" ("+QObject::tr ("Ohm")+")")); 00039 Props.append (new Property ("Fc", "1e3", false, 00040 QObject::tr ("amplifier 3dB frequency") 00041 +" ("+QObject::tr ("Hz")+")")); 00042 Props.append (new Property ("Ro", "1e-3", false, 00043 QObject::tr ("amplifier output resistance") 00044 +" ("+QObject::tr ("Ohm")+")")); 00045 Props.append (new Property ("Ntc", "0.002", false, 00046 QObject::tr ("conformity error temperature coefficient") 00047 +" ("+QObject::tr ("%/Celsius")+")")); 00048 Props.append (new Property ("Vosouttc", "80e-6", false, 00049 QObject::tr ("offset temperature coefficient") 00050 +" ("+QObject::tr ("V/Celsius")+")")); 00051 Props.append (new Property ("Dktc", "0.03", false, 00052 QObject::tr ("scale factor error temperature coefficient") 00053 +" ("+QObject::tr ("%/Celsius")+")")); 00054 Props.append (new Property ("Ib1tc", "0.5e-12", false, 00055 QObject::tr ("input I1 bias current temperature coefficient") 00056 +" ("+QObject::tr ("A/Celsius")+")")); 00057 Props.append (new Property ("Ibrtc", "0.5e-12", false, 00058 QObject::tr ("input reference bias current temperature coefficient") 00059 +" ("+QObject::tr ("A/Celsius")+")")); 00060 Props.append (new Property ("Tnom", "26.85", false, 00061 QObject::tr ("parameter measurement temperature") 00062 +" ("+QObject::tr ("Celsius")+")")); 00063 Props.append (new Property ("Temp", "26.85", false, 00064 QObject::tr ("simulation temperature"))); 00065 00066 createSymbol (); 00067 tx = x2 + 4; 00068 ty = y1 + 4; 00069 Model = "log_amp"; 00070 Name = "LA"; 00071 } 00072 00073 Component * log_amp::newOne() 00074 { 00075 log_amp * p = new log_amp(); 00076 p->Props.getFirst()->Value = Props.getFirst()->Value; 00077 p->recreate(0); 00078 return p; 00079 } 00080 00081 Element * log_amp::info(QString& Name, char * &BitmapFile, bool getNewOne) 00082 { 00083 Name = QObject::tr("Logarithmic Amplifier"); 00084 BitmapFile = (char *) "log_amp"; 00085 00086 if(getNewOne) return new log_amp(); 00087 return 0; 00088 } 00089 00090 void log_amp::createSymbol() 00091 { 00092 Lines.append(new Line(-30,-20,-20,-20,QPen(Qt::darkBlue,2))); 00093 Lines.append(new Line(-30, 20,-20, 20,QPen(Qt::darkBlue,2))); 00094 Lines.append(new Line( 30, 0, 40, 0,QPen(Qt::darkBlue,2))); 00095 00096 Lines.append(new Line(-20,-35,-20, 35,QPen(Qt::darkBlue,2))); 00097 Lines.append(new Line(-20,-35, 30, 0,QPen(Qt::darkBlue,2))); 00098 Lines.append(new Line(-20, 35, 30, 0,QPen(Qt::darkBlue,2))); 00099 00100 Lines.append(new Line(-5, -10, -5, 10,QPen(Qt::red,2))); 00101 Lines.append(new Line(-5, 10, 5, 10,QPen(Qt::red,2))); 00102 00103 Texts.append(new Text(-17, -26, QObject::tr("I"), Qt::black, 10.0, 1.0, 0.0)); 00104 Texts.append(new Text(-17, 14, QObject::tr("R"), Qt::black, 10.0, 1.0, 0.0)); 00105 00106 Ports.append(new Port(-30,-20)); 00107 Ports.append(new Port(-30, 20)); 00108 Ports.append(new Port( 40, 0)); 00109 00110 x1 = -30; y1 = -38; 00111 x2 = 40; y2 = 38; 00112 }