disabled getLastHeartbeatToDeterminIdling
This commit is contained in:
@ -37,30 +37,30 @@ async function commitMessage(now, logDevice) {
|
||||
// if (logDevice.device_id == "0353742372637637")
|
||||
// console.log("vhc", vhc, lastTrack)
|
||||
|
||||
if (["heartbeat", "alarm"].includes(logDevice.action)) {
|
||||
if (logDevice.ignition == GpsTracksModels.STTS_IGNITION_HIGH) {
|
||||
if (logDevice.speed) {
|
||||
logDevice.stts_engine = GpsTracksModels.STTS_EN_MOVING
|
||||
} else {
|
||||
if (lastTrack.length > 0) {
|
||||
const checkLastHeartbeat =
|
||||
await GpsTracksModels.getLastHeartbeatToDeterminIdling(
|
||||
logDevice.device_id,
|
||||
lastTrack[0].crt,
|
||||
now,
|
||||
)
|
||||
if (checkLastHeartbeat.length >= 3) {
|
||||
logDevice.stts_engine =
|
||||
GpsTracksModels.STTS_EN_IDLING
|
||||
} else {
|
||||
logDevice.stts_engine = lastTrack[0].stts_engine
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logDevice.stts_engine = GpsTracksModels.STTS_EN_STOPING
|
||||
}
|
||||
}
|
||||
// if (["heartbeat", "alarm"].includes(logDevice.action)) {
|
||||
// if (logDevice.ignition == GpsTracksModels.STTS_IGNITION_HIGH) {
|
||||
// if (logDevice.speed) {
|
||||
// logDevice.stts_engine = GpsTracksModels.STTS_EN_MOVING
|
||||
// } else {
|
||||
// if (lastTrack.length > 0) {
|
||||
// const checkLastHeartbeat =
|
||||
// await GpsTracksModels.getLastHeartbeatToDeterminIdling(
|
||||
// logDevice.device_id,
|
||||
// lastTrack[0].crt,
|
||||
// now,
|
||||
// )
|
||||
// if (checkLastHeartbeat.length >= 3) {
|
||||
// logDevice.stts_engine =
|
||||
// GpsTracksModels.STTS_EN_IDLING
|
||||
// } else {
|
||||
// logDevice.stts_engine = lastTrack[0].stts_engine
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// logDevice.stts_engine = GpsTracksModels.STTS_EN_STOPING
|
||||
// }
|
||||
// }
|
||||
|
||||
if (["location"].includes(logDevice.action)) {
|
||||
// console.log(logDevice.device_id + " : 1")
|
||||
@ -97,20 +97,21 @@ async function commitMessage(now, logDevice) {
|
||||
logDevice.stts_engine = GpsTracksModels.STTS_EN_MOVING
|
||||
} else {
|
||||
if (lastTrack.length > 0) {
|
||||
const checkLastHeartbeat =
|
||||
await GpsTracksModels.getLastHeartbeatToDeterminIdling(
|
||||
logDevice.device_id,
|
||||
lastTrack[0].crt,
|
||||
now,
|
||||
)
|
||||
if (checkLastHeartbeat.length >= 3) {
|
||||
logDevice.stts_engine =
|
||||
GpsTracksModels.STTS_EN_IDLING
|
||||
} else {
|
||||
// const checkLastHeartbeat =
|
||||
// await GpsTracksModels.getLastHeartbeatToDeterminIdling(
|
||||
// logDevice.device_id,
|
||||
// lastTrack[0].crt,
|
||||
// now,
|
||||
// )
|
||||
// if (checkLastHeartbeat.length >= 3) {
|
||||
// logDevice.stts_engine =
|
||||
// GpsTracksModels.STTS_EN_IDLING
|
||||
// } else {
|
||||
// logDevice.stts_engine = lastTrack[0].stts_engine
|
||||
// }
|
||||
logDevice.stts_engine = lastTrack[0].stts_engine
|
||||
}
|
||||
}
|
||||
}
|
||||
// get stts_alarm, stts_charge, stts_acc, stts_volt, stts_switch
|
||||
} else {
|
||||
logDevice.stts_engine = GpsTracksModels.STTS_EN_STOPING
|
||||
|
||||
Reference in New Issue
Block a user