1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
/*$Id: e_paramlist.cc 2016/09/16 $ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis@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_paramlist.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{itested();
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{itested();
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:
|