home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************
- * *
- * Filename : DebugL2.c *
- * *
- *****************************************************************
- * *
- * Comment : Sourcedatei für Debugfunktionen Level 2 *
- * Diese Funktionen helfen dem Programmierer die *
- * geladenen Daten der Plotlibrary anzuschauen. Es *
- * kann bei einer Implementation auf einen neuen *
- * Rechner die Darstellung kontrolliert werden. *
- * Diese Funktionen sollten nur während dieser *
- * Implementationsphase verwendet werden, da sie *
- * sehr gross sind und normalerweise auch nicht *
- * benötigt werden. *
- * *
- * Funktionen *
- * ========== *
- * *
- * displaydata() sucht und zeigt Daten einer Kurve *
- * displaycurve() sucht und zeigt Kurvenstruktur *
- * dispdata() zeigt Daten einer Kurve *
- * dispplot() zeigt Plotstruktur *
- * dispcurve() zeigt Kurvenstruktur *
- * *
- * Rev : V1.0 *
- * *
- * History : V1.0 erstellen dieses Files 15/11/89 *
- * *
- * Doc : Plotlibrary User's Guide *
- * *
- * Bugs : keine bekannten *
- * *
- * Autor : Oesch Silvano *
- * *
- * Datum : 10/12/89 *
- * *
- ****************************************************************/
-
- /****************************************************************
- * *
- * Plotlibrary Includedateien *
- * *
- ****************************************************************/
-
- #include "Plot.h" /* allg. Includes */
- #include "DebugL2.h" /* und eigene einlesen */
-
- /****************************************************************
- * *
- * externe Variablen *
- * *
- ****************************************************************/
-
- extern struct Plot *plot; /* Plotpointer */
- extern int plerr; /* Fehlervariable */
-
- /****************************************************************
- * *
- * Function : displaydata() *
- * *
- *****************************************************************
- * *
- * Input : int id ID der Kurve *
- * *
- * Output : void *
- * *
- *****************************************************************
- * *
- * Comment : Zeigt die Daten einer Kurve welche mit ID bestimmt *
- * wurde. Diese Funktion sollte nur zum debbugen *
- * verwendet werde. *
- * *
- ****************************************************************/
-
- void displaydata(id)
- int id;
- {
- struct Curve *curve; /* Kurvenzeiger */
-
- curve = slistid(id); /* suche Kurve */
- if (curve) /* gefunden ? */
- dispdata(curve); /* dann zeige Daten */
- else /* sonst */
- dis_ploterror(); /* zeige Fehler */
- }
-
- /****************************************************************
- * *
- * Function : displaycurve() *
- * *
- *****************************************************************
- * *
- * Input : int id ID der Kurve *
- * *
- * Output : void *
- * *
- *****************************************************************
- * *
- * Comment : Zeigt die Kurvenstruktur einer Kurve welche mit ID *
- * bestimmt wurde. Diese Funktion sollte nur zum *
- * debuggen verwendet werden. *
- * *
- ****************************************************************/
-
- void displaycurve(id)
- int id;
- {
- struct Curve *curve; /* Kurvenzeiger */
-
- curve = slistid(id); /* suche Kurve */
- if (curve) /* gefunden ? */
- dispcurve(curve); /* dann zeige Kurvenstruk. */
- else /* sonst */
- dis_ploterror(); /* zeige Fehler */
- }
-
- /****************************************************************
- * *
- * Function : dispdata() *
- * *
- *****************************************************************
- * *
- * Input : curve *
- * struct Curve *curve welche Kurvendaten *
- * *
- * Output : void *
- * *
- *****************************************************************
- * *
- * Comment : listet die Daten einer bestimmten Kurve anhand *
- * ihres Darstellungstypes. Diese Funktion sollte nur *
- * zum debuggen verwendet werden. *
- * *
- ****************************************************************/
-
- void dispdata(curve)
- struct Curve *curve;
- {
- DATA *array=curve->val; /* Datenzeiger */
- int i; /* allg Zähler */
-
- if (curve != NULL) /* Kurve vorhanden */
- { /* dann zeigen */
- printf("Kurvendaten der Kurve %d :\n",curve->id);
- /* Header */
- for (i=0;i<curve->count;i++) /* alle Daten zeigen */
- { /* Zahlen ausgeben */
- printf("[%d]\tx : % lG",i+1,*array++);
- printf("\ty : % lG",*array++);
- if (plot->typ != D3) /* je nach Typ 2 oder 3 */
- printf("\n");
- else
- printf("\tz : % lG\n",*array++);
- }
- printf("Ende Kurvendaten\n\n");
- }
- else
- printf("Null Pointer für Kurve als Parameter");
- }
-
- /****************************************************************
- * *
- * Function : dispplot() *
- * *
- *****************************************************************
- * *
- * Input : void *
- * *
- * Output : void *
- * *
- *****************************************************************
- * *
- * Comment : zeigt die Plotstruktur. Diese Funktion sollte nur *
- * zum debuggen verwendet werden. *
- * *
- ****************************************************************/
-
- void dispplot()
- {
-
- char *names[] =
- {
- "Titel",
- "Xname",
- "Xunit",
- "Yname",
- "Yunit",
- "Zname",
- "Zunit",
- "Plotout"
- };
-
- char **name;
- int i;
-
- if (plot) /* nur zeigen wenn def. */
- {
- printf("P L O T - Struktur\n");
-
- /****************************************************************
- * *
- * Zuerst werden alle Parameter dargestellt *
- * *
- ****************************************************************/
-
- printf(" Typ : %d\t",plot->typ);
- printf(" Grid : %d\t",plot->grid);
- printf(" Clipp : %d\t",plot->clipp);
- printf("Autoval : %d\n",plot->autoval);
-
- printf(" Xmes : %d\t",plot->xmes);
- printf(" Ymes : %d\t",plot->ymes);
- printf(" Zmes : %d\n",plot->zmes);
-
- printf(" Count : %d\t",plot->count);
- printf(" CurrID : %d\n",plot->currid);
-
- printf(" Disp : %d\t",plot->disp);
- printf(" MaxCol : %d\n",plot->maxcol);
-
- printf(" Xpic1 : %d\t",plot->xpic1);
- printf(" XPic2 : %d\t",plot->xpic2);
- printf(" XSize : %d\n",plot->xsize);
-
- printf(" Ypic1 : %d\t",plot->ypic1);
- printf(" YPic2 : %d\t",plot->ypic2);
- printf(" YSize : %d\n",plot->ysize);
-
- printf(" XText : %d\t",plot->xtext);
- printf(" YText : %d\n",plot->ytext);
-
- printf(" Xout : %d\t",plot->xout);
- printf(" Yout : %d\t",plot->yout);
- printf("Xlength : %d\t",plot->xlength);
- printf("Ylength : %d\n",plot->ylength);
-
- printf(" First : %p\t",plot->first);
- printf(" Last : %p\n\n",plot->last);
-
- printf(" Xmin : % lG\t",plot->xmin);
- printf(" Xmax : % lG\n",plot->xmax);
- printf(" XStep : % lG\t",plot->xstep);
- printf(" XGmin : % lG\t",plot->xgridmin);
- printf(" XGmax : % lG\n",plot->xgridmax);
-
- printf(" Ymin : % lG\t",plot->ymin);
- printf(" Ymax : % lG\n",plot->ymax);
- printf(" YStep : % lG\t",plot->ystep);
- printf(" YGmin : % lG\t",plot->ygridmin);
- printf(" YGmax : % lG\n",plot->ygridmax);
-
- printf(" Zmin : % lG\t",plot->zmin);
- printf(" Zmax : % lG\n",plot->zmax);
- printf(" ZStep : % lG\t",plot->zstep);
- printf(" ZGmin : % lG\t",plot->zgridmin);
- printf(" ZGmax : % lG\n\n",plot->zgridmax);
-
- /****************************************************************
- * *
- * Jetzt kommen die Texte *
- * *
- ****************************************************************/
-
- name = &plot->titel;
- for (i=0;i<MAXNAMES;i++)
- {
- if (*name)
- printf(" %s : %s\n",names[i],*name);
- else
- printf(" %s : NULL\n",names[i]);
- name++;
- }
-
- printf("Ende der P L O T - Struktur\n\n");
- }
- else
- printf("Plot nicht definiert\n");
- }
-
- /****************************************************************
- * *
- * Function : dispcurve() *
- * *
- *****************************************************************
- * *
- * Input : curve *
- * struct Curve *curve *
- * *
- * Output : void *
- * *
- *****************************************************************
- * *
- * Comment : zeigt die Kurvenstruktur. Diese Funktion sollte *
- * nur zum debuggen verwendet werden. *
- * *
- ****************************************************************/
-
- void dispcurve(curve)
- struct Curve *curve;
- {
- if (curve) /* nur wenn Kurve existiert */
- {
- printf("C U R V E - Struktur\n");
- printf(" Next : %p\t",curve->next);
- printf(" Value : %p\n",curve->val);
-
- if (curve->titel)
- printf(" Titel : %s\t",curve->titel);
- else
- printf(" Titel : NULL\t");
- printf(" ID : %d\n",curve->id);
-
- printf(" Color : %d\t",curve->color);
- printf(" Count : %d\t",curve->count);
- printf(" MaxCnt : %d\n\n",curve->maxcount);
-
- printf(" Xmin : % lG\t",curve->xmin);
- printf(" Xmax : % lG\n",curve->xmax);
-
- printf(" Ymin : % lG\t",curve->ymin);
- printf(" Ymax : % lG\n",curve->ymax);
-
- printf(" Zmin : % lG\t",curve->zmin);
- printf(" Zmax : % lG\n\n",curve->zmax);
-
- printf("Ende der C U R V E - Struktur\n\n");
- }
- else
- printf("Curve nicht definiert\n");
- }
-
-