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

Go to the source code of this file.

Functions

int ACsetParm (GENERIC *cktp, GENERIC *anal, int which, IFvalue *value)
 
int ACsetp (struct sACprms *ac, int which, IFvalue *value)
 

Variables

static IFparm ACparms []
 
SPICEanalysis ACinfo
 

Function Documentation

int ACsetp ( struct sACprms ac,
int  which,
IFvalue value 
)

Definition at line 36 of file acsetp.c.

41 {
42  switch (which) {
43 
44  case AC_START:
45  ac->fstart = value->rValue;
46  break;
47 
48  case AC_STOP:
49  ac->fstop = value->rValue;
50  break;
51 
52  case AC_STEPS:
53  ac->numSteps = value->iValue;
54  break;
55 
56  case AC_DEC:
57  if (value->iValue) {
58  ac->stepType = DECADE;
59  }
60  else {
61  if (ac->stepType == DECADE) {
62  ac->stepType = 0;
63  }
64  }
65  break;
66 
67  case AC_OCT:
68  if (value->iValue) {
69  ac->stepType = OCTAVE;
70  }
71  else {
72  if (ac->stepType == OCTAVE) {
73  ac->stepType = 0;
74  }
75  }
76  break;
77 
78  case AC_LIN:
79  if (value->iValue) {
80  ac->stepType = LINEAR;
81  }
82  else {
83  if (ac->stepType == LINEAR) {
84  ac->stepType = 0;
85  }
86  }
87  break;
88 
89  default:
90  return (E_BADPARM);
91  }
92  return (OK);
93 }
#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
int ACsetParm ( GENERIC cktp,
GENERIC anal,
int  which,
IFvalue value 
)

Definition at line 18 of file acsetp.c.

24 {
25  ACAN *job = (ACAN *) anal;
26 
27  if (ACsetp(&job->AC,which,value) == OK)
28  return (OK);
29  if (DCTsetp(&job->DC,which,value) == OK)
30  return (OK);
31  return (E_BADPARM);
32 }
struct sACprms AC
Definition: acdefs.h:20
struct sDCTprms DC
Definition: acdefs.h:21
#define E_BADPARM
Definition: iferrmsg.h:26
#define OK
Definition: iferrmsg.h:17
Definition: acdefs.h:15
int ACsetp(struct sACprms *ac, int which, IFvalue *value)
Definition: acsetp.c:36
int DCTsetp()

Variable Documentation

SPICEanalysis ACinfo
Initial value:
= {
{
"AC",
"A.C. Small signal analysis",
sizeof(ACparms)/sizeof(IFparm),
},
sizeof(ACAN),
}
int ACaskQuest()
int ACparse()
int ACan()
static IFparm ACparms[]
Definition: acsetp.c:97
int ACsetParm(GENERIC *cktp, GENERIC *anal, int which, IFvalue *value)
Definition: acsetp.c:18
Definition: acdefs.h:15
Definition: ifsim.h:54
#define FREQUENCYDOMAIN
Definition: jobdefs.h:34

Definition at line 114 of file acsetp.c.

IFparm ACparms[]
static
Initial value:
= {
{ "start", AC_START, IFP|IF_REAL, "starting frequency" },
{ "stop", AC_STOP, IFP|IF_REAL, "ending frequency" },
{ "numsteps", AC_STEPS, IFP|IF_INTEGER, "number of frequencies"},
{ "dec", AC_DEC, IFP|IF_FLAG, "step by decades" },
{ "oct", AC_OCT, IFP|IF_FLAG, "step by octaves" },
{ "lin", AC_LIN, IFP|IF_FLAG, "step linearly" },
{ "name1", DC_NAME1, IFP|IF_INSTANCE, "name of source to step" },
{ "start1", DC_START1, IFP|IF_REAL, "starting voltage/current"},
{ "stop1", DC_STOP1, IFP|IF_REAL, "ending voltage/current" },
{ "step1", DC_STEP1, IFP|IF_REAL, "voltage/current step" },
{ "name2", DC_NAME2, IFP|IF_INSTANCE, "name of source to step" },
{ "start2", DC_START2, IFP|IF_REAL, "starting voltage/current"},
{ "stop2", DC_STOP2, IFP|IF_REAL, "ending voltage/current" },
{ "step2", DC_STEP2, IFP|IF_REAL, "voltage/current step" }
}
#define AC_STOP
Definition: analysis.h:56
#define AC_START
Definition: analysis.h:55
#define DC_STOP1
Definition: analysis.h:19
#define DC_START1
Definition: analysis.h:18
#define AC_OCT
Definition: analysis.h:53
#define IF_INSTANCE
Definition: ifsim.h:112
#define AC_LIN
Definition: analysis.h:54
#define DC_NAME2
Definition: analysis.h:21
#define AC_STEPS
Definition: analysis.h:57
#define IFP
Definition: analysis.h:10
#define DC_STEP1
Definition: analysis.h:20
#define IF_INTEGER
Definition: ifsim.h:107
#define DC_NAME1
Definition: analysis.h:17
#define IF_REAL
Definition: ifsim.h:108
#define IF_FLAG
Definition: ifsim.h:106
#define AC_DEC
Definition: analysis.h:52
#define DC_START2
Definition: analysis.h:22
#define DC_STOP2
Definition: analysis.h:23
#define DC_STEP2
Definition: analysis.h:24

Definition at line 97 of file acsetp.c.