Jspice3
newgraf.h
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3e2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1992 Stephen R. Whiteley
5 ****************************************************************************/
6 
7 /*
8  * Header for new graphics package.
9  */
10 
11 /* max number of displayed curves */
12 #define PNUM 8
13 
14 /* number of characters in trace name field */
15 #define FIELD 12
16 
17 /* option mask defines */
18 #define OPT_n 0x1
19 #define OPT_N 0x2
20 #define OPT_x 0x4
21 #define OPT_X 0x8
22 #define OPT_b 0x10
23 #define OPT_t 0x20
24 #define OPT_p 0x40
25 #define OPT_Xx 0x80
26 #define OPT_help 0x100
27 #define OPT_quit 0x200
28 #define OPT_mark 0x400
29 #define OPT_add 0x800
30 #define OPT_hcpy 0x1000
31 #define OPT_step 0x2000
32 
33 /* type of trace: voltage, current, other */
34 #define GRAF_V 0
35 #define GRAF_I 1
36 #define GRAF_O 2
37 
38 
39 struct gframe {
40  double beg; /* initial data value */
41  double end; /* final data value */
42  double min; /* scale initial value */
43  double max; /* scale final value */
44 };
45 
46 /* scale factors for plot */
47 struct gscale {
48  int ncells; /* number of x axis cells */
49  int numpts; /* number of x axis points to plot */
50  int strtpt; /* starting x axis point offset */
51  int lflg; /* nonzero if log x axis */
52  /*
53  * The following two arrays store min/max values used for
54  * building special y scales. The last four elements are
55  * the values for all traces (global min/max), just the "v"
56  * traces, just the "i" traces, and other traces. The
57  * first (up to PNUM elements) store min/max values derived
58  * from data for expanded (x option) plots.
59  */
60  double ymin[PNUM+4]; /* y scale min values: plots,all,v,i,other */
61  double ymax[PNUM+4]; /* y scale max values: plots,all,v,i,other */
62  struct gframe xfull; /* full x scale values */
63  struct gframe xcurr; /* current x scale */
64 };
65 
66 /* trace data */
67 struct gtrace {
68  int cycles; /* cycles of multidimensional plot */
69  int extra; /* extra points of incomplete multi plot */
70  char name[FIELD+2]; /* name of trace */
71  int type; /* GRAF_V, GRAF_I, GRAF_O */
72  double scale[2]; /* default y scale for trace */
73  int lasty; /* last point plotted (screen coord) */
74  float *data; /* interpolated data for trace */
75 };
76 
77 /* viewport description */
78 struct screen {
79  int X; /* plot viewport width */
80  int Y; /* plot viewport height */
81  int W; /* font width */
82  int H; /* font height */
83  int W2; /* half font width */
84  int H2; /* half font height */
85  int H3; /* vertical space and a half */
86  int XL; /* left margin */
87  int XU; /* right " */
88  int YL; /* lower " */
89  int YU; /* upper " */
90  int XS; /* screen width */
91  int YS; /* screen height */
92  int XC; /* X center of plot area */
93  int YC; /* Y center of plot area */
94 };
95 
96 /* stored reference */
97 struct gref {
98  int x; /* X reference */
99  bool set; /* using offsets */
100 };
101 
102 /* plot data storage */
103 struct gplot {
104  int numtr; /* number of traces */
105  int numpt; /* number of points in traces */
106  int opt; /* option mask, see defines */
107  int lastx; /* last x point (screen coords) */
108  bool iniplot; /* set when doing iplot */
109  float *xdata; /* interpolated x scale data */
110  struct gscale *scale; /* scaling parameters for x axis */
111  struct plot *plot; /* originating plot structure */
112  struct dvlist *dlist; /* list of dvecs being plotted, for iplot */
113  struct gtrace tdata[PNUM]; /* trace data */
114  struct screen scr; /* viewport description */
115  struct gref ref; /* storage of marker offset */
116 };
117 
118 /*
119  * Structures for operating range analysis plotting.
120  */
121 
122 struct chkpts { /* linked list of x-y file points to plot */
123  char *v1; /* value 1 steps (as int) */
124  char *v2; /* value 2 steps (as int) */
125  char *pf; /* boolean pass/file values */
126  char delta1; /* number of steps 1 */
127  char delta2; /* number of steps 2 */
128  int size; /* length of list */
129  int rsize; /* allocated length */
130  int xc; /* screen center x */
131  int yc; /* screen center y */
132  int d; /* screen cell size */
133  int d1; /* current step 1 */
134  int d2; /* current step 2 */
135  double minv1; /* min/max data values */
136  double maxv1;
137  double minv2;
138  double maxv2;
139  struct chkpts *next;
140 };
141 
142 struct mdata {
143  struct chkpts *pts;
144  struct screen scr;
145 };
float * xdata
Definition: newgraf.h:109
int x
Definition: newgraf.h:98
int strtpt
Definition: newgraf.h:50
double maxv2
Definition: newgraf.h:138
double end
Definition: newgraf.h:41
double minv2
Definition: newgraf.h:137
#define FIELD
Definition: newgraf.h:15
double minv1
Definition: newgraf.h:135
Definition: ftedata.h:49
#define PNUM
Definition: newgraf.h:12
int type
Definition: newgraf.h:71
float * data
Definition: newgraf.h:74
int YS
Definition: newgraf.h:91
double max
Definition: newgraf.h:43
Definition: ftedata.h:61
char * v1
Definition: newgraf.h:123
int numtr
Definition: newgraf.h:104
Definition: newgraf.h:103
int size
Definition: newgraf.h:128
Definition: newgraf.h:39
Definition: newgraf.h:97
int lflg
Definition: newgraf.h:51
int cycles
Definition: newgraf.h:68
int numpt
Definition: newgraf.h:105
int rsize
Definition: newgraf.h:129
struct dvlist * dlist
Definition: newgraf.h:112
int numpts
Definition: newgraf.h:49
int opt
Definition: newgraf.h:106
int XU
Definition: newgraf.h:87
struct gscale * scale
Definition: newgraf.h:110
int H3
Definition: newgraf.h:85
Definition: newgraf.h:142
int W
Definition: newgraf.h:81
struct plot * plot
Definition: newgraf.h:111
int ncells
Definition: newgraf.h:48
bool iniplot
Definition: newgraf.h:108
struct chkpts * next
Definition: newgraf.h:139
int yc
Definition: newgraf.h:131
int H
Definition: newgraf.h:82
int YU
Definition: newgraf.h:89
int X
Definition: newgraf.h:79
int lasty
Definition: newgraf.h:73
char * pf
Definition: newgraf.h:125
int YL
Definition: newgraf.h:88
char * v2
Definition: newgraf.h:124
int lastx
Definition: newgraf.h:107
int XL
Definition: newgraf.h:86
double maxv1
Definition: newgraf.h:136
double min
Definition: newgraf.h:42
int YC
Definition: newgraf.h:93
int d1
Definition: newgraf.h:133
char delta1
Definition: newgraf.h:126
int d
Definition: newgraf.h:132
struct chkpts * pts
Definition: newgraf.h:143
Definition: newgraf.h:47
int extra
Definition: newgraf.h:69
int W2
Definition: newgraf.h:83
char delta2
Definition: newgraf.h:127
int H2
Definition: newgraf.h:84
int Y
Definition: newgraf.h:80
Definition: newgraf.h:67
double beg
Definition: newgraf.h:40
int d2
Definition: newgraf.h:134
int xc
Definition: newgraf.h:130
Definition: newgraf.h:78
int XS
Definition: newgraf.h:90
int XC
Definition: newgraf.h:92