source: webapp/javascript/main.js@ 3121b3b

0.5 app-cordova debian/bullseye debian/jessie
Last change on this file since 3121b3b was 3121b3b, checked in by Joachim Langenbach <joachim.langenbach@…>, 10 years ago
  • Webservice is now able to connect to GPSD
    • Improved the display section in webclient

Signed-off-by: Joachim Langenbach <joachim.langenbach@…>

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[d7e6e9c]1/*
2
[3121b3b]3 Copyright (C) 2016 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
[d7e6e9c]4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 MA 02110-1301 USA.
19
20*/
21
22function openLink(target){
23 window.location=target;
24}
25
26function displayDataSet(data){
[3121b3b]27 $("#display #speedthroughwater #value").text(data["speedthroughwater"].toString());
28 $("#display #speedoverground #value").text(data["speedoverground"].toString());
29 $("#display #waterdepth #value").text(data["waterdepth"].toString());
30 $("#display #watertemperature #value").text(Math.round(data["watertemperature"]).toString());
31 $("#display #gps #value").text(data["gpsfix"]);
[d7e6e9c]32}
33
34function displayDataGet() {
[3121b3b]35 var gnuboatApi = "webservice/";
[d7e6e9c]36 $.getJSON( gnuboatApi, displayDataSet);
37}
38
39$(document).ready(function() {
40 displayDataGet();
41 setInterval(displayDataGet, 5000);
42});
Note: See TracBrowser for help on using the repository browser.