1 /*$Id: measure_at.cc,v 1.2 2009-12-13 17:55:01 felix Exp $ -*- C++ -*-
3 * Copyright (C) 2008 Albert Davis
4 * Author: Albert Davis <aldavis@gnu.org>
6 * This file is part of "Gnucap", the Gnu Circuit Analysis Package
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3, or (at your option)
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 *------------------------------------------------------------------
24 #include "u_parameter.h"
26 #include "u_function.h"
27 /*--------------------------------------------------------------------------*/
29 /*--------------------------------------------------------------------------*/
30 class MEASURE
: public WAVE_FUNCTION
{
38 virtual FUNCTION_BASE
* clone()const { return new MEASURE(*this);}
39 string
label() const{return "at";}
40 void expand(CS
& Cmd
, const CARD_LIST
* Scope
){
41 unsigned here
= Cmd
.cursor();
43 _w
= find_wave(probe_name
);
55 || Get(Cmd
, "probe", &probe_name
)
58 || Get(Cmd
, "deriv{ative}", &derivative
)
60 }while (Cmd
.more() && !Cmd
.stuck(&here
));
63 _w
= find_wave(probe_name
);
66 x
.e_val(BIGBIG
, Scope
);
68 /*--------------------------------------------------------------------------*/
69 fun_t
wave_eval()const
72 return to_fun_t((derivative
) ? (_w
->v_out(x
).f1
) : (_w
->v_out(x
).f0
));
74 throw Exception_No_Match(probe_name
);
78 DISPATCHER
<FUNCTION_BASE
>::INSTALL
d1(&measure_dispatcher
, "at", &p1
);
79 /*--------------------------------------------------------------------------*/
81 /*--------------------------------------------------------------------------*/
82 /*--------------------------------------------------------------------------*/
83 // vim:ts=8:sw=2:noet: