최현영

Expressway travel time of ICtoIC function added

......@@ -1150,7 +1150,6 @@ function feelead(eventObj, msg){
}
function timelead(eventObj, msg){
var isstart = false;
var isend = false;
......@@ -1163,13 +1162,14 @@ function timelead(eventObj, msg){
console.log(inputoutputIC[1]);
var length = namedata.unitLists.length;
for(var i = 0; i < length; i++){
if(namedata.unitName == inputoutputIC[0]){
start = namedata.unitCode;
if(namedata.unitLists[i].unitName == inputoutputIC[0]){
start = namedata.unitLists[i].unitCode;
isstart = true;
}
if(namedata.unitName == inputoutputIC[1]){
end = namedata.unitCode;
isend = false;
if(namedata.unitLists[i].unitName == inputoutputIC[1]){
end = namedata.unitLists[i].unitCode;
isend = true;
}
}
......@@ -1177,7 +1177,8 @@ function timelead(eventObj, msg){
jsonICtoICtime(start, end, function(Object){
var avgTime = new Array();
var ICtimejson = Object;
var avgTime = ICtimejson.realUnitTrtmVO.timeAvg.split('.');
console.log(ICtimejson);
var avgTime = ICtimejson.realUnitTrtmVO[0].timeAvg;
if(ICtimejson.count > 0){
request.post(
{
......@@ -1190,7 +1191,7 @@ function timelead(eventObj, msg){
"messages":[
{
"type":"text",
"text":ICtimejson.realUnitTrtmVO[0].startUnitNm + "나들목에서 " + ICtimejson.realUnitTrtmVO[0].endUnitNm + "나들목까지 평균 소요시간은 " + avg
"text":ICtimejson.realUnitTrtmVO[0].startUnitNm + "나들목에서 " + ICtimejson.realUnitTrtmVO[0].endUnitNm + "나들목까지 평균 소요시간은 " + avgTime
}
]
}
......