source: src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Dpt.php@ 2eed0da

debian/bullseye
Last change on this file since 2eed0da was 008bce9, checked in by Joachim Langenbach <joachim.langenbach@…>, 9 years ago

First more or less working version of visualising logfiles on the map

  • Property mode set to 100644
File size: 1.3 KB
RevLine 
[86442cb]1<?php
2/*
3 Copyright (C) 2017 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19namespace GnuBoat\Nmea\Nmea0183;
20
21class Nmea0183Dpt extends Nmea0183Sentence
22{
23 function __construct($talker, $checksum, $sentence)
24 {
25 parent::__construct("DPT", $talker, $checksum, $sentence);
26
27 // init default values
28 $this->_depth = 0;
29 $this->_offset = 0;
30
31 $content = explode(",", $sentence);
32 if(count($content) != 3)
33 return;
34
[008bce9]35 $this->_depth = (float)$content[1];
[86442cb]36 $tmp = explode("*", $content[2]);
37 $this->_offset = $tmp[0];
38 }
39
40 public function depth()
41 {
42 return $this->_depth;
43 }
44
45 public function offset()
46 {
47 return $this->_offset;
48 }
49
50 private $_depth;
51 private $_offset;
52}
53
54?>
Note: See TracBrowser for help on using the repository browser.