mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
use epoch() instead of time()
This commit is contained in:
parent
cd289ffb1e
commit
812d10f374
@ -282,7 +282,7 @@ function comms_init(id, modem, local_port, server_port, reactor, iss)
|
||||
|
||||
-- keep alive ack
|
||||
local _send_keep_alive_ack = function (srv_time)
|
||||
_send(RPLC_TYPES.KEEP_ALIVE, { srv_time, os.time() })
|
||||
_send(RPLC_TYPES.KEEP_ALIVE, { srv_time, os.epoch() })
|
||||
end
|
||||
|
||||
-- general ack
|
||||
@ -368,7 +368,7 @@ function comms_init(id, modem, local_port, server_port, reactor, iss)
|
||||
if packet.type == RPLC_TYPES.KEEP_ALIVE then
|
||||
-- keep alive request received, echo back
|
||||
local timestamp = packet.data[1]
|
||||
local trip_time = os.time() - timestamp
|
||||
local trip_time = os.epoch() - timestamp
|
||||
|
||||
if trip_time < 0 then
|
||||
log._warning("PLC KEEP_ALIVE trip time less than 0 (" .. trip_time .. ")")
|
||||
@ -490,7 +490,7 @@ function comms_init(id, modem, local_port, server_port, reactor, iss)
|
||||
end
|
||||
|
||||
local sys_status = {
|
||||
os.time(),
|
||||
os.epoch(),
|
||||
(not self.scrammed),
|
||||
overridden,
|
||||
degraded,
|
||||
|
@ -9,7 +9,7 @@ SEVERITY = {
|
||||
|
||||
function scada_alarm(severity, device, message)
|
||||
local self = {
|
||||
time = os.time(),
|
||||
time = os.epoch(),
|
||||
ts_string = os.date("[%H:%M:%S]"),
|
||||
severity = severity,
|
||||
device = device,
|
||||
|
Loading…
Reference in New Issue
Block a user