Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍용민
/
BusTime
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
홍용민
2021-06-09 02:06:02 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8e2974e20ac48cb3a8fe74bed990ea753108a6f4
8e2974e2
1 parent
859043f4
남은 시간 예측 기능 model로 옮김
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
BusInfo.js
BusInfo.js
View file @
8e2974e
...
...
@@ -64,6 +64,7 @@ for(var i=0; i<routeID.length; i++){
const
GateBusUrl
=
bus_url
+
'?servicekey='
+
process
.
env
.
key
+
'&stationId='
+
gateStationID
;
//국제캠 정문 정류장
let
date
=
new
Date
();
let
predictTime
=
[
'-1'
,
'-1'
,
'-1'
,
'-1'
];
let
body
=
new
Object
();
function
predict
(){
console
.
log
(
GateBusUrl
);
...
...
@@ -95,6 +96,25 @@ function predict(){
Bus
[
index
][
"MaxPredictTime"
]
=
predictHour2
+
":"
+
predictMinute2
;
predictTime
=
[
predictHour1
+
""
,
predictMinute1
+
""
,
predictHour2
+
""
,
predictMinute2
+
""
]
const
dateBusDeparture
=
new
Date
(
date
.
getFullYear
(),
date
.
getMonth
(),
date
.
getDate
(),
predictTime
[
0
]
*
1
,
predictTime
[
1
]
*
1
,
0
);
var
gapSec
=
(
dateBusDeparture
.
getTime
()
-
date
.
getTime
())
/
1000
;
var
gapHour
=
Math
.
floor
(
gapSec
/
60
/
60
);
var
gapMin
=
Math
.
floor
((
gapSec
-
gapHour
*
3600
)
/
60
);
// var ans = gapHour + "시간" + gapMin + "분 이상";
// var ETD_min_H = predictTime[0];
// var ETD_min_M = predictTime[1];
// var ETD_max_H = predictTime[2];
// var ETD_max_M = predictTime[3];
body
.
remainTime
=
gapHour
+
"시간"
+
gapMin
+
"분 이상"
;
body
.
ETD_min_H
=
predictTime
[
0
];
body
.
ETD_min_M
=
predictTime
[
1
];
body
.
ETD_max_H
=
predictTime
[
2
];
body
.
ETD_max_M
=
predictTime
[
3
];
}
})
})
...
...
Please
register
or
login
to post a comment