home *** CD-ROM | disk | FTP | other *** search
- #include "header.h"
- #include "file.h"
-
- /************************************************************************/
- /** print routines: part 1 **/
- /************************************************************************/
- /* contains: printintro
- printoutputhdr
- printstgdat
- printstgdatHARD
- printseqdat1
- printseqdat
- printseqdatHARD
- */
-
- /********************************/
- /* function: printintro */
- /********************************/
- /* prints out title page information */
- printintro (termq, fileq)
- int termq, fileq;
- {
- #if PC
- int i;
- #endif
-
- #if PC
- if (termq) {
- i = 1;
- printline(4, LNWID, '-'); /* to file and printer only */
- clrscr1(3);
- clrscr1(1);
- gotoxy(1, i++);
- highvideo();
- cprintf("%sStages Program [Version %s]", tab, VERSION);
- normvideo();
- i++;
- gotoxy(1, i++);
- cprintf("%sA Spermatogenesis Stage Predictor Program", tab);
- gotoxy(1, i++);
- cprintf("%sDeveloped at the University of Illinois, Urbana, IL", tab);
- gotoxy(1, i++);
- cprintf("%s Programmer: Paul P. Chen", tab);
- i++;
- gotoxy(1, i++);
- cprintf("%sDirect correspondence to:", tab);
- gotoxy(1, i++);
- cprintf("%s Dr. Rex A. Hess", tab);
- gotoxy(1, i++);
- cprintf("%s Veterinary Biosciences", tab);
- gotoxy(1, i++);
- cprintf("%s University of Illinois at Urbana-Champaign", tab);
- gotoxy(1, i++);
- cprintf("%s 2001 S. Lincoln Ave.", tab);
- gotoxy(1, i++);
- cprintf("%s Urbana, IL 61801", tab);
- gotoxy(1, i++);
- cprintf("%s Tel: 217/333-8933 or 333-2506", tab);
- gotoxy(1, i++);
- cprintf("%s FAX: 217/333-4628", tab);
- clrscr1(3);
- gotoxy(9, 2);
- cprintf("Created using Turbo C, copyright Borland 1987, 1988.");
- hitreturn(1);
- } /* if termq */
-
- if (HARDCOPY) {
- introprint = 1;
- fprintf(stdprn, "\n\n");
- printline(2, LNWID, '-');
- fprintf(stdprn, "\tStages Program [Version %s]\n", VERSION);
- fprintf(stdprn, "\tA Spermatogenesis Stage Predictor Program\n");
- fprintf(stdprn, "\tDeveloped at the University of Illinois, ");
- fprintf(stdprn, "Urbana, IL\n");
- fprintf(stdprn, "\t Programmer: Paul P. Chen\n\n");
- fprintf(stdprn, "\tDirect correspondence to:\n");
- fprintf(stdprn, "\t Dr. Rex A. Hess\n");
- fprintf(stdprn, "\t Veterinary Biosciences\n");
- fprintf(stdprn, "\t University of Illinois at ");
- fprintf(stdprn, "Urbana-Champaign\n");
- fprintf(stdprn, "\t 2001 S. Lincoln Avenue\n");
- fprintf(stdprn, "\t Urbana, IL 61801\n");
- fprintf(stdprn, "\t Tel: 217/333-8933 or 333-2506\n");
- fprintf(stdprn, "\t FAX: 217/333-4628\n\n");
- fprintf(stdprn, "\tCreated using Turbo C, ");
- fprintf(stdprn, "copyright Borland 1987, 1988.\n");
- printline(2, LNWID, '-');
- } /* if HARDCOPY */
- #else
- if (termq) {
- printf("\n\n");
- printline(0, LNWID, '-');
- printf("\tStages Program [Version %s]\n\n", VERSION);
- printf("\tA Spermatogenesis Stage Predictor Program\n");
- printf("\tDeveloped at the University of Illinois, Urbana, IL\n");
- printf("\t Programmer: Paul P. Chen\n\n");
- printf("\tDirect correspondence to:\n");
- printf("\t Dr. Rex A. Hess\n");
- printf("\t Veterinary Biosciences\n");
- printf("\t University of Illinois at Urbana-Champaign\n");
- printf("\t 2001 S. Lincoln Ave.\n");
- printf("\t Urbana, IL 61801\n");
- printf("\t Tel: 217/333-8933 or 333-2506\n");
- printf("\t FAX: 217/333-4628\n\n");
- printf("\tCreated using Turbo C, ");
- printf("copyright Borland 1987, 1988.\n");
- printline(0, LNWID, '-');
- } /* if termq */
- #endif
-
- if (fileq) {
- fprintf(fpout, "\n\n");
- printline(1, LNWID, '-');
- fprintf(fpout, "\tStages Program [Version %s]\n", VERSION);
- fprintf(fpout, "\tA Spermatogenesis Stage Predictor Program\n");
- fprintf(fpout, "\tDeveloped at the University of Illinois, ");
- fprintf(fpout, "Urbana, IL\n");
- fprintf(fpout, "\t Programmer: Paul P. Chen\n\n");
- fprintf(fpout, "\tDirect correspondence to:\n");
- fprintf(fpout, "\t Dr. Rex A. Hess\n");
- fprintf(fpout, "\t Veterinary Biosciences\n");
- fprintf(fpout, "\t University of Illinois at ");
- fprintf(fpout, "Urbana-Champaign\n");
- fprintf(fpout, "\t 2001 S. Lincoln Avenue\n");
- fprintf(fpout, "\t Urbana, IL 61801\n");
- fprintf(fpout, "\t Tel: 217/333-8933 or 333-2506\n");
- fprintf(fpout, "\t FAX: 217/333-4628\n\n");
- fprintf(fpout, "\tCreated using Turbo C, ");
- fprintf(fpout, "copyright Borland 1987, 1988.\n");
- printline(1, LNWID, '-');
- } /* if fileq */
- return(0);
- } /* printintro */
-
- /********************************/
- /* function: printoutputhdr */
- /********************************/
- printoutputhdr (argc, argv, pbadipfil, interactive, ok,
- ipfil, opfil, stgfil, seqfil)
- int argc;
- char *argv[];
- int *pbadipfil, interactive, ok;
- char *ipfil, *opfil, *stgfil, *seqfil;
- {
- int j, ok1, val;
- char dummy[MAXLEN]; /* user string input (y/n) */
- #if PC
- int i;
-
- i = 3;
- printline(4, LNWID, '-'); /* to file and printer only */
- topline(""); /* puts animal name at top */
- clrscr1(1);
- gotoxy(1, i++);
- cprintf("%sStages Program Output", tab);
- gotoxy(1, i++);
- cprintf("%sCalled by command: ", tab);
- if (HARDCOPY) {
- fprintf(stdprn, "\tStages Program Output\n\n");
- fprintf(stdprn, "\tCalled by command: ");
- }
- #else
- printf("\n\n");
- printline(3, LNWID, '-');
- printf("\tStages Program Output\n\n");
- printf("\tCalled by command: ");
- #endif
- if (FILEq && FILECOPY) {
- fprintf(fpout, "\tStages Program Output\n\n");
- fprintf(fpout, "\tCalled by command: ");
- }
-
- for ( j=0; j<argc; j++ ) {
- #if PC
- cprintf(" %s", argv[j]);
- if (HARDCOPY)
- fprintf(stdprn, " %s", argv[j]);
- #else
- printf(" %s", argv[j]);
- #endif
- if (FILEq && FILECOPY)
- fprintf(fpout, " %s", argv[j]);
- } /* for j */
-
- #if PC
- i++; /* skip a line */
- if (HARDCOPY)
- fprintf(stdprn, "\n\n");
- #else
- printf("\n\n");
- #endif
- if (FILEq && FILECOPY)
- fprintf(fpout, "\n\n");
-
- if (! ok) {
- #if PC
- msgwin();
- gotoxy(1, 1);
- cprintf("%sUnrecognized option(s) ignored.", tab);
- if (HARDCOPY)
- fprintf(stdprn, "\tUnrecognized option(s) ignored.\n\n");
- #else
- printf("\tUnrecognized option(s) ignored.\n\n");
- #endif
- if (FILEq && FILECOPY)
- fprintf(fpout, "\tUnrecognized option(s) ignored.\n\n");
- } /* !ok */
-
- if (*pbadipfil) { /* interactive because ipfil not found */
- /* reset badipfil: don't want to print out this error msg more than once */
- *pbadipfil = 0;
- #if PC
- msgwin();
- gotoxy(1, 2);
- cprintf("%sInvalid batch input file <%s> specified.", tab, ipfil);
- gotoxy(1, 3);
- cprintf("%sInput must be entered interactively.", tab);
- outputwin();
- gotoxy(1, i++);
- cprintf("%sInput must be entered interactively.", tab);
- if (HARDCOPY) {
- fprintf(stdprn, "\tInvalid batch input file <%s> specified.\n", ipfil);
- fprintf(stdprn, "\t Input must be entered interactively.\n");
- }
- #else
- printf("\tInvalid batch input file <%s> specified.\n", ipfil);
- printf("\t Input must be entered interactively.\n");
- #endif
- if (FILEq && FILECOPY) {
- fprintf(fpout, "\tInvalid batch input file <%s> specified.\n", ipfil);
- fprintf(fpout, "\t Input entered interactively.\n");
- }
- } else { /* !badipfil */
- if (interactive) {
- #if PC
- outputwin();
- gotoxy(1, i++);
- cprintf("%sInput entered interactively.", tab);
- if (HARDCOPY)
- fprintf(stdprn, "\tInput entered interactively.\n");
- #else
- printf("\tInput entered interactively.\n");
- #endif
- if (FILEq && FILECOPY)
- fprintf(fpout, "\tInput entered interactively.\n");
- } else { /* input from file */
- #if PC
- outputwin();
- gotoxy(1, i++);
- cprintf("%sInput taken from file <%s>.", tab, ipfil);
- if (HARDCOPY)
- fprintf(stdprn, "\tInput taken from file <%s>.\n", ipfil);
- #else
- printf("\tInput taken from file <%s>.\n", ipfil);
- #endif
- if (FILEq && FILECOPY)
- fprintf(fpout, "\tInput taken from file <%s>.\n", ipfil);
- } /* ! interactive */
- } /* !badipfil */
-
- if (strcmp(opfil, "None")) {
- #if PC
- outputwin();
- gotoxy(1, i++);
- cprintf("%sOutput appended to file <%s>.", tab, opfil);
- if (HARDCOPY)
- fprintf(stdprn,"\tOutput appended to file <%s>.\n\n", opfil);
- #else
- printf("\tOutput appended to file <%s>.\n\n", opfil);
- #endif
- if (FILEq && FILECOPY)
- fprintf(fpout,"\tOutput appended to file <%s>.\n\n", opfil);
- } /* if output file */
-
- /* don't need to echo this info, user neither knows nor cares */
- #if PC
- /*
- i++;
- outputwin();
- gotoxy(1, i++);
- cprintf("%sCycle stage data from file <%s>.", tab, stgfil);
- gotoxy(1, i++);
- cprintf("%sCell sequence data from file <%s>.", tab, seqfil);
- i++;
- */
- i += 3; /* skip a few lines */
- gotoxy(1, i++);
- cprintf("%sDefault Cycle Length: %.2lf days", tab, CycleTime);
- if (HARDCOPY) {
- /*
- fprintf(stdprn, "\tCycle stage data from ");
- fprintf(stdprn, "file <%s>.\n", stgfil);
- fprintf(stdprn, "\tCell sequence data from ");
- fprintf(stdprn, "file <%s>.\n\n", seqfil);
- */
- fprintf(stdprn, "\tDefault Cycle Length: %.2lf days.\n", CycleTime);
- }
- #else
- /*
- printf("\tCycle stage data from file <%s>.\n", stgfil);
- printf("\tCell sequence data from file <%s>.\n\n", seqfil);
- */
- printf("\tDefault Cycle Length: %.2lf days.\n", CycleTime);
- #endif
- if (FILEq && FILECOPY) {
- /*
- fprintf(fpout, "\tCycle stage data from ");
- fprintf(fpout, "file <%s>.\n", stgfil);
- fprintf(fpout, "\tCell sequence data from ");
- fprintf(fpout, "file <%s>.\n\n", seqfil);
- */
- fprintf(fpout, "\tDefault Cycle Length: %.2lf days.\n", CycleTime);
- }
-
- ok1 = 0;
- while (! ok1) {
- #if PC
- printline(4, LNWID, '-');
- clrscr1(2);
- cprintf("%sDo you wish to change the default Cycle Length (y/n)?", tab);
- gotoxy(1, 2);
- highvideo();
- cprintf("%s%c%c%c ", tab2, HBAR, HBAR, RTRI);
- normvideo();
- val = getusrstr(dummy);
- if (HARDCOPY) {
- fprintf(stdprn, "\n\tDo you wish to change the default Cycle Length");
- fprintf(stdprn, " (y/n)?\n\t\t==> %s\n\n", dummy);
- }
- if (val) return(val);
- #else
- printline(3, LNWID, '-');
- printf("\n\tDo you wish to change the default Cycle Length? (y/n)\n");
- printf("\t\t==> ");
- val = getusrstr(dummy);
- #endif
- if (FILEq && FILECOPY) {
- fprintf(fpout, "\n\tDo you wish to change the default Cycle Length");
- fprintf(fpout, " (y/n)?\n\t\t==> %s\n\n", dummy);
- }
- switch (dummy[0]) {
- case 'y':
- case 'Y':
- return(104); /* goto cycle length menu */
- case 'n':
- case 'N':
- return(105); /* goto cell i/p menu */
- default:
- #if PC
- clrscr1(3);
- cprintf("%s%s: Please type either 'y' or 'n'.", tab, ERRSTR);
- if (HARDCOPY)
- fprintf(stdprn, "\t%s: Please type either 'y' or 'n'.\n\n", ERRSTR);
- #else
- printf("\t%s: Please type either 'y' or 'n'.\n\n", ERRSTR);
- #endif
- if (FILEq && FILECOPY)
- fprintf(fpout, "\t%s: Please type either 'y' or 'n'.\n\n", ERRSTR);
- } /* switch */
- } /* while ! ok */
- return(0);
- } /* printoutputhdr */
-
- /********************************/
- /* function: printstgdat */
- /********************************/
- /* prints out cycle stage data
- returns 1 if printed ok, 0 if no animal exists to be printed */
- printstgdat ()
- {
- FILE *fil; /* ptr to ref dat info file */
- int j, half;
- char c, lastc;
- #if PC
- int i;
- #endif
-
- if (strcmp(Animal, "None")==0) {
- #if PC
- clrscr1(1);
- gotoxy(1, 5);
- cprintf("%sNo animal has been selected yet.", tab);
- gotoxy(1, 6);
- cprintf("%sPlease use the Animal Menu to select an animal.", tab);
- hitreturn(1);
- if (HARDCOPY) {
- togglepr();
- fprintf(stdprn, "\n\tNo animal has been selected yet.\n");
- fprintf(stdprn, "\tPlease use the Animal Menu to select an animal.\n");
- }
- #else
- printf("\n\tNo animal has been selected yet.\n");
- printf("\tPlease use the Animal Menu to select an animal.\n");
- #endif
- #if VERBOSE
- if (FILEq && FILECOPY) {
- fprintf(fpout, "\n\tNo animal has been selected yet.\n");
- fprintf(fpout, "\tPlease use the Animal Menu to select an animal.\n");
- }
- #endif
- return(0);
- } /* if no Animal */
-
- #if PC
- i = 1;
- clrscr1(1);
- gotoxy(1, i++);
- cprintf("%sCycle length = %7.4lf days", tab, CycleTime);
- if (NewCycleTime)
- cprintf(" <new Cycle length>");
- else
- cprintf(" <default Cycle length>");
- #else
- printf("\n\t%s\n", Animal);
- printf("\tCycle length = %5.2lf days", CycleTime);
- if (NewCycleTime)
- printf(" <new Cycle length>\n\n");
- else
- printf(" <default Cycle length>\n\n");
- #endif
- if (FILEq && FILECOPY) {
- fprintf(fpout, "\n\t%s\n", Animal);
- fprintf(fpout, "\tCycle length = %5.2lf days", CycleTime);
- if (NewCycleTime)
- fprintf(fpout, " <new Cycle length>\n");
- else
- fprintf(fpout, " <default Cycle length>\n");
- }
-
- half = (int) (NumStages / 2);
- if (NumStages % 2) half++;
-
- for ( j=0; j<half; j++ ) {
- #if PC
- if (i >= OUTPUTLNS) {
- hitreturn(1);
- clrscr1(1);
- i = 1;
- gotoxy(1, i++);
- cprintf("%sCycle length = %5.2lf days", tab, CycleTime);
- }
- gotoxy(1, i++);
- cprintf("%s Stage %2d = %5.2lf days%s", tab, j+1, stage[j], tab);
- if ((j+half+1) <= NumStages)
- cprintf("Stage %2d = %5.2lf days", j+1+half, stage[j+half]);
- #else
- printf("\t Stage %2d = %5.2lf days%s", j+1, stage[j], tab);
- if ((j+half+1) <= NumStages)
- printf("Stage %2d = %5.2lf days\n", j+1+half, stage[j+half]);
- else
- printf("\n");
- #endif
- if (FILEq && FILECOPY) {
- fprintf(fpout, "\t Stage %2d = %5.2lf days%s", j+1, stage[j], tab);
- if ((j+half+1) <= NumStages)
- fprintf(fpout, "Stage %2d = %5.2lf days\n", j+1+half, stage[j+half]);
- else
- fprintf(fpout, "\n");
- }
- } /* for j */
-
- #if PC
- gotoxy(1, i++);
- cprintf("%s%s Epididymis transit time = %.2lf days", tab, tab, EpiTime);
- #else
- printf("\n\t\t Epididymis transit time = %.2lf days\n", EpiTime);
- #endif
- if (FILEq && FILECOPY) {
- fprintf(fpout, "\n\t\t Epididymis transit time = %.2lf days\n", EpiTime);
- }
-
- /* echo reference data */
- switch (AnimalNum) {
- case 0: /* Sprague-Dawley rat */
- fil = fopen("sdrat.ref", "r");
- break;
- case 1: /* Sherman rat */
- fil = fopen("shrat.ref", "r");
- break;
- case 2: /* hamster */
- fil = fopen("hamster.ref", "r");
- break;
- case 3: /* c3h mouse */
- fil = fopen("c3h.ref", "r");
- break;
- case 4: /* dog */
- fil = fopen("dog.ref", "r");
- break;
- default: /* shouldn't! */
- fil = fopen("sdrat.ref", "r");
- } /* switch */
-
- i--; /* so don't skip a line */
- /* echo cell seq information */
- #if PC
- lastc = 10; /* ! CR */
- #endif
- while ((c = getc(fil)) != EOF) {
- #if PC
- if (lastc==10) {
- i++;
- gotoxy(3, i);
- } /* if */
- cprintf("%c", c);
- #else
- printf("%c", c);
- #endif
- if (FILEq && FILECOPY)
- fprintf(fpout, "%c", c);
- lastc = c;
- } /* while */
- fclose(fil);
- return(1);
- } /* printstgdat */
-
- #if PC
- /*********************************/
- /* function: printstgdatHARD */
- /*********************************/
- /* prints out cycle stage data to the printer */
- printstgdatHARD ()
- {
- FILE *fil; /* ptr to ref data info file */
- int j, half;
- char c;
-
- if (strcmp(Animal, "None")==0) {
- clrscr1(1);
- gotoxy(1, 5);
- cprintf("%sNo animal has been selected yet.", tab);
- gotoxy(1, 6);
- cprintf("%sPlease use the Animal Menu to select an animal.", tab);
- hitreturn(1);
- if (HARDCOPY) {
- togglepr();
- fprintf(stdprn, "\n\tNo animal has been selected yet.\n");
- fprintf(stdprn, "\tPlease use the Animal Menu to select an animal.\n");
- }
- return(0);
- } /* if no Animal */
-
- if (HARDCOPY) {
- togglepr();
- fprintf(stdprn, "\n\t%s\n", Animal);
- fprintf(stdprn, "\tCycle length = %5.2lf days", CycleTime);
- if (NewCycleTime)
- fprintf(stdprn, " <new Cycle length>\n");
- else
- fprintf(stdprn, " <default Cycle length>\n");
-
- half = (int) (NumStages / 2);
- if (NumStages % 2) half++;
-
- for ( j=0; j<half; j++ ) {
- fprintf(stdprn, "\t Stage %2d = %5.2lf days%s", j+1, stage[j], tab);
- if ((j+half+1) <= NumStages)
- fprintf(stdprn, "Stage %2d = %5.2lf days\n", j+1+half, stage[j+half]);
- else
- fprintf(stdprn, "\n");
- } /* for j */
-
- fprintf(stdprn, "\n\t\t Epididymis transit time = %.2lf days\n",
- EpiTime);
-
- switch (AnimalNum) {
- case 0: /* Sprague-Dawley rat */
- fil = fopen("sdrat.ref", "r");
- break;
- case 1: /* Sherman rat */
- fil = fopen("shrat.ref", "r");
- break;
- case 2: /* hamster */
- fil = fopen("hamster.ref", "r");
- break;
- case 3: /* c3h mouse */
- fil = fopen("c3h.ref", "r");
- break;
- case 4: /* dog */
- fil = fopen("dog.ref", "r");
- break;
- default: /* shouldn't! */
- fil = fopen("sdrat.ref", "r");
- } /* switch */
-
- rewind(fil);
- while ((c = getc(fil)) != EOF)
- fprintf(stdprn, "%c", c);
- } /* if HARDCOPY */
-
- fclose(fil);
- return(1);
- } /* printstgdatHARD */
-
- #endif
-
- /********************************/
- /* function: printseqdat1 */
- /********************************/
- /* prints out cell sequence data (list of cell names, in sequence)
- returns 1 if printed ok, 0 if no animal exists to be printed */
- /* this is the old printseqdat. the new one follows
- this function performs on-the-fly formatting of the info
- the new func just reads files and cats them to the screen */
- printseqdat1 ()
- {
- int i, j; /* loop indices */
- int col; /* number of columns for output */
- int row; /* number of rows for output */
- #if PC
- int k;
- #endif
-
- if (strcmp(Animal, "None")==0) {
- #if PC
- clrscr1(1);
- gotoxy(1, 5);
- cprintf("%sNo animal has been selected yet.", tab);
- gotoxy(1, 6);
- cprintf("%sPlease use the Animal Menu to select an animal.", tab);
- if (HARDCOPY) {
- fprintf(stdprn, "\n\tNo animal has been selected yet.\n");
- fprintf(stdprn, "\tPlease use the Animal Menu to select an animal.\n");
- }
- hitreturn(1);
- #else
- printf("\n\tNo animal has been selected yet.\n");
- printf("\tPlease use the Animal Menu to select an animal.\n");
- #endif
- #if VERBOSE
- if (FILEq && FILECOPY) {
- fprintf(fpout, "\n\tNo animal has been selected yet.\n");
- fprintf(fpout, "\tPlease use the Animal Menu to select an animal.\n");
- }
- #endif
- return(0);
- } /* if no Animal */
-
- #if PC
- k = 1;
- clrscr1(1);
- gotoxy(1, k++);
- #else
- printf("\n\t%s : ", Animal);
- printf("Cell Sequence Data\n");
- #endif
- if (FILEq && FILECOPY) {
- fprintf(fpout, "\n\t%s : ", Animal);
- fprintf(fpout, "Cell Sequence Data\n");
- }
-
- col = 6;
- row = NumCellSeq / col;
- if (NumCellSeq % col) row++;
-
- #if (! PC)
- printf("\n");
- #endif
- if (FILEq && FILECOPY) fprintf(fpout, "\n");
-
- /* for printing out cells in order, down columns (vertical order) */
- for ( i=0; i<row; i++ ) {
- for ( j=0; j<col; j++ ) {
- if ((j*row+i+1) <= NumCellSeq) {
- if (j==(col-1)) { /* prevent extra spaces in last col */
- #if PC
- cprintf("%2d: %6s", j*row+i+1, CellNames[j*row+i]);
- #else
- printf("%2d: %6s", j*row+i+1, CellNames[j*row+i]);
- #endif
- } else {
- #if PC
- cprintf("%2d: %6s ", j*row+i+1, CellNames[j*row+i]);
- #else
- printf("%2d: %6s ", j*row+i+1, CellNames[j*row+i]);
- #endif
- }
- if (FILEq && FILECOPY)
- fprintf(fpout, "%2d: %6s ", j*row+i+1, CellNames[j*row+i]);
- } /* if */
- } /* for j */
- #if PC
- if ((k >= OUTPUTLNS) && (i < (row-1))) {
- /* on last line and there's more to go */
- hitreturn(1);
- clrscr1(1);
- k = 1;
- gotoxy(1, k++);
- cprintf("%s%s : ", tab, Animal);
- cprintf("Cell Sequence Data");
- } /* if */
- gotoxy(1, k++);
- #else
- printf("\n");
- #endif
- if (FILEq && FILECOPY) fprintf(fpout, "\n");
- } /* for i */
-
- /* prints out seq dat to the printer, if hitreturn returns F8 */
- #if PC
- hitreturn(1);
- if (HARDCOPY) {
- togglepr();
- fprintf(stdprn, "\n\t%s : ", Animal);
- fprintf(stdprn, "Cell Sequence Data");
- fprintf(stdprn, "\n");
-
- /* for printing out cells in order, down columns (vertical order) */
- for ( i=0; i<row; i++ ) {
- for ( j=0; j<col; j++ ) {
- if ((j*row+i+1) <= NumCellSeq) {
- if (j==(col-1)) /* prevent extra spaces in last col */
- fprintf(stdprn, "%2d: %6s ", j*row+i+1, CellNames[j*row+i]);
- } /* if */
- } /* for j */
- fprintf(stdprn, "\n");
- } /* for i */
- } /* if HARDCOPY */
- #endif
- return(1);
- } /* printseqdat1 */
-
- /********************************/
- /* function: printseqdat */
- /********************************/
- /* prints out cell sequence data (list of cell names, in sequence)
- returns 1 if printed ok, 0 if no animal exists to be printed */
- /* this is the new printseqdat. this just reads files and cats
- them to the screen. no on-the-fly formatting done here. */
- printseqdat ()
- {
- FILE *fil1; /* file pointer to seq dat listing file */
- FILE *fil2; /* file pointer to ref dat listing file */
- char c; /* input char read */
- char lastc; /* last input char read */
- #if PC
- int j; /* line counter */
- #endif
-
- if (strcmp(Animal, "None")==0) {
- #if PC
- clrscr1(1);
- gotoxy(1, 5);
- cprintf("%sNo animal has been selected yet.", tab);
- gotoxy(1, 6);
- cprintf("%sPlease use the Animal Menu to select an animal.", tab);
- if (HARDCOPY) {
- fprintf(stdprn, "\n\tNo animal has been selected yet.\n");
- fprintf(stdprn, "\tPlease use the Animal Menu to select an animal.\n");
- }
- hitreturn(1);
- #else
- printf("\n\tNo animal has been selected yet.\n");
- printf("\tPlease use the Animal Menu to select an animal.\n");
- #endif
- #if VERBOSE
- if (FILEq && FILECOPY) {
- fprintf(fpout, "\n\tNo animal has been selected yet.\n");
- fprintf(fpout, "\tPlease use the Animal Menu to select an animal.\n");
- }
- #endif
- return(0);
- } /* if no Animal */
-
- #if PC
- j = 0;
- clrscr1(1);
- #else
- printf("%s : ", Animal);
- printf("Cell Sequence Data\n\n");
- #endif
- if (FILEq && FILECOPY) {
- fprintf(fpout, "%s : ", Animal);
- fprintf(fpout, "Cell Sequence Data\n\n");
- }
-
- switch (AnimalNum) {
- case 0: /* Sprague-Dawley rat */
- fil1 = fopen("sdrat.fil", "r");
- fil2 = fopen("sdrat.ref", "r");
- break;
- case 1: /* Sherman rat */
- fil1 = fopen("shrat.fil", "r");
- fil2 = fopen("shrat.ref", "r");
- break;
- case 2: /* hamster */
- fil1 = fopen("hamster.fil", "r");
- fil2 = fopen("hamster.ref", "r");
- break;
- case 3: /* c3h mouse */
- fil1 = fopen("c3h.fil", "r");
- fil2 = fopen("c3h.ref", "r");
- break;
- case 4: /* dog */
- fil1 = fopen("dog.fil", "r");
- fil2 = fopen("dog.ref", "r");
- break;
- default: /* shouldn't! */
- fil1 = fopen("sdrat.fil", "r");
- fil2 = fopen("sdrat.ref", "r");
- } /* switch */
-
- /* echo cell seq information */
- #if PC
- lastc = 10; /* CR */
- #endif
- while ((c = getc(fil1)) != EOF) {
- #if PC
- if (lastc==10) {
- j++;
- gotoxy(3, j);
- } /* if */
- cprintf("%c", c);
- #else
- printf("%c", c);
- #endif
- if (FILEq && FILECOPY)
- fprintf(fpout, "%c", c);
- lastc = c;
- } /* while */
- fclose(fil1);
-
- /* echo reference information */
- #if PC
- lastc = 10; /* CR */
- #endif
- while ((c = getc(fil2)) != EOF) {
- #if PC
- if (lastc==10) {
- j++;
- gotoxy(3, j);
- } /* if */
- cprintf("%c", c);
- #else
- printf("%c", c);
- #endif
- if (FILEq && FILECOPY)
- fprintf(fpout, "%c", c);
- lastc = c;
- } /* while */
- fclose(fil2);
-
- return(1);
- } /* printseqdat */
-
- #if PC
- /*********************************/
- /* function: printseqdatHARD */
- /*********************************/
- /* prints out cell sequence data to the printer */
- printseqdatHARD ()
- {
- FILE *fil1; /* file pointer to seq dat listing file */
- FILE *fil2; /* file pointer to ref dat listing file */
- char c; /* input char read */
-
- if (strcmp(Animal, "None")==0) {
- clrscr1(1);
- gotoxy(1, 5);
- cprintf("%sNo animal has been selected yet.", tab);
- gotoxy(1, 6);
- cprintf("%sPlease use the Animal Menu to select an animal.", tab);
- if (HARDCOPY) {
- fprintf(stdprn, "\n\tNo animal has been selected yet.\n");
- fprintf(stdprn, "\tPlease use the Animal Menu to select an animal.\n");
- }
- hitreturn(1);
- return(0);
- } /* if no Animal */
-
- switch (AnimalNum) {
- case 0: /* Sprague-Dawley rat */
- fil1 = fopen("sdrat.fil", "r");
- fil2 = fopen("sdrat.ref", "r");
- break;
- case 1: /* Sherman rat */
- fil1 = fopen("shrat.fil", "r");
- fil2 = fopen("shrat.ref", "r");
- break;
- case 2: /* hamster */
- fil1 = fopen("hamster.fil", "r");
- fil2 = fopen("hamster.ref", "r");
- break;
- case 3: /* c3h mouse */
- fil1 = fopen("c3h.fil", "r");
- fil2 = fopen("c3h.ref", "r");
- break;
- case 4: /* dog */
- fil1 = fopen("dog.fil", "r");
- fil2 = fopen("dog.ref", "r");
- break;
- default: /* shouldn't! */
- fil1 = fopen("sdrat.fil", "r");
- fil2 = fopen("sdrat.ref", "r");
- } /* switch */
-
- if (HARDCOPY) {
- togglepr();
- fprintf(stdprn, "\n%s : ", Animal);
- fprintf(stdprn, "Cell Sequence Data\n\n");
-
- rewind(fil1);
- rewind(fil2);
- while ((c = getc(fil1)) != EOF)
- fprintf(stdprn, "%c", c);
- while ((c = getc(fil2)) != EOF)
- fprintf(stdprn, "%c", c);
- } /* if HARDCOPY */
- fclose(fil1);
- fclose(fil2);
- return(1);
- } /* printseqdatHARD */
- #endif