LCOV - code coverage report
Current view: top level - src/components - vprobe.cpp (source / functions) Hit Total Coverage
Test: qucs-core-0.0.19 Code Coverage Lines: 26 26 100.0 %
Date: 2015-01-05 16:01:02 Functions: 6 7 85.7 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 8 16 50.0 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * vprobe.cpp - AC/DC and transient voltage probe class implementation
       3                 :            :  *
       4                 :            :  * Copyright (C) 2006, 2007, 2008 Stefan Jahn <stefan@lkcc.org>
       5                 :            :  *
       6                 :            :  * This is free software; you can redistribute it and/or modify
       7                 :            :  * it under the terms of the GNU General Public License as published by
       8                 :            :  * the Free Software Foundation; either version 2, or (at your option)
       9                 :            :  * any later version.
      10                 :            :  *
      11                 :            :  * This software is distributed in the hope that it will be useful,
      12                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      13                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14                 :            :  * GNU General Public License for more details.
      15                 :            :  *
      16                 :            :  * You should have received a copy of the GNU General Public License
      17                 :            :  * along with this package; see the file COPYING.  If not, write to
      18                 :            :  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
      19                 :            :  * Boston, MA 02110-1301, USA.
      20                 :            :  *
      21                 :            :  * $Id$
      22                 :            :  *
      23                 :            :  */
      24                 :            : 
      25                 :            : #if HAVE_CONFIG_H
      26                 :            : # include <config.h>
      27                 :            : #endif
      28                 :            : 
      29                 :            : #include "component.h"
      30                 :            : #include "vprobe.h"
      31                 :            : 
      32                 :            : using namespace qucs;
      33                 :            : 
      34                 :         15 : vprobe::vprobe () : circuit (2) {
      35                 :         15 :   type = CIR_VPROBE;
      36                 :         15 :   setProbe (true);
      37                 :         15 : }
      38                 :            : 
      39                 :          2 : void vprobe::initSP (void) {
      40                 :          2 :   allocMatrixS ();
      41         [ +  - ]:          2 :   setS (NODE_1, NODE_1, 1.0);
      42         [ +  - ]:          2 :   setS (NODE_1, NODE_2, 0.0);
      43         [ +  - ]:          2 :   setS (NODE_2, NODE_1, 0.0);
      44         [ +  - ]:          2 :   setS (NODE_2, NODE_2, 1.0);
      45                 :          2 : }
      46                 :            : 
      47                 :        166 : void vprobe::initDC (void) {
      48                 :        166 :   allocMatrixMNA ();
      49                 :        166 : }
      50                 :            : 
      51                 :      33899 : void vprobe::saveOperatingPoints (void) {
      52 [ +  - ][ +  - ]:      33899 :   nr_double_t Vr = real (getV (NODE_1) - getV (NODE_2));
      53 [ +  - ][ +  - ]:      33899 :   nr_double_t Vi = imag (getV (NODE_1) - getV (NODE_2));
      54                 :      33899 :   setOperatingPoint ("Vr", Vr);
      55                 :      33899 :   setOperatingPoint ("Vi", Vi);
      56                 :      33899 : }
      57                 :            : 
      58                 :         30 : void vprobe::initAC (void) {
      59                 :         30 :   initDC ();
      60                 :         30 : }
      61                 :            : 
      62                 :         37 : void vprobe::initTR (void) {
      63                 :         37 :   initDC ();
      64                 :         37 : }
      65                 :            : 
      66                 :            : // properties
      67                 :            : PROP_REQ [] = { PROP_NO_PROP };
      68                 :            : PROP_OPT [] = { PROP_NO_PROP };
      69                 :            : struct define_t vprobe::cirdef =
      70                 :            :   { "VProbe", 2, PROP_COMPONENT, PROP_NO_SUBSTRATE, PROP_LINEAR, PROP_DEF };

Generated by: LCOV version 1.11