update
This commit is contained in:
@ -472,9 +472,16 @@ class ListenController {
|
||||
let previousCrtD = 0
|
||||
for (const rec of records) {
|
||||
// console.log("rec ====> ", rec)
|
||||
const timestamp_device = rec.gnss.timestamp / 1000 - 25200
|
||||
// avoid duplicate timestamp
|
||||
if (previousCrtD == rec.gnss.timestamp) continue
|
||||
previousCrtD = rec.gnss.timestamp
|
||||
if (previousCrtD == timestamp_device) continue
|
||||
previousCrtD = timestamp_device
|
||||
|
||||
const isSleepMode = rec.io["Sleep Mode"] == 0 ? false : true
|
||||
if (isSleepMode) {
|
||||
// get previous log io
|
||||
// continue;
|
||||
}
|
||||
|
||||
const now = moment().unix()
|
||||
const logDevice = {
|
||||
@ -509,8 +516,8 @@ class ListenController {
|
||||
crt: now,
|
||||
crt_format: moment.unix(now).format("YYYY-MM-DD HH:mm:ss"),
|
||||
// minus 7 hours -- ngikutin data gt06 biar sinkron
|
||||
crt_d: rec.gnss.timestamp / 1000 - 25200,
|
||||
crt_d_format: moment.unix(rec.gnss.timestamp / 1000 - 25200).format("YYYY-MM-DD HH:mm:ss"),
|
||||
crt_d: timestamp_device,
|
||||
crt_d_format: moment.unix(timestamp_device).format("YYYY-MM-DD HH:mm:ss"),
|
||||
crt_s: now,
|
||||
crt_s_format: moment.unix(now).format("YYYY-MM-DD HH:mm:ss"),
|
||||
fuel_curr: rec.io["Fuel Level"] || 0,
|
||||
|
||||
Reference in New Issue
Block a user