Index: src/webapp/build.xml
===================================================================
--- src/webapp/build.xml	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/build.xml	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -46,19 +46,34 @@
 	<target name="dist" depends="buildwebservice,buildwebclient,test">
 		<echo msg="Creating archive"/>
-	<!--	<tar destfile="${builddir}/..//gnuboat-webapp.tar.gz" compression="gzip">
+		<tar destfile="${builddir}/..//gnuboat-webapp.tar.gz" compression="gzip">
 			<fileset refid="filesWebApp"/>
-		</tar>-->
+		</tar>
 		<echo msg="Files copied and compressed in build directory weblcient.tar.gz OK!" />
 	</target>
-	<target name="testdist" depends="buildwebservice,buildwebclient">
+
+	<target name="testdist" depends="buildwebservice,buildwebclient,test">
 		<echo msg="Install project into ${user.home}/public_html/gnuboat"/>
+		<fileset id="filesConfig" dir="./webservice/tests">
+			<include name="config.php"/>
+		</fileset>
+		<fileset id="filesLogs" dir="./webservice/tests/data">
+			<include name="*.log"/>
+		</fileset>
+	
 		<copy todir="${user.home}/public_html/gnuboat">
 			<fileset refid="filesWebApp"/>
+		</copy>
+		<copy todir="${user.home}/public_html/gnuboat/logs">
+			<fileset refid="filesLogs"/>
+		</copy>
+		<copy todir="${user.home}/public_html/gnuboat/webservice/config">
+			<fileset refid="filesConfig"/>
 		</copy>
 	</target>
 
 	<target name="test">
-		<phpunit bootstrap="webservice/inc/autoloader.php" pharlocation="phpunit-4.8.9.phar" haltonfailure="true" haltonerror="true" printsummary="true">
+		<phpunit bootstrap="webservice/inc/autoloader.php" pharlocation="phpunit-4.8.9.phar" haltonfailure="true" haltonerror="true" printsummary="true" codecoverage="false">
 			<formatter type="plain" usefile="false"/>
+			<!--<formatter type="JUnit" usefile="true"/>-->
 			<batchtest>
 				<fileset dir="webservice">
Index: src/webapp/webclient/index.html
===================================================================
--- src/webapp/webclient/index.html	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webclient/index.html	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -139,5 +139,14 @@
 					<div id="map">
 						<a name="map"></a>
-						<form id="mapSelectForm" class="pure-form"><select id="mapSelect" class="pure-input-1" size="1"></select></form>
+						<form id="mapSelectForm" class="pure-form pure-form-aligned">
+							<div class="pure-control-group">
+								<label for="mapModusSelect">Map Modus:</label>
+								<select id="mapModusSelect" size="1" class="pure-input-1-2"></select>
+							</div>
+							<div class="pure-control-group">
+								<label for="mapSelect">Map Selection:</label>
+								<select id="mapSelect" size="1" class="pure-input-1-2"></select>
+							</div>
+						</form>
 						<div id="mapViewport" class="viewportGeometry"></div>
 					</div>
Index: src/webapp/webclient/js/GnuBoat.js
===================================================================
--- src/webapp/webclient/js/GnuBoat.js	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webclient/js/GnuBoat.js	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -54,5 +54,5 @@
 {
 	if(GnuBoat.private.serverBaseUrl == null){
-		GnuBoat.displayMessage("No server set/found");
+		GnuBoat.displayMessage('<span class="error">No server set/found</span>');
 		return;
 	}
@@ -67,5 +67,5 @@
 {
 	if(GnuBoat.private.serverBaseUrl == null){
-		GnuBoat.displayMessage("No server set/found");
+		GnuBoat.displayMessage('<span class="error">No server set/found</span>');
 		return;
 	}
@@ -79,9 +79,10 @@
 {
 	if(GnuBoat.private.serverBaseUrl == null){
-		GnuBoat.displayMessage("No server set/found");
+		GnuBoat.displayMessage('<span class="error">No server set/found</span>');
 		return;
 	}
 	$("#logfilesForm").empty();
 	$.getJSON(GnuBoat.private.serverBaseUrl +"?request=logfiles", function(data){
+		GnuBoat.private.updateMapModus(data);
 		if(!Array.isArray(data) || data.length < 1){
 			$("<p>No Logfiles found!</p>").appendTo("#logfilesForm");
@@ -90,7 +91,7 @@
 		}
 		if(("error" in data) && data["error"] == 1){
-			alert("Failed to upload map: "+ data["errormessage"]);
-			$("#mapTileUploadProgress").hide();
-			$("#mapFileInput").show();
+			GnuBoat.displayMessage('<span class="error">Failed to get log files: '+ data["errormessage"] +'</span>');
+			$("<p>No Logfiles found!</p>").appendTo("#logfilesForm");
+			console.log(data);
 			return;
 		}
@@ -108,5 +109,5 @@
 {
 	if(GnuBoat.private.serverBaseUrl == null){
-		GnuBoat.displayMessage("No server set/found");
+		GnuBoat.displayMessage('<span class="error">No server set/found</span>');
 		return;
 	}
@@ -129,5 +130,5 @@
 {
 	if(GnuBoat.private.serverBaseUrl == null){
-		displayMessage("No server set/found");
+		displayMessage('<span class="error">No server set/found</span>');
 		return;
 	}
@@ -142,10 +143,10 @@
 		success: function(data){
 			if(("error" in data) && data["error"] == 1){
-				alert("Failed to upload map: "+ data["errormessage"]);
+				GnuBoat.displayMessage('<span class="error">Failed to upload map: '+ data["errormessage"] +'</span>');
 				$("#mapTileUploadProgress").hide();
 				$("#mapFileInput").show();
 				return;
 			}
-			alert("Map upload successfully");
+			GnuBoat.displayMessage('<span class="error">Map upload successfully</span>');
 			$("#mapTileUploadProgress").hide();
 			$("#mapFileInput").show();
@@ -153,5 +154,5 @@
 		},
 		error: function(jqXHR, exception, errorThrown){
-			alert("Failed to upload map (XHR): "+ exception);
+			GnuBoat.displayMessage('<span class="error">Failed to upload map (XHR): '+ exception +'</span>');
 			$("#mapTileUploadProgress").hide();
 			$("#mapFileInput").show();
@@ -167,4 +168,5 @@
 GnuBoat.initialize = function()
 {
+	$("#mapModusSelect").change(function(){ GnuBoat.private.mapModusChanged(); });
 	$("#mapTileUploadProgress").hide();
 	$("#logfilesReload").click(GnuBoat.logfilesLoad);
@@ -242,5 +244,5 @@
 {
 	if(GnuBoat.private.serverBaseUrl == null){
-		GnuBoat.displayMessage("No server set/found");
+		GnuBoat.displayMessage('<span class="error">No server set/found</span>');
 		return;
 	}
@@ -250,5 +252,5 @@
 	if(GnuBoat.private.timerDisplay == null)
 		GnuBoat.private.timerDisplay = setInterval(GnuBoat.displayDataGet, 10000);
-	GnuBoat.logfilesLoad();	
+	GnuBoat.logfilesLoad();
 	
 	GnuBoat.private.animate();
@@ -276,4 +278,5 @@
 	mapsMetadata: null,
 	mapBounds: null,
+	mapModusLive: true,
 	dataMappings: {
 		speedthroughwater: {display: true, map: true, mapActive: false, titleLong: "Speed Through Water", titleShort: "STW", unit: "kts"},
@@ -302,4 +305,14 @@
 	displayDataSet: function(data)
 	{
+// 		if(!Array.isArray(data) || data.length < 1){
+// 			console.log("No data array returned!");
+// 			console.log(data);
+// 			return;
+// 		}
+		if(("error" in data) && data["error"] == 1){
+			GnuBoat.displayMessage('<span class="error">Failed to get display data and tracks: '+ data["errormessage"] +'</span>');
+			return;
+		}
+
 		var keysDisplay = [];
 		for(var key in GnuBoat.private.dataMappings){
@@ -307,9 +320,5 @@
 				keysDisplay.push(key);
 		}
-		if(!Array.isArray(data) && !(data instanceof Object)){
-			console.log("No data array returned!");
-			console.log(data);
-			return;
-		}
+
 		if(!("lastvalid" in data)){
 				console.log("No last valid values given!");
@@ -333,68 +342,12 @@
 		}
 		
-		if(!("track" in data)){
-				console.log("No track given!");
-		}
-		else{
-			if(GnuBoat.private.map == null){
-				console.log("No map in use");
-			}
-			else{
-				var track = data["track"];
-				var maximas = [];
-				var minimas = [];
-				var points = [];
-				var densityPoints = [];
-				
-				var keysMap = [];
-				for(var key in GnuBoat.private.dataMappings){
-					if(GnuBoat.private.dataMappings[key]["map"] === true)
-						keysMap.push(key);
-				}
-				for(var i = 0; i < keysMap.length; i++){
-					if(keysMap[i] == "gpsfix")
-						continue;
-					points[keysMap[i]] = [];
-				}
-				
-				// getting maximas, minimums for normalization and the tracks themselves
-				for(var time in track){
-					for(var i = 0; i < keysMap.length; i++){
-						var key = keysMap[i];
-						if(key == "gpsfix")
-							continue;
-						if(!(key in maximas))
-							maximas[key] = track[time][key]
-						else if(maximas[key] < track[time][key])
-							maximas[key] = track[time][key];
-						if(!(key in minimas))
-							minimas[key] = track[time][key]
-						else if(minimas[key] > track[time][key])
-							minimas[key] = track[time][key];
-						points[key].push(new L.latLng(track[time]["latitude"], track[time]["longitude"], track[time][key]));
-						densityPoints.push({latitude: track[time]["latitude"], longitude: track[time]["longitude"], depth: track[time]["waterdepth"]});
-					}
-				}
-				for(var i = 0; i < keysMap.length; i++){
-					var key = keysMap[i];
-					if(key == "gpsfix")
-						continue;
-					if(points[key].length > 0){
-						if(key in GnuBoat.private.mapPolylines)
-							GnuBoat.private.mapPolylines[key].setLatLngs(points[key]);
-						else{
-							GnuBoat.private.mapPolylines[key] = L.hotline(points[key], {weight: 3, outlineWidth: 0, min: minimas[key], max: maximas[key]});
-							if(GnuBoat.private.mapControl){
-								var name = GnuBoat.private.dataMappings[key]["titleLong"] +" in "+ GnuBoat.private.dataMappings[key]["unit"] +" ("+ GnuBoat.private.dataMappings[key]["titleShort"] +")";
-								GnuBoat.private.mapControl.addOverlay(GnuBoat.private.mapPolylines[key], name);
-							}
-							if(GnuBoat.private.dataMappings[key]["mapActive"] === true)
-								GnuBoat.private.mapPolylines[key].addTo(GnuBoat.private.map);
-						}
-					}
-				}
-				GnuBoat.private.drawDensityEstimation(densityPoints, maximas["waterdepth"], minimas["waterdepth"]);
-			}
-		}
+		// map displays logged data
+		if(!GnuBoat.private.mapModusLive)
+			return;
+		else if(!("track" in data)){
+			console.log("No track given!");
+			return;
+		}
+		GnuBoat.private.mapAddTracks(data["track"]);
 	},
 	
@@ -578,3 +531,134 @@
 		return result;
 	},
+	
+	updateMapModus: function(data)
+	{
+		var selected = $("#mapModusSelect").val();
+		$("#mapModusSelect").empty();
+		var selectedFound = false;
+		if(selected != null && Array.isArray(data)){
+			data.forEach(function(value, index){
+				if(value == selected)
+					selectedFound = true;
+			});
+		}
+		var selectedString = "";
+		if(!selectedFound)
+			selectedString = " selected";
+		$('<option value="live"'+ selectedString +'>Live View</option>').appendTo("#mapModusSelect");
+		if(!Array.isArray(data) || data.length < 1){
+			console.log(data);
+			return;
+		}
+		if(("error" in data) && data["error"] == 1){
+			GnuBoat.displayMessage('<span class="error">Failed to upload map: '+ data["errormessage"] +'</span>');
+			return;
+		}
+		data.forEach(function(value, index){
+			var selectedString = "";
+			if(value == selected)
+				selectedString = " selected";
+			$("<option value=\""+ value +"\""+ selected +">"+ value +"</option>").appendTo("#mapModusSelect");
+		});
+	},
+	
+	mapModusChanged: function()
+	{
+		var modus = $("#mapModusSelect").val();
+		// live modus is automatically activated on displayDataSet
+		if(modus == "live"){
+			GnuBoat.private.mapModusLive = true;
+			return;
+		}
+		// remove overlays
+		if(GnuBoat.private.mapControl != null){
+			for(var key in GnuBoat.private.dataMappings){
+				if(GnuBoat.private.dataMappings[key]["map"] === true)
+					if(key in GnuBoat.private.mapPolylines){
+						GnuBoat.private.mapControl.removeLayer(GnuBoat.private.mapPolylines[key]);
+						GnuBoat.private.mapPolylines[key].remove();
+						delete GnuBoat.private.mapPolylines[key];
+					}
+			}
+		}
+		GnuBoat.private.mapModusLive = false;
+		$.post({
+			url: GnuBoat.private.serverBaseUrl +'?request=replay',
+			data: { logfile: modus },
+			success: function(data){
+// 				if(!Array.isArray(data) || data.length < 1){
+// 					console.log("No data array returned!");
+// 					console.log(data);
+// 					return;
+// 				}
+				if(("error" in data) && data["error"] == 1){
+					GnuBoat.displayMessage('<span class="error">Failed to get logged tracks: '+ data["errormessage"] +'</span>');
+					return;
+				}
+				if(!("track" in data)){
+					console.log("No track given!");
+					return;
+				}
+				GnuBoat.private.mapAddTracks(data["track"]);
+			}
+		});
+	},
+	
+	mapAddTracks: function(track)
+	{
+		if(GnuBoat.private.map == null){
+			console.log("No map in use");
+			return;
+		}
+		
+		var maximas = [];
+		var minimas = [];
+		var points = [];
+		var densityPoints = [];
+		
+		var keysMap = [];
+		for(var key in GnuBoat.private.dataMappings){
+			if(GnuBoat.private.dataMappings[key]["map"] === true)
+				keysMap.push(key);
+		}
+		for(var i = 0; i < keysMap.length; i++){
+			points[keysMap[i]] = [];
+		}
+		
+		// getting maximas, minimums for normalization and the tracks themselves
+		for(var time in track){
+			for(var i = 0; i < keysMap.length; i++){
+				var key = keysMap[i];
+				if(key == "gpsfix")
+					continue;
+				if(!(key in maximas))
+					maximas[key] = track[time][key]
+				else if(maximas[key] < track[time][key])
+					maximas[key] = track[time][key];
+				if(!(key in minimas))
+					minimas[key] = track[time][key]
+				else if(minimas[key] > track[time][key])
+					minimas[key] = track[time][key];
+				points[key].push(new L.latLng(track[time]["latitude"], track[time]["longitude"], track[time][key]));
+				densityPoints.push({latitude: track[time]["latitude"], longitude: track[time]["longitude"], depth: track[time]["waterdepth"]});
+			}
+		}
+		for(var i = 0; i < keysMap.length; i++){
+			var key = keysMap[i];
+			if(points[key].length > 0){
+				if(key in GnuBoat.private.mapPolylines)
+					GnuBoat.private.mapPolylines[key].setLatLngs(points[key]);
+				else{
+					GnuBoat.private.mapPolylines[key] = L.hotline(points[key], {weight: 3, outlineWidth: 0, min: minimas[key], max: maximas[key]});
+					if(GnuBoat.private.mapControl){
+						var name = GnuBoat.private.dataMappings[key]["titleLong"] +" in "+ GnuBoat.private.dataMappings[key]["unit"] +" ("+ GnuBoat.private.dataMappings[key]["titleShort"] +")";
+						GnuBoat.private.mapControl.addOverlay(GnuBoat.private.mapPolylines[key], name);
+					}
+					if(GnuBoat.private.dataMappings[key]["mapActive"] === true)
+						GnuBoat.private.mapPolylines[key].addTo(GnuBoat.private.map);
+				}
+			}
+		}
+		GnuBoat.private.drawDensityEstimation(densityPoints, maximas["waterdepth"], minimas["waterdepth"]);
+	},
 };
Index: src/webapp/webservice/inc/GnuBoat/Config.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/Config.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/inc/GnuBoat/Config.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -26,5 +26,5 @@
 	public function __construct()
 	{
-		$configFile = __DIR__ ."/../config/config.php";
+		$configFile = __DIR__ ."/../../config/config.php";
 		if(file_exists($configFile)){
 			include($configFile);
@@ -51,5 +51,5 @@
 	{
 		if(array_key_exists("datadirectory", $this->_config))
-			return addTrailingSlash($this->_config["datadirectory"]);
+			return $this->addTrailingSlash($this->_config["datadirectory"]);
 		return "/var/lib/gnuboat/";
 	}
@@ -58,5 +58,5 @@
 	{
 		if(array_key_exists("logdirectory", $this->_config))
-			return addTrailingSlash($this->_config["logdirectory"]);
+			return $this->addTrailingSlash($this->_config["logdirectory"]);
 		return "/var/log/gnuboat/";
 	}
Index: src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Dpt.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Dpt.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Dpt.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -33,5 +33,5 @@
 			return;
 		
-		$this->_depth = $content[1];
+		$this->_depth = (float)$content[1];
 		$tmp = explode("*", $content[2]);
 		$this->_offset = $tmp[0];
Index: src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Mtw.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Mtw.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Mtw.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -33,5 +33,5 @@
 			return;
 		
-		$this->_temperature = $content[1];
+		$this->_temperature = (float)$content[1];
 		$tmp = explode("*", $content[2]);
 		$this->_unit = $tmp[0];
Index: src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Rmc.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Rmc.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Rmc.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -19,4 +19,9 @@
 namespace GnuBoat\Nmea\Nmea0183;
 
+/**
+ * @brief NMEA0183 RMC Naviation sentence
+ *
+ * Keep in mind, that the latitude() and longitude() is converted to +/- values
+ */
 class Nmea0183Rmc extends Nmea0183Sentence
 {
@@ -49,16 +54,18 @@
 		if($content[2] == 'A')
 			$this->_status = Nmea0183RmcStatus::A;
-			
-		$this->_latitude = $content[3];
-		$this->_latitudeDirection = Nmea0183Rmc::directionToEnum($content[4]);
 		
-		$this->_longitude = $content[5];
-		$this->_longitudeDirection = Nmea0183Rmc::directionToEnum($content[6]);
+		$this->_latitude = (float)$content[3];
+		if(Nmea0183Rmc::directionToEnum($content[4]) == Nmea0183Direction::South)
+			$this->_latitude = $this->_latitude * -1;
 		
-		$this->_speedOverGround = $content[7];
+		$this->_longitude = (float)$content[5];
+		if(Nmea0183Rmc::directionToEnum($content[6]) == Nmea0183Direction::West)
+			$this->_longitude = $this->_longitude * -1;
 		
-		$this->_courseOverGround = $content[8];
+		$this->_speedOverGround = (float)$content[7];
 		
-		$this->_magneticDeclination = $content[10];
+		$this->_courseOverGround = (float)$content[8];
+		
+		$this->_magneticDeclination = (float)$content[10];
 		$this->_magneticDeclinationDirection = Nmea0183Rmc::directionToEnum($content[11]);
 		
@@ -82,4 +89,7 @@
 	}
 	
+	/**
+	 * @brief Latitude with North (+) and South (-)
+	 */
 	public function latitude()
 	{
@@ -87,17 +97,10 @@
 	}
 	
-	public function latitudeDirection()
-	{
-		return $this->_latitudeDirection;
-	}
-	
+	/**
+	 * @brief Longitude with East (+) and West (-)
+	 */
 	public function longitude()
 	{
 		return $this->_longitude;
-	}
-
-	public function longitudeDirection()
-	{
-		return $this->_longitudeDirection;
 	}
 	
@@ -162,7 +165,5 @@
 	private $_status;
 	private $_latitude;
-	private $_latitudeDirection;
 	private $_longitude;
-	private $_longitudeDirection;
 	private $_speedOverGround;
 	private $_courseOverGround;
Index: src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Parser.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Parser.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Parser.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -35,8 +35,8 @@
 		$result = array();
 		if(!file_exists($file)){
-			$message = "NMEA file to parse does not exists: ". $file ."\n";
+			$message = "NMEA file to parse does not exists: ". $file;
 			error_log($message);
 			if($debug > 0)
-				print $message;
+				print $message ."\n";
 			return $result;
 		}
@@ -44,8 +44,8 @@
 		$fileHandler = fopen($file, 'r');
 		if(!$fileHandler){
-			$message = "NMEA file to parse could not be opend for reading: ". $file ."\n";
+			$message = "NMEA file to parse could not be opend for reading: ". $file;
 			error_log($message);
 			if($debug > 0)
-				print $message;
+				print $message ."\n";
 			return $result;
 		}
@@ -61,8 +61,8 @@
 				$result[] = $parsedSentence;
 			else{
-				$message = "Skipped sentence on line ". $line .": ". $sentence ."\n";
+				$message = "Skipped sentence on line ". $line .": ". $sentence;
 				error_log($message);
 				if($debug > 0)
-					print $message;
+					print $message ."\n";
 			}
 		}
@@ -75,8 +75,8 @@
 		$sentence = trim($sentence);
 		if(empty($sentence)){
-			$message = "Empty sentence\n";
+			$message = "Empty sentence";
 			error_log($message);
 			if($debug > 0)
-				print $message;
+				print $message ."\n";
 			return null;
 		}
@@ -85,8 +85,8 @@
 		$result = preg_match('/^[\$!]{1}([\w]{2})([\w]{3})([^\*]+)\*([\da-zA-Z]+)$/', $sentence, $matches);
 		if($result === false || $result != 1 || count($matches) != 5){
-			$message = "Could not detect talker, type and checksum from ". $sentence ."\n";
+			$message = "Could not detect talker, type and checksum from ". $sentence;
 			error_log($message);
 			if($debug > 0)
-				print $message;
+				print $message ."\n";
 			return null;
 		}
@@ -97,8 +97,8 @@
 		
 		if(!array_key_exists(strtolower($type), $this->_types)){
-			$message = "Skipping unknown NMEA0183 sentence of type ". $type .": ". $sentence ."\n";
+			$message = "Skipping unknown NMEA0183 sentence of type ". $type .": ". $sentence;
 			error_log($message);
 			if($debug > 0)
-				print $message;
+				print $message ."\n";
 			return null;
 		}
Index: src/webapp/webservice/inc/GnuBoat/Nmea/NmeaSentence.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/Nmea/NmeaSentence.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/inc/GnuBoat/Nmea/NmeaSentence.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -48,5 +48,5 @@
 	public function type()
 	{
-		return $this->_type;
+		return strtolower($this->_type);
 	}
 	
Index: src/webapp/webservice/inc/GnuBoat/Service.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/Service.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/inc/GnuBoat/Service.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -44,4 +44,15 @@
 		$this->process();
 	}
+	
+	public static function error($message)
+	{
+		Service::output(["error" => 1, "errormessage" => $message]);
+	}
+	
+	public static function output($content)
+	{
+		header('Content-Type: application/json');
+		echo json_encode($content);
+	}
 
 	/**
Index: src/webapp/webservice/inc/GnuBoat/ServiceData.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/ServiceData.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/inc/GnuBoat/ServiceData.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -49,9 +49,8 @@
 
 		if(!file_exists($dbFile)){
-			echo json_encode("");
 			if($debug > 0)
 				echo "Database file ". $dbFile ." does not exist!";
 			error_log("Database file ". $dbFile ." does not exist");
-			exit;
+			return;
 		}
 		// Fetch entries of the last 30s with maximum (available) resolution of 2s
Index: src/webapp/webservice/inc/GnuBoat/ServiceLogFiles.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/ServiceLogFiles.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/inc/GnuBoat/ServiceLogFiles.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -32,4 +32,6 @@
 		$debug = $this->debug();
 		$config = new Config();
+		if($debug > 1)
+			print "Log directory: ". $config->logDirectory() ."\n";
 
 		if(!array_key_exists("logfilesSelected", $_POST)){
Index: src/webapp/webservice/inc/GnuBoat/ServiceReplay.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/ServiceReplay.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
+++ src/webapp/webservice/inc/GnuBoat/ServiceReplay.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -0,0 +1,79 @@
+<?php
+/*
+    Copyright (C) 2017 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+namespace GnuBoat;
+
+require_once(__DIR__ ."/../autoloader.php");
+
+class ServiceReplay extends Service
+{
+	function __construct()
+	{
+		parent::__construct();
+	}
+
+	protected function process()
+	{
+		$debug = $this->debug();
+		$config = new Config();
+		if($debug > 1)
+			print "Log directory: ". $config->logDirectory() ."\n";
+
+		if(!array_key_exists("logfile", $_POST)){
+			return $this->error("No logfile to replay selected");
+		}
+
+		// prepare a download of available log files
+		$file = $config->logDirectory() . $_POST["logfile"];
+		if(!file_exists($file))
+			return $this->error("Logfile ". $file ." not found");
+		
+		$parser = new Nmea\Parser();
+		$nmeaSentences = $parser->parseFile($file, '0183');
+		if($nmeaSentences == null)
+			return error("Error parsing logfile ". $file);
+		
+		$result = ["track" => []];
+		$currentItem = new TrackItem();
+		foreach($nmeaSentences as $sentence){
+			if($sentence->type() == "rmc"){
+				if($currentItem->isValid()){
+					$result["track"][$currentItem->timestamp()] = $currentItem->toArray();
+					$currentItem = new TrackItem();
+				}
+				$currentItem->setDateTime($sentence->dateTime());
+				$currentItem->setLatitude($sentence->latitude());
+				$currentItem->setLongitude($sentence->longitude());
+				$currentItem->setSpeedOverGround($sentence->speedOverGround());
+				$currentItem->setCourseOverGround($sentence->courseOverGround());
+			}
+			elseif($sentence->type() == "dpt"){
+				$currentItem->setWaterDepth($sentence->depth());
+			}
+			elseif($sentence->type() == "mtw"){
+				$currentItem->setWaterTemperature($sentence->temperature());
+			}
+		}
+		if($currentItem->isValid())
+			$result["track"][$currentItem->timestamp()] = $currentItem->toArray();
+
+		$this->output($result);
+	}
+}
+
+?>
Index: src/webapp/webservice/inc/GnuBoat/TrackItem.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/TrackItem.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
+++ src/webapp/webservice/inc/GnuBoat/TrackItem.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -0,0 +1,177 @@
+<?php
+/*
+    Copyright (C) 2017 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+namespace GnuBoat;
+
+/**
+  * @brief One item in a track
+  */
+class TrackItem
+{
+	function __construct()
+	{
+		$this->_time = null;
+		$this->_latitude = null;
+		$this->_longitude = null;
+		$this->_speedThroughWater = null;
+		$this->_speedOverGround = null;
+		$this->_courseOverGround = null;
+		$this->_waterDepth = null;
+		$this->_waterTemperature = null;
+		$this->_gpsfix = null;
+	}
+
+	public function setTimestamp($time)
+	{
+		$this->_time = $time;
+	}
+	
+	public function setDateTime($dateTime)
+	{
+		$timezone = new \DateTimeZone("UTC");
+		if($dateTime == null)
+			$this->_time = null;
+		$dateTime->setTimezone($timezone);
+		$this->_time = $dateTime->getTimestamp();
+	}
+	
+	public function timestamp()
+	{
+		return $this->_time;
+	}
+	
+		public function setLatitude($latitude)
+	{
+		$this->_latitude = $latitude;
+	}
+	
+	public function latitude()
+	{
+		return $this->_latitude;
+	}
+	
+		public function setLongitude($longitude)
+	{
+		$this->_longitude = $longitude;
+	}
+	
+	public function longitude()
+	{
+		return $this->_longitude;
+	}
+	
+		public function setSpeedThroughWater($speedThroughWater)
+	{
+		$this->_speedThroughWater = $speedThroughWater;
+	}
+	
+	public function speedThroughWater()
+	{
+		return $this->_speedThroughWater;
+	}
+	
+		public function setSpeedOverGround($speedOverGround)
+	{
+		$this->_speedOverGround = $speedOverGround;
+	}
+	
+	public function speedOverGround()
+	{
+		return $this->_speedOverGround;
+	}
+	
+		public function setCourseOverGround($courseOverGround)
+	{
+		$this->_courseOverGround = $courseOverGround;
+	}
+	
+	public function courseOverGround()
+	{
+		return $this->_courseOverGround;
+	}
+	
+		public function setWaterDepth($waterDepth)
+	{
+		$this->_waterDepth = $waterDepth;
+	}
+	
+	public function waterDepth()
+	{
+		return $this->_waterDepth;
+	}
+	
+		public function setWaterTemperature($waterTemperature)
+	{
+		$this->_waterTemperature = $waterTemperature;
+	}
+	
+	public function waterTemperature()
+	{
+		return $this->_waterTemperature;
+	}
+	
+		public function setGpsFix($gpsFix)
+	{
+		$this->_gpsFix = $gpsFix;
+	}
+	
+	public function gpsFix()
+	{
+		return $this->_gpsFix;
+	}
+	
+	public function isValid()
+	{
+		if($this->timestamp() == null)
+			return false;
+		if($this->latitude() == null)
+			return false;
+		if($this->longitude() == null)
+			return false;
+		return true;
+	}
+	
+	public function toArray()
+	{
+		$speedThroughWater = ($this->speedThroughWater() != null) ? $this->speedThroughWater() : 0;
+		$speedOverGround = ($this->speedOverGround() != null) ? $this->speedOverGround() : 0;
+		$courseOverGround = ($this->courseOverGround() != null) ? $this->courseOverGround() : 0;
+		$waterDepth = ($this->waterDepth() != null) ? $this->waterDepth() : 0;
+		$waterTemperature = ($this->waterTemperature() != null) ? $this->waterTemperature() : 0;
+		$gpsFix = ($this->gpsFix() != null) ? $this->gpsFix() : 0;
+	
+		return [
+			"latitude" => $this->latitude(),
+			"longitude" => $this->longitude(),
+			"speedthroughwater" => $speedThroughWater,
+			"speedoverground" => $speedOverGround,
+			"courseoverground" => $courseOverGround,
+			"waterdepth" => $waterDepth,
+			"watertemperature" => $waterTemperature,
+			"gpsfix" => $gpsFix,
+		];
+	}
+
+	private $_time;
+	private $_latitude, $_longitude;
+	private $_speedThroughWater, $_speedOverGround, $_courseOverGround;
+	private $_waterDepth, $_waterTemperature;
+	private $_gpsFix;
+}
+
+?>
Index: src/webapp/webservice/inc/GnuBoat/Webservice.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/Webservice.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/inc/GnuBoat/Webservice.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -23,5 +23,5 @@
 class WebService
 {
-	function __construct()
+	function __construct($debug)
 	{
 		$this->_requests = array();
@@ -30,12 +30,11 @@
 		$this->_requests["logfiles"] = "GnuBoat\ServiceLogFiles";
 		$this->_requests["map"] = "GnuBoat\ServiceMap";
+		$this->_requests["replay"] = "GnuBoat\ServiceReplay";
+		
+		$this->_debug = $debug;
 	}
 
 	public function process()
 	{
-		$debug = 0;
-		if(is_array($_GET) && array_key_exists("debug", $_GET))
-			$debug = $_GET["debug"];
-
 		$request = array_keys($this->_requests)[0];
 		if(is_array($_GET) && array_key_exists("request", $_GET)){
@@ -44,16 +43,12 @@
 
 		if(!array_key_exists($request, $this->_requests)){
-			$result["error"] = 1;
-			$result["errormessage"] = "Request ". $request ." not implemented";
-			
-			header('Content-Type: application/json');
-			echo json_encode($result) ."\n";
-			return;
+			return Service::error("Request ". $request ." not implemented");
 		}
-
-		call_user_func(array(new $this->_requests[$request], "processRequest"), $debug);
+		
+		call_user_func(array(new $this->_requests[$request], "processRequest"), $this->_debug);
 	}
 
 	private $_requests;
+	private $_debug;
 }
 
Index: src/webapp/webservice/index.php
===================================================================
--- src/webapp/webservice/index.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/index.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -19,5 +19,9 @@
 require_once(__DIR__ ."/inc/autoloader.php");
 
-$webservice = new GnuBoat\Webservice();
+$debug = 0;
+if(array_key_exists("debug", $_GET))
+	$debug = $_GET["debug"];
+
+$webservice = new GnuBoat\Webservice($debug);
 $webservice->process();
 
Index: src/webapp/webservice/tests/Nmea0183DptTest.php
===================================================================
--- src/webapp/webservice/tests/Nmea0183DptTest.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/tests/Nmea0183DptTest.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -46,8 +46,8 @@
 	{
 		return [
-			"wrong_data_count" => ['$SDDPT,00.71,00.71,00.00*51', 'SD', 'DPT', 0, 0, 51, false],
-			"wrong_checksum" => ['$SDDPT,00.71,00.00*22', 'SD', 'DPT', 0.71, 0.0, 22, false],
-			"valid1" => ['$SDDPT,00.71,00.00*51', 'SD', 'DPT', 0.71, 0.0, 51, true],
-			"valid2" => ['!SDDPT,00.71,00.00*51', 'SD', 'DPT', 0.71, 0.0, 51, true],
+			"wrong_data_count" => ['$SDDPT,00.71,00.71,00.00*51', 'SD', 'dpt', 0, 0, 51, false],
+			"wrong_checksum" => ['$SDDPT,00.71,00.00*22', 'SD', 'dpt', 0.71, 0.0, 22, false],
+			"valid1" => ['$SDDPT,00.71,00.00*51', 'SD', 'dpt', 0.71, 0.0, 51, true],
+			"valid2" => ['!SDDPT,00.71,00.00*51', 'SD', 'dpt', 0.71, 0.0, 51, true],
 		];
 	}
Index: src/webapp/webservice/tests/Nmea0183MtwTest.php
===================================================================
--- src/webapp/webservice/tests/Nmea0183MtwTest.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/tests/Nmea0183MtwTest.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -46,8 +46,8 @@
 	{
 		return [
-			"wrong_data_count" => ['$YXMTW,C*15', 'YX', 'MTW', 0, '', 15, false],
-			"wrong_checksum" => ['$YXMTW,26.3,C*22', 'YX', 'MTW', 26.3, 'C', 22, false],
-			"valid1" => ['$YXMTW,26.3,C*15', 'YX', 'MTW', 26.3, 'C', 15, true],
-			"valid2" => ['!YXMTW,26.3,C*15', 'YX', 'MTW', 26.3, 'C', 15, true],
+			"wrong_data_count" => ['$YXMTW,C*15', 'YX', 'mtw', 0, '', 15, false],
+			"wrong_checksum" => ['$YXMTW,26.3,C*22', 'YX', 'mtw', 26.3, 'C', 22, false],
+			"valid1" => ['$YXMTW,26.3,C*15', 'YX', 'mtw', 26.3, 'C', 15, true],
+			"valid2" => ['!YXMTW,26.3,C*15', 'YX', 'mtw', 26.3, 'C', 15, true],
 		];
 	}
Index: src/webapp/webservice/tests/Nmea0183RmcTest.php
===================================================================
--- src/webapp/webservice/tests/Nmea0183RmcTest.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/tests/Nmea0183RmcTest.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -49,7 +49,5 @@
 		$this->assertEquals($sentence->status(), $status);
 		$this->assertEquals($latitude, $sentence->latitude());
-		$this->assertEquals($latitudeDirection, $sentence->latitudeDirection());
 		$this->assertEquals($longitude, $sentence->longitude());
-		$this->assertEquals($longitudeDirection, $sentence->longitudeDirection());
 		$this->assertEquals($speedOverGround, $sentence->speedOverGround());
 		$this->assertEquals($courseOverGround, $sentence->courseOverGround());
@@ -71,5 +69,5 @@
 			"wrong_data_count" => [
 				'$GPRMC,162614,A,N,01322.3900,E,10.0,90.0,131006,1.2,E,A*13',
-				"GP", "RMC", null,
+				"GP", "rmc", null,
 				GnuBoat\Nmea\Nmea0183\Nmea0183RmcStatus::V, 0, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::Invalid,
 				0, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::Invalid,
@@ -79,5 +77,5 @@
 			"wrong_checksum" => [
 				'$GPRMC,162614,A,5230.5900,N,01322.3900,E,10.0,90.0,131006,1.2,E,A*22',
-				"GP", "RMC", DateTime::createFromFormat($format, "2006-10-13 16:26:14", new DateTimeZone("UTC")),
+				"GP", "rmc", DateTime::createFromFormat($format, "2006-10-13 16:26:14", new DateTimeZone("UTC")),
 				GnuBoat\Nmea\Nmea0183\Nmea0183RmcStatus::A, 5230.59, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::North,
 				1322.39, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::East,
@@ -87,5 +85,5 @@
 			"valid1" => [
 				'$GPRMC,162614,A,5230.5900,N,01322.3900,E,10.0,90.0,131006,1.2,E,A*13',
-				"GP", "RMC", DateTime::createFromFormat($format, "2006-10-13 16:26:14", new DateTimeZone("UTC")),
+				"GP", "rmc", DateTime::createFromFormat($format, "2006-10-13 16:26:14", new DateTimeZone("UTC")),
 				GnuBoat\Nmea\Nmea0183\Nmea0183RmcStatus::A, 5230.59, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::North,
 				1322.39, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::East,
@@ -94,18 +92,18 @@
 			],
 			"valid2" => [
-				'!GPRMC,162614,A,5230.5900,N,01322.3900,E,10.0,90.0,131006,1.2,E,A*13',
-				"GP", "RMC", DateTime::createFromFormat($format, "2006-10-13 16:26:14", new DateTimeZone("UTC")),
-				GnuBoat\Nmea\Nmea0183\Nmea0183RmcStatus::A, 5230.59, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::North,
-				1322.39, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::East,
+				'!GPRMC,162614,A,5230.5900,S,01322.3900,W,10.0,90.0,131006,1.2,E,A*1c',
+				"GP", "rmc", DateTime::createFromFormat($format, "2006-10-13 16:26:14", new DateTimeZone("UTC")),
+				GnuBoat\Nmea\Nmea0183\Nmea0183RmcStatus::A, -5230.59, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::North,
+				-1322.39, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::East,
 				10, 90, 1.2, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::East,
-				GnuBoat\Nmea\Nmea0183\Nmea0183RmcSignal::AutonomousMode, 13, true
+				GnuBoat\Nmea\Nmea0183\Nmea0183RmcSignal::AutonomousMode, '1c', true
 			],
 			"valid3" => [
-				'$GPRMC,162614.123,A,5230.5900,N,01322.3900,E,10.0,90.0,131006,1.2,E,A*d',
-				"GP", "RMC", DateTime::createFromFormat($formatMilli, "2006-10-13 16:26:14.123", new DateTimeZone("UTC")),
+				'$GPRMC,162614.123,A,5230.5900,N,01322.3900,W,10.0,90.0,131006,1.2,E,A*1f',
+				"GP", "rmc", DateTime::createFromFormat($formatMilli, "2006-10-13 16:26:14.123", new DateTimeZone("UTC")),
 				GnuBoat\Nmea\Nmea0183\Nmea0183RmcStatus::A, 5230.59, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::North,
-				1322.39, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::East,
+				-1322.39, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::East,
 				10, 90, 1.2, GnuBoat\Nmea\Nmea0183\Nmea0183Direction::East,
-				GnuBoat\Nmea\Nmea0183\Nmea0183RmcSignal::AutonomousMode, 'd', true
+				GnuBoat\Nmea\Nmea0183\Nmea0183RmcSignal::AutonomousMode, '1f', true
 			]
 		];
Index: src/webapp/webservice/tests/NmeaTest.php
===================================================================
--- src/webapp/webservice/tests/NmeaTest.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/tests/NmeaTest.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -20,72 +20,89 @@
 // declare(Strict_types=1);
 
-/**
-  * @brief Covers Parser.php
-  */
-final class NmeaTest extends PHPUnit_Framework_TestCase
+namespace GnuBoat\Nmea
 {
+
 	/**
-	  * @dataProvider formatsProvider
-	  */
-	public function testFormats($format)
+	* @brief Covers Parser.php
+	*/
+	final class NmeaTest extends \PHPUnit_Framework_TestCase
 	{
-		$parser = new GnuBoat\Nmea\Parser(0);
-		$formats = $parser->formatsSupported();
-		$this->assertInternalType('array', $formats);
-		$this->assertContains($format, $formats);
-	}
-	
-	public function formatsProvider()
-	{
-		return [["0183"]];
+		/**
+		* @dataProvider formatsProvider
+		*/
+		public function testFormats($format)
+		{
+			$parser = new Parser(0);
+			$formats = $parser->formatsSupported();
+			$this->assertInternalType('array', $formats);
+			$this->assertContains($format, $formats);
+		}
+		
+		public function formatsProvider()
+		{
+			return [["0183"]];
+		}
+
+		/**
+		* @dataProvider nmeaSentenceProvider
+		*/
+		public function testNmeaSentence($format, $sentence, $classType, $valid)
+		{
+			$parser = new Parser(0);
+			$sentence = $parser->parseSentence($sentence, $format);
+			if($classType == null)
+				$this->assertNull($sentence);
+			else{
+				$this->assertInstanceOf($classType, $sentence);
+				$message = "";
+				$result = $sentence->valid($message);
+				$this->assertEquals($valid, $result, $message);
+			}
+		}
+		
+		public function nmeaSentenceProvider()
+		{
+			return [
+				"empty" => ['0183', '', null, false],
+				"unsupported_format" => ['abc', '', null, false],
+				"rmc0183" => ['0183', '$GNRMC,173658,A,0047.589,N,00010.713,E,01.1,147.4,260817,,,A*5F', Nmea0183\Nmea0183Rmc::class, true],
+				"dpt0183" => ['0183', '$SDDPT,00.71,00.00*51', Nmea0183\Nmea0183Dpt::class, true],
+				"mtw0183" => ['0183', '$YXMTW,26.3,C*15', Nmea0183\Nmea0183Mtw::class, true],
+			];
+		}
+		
+		/**
+		* @dataProvider nmeaFileProvider
+		*/
+		public function testNmeaFile($file, $format, $count)
+		{
+			$parser = new Parser(0);
+			$sentences = $parser->parseFile($file, $format);
+			$this->assertInternalType('array', $sentences);
+			$this->assertCount($count, $sentences);
+			foreach($sentences as $sentence){
+				$this->assertNotNull($sentence);
+				$this->assertInstanceOf(NmeaSentence::class, $sentence);
+				$this->assertEquals(true, $sentence->valid());
+			}
+		}
+		
+		public function nmeaFileProvider()
+		{
+			return [["webservice/tests/data/nmea0183.log", '0183', 2000]];
+		}
 	}
 
-	/**
-	 * @dataProvider nmeaSentenceProvider
-	 */
-	public function testNmeaSentence($format, $sentence, $classType, $valid)
+	function error_log($msg)
 	{
-		$parser = new GnuBoat\Nmea\Parser(0);
-		$sentence = $parser->parseSentence($sentence, $format);
-		if($classType == null)
-			$this->assertNull($sentence);
-		else{
-			$this->assertInstanceOf($classType, $sentence);
-			$message = "";
-			$result = $sentence->valid($message);
-			$this->assertEquals($valid, $result, $message);
-		}
+		echo "ERR Nmea: ". $msg ."\n";
 	}
-	
-	public function nmeaSentenceProvider()
+}
+
+namespace GnuBoat\Nmea\Nmea0183
+{
+	function error_log($msg)
 	{
-		return [
-			"empty" => ['0183', '', null, false],
-			"unsupported_format" => ['abc', '', null, false],
-			"rmc0183" => ['0183', '$GNRMC,173658,A,0047.589,N,00010.713,E,01.1,147.4,260817,,,A*5F', GnuBoat\Nmea\Nmea0183\Nmea0183Rmc::class, true],
-			"dpt0183" => ['0183', '$SDDPT,00.71,00.00*51', GnuBoat\Nmea\Nmea0183\Nmea0183Dpt::class, true],
-			"mtw0183" => ['0183', '$YXMTW,26.3,C*15', GnuBoat\Nmea\Nmea0183\Nmea0183Mtw::class, true],
-		];
-	}
-	
-	/**
-	 * @dataProvider nmeaFileProvider
-	 */
-	public function testNmeaFile($file, $format, $count)
-	{
-		$parser = new GnuBoat\Nmea\Parser(0);
-		$sentences = $parser->parseFile($file, $format);
-		$this->assertInternalType('array', $sentences);
-		$this->assertCount($count, $sentences);
-		foreach($sentences as $sentence){
-			$this->assertNotNull($sentence);
-			$this->assertInstanceOf(GnuBoat\Nmea\NmeaSentence::class, $sentence);
-			$this->assertEquals(true, $sentence->valid());
-		}
-	}
-	
-	public function nmeaFileProvider()
-	{
-		return [["webservice/tests/data/nmea0183.log", '0183', 2000]];
+		echo "ERR Nmea0183: ". $msg ."\n";
 	}
 }
Index: src/webapp/webservice/tests/ServiceTest.php
===================================================================
--- src/webapp/webservice/tests/ServiceTest.php	(revision fc63b30e2819918c1c41f5e702b96b8506394bbb)
+++ src/webapp/webservice/tests/ServiceTest.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -20,13 +20,15 @@
 // declare(Strict_types=1);
 
+namespace GnuBoat;
+
 /**
-  * @brief Covers index.php tests
+  * @brief Covers Service.php tests
   */
-final class ServiceTest extends PHPUnit_Framework_TestCase
+final class ServiceTest extends \PHPUnit_Framework_TestCase
 {
 	public function testData()
 	{
-		$webservice = new GnuBoat\Webservice();
-		$this->assertInstanceOf(GnuBoat\Webservice::class, $webservice);
+		$webservice = new Webservice(0);
+		$this->assertInstanceOf(Webservice::class, $webservice);
 		$_POST["request"] = "data";
 		$webservice->process();
@@ -35,6 +37,6 @@
 	public function testLogFiles()
 	{
-		$webservice = new GnuBoat\Webservice();
-		$this->assertInstanceOf(GnuBoat\Webservice::class, $webservice);
+		$webservice = new Webservice(0);
+		$this->assertInstanceOf(Webservice::class, $webservice);
 		$_POST["request"] = "logfiles";
 		$webservice->process();
@@ -43,6 +45,6 @@
 	public function testShutdown()
 	{
-		$webservice = new GnuBoat\Webservice();
-		$this->assertInstanceOf(GnuBoat\Webservice::class, $webservice);
+		$webservice = new Webservice(0);
+		$this->assertInstanceOf(Webservice::class, $webservice);
 		$_POST["request"] = "shutdown";
 		$webservice->process();
@@ -51,10 +53,23 @@
 	public function testMap()
 	{
-		$webservice = new GnuBoat\Webservice();
-		$this->assertInstanceOf(GnuBoat\Webservice::class, $webservice);
+		$webservice = new Webservice(0);
+		$this->assertInstanceOf(Webservice::class, $webservice);
 		$_POST["request"] = "map";
+		$webservice->process();
+	}
+	
+	public function testReplay()
+	{
+		$webservice = new Webservice(0);
+		$this->assertInstanceOf(Webservice::class, $webservice);
+		$_POST["request"] = "replay";
 		$webservice->process();
 	}
 }
 
+	function error_log($msg)
+	{
+		echo "ERR GnuBoat: ". $msg ."\n";
+	}
+
 ?>
Index: src/webapp/webservice/tests/config.php
===================================================================
--- src/webapp/webservice/tests/config.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
+++ src/webapp/webservice/tests/config.php	(revision 008bce99c15e3dad6fcf395f8c3a3f69b23b4b28)
@@ -0,0 +1,9 @@
+<?php
+
+$config = [
+	"datadirectory" => __DIR__ ."/../../data",
+	"shutdownfile" => __DIR__ ."/../../shutdown.request",
+	"logdirectory" => __DIR__ ."/../../logs",
+];
+
+?>
