Merge branch 'devel-en' into devel-zht

This commit is contained in:
dragonpilot
2019-11-04 16:44:24 +10:00
5 changed files with 33 additions and 1 deletions
Binary file not shown.
Binary file not shown.
+3
View File
@@ -119,6 +119,9 @@ keys = {
"DragonEnableAutonavi": [TxType.PERSISTENT],
"DragonBootAutonavi": [TxType.PERSISTENT],
"DragonRunAutonavi": [TxType.PERSISTENT],
"DragonEnableAegis": [TxType.PERSISTENT],
"DragonBootAegis": [TxType.PERSISTENT],
"DragonRunAegis": [TxType.PERSISTENT],
"DragonEnableMixplorer": [TxType.PERSISTENT],
"DragonRunMixplorer": [TxType.PERSISTENT],
"DragonSteeringMonitorTimer": [TxType.PERSISTENT],
+27 -1
View File
@@ -25,21 +25,30 @@ mixplorer_main = "com.mixplorer.activities.BrowseActivity"
gpsservice = "cn.dragonpilot.gpsservice"
gpsservice_main = "cn.dragonpilot.gpsservice.MainService"
# v2.9.5 build 74
aegis = "tw.com.ainvest.outpack"
aegis_main = "tw.com.ainvest.outpack.ui.MainActivity"
def main(gctx=None):
dragon_enable_tomtom = True if params.get('DragonEnableTomTom', encoding='utf8') == "1" else False
dragon_enable_autonavi = True if params.get('DragonEnableAutonavi', encoding='utf8') == "1" else False
dragon_enable_aegis = True if params.get('DragonEnableAegis', encoding='utf8') == "1" else False
dragon_enable_mixplorer = True if params.get('DragonEnableMixplorer', encoding='utf8') == "1" else False
dragon_boot_tomtom = True if params.get("DragonBootTomTom", encoding='utf8') == "1" else False
dragon_boot_autonavi = True if params.get("DragonBootAutonavi", encoding='utf8') == "1" else False
dragon_boot_aegis = True if params.get("DragonBootAegis", encoding='utf8') == "1" else False
dragon_greypanda_mode = True if params.get("DragonGreyPandaMode", encoding='utf8') == "1" else False
dragon_grepanda_mode_started = False
tomtom_is_running = False
autonavi_is_running = False
aegis_is_running = False
mixplorer_is_running = False
allow_auto_boot = True
manual_tomtom = False
manual_autonavi = False
manual_aegis = False
last_started = False
frame = 0
start_delay = None
@@ -48,16 +57,18 @@ def main(gctx=None):
put_nonblocking('DragonRunTomTom', '0')
put_nonblocking('DragonRunAutonavi', '0')
put_nonblocking('DragonRunMixplorer', '0')
put_nonblocking('DragonRunAegis', '0')
# we want to disable all app when boot
system("pm disable %s" % tomtom)
system("pm disable %s" % autonavi)
system("pm disable %s" % mixplorer)
system("pm disable %s" % gpsservice)
system("pm disable %s" % aegis)
thermal_sock = messaging.sub_sock(service_list['thermal'].port)
while dragon_enable_tomtom or dragon_enable_autonavi or dragon_enable_mixplorer or dragon_greypanda_mode:
while dragon_enable_tomtom or dragon_enable_autonavi or dragon_enable_aegis or dragon_enable_mixplorer or dragon_greypanda_mode:
# allow user to manually start/stop app
if dragon_enable_tomtom:
@@ -74,6 +85,13 @@ def main(gctx=None):
put_nonblocking('DragonRunAutonavi', '0')
manual_autonavi = status != "0"
if dragon_enable_aegis:
status = params.get('DragonRunAegis', encoding='utf8')
if not status == "0":
aegis_is_running = exec_app(status, aegis, aegis_main)
put_nonblocking('DragonRunAegis', '0')
manual_aegis = status != "0"
if dragon_enable_mixplorer:
status = params.get('DragonRunMixplorer', encoding='utf8')
if not status == "0":
@@ -83,6 +101,7 @@ def main(gctx=None):
# if manual control is set, we do not allow any of the auto actions
auto_tomtom = not manual_tomtom and dragon_enable_tomtom and dragon_boot_tomtom
auto_autonavi = not manual_autonavi and dragon_enable_autonavi and dragon_boot_autonavi
auto_aegis = not manual_aegis and dragon_enable_aegis and dragon_boot_aegis
msg = messaging.recv_sock(thermal_sock, wait=True)
started = msg.thermal.started
@@ -112,11 +131,15 @@ def main(gctx=None):
tomtom_is_running = exec_app('1', tomtom, tomtom_main)
if auto_autonavi and not autonavi_is_running and frame > start_delay:
autonavi_is_running = exec_app('1', autonavi, autonavi_main)
if auto_aegis and not aegis_is_running and frame > start_delay:
aegis_is_running = exec_app('1', aegis, aegis_main)
else:
if auto_tomtom and tomtom_is_running:
tomtom_is_running = exec_app('-1', tomtom, tomtom_main)
if auto_autonavi and autonavi_is_running:
autonavi_is_running = exec_app('-1', autonavi, autonavi_main)
if auto_aegis and aegis_is_running:
aegis_is_running = exec_app('-1', aegis, aegis_main)
# set allow_auto_boot to False once the thermal status is >= red
allow_auto_boot = False
@@ -137,11 +160,14 @@ def main(gctx=None):
tomtom_is_running = exec_app('-1', tomtom, tomtom_main)
if auto_autonavi and autonavi_is_running and frame > stop_delay:
autonavi_is_running = exec_app('-1', autonavi, autonavi_main)
if auto_aegis and aegis_is_running and frame > stop_delay:
aegis_is_running = exec_app('-1', aegis, aegis_main)
# if car state changed, we remove manual control state
if not last_started == started:
manual_tomtom = False
manual_autonavi = False
manual_aegis = False
last_started = started
frame += 3
@@ -29,6 +29,9 @@ default_conf = {
'DragonEnableAutonavi': '0',
'DragonBootAutonavi': '0',
'DragonRunAutonavi': '0',
'DragonEnableAegis': '0',
'DragonBootAegis': '0',
'DragonRunAegis': '0',
'DragonEnableMixplorer': '0',
'DragonRunMixplorer': '0',
'DragonSteeringMonitorTimer': '3',