Changeset 018bce2 for src


Ignore:
Timestamp:
Aug 8, 2017, 11:23:36 AM (9 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, debian/jessie
Children:
9aa387f
Parents:
a68d628 (diff), 24d4504 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into debian/jessie

Location:
src
Files:
26 added
4 deleted
7 edited
3 moved

Legend:

Unmodified
Added
Removed
  • src/puppetcode/environments/gnuboat/modules/gnuboat_gnuboat/manifests/service.pp

    ra68d628 r018bce2  
    1010                        ensure => $status,
    1111                        enable => $enabled,
    12                         subscribe => Package['gnuboat-server'],
     12                        subscribe => Package['python-gnuboat'],
    1313                }
    1414        }
  • src/python/bin/gnuboat

    ra68d628 r018bce2  
    4141rrdfile = "/var/lib/gnuboat/log-webservice.rrd"
    4242shutdownfile = "/var/spool/gnuboat/shutdown.request"
    43 logfile = "/var/log/gnuboat-nmea1983.log"
     43logdir = "/var/log/gnuboat"
     44nmeaLogFile = "nmea0183.log"
    4445logperiod = 2
    4546displayperiod = 5
    … …  
    113114    print "  -l --logperiod         Time in seconds to update the logs"
    114115    print "  -d --displayperiod     Timein seconds to update the display"
    115     print "  -o --output            File where the NMEA1983 log is stored"
     116    print "  -o --output            Directory where the log files are stored (e.g. the NMEA0183 log files)"
    116117
    117118
    … …  
    121122    global logperiod
    122123    global displayperiod
    123     global logfile
     124    global logdir
     125    global nmeaLogFile
    124126    global nmeafile
    125127
    … …  
    144146            displayperiod = argument
    145147        elif option in ("-o", "--output"):
    146             logfile = argument
     148            logdir = argument
    147149        else:
    148150            assert False, "unhandled option"
    … …  
    175177
    176178    try:
    177         nmeafile = open(logfile, 'a', 0)
     179        nmeafile = open("%s/%s" % (logdir, nmeaLogFile), 'a', 0)
    178180    except IOError as error:
    179181        print "Could not open the logfile: %s" % error
    … …  
    221223                                                           timeUtc.strftime("%d%m%y"), '', '', mode))))
    222224                if n2kd.waterDepthValid():
    223                     nmeafile.write("%\r\n" % str(pynmea2.DPT('SD', 'DPT',
     225                    nmeafile.write("%s\r\n" % str(pynmea2.DPT('SD', 'DPT',
    224226                                                             ('%02.2f' % waterDepth, '00.00'))))
    225227
  • src/python/config/gnuboat.service

    ra68d628 r018bce2  
    88Group=root
    99WorkingDirectory=/tmp
    10 ExecStart=/usr/bin/gnuboat -r /var/lib/gnuboat/gnuboat.rrd -s /var/spool/gnuboat/shutdown.request -o /var/log/gnuboat/nmea1983.log
     10ExecStart=/usr/bin/gnuboat -r /var/lib/gnuboat/gnuboat.rrd -s /var/spool/gnuboat/shutdown.request -o /var/log/gnuboat
    1111StandardOutput=syslog
    1212StandardError=syslog
  • src/python/gnuboat/daemon/n2kdpoller.py

    ra68d628 r018bce2  
    6363    def _loadData(self):
    6464        n2kdSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    65         n2kdSocket.settimeout(float(self._logperiod) / 2.0)
     65        n2kdSocket.settimeout(self._timeout)
    6666        try:
    6767            n2kdSocket.connect((self._serverHost, self._serverPort))
    … …  
    7373            return
    7474        if self._connectErrorPrinted:
    75             print "Connected to n2kd server at %s:%s: %s" % (self._serverHost, self._serverPort, error)
     75            print "Connected to n2kd server at %s:%s" % (self._serverHost, self._serverPort)
    7676            self._connectErrorPrinted = False
    7777
    … …  
    8383            response += data
    8484        n2kdSocket.close()
    85         data = json.loads(response)
     85        try:
     86            data = json.loads(response)
     87        except ValueError as error:
     88            print "Failed to decode json: %s" % error
    8689
    8790        descriptions = [
  • src/webapp/build.xml

    ra68d628 r018bce2  
    1010        <target name="buildwebclient" depends="prepare">
    1111                <echo msg="Copying files to build directory"/>
    12                 <fileset dir="./webclient/root" id="filesWebroot">
     12                <fileset dir="./webclient" id="filesWebclient">
    1313                        <!-- <exclude name=""/> -->
    1414                </fileset>
    15                 <fileset dir="./webclient/css" id="filesCss"/>
    16                 <fileset dir="./webclient/javascript" id="filesJavascript"/>
    17                 <fileset dir="./webclient/resources" id="filesResources"/>
    1815                <fileset dir="../icon/" id="filesGnuboatIcons">
    1916                        <include name="gnuboat-256-256-transparent.png"/>
    … …  
    2118
    2219                <copy todir="${builddir}/webclient">
    23                         <fileset refid="filesWebroot"/>
    24                 </copy>
    25                 <copy todir="${builddir}/webclient/css">
    26                         <fileset refid="filesCss"/>
    27                 </copy>
    28                 <copy todir="${builddir}/webclient/javascript">
    29                         <fileset refid="filesJavascript"/>
     20                        <fileset refid="filesWebclient"/>
    3021                </copy>
    3122                <copy todir="${builddir}/webclient/resources">
    32                         <fileset refid="filesResources"/>
    3323                        <fileset refid="filesGnuboatIcons"/>
    3424                </copy>
  • src/webapp/webclient/css/main.css

    ra68d628 r018bce2  
    1616*/
    1717
    18 body {
     18/*body {
    1919        margin: 1em;
    2020        width: 14em;
    2121        border-color: 1px solid black;
    22 }
     22}*/
    2323
    2424.backgroundblue {
    … …  
    3232}
    3333
    34 #title {
     34/*#title {
    3535        text-align: center;
    3636        font-size: 34pt;
    … …  
    4747        padding-left: 0em;
    4848        margin-left: -0.3em;
     49}*/
     50
     51.l-box {
     52        padding: 1em;
    4953}
    5054
    5155#display {
    52         background-color: #E6E6E6;
    53         width: 100%;
     56        background-color: #BCD9D9;
    5457        height: 9em;
     58        min-width: 14em;
    5559        font-size: 12pt;
    5660        font-weight: normal;
    … …  
    5862        position:relative;
    5963        line-height: 1.5em;
     64        color: black;
    6065}
    6166
    … …  
    116121}
    117122
    118 form {
    119         width: 58.3mm;
    120 }
    121 
    122 form h2 {
    123         text-align: center;
    124         margin-top: 2em;
    125         margin-bottom: 0.5em;
    126         padding-top: 0.6em;
    127         height: 2em;
    128 }
    129 
    130 form p {
    131         height: 3em;
    132         margin: 0em;
    133 }
    134 
    135 form p input {
    136         border: 1px solid #ACDFAC;
    137         height: 3em;
    138         width: 100%;
    139         font-weight: normal;
    140         margin-top: 1em;
    141 }
    142 
    143 .formButtons {
    144         text-align: center;
    145         margin-top: 3em;
    146 }
    147 
    148 .button {
    149         border: 0;
    150         height: 3em;
    151         width: 100%;
    152         background-repeat: no-repeat;
    153         background-position: 0.5em 0.25em;
    154         background-size: auto 1.5em;
    155         text-align: left;
    156         padding-left: 2.5em;
    157         font-weight: bold;
    158 
    159 }
    160 
    161 #shutdown {
    162         width: 100%;
    163         margin-top: 3em;
    164 }
    165 
    166 #shutdown button {
     123.shutdown-button {
    167124        background-color: #8C1C00;
    168125        color: white;
    169126        font-weight: bold;
    170127        font-size: 24pt;
    171         width: 100%;
    172128        height: 3em;
    173129}
  • src/webapp/webclient/js/main.js

    ra68d628 r018bce2  
    121121}
    122122
     123function uploadMap(form)
     124{
     125        $.ajax({
     126                type: "POST",
     127                url: "../webservice/mapupload.php",
     128                data: $(form).serialize(),
     129                success: function(data){
     130                        if(("error" in data) && data["error"] == 1){
     131                                alert("Failed to upload map: "+ data["errormessage"]);
     132                                return;
     133                        }
     134                        alert("Map upload successfully");
     135                },
     136                error: function(jqXHR, exception, errorThrown){ alert("Failed to upload map: "+ exception); }
     137        });
     138}
     139
     140
    123141$(document).ready(function() {
    124142        displayDataGet();
    … …  
    127145        $.getJSON("../webservice/tileserver.php?/map.json", mapSetup);
    128146       
    129         $("#shutdownButton").click(shutdown);
     147        $("shutdown").click(shutdown);
     148       
     149        $("#mapTileUpload").validate({
     150                rules: {
     151                        mapFile: {
     152                                required: true
     153                        }
     154                },
     155                submitHandler: function(form){
     156                        uploadMap(form);
     157                }
     158        });
    130159});
  • src/webapp/webservice/mapupload.php

    ra68d628 r018bce2  
    2121
    2222$mapDirectory = __DIR__;
    23 if(!array_key_exists("map", $_FILES)){
     23if(!array_key_exists("mapFile", $_FILES)){
    2424        $result["status"] = false;
    2525        $result["message"] = "No map file recieved";
Note: See TracChangeset for help on using the changeset viewer.