Commit 5ab5736a authored by project's avatar project

--no commit message

--no commit message
parent be36b036
...@@ -25,7 +25,8 @@ exports.getValues = function(dataSet, cb){ ...@@ -25,7 +25,8 @@ exports.getValues = function(dataSet, cb){
if(parseInt(json.xhr.IO.Record) > 0){ if(parseInt(json.xhr.IO.Record) > 0){
if(parseInt(json.xhr.IO.Record) === 1){ if(parseInt(json.xhr.IO.Record) === 1){
getImage(json.xhr.IO.Data.Value).then((data) =>{ getImage(json.xhr.IO.Data.Value).then((data) =>{
values.push({"observeddatetime": json.xhr.IO.Data.IODateTime, "value": data}); dataTemplate.values.push({"observeddatetime": json.xhr.IO.Data.IODateTime, "value": data});
cb(dataTemplate);
}).catch((err) => { }).catch((err) => {
cb(err); cb(err);
}) })
...@@ -49,6 +50,7 @@ exports.getValues = function(dataSet, cb){ ...@@ -49,6 +50,7 @@ exports.getValues = function(dataSet, cb){
}, function(err) { }, function(err) {
if( err ) { if( err ) {
console.log(err); console.log(err);
cb(err);
} }
if(values.length > 0){ if(values.length > 0){
dataTemplate.values = values; dataTemplate.values = values;
......
...@@ -19,8 +19,8 @@ function perform_function(context,request,response){ ...@@ -19,8 +19,8 @@ function perform_function(context,request,response){
var dataKeySeries = Object.keys(di_data.data); var dataKeySeries = Object.keys(di_data.data);
// for (var i = 0; i < dataKeySeries.length; i++) { // for (var k = 0; k < dataKeySeries.length; k++) {
// console.log(di_data.data[dataKeySeries[i]]); // console.log(di_data.data[dataKeySeries[k]]);
// } // }
let i = 0; let i = 0;
async.whilst(function() { return i < dataKeySeries.length;}, function(cb) { async.whilst(function() { return i < dataKeySeries.length;}, function(cb) {
...@@ -41,7 +41,7 @@ function perform_function(context,request,response){ ...@@ -41,7 +41,7 @@ function perform_function(context,request,response){
let json = parser.toJson(vals[idx].value, {object: true}); let json = parser.toJson(vals[idx].value, {object: true});
//console.log('Type = ' + json.xhr.IO.Type); //console.log('Type = ' + json.xhr.IO.Type);
agriParser.getParser(json.xhr.IO.Type).getValues(vals[idx].value, function(values) { agriParser.getParser(json.xhr.IO.Type).getValues(vals[idx].value, function(values) {
//console.log('data = ' + vals[idx].value);
idx++; idx++;
if(values !== null){ if(values !== null){
result.latitude = json.xhr.IO.Latitude; result.latitude = json.xhr.IO.Latitude;
...@@ -57,6 +57,7 @@ function perform_function(context,request,response){ ...@@ -57,6 +57,7 @@ function perform_function(context,request,response){
}); });
} }
else callback(); else callback();
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment