Jspice3
ltrapar.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1990 Jaijeet S. Roychowdhury
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include <math.h>
11 #include "ltradefs.h"
12 #include "sperror.h"
13 #include "util.h"
14 
15 
16 /* ARGSUSED */
17 int
18 LTRAparam(ckt,param,value,inst,select)
19 
20 CKTcircuit *ckt;
21 int param;
22 IFvalue *value;
23 GENinstance *inst;
24 IFvalue *select;
25 {
26  LTRAinstance *here = (LTRAinstance *)inst;
27 
28  switch (param) {
29 
30  case LTRA_V1:
31  here->LTRAinitVolt1 = value->rValue;
32  here->LTRAicV1Given = TRUE;
33  break;
34  case LTRA_I1:
35  here->LTRAinitCur1 = value->rValue;
36  here->LTRAicC1Given = TRUE;
37  break;
38  case LTRA_V2:
39  here->LTRAinitVolt2 = value->rValue;
40  here->LTRAicV2Given = TRUE;
41  break;
42  case LTRA_I2:
43  here->LTRAinitCur2 = value->rValue;
44  here->LTRAicC2Given = TRUE;
45  break;
46  case LTRA_IC:
47  switch(value->v.numValue) {
48  case 4:
49  here->LTRAinitCur2 = *(value->v.vec.rVec+3);
50  case 3:
51  here->LTRAinitVolt2 = *(value->v.vec.rVec+2);
52  case 2:
53  here->LTRAinitCur1 = *(value->v.vec.rVec+1);
54  case 1:
55  here->LTRAinitVolt1 = *(value->v.vec.rVec);
56  break;
57  default:
58  return (E_BADPARM);
59  }
60  break;
61  default:
62  return (E_BADPARM);
63  }
64  return (OK);
65 }
#define LTRA_V1
Definition: ltradefs.h:171
int numValue
Definition: ifsim.h:240
double LTRAinitVolt2
Definition: ltradefs.h:37
union uIFvalue::@13::@14 vec
#define LTRA_I2
Definition: ltradefs.h:174
#define E_BADPARM
Definition: iferrmsg.h:26
#define TRUE
Definition: util.h:27
#define LTRA_V2
Definition: ltradefs.h:173
double rValue
Definition: ifsim.h:233
#define OK
Definition: iferrmsg.h:17
#define LTRA_I1
Definition: ltradefs.h:172
unsigned LTRAicV2Given
Definition: ltradefs.h:68
#define LTRA_IC
Definition: ltradefs.h:175
double LTRAinitVolt1
Definition: ltradefs.h:35
unsigned LTRAicC1Given
Definition: ltradefs.h:67
unsigned LTRAicV1Given
Definition: ltradefs.h:66
double LTRAinitCur1
Definition: ltradefs.h:36
struct uIFvalue::@13 v
unsigned LTRAicC2Given
Definition: ltradefs.h:69
double LTRAinitCur2
Definition: ltradefs.h:38
int LTRAparam(CKTcircuit *ckt, int param, IFvalue *value, GENinstance *inst, IFvalue *select)
Definition: ltrapar.c:18