001: /*
002:  *  dde-model.h
003:  *  dde
004:  *
005:  *  Created by ashley on 03/12/2009.
006:  *  Copyright 2009 __MyCompanyName__. All rights reserved.
007:  *
008:  */
009:  
010: #ifndef __DDEMODEL_
011: #define __DDEMODEL_
012: #include <gtk/gtk.h>
013: 
014: enum _linetypes {noline, fullline, dottedline, dashedline};
015: typedef enum _linetypes linetypes;
016: 
017: enum _markertypes {nomarkers, circlemarker, squaremarker, crossmarker, diamondmarker};
018: typedef enum _markertypes markertypes;
019: 
020: typedef struct { 
021:         double y0,y1;
022: } y0y1type;
023: 
024: typedef struct { 
025:         float x,y;
026: } xytype;
027: 
028: typedef struct { 
029:         int win,cur;
030: } wctype;
031: 
032: typedef struct { 
033:         double x0,x1;
034: } x0x1type;
035: 
036: struct _linedef {
037:         gint index;
038:         linetypes linetype;
039:         GdkColor lineColour;
040:         markertypes markertype;
041:         GdkColor markerColour;
042: };
043: typedef struct _linedef linedef;
044: 
045: struct _plotwindef {
046:         gdouble ymin;
047:         gdouble ymax;
048:         gdouble xmin;
049:         gdouble xmax;
050:         gint nlines;
051:         gint ordinate;
052:         gint *lines;
053:         gboolean xgrid;
054:         gboolean ygrid;
055:         gchar *xlabel;
056:         gchar *ylabel;
057:         gchar *title;
058: };
059: typedef struct _plotwindef plotwindef;
060: 
061: struct _usercontrol { 
062:         int nvariables;
063:         int nparameters;
064:         int no_windows;
065:         int *lines;         /* variables per window */
066:         
067:         gpointer mainwindow;
068:         gchar *builder_file_name;
069:         plotwindef **plots;
070:         int count;
071:         GArray *buffer;
072:         gpointer plotwindow;
073:         
074:         int nhv;
075:         int nlag;
076:         int nsw;
077:         int fileno;
078:         int *fout;
079:         long hbsize;
080:         wctype *index; /* window and curve for state variable */
081:         char **label;
082:         char **cname;
083:         char **wname;
084:         char *initialtext;
085:         char *initialtitle;
086:         char **cinfo;
087:         char *xlabel;/* labels for state variables and constants*/
088:         y0y1type *range; /* y-range for [window] */
089:         double t0;
090:         double t1;
091:         double dt;
092:         double dout;
093:         double *c;
094:         double tol;
095: };
096: typedef struct _usercontrol usercontrol;
097: 
098: usercontrol *makeUsercontrol();
099: void freeUsercontrol(usercontrol *out);
100: void initialiseUsercontrol(usercontrol *out);
101: gboolean run_model(usercontrol *out);
102: 
103: #endif