[mkgmap] 01/04: Imported Upstream version 0.0.0+svn3695

Bas Couwenberg sebastic at debian.org
Sat Oct 1 08:24:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository mkgmap.

commit 46c9c9399aa3063d3db463a61d9a75da921a8aac
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sat Oct 1 09:47:25 2016 +0200

    Imported Upstream version 0.0.0+svn3695
---
 doc/options.txt                                          | 5 +++++
 resources/help/en/options                                | 5 +++++
 resources/mkgmap-version.properties                      | 4 ++--
 src/uk/me/parabola/imgfmt/FileSystemParam.java           | 9 +++++++++
 src/uk/me/parabola/imgfmt/sys/ImgHeader.java             | 9 +++++++--
 src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java | 4 ++++
 6 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/doc/options.txt b/doc/options.txt
index a851d7d..0bf5b0b 100644
--- a/doc/options.txt
+++ b/doc/options.txt
@@ -691,6 +691,11 @@ cover the same area, you can see through this map and see the
 lower map too.  Useful for contour line maps among other
 things.
 <p>
+;--hide-gmapsupp-on-pc
+: 	Set a bit in the gmapsupp.img that tells PC software that the file is
+already installed on the PC and therefore there is no need to read it 
+from the device.
+<p>
 ;--poi-address
 : 	Enable address / phone information to POIs. Address info is
 read according to the "Karlsruhe" tagging schema. Automatic
diff --git a/resources/help/en/options b/resources/help/en/options
index 5c579ae..169f91f 100644
--- a/resources/help/en/options
+++ b/resources/help/en/options
@@ -685,6 +685,11 @@ Miscellaneous options:
 	lower map too.  Useful for contour line maps among other
 	things.
 
+--hide-gmapsupp-on-pc
+  Set a bit in the gmapsupp.img that tells PC software that the file is
+	already installed on the PC and therefore there is no need to read it 
+	from the device.
+
 --poi-address
 	Enable address / phone information to POIs. Address info is
 	read according to the "Karlsruhe" tagging schema. Automatic
diff --git a/resources/mkgmap-version.properties b/resources/mkgmap-version.properties
index ad1defd..edf6f40 100644
--- a/resources/mkgmap-version.properties
+++ b/resources/mkgmap-version.properties
@@ -1,2 +1,2 @@
-svn.version: 3694
-build.timestamp: 2016-08-18T22:23:10+0100
+svn.version: 3695
+build.timestamp: 2016-09-11T16:04:51+0100
diff --git a/src/uk/me/parabola/imgfmt/FileSystemParam.java b/src/uk/me/parabola/imgfmt/FileSystemParam.java
index 3a19ae1..e91d7f4 100644
--- a/src/uk/me/parabola/imgfmt/FileSystemParam.java
+++ b/src/uk/me/parabola/imgfmt/FileSystemParam.java
@@ -25,6 +25,7 @@ public class FileSystemParam {
 	private int directoryStartEntry = 2; // Always in terms of entries of 512 bytes
 	private int reservedDirectoryBlocks = 202;
 	private boolean gmapsupp;
+	private boolean hideGmapsuppOnPC;
 
 	public String getFilename() {
 		return filename;
@@ -75,4 +76,12 @@ public class FileSystemParam {
 	public void setGmapsupp(boolean gmapsupp) {
 		this.gmapsupp = gmapsupp;
 	}
+
+	public boolean isHideGmapsuppOnPC() {
+		return hideGmapsuppOnPC;
+	}
+
+	public void setHideGmapsuppOnPC(boolean hideGmapsuppOnPC) {
+		this.hideGmapsuppOnPC = hideGmapsuppOnPC;
+	}
 }
diff --git a/src/uk/me/parabola/imgfmt/sys/ImgHeader.java b/src/uk/me/parabola/imgfmt/sys/ImgHeader.java
index 9ab6666..a5e66df 100644
--- a/src/uk/me/parabola/imgfmt/sys/ImgHeader.java
+++ b/src/uk/me/parabola/imgfmt/sys/ImgHeader.java
@@ -161,6 +161,7 @@ class ImgHeader {
 		setCreationTime(date);
 		setUpdateTime(date);
 		setDescription(params.getMapDescription());
+		header.put(OFF_SUPP, (byte) (fsParams.isGmapsupp() && fsParams.isHideGmapsuppOnPC() ? 1: 0));
 
 		// Checksum is not checked.
 		header.put(OFF_CHECKSUM, (byte) 0);
@@ -337,7 +338,7 @@ class ImgHeader {
 	 * @param s The string
 	 * @return A byte array.
 	 */
-	private byte[] toByte(String s) {
+	private static byte[] toByte(String s) {
 		// NB: what character set should be used?
 		return s.getBytes();
 	}
@@ -350,7 +351,7 @@ class ImgHeader {
 	 * @param y The year in real-world format eg 2006.
 	 * @return A one byte code representing the year.
 	 */
-	private byte toYearCode(int y) {
+	private static byte toYearCode(int y) {
 		return (byte) (y - 1900);
 	}
 
@@ -367,6 +368,10 @@ class ImgHeader {
 		this.numBlocks = numBlocks;
 	}
 
+	public void hideGmapsuppOnPC (boolean b) {
+		header.put(OFF_SUPP, (byte) (fsParams.isGmapsupp() && b ? 1: 0));
+	}
+	
 	/**
 	 * Represent a block number in the chs format.
 	 *
diff --git a/src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java b/src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java
index 8c9005a..5cb9ab1 100644
--- a/src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java
+++ b/src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java
@@ -84,6 +84,7 @@ public class GmapsuppBuilder implements Combiner {
 	private final Map<Integer, MdrBuilder> mdrBuilderMap = new LinkedHashMap<Integer, MdrBuilder>();
 	private final Map<Integer, Sort> sortMap = new LinkedHashMap<Integer, Sort>();
 	private boolean splitName;
+	private boolean hideGmapsuppOnPC;
 
 
 	public void init(CommandArgs args) {
@@ -92,6 +93,7 @@ public class GmapsuppBuilder implements Combiner {
 		overallDescription = args.getDescription();
 		outputDir = args.getOutputDir();
 		splitName = args.get("split-name-index", false);
+		hideGmapsuppOnPC = args.get("hide-gmapsupp-on-pc", false);
 	}
 
 	/**
@@ -421,11 +423,13 @@ public class GmapsuppBuilder implements Combiner {
 		params.setMapDescription(overallDescription);
 		params.setDirectoryStartEntry(DIRECTORY_OFFSET_ENTRY);
 		params.setGmapsupp(true);
+		params.setHideGmapsuppOnPC(hideGmapsuppOnPC);
 
 		int reserveBlocks = (int) Math.ceil(bi.reserveEntries * 512.0 / blockSize);
 		params.setReservedDirectoryBlocks(reserveBlocks);
 
 		FileSystem outfs = ImgFS.createFs(Utils.joinPath(outputDir, GMAPSUPP), params);
+		
 		mpsFile = createMpsFile(outfs);
 		mpsFile.setMapsetName(mapsetName);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/mkgmap.git



More information about the Pkg-grass-devel mailing list