SPARC printer

Wang Song wang at cast.uark.edu
Thu Feb 24 15:28:19 EST 1994


	Sorry to waste the bandwidth because an unreachable
individual E-Mail address.

> Song
> 
> I would appreciate that driver you mentioned because we've
> had trouble with the MAPGEN ps driver.  I would also like 
> to benefit from the options you have added in your driver.
> 
> Thanks for the help,
> 
> Jim
> jim at sar_ws.fb4.noaa.gov

	This is a C-shell script, you may need to modify on your site.

	If you have questions about it, please let me know.

Cut following section out and save it with a file name post.sh.
Change permission to executable, then should be able to run it.

Song Wang
CAST/NCRI
University of Arkansas

============================================================================

#                 ***********
#                 * post.sh *
#                 ***********
#      This script is used to plot MAPGEN
#      maps from a PostScript printer
#
#      Command format ---
#         post.sh   
#
#      Note: To run this program, you have to be in the
#            directory: GRASS_data_dir/LOCATION/MAPSET/mapgen/mapname;
#
#            postfile is a new file name defined by
#            the user to save PostScript file used to
#            draw MAPGEN maps;
#            scale_parameter is a real number by which 
#            the map coordinates are multiplied. It is 
#            the mechanism used to rescale map prints.
#
clear
echo "     "
echo "     "
echo "     "
echo "     "
echo "                   Warning      "
echo "     "
echo "  This program is used to create a PostScript file"
echo "  for MAPGEN maps and plot the map on a PostScript"
echo "  printer across the network. Before you go any   "     
echo "  further, please make sure that GRASS-MAPGEN shell"
echo "  has been properly started and you are in the    "
echo "  correct MAPGEN directory !                      "
echo "  (GRASS_data_dir/LOCATION/MAPSET/mapgen/mapname) "
echo "     "
echo -n "  Hit [return] to continue --> "
set oktogo = $<
clear

echo "     "
echo "     "
echo "     "
echo "Do you want to save the PostScript file for"
echo "the MAPGEN plot ?"
echo "     "
echo -n "Answer (y or n) --> "
set savefile = $<

if ($savefile =~ y*) then
 
    echo "     "
    echo "     "
    echo "Enter a new file name to save the PostScripts"
    echo "file for the MAPGEN plot."
    echo "     "
    echo -n "--> "
    set postfile = $<

else       # Creat PostScript program as a temporary file

    set postfile = "temp"

endif

echo "     "
echo "     "
echo "Enter a scale parameter to resize the map"
echo "prints. This parameter must be a real number"
echo "by which the original map size is multiplied."
echo "(Default value is one that will print the map"
echo "in same size as the original)."
echo "      "
echo -n "--> "
set map_scale = $<

if ($map_scale == "") then 

    set map_scale = "1"

endif    

echo "      "
echo "      "
echo "Do you want to define a new origin for"
echo "your map plot ?"
echo "      "
echo -n "Answer (y or n) --> "
set set_origin = $<

if ($set_origin =~ y*) then

    echo "      "
    echo "      "
    echo "Enter a number for X coordinate of the origin."
    echo "This number ranges from 0 to 4318. "
    echo "       "
    echo -n "--> "
    set Xorigin = $<
    echo "      "
    echo "      "
    echo "Enter a number for Y coordinate of the origin."
    echo "This number ranges from 0 to 5588."
    echo "       "
    echo -n "--> "
    set R_Yorigin = $<

else

    set Xorigin = 200         # default value
    set R_Yorigin = 200       # default value

endif     # Define a new origin for the map plot

echo "     "
echo "     "
echo "Do you want to rotate 90 degree for the map plot ?"
echo "     "
echo -n "Answer (y or n) --> "
set map_rotate = $<

# Create PostScript file for MAPGEN plots

# Create PostScript header

if (-e tmp.ps) then
   
   rm tmp.ps

endif

cat /usr2/grass4/sun4/mapgen/interface/postStart > tmp.ps

# Create a primary PostScript file for a MAPGEN plot

if ($map_rotate =~ y*) then

    /usr2/grass4/sun4/mapgen/bin/plotter -dr ps -s $map_scale ovm/* >> tmp.ps

else          # Do not rotate the map plot

    /usr2/grass4/sun4/mapgen/bin/plotter -d ps -s $map_scale ovm/* >> tmp.ps

endif

# Reset origin for the MAPGEN map plot

@ Yorigin = 5588 - $R_Yorigin 

if ($map_rotate =~ n*) then

    cat tmp.ps | awk '{if ($3 == "translate") {$1=i; $2=l; print} else print}' i=$Xorigin l=$Yorigin > $postfile.ps

else
   
    cat tmp.ps | awk '{if (NR == 11) {print i, l, "translate"} else  print}' i=$Xorigin l=$R_Yorigin > $postfile.ps

endif

# Print the MAPGEN PostScript plot

clear
echo "    "
echo "    "
echo "Your MAPGEN map is plotting off the PostScript printer \!"
rsh spock lp <$postfile.ps

if ($savefile =~ y*) then

   mv $postfile.ps ~/.

else

   rm temp.ps

endif

# End of the program





More information about the grass-user mailing list