source: webapp/javascript/main.js@ 36be960

0.5 app-cordova debian/bullseye debian/jessie
Last change on this file since 36be960 was d7e6e9c, checked in by Joachim Langenbach <joachim.langenbach@…>, 10 years ago
  • Added webservice file to return displayed data (currently random generated)
    • Load the displayed data from webservice using JQuery
    • Added license statements

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

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2
3 Copyright (C) 2016 Insitute of Mechinal Engineering, Clausthal University of Technology. All rights reserved.
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){
27 $("#display #speedthroughwater #value").text(data["speedthroughwater"]);
28 $("#display #speedoverground #value").text(data["speedoverground"]);
29 $("#display #waterdepth #value").text(data["waterdepth"]);
30 $("#display #watertemperature #value").text(data["watertemperature"]);
31 $("#display #gps #value").text(data["satellites"]);
32}
33
34function displayDataGet() {
35 var gnuboatApi = "http://localhost/~joachim/gnuboat/webservice/";
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.