|
Post by alexfish on Jul 22, 2022 0:16:29 GMT 1
Hi all NOTE: Thread Closed: HUG API HERE LATEST LIB & demo SEE POST #10 , after testing it will be here A brief test using libosm 'Requires libosmgpsmap-1.0-dev libgtk-3-dev PRAGMA LDFLAGS `pkg-config gtk+-3.0 osmgpsmap-1.0 gthread-2.0 --libs` PRAGMA OPTIONS `pkg-config gtk+-3.0 osmgpsmap-1.0 --cflags` PRAGMA INCLUDE <gtk-3.0/gtk/gtk.h> PRAGMA INCLUDE <osmgpsmap-1.0/osm-gps-map.h>
OPTION PARSE FALSE
LOCAL window TYPE GtkWidget * LOCAL map TYPE OsmGpsMap * LOCAL source$ TYPE OsmGpsMapSource_t
'g_thread_init(NULL) gtk_init (&argc, &argv)
source$ = OSM_GPS_MAP_SOURCE_OPENSTREETMAP
map = g_object_new (OSM_TYPE_GPS_MAP, "map-source", source$, "tile-cache", "/tmp/", NULL)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL) gtk_window_set_title (GTK_WINDOW (window), "BaCon Rules") g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL) gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(map))
gtk_widget_show (GTK_WIDGET(map)) gtk_widget_show (window) gtk_main ()
if lib is installed the should be here file:///usr/share/gtk-doc/html/libosmgpsmap/OsmGpsMap.html copy and paste in your browser :: OpenStreetMap to seamap converter '================================================================================= ' File seamap_converter.bac SUB UPDATE_SEAMAPS(OSMDIR$,ZOOM,REBUILD) OSMDIR$ =OSMDIR$ & STR$(ZOOM) & "/" LOCAL first LOCAL myfile$ OPEN OSMDIR$ FOR DIRECTORY AS mydir PRINT OSMDIR$ REPEAT GETFILE myfile$ FROM mydir getfile$= OSMDIR$ & myfile$ OPEN getfile$ FOR DIRECTORY AS mydir2 REPEAT GETFILE getfile$ FROM mydir2 ' miss the zoom file if have used the original navigation app IF getfile$ = "zoom" THEN
ELSE myfile$ = OSMDIR$ & getfile$ & "/" DIRS$ = getfile$ & "/" FDIR$ = OSMDIR$ & getfile$ & "/" DIRT$ = myfile$ PRINT "OPEN Dir : " ,myfile$
OPEN myfile$ FOR DIRECTORY AS mydir3 REPEAT
GETFILE myfile$ FROM mydir3
IF RIGHT$(DIRS$ & myfile$,4) = ".png" THEN PRINT " Get png" Searchdir$ = OSMDIR$ & DIRS$ INCR first IF NOT(INSTR(myfile$,"S")) THEN DESTINATION$ = FDIR$ & myfile$ SOURCER$ = FDIR$ & "S" & myfile$ IF NOT(FILEEXISTS(SOURCER$)) THEN OSMTILE$ = "https://a.tile.openstreetmap.org/" & STR$(ZOOM) & "/" & DIRS$ & myfile$ TILE$ ="https://t1.openseamap.org/seamark/" & STR$(ZOOM) & "/" & DIRS$ & myfile$ PRINT TILE$ IF REBUILD THEN Cmd$ = "wget " & OSMTILE$ & " -O " & FDIR$ & myfile$ SYSTEM(Cmd$) END IF Cmd$ = "wget " & TILE$ & " -O " & FDIR$ & "S" & myfile$ SYSTEM(Cmd$) LOCAL im1 , im2 TYPE GdkPixbuf* im1 = gdk_pixbuf_new_from_file(DESTINATION$ , NULL) im2 = gdk_pixbuf_new_from_file(SOURCER$, NULL)
w = gdk_pixbuf_get_width(im2) h = gdk_pixbuf_get_height(im2) IF w = -1 THEN
ELSE gdk_pixbuf_composite(im2, im1, 0, 0, w, h, 0,0, 1,1, 0,255) gdk_pixbuf_save (im1,DESTINATION$, "png", 0, NULL, NULL, NULL)
END IF g_object_unref(im1) g_object_unref(im2) PRINT "========================================"
END IF END IF END IF
UNTIL ISFALSE(LEN(myfile$)) END IF
UNTIL ISFALSE(LEN(getfile$))
UNTIL ISFALSE(LEN(myfile$))
PRINT "converted : " , first CLOSE DIRECTORY mydir CLOSE DIRECTORY mydir3 CLOSE DIRECTORY mydir2
END SUB
Enjoy + BR Alex Attachments:
|
|
|
Post by alexfish on Jul 22, 2022 0:53:21 GMT 1
Next step is to add gps position the bis is simple , like this osm_gps_map_set_center_and_zoom(map, 53.865802833333335, -1.6721983333333331,12) for othe INCLUDE's the gps converter will need libnmea from github HEREif link blocker on copy this https://github.com/jacketizer/libnmea
Tile Bits Already have for the reads managed to get BaCon Serial Working + WiFi using BaCon Method OPEN URL$ & ":" & PORT$ FOR NETWORK AS mynet Also Looking at a hackaday on the lib osm files to add seamap png's : hence not tested BR Alex
|
|
|
Post by alexfish on Jul 22, 2022 1:38:27 GMT 1
Hi All
the working code with
osm_gps_map_set_center_and_zoom
'Requires libosmgpsmap-1.0-dev libgtk-3-dev PRAGMA LDFLAGS `pkg-config gtk+-3.0 osmgpsmap-1.0 gthread-2.0 --libs` PRAGMA OPTIONS `pkg-config gtk+-3.0 osmgpsmap-1.0 --cflags` PRAGMA INCLUDE <gtk-3.0/gtk/gtk.h> PRAGMA INCLUDE <osmgpsmap-1.0/osm-gps-map.h>
OPTION PARSE FALSE
LOCAL window TYPE GtkWidget * 'LOCAL track TYPE OsmGpsMapTrack* LOCAL map TYPE OsmGpsMap * LOCAL source$ TYPE OsmGpsMapSource_t
'g_thread_init(NULL) gtk_init (&argc, &argv)
source$ = OSM_GPS_MAP_SOURCE_OPENSTREETMAP
map = g_object_new (OSM_TYPE_GPS_MAP, "map-source", source$, "tile-cache", "/tmp/", NULL)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL) gtk_window_set_title (GTK_WINDOW (window), "BaCon Rules") g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL) gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(map))
gtk_widget_show (GTK_WIDGET(map)) gtk_widget_show (window) osm_gps_map_set_center_and_zoom(map, 53.965748, -1.272365,14)
gtk_main ()
BR Alex
|
|
|
Post by bigbass on Jul 23, 2022 3:01:52 GMT 1
Hello Alex
some feedback for the RPI3 as you know I don't have a boat but I feel comfortable testing gtk3 code demos from the shoreline the RPI3 needs some very small adaptations in the PRAGMA area *unless you edited the osm-gps-map.h
these worked on the RPI3 thanks Joe
your code demo1 RPI3
'Requires libosmgpsmap-1.0-dev libgtk-3-dev PRAGMA LDFLAGS `pkg-config gtk+-3.0 osmgpsmap-1.0 gthread-2.0 --libs` PRAGMA OPTIONS `pkg-config gtk+-3.0 osmgpsmap-1.0 --cflags` PRAGMA INCLUDE <gtk-3.0/gtk/gtk.h> PRAGMA INCLUDE <osmgpsmap-1.0/osm-gps-map.h>
OPTION PARSE FALSE
LOCAL window TYPE GtkWidget * LOCAL map TYPE OsmGpsMap * LOCAL source$ TYPE OsmGpsMapSource_t
'g_thread_init(NULL) gtk_init (&argc, &argv)
source$ = OSM_GPS_MAP_SOURCE_OPENSTREETMAP
map = g_object_new (OSM_TYPE_GPS_MAP, "map-source", source$, "tile-cache", "/tmp/", NULL)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL) gtk_window_set_title (GTK_WINDOW (window), "BaCon Rules") g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL) gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(map))
gtk_widget_show (GTK_WIDGET(map)) gtk_widget_show (window) gtk_main ()
your code demo2 RPI3
'Requires libosmgpsmap-1.0-dev libgtk-3-dev
PRAGMA LDFLAGS `pkg-config gtk+-3.0 osmgpsmap-1.0 gthread-2.0 --libs` PRAGMA OPTIONS `pkg-config gtk+-3.0 osmgpsmap-1.0 --cflags` PRAGMA INCLUDE <gtk-3.0/gtk/gtk.h> PRAGMA INCLUDE <gtk-3.0/gdk/gdk.h> PRAGMA INCLUDE <osmgpsmap-1.0/osm-gps-map.h>
OPTION PARSE FALSE
LOCAL window TYPE GtkWidget * 'LOCAL track TYPE OsmGpsMapTrack* LOCAL map TYPE OsmGpsMap * LOCAL source$ TYPE OsmGpsMapSource_t
'g_thread_init(NULL) gtk_init (&argc, &argv)
source$ = OSM_GPS_MAP_SOURCE_OPENSTREETMAP
map = g_object_new (OSM_TYPE_GPS_MAP, "map-source", source$, "tile-cache", "/tmp/", NULL)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL) gtk_window_set_title (GTK_WINDOW (window), "BaCon Rules") g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL) gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(map))
gtk_widget_show (GTK_WIDGET(map)) gtk_widget_show (window) osm_gps_map_set_center_and_zoom(map, 53.965748, -1.272365,14)
gtk_main ()
|
|
|
Post by alexfish on Jul 23, 2022 10:25:51 GMT 1
Hi Joe
Thanks for the feedback , the lib source code has an example, at first was curious as to the why include the header in short your bits did the trick
PRAGMA INCLUDE <gtk-3.0/gtk/gtk.h> PRAGMA INCLUDE <osmgpsmap-1.0/osm-gps-map.h>
I will update the demo and remove the header + add local link to docs
BR Alex
|
|
|
Post by alexfish on Jul 24, 2022 18:48:01 GMT 1
Hi Joe & All had some terrible casting problems re gobject etc etc so in short these are the bits that work, plus now have the gps working with serial & wifi also got the track/rout plotting in PRAGMA INCLUDE <nmea/gpgll.h> PRAGMA INCLUDE <nmea/gpgsa.h> PRAGMA INCLUDE <nmea/gpvtg.h> PRAGMA INCLUDE <nmea/gptxt.h> PRAGMA INCLUDE <nmea/gpgsv.h> PRAGMA INCLUDE <nmea/gprmc.h> PRAGMA INCLUDE nmea.h
PRAGMA INCLUDE <gtk-3.0/gtk/gtk.h> PRAGMA INCLUDE <osmgpsmap-1.0/osm-gps-map.h> PRAGMA INCLUDE <glib-2.0/glib.h>
PRAGMA LDFLAGS -lnmea PRAGMA LDFLAGS `pkg-config gtk+-3.0 osmgpsmap-1.0 gobject-2.0 gthread-2.0 --libs` PRAGMA OPTIONS `pkg-config gtk+-3.0 osmgpsmap-1.0 --cflags` PRAGMA INCLUDE <gdk/gdkkeysyms.h> now looking to clean up the code ready for posting Q&A Q does it require the GPS A NO it is select by choice if only want the maps BR Alex Attachments:
|
|
|
Post by Pjot on Jul 25, 2022 18:05:04 GMT 1
Thanks Alex, Your code works for me as well, I get a window with a nice map
I have used OpenStreetMaps a lot in the past and it is cool how easy it can be embedded in GTK. But I do see some GTK/GDK warnings and errors in the background. Though this is probably not your code, would there be a way to get of these warnings? E.g.: <....> (osm:23817): GdkPixbuf-CRITICAL **: 19:00:48.589: gdk_pixbuf_new_from_data: assertion 'width > 0' failed (osm:23817): GLib-GObject-CRITICAL **: 19:00:48.589: g_object_set_qdata_full: assertion 'G_IS_OBJECT (object)' failed (osm:23817): GdkPixbuf-CRITICAL **: 19:00:48.589: gdk_pixbuf_scale_simple: assertion 'GDK_IS_PIXBUF (src)' failed (osm:23817): GLib-GObject-CRITICAL **: 19:00:48.589: g_object_unref: assertion 'G_IS_OBJECT (object)' failed (osm:23817): OsmGpsMap-WARNING **: 19:00:48.589: Error getting missing tile (osm:23817): GdkPixbuf-CRITICAL **: 19:00:52.819: gdk_pixbuf_new_from_data: assertion 'width > 0' failed (osm:23817): GLib-GObject-CRITICAL **: 19:00:52.819: g_object_set_qdata_full: assertion 'G_IS_OBJECT (object)' failed (osm:23817): GdkPixbuf-CRITICAL **: 19:00:52.819: gdk_pixbuf_scale_simple: assertion 'GDK_IS_PIXBUF (src)' failed (osm:23817): GLib-GObject-CRITICAL **: 19:00:52.819: g_object_unref: assertion 'G_IS_OBJECT (object)' failed (osm:23817): OsmGpsMap-WARNING **: 19:00:52.819: Error getting missing tile (osm:23817): GdkPixbuf-CRITICAL **: 19:00:52.820: gdk_pixbuf_new_from_data: assertion 'width > 0' failed (osm:23817): GLib-GObject-CRITICAL **: 19:00:52.820: g_object_set_qdata_full: assertion 'G_IS_OBJECT (object)' failed (osm:23817): GdkPixbuf-CRITICAL **: 19:00:52.820: gdk_pixbuf_scale_simple: assertion 'GDK_IS_PIXBUF (src)' failed (osm:23817): GLib-GObject-CRITICAL **: 19:00:52.820: g_object_unref: assertion 'G_IS_OBJECT (object)' failed (osm:23817): OsmGpsMap-WARNING **: 19:00:52.820: Error getting missing tile <...etc...>
Best regards, Peter
|
|
|
Post by alexfish on Jul 25, 2022 21:09:31 GMT 1
Hi Peter possible most warnings are the Missing tile or tiles, I think says he IE there missing from the cache , all tiles are set in cue , that usual settles esp when zoom level is above 5 ADDED . IE the IE , same as OPEN file FOR WRITINGnote the demo uses /tmp as the storage , hence every boot will = same results as mentioned , works is still on going fso rom last post , now concluding the code to download the openseamaps/seamarks. now in last steps of coding 'compositing the two png's into one png' this proved to be a teaser then options will be tmp or cache dir home/user ADDED (osm:23817): GdkPixbuf-CRITICAL **: 19:00:52.820: gdk_pixbuf_new_from_data: assertion 'width > 0' failed OK that is the bit that proved to be a teaser . that width 0 = empty png , generally size of 334 the bit for down loading the seamarks , HERE WE NEED TO GET THE HEADER FIRST SPLIT the header then check the bits 334 of png =0 , I think says he IF INSTR(b$,"334") THEN PRINT array$[4] ELSE
The ELSE = download beyond that I use BaCon FILELEN as a double check BR Alex the test bit as of just a few hours ago Attachments:
|
|
|
Post by alexfish on Jul 26, 2022 2:50:50 GMT 1
Hi All
as an example to the above
two tests on the headers of openseamap/seamarks
TP/2 200 server: nginx date: Tue, 26 Jul 2022 01:41:09 GMT content-type: image/png content-length: 1316 <<<<<<<<<<<<< [b]this is a picture[/b] last-modified: Tue, 31 Aug 2021 16:13:10 GMT etag: "612e5516-524" x-static: super access-control-allow-origin: * access-control-allow-credentials: false access-control-allow-methods: GET, OPTIONS access-control-allow-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type accept-ranges: bytes x-frame-options: DENY x-content-type-options: nosniff x-xss-protection: 1; mode=block x-clacks-overhead: GNU Terry Pratchett =========================================== TP/2 200 server: nginx date: Tue, 26 Jul 2022 01:42:43 GMT content-type: image/ content-length: 334 <<<<<<<<<<<<< [b]this is NOT picture[/b] last-modified: Mon, 23 Nov 2015 17:04:56 GMT etag: "56534738-14e" x-static: super access-control-allow-origin: * access-control-allow-credentials: false access-control-allow-methods: GET, OPTIONS access-control-allow-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type accept-ranges: bytes x-frame-options: DENY x-content-type-options: nosniff x-xss-protection: 1; mode=block x-clacks-overhead: GNU Terry Pratchett
What is inside the png
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 334 100 334 0 0 453 0 --:--:-- --:--:-- --:--:-- 453 �PNG �
that says no picky BR Alex
|
|
|
Post by alexfish on Jul 27, 2022 19:15:37 GMT 1
Hi All update of navigation 2 in archive gpslib.bac example code , please read , note. maps will be stored in home$/baconmaps , default settings .no tracking , no gps no wifi, Adapt code to suit' note the gpslib.bac must be in same directory Example code , ' bacon example using gpslibs ' required gtk3 dev , libosmgpsmap-1.0-dev libnmea from "https://github.com/jacketizer/libnmea" INCLUDE gpslib.bac 'GTK WIDGETS ======================================================================== DECLARE window TYPE GtkWidget * DECLARE vbox TYPE GtkWidget * DECLARE entry TYPE GtkWidget* DECLARE map TYPE GtkWidget* DECLARE but TYPE GtkWidget* DECLARE label TYPE GtkWidget * 'OSM WIDGETS========================================================================= DECLARE rightclicktrack TYPE OsmGpsMapTrack* DECLARE osd TYPE OsmGpsMapLayer * DECLARE source$ TYPE OsmGpsMapSource_t 'TIMEOUT============================================================================= DECLARE timeout TYPE gint 'FOR SERIAL GPS ===================================================================== DECLARE myserial TYPE int 'FOR ENABLE / DISABLE TRACKING DECLARE tracking TYPE int ' =====================================================
DECLARE WiFiURL$ TYPE STRING DECLARE WiFiPORT$ TYPE STRING
FUNCTION GetGPSserial (gpointer user_data)
r = SERIAL_PORT(myserial) IF r = 1 THEN IF tracking THEN LOCAL maps TYPE OsmGpsMap * maps = OSM_GPS_MAP(user_data) osm_gps_map_set_center((gpointer) maps, NMEA.LAT, NMEA.LON) END IF gtk_entry_set_text(GTK_ENTRY(entry),STR$( NMEA.LAT) & " " & NMEA.Cardinal_LAT$ & " " & STR$(NMEA.LON) & " " & NMEA.Cardinal_LON$) END IF
RETURN TRUE END FUNCTION
'========================================================================= FUNCTION GetGPSinet (gpointer user_data)
INET_PORT(WiFiURL$,WiFiPORT$) IF LEN(NMEA.Cardinal_LAT$) THEN IF tracking THEN LOCAL mapy TYPE OsmGpsMap * mapy = OSM_GPS_MAP(user_data) osm_gps_map_set_center((gpointer) mapy, NMEA.LAT, NMEA.LON) END IF gtk_entry_set_text(GTK_ENTRY(entry),STR$( NMEA.LAT) & " " & NMEA.Cardinal_LAT$ & " " & STR$(NMEA.LON) & " " & NMEA.Cardinal_LON$) END IF
RETURN TRUE END FUNCTION '========================================================================= FUNCTION on_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
LOCAL left_button,middle_button,right_button LOCAL lat,lon TYPE float
LOCAL mapsy = OSM_GPS_MAP(widget) TYPE OsmGpsMap * LOCAL othertrack = OSM_GPS_MAP_TRACK(user_data) TYPE OsmGpsMapTrack *
USEC OsmGpsMapPoint coord; END USEC
left_button = (event->button == 1) && (event->state == 0) middle_button = (event->button == 2) || ((event->button == 1) && (event->state & GDK_SHIFT_MASK)) right_button = (event->button == 3) || ((event->button == 1) && (event->state & GDK_CONTROL_MASK))
osm_gps_map_convert_screen_to_geographic(mapsy, event->x, event->y, &coord) osm_gps_map_point_get_degrees(&coord, &lat, &lon)
LOCAL rt TYPE int rt =event->x
osm_gps_map_point_get_degrees(&coord, &lat, &lon) right_button = (event->button == 3) || ((event->button == 1) && (event->state & GDK_CONTROL_MASK)) IF (right_button) THEN osm_gps_map_convert_screen_to_geographic(mapsy, event->x, event->y, &coord) osm_gps_map_track_add_point(othertrack,&coord) END IF
RETURN FALSE END FUNCTION '========================================================================= SUB QUIT(GtkWidget *widget, gpointer user_data)
IF myserial THEN PRINT "Serial Closed" CLOSE DEVICE myserial PRINT "BYE" END IF gtk_widget_destroy(widget) gtk_main_quit()
END SUB '========================================================================= SUB tog_gps(GtkWidget * widget, GdkEventButton *event, gpointer user_data)
tracking = NOT(tracking) IF tracking THEN
gtk_button_set_label (widget,"TRACKING ON") ELSE gtk_button_set_label (widget,"TRACKING OFF") END IF
END SUB
' === main ==================================================
'Common baud rates 'B115200, B230400, B9600, B19200, B38400, B57600, B1200, B2400, B4800
'========================== 'FOR Serial example remove quotes to enable or quote to disable ' edit the /dev/tty* '========================== HOME$ = GETENVIRON$("HOME") OSMDIR$ = HOME$ & "/baconmaps/" PRINT OSMDIR$ /* myserial = INIT_SERIAL("/dev/ttyACM0" , B38400) IF NOT(myserial) THEN END END IF */
'==========================
'FOR WIFI example remove quotes to enable or quote to disable ' edit the url & port '==========================
WiFiURL$ = "192.168.1.100" WiFiPORT$ = "2000" /* IF NOT(INITWIFI(WiFiURL$,WiFiPORT$ )) THEN END END IF */ '=============================== gtk_init (&argc, &argv)
source = OSM_GPS_MAP_SOURCE_OPENSTREETMAP
window = gtk_window_new (GTK_WINDOW_TOPLEVEL) gtk_window_set_default_size(GTK_WINDOW(window), 600, 400) gtk_window_set_title (GTK_WINDOW (window), "Sea Nav") g_signal_connect_data (GTK_WINDOW (window), "destroy", G_CALLBACK (QUIT),0,0,0)
map = g_object_new (OSM_TYPE_GPS_MAP, "map-source", source, "tile-cache",OSMDIR$, NULL)
osd = g_object_new (OSM_TYPE_GPS_MAP_OSD, \ "show-scale",TRUE, \ "show-coordinates",TRUE, \ "show-crosshair",TRUE, \ "show-dpad",TRUE, \ "show-zoom",TRUE, \ "show-gps-in-dpad",TRUE, \ "show-gps-in-zoom",FALSE, \ "show-copyright",FALSE, \ "dpad-radius", 30, \ NULL)
osm_gps_map_layer_add (OSM_GPS_MAP(map), osd) rightclicktrack = osm_gps_map_track_new ()
g_object_set(rightclicktrack, "editable", TRUE, NULL)
osm_gps_map_track_add(OSM_GPS_MAP(map), rightclicktrack) g_signal_connect_data (G_OBJECT (map), "button-press-event",G_CALLBACK (on_button_press_event), (gpointer) rightclicktrack,0,0)
vbox =gtk_box_new (GTK_ORIENTATION_VERTICAL, 3)
entry = gtk_entry_new() gtk_entry_set_text(GTK_ENTRY(entry),"52.0706, 4.3129");
gtk_box_pack_start(GTK_BOX(vbox), map,1,1,0) gtk_box_pack_start(GTK_BOX(vbox), entry,0,0,1)
but = gtk_button_new_with_label("TRACKING OFF") gtk_widget_show (GTK_WIDGET(but)) gtk_box_pack_start(GTK_BOX(vbox), but,0,0,1)
g_signal_connect_data (G_OBJECT (but), "button-press-event",G_CALLBACK (tog_gps), 0,0,0)
gtk_container_add(GTK_CONTAINER(window), vbox)
gtk_widget_show (GTK_WIDGET(vbox)) gtk_widget_show (GTK_WIDGET(map)) gtk_widget_show_all (window)
gtk_widget_set_size_request(entry,-1,30) gtk_widget_set_size_request(entry,-1,30)
/* timeout can change to serial or GetGPSinet or comment out both if no serial or net */
'timeout = g_timeout_add(1000, GetGPSserial,GTK_WIDGET( map)) 'timeout= g_timeout_add (1000, GetGPSinet, map)
' set the zoom osm_gps_map_set_zoom (map,16) 'set the gps to a location 52.0706 4.3129 osm_gps_map_set_center( map, 52.0706, 4.3129)
gtk_main ()
to plot a track Mouse Button Right click BR Alex Attachments:gpslib.bac.tar.bz2 (2.01 KB)
|
|
|
Post by alexfish on Aug 30, 2022 2:39:12 GMT 1
Hi All
OpenStreetMap 2 seamap converter added See post #1
BR Ales
|
|
|
Post by alexfish on Sept 7, 2022 23:18:25 GMT 1
Hi All asp can see from recent post RE OPEN FOR DIRECTORY , the seamap converter function has been re-written , Code at first post this part has is now part of the general gui hence one can use the app and then convert to seamap on the go by clicking on the button , added tracking enable / disable , here one can scan an area and then convert to seamap at will, see picky vessel tracking now enabled as in, IE it leaves a trail. + have now added means of weather and tides , using a bit of PicScale internally on some older images , final update hopeful next week , as can see there are two panes, when i mention final update this means it will be down to the user to add what ever to the left hand pane BR Alex Attachments:
|
|
|
Post by alexfish on Sept 18, 2022 0:03:29 GMT 1
Hi All still behind after finding another bug , now resolved new interface option added RE webkit and openseamap options will be tide and weather or tide and weather have searched high & low for AIS decoder based on c how ever if install gps lib then can use that option, this one should give ais info , not tested as yet Joe has baconised the bits read here sourceforge.net/p/bacon-qt5/wiki/gps_from_localhost/have tested python ais , a bit of code + typical reply import ais #message = NMEAMessage(b"!AIVDM,1,1,,B,15M67FC000G?ufbE`FepT@3n00Sa,0*5C")
message = ais.decode('15M67FC000G?ufbE`FepT@3n00Sa', 0) print(message) reply {'id': 1, 'repeat_indicator': 0, 'mmsi': 366053209, 'nav_status': 3, 'rot_over_range': False, 'rot': 0.0, 'sog': 0.0, 'position_accuracy': 0, 'x': -122.34161833333333, 'y': 37.80211833333333, 'cog': 219.3000030517578, 'true_heading': 1, 'timestamp': 59, 'special_manoeuvre': 0, 'spare': 0, 'raim': False, 'sync_state': 0, 'slot_timeout': 0, 'slot_offset': 2281} so easy if you know the sentence count and trim the bits BR Alex picky of OSM + openseamap with ais Attachments:
|
|
|
Post by alexfish on Oct 9, 2022 23:08:12 GMT 1
Hi All found another problem normally I do not use the GPSD , this was installed and resulted serial read device problems 1. device busy or permission denied :: obvious the gpsd is still running 2. normally the gpsd does not run unless you tell it IE gpsd /dev/tty* . * = your device 3. found that after fresh boot or reboot serial read or even cat the device = errors , garbage How does one stop the gpsd + get the device back to normal ? So after a while in days finally found a way around the problem using one of the gpsd tools gpsctl man gpsctl
find command -r in short and in may case this worked -r /dev/ttyACM0 but use at your own risk to check example and result gpsctl /dev/ttyACM0 /dev/ttyACM0 identified as a NMEA0183 although this device is a 'u-blox GPS' may have on your system ubxtool man ubxtool the Why, can read here HEREBR Alex
|
|
|
Post by alexfish on Oct 30, 2022 22:16:46 GMT 1
Hi All
Yet more trouble
this concerns openseamap marks,
did some testing of original navigation using x11 and cairo on manjaro gnome no maps would show , found that seamarks no go did a test from the terminal results of wget
wget https://tiles.openseamap.org/seamark/17/65312/41776.png --2022-10-30 20:51:36-- https://tiles.openseamap.org/seamark/17/65312/41776.png Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt' Resolving tiles.openseamap.org (tiles.openseamap.org)... 195.37.132.70, 64:ff9b::c325:8446 Connecting to tiles.openseamap.org (tiles.openseamap.org)|195.37.132.70|:443... connected. ERROR: The certificate of ‘tiles.openseamap.org’ is not trusted. ERROR: The certificate of ‘tiles.openseamap.org’ doesn't have a known issuer. The certificate's owner does not match hostname ‘tiles.openseamap.org solution looks like orignal http will work here
wget http://tiles.openseamap.org/seamark/17/65312/41776.png --2022-10-30 21:00:58-- http://tiles.openseamap.org/seamark/17/65312/41776.png Resolving tiles.openseamap.org (tiles.openseamap.org)... 195.37.132.70, 64:ff9b::c325:8446 Connecting to tiles.openseamap.org (tiles.openseamap.org)|195.37.132.70|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 3558 (3.5K) [image/png] Saving to: ‘41776.png’
also need to test other os's
BR Alex
|
|