Changes in / [c810990:8fd7454]


Ignore:
Files:
44 added
12 deleted
244 edited

Legend:

Unmodified
Added
Removed
  • debian/changelog

    rc810990 r8fd7454  
     1gnuboat (0.5.2) jessie; urgency=low
     2
     3  * Fixed NMEA0183 position format
     4  * Added checksum fix feature to gnuboat-log-converter
     5
     6 -- EngSaS - Maintainer <info@engsas.de>  Mon, 30 Oct 2017 11:00:00 +0100
     7gnuboat (0.5.1) jessie; urgency=low
     8
     9  * Fixed python error in dpt and temp logging
     10  * Improved error handling in gpsdpoller.py
     11  * Cleanup leaflet css files in webclient
     12
     13 -- EngSaS - Maintainer <info@engsas.de>  Sun, 24 Sep 2017 16:00:00 +0200
     14gnuboat (0.5.0) jessie; urgency=low
     15
     16  * Fixed python print() and string.format() errors
     17  * Switched to feature freezed branch 0.5 as upstream
     18    source
     19
     20 -- EngSaS - Maintainer <info@engsas.de>  Fri, 22 Sep 2017 08:30:00 +0200
     21gnuboat (0.4.15) jessie; urgency=low
     22
     23  * Fixed wrong format of latitude and longitude in NMEA log
     24  * Improved gnuboat-log-converter (NMEA, CSV, GPX formats)
     25  * Removed timeout from gpsd poller (which caused falling behind in reading
     26    gpsd messages)
     27  * Fixed webservice to handle timestamps in front of the nmea sentence
     28
     29 -- EngSaS - Maintainer <info@engsas.de>  Thu, 21 Sep 2017 14:00:00 +0200
     30gnuboat (0.4.14) jessie; urgency=low
     31
     32  * Several fixes applied for webservice and webclient
     33
     34 -- EngSaS - Maintainer <info@engsas.de>  Thu, 24 Aug 2017 20:00:00 +0200
     35gnuboat (0.4.13) jessie; urgency=low
     36
     37  * Merged new features from master:
     38    * 3D rendering
     39    * Fixed gnuboat daemon
     40    * Added data generator to simulate rrd database input
     41    * Added OpenCPN hint
     42    * Added colored tracks to leaflet map
     43
     44 -- EngSaS - Maintainer <info@engsas.de>  Thu, 24 Aug 2017 18:00:00 +0200
    145gnuboat (0.4.12) jessie; urgency=low
    246
  • debian/control

    rc810990 r8fd7454  
    33Priority: optional
    44Maintainer: EngSaS - Maintainer <info@engsas.de>
    5 # Removed po-debconf, as puppet could not be run from postinst script (see gnuboat-puppet.postinst for details)
     5# To get a hint how debconf could be used, have a look at revision ecee2e69fa25cf158e950f4d4359363198c313a6 from debian/jessie branch
    66Build-Depends: debhelper (>= 9), lsb-release, dh-python, dh-systemd (>= 1.5), python-all, python3-all, python-all-dbg, python3-all-dbg, python-setuptools, python3-setuptools, python-rrdtool, python-pynmea2, python3-pynmea2, phing, php-pear
    77Standards-Version: 3.9.6
    … …  
    2727Package: python-gnuboat
    2828Section: python
    29 Architecture: any
    30 Depends: ${misc:Depends}, ${python:Depends}, python-pil, python-dateutil, python-tz, python-rrdtool, python-pynmea2, gpsd, n2kd-scripts, n2kd-bin, gnuboat-daemon-config
     29Architecture: all
     30Depends: ${misc:Depends}, ${python:Depends}, python-pil, python-dateutil, python-tz, python-rrdtool, python-pynmea2, gpsd, gpsbabel, n2kd-scripts, n2kd-bin, gnuboat-daemon-config
    3131Recommends: python-epd
    3232Description: GNUBoat logging daemon
    … …  
    3636#Package: python3-gnuboat
    3737#Section: python
    38 #Architecture: any
    39 #Depends: ${misc:Depends}, ${python3:Depends}, python3-pil, python3-dateutil, python3-tz, python3-rrdtool, python3-pynmea2, gpsd, n2kd-scripts, n2kd-bin, gnuboat-daemon-config
     38#Architecture: all
     39#Depends: ${misc:Depends}, ${python3:Depends}, python3-pil, python3-dateutil, python3-tz, python3-rrdtool, python3-pynmea2, gpsd, gpsbabel, n2kd-scripts, n2kd-bin, gnuboat-daemon-config
    4040#Recommends: python-epd
    4141#Description: GNUBoat logging daemon
    … …  
    5555Package: gnuboat-puppet
    5656Architecture: all
    57 Depends: ${misc:Depends}, puppet (>= 3.8), debconf
     57Depends: ${misc:Depends}, puppet (>= 3.8)
    5858Description: GNUBoat puppet configuration environment
    5959 Contains a complete puppet environment to configure a device
  • debian/copyright

    rc810990 r8fd7454  
    2626 License version 3 can be found in the file
    2727 `/usr/share/common-licenses/GPL-3'.
     28
     29Files: src/puppetcode/environments/gnuboat/modules/apt
     30       src/puppetcode/environments/gnuboat/modules/stdlib
     31Copyright: Puppet
     32License: Apache-2.0
     33 Licensed under the Apache License, Version 2.0 (the "License");
     34 you may not use this file except in compliance with the License.
     35 You may obtain a copy of the License at
     36 http://www.apache.org/licenses/LICENSE-2.0
     37 .
     38 Unless required by applicable law or agreed to in writing, software
     39 distributed under the License is distributed on an "AS IS" BASIS,
     40 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     41 See the License for the specific language governing permissions
     42 and limitations under the License.
     43 .
     44 On Debian systems, the complete text of the Apache license 2.0 can be found in
     45 /usr/share/common-licenses/Apache-2.0 file.
     46
     47Files: src/puppetcode/environments/gnuboat/modules/chrony
     48Copyright: Michael Hampton
     49License: GPL-3
     50 This program is free software; you can redistribute it
     51 and/or modify it under the terms of the GNU General Public
     52 License version 3 as published by the Free Software Foundation.
     53 .
     54 This program is distributed in the hope that it will be
     55 useful, but WITHOUT ANY WARRANTY; without even the implied
     56 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     57 PURPOSE.  See the GNU General Public License for more
     58 details.
     59 .
     60 You should have received a copy of the GNU General Public
     61 License along with this package; if not, write to the Free
     62 Software Foundation, Inc., 51 Franklin St, Fifth Floor,
     63 Boston, MA  02110-1301 USA
     64 .
     65 On Debian systems, the full text of the GNU General Public
     66 License version 3 can be found in the file
     67 `/usr/share/common-licenses/GPL-3'.
     68
  • debian/gnuboat-webserver.lintian-overrides

    rc810990 r8fd7454  
    1 gnuboat-webserver binary: executable-not-elf-or-script usr/share/gnuboat/webservice/map.mbtiles
     1# mbtiles files are SQLite databases and they must be executable by the webserver to be used by PHP SQLite
     2gnuboat-webserver binary: executable-not-elf-or-script usr/share/gnuboat/webservice/maps/000-forggensee.mbtiles
  • setup.py

    rc810990 r8fd7454  
    2626setup(
    2727  name="gnuboat",
    28   version="0.4.6",
     28  version="0.4.8",
    2929  maintainer="EngSaS - Langenbach",
    3030  maintainer_email="info@engsas.de",
    … …  
    3232  license="GNU General Public License v3 or later (GPLv3+)",
    3333  keywords="",
    34   url="http://trac.falaba.de/gnuboat",
     34  url="http://trac.engsas.de/gnuboat",
    3535  package_dir={'': 'src/python'},
    3636  packages=find_packages("src/python"),
    37   scripts=["src/python/bin/gnuboat", "src/python/bin/gnuboat-splashscreen"],
     37  scripts=["src/python/bin/gnuboat", "src/python/bin/gnuboat-splashscreen", "src/python/bin/gnuboat-log-converter", "src/python/bin/gnuboat-data-generator"],
    3838  long_description=README_TEXT,
    3939  install_requires=[
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/abs_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/anchor_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/any2array_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/base64_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/bool2num_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/build_csv.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/capitalize_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/ceiling_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/chomp_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/chop_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/clamp_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/concat_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/count_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/deep_merge_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/defined_with_params_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/delete_at_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/delete_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/delete_undef_values_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/delete_values_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/difference_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/dirname_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/downcase_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/empty_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/ensure_resource_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/flatten_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/floor_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/fqdn_rotate_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/get_module_path_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/getparam_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/getvar_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/grep_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/has_interface_with_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/has_ip_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/has_ip_network_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/has_key_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/hash_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/intersection_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_array_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_bool_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_domain_name_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_float_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_function_available_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_hash_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_integer_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_ip_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_ipv4_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_ipv6_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_mac_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_numeric_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/is_string_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/join_keys_to_values_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/join_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/keys_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/lstrip_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/max_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/member_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/merge_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/min_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/num2bool_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/parsejson_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/parseyaml_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/pick_default_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/pick_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/prefix_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/range_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/reject_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/reverse_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/rstrip_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/shuffle_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/size_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/sort_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/squeeze_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/str2bool_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/str2saltedsha512_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/strftime_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/strip_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/suffix_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/swapcase_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/time_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/to_bytes_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/try_get_value_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/type_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/union_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/unique_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/upcase_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/uriescape_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/validate_absolute_path_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/validate_array_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/validate_augeas_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/validate_bool_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/validate_cmd_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/validate_hash_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/validate_ipv4_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/validate_ipv6_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/validate_re_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/validate_slength_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/validate_string_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/values_at_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/values_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/zip_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/abs_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/any2array_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/any2bool_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/assert_private_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/base64_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/basename_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/bool2num_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/bool2str_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/camelcase_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/capitalize_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/ceiling_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/chomp_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/chop_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/concat_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/count_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/deep_merge_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/defined_with_params_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/delete_at_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/delete_regex_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/delete_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/delete_undef_values_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/delete_values_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/difference_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/dirname_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/downcase_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/empty_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/ensure_packages_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/ensure_resource_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/flatten_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/floor_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/fqdn_rotate_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/get_module_path_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/getparam_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/getvar_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/glob_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/grep_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/has_interface_with_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/has_ip_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/has_ip_network_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/has_key_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/hash_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/intersection_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_array_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_bool_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_domain_name_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_email_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_float_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_function_available.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_hash_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_integer_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_ip_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_mac_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_numeric_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/is_string_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/join_keys_to_values_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/join_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/keys_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/length.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/load_module_metadata_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/loadyaml_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/lstrip_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/max_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/member_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/merge_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/min_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/num2bool_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/parsejson_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/parseyaml_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/pick_default_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/pick_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/prefix_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/range_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/reject_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/reverse_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/rstrip_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/shuffle_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/size_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/sort_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/squeeze_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/str2bool_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/str2saltedsha512_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/strftime_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/strip_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/suffix_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/swapcase_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/time_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/to_bytes_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/type_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/union_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/unique_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/upcase_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/uriescape_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_absolute_path_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_array_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_augeas_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_bool_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_cmd_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_hash_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_integer_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_ipv4_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_ipv6_address_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_numeric_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_re_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_slength_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_string_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/validate_x509_rsa_key_pair_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/values_at_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/values_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/functions/zip_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/monkey_patches/alias_should_to_must.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/monkey_patches/publicize_methods.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/spec_helper.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/spec_helper_acceptance.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/unit/facter/facter_dot_d_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/unit/facter/pe_version_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/unit/facter/root_home_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/unit/facter/util/puppet_settings_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/unit/puppet/provider/file_line/ruby_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/unit/puppet/type/anchor_spec.rb

    • Property mode changed from 100755 to 100644
  • src/puppetcode/environments/gnuboat/modules/stdlib/spec/unit/puppet/type/file_line_spec.rb

    • Property mode changed from 100755 to 100644
  • src/python/bin/gnuboat

    rc810990 r8fd7454  
    2727from pytz import timezone
    2828import pytz
    29 import getopt
     29import argparse
    3030import sys
    3131import pynmea2
     32import traceback
     33import math
    3234
    3335from gnuboat import daemon
    … …  
    4345logdir = "/var/log/gnuboat"
    4446logperiod = 2
     47logverbose = False
     48logsystemtime = False
    4549displayperiod = 5
    4650
    … …  
    4852nmeafile = None
    4953nmeaFileDate = None
    50 
    51 
    52 def rraRows(duration, resolution, step):
    53     return int(round(float(duration) / rraSteps(resolution, float(step)) / float(step)))
    54 
    55 
    56 def rraSteps(resolution, step):
    57     return int(round(float(resolution) / float(step)))
    58 
    59 
    60 def createDatabase(databaseFile):
    61     rrdDataSources = ['DS:latitude:GAUGE:15:-90:90',
    62                       'DS:longitude:GAUGE:15:-180:180',
    63                       'DS:speedthroughwater:GAUGE:15:U:U',
    64                       'DS:speedoverground:GAUGE:15:U:U',
    65                       'DS:waterdepth:GAUGE:15:0:10000',
    66                       'DS:watertemperature:GAUGE:15:-10:50',
    67                       'DS:gpsfix:GAUGE:15:-999:3']
    68 
    69     step = logperiod
    70     # durations: each archive should contain values for in seconds
    71     archives = [
    72         {"duration": 240, "resolution": 2},
    73         {"duration": 3600, "resolution": 10},
    74         {"duration": 86400, "resolution": 60},
    75     ]
    76     rrdArchives = []
    77     for i in range(0, len(archives)):
    78         rrdArchives += ['RRA:AVERAGE:0.5:%d:%d' % (rraSteps(archives[i]["resolution"], step), rraRows(
    79             archives[i]["duration"], archives[i]["resolution"], step))]
    80 
    81     if not os.path.isfile(databaseFile):
    82         rrdtool.create(databaseFile,
    83                        "--start",
    84                        "N",
    85                        "--step",
    86                        str(step),
    87                        rrdDataSources,
    88                        rrdArchives)
    8954
    9055
    … …  
    10469            os.system("sudo shutdown -h now")
    10570
    106 
    107 def usage():
    108     print "Usage of gnuboat daemon:"
    109     print "  gnuboat -r PATH_TO_RRD_DATABAE_FILE -s PATH_TO_SHUTDOWN_REQUEST_FILE [-l [LOG_UPDATE_PERIOD] [-d DISPLAY_UPDATE_PERIOD] [-o PATH_TO_NMEA1983_LOG]"
    110     print ""
    111     print "  -h --help              Display this help"
    112     print "  -r --rrdfile           Path to the rrd database used by the webservice to serve the clients"
    113     print "  -s --shutdownfile      Path to the shutdown request file, used by the webservice to request a shutdown of the system running gnuboat"
    114     print "  -l --logperiod         Time in seconds to update the logs"
    115     print "  -d --displayperiod     Timein seconds to update the display"
    116     print "  -o --output            Directory where the log files are stored (e.g. the NMEA0183 log files)"
    117 
    11871def log(gpsFix, gpsTime, gpsStatus, latitude, latitudeDirection, longitude,
    119         longitudeDirection, courseOverGround, speedOverGround, waterDepth, waterDepthValid):
     72        longitudeDirection, courseOverGround, speedOverGround, waterDepth, waterTemperature, transducerValid, logVerbose, logSystemTime):
    12073    global logdir
    12174    global nmeafile
    12275    global nmeaFileDate
    123    
     76
    12477    # Only log, if we have a gps fix
    12578    if gpsFix < 2:
    126         return
     79        if not logVerbose:
     80            return
     81        gpsStatus = 'V'
     82        mode = 'N'
     83        if gpsTime is None:
     84            gpsTime = datetime.datetime.utcnow()
    12785   
    12886    nmeaFileDateShould = datetime.datetime.utcnow().strftime("%Y-%m-%d")
    … …  
    13391        try:
    13492            nmeaFileDate = nmeaFileDateShould
    135             nmeaLogFile = "nmea0183-%s.log" % nmeaFileDate
    136             nmeafile = open("%s/%s" % (logdir, nmeaLogFile), 'a', 0)
     93            nmeaLogFile = 'nmea0183-{}.log'.format(nmeaFileDate)
     94            nmeafile = open('{}/{}'.format(logdir, nmeaLogFile), 'a', 0)
    13795        except IOError as error:
    138             print "Could not open the logfile: %s" % error
     96            print('Could not open the logfile: {}'.format(error))
    13997            sys.exit(2)
    140                
    141     nmeafile.write("%s\r\n" % str(pynmea2.RMC('GN', 'RMC',
    142                                               (gpsTime.strftime("%H%M%S"), gpsStatus, '$%04.3f' % latitude,
    143                                                latitudeDirection, '$%05.3f' % longitude, longitudeDirection,
    144                                                '$%02.1f' % speedOverGround, '$%02.1f' % courseOverGround,
    145                                                gpsTime.strftime("%d%m%y"), '', '', mode))))
    146     if waterDepthValid:
    147         nmeafile.write("%s\r\n" % str(pynmea2.DPT('SD', 'DPT', ('%02.2f' % waterDepth, '00.00'))))
     98
     99    latitude = degreesDecimalToNmea(latitude)
     100    longitude = degreesDecimalToNmea(longitude)
     101
     102    logsystemtime = ""
     103    if logsystemtime:
     104        logsystemtime = '{}: '.format(datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S"))
     105       
     106    try:
     107        nmeafile.write('{}{}\r\n'.format(logsystemtime, str(pynmea2.RMC('GN', 'RMC',
     108                                                     (gpsTime.strftime("%H%M%S"), gpsStatus,
     109                                                     '{:02d}{:07.4f}'.format(latitude['degrees'], latitude['minutes']),
     110                                                     latitudeDirection,
     111                                                     '{:03d}{:07.4f}'.format(longitude['degrees'], longitude['minutes']),
     112                                                     longitudeDirection,
     113                                                     '{:04.1f}'.format(speedOverGround), '{:04.1f}'.format(courseOverGround),
     114                                                     gpsTime.strftime("%d%m%y"), '', '', mode)))))
     115        if transducerValid:
     116            nmeafile.write('{}{}\r\n'.format(logsystemtime, str(pynmea2.DPT('SD', 'DPT', ('{:05.2f}'.format(waterDepth), '00.00')))))
     117            nmeafile.write('{}{}\r\n'.format(logsystemtime, str(pynmea2.MTW('YX', 'MTW', ('{:04.1f}'.format(waterTemperature), 'C')))))
     118    except:
     119        print('Failed writing to logfile {}'.format(nmeaLogFile))
     120        print(traceback.format_exc())
     121
     122def degreesDecimalToNmea(decimalDegrees):
     123    degrees = int(math.floor(decimalDegrees))
     124    minutes = 60.0 * (decimalDegrees - degrees)
     125    return { 'degrees': degrees, 'minutes': minutes}
    148126
    149127def main(argv):
    … …  
    151129    global shutdownfile
    152130    global logperiod
     131    global logverbose
     132    global logsystemtime
    153133    global displayperiod
    154134    global logdir
    155135    global nmeafile
    156136
    157     try:
    158         opts, args = getopt.getopt(argv, "hr:s:l:d:o:", [
    159                                    "help", "rrdfile=", "shutdownfile=", "logperiod=", "displayperiod=", "output="])
    160     except getopt.GetoptError:
    161         usage()
    162         sys.exit(2)
    163 
    164     for option, argument in opts:
    165         if option == ("-h", "--help"):
    166             usage()
    167             sys.exit()
    168         elif option in ("-r", "--rrdfile"):
    169             rrdfile = argument
    170         elif option in ("-s", "--shutdownfile"):
    171             shutdownfile = argument
    172         elif option in ("-l", "--logperiod"):
    173             logperiod = argument
    174         elif option in ("-d", "--displayperiod"):
    175             displayperiod = argument
    176         elif option in ("-o", "--output"):
    177             logdir = argument
    178         else:
    179             assert False, "unhandled option"
     137    parser = argparse.ArgumentParser(description='Collects the data from canboat and gpsd and writes them to the rrd database and the nmea log file')
     138    parser.add_argument('-r', '--rrdfile', dest='rrd_file', metavar='rrd_file', type=str,
     139                        help='Path to the rrd database used by the webservice to serve the clients', default=rrdfile)
     140    parser.add_argument('-s', '--shutdownfile', dest='shutdown_file', metavar='shutdown_file', type=str,
     141                        help='Path to the shutdown request file, used by the webservice to request a shutdown of the system running gnuboat', default=shutdownfile)
     142    parser.add_argument('-lp', '--logperiod', dest='log_period', metavar='log_period', type=int,
     143                        help='Time in seconds to update the logs', default=logperiod)
     144    parser.add_argument('-lv', '--log-verbose', action='store_true', dest='log_verbose',
     145                        help='Log verbose information to nmea log file (Enables -ls and adds RMC sentences, with invalid GPS state, on non fixes (Default off)')
     146    parser.add_argument('-ls', '--log-system-time', action='store_true', dest='log_system_time',
     147                        help='Add to enable prefixing every logline with the system time (Default off)')
     148    parser.add_argument('-d', '--displayperiod', dest='display_period', metavar='display_period', type=int,
     149                        help='Time in seconds to update the display', default=displayperiod)
     150    parser.add_argument('-o', '--output', dest='output', metavar='output', type=str,
     151                        help='Directory where the log files are stored (e.g. the NMEA0183 log files)', default=logdir)
     152    arguments = parser.parse_args(argv)
     153   
     154    if arguments.rrd_file is not None:
     155        rrdfile = arguments.rrd_file
     156    if arguments.shutdown_file is not None:
     157        shutdownfile = arguments.shutdown_file
     158    if arguments.log_period is not None:
     159        logperiod = arguments.log_period   
     160    if arguments.log_verbose is not None:
     161        logverbose = arguments.log_verbose
     162        logsystemtime = True
     163    if arguments.log_system_time is not None and arguments.log_verbose is None:
     164        logsystemtime = arguments.log_system_time
     165    if arguments.display_period is not None:
     166        displayperiod = arguments.display_period
     167    if arguments.output is not None:
     168        logdir = arguments.output
    180169
    181170    if not os.path.exists(os.path.dirname(rrdfile)):
    182         print "rrd database directory not found %s" % os.path.dirname(rrdfile)
    183         print ""
    184         usage()
     171        print('rrd database directory not found {}'.format(os.path.dirname(rrdfile)))
     172        parser.print_help()
    185173        sys.exit(2)
    186174
    187175    if not os.path.exists(os.path.dirname(shutdownfile)):
    188         print "Shutdown request directory not found %s" % os.path.dirname(shutdownfile)
    189         print ""
    190         usage()
     176        print('Shutdown request directory not found {}'.format(os.path.dirname(shutdownfile)))
     177        parser.print_help()
    191178        sys.exit(2)
    192179
    193180    if logperiod < 1:
    194         print "Log period must be >= 1"
    195         print ""
    196         usage()
     181        print('Log period must be >= 1')
     182        parser.print_help()
    197183        sys.exit(2)
    198184
    199185    if displayperiod < 1 or displayperiod < logperiod:
    200         print "Display period must be >= 1 and could not be faster than log period"
    201         print ""
    202         usage()
    203         sys.exit(2)
    204 
    205     createDatabase(rrdfile)
     186        print('Display period must be >= 1 and could not be faster than log period')
     187        parser.print_help()
     188        sys.exit(2)
     189
     190    daemon.rrd_create_database(rrdfile, logperiod)
     191
     192    if os.path.isfile(shutdownfile):
     193        os.remove(shutdownfile)
    206194
    207195    displayHandler = daemon.DisplayHandler(displayperiod)
    … …  
    220208            speedThroughWater = n2kd.speedThroughWater()
    221209            speedOverGround = gpsp.speedOverGround()
     210            courseOverGround = gpsp.courseOverGround()
    222211            waterDepth = n2kd.waterDepth()
    223212            waterTemperature = n2kd.waterTemperature()
    … …  
    225214
    226215            # update rrd database for the webservice
    227             rrdtool.update(rrdfile, "N:%s:%s:%s:%s:%s:%s:%s" % (
    228                 latitude, longitude, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix))
     216            daemon.rrd_update(rrdfile, 'N:{}:{}:{}:{}:{}:{}:{}:{}'.format(
     217                latitude, longitude, speedThroughWater, speedOverGround, courseOverGround, waterDepth, waterTemperature, gpsFix))
    229218
    230219            # append to log
    231220            log(gpsFix, gpsp.timeUtc(), gpsp.status(), latitude, gpsp.latitudeDirection(),
    232                 longitude, gpsp.longitudeDirection(), gpsp.courseOverGround(), speedOverGround,
    233                 waterDepth, n2kd.waterDepthValid())
     221                longitude, gpsp.longitudeDirection(), courseOverGround, speedOverGround,
     222                waterDepth, waterTemperature, n2kd.waterDepthValid(), logverbose, logsystemtime)
    234223           
    235224            # display data
    236225            displayHandler.setValues(
    237                 speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix)
     226                speedThroughWater, speedOverGround, courseOverGround, waterDepth, waterTemperature, gpsFix)
    238227
    239228            # check for shutdown request
  • src/python/bin/gnuboat-splashscreen

    rc810990 r8fd7454  
    3939
    4040def usage():
    41     print "Usage of gnuboat-splashscreen:"
    42     print "  gnuboat-splashscreen [-h] -i PATH_TO_IMAGE_TO_DISPLAY"
    43     print ""
    44     print "  -h --help    Print this help"
    45     print "  -i --image   Path to the image, which should be displayed"
     41    print("Usage of gnuboat-splashscreen:")
     42    print("  gnuboat-splashscreen [-h] -i PATH_TO_IMAGE_TO_DISPLAY")
     43    print("")
     44    print("  -h --help    Print this help")
     45    print("  -i --image   Path to the image, which should be displayed")
    4646    sys.exit()
    4747
    … …  
    6565
    6666    if not os.path.exists(image):
    67         print "Image %s not found" % image
    68         print ""
     67        print("Image {} not found".format(image))
    6968        usage()
    7069        sys.exit(2)
    7170
    7271    if not epdEnabled:
    73         print "Could not initialize EPD or PIL python packages"
     72        print("Could not initialize EPD or PIL python packages")
    7473        sys.exit(2)
    7574
  • src/python/gnuboat/__init__.py

    rc810990 r8fd7454  
    1919from daemon.gpsdpoller import GpsdPoller
    2020from daemon.n2kdpoller import N2kdPoller
     21from daemon.rrdhandler import rrd_create_database
     22from daemon.rrdhandler import rrd_update
  • src/python/gnuboat/daemon/__init__.py

    rc810990 r8fd7454  
    2020from .gpsdpoller import GpsdPoller
    2121from .n2kdpoller import N2kdPoller
     22from .rrdhandler import rrd_create_database
     23from .rrdhandler import rrd_update
    2224
    23 __all__ = ["displayhandler", "gpsdpoller", "n2kdpoller"]
     25__all__ = ["displayhandler", "gpsdpoller", "n2kdpoller", "rrd_create_database", "rrd_update"]
  • src/python/gnuboat/daemon/displayhandler.py

    rc810990 r8fd7454  
    4747        self._speedThroughWater = None
    4848        self._speedOverGround = None
     49        self._courseOverGround = None
    4950        self._waterDepth = None
    5051        self._waterTemperature = None
    … …  
    5758        self._speedOverGround = speed
    5859
     60    def setCourseOverGround(self, course):
     61        self._courseOverGround = course
     62
    5963    def setWaterDepth(self, depth):
    6064        self._waterDepth = depth
    … …  
    6670        self._gpsFix = fix
    6771
    68     def setValues(self, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix):
     72    def setValues(self, speedThroughWater, speedOverGround, courseOverGround, waterDepth, waterTemperature, gpsFix):
    6973        self.setSpeedThroughWater(speedThroughWater)
    7074        self.setSpeedOverGround(speedOverGround)
     75        self.setCourseOverGround(courseOverGround)
    7176        self.setWaterDepth(waterDepth)
    7277        self.setWaterTemperature(waterTemperature)
    … …  
    8186        try:
    8287            while self._running:
    83                 self.displayValues(self._epd, self._speedThroughWater, self._speedOverGround,
     88                self.displayValues(self._epd, self._speedThroughWater, self._speedOverGround, self._courseOverGround,
    8489                                   self._waterDepth, self._waterTemperature, self._gpsFix)
    8590                time.sleep(self._updatePeriod)
    … …  
    8792            pass
    8893
    89     def displayValues(epd, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix):
     94    def displayValues(self, epd, speedThroughWater, speedOverGround, courseOverGround, waterDepth, waterTemperature, gpsFix):
    9095        if not epdEnabled:
    9196            return
  • src/python/gnuboat/daemon/gpsdpoller.py

    rc810990 r8fd7454  
    2222import datetime
    2323import gps
     24import traceback
    2425
    2526# Copied from https://gist.github.com/wolfg1969/4653340
    … …  
    3031    def __init__(self, logperiod):
    3132        threading.Thread.__init__(self)
    32         try:
    33             self._session = gps.gps(mode=gps.WATCH_ENABLE)
    34         except:
    35             self._session = None
    36             self._running = False
    37             return
     33        self._session = None
     34        self._session = None
    3835        self._currentValue = None
    3936        self._running = True
    … …  
    4138
    4239    def latitude(self):
    43         if self._session == None or self.gpsFix() < 2:
     40        if self._currentValue is None or self.gpsFix() < 2 or 'lat' not in self._currentValue:
    4441            return 0
    45         return self._session.fix.latitude
     42        return self._currentValue.lat
    4643
    4744    def latitudeDirection(self):
    48         return "N"
     45        return 'N'
    4946
    5047    def longitude(self):
    51         if self._session == None or self.gpsFix() < 2:
     48        if self._currentValue is None or self.gpsFix() < 2 or 'lon' not in self._currentValue:
    5249            return 0
    53         return self._session.fix.longitude
     50        return self._currentValue.lon
    5451
    5552    def longitudeDirection(self):
    56         return "E"
     53        return 'E'
    5754
    5855    def speedOverGround(self):
    59         if self._session == None or self.gpsFix() < 2:
     56        if self._currentValue is None or self.gpsFix() < 2 or 'speed' not in self._currentValue:
    6057            return 0
    61         return self._session.fix.speed
     58        return self._currentValue.speed
    6259
    6360    def courseOverGround(self):
    64         if self._session == None or self.gpsFix() < 2:
     61        if self._currentValue is None or self.gpsFix() < 2 or 'track' not in self._currentValue:
    6562            return 0
    66         return self._session.fix.track
     63        return self._currentValue.track
    6764
    6865    def gpsFix(self):
    69         if self._session == None:
     66        if self._currentValue is None or 'mode' not in self._currentValue:
    7067            return 0
    71         return self._session.fix.mode
     68        return self._currentValue.mode
    7269
    7370    def status(self):
    74         if self._session == None or self.gpsFix() < 2:
    75             return "V"
    76         return "A"
     71        if self._currentValue is None or self.gpsFix() < 2:
     72            return 'V'
     73        return 'A'
    7774
    7875    def timeUtc(self):
    79         if self._session == None or self.gpsFix() < 2:
     76        if self._currentValue is None or self.gpsFix() < 2 or 'time' not in self._currentValue:
    8077            return None
    81         currentTime = self._session.fix.time
     78        currentTime = self._currentValue.time
    8279        if isinstance(currentTime, float):
    8380            return datetime.datetime.fromtimestamp(currentTime)
    84         return dateutil.parser.parse(self._session.fix.time)
     81        return dateutil.parser.parse(currentTime)
    8582
    8683    def stop(self):
    … …  
    9087        try:
    9188            while self._running:
    92                 self._currentValue = self._session.next()
    93                 time.sleep(float(self._logperiod) / 2.0)
     89                try:
     90                    if self._session is None:
     91                        self._session = gps.gps(mode=gps.WATCH_ENABLE)
     92                    current_value = self._session.next()
     93                    # only update current value, if we got an epX entry
     94                    # dop entries are ignored right now
     95                    if 'mode' in current_value:
     96                        self._currentValue = current_value
     97                except StopIteration:
     98                    break
     99                except:
     100                    print('Failed to read gpsd data')
     101                    print(traceback.format_exc())
     102                    self._currentValue = None
     103                    self._session = None
    94104        except StopIteration:
    95105            pass
  • src/python/gnuboat/daemon/n2kdpoller.py

    rc810990 r8fd7454  
    2121import socket
    2222import json
     23import traceback
    2324
    2425"""@class N2kdPoller
    … …  
    6869        except socket.error as error:
    6970            if not self._connectErrorPrinted:
    70                 print "Failed to connect to n2kd server at %s:%s: %s" % (self._serverHost, self._serverPort, error)
     71                print('Failed to connect to n2kd server at {}:{}: {}'.format(self._serverHost, self._serverPort, error))
    7172                self._connectErrorPrinted = True
    7273            self._waterDepthValid = False
    7374            return
    7475        if self._connectErrorPrinted:
    75             print "Connected to n2kd server at %s:%s" % (self._serverHost, self._serverPort)
     76            print('Connected to n2kd server at {}:{}'.format(self._serverHost, self._serverPort))
    7677            self._connectErrorPrinted = False
    7778
    7879        response = ""
    7980        while 1:
    80             data = n2kdSocket.recv(1024)
     81            try:
     82                data = n2kdSocket.recv(1024)
     83            except:
     84                print('Failed to update n2kd data')
     85                print(traceback.format_exc())
     86                self._waterDepthValid = False
    8187            if not data:
    8288                break
    … …  
    8692            data = json.loads(response)
    8793        except ValueError as error:
    88             print "Failed to decode json: %s" % error
     94            print('Failed to decode json: {}'.format(error))
    8995
    9096        descriptions = [
    … …  
    94100            entryKeys = data[key].keys()
    95101            if len(entryKeys) != 2:
    96                 print "Malformed json n2kd response? %s" % response
     102                print('Malformed json n2kd response? {}'.format(response))
    97103            else:
    98104                if data[key]["description"] in descriptions:
    … …  
    100106                    lineKeys = data[key][entryKey].keys()
    101107                    if "fields" not in lineKeys:
    102                         print "No fields entry. Malformed json n2kd response in %s" % data[key][entryKey]
     108                        print('No fields entry. Malformed json n2kd response in {}'.format(data[key][entryKey]))
    103109                    else:
    104110                        fields = data[key][entryKey]["fields"]
    … …  
    110116                        # try speed
    111117                        if "Speed Water Referenced" in fields:
    112                             self._speedThroughWater = fields[
    113                                 "Speed Water Referenced"]
     118                            self._speedThroughWater = fields["Speed Water Referenced"]
    114119                        # try sea temperature
    115120                        if "Temperature Source" in fields and "Temperature" in fields:
    … …  
    123128
    124129    def _serverUrl(self):
    125         return "http://%s:%d/" % (self._serverHost, self._serverPort)
     130        return 'http://{}:{:d}/'.format(self._serverHost, self._serverPort)
    126131
    127132    def stop(self):
  • src/webapp/build.xml

    rc810990 r8fd7454  
    2828                        <exclude name="mbtiles/**"/>
    2929                        <exclude name="tests/**"/>
     30                        <exclude name="config/**"/>
    3031                </fileset>
    3132                <fileset dir="./webservice/mbtiles" id="filesWebserviceMaps">
    … …  
    4445
    4546
    46         <target name="dist" depends="buildwebservice,buildwebclient">
     47        <target name="dist" depends="buildwebservice,buildwebclient,test">
    4748                <echo msg="Creating archive"/>
    48         <!--    <tar destfile="${builddir}/..//gnuboat-webapp.tar.gz" compression="gzip">
     49                <tar destfile="${builddir}/..//gnuboat-webapp.tar.gz" compression="gzip">
    4950                        <fileset refid="filesWebApp"/>
    50                 </tar>-->
     51                </tar>
    5152                <echo msg="Files copied and compressed in build directory weblcient.tar.gz OK!" />
    5253        </target>
    53         <target name="testdist" depends="buildwebservice,buildwebclient">
     54
     55        <target name="testdist" depends="buildwebservice,buildwebclient,test">
    5456                <echo msg="Install project into ${user.home}/public_html/gnuboat"/>
     57                <fileset id="filesConfig" dir="./webservice/config">
     58                        <include name="config.php"/>
     59                </fileset>
     60                <fileset id="filesLogs" dir="./webservice/tests/logs">
     61                        <include name="*.log"/>
     62                </fileset>
     63       
    5564                <copy todir="${user.home}/public_html/gnuboat">
    5665                        <fileset refid="filesWebApp"/>
    5766                </copy>
     67                <copy todir="${user.home}/public_html/gnuboat/webservice/tests/logs">
     68                        <fileset refid="filesLogs"/>
     69                </copy>
     70                <copy todir="${user.home}/public_html/gnuboat/webservice/config">
     71                        <fileset refid="filesConfig"/>
     72                </copy>
    5873        </target>
    5974
    60         <!-- <phpunit bootstrap="webservice/inc/autoloader.php" pharlocation="phpunit-4.8.9.phar" haltonfailure="true" haltonerror="true" printsummary="true">
    61                 <formatter type="plain" usefile="false"/>
    62                 <batchtest>
    63                         <fileset dir="webservice">
    64                                 <include name="tests/ServiceTest.php"/>
    65                         </fileset>
    66                 </batchtest>
    67         </phpunit> -->
     75        <target name="test">
     76                <exec command="php phpunit-4.8.9.phar" passthru="true" checkreturn="true"/>
     77                <!--<phpunit pharlocation="phpunit-4.8.9.phar" configuration="phpunit.xml" haltonfailure="true" haltonerror="true" printsummary="true" codecoverage="false">
     78                        <formatter type="plain" usefile="false"/> -->
     79                        <!--<formatter type="JUnit" usefile="true"/>-->
     80<!--                    <batchtest>
     81                                <fileset dir="webservice">
     82                                        <include name="tests/*Test.php"/>
     83                                </fileset>
     84                        </batchtest>
     85                </phpunit>-->
     86        </target>
    6887</project>
  • src/webapp/webclient/index.html

    rc810990 r8fd7454  
    3030                <link rel="stylesheet" content="text/css" href="lib/css/pure/grids-responsive-min.css">
    3131                <!--<![endif]-->
    32                 <link rel="stylesheet" content="text/css" href="lib/css/leaflet.css"/>
     32                <link rel="stylesheet" content="text/css" href="lib/css/leaflet/leaflet.css"/>
    3333               
    34                 <script language="javascript" src="lib/js/jquery-3.2.1.min.js" type="text/javascript"></script>
     34                <script src="lib/js/jquery-3.2.1.min.js" type="text/javascript"></script>
    3535                <script src="lib/js/jquery.validate.min.js" type="text/javascript"></script>
    3636                <script src="lib/js/additional-methods.min.js" type="text/javascript"></script>
    37                 <script language="javascript\" src="lib/js/leaflet.js" type="text/javascript"></script>
     37                <script src="lib/js/leaflet.js" type="text/javascript"></script>
     38                <script src="lib/js/leaflet.hotline.min.js" type="text/javascript"></script>
     39                <script src="lib/js/three.min.js"></script>
     40                <script src="lib/js/three.OrbitControls.js"></script>
    3841               
    39                 <link rel="stylesheet" href="css/main.css" type="text/css"/>
     42                <link rel="stylesheet" href="css/GnuBoat.css" type="text/css"/>
    4043                <link rel="stylesheet" href="css/side-menu.css" type="text/css"/>
    41                 <script language="javascript" src="js/side-menu.js" type="text/javascript"></script>
    42                 <script language="javascript" src="js/main.js" type="text/javascript"></script>
     44                <script language="javascript" src="js/GnuBoat.js" type="text/javascript"></script>
     45                <script language="javascript" type="text/javascript">
     46                        var active = 'active';
     47                        var layout = null;
     48                        var menu = null;
     49                        var menuLink = null;
     50                        var content = null;
     51
     52                        function toggleAll() {
     53                                layout.toggleClass(active);
     54                                menu.toggleClass(active);
     55                                menuLink.toggleClass(active);
     56                        }
     57
     58                        $(document).ready(function () {
     59                                layout   = $("#layout");
     60                                menu     = $("#menu");
     61                                menuLink = $("#menuLink");
     62                                content  = $("#main");
     63
     64                                menuLink.click(function () {
     65                                        toggleAll();
     66                                });
     67
     68                                content.click(function() {
     69                                        if (menu.hasClass(active)) {
     70                                                toggleAll();
     71                                        }
     72                                });
     73
     74                                GnuBoat.initialize();
     75                                GnuBoat.setServer("../webservice");
     76                                GnuBoat.start();
     77                        });
     78                </script>
    4379        </head>
    4480        <body>
    … …  
    5187                                                <li class="pure-menu-item"><a class="pure-menu-link" href="#display">Display</a></li>
    5288                                                <li class="pure-menu-item"><a class="pure-menu-link" href="#map">Map</a></li>
     89                                                <li class="pure-menu-item"><a class="pure-menu-link" href="#rendering">3D Rendering</a></li>
    5390                                                <li class="pure-menu-item"><a class="pure-menu-link" href="#logfiles">Logfiles</a></li>
     91                                                <li class="pure-menu-item"><a class="pure-menu-link" href="#opencpn">OpenCPN</a></li>
    5492                                                <li class="pure-menu-item"><button type="button" class="pure-button shutdown-button" id="shutdownButton">SHUTDOWN</button></li>
    5593                                        </ul>
    … …  
    91129                                                <div class="pure-u-1 pure-u-md-1-2 pure-u-lg-1-2">
    92130                                                        <div id="shutdown" class="l-box">
    93                                                                 <a name="shutdown"></a>
    94                                                                 <p id="shutdownMessage"/>
     131                                                                <a name="messages"></a>
     132                                                                <p id="message"/>
    95133<!--                                                            <button type="button" class="pure-button shutdown-button" id="shutdownButton">SHUTDOWN</button> -->
    96134                                                        </div>
    … …  
    101139                                        <div id="map">
    102140                                                <a name="map"></a>
    103                                                 <form id="mapSelectForm" class="pure-form"><select id="mapSelect" class="pure-input-1" size="1"></select></form>
    104                                                 <div id="mapViewport"></div>
     141                                                <form id="mapSelectForm" class="pure-form pure-form-aligned">
     142                                                        <div class="pure-control-group">
     143                                                                <label for="mapModusSelect">Map Modus:</label>
     144                                                                <select id="mapModusSelect" size="1" class="pure-input-1-2"></select>
     145                                                        </div>
     146                                                        <div class="pure-control-group">
     147                                                                <label for="mapSelect">Map Selection:</label>
     148                                                                <select id="mapSelect" size="1" class="pure-input-1-2"></select>
     149                                                        </div>
     150                                                </form>
     151                                                <div class="pure-g">
     152                                                        <div class="pure-u-1 pure-u-md-4-5 pure-u-lg-4-5">
     153                                                                <div id="mapViewport" class="viewportGeometry"></div>
     154                                                        </div>
     155                                                        <div class="pure-u-1 pure-u-md-1-5 pure-u-lg-1-5">
     156                                                                <div id="mapLegend"></div>
     157                                                        </div>
     158                                                </div>
    105159                                        </div>
    106160                                        <form id="mapTileUpload" class="pure-form pure-form-aligned" enctype="multipart/form-data">
    … …  
    118172                                                </fieldset>
    119173                                        </form>
    120                                                                        
     174
     175                                        <h2 class="content-subhead">3D Rendering of Water Depth</h2>
     176                                        <div>
     177                                                <a name="rendering"></a>
     178                                                <form id="renderForm" class="pure-form">
     179                                                        <label>Scale Depth Axis:</label><input id="renderScaleZ" type="range" name="renderScaleZ" min="0.5" max="1000" step="1" value="10" class="pure-input-1">
     180                                                </form>
     181                                                <div id="rendering" class="viewportGeometry"></div>
     182                                        </div>
     183
    121184                                        <h2 class="content-subhead">
    122185                                                Logfiles
    … …  
    127190                                                <form id="logfilesForm" class="pure-form" method="POST" action="../webservice/?request=logfiles"></form>
    128191                                        </div>
     192                                       
     193                                        <h2 class="content-subhead">OpenCPN</h2>
     194                                        <div>
     195                                                <a name="opencpn"></a>
     196                                                <div id="opencpnHint"></div>
     197                                        </div>
    129198                                </div>
    130199                        </div>
  • src/webapp/webservice/inc/GnuBoat/Config.php

    rc810990 r8fd7454  
    2626        public function __construct()
    2727        {
    28                 $configFile = __DIR__ ."/../config/config.php";
     28                $configFile = __DIR__ ."/../../config/config.php";
    2929                if(file_exists($configFile)){
    3030                        include($configFile);
    … …  
    5151        {
    5252                if(array_key_exists("datadirectory", $this->_config))
    53                         return addTrailingSlash($this->_config["datadirectory"]);
     53                        return $this->addTrailingSlash($this->_config["datadirectory"]);
    5454                return "/var/lib/gnuboat/";
    5555        }
    … …  
    5858        {
    5959                if(array_key_exists("logdirectory", $this->_config))
    60                         return addTrailingSlash($this->_config["logdirectory"]);
     60                        return $this->addTrailingSlash($this->_config["logdirectory"]);
    6161                return "/var/log/gnuboat/";
    6262        }
  • src/webapp/webservice/inc/GnuBoat/Service.php

    rc810990 r8fd7454  
    4444                $this->process();
    4545        }
     46       
     47        public static function errorStatic($message, $additionalContent = array(), $debug)
     48        {
     49                error_log($message);
     50                if($debug > 0)
     51                        print $message ."\n";
     52                $result = ["error" => 1, "errormessage" => $message];
     53                Service::outputStatic(array_merge($result, $additionalContent), $debug);
     54        }
     55       
     56        public static function outputStatic($content, $debug)
     57        {
     58                header('Content-Type: application/json');
     59                if($debug > 0){
     60                        echo json_encode($content,  JSON_PRETTY_PRINT) ."\n";
     61                }
     62                else{
     63                        echo json_encode($content) ."\n";
     64                }
     65        }
     66       
     67        protected function error($message, $additionalContent = array())
     68        {
     69                Service::errorStatic($message, $additionalContent, $this->debug());
     70        }
     71       
     72        protected function output($content)
     73        {
     74                Service::outputStatic($content, $this->debug());
     75        }
    4676
    4777        /**
  • src/webapp/webservice/inc/GnuBoat/ServiceData.php

    rc810990 r8fd7454  
    2929                $this->_configRound = array
    3030                (
    31                         "latitude" => 5,
    32                         "longitude" => 5,
     31                        "latitude" => 4,
     32                        "longitude" => 4,
    3333                        "speedthroughwater" => 1,
    3434                        "speedoverground" => 1,
     35                        "courseoverground" => 1,
    3536                        "waterdepth" => 1,
    3637                        "watertemperature" => 1,
    … …  
    4849                $result["track"] = array();
    4950
    50                 if(!file_exists($dbFile)){
    51                         echo json_encode("");
    52                         if($debug > 0)
    53                                 echo "Database file ". $dbFile ." does not exist!";
    54                         error_log("Database file ". $dbFile ." does not exist");
    55                         exit;
    56                 }
     51                if(!file_exists($dbFile))
     52                        return $this->error("Database file ". $dbFile ." does not exist");
     53
    5754                // Fetch entries of the last 30s with maximum (available) resolution of 2s
    5855                $this->addRrdData($dbFile, "2", "240", $result, $lastValid);
    59                 if($lastValid){
    60                         $result["lastvalid"] = $lastValid;
     56                if($lastValid !== false){
     57                        $result["lastvalid"] = $lastValid->toArray();
    6158                }
    6259                // Fetch entries of the last 1h with maximum (available) resolution of 10s
    … …  
    6562                $this->addRrdData($dbFile, "60", "86400", $result, $lastTime);
    6663
    67                 if($debug > 0){
    68                         echo json_encode($result,  JSON_PRETTY_PRINT) ."\n";
    69                 }
    70                 else{
    71                         header('Content-Type: application/json');
    72                         echo json_encode($result) ."\n";
    73                 }
     64                return $this->output($result);
    7465        }
    7566
    … …  
    8273                $data = rrd_fetch($dbFile, array("AVERAGE", "--resolution", $interval, "--start", $startTime, "--end", $endTime));
    8374                // $data = rrd_fetch($dbFile, array("AVERAGE", "--resolution", $interval, "--start", "-". $period, "--end", "start+". $period, "--align-start"));
    84                 if($data === false){
    85                         echo json_encode($result);
    86                         $message = "Failure reading rrd database ". $dbFile .": ". rrd_error();
    87                         if($debug > 0)
    88                                 echo $message;
    89                         else
    90                                 error_log($message);
    91                         return;
    92                 }
     75                if($data === false)
     76                        return $this->error("Failure reading rrd database ". $dbFile .": ". rrd_error(), $result);
    9377
    9478                if($debug > 2){
    95                         echo "<pre>";
    9679                        var_dump($data);
    97                         echo "</pre>";
    9880                }
    9981
    … …  
    10284                // transform them into json format
    10385                $i = 0;
    104                 $lastValid = -1;
     86                $lastValid = false;
    10587                $keys = array_keys($data);
    10688                $keyTimeframes = $keys[0];
    10789                $itemCount = count($keys);
    108                 if($itemCount < 0 ){
    109                         error_log("No keys in fetched rrd data from ". $dbFile);
    110                         echo json_encode("");
    111                         exit;
    112                 }
     90                if($itemCount < 0 )
     91                        return $this->error("No keys in fetched rrd data from ". $dbFile);
     92
    11393                $timeframesCount = count($data[$keyTimeframes]);
    114                 if($debug > 0){
    115                         echo "<p>Variables: ". $itemCount ."; Timeframes: ". $timeframesCount ."</p>\n";
     94                if($debug > 1){
     95                        error_log("Variables: ". $itemCount ."; Timeframes: ". $timeframesCount);
    11696                }
    11797                foreach($data[$keys[0]] as $timeframe => $value){
    118                         $allValid = true;
    119                         $gpsFix = false;
    120                         $tmp = array();
     98                        $tmp = new TrackItem($timeframe);
    12199                        foreach($keys as $key){
    122                                 if($key == "gpsfix"){
    123                                         switch($data[$key][$timeframe]){
    124                                                 case 2:
    125                                                         $tmp[$key] = "2D";
    126                                                         $gpsFix = true;
    127                                                         break;
    128                                                 case 3:
    129                                                         $tmp[$key] = "3D";
    130                                                         $gpsFix = true;
    131                                                         break;
    132                                                 default:
    133                                                         $tmp[$key] = "-";
    134                                         }
    135                                 }
    136                                 else{
    137                                         $tmp[$key] = $data[$key][$timeframe];
    138                                         if(!is_numeric($tmp[$key]) || is_nan($tmp[$key])){
    139                                                 $allValid = false;
    140                                                 if($debug > 1){
    141                                                         echo "Invalid value ". $key ." (". $tmp[$key] .") at time ". $timeframe ."<br/>";
    142                                                 }
    143                                         }
    144                                         elseif(array_key_exists($key, $this->_configRound) && is_integer($this->_configRound[$key]))
    145                                                 $tmp[$key] = round($tmp[$key], $this->_configRound[$key]);
    146                                 }
     100                                $value = $data[$key][$timeframe];
     101                                if(array_key_exists($key, $this->_configRound) && is_integer($this->_configRound[$key]))
     102                                        $value = round($value, $this->_configRound[$key]);
     103                                if(!$tmp->setProperty($key, $value) && $debug > 1)
     104                                        error_log("Coult not set property ". $key ." to value ". $value ." at ". $timeframe);
    147105                        }
    148106                        // only add the timeframe to the track, if the values are valid and we had a gps fix at that time
    149                         if($allValid){
     107                        if($tmp->isValid()){
    150108                                $lastValid = $tmp;
    151                                 if($gpsFix){
     109                                if($tmp->gpsFixed()){
    152110                                        if(!array_key_exists($timeframe, $result["track"])){
    153                                                 $result["track"][$timeframe] = $tmp;
     111                                                $result["track"][$timeframe] = $tmp->toArray();
    154112                                        }
    155113                                }
  • src/webapp/webservice/inc/GnuBoat/ServiceLogFiles.php

    rc810990 r8fd7454  
    3232                $debug = $this->debug();
    3333                $config = new Config();
     34                if($debug > 1)
     35                        print "Log directory: ". $config->logDirectory() ."\n";
    3436
    3537                if(!array_key_exists("logfilesSelected", $_POST)){
    … …  
    3739                        $files = glob($config->logDirectory() ."*.log");
    3840                        array_walk($files, 'GnuBoat\ServiceLogFiles::stripLogDirectory');
     41                        return $this->output($files);
     42                }
    3943
    40                         header('Content-Type: application/json');
    41                         if($debug > 0){
    42                                 echo json_encode($files,  JSON_PRETTY_PRINT) ."\n";
     44                // prepare a download of available log files
     45                $files = $_POST["logfilesSelected"];
     46                if(count($files) < 1)
     47                        return $this->error("No logfile selected");
     48                elseif(count($files) == 1){
     49                        $content = file_get_contents($config->logDirectory() . $files[0]);
     50                        if($content === false){
     51                                echo "<html><head></head><body>Failed to read logfile ". $files[0] ."</body></html>";
    4352                        }
    44                         else{
    45                                 echo json_encode($files) ."\n";
    46                         }
     53               
     54                        header('Content-Type: text/plain');
     55                        header('Content-disposition: attachment; filename="'. $files[0] .'"');
     56                        header('Content-Length: ' . filesize($config->logDirectory() . $files[0]));
     57                        echo $content;
    4758                }
    4859                else{
    49                         // prepare a download of available log files
    50                         $files = $_POST["logfilesSelected"];
    51                         if(count($files) < 1){
     60                        $date = new \DateTime('NOW');
     61                        $archiveName = "gnuboat-logs-". $date->format("Y-m-d");
     62               
     63                        // provide files as zip file
     64                        $tmpArchive = tempnam(sys_get_temp_dir(), $archiveName);
     65                        $zip = new \ZipArchive();
     66                        if($zip->open($tmpArchive, \ZipArchive::CREATE) !== TRUE){
     67                                echo "<html><head></head><body>Failed to create zip file</body></html>";
    5268                                return;
    5369                        }
    54                         elseif(count($files) == 1){
    55                                 $content = file_get_contents($config->logDirectory() . $files[0]);
    56                                 if($content === false){
    57                                         echo "<html><head></head><body>Failed to read logfile ". $files[0] ."</body></html>";
    58                                 }
    59                        
    60                                 header('Content-Type: text/plain');
    61                                 header('Content-disposition: attachment; filename="'. $files[0] .'"');
    62                                 header('Content-Length: ' . filesize($config->logDirectory() . $files[0]));
    63                                 echo $content;
    64                         }
    65                         else{
    66                                 $date = new \DateTime('NOW');
    67                                 $archiveName = "gnuboat-logs-". $date->format("Y-m-d");
    68                        
    69                                 // provide files as zip file
    70                                 $tmpArchive = tempnam(sys_get_temp_dir(), $archiveName);
    71                                 $zip = new \ZipArchive();
    72                                 if($zip->open($tmpArchive, \ZipArchive::CREATE) !== TRUE){
    73                                         echo "<html><head></head><body>Failed to create zip file</body></html>";
     70                        foreach($files as $file){
     71                                if($zip->addFile($config->logDirectory() . $file, $archiveName ."/". $file) !== true){
     72                                        $zip->close();
     73                                        echo "<html><head></head><body>Failed to add logfile ". $file ." to the zip file</body></html>";
    7474                                        return;
    7575                                }
    76                                 foreach($files as $file){
    77                                         if($zip->addFile($config->logDirectory() . $file, $archiveName ."/". $file) !== true){
    78                                                 $zip->close();
    79                                                 echo "<html><head></head><body>Failed to add logfile ". $file ." to the zip file</body></html>";
    80                                                 return;
    81                                         }
    82                                 }
    83                                 if($zip->close() !== true){
    84                                                 echo "<html><head></head><body>Failed to save zip file</body></html>";
    85                                                 return;
    86                                 }
    87                                
    88                                 echo "<html><head></head><body>Failed to add logfile ". $file ." to the zip file</body></html>";
    89                                
    90                                 //Send zip folder
    91                                 while (ob_get_level()) {
    92                                         ob_end_clean();
    93                                 }
    94                                 ob_start();
    95                                 header('Content-Type: application/zip');
    96                                 header('Content-Transfer-Encoding: Binary');
    97                                 header('Content-disposition: attachment; filename=' . $archiveName . '.zip');
    98                                 header('Content-Length: ' . filesize($tmpArchive));
    99                                 ob_flush();
    100                                 ob_clean();
    101                                 readfile($tmpArchive);
    102                                 unlink($tmpArchive);
    103                                 return;
    10476                        }
     77                        if($zip->close() !== true){
     78                                        echo "<html><head></head><body>Failed to save zip file</body></html>";
     79                                        return;
     80                        }
     81                       
     82                        echo "<html><head></head><body>Failed to add logfile ". $file ." to the zip file</body></html>";
     83                       
     84                        //Send zip folder
     85                        while (ob_get_level()) {
     86                                ob_end_clean();
     87                        }
     88                        ob_start();
     89                        header('Content-Type: application/zip');
     90                        header('Content-Transfer-Encoding: Binary');
     91                        header('Content-disposition: attachment; filename=' . $archiveName . '.zip');
     92                        header('Content-Length: ' . filesize($tmpArchive));
     93                        ob_flush();
     94                        ob_clean();
     95                        readfile($tmpArchive);
     96                        unlink($tmpArchive);
     97                        return;
    10598                }
    10699        }
  • src/webapp/webservice/inc/GnuBoat/ServiceMap.php

    rc810990 r8fd7454  
    3030        protected function process()
    3131        {
    32                 header('Content-type: application/json');
     32                if(!array_key_exists("mapName", $_POST))
     33                        return $this->error("Please specify map name (no value)");
    3334
    34                 $result["error"] = 1;
    35                 $result["errormessage"] = "Unknown Error";
    36 
    37                 if(!array_key_exists("mapName", $_POST)){
    38                         $result["error"] = 1;
    39                         $result["errormessage"] = "Please specify map name (no value)";
    40                         echo json_encode($result);
    41                         return;
    42                 }
    4335                $mapName = $_POST["mapName"];
    44                 if(empty($mapName) || $mapName == ""){
    45                         $result["error"] = 1;
    46                         $result["errormessage"] = "Please specifiy map name (empty value)";
    47                         echo json_encode($result);
    48                         return;
    49                 }
     36                if(empty($mapName) || $mapName == "")
     37                        return $this->error("Please specifiy map name (empty value)");
    5038
    5139                $mapDirectory = __DIR__ ."/../../maps";
    52                 if(!array_key_exists("mapFile", $_FILES)){
    53                         $result["error"] = 1;
    54                         $result["errormessage"] = "No map file recieved";
    55                         echo json_encode($result);
    56                         return;
    57                 }
    58                 if (!isset($_FILES['mapFile']['error']) || is_array($_FILES['mapFile']['error'])){
    59                         $result["error"] = 1;
    60                         $result["errormessage"] = "Invalid parameters";
    61                         echo json_encode($result);
    62                         return;
    63                 }
     40                if(!array_key_exists("mapFile", $_FILES))
     41                        return $this->error("No map file recieved");
     42
     43                if (!isset($_FILES['mapFile']['error']) || is_array($_FILES['mapFile']['error']))
     44                        return $this->error("Invalid parameters");
     45
    6446                switch ($_FILES['mapFile']['error']) {
    6547                        case UPLOAD_ERR_OK:
    6648                                break;
    6749                        case UPLOAD_ERR_NO_FILE:
    68                                 $result["error"] = 1;
    69                                 $result["errormessage"] = "No file sent";
    70                                 echo json_encode($result);
    71                                 return;
     50                                return $this->error("No file sent");
    7251                        case UPLOAD_ERR_INI_SIZE:
    7352                        case UPLOAD_ERR_FORM_SIZE:
    74                                 $result["error"] = 1;
    75                                 $result["errormessage"] = "Exceeded filesize limit.";
    76                                 echo json_encode($result);
    77                                 return;
     53                                return $this->error("Exceeded filesize limit.");
    7854                        default:
    79                                 $result["error"] = 1;
    80                                 $result["errormessage"] = "Unknown PHP Error";
    81                                 echo json_encode($result);
    82                                 return;
     55                                return $this->error("Unknown PHP Error");
    8356                }
    8457                $mapFileName = $mapDirectory ."/". sha1_file($_FILES['mapFile']['tmp_name']) .".mbtiles";
    8558                if(move_uploaded_file($_FILES['mapFile']['tmp_name'], $mapFileName)){
    86                         if(!chmod($mapFileName, 0755)){
    87                                 $result["error"] = 1;
    88                                 $result["errormessage"] = "Could not change permissions of the map file";
    89                         }
    90                         else{
    91                                 // correct map metadata
    92                                 $resultRename = $this->setMapName($mapFileName, $mapName);
    93                                 if($resultRename[0] === true){
    94                                         $result["error"] = 0;
    95                                         $result["errormessage"] = "";
    96                                 }
    97                                 else{
    98                                         $result["error"] = 1;
    99                                         $result["errormessage"] = $resultRename[1];
    100                                 }
    101                         }
     59                        if(!chmod($mapFileName, 0755))
     60                                return $this->error("Could not change permissions of the map file");
     61                        // correct map metadata
     62                        $resultRename = $this->setMapName($mapFileName, $mapName);
     63                        if($resultRename[0] === true)
     64                                return $this->output(["error" => 0, "errormessage" => ""]);
     65                       
     66                        return $this->error($resultRename[1]);
    10267                }
    103                 else {
    104                         $result["error"] = 1;
    105                         $result["errormessage"] = "Could not move map in place";
    106                 }
    107                 echo json_encode($result);
     68                else
     69                        return $this->error("Could not move map in place");
    10870        }
    10971       
  • src/webapp/webservice/inc/GnuBoat/ServiceShutdown.php

    rc810990 r8fd7454  
    3636                if($handle === false){
    3737                        $message = "Could not create file (". $config->shutdownRequestFile() .") to indicate shutdown to the daemon.";
    38                         if($debug > 0)
    39                                 echo $message;
    40                         error_log($message);
    41                         $result["shutdownstart"] = -1;
    42                         $result["errormessage"] = $message;
    43                 }
    44                 else{
    45                         $shutdownTime = new \DateTime('NOW');
    46                         $shutdownTime->modify("+15 seconds");
    47                         fwrite($handle, $shutdownTime->format(\DateTime::ATOM));
    48                         $result["shutdownstart"] = $shutdownTime->format(\DateTime::ATOM);
     38                        return $this->error($message, ["shutdownstart" => -1]);
    4939                }
    5040
    51                 header('Content-Type: application/json');
    52                 if($debug > 0){
    53                         echo json_encode($result,  JSON_PRETTY_PRINT) ."\n";
    54                 }
    55                 else{
    56                         echo json_encode($result) ."\n";
    57                 }
     41                $shutdownTime = new \DateTime('NOW');
     42                $shutdownTime->modify("+15 seconds");
     43                fwrite($handle, $shutdownTime->format(\DateTime::ATOM));
     44                fclose($handle);
     45                $result["shutdownstart"] = $shutdownTime->format(\DateTime::ATOM);
     46                $this->output($result);
    5847        }
    5948}
  • src/webapp/webservice/inc/GnuBoat/Webservice.php

    rc810990 r8fd7454  
    2323class WebService
    2424{
    25         function __construct()
     25        function __construct($debug)
    2626        {
    2727                $this->_requests = array();
    … …  
    3030                $this->_requests["logfiles"] = "GnuBoat\ServiceLogFiles";
    3131                $this->_requests["map"] = "GnuBoat\ServiceMap";
     32                $this->_requests["replay"] = "GnuBoat\ServiceReplay";
     33               
     34                $this->_debug = $debug;
    3235        }
    3336
    3437        public function process()
    3538        {
    36                 $debug = 0;
    37                 if(is_array($_GET) && array_key_exists("debug", $_GET))
    38                         $debug = $_GET["debug"];
    39 
    4039                $request = array_keys($this->_requests)[0];
    4140                if(is_array($_GET) && array_key_exists("request", $_GET)){
    … …  
    4443
    4544                if(!array_key_exists($request, $this->_requests)){
    46                         $result["error"] = 1;
    47                         $result["errormessage"] = "Request ". $request ." not implemented";
    48                        
    49                         header('Content-Type: application/json');
    50                         echo json_encode($result) ."\n";
    51                         return;
     45                        return Service::errorStatic("Request ". $request ." not implemented", $this->_debug);
    5246                }
    53 
    54                 call_user_func(array(new $this->_requests[$request], "processRequest"), $debug);
     47               
     48                call_user_func(array(new $this->_requests[$request], "processRequest"), $this->_debug);
    5549        }
    5650
    5751        private $_requests;
     52        private $_debug;
    5853}
    5954
  • src/webapp/webservice/inc/autoloader.php

    rc810990 r8fd7454  
    2525}
    2626
     27function canClassBeLoaded($class) {
     28        $parts = explode('\\', $class);
     29        $fileName = __DIR__ ."/". join("/", $parts) .".php";
     30        return file_exists($fileName);
     31}
     32
    2733spl_autoload_register("gnuboatAutoloader");
    2834
  • src/webapp/webservice/index.php

    rc810990 r8fd7454  
    1919require_once(__DIR__ ."/inc/autoloader.php");
    2020
    21 $webservice = new GnuBoat\Webservice();
     21$debug = 0;
     22if(array_key_exists("debug", $_GET))
     23        $debug = $_GET["debug"];
     24
     25$webservice = new GnuBoat\Webservice($debug);
    2226$webservice->process();
    2327
  • src/webapp/webservice/tests/ServiceTest.php

    rc810990 r8fd7454  
    2020// declare(Strict_types=1);
    2121
     22namespace GnuBoat;
     23
    2224/**
    23   * @brief Covers index.php tests
     25  * @brief Covers Service.php tests
    2426  */
    25 final class ServiceTest extends PHPUnit_Framework_TestCase
     27final class ServiceTest extends \PHPUnit_Framework_TestCase
    2628{
    27         /**
    28           * @runInSeparateProcess
    29           */
    3029        public function testData()
    3130        {
    32                 $webservice = new GnuBoat\Webservice();
    33                 $this->assertInstanceOf(GnuBoat\Webservice::class, $webservice);
    34                 $_POST["request"] = "data";
     31                $webservice = new Webservice(0);
     32                $this->assertInstanceOf(Webservice::class, $webservice);
     33                $_GET["request"] = "data";
    3534                $webservice->process();
    3635        }
    3736
    38         /**
    39           * @runInSeparateProcess
    40           */
    4137        public function testLogFiles()
    4238        {
    43                 $webservice = new GnuBoat\Webservice();
    44                 $this->assertInstanceOf(GnuBoat\Webservice::class, $webservice);
    45                 $_POST["request"] = "logfiles";
     39                $webservice = new Webservice(0);
     40                $this->assertInstanceOf(Webservice::class, $webservice);
     41                $_GET["request"] = "logfiles";
    4642                $webservice->process();
    4743        }
    4844       
    49         /**
    50           * @runInSeparateProcess
    51           */
    5245        public function testShutdown()
    5346        {
    54                 $webservice = new GnuBoat\Webservice();
    55                 $this->assertInstanceOf(GnuBoat\Webservice::class, $webservice);
    56                 $_POST["request"] = "shutdown";
     47                $webservice = new Webservice(0);
     48                $this->assertInstanceOf(Webservice::class, $webservice);
     49                $_GET["request"] = "shutdown";
    5750                $webservice->process();
    5851        }
    59        
    60         /**
    61           * @runInSeparateProcess
    62           */
     52
    6353        public function testMap()
    6454        {
    65                 $webservice = new GnuBoat\Webservice();
    66                 $this->assertInstanceOf(GnuBoat\Webservice::class, $webservice);
    67                 $_POST["request"] = "map";
     55                $webservice = new Webservice(0);
     56                $this->assertInstanceOf(Webservice::class, $webservice);
     57                $_GET["request"] = "map";
    6858                $webservice->process();
     59        }
     60
     61        public function testReplay()
     62        {
     63                $webservice = new Webservice(0);
     64                $_GET["request"] = "replay";
     65                $_POST["logfile"] = "replay-test.log";
     66                $webservice->process();
     67                $output = $this->getActualOutput();
     68                $this->assertJsonStringEqualsJsonString('{"track":{"1503767412":{"latitude":1.001,"longitude":1.001,"speedthroughwater":"-","speedoverground":11,"courseoverground":21,"waterdepth":"-","watertemperature":"-","gpsfix":"-"},"1503767413":{"latitude":2.0186666666667001,"longitude":2.0186666666667001,"speedthroughwater":"-","speedoverground":12,"courseoverground":22,"waterdepth":"-","watertemperature":"-","gpsfix":"-"},"1503767414":{"latitude":3.1696666666666999,"longitude":3.1696666666666999,"speedthroughwater":"-","speedoverground":13,"courseoverground":23,"waterdepth":1,"watertemperature":21,"gpsfix":"-"},"1503767415":{"latitude":4.004,"longitude":4.004,"speedthroughwater":"-","speedoverground":14,"courseoverground":24,"waterdepth":2,"watertemperature":22,"gpsfix":"-"},"1503767416":{"latitude":5.005,"longitude":5.005,"speedthroughwater":"-","speedoverground":15,"courseoverground":25,"waterdepth":3,"watertemperature":23,"gpsfix":"-"}}}', $output);
    6969        }
    7070}
    7171
     72function error_log($msg)
     73{
     74        echo "ERR GnuBoat: ". $msg ."\n";
     75}
     76
    7277?>
Note: See TracChangeset for help on using the changeset viewer.