traask.c

来自「支持数字元件仿真的SPICE插件」· C语言 代码 · 共 101 行

C
101
字号
/* * Copyright (c) 1987 Thomas L. Quarles *//* * This routine gives access to the internal device parameter * of TRAnsmission lines */#include "prefix.h"#include <stdio.h>#include "CKTdefs.h"#include "DEVdefs.h"#include "IFsim.h"#include "TRAdefs.h"#include "SPerror.h"#include "util.h"#include "suffix.h"RCSID("TRAask.c $Revision: 1.1 $ on $Date: 90/10/11 12:46:36 $")/* ARGSUSED */intTRAask(ckt,inst,which,value,select)    CKTcircuit *ckt;    GENinstance *inst;    int which;    IFvalue *value;    IFvalue *select;{    TRAinstance *here = (TRAinstance *)inst;    int temp;    switch(which) {        case TRA_POS_NODE1:            value->iValue = here->TRAposNode1;            return (OK);        case TRA_NEG_NODE1:            value->iValue = here->TRAnegNode1;            return (OK);        case TRA_POS_NODE2:            value->iValue = here->TRAposNode2;            return (OK);        case TRA_NEG_NODE2:            value->iValue = here->TRAnegNode2;            return (OK);        case TRA_INT_NODE1:            value->iValue = here->TRAintNode1;            return (OK);        case TRA_INT_NODE2:            value->iValue = here->TRAintNode2;            return (OK);        case TRA_Z0:            value->rValue = here->TRAimped;            return (OK);        case TRA_TD:            value->rValue = here->TRAtd;            return (OK);        case TRA_NL:            value->rValue = here->TRAnl;            return (OK);        case TRA_FREQ:            value->rValue = here->TRAf;            return (OK);        case TRA_V1:            value->rValue = here->TRAinitVolt1;            return (OK);        case TRA_I1:            value->rValue = here->TRAinitCur1;            return (OK);        case TRA_V2:            value->rValue = here->TRAinitVolt2;            return (OK);        case TRA_I2:            value->rValue = here->TRAinitCur2;            return (OK);        case TRA_RELTOL:            value->rValue = here->TRAreltol;            return (OK);        case TRA_ABSTOL:            value->rValue = here->TRAabstol;            return (OK);        case TRA_BR_EQ1:            value->rValue = here->TRAbrEq1;            return (OK);        case TRA_BR_EQ2:            value->rValue = here->TRAbrEq2;            return (OK);        case TRA_DELAY:            value->v.vec.rVec = (double *) MALLOC(here->TRAsizeDelay);            value->v.numValue = temp = here->TRAsizeDelay;            while (temp--) {                *value->v.vec.rVec++ = *here->TRAdelays++;            }            return (OK);        default:            return (E_BADPARM);    }    /* NOTREACHED */}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?