void display(void) { FS *fs; FU *fu; PR *pr; int cnt; u_char *bp; off_t saveaddress; u_char savech=0, *savebp; while ((bp = get())) for (fs = fshead, savebp = bp, saveaddress = address; fs; fs = fs->nextfs, bp = savebp, address = saveaddress) for (fu = fs->nextfu; fu; fu = fu->nextfu) { if (fu->flags&F_IGNORE) break; for (cnt = fu->reps; cnt; --cnt) for (pr = fu->nextpr; pr; address += pr->bcnt, bp += pr->bcnt, pr = pr->nextpr) { if (eaddress && address >= eaddress && !(pr->flags & (F_TEXT|F_BPAD))) bpad(pr); if (cnt == 1 && pr->nospace) { savech = *pr->nospace; *pr->nospace = '\0'; } print(pr, bp); if (cnt == 1 && pr->nospace) *pr->nospace = savech; } } if (endfu) { /* * If eaddress not set, error or file size was multiple of * blocksize, and no partial block ever found. */ if (!eaddress) { if (!address) { return; } eaddress = address; } for (pr = endfu->nextpr; pr; pr = pr->nextpr) switch(pr->flags) { case F_ADDRESS: (void)printf(pr->fmt, (quad_t)eaddress); break; case F_TEXT: (void)printf("%s", pr->fmt); break; default: break; } } }
display() { extern FU *endfu; register FS *fs; register FU *fu; register PR *pr; register int cnt; register u_char *bp; off_t saveaddress; u_char savech, *savebp, *get(); while (bp = get()) for (fs = fshead, savebp = bp, saveaddress = address; fs; fs = fs->nextfs, bp = savebp, address = saveaddress) for (fu = fs->nextfu; fu; fu = fu->nextfu) { if (fu->flags&F_IGNORE) break; for (cnt = fu->reps; cnt; --cnt) for (pr = fu->nextpr; pr; address += pr->bcnt, bp += pr->bcnt, pr = pr->nextpr) { if (eaddress && address >= eaddress && !(pr->flags&(F_TEXT|F_BPAD))) bpad(pr); if (cnt == 1 && pr->nospace) { savech = *pr->nospace; *pr->nospace = '\0'; } PRINT; if (cnt == 1 && pr->nospace) *pr->nospace = savech; } } if (endfu) { /* * if eaddress not set, error or file size was multiple of * blocksize, and no partial block ever found. */ if (!eaddress) { if (!address) return; eaddress = address; } for (pr = endfu->nextpr; pr; pr = pr->nextpr) switch(pr->flags) { case F_ADDRESS: (void)printf(pr->fmt, eaddress); break; case F_TEXT: (void)printf(pr->fmt); break; } } }
static void display(priv_dumper_t* dumper) { FS *fs; FU *fu; PR *pr; int cnt; unsigned char *bp, *savebp; off_t saveaddress; unsigned char savech = '\0'; while ((bp = get(dumper)) != NULL) { fs = dumper->pub.fshead; savebp = bp; saveaddress = dumper->address; for (; fs; fs = fs->nextfs, bp = savebp, dumper->address = saveaddress) { for (fu = fs->nextfu; fu; fu = fu->nextfu) { if (fu->flags & F_IGNORE) { break; } for (cnt = fu->reps; cnt; --cnt) { for (pr = fu->nextpr; pr; dumper->address += pr->bcnt, bp += pr->bcnt, pr = pr->nextpr) { if (dumper->eaddress && dumper->address >= dumper->eaddress && !(pr->flags & (F_TEXT | F_BPAD)) ) { bpad(pr); } if (cnt == 1 && pr->nospace) { savech = *pr->nospace; *pr->nospace = '\0'; } /* PRINT; */ switch (pr->flags) { case F_ADDRESS: printf(pr->fmt, (unsigned) dumper->address); break; case F_BPAD: printf(pr->fmt, ""); break; case F_C: conv_c(pr, bp); break; case F_CHAR: printf(pr->fmt, *bp); break; case F_DBL: { double dval; float fval; switch (pr->bcnt) { case 4: memcpy(&fval, bp, sizeof(fval)); printf(pr->fmt, fval); break; case 8: memcpy(&dval, bp, sizeof(dval)); printf(pr->fmt, dval); break; } break; } case F_INT: { int ival; short sval; switch (pr->bcnt) { case 1: printf(pr->fmt, (int) *bp); break; case 2: memcpy(&sval, bp, sizeof(sval)); printf(pr->fmt, (int) sval); break; case 4: memcpy(&ival, bp, sizeof(ival)); printf(pr->fmt, ival); break; } break; } case F_P: printf(pr->fmt, isprint_asciionly(*bp) ? *bp : '.'); break; case F_STR: printf(pr->fmt, (char *) bp); break; case F_TEXT: printf(pr->fmt); break; case F_U: conv_u(pr, bp); break; case F_UINT: { unsigned ival; unsigned short sval; switch (pr->bcnt) { case 1: printf(pr->fmt, (unsigned) *bp); break; case 2: memcpy(&sval, bp, sizeof(sval)); printf(pr->fmt, (unsigned) sval); break; case 4: memcpy(&ival, bp, sizeof(ival)); printf(pr->fmt, ival); break; } break; } } if (cnt == 1 && pr->nospace) { *pr->nospace = savech; } } } } } } if (dumper->endfu) { /* * if eaddress not set, error or file size was multiple * of blocksize, and no partial block ever found. */ if (!dumper->eaddress) { if (!dumper->address) { return; } dumper->eaddress = dumper->address; } for (pr = dumper->endfu->nextpr; pr; pr = pr->nextpr) { switch (pr->flags) { case F_ADDRESS: printf(pr->fmt, (unsigned) dumper->eaddress); break; case F_TEXT: printf(pr->fmt); break; } } } }
static void display(void) { /* extern FU *endfu; */ register FS *fs; register FU *fu; register PR *pr; register int cnt; register u_char *bp; off_t saveaddress; u_char savech = 0, *savebp; while ((bp = get()) != NULL) { for (fs = bb_dump_fshead, savebp = bp, saveaddress = address; fs; fs = fs->nextfs, bp = savebp, address = saveaddress) { for (fu = fs->nextfu; fu; fu = fu->nextfu) { if (fu->flags & F_IGNORE) { break; } for (cnt = fu->reps; cnt; --cnt) { for (pr = fu->nextpr; pr; address += pr->bcnt, bp += pr->bcnt, pr = pr->nextpr) { if (eaddress && address >= eaddress && !(pr->flags & (F_TEXT | F_BPAD))) { bpad(pr); } if (cnt == 1 && pr->nospace) { savech = *pr->nospace; *pr->nospace = '\0'; } /* PRINT; */ switch (pr->flags) { case F_ADDRESS: printf(pr->fmt, (unsigned int) address); break; case F_BPAD: printf(pr->fmt, ""); break; case F_C: conv_c(pr, bp); break; case F_CHAR: printf(pr->fmt, *bp); break; case F_DBL:{ double dval; float fval; switch (pr->bcnt) { case 4: memmove((char *) &fval, (char *) bp, sizeof(fval)); printf(pr->fmt, fval); break; case 8: memmove((char *) &dval, (char *) bp, sizeof(dval)); printf(pr->fmt, dval); break; } break; } case F_INT:{ int ival; short sval; switch (pr->bcnt) { case 1: printf(pr->fmt, (int) *bp); break; case 2: memmove((char *) &sval, (char *) bp, sizeof(sval)); printf(pr->fmt, (int) sval); break; case 4: memmove((char *) &ival, (char *) bp, sizeof(ival)); printf(pr->fmt, ival); break; } break; } case F_P: printf(pr->fmt, isprint(*bp) ? *bp : '.'); break; case F_STR: printf(pr->fmt, (char *) bp); break; case F_TEXT: printf(pr->fmt); break; case F_U: conv_u(pr, bp); break; case F_UINT:{ unsigned int ival; unsigned short sval; switch (pr->bcnt) { case 1: printf(pr->fmt, (unsigned int) * bp); break; case 2: memmove((char *) &sval, (char *) bp, sizeof(sval)); printf(pr->fmt, (unsigned int) sval); break; case 4: memmove((char *) &ival, (char *) bp, sizeof(ival)); printf(pr->fmt, ival); break; } break; } } if (cnt == 1 && pr->nospace) { *pr->nospace = savech; } } } } } } if (endfu) { /* * if eaddress not set, error or file bb_dump_size was multiple of * bb_dump_blocksize, and no partial block ever found. */ if (!eaddress) { if (!address) { return; } eaddress = address; } for (pr = endfu->nextpr; pr; pr = pr->nextpr) { switch (pr->flags) { case F_ADDRESS: (void) printf(pr->fmt, (unsigned int) eaddress); break; case F_TEXT: (void) printf(pr->fmt); break; } } } }
void MakeMotTitle ( char *title, char *dattim, char *product, char *level, char *vlevel, char *label, char *location ) { char buf[GEMPAKSTRING]; char time[20], day[4], imon[3], year[5], slash[2]; char *dayw, *month; int len=FILENAMESTRING, iret; BooleanType pdattim = False; strcpy ( title, " " ); bpad ( title, len, &iret ); strcpy ( title, " " ); /* * Parse the input dattim string formatted as: YYYYMMDD/HHMM????? where * the question marks (?) could represent model forecast time. */ if ( dattim != NULL ) { /* * Write date/time to title as a dattim string. */ if ( pdattim ) { if ( strcmp ( dattim, "MISSING" ) != 0 ) strcat ( title, dattim ); } /* * Write date/time to title in components. */ else if ( strlen (dattim)>10 ) { sscanf ( dattim, "%4s%2s%2s%1s%s", year, imon, day, slash, time ); dayw = DayOfWeek ( dattim ); month = MonthOfYear ( str2int(imon) );; strcat ( title, dayw ); strcat ( title, " " ); strcat ( title, month ); strcat ( title, " " ); strcat ( title, day ); strcat ( title, " " ); strcat ( title, year ); strcat ( title, " " ); strcat ( title, time ); Free ( dayw ); Free ( month ); } /* * Date time is missing so don't write it to the title. */ else if ( strcmp ( dattim, "MISSING" ) == 0 ) (void) 0; /* * Error check. */ else printf ("MakeMotTitle - input time is invalid\n"); } /* * Write product ( or model ) to title. */ if ( product != NULL ) { strcat ( title, " " ); strcat ( title, product ); } /* * Special case for level = 0, vcord = none */ if ( level && vlevel && strncmp (level, "0", 1 ) == 0 && ( strncmp (vlevel, "NONE", 4 ) == 0 || strncmp (vlevel, "none", 4 ) == 0 )) { strcat ( title, " (SFC)" ); } else { /* * Write vertical level to title. */ if ( level != NULL ) { strcat ( title, " (" ); strcat ( title, level ); } /* * Write vertical coordinate units to title. */ if ( vlevel != NULL ) { if ( level == NULL ) strcat ( title, " (" ); else strcat ( title, " " ); strcat ( title, vlevel ); strcat ( title, ")" ); } else if ( level != NULL ) strcat ( title, ")" ); } /* * Write label ( or model field ) to title. */ if ( label != NULL ) { strcat ( title, " " ); strcat ( title, label ); } /* * Write station location to title. */ if ( location != NULL ) { sprintf ( buf, "%s%s%s", " (", location, ")" ); strcat ( title, buf ); } }
void stnmark ( int nstn, struct station_list *stn, int icolr, int marker, int pstn, int pmarker, int *iret ) { char stid[5], *stations; float lat[LLSTFL], lon[LLSTFL], elev[LLSTFL]; float values[LLSTFL], breaks [LLCLEV], sizmrk; int color[LLSTFL]; int markid = 2; float marksiz = 1.0; int ncolrs, mrktyp, mrkwid, pltval, iposn; int size_per = 5; int len; int i; /*---------------------------------------------------------------------*/ *iret = NORMAL; /* * Set the marker attributes. */ for ( i=0; i<nstn; i++ ) color[i] = icolr; /* one color */ /* * Allocate space for station list. */ len = nstn * size_per * sizeof (char); if ( ( stations = (char *) malloc ( ( len + 1 ) * sizeof (char) ) ) == NULL ) { printf("Malloc failed\n" ); return; } strcpy ( stations, "" ); /* * Prepare for FORTRAN consumption. */ for ( i=0; i<nstn; i++ ) { strcpy ( stid, stn->stid ); bpad ( stid, size_per, iret ); strcat ( stations, stid ); lat[i] = stn->rlat; lon[i] = stn->rlon; *stn++; } size_per--; /* * Draw the markers. */ sym ( &nstn, &size_per, stations, &marker, &marksiz, &markid, lat, lon, color, &pstn, &pmarker, &iret ); /* * Free station list. */ free ( stations ); }
MetObjectType *MakeMarkerObject( int tblindex, int parm, int marker, int pstn, int pmarker, int *iret ) { MetObjectType *m; MarkerObjectType *mobj; GlobalDataObjectType *gd; extern struct datatype_list mastertbl[MAXTYP]; extern struct station_list station_info[LLSTFL]; char *str, stid[80]; int number, llen, stidlen=0; int nstn, ncolrs, jcolr, icolrs[LLSTFL]; int i, verbose; verbose = GetVerboseLevel(); if( verbose > VERBOSE_0 ) printf ( "MakeMarkerObject\n" ); gd = GetGlobalDataObject(); m = AllocateMot(); if( !m ) { printf("*** MakeMarkerObject: Mot allocation error.\n"); return( ( MetObjectType * ) NULL ); } mobj = (MarkerObjectType *) malloc( sizeof( MarkerObjectType ) ); if( ! mobj ) { printf("*** MakeMarkerObject: malloc error.\n"); return( ( MetObjectType * ) NULL ); } /* * Read and store NEXRAD radar sites. */ get_table ( mastertbl[tblindex], &station_info, &nstn, iret ); if ( *iret != NORMAL ) return; /* * Fill in the markerObject data. */ GetNextObjectColor ( gd ); mobj->color = atoi ( gd->colors ); strcpy ( mobj->stations, "" ); /* * Save the parameter to plot in a long string. */ switch (parm) { case 0: /* * Get length of the longest string. */ for ( i=0; i<nstn; i++ ) { llen = strlen ( station_info[i].stid ); if ( llen > stidlen ) stidlen = llen + 1; } for ( i=0; i<nstn; i++ ) { strcpy ( stid, station_info[i].stid ); bpad ( stid, stidlen, iret ); strcat ( mobj->stations, stid ); } break; case 1: stidlen = 9; for ( i=0; i<nstn; i++ ) { str = int2str ( station_info[i].stnm ); bpad ( str, stidlen, iret ); strcat ( mobj->stations, str ); Free ( str ); } break; case 2: /* * Get length of the longest string. */ for ( i=0; i<nstn; i++ ) { llen = strlen ( station_info[i].name ); if ( llen > stidlen ) stidlen = llen + 1; } for ( i=0; i<nstn; i++ ) { strcpy ( stid, station_info[i].name ); bpad ( stid, stidlen, iret ); strcat ( mobj->stations, stid ); } break; case 3: stidlen = 9; for ( i=0; i<nstn; i++ ) { number = (int) station_info[i].elev; str = int2str ( number ); bpad ( str, stidlen, iret ); strcat ( mobj->stations, str ); Free ( str ); } case 4: stidlen = 9; for ( i=0; i<nstn; i++ ) { number = 3.2808 * (int) station_info[i].elev; str = int2str ( number ); bpad ( str, stidlen, iret ); strcat ( mobj->stations, str ); Free ( str ); } break; default: break; } for ( i=0; i<nstn; i++ ) { mobj->lat[i] = station_info[i].rlat; mobj->lon[i] = station_info[i].rlon; } stidlen--; mobj->marker = marker; mobj->nstn = nstn; mobj->stidlen = stidlen; mobj->plot_stn = pstn; mobj->plot_marker = pmarker; /* * hard code the text type for now */ strcpy ( mobj->symbol_size, "1.0" ); strcpy ( mobj->symbol_width, "1" ); sprintf ( mobj->text, "%s/%s/%s/%s", gd->text_size, gd->text_font, gd->text_width, gd->text_hw_flag ); m->type = MARKEROBJECT; m->displayFunc = DisplayMarker; m->destroyFunc = DestroyMarkerObject; m->toggledOn = True; /* * Provide some geographic defualt */ strcpy ( m->proj, "lcc/30.0;-100;50.0//nm" ); strcpy ( m->garea, "23.0;-120.0;47.0;-65.0" ); strcpy ( m->area, "23.0;-120.0;47.0;-65.0" ); /* * Tie the MetObjectContentType data into the metObject. */ m->metObjectContent = (MetObjectContentType *) mobj; return( m ); }
void BuildVectorGrid ( GuiVectorGridDialogType *vec ) { MetObjectType *mlist[MAXMETOBJS]; WindowObjectType *wo; GuiScalarGridDialogType *grd; ModelInfoType *mdl; KeyListType *fdf; GlobalDataObjectType *gd; GeoRefObjectType *geo; ListParentObjectType *inList; char **levels; char *model, *file, *ftime, *level, *field, *vcoord, *refvec, *text, *scale, *skip, *skip_x, *skip_y; char *wind_symbol, *wind_symbol_color, *wind_symbol_size, *wind_symbol_width, *wind_symbol_type, *wind_symbol_headsize; char *model_label, *field_label; char *buf, gridtype[80]; int *indexList, titleIndex; int nfunction; int count, matchSize, metObjectCount; int i, j, nlevels; int iret, viewType, verbose; grd = GetGuiScalarGridDialog(); mdl = GetGuiModelInfo(); gd = GetGlobalDataObject(); wo = GetActiveWindowObject(); fdf = GetHSGuiFdfInfo(); verbose = GetVerboseLevel(); if( verbose > VERBOSE_0 ) printf ( "BuildVectorGrid\n" ); inList = ReturnListStruct ( GetModelScrolledListHSW( grd ), grd->time_list, grd->match_list, &(grd->select_list) ); count = inList->listcount; /* * Save the first time in the list for selection purposes. */ if ( grd->select_list.listcount > 0 ) PreviousSelectedTime ( "SET", VECTORGRIDOBJECT, inList->label[0] ); /* * Check on the view types for compatibility. Compare this object * with the current georeference view state and do a reset if * they don't match. */ viewType = GetMetObjectView( VECTORGRIDOBJECT ); if ( geo = GetGeoRefObject( wo) ) if ( geo->viewType != viewType ) WindowObjectFullReset( wo ); /* * Get FDF from text widget. */ if ( GetFunctionHS ( grd ) != NULL ) { /* fdf */ field = (char *) malloc ( GEMPAKSTRING * sizeof ( char ) ); strcpy ( field, GetFunctionHS ( grd ) ); bpad ( field, GEMPAKSTRING, &iret ); strcpy ( gridtype, " v" ); } else { ("*** Error in BuildVectorGrid - field in undefined\n" ); return; } /* * For complicated fields which require several descriptors to build * the field, format the definition to pass to FORTRAN. */ nfunction = GetNumFunctionHS ( grd ); if ( nfunction > 1 ) { Free ( field ); field = BuildGemFunction ( "function", gridtype, fdf ); } /* * Get the vertical coordinate */ if ( buf = XmTextGetString ( GetModelVCoordHSW ( mdl ) ) ) { vcoord = strdup ( buf ); XtFree ( buf ); ToLower ( vcoord ); FreeModelVCoord ( mdl ); SetModelVCoord ( mdl, vcoord ); } else vcoord = strdup (" "); /* * Get the level */ if ( level = XmTextGetString ( GetModelLevel1HSW ( mdl ) ) ) { FreeModelLevel1 ( mdl ); SetModelLevel1 ( mdl, level ); XtFree ( level ); } if ( level = XmTextGetString ( GetModelLevel2HSW ( mdl ) ) ) { FreeModelLevel2 ( mdl ); SetModelLevel2 ( mdl, level ); XtFree ( level ); } level = BuildGemParm ( "level", fdf ); /* * Check if animating vertically through all model levels or layers. */ if ( strcasecmp ( level, "all_level" ) == 0 ) nlevels = GetModelLevels ( GetModelType(mdl), GetModelVCoord (mdl), &levels ); else if ( strcasecmp ( level, "all_layer" ) == 0 ) nlevels = GetModelLayers ( GetModelType(mdl), GetModelVCoord (mdl), &levels ); else { nlevels = 1; levels = StringListAllocate ( nlevels ); *levels = strdup ( level ); } Free ( level ); /* * Set wind symbol and color. */ wind_symbol = strdup ( GetVectorSymbolHS ( grd ) ); wind_symbol_color = GetFdfKeyValue ( fdf, "wind_symbol_color" ); if ( wind_symbol_color == NULL ) { GetNextObjectColor ( gd ); wind_symbol_color = strdup ( gd->colors ); } wind_symbol_size = GetFdfKeyValue ( fdf, "wind_symbol_size" ); wind_symbol_width = GetFdfKeyValue ( fdf, "wind_symbol_width" ); wind_symbol_type = GetFdfKeyValue ( fdf, "wind_symbol_type" ); wind_symbol_headsize = GetFdfKeyValue ( fdf, "wind_symbol_headsize" ); /* * Set reference vector parameters. */ refvec = BuildGemParm ( "refvec", fdf ); /* * Scale, Skip factor. */ if ( buf = XmTextGetString ( GetScaleFactorHSW ( grd ) ) ) { scale = strdup ( buf ); XtFree ( buf ); } else scale = strdup ( "9999" ); skip = GetFdfKeyValue ( fdf, "skip_contour" ); skip_x = GetFdfKeyValue ( fdf, "skip_plot_x" ); skip_y = GetFdfKeyValue ( fdf, "skip_plot_y" ); /* * Set text size, font, text width and hardware/software flag. */ text = BuildGemParm ( "text", fdf ); /* * Get model */ model = strdup ( GetModelType ( mdl ) ); model_label = strdup ( GetModelLabelType ( mdl ) ); /* * Get field label. */ field_label = GetFdfKeyValue ( fdf, "label" ); if ( field_label == NULL ) field_label = strdup ( field ); /* * Save title line index. */ titleIndex = GetNextTitleIndex ( wo ); /* * Create metObjects. */ metObjectCount = 0; for ( i=0; i<count; i++ ) { /* loop over times */ if ( inList->label[i] == NULL ) { file = strdup ( "MISSING" ); ftime = strdup ( "MISSING" ); } else { file = strdup ( inList->string[i] ); ftime = strdup ( inList->label[i] ); strdelc ( ftime, ' ', &iret ); } for ( j=0; j<nlevels; j++ ) { /* loop over levels */ mlist[metObjectCount] = (MetObjectType *) MakeHorizontalVectorGridObject( file, ftime, vcoord, levels[j], field, gridtype, text, wind_symbol, wind_symbol_color, wind_symbol_size, wind_symbol_width, wind_symbol_type, wind_symbol_headsize, refvec, scale, skip, skip_x, skip_y, model, model_label, field_label, nfunction, titleIndex ); metObjectCount++; } Free ( ftime ); Free ( file ); } Free ( field ); Free ( vcoord ); Free ( wind_symbol ); Free ( wind_symbol_color ); Free ( wind_symbol_size ); Free ( wind_symbol_width ); Free ( wind_symbol_type ); Free ( wind_symbol_headsize ); Free ( refvec ); Free ( text ); Free ( scale ); Free ( skip ); Free ( skip_x ); Free ( skip_y ); Free ( model ); Free ( model_label ); Free ( field_label ); StringListFree ( nlevels, levels ); count = count * nlevels; if ( metObjectCount > 0 ) AddObjectListToDisplay( count, mlist ); /* * Create a DataTimeObject for time matching. */ if ( wo && metObjectCount > 0 ) CreateDataTimeObject ( wo, mlist ); /* * Save list indices in case dialog is not closed. */ if ( grd->match_list.listcount < 1 ) { indexList = MatchIndicesToList ( grd->time_list.label, grd->time_list.listcount, VECTORGRIDOBJECT, &matchSize ); grd->match_list.listcount = matchSize; grd->match_list.intList = indexList; } if( wo ) ProcessDisplayList( wo ); /* * Free. */ FreeListParentObject ( inList ); return; }
int DisplayXSection( WindowObjectType *wo, MetObjectType *mot ) { /* * Prepare a horizontal scalar grid Met object for plotting with a * GEMPAK driver subroutine. */ char **strarray; char title[FILENAMESTRING], ctype[GEMPAKSTRING]; char cint[GEMPAKSTRING], fint[GEMPAKSTRING]; char line[GEMPAKSTRING], wind[GEMPAKSTRING]; char sizestr[GEMPAKSTRING], widthstr[GEMPAKSTRING]; char fontstr[GEMPAKSTRING], skipstr[GEMPAKSTRING]; int size, width, font_size, filter; int i, verbose, frame, num, iret; XSectionGridObjectType *xot; xot = (XSectionGridObjectType *) mot->metObjectContent; assert( xot ); verbose = GetVerboseLevel(); if( verbose > VERBOSE_0 ) printf ( "DisplayXSection\n" ); frame = GetActivePixmapObjectIndex (wo) + 1; /* * Save original FDF settings. */ strcpy ( sizestr, xot->symbol_size ); strcpy ( widthstr, xot->symbol_width ); strcpy ( fontstr, xot->text ); strcpy ( skipstr, xot->skip ); /* * Set plotting parameters according to generalized values. */ GetDepictableValue ( "SYMBOLSIZE", &size ); GetDepictableValue ( "SYMBOLWIDTH", &width ); GetDepictableValue ( "FONTSIZE", &font_size ); GetDepictableValue ( "SYMBOLPACKING", &filter ); SetGemText ( XSECTIONGRIDOBJECT, fontstr, "FONTSIZE", font_size ); SetGemFloatVar ( XSECTIONGRIDOBJECT, sizestr, "SYMBOLSIZE", size ); SetGemFloatVar ( XSECTIONGRIDOBJECT, widthstr, "SYMBOLWIDTH", width); SetGemIntVar ( XSECTIONGRIDOBJECT, skipstr, "SYMBOLPACKING", filter ); sprintf ( cint, "%s/%s/%s", xot->cint, xot->cmin, xot->cmax ); sprintf ( fint, "%s/%s/%s", xot->fint, xot->fmin, xot->fmax ); bpad ( cint, GEMPAKSTRING, &iret ); bpad ( fint, GEMPAKSTRING, &iret ); /* * Check for plotting contour lines, fill or symbol. */ strcpy ( ctype, "" ); if ( xot->contour ) strcat ( ctype, "C" ); if ( xot->fill ) strcat ( ctype, "/F" ); /* * Set contour line characteristics. */ sprintf ( line, "%s/%s/%s/%s", xot->line_color, xot->line_type, xot->line_width, xot->label_freq ); sprintf ( wind, "%s%s/%s/%s/%s/%s", xot->wind_symbol, xot->line_color, sizestr , widthstr , xot->symbol_type, xot->symbol_headsize ); /* * Make sure SCALE is defined. */ if ( ! xot->scale ) strcpy ( xot->scale, "0" ); /* * Title. */ strcpy (title, mot->titleString ); SetGemTitle ( line, mot->titleIndex, title ); pxsec( mot->filename, xot->gdatim, xot->gfunc, xot->gvcord, xot->gvect, xot->cxstns, ctype, xot->ptype, xot->yaxis, xot->scale, wind, cint, line, xot->contur, fint, xot->fline, xot->clrbar, title, skipstr, xot->refvec, fontstr, &frame, &(mot->titleIndex), &verbose, &iret, strlen(mot->filename), strlen(xot->gdatim), strlen(xot->gfunc), strlen(xot->gvcord), strlen(xot->gvect), strlen(xot->cxstns), strlen(ctype), strlen(xot->ptype), strlen(xot->yaxis), strlen(xot->scale), strlen(wind), GEMPAKSTRING-1, strlen(line), strlen(xot->contur), GEMPAKSTRING-1, strlen(xot->fline), strlen(xot->clrbar), strlen(title), strlen(skipstr), strlen(xot->refvec), strlen(fontstr) ); /* * Save the contour and fill info back into the metobject */ if ( xot->contour ) { cint[GEMPAKSTRING-1] = '\0'; strbrm (cint); strarray = SplitByDelimeter ( cint, "/", &num ); if ( strarray [0] != NULL ) strcpy ( xot->cint, strarray [0]); if ( strarray [1] != NULL ) strcpy ( xot->cmin, strarray [1]); if ( strarray [2] != NULL ) strcpy ( xot->cmax, strarray [2]); StringListFree ( num, strarray ); } if ( xot->fill ) { fint[GEMPAKSTRING-1] = '\0'; strbrm (fint); strarray = SplitByDelimeter ( fint, "/", &num ); if ( strarray [0] != NULL ) strcpy ( xot->fint, strarray [0]); if ( strarray [1] != NULL ) strcpy ( xot->fmin, strarray [1]); if ( strarray [2] != NULL ) strcpy ( xot->fmax, strarray [2]); StringListFree ( num, strarray ); } /* if ( iret ) PrintGemError ( errmsg, errparm ); */ SetMetObjectDrawnFlag( mot, True ); return(0); }