[Pkg-electronics-commits] [gnucap] 29/47: subckt-1: subckt is a plugin. e_paramlist.* COMMON_PARAMLIST
felix salfelder
felix-guest at moszumanska.debian.org
Mon Sep 26 10:37:10 UTC 2016
This is an automated email from the git hooks/post-receive script.
felix-guest pushed a commit to branch master
in repository gnucap.
commit 6c900a2106d912996c5524db99d3e2a8b8f6028f
Author: al davis <ad211 at freeelectron.net>
Date: Sat Sep 17 00:27:51 2016 -0400
subckt-1: subckt is a plugin. e_paramlist.* COMMON_PARAMLIST
---
apps/Make.depend | 19 ++++--
apps/Make1 | 2 +-
{lib => apps}/d_subckt.cc | 111 ++++++----------------------------
include/Make1 | 6 +-
include/{d_subckt.h => e_paramlist.h} | 16 ++---
include/patchlev.h | 2 +-
include/spice-wrapper.cc | 8 +--
lib/Make.depend | 18 +++---
lib/Make1 | 4 +-
lib/e_paramlist.cc | 100 ++++++++++++++++++++++++++++++
10 files changed, 162 insertions(+), 124 deletions(-)
diff --git a/apps/Make.depend b/apps/Make.depend
index beb389e..389ecc2 100644
--- a/apps/Make.depend
+++ b/apps/Make.depend
@@ -244,6 +244,15 @@ d_res.o: d_res.cc ../include/globals.h ../include/l_dispatcher.h \
../include/u_time_pair.h ../include/u_parameter.h \
../include/m_expression.h ../include/m_base.h ../include/e_cardlist.h \
../include/e_card.h
+d_subckt.o: d_subckt.cc ../include/e_node.h ../include/u_sim_data.h \
+ ../include/constant.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_compar.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
+ ../include/globals.h ../include/l_dispatcher.h ../include/ap.h \
+ ../include/e_paramlist.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h ../include/e_subckt.h
d_switch.o: d_switch.cc ../include/globals.h ../include/l_dispatcher.h \
../include/e_base.h ../include/md.h ../include/io_trace.h \
../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
@@ -465,11 +474,11 @@ c_comand.o: c_comand.cc ../include/constant.h ../include/md.h \
../include/e_card.h ../include/e_base.h ../include/globals.h \
../include/l_dispatcher.h ../include/l_stlextra.h ../include/u_opt.h \
../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h
-c_delete.o: c_delete.cc ../include/e_cardlist.h ../include/md.h \
- ../include/io_trace.h ../include/io_error.h ../include/globals.h \
- ../include/l_dispatcher.h ../include/e_base.h ../include/l_stlextra.h \
- ../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/ap.h ../include/c_comand.h ../include/e_card.h
+c_delete.o: c_delete.cc ../include/globals.h ../include/l_dispatcher.h \
+ ../include/e_base.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h ../include/ap.h \
+ ../include/e_cardlist.h ../include/c_comand.h ../include/e_card.h
c_exp.o: c_exp.cc ../include/globals.h ../include/l_dispatcher.h \
../include/e_base.h ../include/md.h ../include/io_trace.h \
../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
diff --git a/apps/Make1 b/apps/Make1
index c5d6a53..7f2a5e7 100644
--- a/apps/Make1
+++ b/apps/Make1
@@ -38,7 +38,7 @@ d_bjt.model d_diode.model
# device models hand coded in C++
D_SRCS = \
d_admit.cc d_cap.cc d_cccs.cc d_ccvs.cc d_coil.cc \
-d_cs.cc d_poly_g.cc d_poly_cap.cc d_res.cc d_switch.cc \
+d_cs.cc d_poly_g.cc d_poly_cap.cc d_res.cc d_subckt.cc d_switch.cc \
d_trln.cc d_vcg.cc d_vcr.cc d_vcvs.cc d_vs.cc \
d_meter.cc
diff --git a/lib/d_subckt.cc b/apps/d_subckt.cc
similarity index 72%
rename from lib/d_subckt.cc
rename to apps/d_subckt.cc
index b934f56..218f545 100644
--- a/lib/d_subckt.cc
+++ b/apps/d_subckt.cc
@@ -31,86 +31,15 @@
* the expansion (attact to the X) has all comments removed
* - need to process the entire ring - for doesn't work
*/
+//testing=script 2016.09.16
#include "e_node.h"
#include "globals.h"
-#include "d_subckt.h"
+#include "e_paramlist.h"
#include "e_subckt.h"
/*--------------------------------------------------------------------------*/
-int COMMON_SUBCKT::_count = -1;
-static COMMON_SUBCKT Default_SUBCKT(CC_STATIC);
-/*--------------------------------------------------------------------------*/
-bool COMMON_SUBCKT::operator==(const COMMON_COMPONENT& x)const
-{
- const COMMON_SUBCKT* p = dynamic_cast<const COMMON_SUBCKT*>(&x);
- bool rv = p
- && _params == p->_params
- && COMMON_COMPONENT::operator==(x);
- return rv;
-}
-/*--------------------------------------------------------------------------*/
-bool COMMON_SUBCKT::param_is_printable(int i)const
-{
- assert(i < COMMON_SUBCKT::param_count());
- if (i >= COMMON_COMPONENT::param_count()) {
- return _params.is_printable(COMMON_SUBCKT::param_count() - 1 - i);
- }else{
- return COMMON_COMPONENT::param_is_printable(i);
- }
-}
-/*--------------------------------------------------------------------------*/
-std::string COMMON_SUBCKT::param_name(int i)const
-{
- assert(i < COMMON_SUBCKT::param_count());
- if (i >= COMMON_COMPONENT::param_count()) {
- return _params.name(COMMON_SUBCKT::param_count() - 1 - i);
- }else{
- return COMMON_COMPONENT::param_name(i);
- }
-}
-/*--------------------------------------------------------------------------*/
-std::string COMMON_SUBCKT::param_name(int i, int j)const
-{
- assert(i < COMMON_SUBCKT::param_count());
- if (j == 0) {untested();
- return param_name(i);
- }else if (i >= COMMON_COMPONENT::param_count()) {untested();
- return "";
- }else{untested();
- return COMMON_COMPONENT::param_name(i);
- }
-}
-/*--------------------------------------------------------------------------*/
-std::string COMMON_SUBCKT::param_value(int i)const
-{
- assert(i < COMMON_SUBCKT::param_count());
- if (i >= COMMON_COMPONENT::param_count()) {
- return _params.value(COMMON_SUBCKT::param_count() - 1 - i);
- }else{
- return COMMON_COMPONENT::param_value(i);
- }
-}
-/*--------------------------------------------------------------------------*/
-void COMMON_SUBCKT::precalc_first(const CARD_LIST* Scope)
-{
- assert(Scope);
- COMMON_COMPONENT::precalc_first(Scope);
- _mfactor = _params.deep_lookup("m");
- //BUG// _mfactor must be in precalc_first
-}
-/*--------------------------------------------------------------------------*/
-void COMMON_SUBCKT::precalc_last(const CARD_LIST* Scope)
-{
- assert(Scope);
- COMMON_COMPONENT::precalc_last(Scope);
-
- for (PARAM_LIST::iterator i = _params.begin(); i != _params.end(); ++i) {
- i->second.e_val(NOT_INPUT,Scope);
- }
-}
-/*--------------------------------------------------------------------------*/
-/*--------------------------------------------------------------------------*/
+int COMMON_PARAMLIST::_count = -1;
namespace{
-/*--------------------------------------------------------------------------*/
+static COMMON_PARAMLIST Default_SUBCKT(CC_STATIC);
#define PORTS_PER_SUBCKT 100
//BUG// fixed limit on number of ports
/*--------------------------------------------------------------------------*/
@@ -120,10 +49,10 @@ private:
explicit DEV_SUBCKT(const DEV_SUBCKT&);
public:
explicit DEV_SUBCKT();
- ~DEV_SUBCKT() {--_count;}
+ ~DEV_SUBCKT() {--_count;}
CARD* clone()const {return new DEV_SUBCKT(*this);}
private: // override virtual
- char id_letter()const {return 'X';}
+ char id_letter()const {untested();return 'X';}
bool print_type_in_spice()const {return true;}
std::string value_name()const {return "#";}
// std::string dev_type()const
@@ -133,7 +62,7 @@ private: // override virtual
int net_nodes()const {return _net_nodes;}
// CARD* clone_instance()const;
void precalc_first();
- bool makes_own_scope()const {itested(); return false;}
+ bool makes_own_scope()const {return false;}
void expand();
private:
@@ -143,7 +72,7 @@ private:
std::string port_name(int i)const;
public:
- static int count() {return _count;}
+ static int count() {untested();return _count;}
protected:
const BASE_SUBCKT* _parent;
private:
@@ -159,7 +88,7 @@ public:
explicit DEV_SUBCKT_PROTO();
~DEV_SUBCKT_PROTO(){}
public: // override virtual
- char id_letter()const {untested();return '\0';}
+ char id_letter()const {untested();untested();return '\0';}
CARD* clone_instance()const;
bool print_type_in_spice()const {unreachable(); return false;}
std::string value_name()const {incomplete(); return "";}
@@ -171,7 +100,7 @@ public: // override virtual
CARD* clone()const {return new DEV_SUBCKT_PROTO(*this);}
bool is_device()const {return false;}
bool makes_own_scope()const {return true;}
- CARD_LIST* scope() {return subckt();}
+ CARD_LIST* scope() {untested();return subckt();}
const CARD_LIST* scope()const {return subckt();}
private: // no-ops for prototype
void precalc_first(){}
@@ -255,17 +184,17 @@ DEV_SUBCKT::DEV_SUBCKT(const DEV_SUBCKT& p)
}
/*--------------------------------------------------------------------------*/
std::string DEV_SUBCKT::port_name(int i)const
-{itested();
- if (const DEV_SUBCKT* p=dynamic_cast<const DEV_SUBCKT*>(_parent)) {itested();
+{
+ if (const DEV_SUBCKT* p=dynamic_cast<const DEV_SUBCKT*>(_parent)) {
if (i<p->net_nodes()){
return p->port_value(i);
- }else{ untested();
+ }else{
return "";
}
- }else if(_parent){ untested();
+ }else if(_parent){untested(); untested();
// reachable?
return "";
- }else{itested();
+ }else{untested();
return "";
}
}
@@ -273,7 +202,7 @@ std::string DEV_SUBCKT::port_name(int i)const
void DEV_SUBCKT::expand()
{
BASE_SUBCKT::expand();
- COMMON_SUBCKT* c = prechecked_cast<COMMON_SUBCKT*>(mutable_common());
+ COMMON_PARAMLIST* c = prechecked_cast<COMMON_PARAMLIST*>(mutable_common());
assert(c);
if (!_parent) {
// get here when instanciating X, then set modelname
@@ -304,7 +233,7 @@ void DEV_SUBCKT::precalc_first()
BASE_SUBCKT::precalc_first();
if (subckt()) {
- COMMON_SUBCKT* c = prechecked_cast<COMMON_SUBCKT*>(mutable_common());
+ COMMON_PARAMLIST* c = prechecked_cast<COMMON_PARAMLIST*>(mutable_common());
assert(c);
subckt()->attach_params(&(c->_params), scope());
subckt()->precalc_first();
@@ -317,7 +246,7 @@ void DEV_SUBCKT::precalc_last()
{
BASE_SUBCKT::precalc_last();
- COMMON_SUBCKT* c = prechecked_cast<COMMON_SUBCKT*>(mutable_common());
+ COMMON_PARAMLIST* c = prechecked_cast<COMMON_PARAMLIST*>(mutable_common());
assert(c);
subckt()->attach_params(&(c->_params), scope());
subckt()->precalc_last();
@@ -326,7 +255,7 @@ void DEV_SUBCKT::precalc_last()
}
/*--------------------------------------------------------------------------*/
double DEV_SUBCKT::tr_probe_num(const std::string& x)const
-{itested();
+{untested();
if (Umatch(x, "p ")) {untested();
double power = 0.;
assert(subckt());
@@ -351,7 +280,7 @@ double DEV_SUBCKT::tr_probe_num(const std::string& x)const
power += CARD::probe(*ci,"PS");
}
return power;
- }else{itested();
+ }else{untested();
return COMPONENT::tr_probe_num(x);
}
/*NOTREACHED*/
diff --git a/include/Make1 b/include/Make1
index 91a9ae6..bce833f 100644
--- a/include/Make1
+++ b/include/Make1
@@ -1,4 +1,4 @@
-#$Id: Make1,v 26.138 2013/04/24 02:32:27 al Exp $ -*- Makefile -*-
+#$Id: Make1 2016/09/16$ -*- Makefile -*-
# Copyright (C) 2001 Albert Davis
# Author: Albert Davis <aldavis at gnu.org>
#
@@ -32,8 +32,8 @@ spice-wrapper.cc
#------------------------------------------------------------------------
RAW_HDRS = \
ap.h bm.h c_comand.h constant.h d_coment.h d_dot.h d_logic.h \
-d_subckt.h declare.h e_aux.h e_base.h e_card.h e_cardlist.h e_ccsrc.h \
-e_compon.h e_elemnt.h e_model.h e_node.h e_storag.h e_subckt.h \
+declare.h e_aux.h e_base.h e_card.h e_cardlist.h e_ccsrc.h e_compon.h \
+e_elemnt.h e_model.h e_node.h e_paramlist.h e_storag.h e_subckt.h \
globals.h io_.h io_error.h io_trace.h l_compar.h l_denoise.h \
l_dispatcher.h l_lib.h l_stlextra.h l_timer.h m_base.h m_cpoly.h \
m_divdiff.h m_expression.h m_interp.h m_matrix.h m_phase.h m_spline.h \
diff --git a/include/d_subckt.h b/include/e_paramlist.h
similarity index 82%
rename from include/d_subckt.h
rename to include/e_paramlist.h
index 981bf81..b74f1c6 100644
--- a/include/d_subckt.h
+++ b/include/e_paramlist.h
@@ -21,23 +21,23 @@
*------------------------------------------------------------------
* data structures for subcircuits
*/
-//testing=script,sparse 2006.07.17
+//testing=script 2016.09.16
#ifndef D_SUBCKT_H
#define D_SUBCKT_H
#include "e_compon.h"
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
-class INTERFACE COMMON_SUBCKT : public COMMON_COMPONENT {
+class INTERFACE COMMON_PARAMLIST : public COMMON_COMPONENT {
private:
- explicit COMMON_SUBCKT(const COMMON_SUBCKT& p)
+ explicit COMMON_PARAMLIST(const COMMON_PARAMLIST& p)
:COMMON_COMPONENT(p), _params(p._params) {++_count;}
public:
- explicit COMMON_SUBCKT(int c=0) :COMMON_COMPONENT(c) {++_count;}
- ~COMMON_SUBCKT() {--_count;}
+ explicit COMMON_PARAMLIST(int c=0) :COMMON_COMPONENT(c) {++_count;}
+ ~COMMON_PARAMLIST() {--_count;}
bool operator==(const COMMON_COMPONENT&)const;
- COMMON_COMPONENT* clone()const {return new COMMON_SUBCKT(*this);}
- std::string name()const {itested(); return "subckt";}
- static int count() {return _count;}
+ COMMON_COMPONENT* clone()const {return new COMMON_PARAMLIST(*this);}
+ std::string name()const {untested();return "";}
+ static int count() {untested();return _count;}
void set_param_by_name(std::string Name, std::string Value) {_params.set(Name, Value);}
bool param_is_printable(int)const;
diff --git a/include/patchlev.h b/include/patchlev.h
index 12eef8b..f9cfc5d 100644
--- a/include/patchlev.h
+++ b/include/patchlev.h
@@ -1 +1 @@
-#define PATCHLEVEL "subckt-1 2016.09.16"
+#define PATCHLEVEL "subckt-1 2016.09.17"
diff --git a/include/spice-wrapper.cc b/include/spice-wrapper.cc
index 0484490..ce95660 100644
--- a/include/spice-wrapper.cc
+++ b/include/spice-wrapper.cc
@@ -61,7 +61,7 @@ extern "C" {
// gnucap includes
#include "globals.h"
#include "u_xprobe.h"
-#include "d_subckt.h"
+#include "e_paramlist.h"
#include "e_storag.h"
#include "e_model.h"
/*--------------------------------------------------------------------------*/
@@ -91,7 +91,7 @@ enum {uGROUND=1, uFLOAT=2, uDISALLOW=3};
const int MATRIX_NODES = (MAX_NET_NODES + INTERNAL_NODES);
class DEV_SPICE;
class MODEL_SPICE;
-static COMMON_SUBCKT Default_Params(CC_STATIC);
+static COMMON_PARAMLIST Default_Params(CC_STATIC);
/*--------------------------------------------------------------------------*/
/* function mapping: see devdefs.h
* DEVparam DEV_SPICE::parse_spice
@@ -838,7 +838,7 @@ void DEV_SPICE::set_param_by_name(std::string Name, std::string Value)
}else{
}
COMPONENT::set_param_by_name(Name, Value);
- COMMON_SUBCKT* c = dynamic_cast<COMMON_SUBCKT*>(mutable_common());
+ COMMON_PARAMLIST* c = dynamic_cast<COMMON_PARAMLIST*>(mutable_common());
assert(c);
Set_param_by_name(Name, to_string(c->_params[Name].e_val(1,scope())));
}
@@ -1013,7 +1013,7 @@ void DEV_SPICE::precalc_last()
init_ckt();
// push down parameters into spice data
- COMMON_SUBCKT* c = dynamic_cast<COMMON_SUBCKT*>(mutable_common());
+ COMMON_PARAMLIST* c = dynamic_cast<COMMON_PARAMLIST*>(mutable_common());
assert(c);
for (PARAM_LIST::iterator i = c->_params.begin(); i != c->_params.end(); ++i) {
if (i->second.has_hard_value()) {
diff --git a/lib/Make.depend b/lib/Make.depend
index 234cca2..a35949a 100644
--- a/lib/Make.depend
+++ b/lib/Make.depend
@@ -134,15 +134,6 @@ u_xprobe.o: u_xprobe.cc ../include/m_phase.h ../include/constant.h \
../include/md.h ../include/io_trace.h ../include/io_error.h \
../include/u_opt.h ../include/mode.h ../include/io_.h ../include/l_lib.h \
../include/u_xprobe.h
-d_subckt.o: d_subckt.cc ../include/e_node.h ../include/u_sim_data.h \
- ../include/constant.h ../include/md.h ../include/io_trace.h \
- ../include/io_error.h ../include/l_compar.h ../include/u_opt.h \
- ../include/mode.h ../include/io_.h ../include/l_lib.h \
- ../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
- ../include/globals.h ../include/l_dispatcher.h ../include/ap.h \
- ../include/d_subckt.h ../include/e_compon.h ../include/u_time_pair.h \
- ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
- ../include/e_cardlist.h ../include/e_card.h ../include/e_subckt.h
d_logic.o: d_logic.cc ../include/globals.h ../include/l_dispatcher.h \
../include/e_base.h ../include/md.h ../include/io_trace.h \
../include/io_error.h ../include/l_stlextra.h ../include/u_opt.h \
@@ -234,6 +225,15 @@ e_storag.o: e_storag.cc ../include/e_storag.h ../include/e_elemnt.h \
../include/l_denoise.h ../include/e_compon.h ../include/u_time_pair.h \
../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
../include/ap.h ../include/e_cardlist.h ../include/e_card.h
+e_paramlist.o: e_paramlist.cc ../include/e_node.h ../include/u_sim_data.h \
+ ../include/constant.h ../include/md.h ../include/io_trace.h \
+ ../include/io_error.h ../include/l_compar.h ../include/u_opt.h \
+ ../include/mode.h ../include/io_.h ../include/l_lib.h \
+ ../include/m_matrix.h ../include/l_stlextra.h ../include/e_base.h \
+ ../include/globals.h ../include/l_dispatcher.h ../include/ap.h \
+ ../include/e_paramlist.h ../include/e_compon.h ../include/u_time_pair.h \
+ ../include/u_parameter.h ../include/m_expression.h ../include/m_base.h \
+ ../include/e_cardlist.h ../include/e_card.h ../include/e_subckt.h
e_cardlist.o: e_cardlist.cc ../include/u_time_pair.h \
../include/constant.h ../include/md.h ../include/io_trace.h \
../include/io_error.h ../include/e_node.h ../include/u_sim_data.h \
diff --git a/lib/Make1 b/lib/Make1
index e744ae5..5a9825f 100644
--- a/lib/Make1
+++ b/lib/Make1
@@ -36,9 +36,9 @@ l_ftos.cc l_pmatch.cc l_timer.cc l_trim.cc l_wmatch.cc \
io.cc io_contr.cc io_error.cc io_findf.cc io_out.cc io_xopen.cc \
u_lang.cc u_nodemap.cc u_opt1.cc u_opt2.cc \
u_parameter.cc u_prblst.cc u_probe.cc u_sim_data.cc u_xprobe.cc \
-d_subckt.cc d_logic.cc d_logicmod.cc \
+d_logic.cc d_logicmod.cc \
e_base.cc e_card.cc e_node.cc e_model.cc e_compon.cc \
-e_elemnt.cc e_ccsrc.cc e_storag.cc e_cardlist.cc \
+e_elemnt.cc e_ccsrc.cc e_storag.cc e_paramlist.cc e_cardlist.cc \
bm_cond.cc bm_value.cc bm.cc \
c__cmd.cc c_attach.cc c_file.cc \
findbr.cc plot.cc
diff --git a/lib/e_paramlist.cc b/lib/e_paramlist.cc
new file mode 100644
index 0000000..02f9012
--- /dev/null
+++ b/lib/e_paramlist.cc
@@ -0,0 +1,100 @@
+/*$Id: e_paramlist.cc 2016/09/16 $ -*- C++ -*-
+ * Copyright (C) 2001 Albert Davis
+ * Author: Albert Davis <aldavis at gnu.org>
+ *
+ * This file is part of "Gnucap", the Gnu Circuit Analysis Package
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *------------------------------------------------------------------
+ */
+//testing=script 2016.09.16
+#include "e_node.h"
+#include "globals.h"
+#include "e_paramlist.h"
+#include "e_subckt.h"
+int COMMON_PARAMLIST::_count = -1;
+/*--------------------------------------------------------------------------*/
+bool COMMON_PARAMLIST::operator==(const COMMON_COMPONENT& x)const
+{
+ const COMMON_PARAMLIST* p = dynamic_cast<const COMMON_PARAMLIST*>(&x);
+ bool rv = p
+ && _params == p->_params
+ && COMMON_COMPONENT::operator==(x);
+ return rv;
+}
+/*--------------------------------------------------------------------------*/
+bool COMMON_PARAMLIST::param_is_printable(int i)const
+{
+ assert(i < COMMON_PARAMLIST::param_count());
+ if (i >= COMMON_COMPONENT::param_count()) {
+ return _params.is_printable(COMMON_PARAMLIST::param_count() - 1 - i);
+ }else{
+ return COMMON_COMPONENT::param_is_printable(i);
+ }
+}
+/*--------------------------------------------------------------------------*/
+std::string COMMON_PARAMLIST::param_name(int i)const
+{
+ assert(i < COMMON_PARAMLIST::param_count());
+ if (i >= COMMON_COMPONENT::param_count()) {
+ return _params.name(COMMON_PARAMLIST::param_count() - 1 - i);
+ }else{untested();
+ return COMMON_COMPONENT::param_name(i);
+ }
+}
+/*--------------------------------------------------------------------------*/
+std::string COMMON_PARAMLIST::param_name(int i, int j)const
+{untested();
+ assert(i < COMMON_PARAMLIST::param_count());
+ if (j == 0) {untested();
+ return param_name(i);
+ }else if (i >= COMMON_COMPONENT::param_count()) {untested();
+ return "";
+ }else{untested();
+ return COMMON_COMPONENT::param_name(i);
+ }
+}
+/*--------------------------------------------------------------------------*/
+std::string COMMON_PARAMLIST::param_value(int i)const
+{
+ assert(i < COMMON_PARAMLIST::param_count());
+ if (i >= COMMON_COMPONENT::param_count()) {
+ return _params.value(COMMON_PARAMLIST::param_count() - 1 - i);
+ }else{untested();
+ return COMMON_COMPONENT::param_value(i);
+ }
+}
+/*--------------------------------------------------------------------------*/
+void COMMON_PARAMLIST::precalc_first(const CARD_LIST* Scope)
+{
+ assert(Scope);
+ COMMON_COMPONENT::precalc_first(Scope);
+ _mfactor = _params.deep_lookup("m");
+ //BUG// _mfactor must be in precalc_first
+}
+/*--------------------------------------------------------------------------*/
+void COMMON_PARAMLIST::precalc_last(const CARD_LIST* Scope)
+{
+ assert(Scope);
+ COMMON_COMPONENT::precalc_last(Scope);
+
+ for (PARAM_LIST::iterator i = _params.begin(); i != _params.end(); ++i) {
+ i->second.e_val(NOT_INPUT,Scope);
+ }
+}
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+// vim:ts=8:sw=2:noet:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/gnucap.git
More information about the Pkg-electronics-commits
mailing list