Knihovna, která umožňuje autorům skriptů generovat výstupy z GeoGetu řazené a seskupované dle přidělených klíčů - kategorií. Ve výchozím nastavení jsou data exportována v pořadí tak, jak jsou zobrazena v načteném seznamu. Pomocí této knihovny lze každé keši v seznamu přidělit klíč a zařadit ji do fronty ke zpracování. Následně je pak fronta seřazena podle kategorií (abecedně) a zpracovávána v daném pořadí.
![]() |
Instalaci doplňku spustíte kliknutím na tlačítko vlevo. Následně budete v prostředí GeoGetu provedeni instalačním procesem. Pro zajištění této funkce je třeba mít na počítači již
nainstalovaný a
spuštěný program GeoGet
.
|
procedure CatInit;
procedure CatSetCallback(callback : TCatCallback);
procedure(const geo: tgeo; const wpt: TWpt; category: string)
procedure CatBeginUpdate;
procedure CatAddGC(GC: TGeo; category: string);
procedure CatAddWpt(Wpt: TWpt; category: string);
procedure CatSort;
procedure CatCategories(const value: TStrings);
function CatSize: Integer;
function CatCategorySize(category : string) : Integer;
procedure CatEndUpdate;
procedure CatFinish;
Zde je plný opis zdrojového kódu makra, které používá tuto knihovnu ke generování HTML výstupu seřazeného dle kategorie keší. Výstup je jinak shodný s makrem html.gge.pas.
{$include category.lib.pas} //Include the library var exportData : String; //this field holds the exported data var exportCounter : Integer; //this field holds the current number of already exported points var lastCategory : String; //this field holds the name of the last exported category {This function returns the extension of the exported file} function ExportExtension: string; begin result := 'HTML'; end; {This function returns the description of this export format} function ExportDescription: string; begin result := 'HTML list - sorted by category'; end; {This function returns the data about one point, which should be written to the body of the export file} function ExportPoint: string; begin //Only divide points in to categories, do not generate any output yet! CatAddGC(GC,GC.CacheType); //Register the processed point to the category library. Use the cachetype as the category Result := ''; //We are using category library as a workaround. No data must be exported to the file at this stage. end; {This function generates the HTML output based on the given TGeo} function GenerateOutputGeo(geo :TGeo): string; var n: integer; wcnt: integer; begin wcnt := 0; for n := 0 to geo.Waypoints.Count - 1 do if geo.Waypoints[n].IsListed then inc(wcnt); Result := ' <tr>' + CRLF; Result := Result + ' <td rowspan='+inttostr(2 * wcnt + 2) +' valign="top"><b>' + geo.ID + '</b></td>' + CRLF; Result := Result + ' <td>' + geo.IDtag + '</td>' + CRLF; Result := Result + ' <td><b>' + '<A href="' + geo.URL + '">' + geo.Name + '</a></b></td>' + CRLF; Result := Result + ' <td><font face="arial, helvetica">' + ansitoutf(geo.GetCoord) + '</font></td>' + CRLF; Result := Result + ' </tr>' + CRLF; Result := Result + ' <tr>' + CRLF; Result := Result + ' <td colspan=3><font size=-1><i>Hint: ' + geo.hint + '</i></font></td>' + CRLF; Result := Result + ' </tr>' + CRLF; for n := 0 to geo.Waypoints.Count - 1 do if geo.Waypoints[n].IsListed then begin Result := Result + ' <tr>' + CRLF; Result := Result + ' <td>' + geo.Waypoints[n].TypeID + ' ' + geo.Waypoints[n].prefixid+ '</td>' + CRLF; Result := Result + ' <td><b>' + geo.Waypoints[n].Name + '</b></td>' + CRLF; Result := Result + ' <td><font face="arial, helvetica">' + ansitoutf(geo.Waypoints[n].GetCoord) + '</font></td>' + CRLF; Result := Result + ' </tr>' + CRLF; Result := Result + ' <tr>' + CRLF; Result := Result + ' <td colspan=3><font size=-1><i>' + geo.Waypoints[n].Description + '</i></font></td>' + CRLF; Result := Result + ' </tr>' + CRLF; end; end; {This function will be called by the category library and will take care of the export itself} procedure ExportCallback(const geo: tgeo; const wpt: TWpt; category: string); begin if geo <> nil then begin exportCounter := exportCounter + 1; //Increment the counter //handle busy dialog if lastCategory <> category then begin lastCategory := category; GeoBusyKind('Generating HTML output - (' + category + ', ' + IntToStr(CatCategorySize(category))+ ' points)'); end; GeoBusyProgress(exportCounter,CatSize); //Handle the point export exportData := exportData + GenerateOutputGeo(geo); end else if wpt <> nil then ShowMessage('Error occured. No waypoints should be added to category library in this demo export!') //Handle the waypoint export else ShowMessage('Error occured. Invalid parameters supplied!'); end; procedure ExportInit; begin CatInit; //Initialize the category library CatSetCallback(@ExportCallback); //Set the callback procedure. This procedure will be called by the category library during the sort process CatBeginUpdate; //Start transaction on category library exportData := ''; //Make sure that the result variable is empty at the beginning exportCounter := 0; //Set the number of already exported points to 0 end; {This function returns the data which should be written to the beginning of the exported file} function ExportHeader: string; begin ExportInit(); //Initialize the export Result := '<html>' + CRLF; Result := Result + '<head>' + CRLF; Result := Result + '<title>GeoGet cache list</title>' + CRLF; Result := Result + '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">' + CRLF; Result := Result + '</head>' + CRLF; Result := Result + '<body>' + CRLF; Result := Result + '<table width="100%" border=0 column=4>' + CRLF; end; {This function returns the data which should be written to the end of the exported file} function ExportFooter: string; begin CatEndUpdate; //Close transaction on category library CatSort; //Call the main function of the library. This call will ensure that exportData variable will be full of sorted output CatFinish; //Free the memory used by the category library Result := exportData; //Write the exported data to the file Result := Result + '</table>' + CRLF + '</body>' + CRLF; //close the file end; {This function is called after the output is written to the file} function ExportAfter(value: string): string; begin Result := ''; RunShell(value); //Open the result file in the browser end;
Page | Date | Description | Tags |
---|---|---|---|
Be-on-road | 2015/09/26 10:30 | Be-on-road Plugin pro export keší do navigace Be On Road. Autor mikrom, <mikrom@mikrom.cz> LudekV - ikony keší à la a:drake Pokud se Vám doplněk líbí, klikn… | skript, tsv, export, author mikrom, ggp, gge, beonroad, uses category, uses reltoabspath, uses varsubst |
iGO Primo | 2014/06/29 13:04 | iGO Primo Exportní skript speciálně tvořený pro export do navigačního programu iGO Primo (Android, ale měl by bez problémů fungovat i na Windows CE verzích). … | skript, uses category, uses reltoabspath, uses varsubst, author mikrom, ggp, gge, export, kml, igo, primo |
POI Garmin | 2012/07/07 14:12 | POI Garmin Skript, který exportuje z Geogetu GPX soubory vhodné pro použití s POI Loaderem. Pomocí POI Loaderu je možné nahrát soubory do navigace jako Vlastní… | author medwyn, colorado, dakota, export, etrex, garmin, ggp, gps, gpx, oregon, poi, skript, waymarking, uses varsubst, uses reltoabspath, uses category |
POIeTrex | 2019/09/27 16:40 | POIeTrex Export Geocache do GPS Garmin řady eTrex. Generuje sadu GPX souborů pro program PoiLoader, včetně optimalizovaných ikonek. Autor * geby * medwyn… | author geby, author medwyn, skript, gge, ggp, etrex, export, garmin, geocaching, gps, gpx, poi, uses category |
TomTom | 2014/07/30 09:47 | TomTom Export keší do navigací TomTom. Autor mikrom, <mikrom@mikrom.cz> Pokud se Vám doplněk líbí, kliknutím na tlačítko Donate můžete přispět na jeho vývo… | author mikrom, skript, ggp, gge, export, tomtom, ov2, uses category, uses reltoabspath, uses varsubst |
Pokud jste narazili na skript, který knihovnu používá, ale není zde uveden, kontaktujte, prosím, autory.
Stáhnout aktuální verzi: category-0.1.3.gip
Filename | Filesize | Last modified |
---|---|---|
category-0.1.3.gip | 1.9 KiB | 2011/01/04 00:00 |
category-0.1.2.gip | 1.7 KiB | 2010/11/03 00:00 |
category-0.1.1.gip | 1.6 KiB | 2010/11/03 00:00 |
Zobrazit změny ve starších verzích
Skrýt změny ve starších verzích