최현영

Expressway travel time of ICtoIC function added

...@@ -1150,7 +1150,6 @@ function feelead(eventObj, msg){ ...@@ -1150,7 +1150,6 @@ function feelead(eventObj, msg){
1150 } 1150 }
1151 1151
1152 1152
1153 -
1154 function timelead(eventObj, msg){ 1153 function timelead(eventObj, msg){
1155 var isstart = false; 1154 var isstart = false;
1156 var isend = false; 1155 var isend = false;
...@@ -1163,13 +1162,14 @@ function timelead(eventObj, msg){ ...@@ -1163,13 +1162,14 @@ function timelead(eventObj, msg){
1163 console.log(inputoutputIC[1]); 1162 console.log(inputoutputIC[1]);
1164 var length = namedata.unitLists.length; 1163 var length = namedata.unitLists.length;
1165 for(var i = 0; i < length; i++){ 1164 for(var i = 0; i < length; i++){
1166 - if(namedata.unitName == inputoutputIC[0]){ 1165 + if(namedata.unitLists[i].unitName == inputoutputIC[0]){
1167 - start = namedata.unitCode; 1166 +
1167 + start = namedata.unitLists[i].unitCode;
1168 isstart = true; 1168 isstart = true;
1169 } 1169 }
1170 - if(namedata.unitName == inputoutputIC[1]){ 1170 + if(namedata.unitLists[i].unitName == inputoutputIC[1]){
1171 - end = namedata.unitCode; 1171 + end = namedata.unitLists[i].unitCode;
1172 - isend = false; 1172 + isend = true;
1173 } 1173 }
1174 } 1174 }
1175 1175
...@@ -1177,7 +1177,8 @@ function timelead(eventObj, msg){ ...@@ -1177,7 +1177,8 @@ function timelead(eventObj, msg){
1177 jsonICtoICtime(start, end, function(Object){ 1177 jsonICtoICtime(start, end, function(Object){
1178 var avgTime = new Array(); 1178 var avgTime = new Array();
1179 var ICtimejson = Object; 1179 var ICtimejson = Object;
1180 - var avgTime = ICtimejson.realUnitTrtmVO.timeAvg.split('.'); 1180 + console.log(ICtimejson);
1181 + var avgTime = ICtimejson.realUnitTrtmVO[0].timeAvg;
1181 if(ICtimejson.count > 0){ 1182 if(ICtimejson.count > 0){
1182 request.post( 1183 request.post(
1183 { 1184 {
...@@ -1190,7 +1191,7 @@ function timelead(eventObj, msg){ ...@@ -1190,7 +1191,7 @@ function timelead(eventObj, msg){
1190 "messages":[ 1191 "messages":[
1191 { 1192 {
1192 "type":"text", 1193 "type":"text",
1193 - "text":ICtimejson.realUnitTrtmVO[0].startUnitNm + "나들목에서 " + ICtimejson.realUnitTrtmVO[0].endUnitNm + "나들목까지 평균 소요시간은 " + avg 1194 + "text":ICtimejson.realUnitTrtmVO[0].startUnitNm + "나들목에서 " + ICtimejson.realUnitTrtmVO[0].endUnitNm + "나들목까지 평균 소요시간은 " + avgTime
1194 } 1195 }
1195 ] 1196 ]
1196 } 1197 }
......