diff --git a/app.js b/app.js index dbf2eaf..d447f83 100644 --- a/app.js +++ b/app.js @@ -10,10 +10,10 @@ var cosmStreams = [53146, 34606, 43573]; var cosmFeeds = {53146 : ["GearboxRPM", "Windspeed", "Pitch"], 34606 : ["CCChannel1,Import1", "CCSensor1,Servers2", "CCSensor2,Office3"], - 43573 : ["Humidity0", "Air pressure2", "Thermo3"]}; + 43573 : ["Humidity1", "Air pressure2", "Thermo3"]}; var cosmClient = new cosm(cosmStreams, 'orKBBdLAKuKJU-RxqmZpZB6q0baSAKxBTVhKdjhUNkdyVT0g'); -var oscClient = new osc('chaosc', 7110); +var oscClient = new osc('localhost', 7110); function logErrors(err, req, res, next) { console.error(err.stack); diff --git a/views/index.jade b/views/index.jade index 59cbeff..d4fc317 100644 --- a/views/index.jade +++ b/views/index.jade @@ -9,7 +9,7 @@ block content div.row for nr in streams div.cell - div(id=nr, class="kasten") + div(id="stream-#{nr}", class="kasten") h3 -- table tr @@ -31,7 +31,7 @@ block content td(class="break") td(class="break") - div.mapbox(id="map#{nr}") -- + div.mapbox(id="map-#{nr}") -- script(type="text/javascript") //var streams; @@ -68,48 +68,47 @@ block content socket.on('gotstream', function(data) { console.log("gotstream " + data.id); - $("div#" + data.id + " h3").text(data.title); - $("div#" + data.id + " td.location").text(data.location); - $("div#" + data.id + " td.latitude").text(data.lat); - $("div#" + data.id + " td.longitude").text(data.lon); + $("div#stream-" + data.id + " h3").text(data.title); + $("div#stream-" + data.id + " td.location").text(data.location); + $("div#stream-" + data.id + " td.latitude").text(data.lat); + $("div#stream-" + data.id + " td.longitude").text(data.lon); var now = new Date(); - $("div#" + data.id + " td.update").text(now); - loadMap($('div#map' + data.id)[0], data.lat, data.lon); + $("div#stream-" + data.id + " td.update").text(now); + loadMap($('div#map-' + data.id)[0], data.lat, data.lon); }); function add_data(data) { - console.log("add_data"); + console.log("update_data"); console.dir(data); - var row = $('tr#' + data.feed).html(); + console.log('searching for "#feed-' + data.feed + '"') + var row = $('#stream-' + data.stream + '-feed-' + data.feed).html(); if (row === undefined) { - var tmp = '