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: 1985 Wayne A. Christopher 5 1992 Stephen R. Whiteley 6 ****************************************************************************/ 7 8 #ifndef FTEdata_h 9 #define FTEdata_h 10 11 #include "cpstd.h" /* for struct complex */ 12 #include "fteconst.h" 13 14 /* A (possibly multi-dimensional) data vector. The data is represented 15 * internally by a 1-d array. The number of dimensions and the size 16 * of each dimension is recorded, along with v_length, the total size of 17 * the array. If the dimensionality is 0 or 1, v_length is significant 18 * instead of v_numdims and v_dims, and the vector is handled in the old 19 * manner. 20 */ 21 22 #define MAXDIMS 8 23 24 struct dvec { 25 char *v_name; /* Same as so_vname. */ 26 int v_type; /* Same as so_vtype. */ 27 short v_flags; /* Flags (a combination of VF_*). */ 28 double *v_realdata; /* Real data. */ 29 complex *v_compdata; /* Complex data. */ 30 double v_minsignal; /* Minimum value to plot. */ 31 double v_maxsignal; /* Maximum value to plot. */ 32 GRIDTYPE v_gridtype; /* One of GRID_*. */ 33 PLOTTYPE v_plottype; /* One of PLOT_*. */ 34 int v_length; /* Length of the vector. */ 35 int v_rlength; /* How much space we really have. */ 36 int v_outindex; /* Index if writedata is building the vector. */ 37 int v_linestyle; /* What line style we are using. */ 38 int v_color; /* What color we are using. */ 39 char *v_defcolor; /* The name of a color to use. */ 40 int v_numdims; /* How many dims -- 0 = scalar (len = 1). */ 41 int v_dims[MAXDIMS]; /* The actual size in each dimension. */ 42 struct plot *v_plot; /* The plot structure (if it has one). */ 43 struct dvec *v_next; /* Link for list of plot vectors. */ 44 struct dvlist *v_link2; /* Extra link for things like print. */ 45 struct dvec *v_scale; /* If this has a non-standard scale... */ 46 } ; 47 48 /* list of data vectors */ 49 struct dvlist { 50 struct dvec *dl_dvec; 51 struct dvlist *dl_next; 52 }; 53 54 #define isreal(v) ((v)->v_flags & VF_REAL) 55 #define iscomplex(v) ((v)->v_flags & VF_COMPLEX) 56 57 /* The information for a particular set of vectors that come from one 58 * plot. 59 */ 60 61 struct plot { 62 char *pl_title; /* The title card. */ 63 char *pl_date; /* Date. */ 64 char *pl_name; /* The plot name. */ 65 char *pl_typename; /* Tran1, op2, etc. */ 66 void *pl_hashtab; /* Hash head for permanent vectors */ 67 struct dvec *pl_dvecs; /* The data vectors in this plot. */ 68 struct dvec *pl_scale; /* The "scale" for the rest of the vectors. */ 69 struct plot *pl_next; /* List of plots. */ 70 wordlist *pl_commands; /* Commands to execute for this plot. */ 71 struct variable *pl_env;/* The 'environment' for this plot. */ 72 char *pl_ccom; /* The ccom struct for this plot. */ 73 bool pl_written; /* Some or all of the vecs have been saved. */ 74 int pl_ndims; /* Number of dimensions */ 75 int pl_active; /* Nonzero when the plot is being used */ 76 double pl_start; /* the "tran params" for this plot */ 77 double pl_stop; 78 double pl_step; 79 } ; 80 81 #endif /* FTEdata_h */ 82