Jspice3
acaskq.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: 1985 Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "cktdefs.h"
11 #include "acdefs.h"
12 #include "iferrmsg.h"
13 
14 
15 /* ARGSUSED */
16 int
17 ACaskQuest(cktp,anal,which,value)
18 
19 GENERIC *cktp;
20 GENERIC *anal;
21 int which;
22 IFvalue *value;
23 {
24  ACAN *job = (ACAN *) anal;
25 
26  if (ACquery(&job->AC,which,value) == OK)
27  return (OK);
28  if (DCTquery(&job->DC,which,value) == OK)
29  return (OK);
30  return (E_BADPARM);
31 }
32 
33 
34 int
35 ACquery(ac,which,value)
36 
37 struct sACprms *ac;
38 int which;
39 IFvalue *value;
40 {
41  switch (which) {
42 
43  case AC_START:
44  value->rValue = ac->fstart;
45  break;
46 
47  case AC_STOP:
48  value->rValue = ac->fstop;
49  break;
50 
51  case AC_STEPS:
52  value->iValue = ac->numSteps;
53  break;
54 
55  case AC_DEC:
56  if (ac->stepType == DECADE) {
57  value->iValue = 1;
58  }
59  else {
60  value->iValue = 0;
61  }
62  break;
63 
64  case AC_OCT:
65  if (ac->stepType == OCTAVE) {
66  value->iValue = 1;
67  }
68  else {
69  value->iValue = 0;
70  }
71  break;
72 
73  case AC_LIN:
74  if (ac->stepType == LINEAR) {
75  value->iValue = 1;
76  }
77  else {
78  value->iValue = 0;
79  }
80  break;
81 
82  default:
83  return (E_BADPARM);
84  }
85  return (OK);
86 }
#define AC_STOP
Definition: analysis.h:56
#define AC_START
Definition: analysis.h:55
struct sACprms AC
Definition: acdefs.h:20
struct sDCTprms DC
Definition: acdefs.h:21
#define AC_OCT
Definition: analysis.h:53
#define E_BADPARM
Definition: iferrmsg.h:26
#define OCTAVE
Definition: analysis.h:48
int iValue
Definition: ifsim.h:232
int ACquery(struct sACprms *ac, int which, IFvalue *value)
Definition: acaskq.c:35
double rValue
Definition: ifsim.h:233
#define AC_LIN
Definition: analysis.h:54
int DCTquery()
#define OK
Definition: iferrmsg.h:17
#define AC_STEPS
Definition: analysis.h:57
#define LINEAR
Definition: analysis.h:49
Definition: acdefs.h:15
#define AC_DEC
Definition: analysis.h:52
#define DECADE
Definition: analysis.h:47
int ACaskQuest(GENERIC *cktp, GENERIC *anal, int which, IFvalue *value)
Definition: acaskq.c:17
char GENERIC
Definition: ifsim.h:27