/
transition.py
57 lines (52 loc) · 1.46 KB
/
transition.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
import logging
import emission.core.wrapper.wrapperbase as ecwb
import enum as enum
class State(enum.Enum):
START = 0
WAITING_FOR_TRIP_START = 1
ONGOING_TRIP = 2
TRACKING_STOPPED = 3
UNKNOWN = 3
class TransitionType(enum.Enum):
INITIALIZE = 0
EXITED_GEOFENCE = 1
STOPPED_MOVING = 2
STOP_TRACKING = 3
# android specific transitions
BOOTED = 4
TRACKING_ERROR = 18
# iOS specific transitions
INIT_COMPLETE = 5
TRIP_STARTED = 6
RECEIVED_SILENT_PUSH = 7
TRIP_END_DETECTED = 8
TRIP_RESTARTED = 9
END_TRIP_TRACKING = 10
TRACKING_STOPPED = 11
NOP = 12
VISIT_STARTED = 13
VISIT_ENDED = 14
NONE = 15
DATA_PUSHED = 16
# joint transition again
START_TRACKING = 17
class Transition(ecwb.WrapperBase):
props = {"curr_state": ecwb.WrapperBase.Access.RO,
"transition": ecwb.WrapperBase.Access.RO,
"ts": ecwb.WrapperBase.Access.RO,
"local_dt": ecwb.WrapperBase.Access.RO,
"fmt_time": ecwb.WrapperBase.Access.RO
}
enums = {"curr_state": State, "transition": TransitionType}
geojson = []
nullable = []
local_dates = ['local_dt']
def _populateDependencies(self):
pass