Re: [NTLK] Help with GPS MAP process (VERY,VERY LONG POST)

From: Johannes Wolf (mp2100_at_mail-gw.estec.esa.int)
Date: Wed Apr 06 2005 - 06:00:06 PDT


For the sake of readibilty I cut down your very long post to the essential
part I am answering to and put my comments inbetween:

> <<SNIP

> 2 I found Graphic Convertor ver 4.6.1 already on my MAC
> (http://www.lemkesoft.com/en/index.htm) as part of the bundled
> software.

> 3 Opened Jpeg image with Graphic Convertor 4.6. then I;

> A Reduced the color depth to 16 colors Pictures>Colors>Change to 16
> Colors (4 bit)
> B Converted to Grayscale Pictures>Colors>Grayscale
> C Set the resolution to 72 dpi Pictures>Resolution> Enter "72" dpi in
> both the Horiz & Vert boxes: then "OK"
> D If you have not already extracted the calibration point pixel
> coordinates this is the time to do so. This information is necessary so
> that correction factors can be applied to the map by GPS MAP. Here is
> another modified version of an email I exchanged with Johannes;

> snip>>

> 4 Save map as a PICT resource. (I think this is where part of my
> problem is occurring) FILE>SAVE AS> Click the File Extension tab and
> select Resource (*.RSRC). Leave the three boxes underneath Unchecked.

how are they named? since I do not have the same version of GC...

> >Click the Preference tab and click the DEFAULT Tab (This may be a
> Problem Point) >Then click the OPTIONS tab>Select Standard Compression
> (RLE); Ensure that RSED (ResEdit) is in the Document Creator Field.
> Click the Resource box and click the Original Index Radio Button. Name
> the resource (I typed in Ojai1 with no space, dot or extension. This
> may be another Problem Point ). Choose Dither in the Misc Block. Click
> OK to close the Options Dialog box. Then Save the File. My File name
> was Ojai 1. rsrc (Ojai space 1dot rsrc).
> 5 Close Graphic Convertor.

I think that part should be fine now.
If you open the .rsrc file with GC it should appear normally on the screen.

< SNIP >

> 7 Go into GPS MAP folder and Duplicate Map Template 1.5. Rename
> duplicated folder.
> 8 Drop copy of PICT resource document into the new folder.
> 9 Launch Newton Toolkit ver 1.6.4
> a NTK will not load unless it sees a serial port. Ensure
> that Newton
> is connected to serial port via Newton Connection Utilities before
> trying to load NTK or it won't work.
> b There is something called TCPSerial that fakes a serial
> port. Should
> be on UNNA.
> c If you have a USB only computer you probably need to get a USB to
> Serial Convertor.
> d Ethernet- Don't know if NTK will see serial port & newton if
> connected via ethernet (wired or wireless) to NCU.
> 10 Within the Renamed Folder open MAP (no extension) document. OS-X may
> see this as a Text-edit document so use the Open With... feature to
> locate NTK.
> 11 In the Window that comes up select Map_Main.t by double-clicking on
> it. In the Browser window that comes up select clView:Map_Main, and
> select afterScript.
> 12 In the big window that comes up is the template for calling out
> maps. Tried to follow directions as in PDF document MapPrep.PDF. Also
> found source on Web (http://www.phys.uwosh.edu/mike/newt-maps.html)
> that covered some details. Actually very detailed with respect to
> creating the PICT resource files, but from Photoshop not GC. (here is a
> copy of the script I input)
> //////////////////////////////////////////////////////////////////////
> // Map Template for Map Preparation Package version 1.5 //
> // //
> // Copyright ©1995-97 //
> // Gerd Staudenmaier, Software Development & Marketing //
> // Friedrichshafener Str. 24 b //
> // D-88090 Immenstaad, Germany //
> // e-mail: gerds_at_micronet.de //
> // all rights reserved ! //
> // //
> // IMPORTANT !!! //
> // You may freely use this map template for use with "GPS Map" and //
> // "GPS Map Lite" only. All other applications need the written //
> // permission of the author! //
> //////////////////////////////////////////////////////////////////////

I THINK THIS IS THE CRITICAL PART OF THE SCRIPT WHERE I HAD THE VERY SAME
PROBLEM

> //////////////////////////////////////////////////////////////////////
> // Read in the map by using one of the methods as described within //
> // the map preparation manual //
> //////////////////////////////////////////////////////////////////////
> rf := OpenResFileX (Home & "Ojai 1.rsrc");
> BMAP_1 := MakePixFamily (NIL,NIL,"Ojai1");
> CloseResFileX(rf);
> //////////////////////////////////////////////////////////////////////
> // Repeat previous statements for all further maps to be included //
> // into your map package if applicable //
> //////////////////////////////////////////////////////////////////////
> //BMAP_2 := .......;

END OF CRITICAL PART

> thisView.MapList := [
> /////////////////////////////////////////////////
> // This frame describes the map loaded into //
> // BMAP_1. If you have more maps repeat the //
> // frame for each map //
> /////////////////////////////////////////////////

< SNIP >

> // end of afterScript
>
> 16 At this point I attempt to build the application and I get this
> error message in the Inspector window,
>
> Error in Map_Main.t, Map_Main.afterScript, line 22:
> Couldn't open resource file (-43): "Macintosh
> HD:Users:edwardjohnson:Documents:Newton Stuff:GPS Downloads:GPS MAP 2.1
> Unrestricted:Maps Prep Software:MPS-Mac:Ojai 1:Ojai 1.rsrc"
> n.afterScript, Line 1: Unknown global function "MakePixFamily"
>
> I am stumped at this point. I think this error is related to way I
> saved the resource in step 4. I am not experienced in Newton
> development and do not know what it is looking for in terms of creating
> or calling the proper resource in the script. That is why this post is
> so bloody long! Point me to the error of my ways so that I can get on
> with my life! I have been messing around with this for a couple of
> months and my wife is p*****-off!

This is easy to believe...

From what I can remember (and it is quiet some time ago that I did it the
last time)
I had the very same problem and after setting the options for saving the
resource I ended up having the original PICT file (step before creating the
resource) AND the resource file in the same directory used for the NTK
project.
In addition both had the same name, like "map.rsrc" and "map".
In this case .rsrc is NOT an extension, but part of the filename (Mac OS9
does not use extensions).
And here is the point I am wondering about: how this is handled by OS X ?,
because there you have extensions again!

Maybe in your case you have to make sure that both map files are in the same
directory!

I can offer you to prepare the resource on my machine and even the map in
order to find out where the error is located. Just send me the files and I
will try.

Cheers
Johannes

> Okay, enough! Into the mailbox with you!

> Semper Fi!

> Ed Johnson

-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
Official Newton FAQ: http://www.chuma.org/newton/faq/
WikiWikiNewt for all kinds of articles: http://tools.unna.org/wikiwikinewt/


This archive was generated by hypermail 2.1.5 : Wed Apr 06 2005 - 07:00:02 PDT