|
Post by rikky on Mar 19, 2021 20:57:26 GMT 1
There is no command line input. You have to make it yourself. Right at the beginning. This is just a demo, you know. In fact the FUNCTION GET_POSITION$() is now slowly moving the position, but is meant to be connected to whatever gps coordinate program you have got. And the viewbox must be littler, to zoom in around your position. And then a boat or dot or something must be printed on your position. And then the dot must stay on the same place, and the chart (viewbox) must move under the dot. And then the other boats visable with the AIS must be printed also. And then you have to call your insurance company for with all this looking into your computer, you did not pay attention, and you bumbed into a real ship.
|
|
|
Post by alexfish on Mar 19, 2021 22:10:40 GMT 1
Hi All X11 cairo demo stage :: pre math nav :: IE cord algos to sort requires dev X11 , cairo + bacon curl.bac available at BaCon WebSite this demo will show a UK port Whitby But can change the location 'whitby harbour uk home_lat = 54.4877 home_lon = -0.6150 And Yes it Needs a clean up : The Red Square is the rect where cords lat and long are use Arrow keys + Page Up Page down There is No restraint on some of the Scrolling Can test key input as well use from term , since First load = downloading in progress ,then window shows, Have Fun + BR Alex Attachments:xwin2.bac.bz2 (4.92 KB)
|
|
|
Post by vovchik on Mar 19, 2021 22:45:32 GMT 1
Dear Alex, Thanks. It works nicely - but getting the images takes a bit of time. I couldn't help smiling, since I know Whitby from my days as a post-graduate at York decades ago. With kind regards, vovchik
|
|
|
Post by rikky on Mar 20, 2021 7:46:24 GMT 1
On the RPi3 stretch it compiles, but I get a white empty screen with nothing and output:
count=1 Expose :8 Postion = 54.4877 : -640 Test Tile required : 17/65312/41780 count=0 Expose :9 count=3 Expose :10 count=2 Expose :11 count=1 Expose :12 Postion = 54.4877 : -640 Test Tile required : 17/65312/41780 count=0 Expose :13 Postion = 54.4877 : -640 Test Tile required : 17/65312/41780 count=0
On the PRi4 Buster it doesn't compile and outputs
Converting '/home/pi/Downloads/xwin2.bac'... done, 685 lines were processed in 0.238 seconds. Compiling '/home/pi/Downloads/xwin2.bac'... cc `pkg-config --cflags x11 cairo` -c xwin2.bac.c
/home/pi/Downloads/xwin2.bac:138:19: warning: implicit declaration of function 'curl_easy_init'; did you mean 'cairo_matrix_init'? [-Wimplicit-function-declaration]
INFO: see full error report (y/[n])? y In file included from /home/pi/Downloads/xwin2.bac:691, from xwin2.bac.c:2: /home/pi/Downloads/xwin2.bac: In function 'SEAMAP_GET_TILE__b2c__string_var': /home/pi/Downloads/xwin2.bac:138:19: warning: implicit declaration of function 'curl_easy_init'; did you mean 'cairo_matrix_init'? [-Wimplicit-function-declaration] easyhandle = curl_easy_init() ^~~~~~~~~~~~~ cairo_matrix_init In file included from /home/pi/Downloads/xwin2.bac:691, from xwin2.bac.c:2: /home/pi/Downloads/xwin2.bac:139:1: warning: implicit declaration of function 'curl_global_init' [-Wimplicit-function-declaration] curl_global_init(CURL_GLOBAL_ALL) ^ ~~~~~~~~~~~~~~ /home/pi/Downloads/xwin2.bac:139:18: error: 'CURL_GLOBAL_ALL' undeclared (first use in this function); did you mean 'LC_GLOBAL_LOCALE'? curl_global_init(CURL_GLOBAL_ALL) ^~~~~~~~~~~~~~~ LC_GLOBAL_LOCALE /home/pi/Downloads/xwin2.bac:139:18: note: each undeclared identifier is reported only once for each function it appears in In file included from /home/pi/Downloads/xwin2.bac:691, from xwin2.bac.c:2: /home/pi/Downloads/xwin2.bac:140:1: warning: implicit declaration of function 'curl_easy_setopt' [-Wimplicit-function-declaration] curl_easy_setopt(easyhandle, CURLOPT_USERAGENT, "firefox") ^ ~~~~~~~~~~~~~~ /home/pi/Downloads/xwin2.bac:140:30: error: 'CURLOPT_USERAGENT' undeclared (first use in this function) curl_easy_setopt(easyhandle, CURLOPT_USERAGENT, "firefox") ^~~~~~~~~~~~~~~~~ In file included from /home/pi/Downloads/xwin2.bac:691, from xwin2.bac.c:2: /home/pi/Downloads/xwin2.bac:141:30: error: 'CURLOPT_SSL_VERIFYHOST' undeclared (first use in this function) curl_easy_setopt(easyhandle, CURLOPT_SSL_VERIFYHOST, 2L) etc
|
|
|
Post by vovchik on Mar 20, 2021 8:19:18 GMT 1
Dear Rik,
On my Pi4 running bullseye/sid (actually buster/testing, I think), it compiles fine and runs nicely. I wonder what the problem is.
It also compiles and runs fine on my Mint 19.
With kind regards, vovchik
|
|
|
Post by rikky on Mar 20, 2021 8:46:05 GMT 1
Something with curl I suppose, for it gives tenthousand errors, all related to curl. Yet I took the newest off the Bacon website, and also was able to compile curl.bac alone.
|
|
|
Post by vovchik on Mar 20, 2021 11:03:16 GMT 1
Dear Rik, Here is what I used (curl.bac and Alex's xwin2 source). I modded the location for image files to CURDIR$. I hope it works for you. With kind regards, vovchik Attachments:xwin2.bac.tar.gz (8.92 KB)
|
|
|
Post by alexfish on Mar 20, 2021 11:07:12 GMT 1
Hi Rik Not sure about PI3 Possible Memory allocation problem on cairo surface ADDED , & or the position of the surface Within the WindowBut can test first few bits HEREand report back here, will then look further for PI3 PI4 curl ? looks like something is Missing, BR Alex Oh, Just seen Vovchik's post
|
|
|
Post by rikky on Mar 20, 2021 11:10:50 GMT 1
no. It compiles, but gives a white blanco canvas on the RPi3 console output: Expose :71 Postion = 54.4877 : -640 Test Tile required : 17/65312/41780 count=0 Expose :72 Postion = 54.4877 : -640 Test Tile required : 17/65312/41780 count=0 Expose :73 count=3 Expose :74 count=2 Expose :75 count=1 Expose :76 Postion = 54.4877 : -640 Test Tile required : 17/65312/41780 count=0 ^C The Rpi4 is currently out of reach, sorry.
|
|
|
Post by alexfish on Mar 20, 2021 15:36:58 GMT 1
Hi All Just an update RE gps cords , although early days in this respect First step in , looking good So first picky of the Red Rectangle with gps cords in Black lines, hard coded(guess) I say Early days , since need to check (N,S & E,W alignments) with previous algos posted Agh Well The Vertical Cord Should be to the left Will Update picky when done BR Alex Vertical Sorted Now Horizontal is traveling in wrong direction. Brain seizure. Getting good old fashioned drawing board out Attachments:
|
|
|
Post by alexfish on Mar 20, 2021 17:15:01 GMT 1
|
|
|
Post by alexfish on Mar 20, 2021 21:10:27 GMT 1
Finally sorted the GPS cords distance etc Now in process of Clean Up, this will be posted at Posted at Post #1 asp 2/3 days From there will be posting Add-on's. IE starting True GPS reader Hence in first part may opt for openstreet only + opens way for different file types , and in Riks case can add gdk-pixbuf ... BR Alex final picky of up to now two windows using cords + reference from the above mentioned site home_lat = 54.48774 home_lon = -0.61498 bits from the term . if note in the term one bearing 354.767 & 44.4684 then all look good Postion = 54.4877 : -640 lat : 54°29'15.73" N lon :0°36'54.00" W Look at : 65312 : 65313 Results TOP Left :54.4892 : -0.615234 Bearing :354.767 Results TOP Right :54.4892 : -0.612488 Dist : 0.177397 BEARING2 :44.4684 dist 0.015138 Dist 2: 0.0151376 from , -0.615 : -0.615234 scaler : 1443.09 dist real = 21.845 dist real2 = 21.845 FWW opencpn route marker is the same Attachments:
|
|
|
Post by alexfish on Mar 21, 2021 14:38:16 GMT 1
Dear Alex, Thanks. It works nicely - but getting the images takes a bit of time. I couldn't help smiling, since I know Whitby from my days as a post-graduate at York decades ago. With kind regards, vovchik Hi Vovchik Think servers may not be the fastest have put bacon pthread to use , = 2* faster main objective was to download only what one needs, Yet IE seamaps bulk tile are by area, Northsea = 1.5 Gb and has to be converted to png = 3GB, same as for other apps, as mentioned some areas are not complete as an example compare what is posted with this picky a from well known app + what can be done BR Alex Attachments:
|
|
|
Post by rikky on Mar 21, 2021 18:35:14 GMT 1
Well, I'm using the Slippy Map tiles from OpenStreet and OpenSea. I believe you pointed these out for me. They go a lot quicker , but still take a little but noticeable time (on a RPi3) Tiles that are already downloaded take no time at all. I saw that some posts have crossed each other about Cairo. I'm sorry, I did not notice. So I went further on the SVG line. Once you get the hang of it, SVG's are easy. Only thing is that the BaCon GUIDEFINE function does not seem to listen to Whatever I put in there, half my window is below my computer terminal. Tried two different ones, a little and a normal. So either I do something wrong, or Pjotr is going to solve something, or I have to go to Cairo as well, or something. problem is that Cairo and the like is like Chinese for me. Anyway, the next tryout is ready, and much better. (apart from the BaCon Gui) Now you can enter your position in any format on the commandline in the form of [latitude longitude] [zoom] And the new position, the tracking function is done by calling the same program with the new position and or zoom. The own ship (bike,walkingshoes,motorcycle) position calculation is in there, and a red dot is positioned on it. Sometimes, depending on the zoom level, you don't see it, for as I said, half the screen is off. This function CALCULATE_POS_ON_TILE$(string$) can be used for the other ships visible via AIS also of course Note that by using SVG we can add a second zoom function that goes much faster, for it doesn't have to download new tiles. This way you can load little tiles with a lot of details, and zoom back to big vieuw (I think) Anyway, this rudimentary tryout chart program is already better then OpenCpn, for that thing is way to slow on a raspi3 and you have to download an install your charts, etc. OpenSeaGui.bac (15.35 KB) Rik.
|
|
|
Post by bigbass on Mar 22, 2021 2:17:13 GMT 1
Hello Rik I am using the latest fossil on the RPI3 I was getting this after stepping though the code File 'OpenSeaGui.bac' line 261: File 'OpenSeaGui.bac' line 262: RETURN result$ free(): invalid pointer ERROR: signal ABORT received - internal error. Try to compile the program with TRAP LOCAL to find the cause. added the FREE and the TYPE STRING LOCAL result$ TYPE STRING PRINT xtile / POW(2,zoom) *360 - 180 FORMAT "%.9f" TO result$ RETURN result$ FREE result$ it compiles and runs now P.S the code from Alex is not downloading images for me also it just displays an empty window will look at why but it would be better if Alex could test it on the RPI3 Joe
|
|