Jspice3
acaskq.c File Reference
#include "spice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "acdefs.h"
#include "iferrmsg.h"
Include dependency graph for acaskq.c:

Go to the source code of this file.

Functions

int ACaskQuest (GENERIC *cktp, GENERIC *anal, int which, IFvalue *value)
 
int ACquery (struct sACprms *ac, int which, IFvalue *value)
 

Function Documentation

int ACaskQuest ( GENERIC cktp,
GENERIC anal,
int  which,
IFvalue value 
)

Definition at line 17 of file acaskq.c.

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 }
struct sACprms AC
Definition: acdefs.h:20
struct sDCTprms DC
Definition: acdefs.h:21
#define E_BADPARM
Definition: iferrmsg.h:26
int ACquery(struct sACprms *ac, int which, IFvalue *value)
Definition: acaskq.c:35
int DCTquery()
#define OK
Definition: iferrmsg.h:17
Definition: acdefs.h:15
int ACquery ( struct sACprms ac,
int  which,
IFvalue value 
)

Definition at line 35 of file acaskq.c.

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
#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
double rValue
Definition: ifsim.h:233
#define AC_LIN
Definition: analysis.h:54
#define OK
Definition: iferrmsg.h:17
#define AC_STEPS
Definition: analysis.h:57
#define LINEAR
Definition: analysis.h:49
int numSteps
Definition: analysis.h:63
double fstop
Definition: analysis.h:61
#define AC_DEC
Definition: analysis.h:52
#define DECADE
Definition: analysis.h:47
double fstart
Definition: analysis.h:60
int stepType
Definition: analysis.h:64