From 8a05ba2e292b13f78bc01bf52c53518f9c73f1d9 Mon Sep 17 00:00:00 2001 From: pangfan Date: Thu, 23 Mar 2023 20:00:20 +0800 Subject: [PATCH 01/23] =?UTF-8?q?[=E5=A4=A7=E7=90=86/=E7=83=9F=E5=8F=B0?= =?UTF-8?q?=E4=BA=A4=E4=BB=98]1.MiniBus-Driver=EF=BC=9Av3.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index db8144bdb9..b0d479bb7f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -93,8 +93,8 @@ WEBSOCKET_VERSION=1.1.7 applicationId=com.mogo.launcer applicationName=IntelligentPilot # RoboBus司机端:2.5.1;RoboTaxi司机端:2.5.1;RoboTaxi乘客端:1.0.0 -versionCode=1002000 -versionName=1.0.2 +versionCode=3000000 +versionName=3.0.0 ################# 新架构模块Maven版本管理 ################# MOGO_CORE_FUNCTION_HMI_VERSION=0.0.58.10 From 8acabc4f418c7cadbc777e89cbcc98599bcd4ee1 Mon Sep 17 00:00:00 2001 From: pangfan Date: Thu, 23 Mar 2023 20:02:13 +0800 Subject: [PATCH 02/23] =?UTF-8?q?[=E5=A4=A7=E7=90=86/=E7=83=9F=E5=8F=B0?= =?UTF-8?q?=E4=BA=A4=E4=BB=98]1.MiniBus-Passenger=EF=BC=9Av2.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index db8144bdb9..f8e20f3ee9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -93,8 +93,8 @@ WEBSOCKET_VERSION=1.1.7 applicationId=com.mogo.launcer applicationName=IntelligentPilot # RoboBus司机端:2.5.1;RoboTaxi司机端:2.5.1;RoboTaxi乘客端:1.0.0 -versionCode=1002000 -versionName=1.0.2 +versionCode=2000000 +versionName=2.0.0 ################# 新架构模块Maven版本管理 ################# MOGO_CORE_FUNCTION_HMI_VERSION=0.0.58.10 From 7358194afca5915e0273946c319640a26fddaa80 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Fri, 24 Mar 2023 13:02:35 +0800 Subject: [PATCH 03/23] =?UTF-8?q?[m1]=20[=E5=A2=9E=E5=A4=A7=E9=9D=A0?= =?UTF-8?q?=E8=BE=B9=E5=81=9C=E8=BD=A6=E7=9B=91=E5=90=AC=E8=8C=83=E5=9B=B4?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusPassengerFunctionDevicePresenter.kt | 4 +-- .../BusPassengerFunctionPresenter.kt | 31 +---------------- .../presenter/BusPassengerPresenter.kt | 33 ++++++++++++++++++- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerFunctionDevicePresenter.kt b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerFunctionDevicePresenter.kt index 384f7758d8..98ea80709d 100644 --- a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerFunctionDevicePresenter.kt +++ b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerFunctionDevicePresenter.kt @@ -61,7 +61,7 @@ class BusPassengerFunctionDevicePresenter(view: M1DeviceFragment?) : } CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(1) disposeSubscribe(subscribeDoorStatus) - subscribeDoorStatus = createSubscribe { + subscribeDoorStatus = createSubscribe(6000) { if (!OCHM1LightAirconditionDoorStatusManager.doorStatus.isOpen) { ToastUtils.showShort("车门无法开启,请使用车内物理按钮") } @@ -80,7 +80,7 @@ class BusPassengerFunctionDevicePresenter(view: M1DeviceFragment?) : } CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(2) disposeSubscribe(subscribeDoorStatus) - subscribeDoorStatus = createSubscribe { + subscribeDoorStatus = createSubscribe(6000) { if (OCHM1LightAirconditionDoorStatusManager.doorStatus.isOpen) { ToastUtils.showShort("车门无法关闭,请使用车内物理按钮") } diff --git a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerFunctionPresenter.kt b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerFunctionPresenter.kt index feb5069928..641a48e3cd 100644 --- a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerFunctionPresenter.kt +++ b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerFunctionPresenter.kt @@ -10,44 +10,15 @@ import com.mogo.och.common.module.manager.OCHPlanningStopSideStatusManager import com.mogo.och.common.module.voice.VoiceNotice class BusPassengerFunctionPresenter(view: M1ContainFragment?) : - BusBasePassengerFunctionDevicePresenter(view), - OCHPlanningStopSideStatusManager.OCHPlanningActionsCallback { + BusBasePassengerFunctionDevicePresenter(view) { companion object{ private const val TAG = "BusPassengerFunctionPresenter" } override fun onCreate(owner: LifecycleOwner) { super.onCreate(owner) - OCHPlanningStopSideStatusManager.addListener(TAG,this) } override fun onDestroy(owner: LifecycleOwner) { super.onDestroy(owner) - OCHPlanningStopSideStatusManager.removeListener(TAG) - } - - override fun onStartAutopilotFailure( - actionStatus: OCHPlanningStopSideStatusManager.Status, - stopSideStatus: Boolean?, - errorInfo: String? - ) { - UiThreadHandler.post { - when (actionStatus) { - OCHPlanningStopSideStatusManager.Status.NOSTART -> { - ToastUtils.showShort(errorInfo) - } - OCHPlanningStopSideStatusManager.Status.START -> { - VoiceNotice.showNotice(context.getString(R.string.m1_stop_site_zh), AIAssist.LEVEL1) - } - OCHPlanningStopSideStatusManager.Status.DOING -> { - // 正在靠边停车 - } - OCHPlanningStopSideStatusManager.Status.EndingSuccess -> { - ToastUtils.showShort("靠边停车成功") - } - OCHPlanningStopSideStatusManager.Status.EndingFaile -> { - ToastUtils.showShort("靠边停车失败") - } - } - } } } \ No newline at end of file diff --git a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerPresenter.kt b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerPresenter.kt index 66e15fcea8..683b36bbff 100644 --- a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerPresenter.kt +++ b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerPresenter.kt @@ -2,6 +2,7 @@ package com.mogo.och.bus.passenger.presenter import androidx.lifecycle.LifecycleOwner import com.amap.api.maps.model.LatLng +import com.mogo.commons.voice.AIAssist import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener @@ -27,16 +28,18 @@ import com.mogo.och.common.module.bean.dpmsg.DPMsgType import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager import com.mogo.och.common.module.biz.constant.OchCommonConst import com.mogo.och.common.module.manager.OCHM1LightAirconditionDoorStatusManager +import com.mogo.och.common.module.manager.OCHPlanningStopSideStatusManager import com.mogo.och.common.module.utils.DateTimeUtil import com.mogo.och.common.module.utils.NumberFormatUtil import com.mogo.och.common.module.utils.SoundPoolHelper +import com.mogo.och.common.module.voice.VoiceNotice import io.reactivex.disposables.Disposable import java.util.* class BusPassengerPresenter(view: MainFragment?) : BusBasePassengerFunctionDevicePresenter(view), IBusPassengerControllerStatusCallback, IDistanceTimeCallback, IOrderChangeCallback, - IOrderStatusChangeListener { + IOrderStatusChangeListener, OCHPlanningStopSideStatusManager.OCHPlanningActionsCallback { private var subscribe: Disposable? = null private var gnssSpeed = 0.0f @@ -49,6 +52,7 @@ class BusPassengerPresenter(view: MainFragment?) : CharterPassengerModel.setCarTypeChangeListener(this) CharterPassengerModel.setStatusChangeListener(TAG,this) CallerTelematicListenerManager.addListener(TAG, msgReceived) + OCHPlanningStopSideStatusManager.addListener(TAG,this) setCarChangeListener(R.raw.aiqinghao) //BusPassengerModel.setMoGoAutopilotPlanningListener(this) @@ -60,6 +64,7 @@ class BusPassengerPresenter(view: MainFragment?) : CharterPassengerModel.setiDistanceTimeCallback(null) CharterPassengerModel.setCarTypeChangeListener(null) CallerTelematicListenerManager.removeListener(TAG) + OCHPlanningStopSideStatusManager.removeListener(TAG) } private fun setSpeed(speed:Float){ UiThreadHandler.post { @@ -260,4 +265,30 @@ class BusPassengerPresenter(view: MainFragment?) : mView?.drawEndStation(latLng) } + override fun onStartAutopilotFailure( + actionStatus: OCHPlanningStopSideStatusManager.Status, + stopSideStatus: Boolean?, + errorInfo: String? + ) { + UiThreadHandler.post { + when (actionStatus) { + OCHPlanningStopSideStatusManager.Status.NOSTART -> { + ToastUtils.showShort(errorInfo) + } + OCHPlanningStopSideStatusManager.Status.START -> { + VoiceNotice.showNotice(context.getString(R.string.m1_stop_site_zh), AIAssist.LEVEL1) + } + OCHPlanningStopSideStatusManager.Status.DOING -> { + // 正在靠边停车 + } + OCHPlanningStopSideStatusManager.Status.EndingSuccess -> { + ToastUtils.showShort("靠边停车成功") + } + OCHPlanningStopSideStatusManager.Status.EndingFaile -> { + ToastUtils.showShort("靠边停车失败") + } + } + } + } + } \ No newline at end of file From 4a15d67afd95582964a2357eac691f4029ebc098 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Thu, 6 Apr 2023 17:19:54 +0800 Subject: [PATCH 04/23] =?UTF-8?q?[2.15.0][mogo-adas]=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=BD=A6=E8=BE=86=E8=BF=9B=E7=AB=99=E5=90=8E=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=87=BA=E7=AB=99=E9=97=AE=E9=A2=98=EF=BC=8C=E6=A1=A3=E8=BD=A6?= =?UTF-8?q?=E5=A4=84=E4=BA=8E=E8=BF=9B=E7=AB=99=E6=B5=81=E7=A8=8B=E6=97=B6?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=BF=98=E5=A4=84=E4=BA=8ESystemState.AUTO?= =?UTF-8?q?=5FPILOT=5FRUNNING=E7=8A=B6=E6=80=81=E6=89=80=E4=BB=A5=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=B0=86=E6=AD=A4=E9=99=90=E5=88=B6=E6=94=BE=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../high/common/autopilot/ability/AutopilotAbility250.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java index 0c459e56a6..ff336195ee 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java @@ -79,6 +79,7 @@ public class AutopilotAbility250 { } } else { SystemStatusInfo.SystemState systemState = statusInfo.getSysState(); + // 目前已知可以下发启动自驾命令的状态: SystemState.SYS_RUNNING、SystemState.PILOT_READY、SystemState.AUTO_PILOT_STARTING、SystemState.AUTO_PILOT_RUNNING if (systemState != SystemStatusInfo.SystemState.SYS_RUNNING && systemState != SystemStatusInfo.SystemState.PILOT_READY) { isAutopilotAbility = false; if (systemState == SystemStatusInfo.SystemState.SYS_STARTING) { @@ -88,11 +89,13 @@ public class AutopilotAbility250 { } else if (systemState == SystemStatusInfo.SystemState.SYS_FAULT) { unableAutopilotReason = "系统异常"; } else if (systemState == SystemStatusInfo.SystemState.AUTO_PILOT_STARTING) { - //如果第一次下发了启动自动驾驶,没起来或者存在干预 此时systemState是AUTO_PILOT_STARTING 需要二次下发启动自驾命令 所以需要排除此状态 + //TODO 如果第一次下发了启动自动驾驶,没起来或者存在干预 此时systemState是AUTO_PILOT_STARTING 需要二次下发启动自驾命令 所以需要排除此状态 isAutopilotAbility = true; //unableAutopilotReason = "正在开始自动驾驶"; } else if (systemState == SystemStatusInfo.SystemState.AUTO_PILOT_RUNNING) { - unableAutopilotReason = "自动驾驶运行中"; + //TODO 车辆进站属于未退自驾状态,此状态不进行限制,否则无法再次发下启动自驾命令 + isAutopilotAbility = true; +// unableAutopilotReason = "自动驾驶运行中"; } else if (systemState == SystemStatusInfo.SystemState.REMOTE_PILOT_STARTING) { unableAutopilotReason = "平行驾驶启动中"; } else if (systemState == SystemStatusInfo.SystemState.REMOTE_PILOT_RUNNING) { From 61329df94bba40c7e952bc6a87987f25f8d9cc06 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Thu, 6 Apr 2023 17:19:54 +0800 Subject: [PATCH 05/23] =?UTF-8?q?[2.15.0][mogo-adas]=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=BD=A6=E8=BE=86=E8=BF=9B=E7=AB=99=E5=90=8E=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=87=BA=E7=AB=99=E9=97=AE=E9=A2=98=EF=BC=8C=E6=A1=A3=E8=BD=A6?= =?UTF-8?q?=E5=A4=84=E4=BA=8E=E8=BF=9B=E7=AB=99=E6=B5=81=E7=A8=8B=E6=97=B6?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=BF=98=E5=A4=84=E4=BA=8ESystemState.AUTO?= =?UTF-8?q?=5FPILOT=5FRUNNING=E7=8A=B6=E6=80=81=E6=89=80=E4=BB=A5=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=B0=86=E6=AD=A4=E9=99=90=E5=88=B6=E6=94=BE=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../high/common/autopilot/ability/AutopilotAbility250.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java index 0c459e56a6..ff336195ee 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java @@ -79,6 +79,7 @@ public class AutopilotAbility250 { } } else { SystemStatusInfo.SystemState systemState = statusInfo.getSysState(); + // 目前已知可以下发启动自驾命令的状态: SystemState.SYS_RUNNING、SystemState.PILOT_READY、SystemState.AUTO_PILOT_STARTING、SystemState.AUTO_PILOT_RUNNING if (systemState != SystemStatusInfo.SystemState.SYS_RUNNING && systemState != SystemStatusInfo.SystemState.PILOT_READY) { isAutopilotAbility = false; if (systemState == SystemStatusInfo.SystemState.SYS_STARTING) { @@ -88,11 +89,13 @@ public class AutopilotAbility250 { } else if (systemState == SystemStatusInfo.SystemState.SYS_FAULT) { unableAutopilotReason = "系统异常"; } else if (systemState == SystemStatusInfo.SystemState.AUTO_PILOT_STARTING) { - //如果第一次下发了启动自动驾驶,没起来或者存在干预 此时systemState是AUTO_PILOT_STARTING 需要二次下发启动自驾命令 所以需要排除此状态 + //TODO 如果第一次下发了启动自动驾驶,没起来或者存在干预 此时systemState是AUTO_PILOT_STARTING 需要二次下发启动自驾命令 所以需要排除此状态 isAutopilotAbility = true; //unableAutopilotReason = "正在开始自动驾驶"; } else if (systemState == SystemStatusInfo.SystemState.AUTO_PILOT_RUNNING) { - unableAutopilotReason = "自动驾驶运行中"; + //TODO 车辆进站属于未退自驾状态,此状态不进行限制,否则无法再次发下启动自驾命令 + isAutopilotAbility = true; +// unableAutopilotReason = "自动驾驶运行中"; } else if (systemState == SystemStatusInfo.SystemState.REMOTE_PILOT_STARTING) { unableAutopilotReason = "平行驾驶启动中"; } else if (systemState == SystemStatusInfo.SystemState.REMOTE_PILOT_RUNNING) { From 1755396f72ab2c9856149c3131652858d4417e19 Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Wed, 29 Mar 2023 18:16:29 +0800 Subject: [PATCH 06/23] =?UTF-8?q?[mini=20bus]=20merge=20=E5=8F=B8=E6=9C=BA?= =?UTF-8?q?=E7=AB=AF=E4=BA=8C=E7=BB=B4=E7=A0=81=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/bus/constant/URLConst.kt | 12 - OCH/mogo-och-common-module/build.gradle | 2 + .../mogo/och/common/module/utils/QRUtils.kt | 117 ++++ .../common/module/wigets/BindQRCodeDialog.kt | 76 +++ .../common/module/wigets/OCHCommitDialog.kt | 7 - .../drawable-xhdpi/icon_qr_center_logo.png | Bin 0 -> 2254 bytes .../main/res/drawable/bind_driver_qr_bg.xml | 6 + .../main/res/layout/bind_driver_qr_view.xml | 55 ++ .../src/main/res/values/colors.xml | 3 + .../src/main/res/values/strings.xml | 5 +- .../mogo/och/bus/fragment/BusFragment.java | 557 ++++++++++++++++++ app/urlConfig.json | 27 +- .../function/hmi/ui/tools/BusOperationView.kt | 13 + .../icon_bind_driver_qrcode.png | Bin 0 -> 6481 bytes .../res/layout/view_och_bus_operation.xml | 10 + .../com/mogo/eagle/core/data/app/UrlConfig.kt | 4 +- .../eagle/core/data/temp/EventLogout.java | 1 + 17 files changed, 865 insertions(+), 30 deletions(-) create mode 100644 OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/QRUtils.kt create mode 100644 OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/BindQRCodeDialog.kt create mode 100644 OCH/mogo-och-common-module/src/main/res/drawable-xhdpi/icon_qr_center_logo.png create mode 100644 OCH/mogo-och-common-module/src/main/res/drawable/bind_driver_qr_bg.xml create mode 100644 OCH/mogo-och-common-module/src/main/res/layout/bind_driver_qr_view.xml create mode 100644 OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/fragment/BusFragment.java create mode 100755 core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_bind_driver_qrcode.png diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/constant/URLConst.kt b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/constant/URLConst.kt index dce7719222..e69de29bb2 100644 --- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/constant/URLConst.kt +++ b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/constant/URLConst.kt @@ -1,12 +0,0 @@ -package com.mogo.och.bus.constant - -import com.mogo.commons.debug.DebugConfig - -/** - * Created on 2021/12/6 - */ -class URLConst { - companion object { - - } -} \ No newline at end of file diff --git a/OCH/mogo-och-common-module/build.gradle b/OCH/mogo-och-common-module/build.gradle index 24b27d9db3..3de8cdf00a 100644 --- a/OCH/mogo-och-common-module/build.gradle +++ b/OCH/mogo-och-common-module/build.gradle @@ -57,6 +57,8 @@ dependencies { implementation rootProject.ext.dependencies.arouter kapt rootProject.ext.dependencies.aroutercompiler + implementation rootProject.ext.dependencies.litezxing + if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { api rootProject.ext.dependencies.mogoutils api rootProject.ext.dependencies.mogocommons diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/QRUtils.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/QRUtils.kt new file mode 100644 index 0000000000..c6c1b37c5a --- /dev/null +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/QRUtils.kt @@ -0,0 +1,117 @@ +package com.mogo.och.common.module.utils + +import android.graphics.Bitmap +import android.graphics.Canvas +import com.google.zxing.BarcodeFormat +import com.google.zxing.EncodeHintType +import com.google.zxing.common.BitMatrix +import com.google.zxing.qrcode.QRCodeWriter +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel +import java.util.* + + +/** + * isDeleteWhite 是否删除白边 + */ +fun createQRCode(address: String, width: Int, height: Int,isDeleteWhite: Boolean): Bitmap? { + val hints = Hashtable() + hints[EncodeHintType.CHARACTER_SET] = "utf-8" + hints[EncodeHintType.ERROR_CORRECTION] = ErrorCorrectionLevel.H + hints[EncodeHintType.MARGIN] = if (isDeleteWhite) 1 else 0 + var bitMatrix = QRCodeWriter().encode( + address, + BarcodeFormat.QR_CODE, width, height, hints + ) + + if (isDeleteWhite) { + //删除白边 + bitMatrix = deleteWhite(bitMatrix) + } + val widthNew = bitMatrix.width + val heightNew = bitMatrix.height + + val pixels = IntArray(widthNew * heightNew) + //下面这里按照二维码的算法,逐个生成二维码的图片, + //两个for循环是图片横列扫描的结果 + for (y in 0 until heightNew) { + for (x in 0 until widthNew) { + if (bitMatrix.get(x, y)) { + pixels[y * widthNew + x] = -0x1000000 + } else { + pixels[y * widthNew + x] = -0x1 + } + } + } + //生成二维码图片的格式,使用ARGB_8888 + var bitmap = Bitmap.createBitmap(widthNew, heightNew, Bitmap.Config.ARGB_8888) + bitmap.setPixels(pixels, 0, widthNew, 0, 0, widthNew, heightNew) + return bitmap +} + +/** + * 删除白色边框 + * + * @param matrix matrix + * @return BitMatrix + */ +private fun deleteWhite(matrix: BitMatrix): BitMatrix? { + val rec = matrix.enclosingRectangle + val resWidth = rec[2] + 1 + val resHeight = rec[3] + 1 + val resMatrix = BitMatrix(resWidth, resHeight) + resMatrix.clear() + for (i in 0 until resWidth) { + for (j in 0 until resHeight) { + if (matrix[i + rec[0], j + rec[1]]) resMatrix[i] = j + } + } + return resMatrix +} + +fun createQRCodeWithPicture(bmCenter: Bitmap,address: String, width: Int, height: Int,isDeleteWhite: Boolean): Bitmap?{ + var qrCode = createQRCode(address,width,height,isDeleteWhite) + //8,创建一个bitmap对象用于作为其图标 + qrCode?.let { + val resultBitmap = addLogo(it,bmCenter) + if (resultBitmap != null){ + return resultBitmap + } + } + return null +} + +/** + * 用于向创建的二维码中添加一个logo + * @param bmQr + * @param bmCenter + * @return + */ +fun addLogo(bmQr: Bitmap, bmCenter:Bitmap) :Bitmap?{ + if (bmQr == null) { + return null + } + if (bmCenter == null) { + return bmQr + } + + //获取图片的宽高 + val bmQrWidth = bmQr.width + val bmQrHeight = bmQr.height + val bmCenterWidth = bmCenter.width + val bmCenterHeight = bmCenter.height + + var bitmap = Bitmap.createBitmap(bmQrWidth, bmQrHeight, Bitmap.Config.ARGB_8888) + try { + var canvas = Canvas(bitmap) + canvas.drawBitmap(bmQr, 0f, 0f, null) + canvas.drawBitmap(bmCenter, ((bmQrWidth-bmCenterWidth)/2-bmCenterWidth/2).toFloat(), + ((bmQrHeight-bmCenterHeight)/2-bmCenterHeight/2).toFloat(), null) + + canvas.save() + canvas.restore() + } catch (e: Exception) { + bitmap = null + e.stackTrace + } + return bitmap +} \ No newline at end of file diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/BindQRCodeDialog.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/BindQRCodeDialog.kt new file mode 100644 index 0000000000..8648759758 --- /dev/null +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/BindQRCodeDialog.kt @@ -0,0 +1,76 @@ +package com.mogo.och.common.module.wigets + +import android.content.Context +import android.graphics.Bitmap +import androidx.appcompat.widget.AppCompatImageView +import androidx.appcompat.widget.AppCompatTextView +import androidx.lifecycle.LifecycleObserver +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog +import com.mogo.och.common.module.R + +/** + * 带有title, tip,confirm,cancel的dialog + */ +class BindQRCodeDialog: BaseFloatDialog, LifecycleObserver { + + private var qrBm : AppCompatImageView? = null + private var qrCancel: AppCompatTextView? = null + private var qrTitle: AppCompatTextView? = null + + private var clickListener: ClickListener? = null + + constructor(builder: Builder,context: Context) : super(context) { + qrTitle?.text = builder.titleStr + qrCancel?.text = builder.cancelStr + qrBm?.setImageBitmap(builder.qrBm) + } + + init{ + setContentView(R.layout.bind_driver_qr_view) + + setCanceledOnTouchOutside(true) + + qrTitle = findViewById(R.id.qr_title) + qrBm = findViewById(R.id.qr_bm) + qrCancel = findViewById(R.id.bind_qr_cancel) + + qrCancel?.setOnClickListener { + clickListener?.cancel() + dismiss() + } + } + + fun setClickListener(clickListener: ClickListener) { + this.clickListener = clickListener + } + + interface ClickListener{ + fun cancel() + } + + class Builder{ + var titleStr:String = "" + var cancelStr:String = "" + var qrBm: Bitmap? = null + + fun title(title: String) : Builder{ + this.titleStr = title + return this + } + + fun cancelStr(cancel: String) : Builder{ + this.cancelStr = cancel + return this + } + + fun qrBm(bm: Bitmap) : Builder{ + this.qrBm = bm + return this + } + + fun build(context: Context): BindQRCodeDialog? { + return BindQRCodeDialog(this,context) + } + } + +} \ No newline at end of file diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHCommitDialog.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHCommitDialog.kt index a9a27faf36..835c82411a 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHCommitDialog.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/OCHCommitDialog.kt @@ -49,13 +49,6 @@ class OCHCommitDialog: BaseFloatDialog, LifecycleObserver { this.clickListener = clickListener } - fun showUpgradeDialog(){ - if(isShowing){ - return - } - show() - } - interface ClickListener{ fun confirm() fun cancel() diff --git a/OCH/mogo-och-common-module/src/main/res/drawable-xhdpi/icon_qr_center_logo.png b/OCH/mogo-och-common-module/src/main/res/drawable-xhdpi/icon_qr_center_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..edce11b56bf8d844b3c2565c07e12cf63f5d9a0e GIT binary patch literal 2254 zcmV;<2r>7GP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91IG_Un1ONa40RR91H~;_u01a1YQvd)6I7vi7RA>d=TWM?+RTTb)LTOnG z7~0BWAyi~l0oi0x78OJar~!p2Cn zA27KYuXRo41y@bZ;q|D=sl29Xns$fR{}vHc4RQ*375Or`v?O)KhS;i6=_uKWSn>>V z9=WVZY>MsJ3J1zYqsXt4Pm{}=qz!3HhJN`I8yZADM6PI(HV2g(LK@e|3o06wLwnK( ztxSQ^U>)*WhsG+aNcvKzOhD3568T_dAyKp|eM<5IsdTkzU@wg{_A+FbXXgVyFv1-= z2V7v(3v#gzG^`cirg1>m`+#obHt~R_?2Wwz<2jdqyD@fVIZ9dRYLeh&2<#?zaI0)D z&$|YEv5&xx0LP^12q?ZDFuF7FVi(|^+7VO)(y85(APb#pIRYd&DPKcQajIl5yM7z^ zoUdZ(9^l$7yEL-r=<2{I=0Vf@Gxe$IyY4z_4kt*Ck5F<0xPWRiLsgxhHql#iz6btt ze1Fb${FF9kVmF^bVNhE?+J??M1USpC9R`rzlUTFCuITihpz`ok2(@$Ny1*u zR$(lkmEc6bBEd;}@*=0Ml{-(8zK^wPm3WZei>2T=xrtT5e*eLC4oh-n&}44FWbyH! zGn6OOi#J5i>cKbptOO@-axv#zWzol}z>mi~TNez1#UR6j^q%a!7?RN_P#peOLP4L! zKwcTImf+-O)y6JSKd(Oo%v$f?qf`3yN+NsfhlP;z77 zy9tql6VpT5F}s)qG;ipmA*!s{56B2mkYMU00DCEvaOx6cN3KdEAd}Q;#TcMj18-e7 zjVA2U%CUefBwi%*I4#FZ3%v!PaxiW7;XPS6mW%`vxFfh*5*v%T8bnFYJm}|44+UZq zGp$u>84^4^=(&f0hnspRMIi3d92oP6cZKw`o;s}sAQy3Wl8vg0%MCSBkt=u)bCvpGzg1g+5)RjQ5?4Fkg zhqm`@q|^!nIC*5hX{C0F!1x}(unuw@QACl_%?3bg{jhtdrC5eei$;NSloU2pUNn@p z51a;yxcO-v&*i=)uM9;7TQO2P-Yps>r9efon{6jXC}it0#COMq+Nbi zIcJOhOQV^BEErbe0t!j|`kxsqeYM9TkAK zb;{O$!4c@$t89htkNO=Bvy)5R72G75U%E-$%M<#$%K{PuV5(A!^Gd79ITi`Y3!z7R z)0GS$XN_-lQ8X5q+6=;KN)->Lk!5S)Oj;Dsbhxw3rPT1^FXK2=y>lttU>w*xJ}|sp z>^T-E40J5E6bh!aYUUB!R*N9~w#7@(swo3%SRMVwc_5W9Ci`2;io@haS=I_*=P>BE z@*L#uMaE**k}ptATLhaXI^6W8@S={G>2siGeWNz%BGqa$dyadMp@gZ4EdK>u*YXcQ zzg~*Ph!(U~6Paa9cWJGpco+ee99f8a&XHXMK8h{_+Xh0Hm{f_R)nLZae>*cYUfoFo zv~lPpbC3r?ngq6ma_>qt;`p6uo~yXR1Rdskfs?K*G%@}A`ONRZFEZvq&-|*w@K_tt zTD``h`IfcF>0ZWt_`xp`GY7+5ry3z;?Pf!Z?-x>35f55?UqACsx-!?qVsy(`WP%+u zPuQ4~d3>KJX7;^*67<}i!K&qY)e@iJkpX8=RIFD!hpFKH@rB5_F~Kx1E2tLD568>6 znoaOjy;}t>`E{VnCw{<5Q`1ZgCC!F-Fjz`YF5vyl;Is02ZXx1-Rr+5+A*(h)KhV&w$Jok!K_}>zZu0WMs5_#jn@I!aB15PuNm} zAZ25>o7_R3ebLPe1i3u0r7FzwRVApT#jzQgYt2Un_Lo6{_cfg=k^KlEXpknsZft zSYBF^x?-cuew6N*s@VZV^32Zh5Xbmx+>2KRIpg!3e8H+~GA|+jRv^cga + + + + \ No newline at end of file diff --git a/OCH/mogo-och-common-module/src/main/res/layout/bind_driver_qr_view.xml b/OCH/mogo-och-common-module/src/main/res/layout/bind_driver_qr_view.xml new file mode 100644 index 0000000000..4707e43487 --- /dev/null +++ b/OCH/mogo-och-common-module/src/main/res/layout/bind_driver_qr_view.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/mogo-och-common-module/src/main/res/values/colors.xml b/OCH/mogo-och-common-module/src/main/res/values/colors.xml index 8db55d8e50..f4d8555616 100644 --- a/OCH/mogo-och-common-module/src/main/res/values/colors.xml +++ b/OCH/mogo-och-common-module/src/main/res/values/colors.xml @@ -11,4 +11,7 @@ #4D000000 #3B4577 + + #66B8BFE8 + #3B4577 \ No newline at end of file diff --git a/OCH/mogo-och-common-module/src/main/res/values/strings.xml b/OCH/mogo-och-common-module/src/main/res/values/strings.xml index 94cc6ad34a..9ca9718279 100644 --- a/OCH/mogo-och-common-module/src/main/res/values/strings.xml +++ b/OCH/mogo-och-common-module/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - + 欢迎您登录 登录 @@ -30,4 +30,7 @@ 感谢您体验\'蘑菇车联\'自动驾驶小巴车,本次旅程已结束,我们下次乘车再见 Thank you for experiencing the self-driving minibus. See you next time 자율주행 버스를 체험해 주셔서 감사합니다. 다음에 또 뵙겠습니다 + + 取消 + 扫描二维码完成车辆绑定 \ No newline at end of file diff --git a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/fragment/BusFragment.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/fragment/BusFragment.java new file mode 100644 index 0000000000..65a4763f31 --- /dev/null +++ b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/fragment/BusFragment.java @@ -0,0 +1,557 @@ +package com.mogo.och.bus.fragment; + +import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS; +import android.content.Intent; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.os.Bundle; +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.constraintlayout.widget.Group; +import androidx.annotation.Nullable; + +import com.alibaba.android.arouter.launcher.ARouter; +import com.mogo.cloud.passport.MoGoAiCloudClientConfig; +import com.mogo.commons.AbsMogoApplication; +import com.mogo.eagle.core.data.config.FunctionBuildConfig; +import com.mogo.eagle.core.data.map.CenterLine; +import com.mogo.eagle.core.data.temp.EventLogout; +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant; +import com.mogo.eagle.core.utilcode.util.ToastUtils; +import com.mogo.map.marker.IMogoMarker; +import com.mogo.map.marker.MogoMarkerOptions; +import com.mogo.och.bus.R; +import com.mogo.och.bus.bean.BusStationBean; +import com.mogo.och.bus.constant.BusConst; +import com.mogo.och.bus.net.login.LoginBusImpl; +import com.mogo.och.bus.presenter.BusPresenter; +import com.mogo.och.bus.ui.BusStationCommonItem; +import com.mogo.och.bus.ui.BusSwitchLineActivity; +import com.mogo.och.bus.view.SlidePanelView; +import com.mogo.och.common.module.biz.constant.OchCommonConst; +import com.mogo.och.common.module.biz.provider.LoginService; +import com.mogo.och.common.module.utils.BlinkAnimationUtil; +import com.mogo.och.common.module.utils.OCHThreadPoolManager; +import com.mogo.och.common.module.utils.QRUtilsKt; +import com.mogo.och.common.module.wigets.BindQRCodeDialog; +import com.mogo.och.common.module.wigets.MarqueeTextView; +import com.mogo.och.common.module.wigets.OCHCommitDialog; + +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.util.List; +import java.util.Objects; + +import me.jessyan.autosize.utils.AutoSizeUtils; + + +/** + * 网约车小巴界面 + * + * @author tongchenfei + */ +public class BusFragment extends BaseBusTabFragment + implements SlidePanelView.OnSlidePanelMoveToEndListener, View.OnClickListener { + public static final String TAG = "BusFragment"; + + private TextView mSwitchLine; //切换路线 + private MarqueeTextView mLineName; + private TextView mTaskTime; + private Group groupStationsPanel; + private ConstraintLayout noDataView; + + private BusStationBean startStation = null; + private BusStationBean endStation = null; + private BusStationCommonItem firstStationItem; + private BusStationCommonItem secondStationItem; + private BusStationCommonItem thirdStationItem; + + private LoginService loginService; + + @Override + public String getTagName() { + return "BusFragment"; + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation(); + if(loginService!=null){ + loginService.registerFragment(this, getPresenter(),new LoginBusImpl()); + } + } + @Override + public void onDestroyView() { + super.onDestroyView(); + loginService.unRegisterFragment(); + loginService = null; + } + + @Override + protected void initViews() { + super.initViews(); + + mSwitchLine = findViewById(R.id.switch_line_btn); + mSwitchLine.setTag(0); + mLineName = findViewById(R.id.module_och_bus_line_name); + + firstStationItem = findViewById(R.id.bus_panel_first_station); + secondStationItem = findViewById(R.id.bus_panel_second_station); + thirdStationItem = findViewById(R.id.bus_panel_third_station); + mTaskTime = findViewById(R.id.bus_task_time_tv); + groupStationsPanel = findViewById(R.id.group_stations_panel); + noDataView = findViewById(R.id.no_line_data_view); + + CallerLogger.INSTANCE.d(M_BUS + TAG, "initView: " + CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()); + // 初始化的时候设置 UI 按钮状态 + showAutopilotBiz(); + + mSwitchLine.setOnClickListener(this); + + mLineName.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + showHideTestBar(); + return false; + } + }); + } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void changeOverview(EventLogout eventLogout){ + if (eventLogout.getMessgae() == EventLogout.LOGOUT_TYPE){ + CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event消息去登出"); + mPresenter.logout(); + }else if (eventLogout.getMessgae() == EventLogout.SHOW_QR_TYPE){ //显示二维码 + CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event qrcode"); + String qrUrl = String.format(FunctionBuildConfig.urlJson.getBindDriverQRUrl(), + MoGoAiCloudClientConfig.getInstance().getSn()); + Bitmap bmQr = QRUtilsKt.createQRCodeWithPicture( + BitmapFactory.decodeResource(getResources(), R.drawable.icon_qr_center_logo) + ,qrUrl, AutoSizeUtils.dp2px(getContext(),340f), + AutoSizeUtils.dp2px(getContext(),340f),true); + if (bmQr != null){ + BindQRCodeDialog.Builder builder = new BindQRCodeDialog.Builder(); + builder.title(getString(R.string.bind_driver_qr_title)) + .cancelStr(getString(R.string.qr_cancel)) + .qrBm(bmQr).build(getContext()).show(); + }else { + CallerLogger.INSTANCE.d(M_BUS + TAG,"bmQr = null "); + } + } + } + + @Override + protected void onArriveStation() { + mPresenter.onAutopilotArriveAtStation(null); + } + + @Override + protected void debugArrivedStation() { + mPresenter.onAutopilotArriveAtStation(null); + } + + @NonNull + @Override + protected BusPresenter createPresenter() { + return new BusPresenter(this); + } + + @Override + public void onResume() { + super.onResume(); + } + + public void hideStationsPanel(){ + groupStationsPanel.setVisibility(View.GONE); + noDataView.setVisibility(View.VISIBLE); + } + + public void showStationsPanel(){ + groupStationsPanel.setVisibility(View.VISIBLE); + noDataView.setVisibility(View.GONE); + } + + public void updateLineEmptyUI(){ + setArrivedClikable(false); + showOrHideSwitchLineBtn(true); + hideStationsPanel(); + hideSlidePanel(); + resetStationBlinkAnim(); + } + + private void resetStationBlinkAnim() { + BlinkAnimationUtil.clearAnimation(firstStationItem.getCircleImageView()); + BlinkAnimationUtil.clearAnimation(secondStationItem.getCircleImageView()); + BlinkAnimationUtil.clearAnimation(thirdStationItem.getCircleImageView()); + } + + public void updateBusTaskStatus(String lineName, String lineTime, + List stationList, + int arrivingOrArrivedIndex, + boolean isArrived){ + + if (getActivity() == null) { + return; + } + + getActivity().runOnUiThread(() -> { + if (stationList == null) { + // 获取小巴数据失败 + return; + } + + showStationsPanel(); + showOrHideSwitchLineBtn(false); + + mLineName.setText(lineName); + mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime); + // 渲染小巴路线数据 + updateBusStationStatus(stationList,arrivingOrArrivedIndex,isArrived); + }); + } + + private void updateBusStationStatus(List stationList, + int arrivingOrArrivedIndex, + boolean isArrived) { + + startStation = stationList.get(0); + endStation = stationList.get(stationList.size() - 1); + + if (arrivingOrArrivedIndex == stationList.size() - 1 && isArrived){ + //切换路线和结束路线按钮切换 + showSlidePanel("单程结束"); + + setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat() + , endStation.getLon(),R.raw.end_marker); + }else if (arrivingOrArrivedIndex == 0 && isArrived){ + + showSlidePanel("滑动出发"); + + setOrRemoveMapMaker(true, BusConst.BUS_START_MAP_MAKER, + startStation.getLat(), startStation.getLon(),R.raw.star_marker); + setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, + endStation.getLat(), endStation.getLon(),R.raw.end_marker); + }else{ + if (isArrived){ + // 重置滑动按钮文字 + showSlidePanel("滑动出发"); + } + + setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat() + , startStation.getLon(),R.raw.star_marker); + setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat() + , endStation.getLon(),R.raw.end_marker); + } + + if (stationList.size() > 2){ //只有两个站点 + updateMoreThanTwoStationsUI(stationList,arrivingOrArrivedIndex,isArrived); + }else { + updateTwoStationsUI(stationList,arrivingOrArrivedIndex,isArrived); + } + + updateBusTestBarInfo(); + } + + /** + * 有两个以上站点的路线 + * @param stationList + * @param arrivingOrArrivedIndex + * @param isArrived + */ + private void updateMoreThanTwoStationsUI(List stationList, + int arrivingOrArrivedIndex, + boolean isArrived) { + secondStationItem.setStationTag(""); + secondStationItem.showOrHideStationArrowBg(true); + thirdStationItem.setStationTag(""); + secondStationItem.setVisibility(View.VISIBLE); + thirdStationItem.showOrHideStationArrowBg(false); + + if (arrivingOrArrivedIndex == 0 || arrivingOrArrivedIndex -1 == 0 + || (arrivingOrArrivedIndex -2 == 0 && stationList.size() == 3)){ + firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start)); + }else { + firstStationItem.setStationTag(""); + } + + if (arrivingOrArrivedIndex + 1 == stationList.size() - 1 || arrivingOrArrivedIndex == stationList.size() - 1 + || (arrivingOrArrivedIndex == 0 && arrivingOrArrivedIndex + 2 == stationList.size() - 1)){ //确认是否显示 "终" + thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end)); + }else { + thirdStationItem.setStationTag(""); + } + + //圆点: 0:灰色 过站 1:绿色 到站或者即将到站 2:蓝色:未到站 + if (arrivingOrArrivedIndex == 0 && isArrived){ + firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected)); + secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color)); + thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color)); + + firstStationItem.setStationName(stationList.get(0).getName()); + secondStationItem.setStationName(stationList.get(1).getName()); + thirdStationItem.setStationName(stationList.get(2).getName()); + + firstStationItem.setStationPointBg(1); + secondStationItem.setStationPointBg(2); + thirdStationItem.setStationPointBg(2); + + firstStationItem.setStationArrowBg(2); + secondStationItem.setStationArrowBg(2); + + }else if (arrivingOrArrivedIndex == stationList.size() - 1){ + firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color)); + secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color)); + thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected)); + + firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -2).getName()); + secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName()); + thirdStationItem.setStationName(stationList.get(arrivingOrArrivedIndex).getName()); + + firstStationItem.setStationPointBg(0); + secondStationItem.setStationPointBg(0); + thirdStationItem.setStationPointBg(1); + + firstStationItem.setStationArrowBg(0); + if (isArrived){ + secondStationItem.setStationArrowBg(0); + }else { + secondStationItem.setStationArrowBg(1); + } + + }else { + firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color)); + secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected)); + thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color)); + + firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName()); + secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex).getName()); + thirdStationItem.setStationName(stationList.get(arrivingOrArrivedIndex + 1).getName()); + + firstStationItem.setStationPointBg(0); + secondStationItem.setStationPointBg(1); + thirdStationItem.setStationPointBg(2); + + secondStationItem.setStationArrowBg(2); + if (isArrived){ + firstStationItem.setStationArrowBg(0); + }else { + firstStationItem.setStationArrowBg(1); + } + } + + } + + /** + * 只有两个站点的路线 + * @param stationList + * @param arrivingOrArrivedIndex + * @param isArrived + */ + private void updateTwoStationsUI(List stationList, + int arrivingOrArrivedIndex, + boolean isArrived) { + + secondStationItem.setVisibility(View.GONE); + secondStationItem.showOrHideStationArrowBg(false); + thirdStationItem.showOrHideStationArrowBg(false); + + firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start)); + thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end)); + + firstStationItem.setStationName(stationList.get(0).getName()); + thirdStationItem.setStationName(stationList.get(1).getName()); + + //圆点: 0:灰色 过站 1:绿色 到站或者即将到站 2:蓝色:未到站 + if (arrivingOrArrivedIndex == 0 && isArrived){//到站 + firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected)); + thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color)); + firstStationItem.setStationPointBg(1); + firstStationItem.setStationArrowBg(2); + thirdStationItem.setStationPointBg(0); + + }else { + firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color)); + thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected)); + if (isArrived){ //到终点 + firstStationItem.setStationPointBg(0); + firstStationItem.setStationArrowBg(0); + thirdStationItem.setStationPointBg(1); + + }else { //到终点途中 + firstStationItem.setStationPointBg(0); + firstStationItem.setStationArrowBg(1); + thirdStationItem.setStationPointBg(1); + } + } + } + + private void showOrHideSwitchLineBtn(boolean isShow) { + if (isShow){//显示切换路线 + mSwitchLine.setTag(0); + mSwitchLine.setText(getResources().getString(R.string.bus_switch_line_btn)); + }else {//显示结束路线 + mSwitchLine.setTag(1); + mSwitchLine.setText(getResources().getString(R.string.bus_close_line_btn)); + } + } + + public void hideOchBus() { +// tvNotice.setVisibility(View.GONE); + } + + @Override + public int getStationPanelViewId() { + return R.layout.fragment_och_bus; + } + + @Override + public void restartAutopilot() { + if (!isAnimateRunning) { + mPresenter.restartAutopilot(); + } + } + + @Override + public SlidePanelView.OnSlidePanelMoveToEndListener getSlidePanelOnEndListener() { + return this; + } + + @Override + public void moveToEnd() { + // 开启自动驾驶到下一站 + if (isAnimateRunning){ + stopAutopilotAnimation(); + } + mPresenter.autoDriveToNextStation(); + } + + /** + * 设置自动驾驶可用状态 + */ + public void onAutopilotEnableChange(boolean isEnable) { + if (isEnable) { + showAutopilotBiz(); + } else { + hideAutopilotBiz(); + } + } + + public void clearBusStationsMarkers(){ + CallerLogger.INSTANCE.d(M_BUS + TAG,"clearBusStationsMarkers()"); + if (null != startStation) { + setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat() + , startStation.getLon(),R.raw.star_marker); + } + if (null != endStation) { + setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat() + , endStation.getLon(),R.raw.end_marker); + } + + //清除鹰眼右下角小地图轨迹 + CallerLogger.INSTANCE.d(SceneConstant.M_MAP, "clearBusStationsMarkers --------->"); + smallMapView.clearPolyline(); + } + + /** + * VR模式切换 + * + * @param isVRMode + */ + public void onVRModeChanged(boolean isVRMode) { + if (mRootView != null) { + mRootView.setVisibility(isVRMode ? View.VISIBLE : View.GONE); + } + } + + /** + * 绘制地图起点终点 + * + * @param isAdd + * @param uuid + */ + private void setOrRemoveMapMaker(boolean isAdd, String uuid, double lat, double longi,int resourceId) { + if (isAdd) { + Runnable setMapMarkerRunnable = () -> { + CallerLogger.INSTANCE.d(M_BUS + "setMapMaker= "+Thread.currentThread().getName(), + uuid + "=latitude=" + lat + ",longitude=" + longi); + + MogoMarkerOptions options = new MogoMarkerOptions() + .owner(BusConst.TYPE_MARKER_BUS_ORDER) + .anchor(0.5f, 0.5f) + .set3DMode(true) + .gps(true) + .controlAngle(true) + .icon3DRes(resourceId) + .latitude(lat) + .longitude(longi); + IMogoMarker marker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).addMarker(uuid, options); + CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo( + longi,lat,-1); + if (null != centerLine && marker != null) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空 + marker.setRotateAngle(centerLine.getAngle().floatValue()); + } + }; + + OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable); + + }else { + Runnable removeMapMarkerRunnable = () -> { + CallerLogger.INSTANCE.d(M_BUS + "RemoveMapMaker="+Thread.currentThread().getName(), + uuid+"=latitude="+lat+",longitude="+longi); + Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).removeMarkers(uuid); + }; + OCHThreadPoolManager.getsInstance().execute(removeMapMarkerRunnable); + } + } + + @Override + public void debugAutoPilotStatus(int status) { + mPresenter.debugAutoPilotStatus(status); + } + + @Override + public void onClick(View v) { + if (v.getId() == R.id.switch_line_btn) {//切换路线条件: 自动驾驶过程中,点击则toast提示:自动驾驶中,不可切换路线 + //本次行程未结束,不支持切换路线。点击则toast提示:当前行程未完成,不可切换路线 + if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() + == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) { + ToastUtils.showLong(getResources().getString(R.string.bus_switch_line_btn_warning1)); + return; + } + if ((int)mSwitchLine.getTag() == 0){//切换路线 + Intent intent = new Intent(getContext(), BusSwitchLineActivity.class); + startActivity(intent); + }else {//结束任务 + OCHCommitDialog.Builder builder = new OCHCommitDialog.Builder(); + OCHCommitDialog closeLineConfirmDialog = builder + .title(getString(R.string.bus_dialog_title)) + .tips(getString(R.string.bus_dialog_tips)) + .confirmStr(getString(R.string.bus_dialog_confirm)) + .cancelStr(getString(R.string.bus_dialog_cancel)) + .build(getContext()); + closeLineConfirmDialog.setClickListener(new OCHCommitDialog.ClickListener() { + @Override + public void confirm() { + mPresenter.abortTask(); + } + + @Override + public void cancel() { + closeLineConfirmDialog.dismiss(); + } + }); + closeLineConfirmDialog.show(); + } + } + } +} diff --git a/app/urlConfig.json b/app/urlConfig.json index f05fe5d46e..a767ba07c1 100644 --- a/app/urlConfig.json +++ b/app/urlConfig.json @@ -7,7 +7,8 @@ "socket_base_url": "", "socket_tech_url": "", "eagle_mis_url": "", - "eagle_dns_url": "" + "eagle_dns_url": "", + "bind_driver_qr_url": "" }, "online": { "och_url": "https://tech.zhidaohulian.com", @@ -16,7 +17,8 @@ "socket_base_url": "", "socket_tech_url": "", "eagle_mis_url": "", - "eagle_dns_url": "" + "eagle_dns_url": "", + "bind_driver_qr_url": "" }, "demo": { "och_url": "http://tech-dev.zhidaohulian.com", @@ -25,7 +27,8 @@ "socket_base_url": "", "socket_tech_url": "", "eagle_mis_url": "", - "eagle_dns_url": "" + "eagle_dns_url": "", + "bind_driver_qr_url": "" } }, "dali": { @@ -36,7 +39,8 @@ "socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/", "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/", "eagle_mis_url": "http://eagle-mis-a.zhidaozhixing.com/", - "eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/" + "eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/", + "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=asafety&sn=%1$s" }, "online": { "och_url": "https://och-driver-eh.zhidaozhixing.com:18182", @@ -45,7 +49,8 @@ "socket_base_url": "https://och-driver-eh.zhidaozhixing.com:18182/arch/push/", "socket_tech_url": "https://och-driver-eh.zhidaozhixing.com:18182/arch/", "eagle_mis_url": "https://och-hailing-eh.zhidaozhixing.com:18182/", - "eagle_dns_url": "https://och-hailing-eh.zhidaozhixing.com:18182/" + "eagle_dns_url": "https://och-hailing-eh.zhidaozhixing.com:18182/", + "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ehsafety&sn=%1$s" }, "demo": { "och_url": "https://och-a.zhidaozhixing.com", @@ -54,7 +59,8 @@ "socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/", "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/", "eagle_mis_url": "http://och-hailing-eh.zhidaozhixing.com:18181/", - "eagle_dns_url": "http://och-hailing-eh.zhidaozhixing.com:18181/" + "eagle_dns_url": "http://och-hailing-eh.zhidaozhixing.com:18181/", + "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ehsafety&sn=%1$s" } }, "yantai": { @@ -65,7 +71,8 @@ "socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/", "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/", "eagle_mis_url": "http://eagle-mis-a.zhidaozhixing.com/", - "eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/" + "eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/", + "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=asafety&sn=%1$s" }, "online": { "och_url": "https://och-driver-yt.zhidaozhixing.com", @@ -74,7 +81,8 @@ "socket_base_url": "https://och-driver-yt.zhidaozhixing.com/arch/push/", "socket_tech_url": "https://och-driver-yt.zhidaozhixing.com/arch/", "eagle_mis_url": "https://och-hailing-yt.zhidaozhixing.com/", - "eagle_dns_url": "https://och-hailing-yt.zhidaozhixing.com/" + "eagle_dns_url": "https://och-hailing-yt.zhidaozhixing.com/", + "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ytsafety&sn=%1$s" }, "demo": { "och_url": "https://och-a.zhidaozhixing.com", @@ -83,7 +91,8 @@ "socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/", "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/", "eagle_mis_url": "http://eagle-mis-a.zhidaozhixing.com/", - "eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/" + "eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/", + "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ytsafety&sn=%1$s" } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/BusOperationView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/BusOperationView.kt index ce6bab6d96..a77c2a1970 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/BusOperationView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/BusOperationView.kt @@ -31,14 +31,27 @@ class BusOperationView @JvmOverloads constructor( actvAccountPhone.text = phoneMask(SharedPrefs.getInstance(it).getString("och_account","")) } clickPersonalRightView() + clickQRBtn() } + private fun clickQRBtn() { + actvAccountQR.onClick { + EventBus.getDefault().post(EventLogout(EventLogout.SHOW_QR_TYPE)) + } + } + private fun initPersonalIcon() { if(AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){ ivGotoPersonalInfo.visibility = VISIBLE }else{ ivGotoPersonalInfo.visibility = GONE } + + if (AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) { + actvAccountQR.visibility = VISIBLE + }else{ + actvAccountQR.visibility = GONE + } } private fun clickPersonalRightView() { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_bind_driver_qrcode.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_bind_driver_qrcode.png new file mode 100755 index 0000000000000000000000000000000000000000..533c0a3caa200c508e4ffeb9b26fe5a3306f7d5d GIT binary patch literal 6481 zcmV-X8LsAuP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91RGW zDW=+3QVIr5o7$7snw(rtF6YvdbDJ5T-?P^9?zQ*XGkedOgS1K3nf0#Q|N5-|yVlz8 zyJyZq*+N=dTU!wOo0V@>zDD`#F7H+STR9z*afg(jX!)SZyOsZaVPRoS<#{Cl*>n<+ zw}|QIl;5Fz<)#IEYco74^FFEkQ2~4ZW=-7`paSwOQt*D|n>MTH+m!wR+5I~L_Q84W zp9@d{$?g1S%0Dx&;FlQPC*;p>3s{zg4bx0O+wJ`kNjb2gq?i8S^K$XFSkygwFItiWtYLxd_iIkbOn7}=mQX~5cK#|FHc9aY9s$ayf*UvD>T&BGOFbnrhWemk1IbNr4_;rN#yQBpfVz5}WA$kU zjQ4$3fcn#;-EAAued9Fat!ZH5RC1A|)O%-+v){#=xR)byZmv zm#uCm+Zgf!0`>J$9I!*Wq`lbcJsH%l~P&&{<+quwMhL9WoLDQ599}Ia&yIjxWgux=dYM#Yp84Brf(JRF`Y83zdmz<_yHfd2WzXUpfGSt~D`5}5qMc;!(^N7tq<<00@! zqhF=9x=?WP;+>`3{>B~Ume(u|&LHo;$5zT;fALf~d~(f`X}K7LIPvOgz3zcQeb%C? z?ndQ0i)-Og`@pVJZvO7=<$XV{N|%USM9cwZxNc=0u1RZFiE#Z?Km{bAK6Z4?U_O5e zI3U1^YKR@6x3!1D*UD!Oo-U6*y*dO6B*?<{O{8l8l-CwBQ$V52+DUYNO)nCN zOpNuIE;!&sk%&+|-PKaYY9I8D8+Z)_0~N?4FRDCK^9!n<5y0kmQFU5wWQl*Z0Va}` zplf!?9+8d`e4>BuL@8gOJI8vEMkwUxmo1{8fVTHKrg#MJk%uxhjqbrf=m=jA(fOo9VW5|q6bVLr6rnUfl z!7tWQZg*~&g|?BA?>$tJ_Mz5r!C#hZf zbz8nlG? zv?S{EdmUx@XepBwJ=>&<(IG;`V>xXS9felVY_UOAn5*aj)TVc^DGE0z=LU3AhIEc* zuo+suIyO2H7$(WHNSKsd&*TXVSjpCf9?9P>J?LceVlo?zCodi1iEhh?Of}F!avA!R zb!fxu{D3wkQP@kh4Ymv-X_vDB6d-YsJOC_z**Uajs0G%q0*|ULI$WEzJo&Zp8bpxt)J|{!M zSuf6U=Xrfq=_r?+x|2@{4QPC;hJV4l(Ul2g@&f2$yVZMr_)>LIt1_o(tAm@kZXHlr zSq+srR7edV9KtbjHV*niM*j+9>eEk6-DY!6$b^P+0AK5l)tq5& zu-10f5BQ`(cV8Ew+2E@c({A;0VE}cM;tIB5X+7=$5KgfvWX&W(AfYd3L+Xi`gm>gj zb1=u9x(2pSIMJi^l4XPxUC6eMrbkT~p&!qntG4?>;JRf%d9stJ3JBQA$3+~Cfq+^AjF9TR&^pHF?BYc?L#%J=&eQE10zC%Y?82MmJzGjy_6qHnu@J04r}b zZ3<8W6e~N;7-D1EhJu5S>j}PhdNu@U0n8liVdbI98RbOjq2v0zB_Z+24!7r{=p7Qe zm@%d3eL}i)!mk^WfZRT*OZFI40HrRy`f%KAj_t^-axGk!_598Fv~qqxqYK-cgHZ?& z9K;QX#*gUv==;8SvKkz%j^x$=xB+~9BBEP-$Iqz0(V+ssD1&GE)IIc_IK5Ur@Sq-M zDnak0u=Q3&2g{H3jmC-UQvw&A8N>eggADsP$g|YBF7pH0iL>IS)Za#LYi8YV*UCvn zz>8;XEmRW`g_ZOf#^%(>S=98v7h`eJCZ)1QeMbOS04ew=F^af@7-#j?CZ6UL+| z?^b=k9)J#VJDsB?2O}CyFPn*F0vK-n@Q{#q$?k>nhO4&KL%+J?rwKN3nL9!wGm3I6 zUaD8UzjW=6^7oJGg_<^zLe~Bvf)p07Kb-Ox9YoDU!cW>A=wwW>d zdq1*V?t0)vId-bbtS5sC3NlpF09R34s4kM9M~tSSODNWt2@7S1oVoqR<#NTo7NKG# zQsb+|&UxXB4%V>|y(d;w?36izRS;IINF06|9XRZCnEZ_=w$C9`>mw<&5P1T2km6C4AI0+Cd(jp_D(A2#G|aZ*#FPXemgV2TW+^0yIKxkQ&nETM9$?Oia|0445l! zwu?Z+x1PDtASc;fp=q4l#@q!QqwtOOZh1SxDkFvC20ju)ty()gWlewWF>k9<-=hx- zMCBNm8lP;3WmY*8(AXD4DYM~lC%NBcqg1i1&!YN|;*4)JGd@A`!{Q*jHy2dq56?>6j4!r_1^K1aRHS>ca@O1h&{&eVRikLrMd@qjoSmeuY7 zfuHsY#tIDTUIHvf7vJ_4OLgFlj67-^bCk7QdXVjeY?8#W!NA)mY)?wP`lDXa_o-Uc z_e`(P4QS79rRqo-FngMSNhEM+rlc>4sN$=JIAM}Ui=7PU3~B_XY@ph< z23WvEeI_L2(0N&D6M-G!g+2C#epWd@paG*PL~yS->nM(s`&-MOmjR=jbpt9{`M!|> zg%@`2T~}&>Y6GDX8ML9$TMzeR2kFaCuavv)KVFV%J*F#bI^sAf-1dXJ%Fn)Om+j^_ zcIU^Bl`lVeMkfb-{qpU5%FX%;CbXDo-#TCC1$KTwqof(H<|r8eMOA>1A&yE(&v%U+ zsSQv>_}d&!7RECHt3seo%xFz+&<&9Vn1Bk8&xryRU8fY8zkm0!^7sq&NquY?Oa1Oq>@?0BJ5#J^xgn zJyvuQEdWUNqc8!R$6}N_x^^GE^&v4}NftlKlg>C&g{s$RS5_-lHwpCB7cG`uI{dy6dJAZ}+_#|dQm(sPx3!|0 zS2k86*~mPtcVNf$a*+=yOieeF^W0NfwC>3ieoN1+wq0%_COoz@?8R-H>XkGVkyjrNM>(zn)vYtI2mm~Fd z<>s$ZYRA;i@e0uY;R~nAhyLxwa`?omeqn2&yz>WkmS218Zae?;*Y7H~zF}uMczC6p z)uv;aSR?)`_AQnxb#{#%JgJJQ^$r_-1BK|!&JVqBxAhF4=)XXK;{GUMOlFtaCS#YC2#_MMBRH*2(fL8qls{Y^(9h(mcYK-=Gn|NB)Ccwsu zM5Vsc-u=@iQLYGBCJ)-sd#sIz7kwEwKQdftcLYt*(A8&TZ6*OIf2DBWOePEQ(V@ks`7hvmTSN{4gE;#mL>ODH*P(^nm;71!0>142}dBDqc;pmGMi z>(j@)Bsj{Njw~U_ihPb(mZQ$}t7EI_7=ZF8A7=wPp$d=;s7g#DWj#8o;|C9iZM^$+ z0XU#-2(_Zp7~O8|6gkQ7+-tS9)d%gMkT!JnUDkU)cBK5z^V<0t4;iI8hCap^ro&^@ zfp$D4XvTYIwhnOBRw%Upa_Z* z-0~+CRlZBl6fe^6wv%!jjyWuk?GJ#Ns1-QXCpGg0F!O7SuO;r&H&d82^zD_N?KB!K zBKc^0m0sjsrt>G?gQ}B(Y^-dFX3KT@)NB)&^T~ld`XdCds$a!1uwse75i>_=Ko8DA zIFLjMe(_1?8UcF4tG5rJ+Hg^0@F>%+BJ777i4gVswrvCgny9>N_o9wN%ihS?%=|1s z`fk5zcez~P@k_Ip>9GE;A71uH*-Q2O^(SAqvs~ie`Q*GQdHgs7Bl7EHxZ1{8YY*sK z6K{L%j&kjlOZExh;%Bvb?(0F`dcH;EpIeUwGpbRe-I!wz@8A9AvwbDztNLB@uRg~w z@Yj!T$g>MvQcut{XXsC$)*(GdRb_|3;)`3CcMqv?FzK+~w0`Nyv*nu0mddMiT#9{^ z-;fPodHSr6R~UeNj|({c)TBPd5s6IJbysdH*Xe=D*fR!AUM3Nm0Nj}oX?=Oa+<(Ny zyDUb@n4BMT>UmiQ?|Nq!OoK&K(ROgux+mOurznH#R`h7Z6hhfJh2Rv|UdrnbX>)a^4=(M zFMX4=krTjZ2UPk}pR@(toe41|<+*=MkP(6UaTQbl5_k+A9KZ>(`9_i3k0TQ+dZ*mi zUF={JPJJvlI@5GKsYb5Lre~~AglP|GOw%Pg1B`yv$84a3zFJJXenQdt&J2vv3D9da zF!c|zHapB0BPo*u+|Z5&m7(vthH4L1>SLvJq&+b8GMfj{krLXz-t(r8++-pn_2^3p z{TNUYpeKl`j{QN_bLa%>Eh4%{Ior;_J`Gd`V|dEGZ#_!}p(d`aF$X%!`u?7;*Jm-k zfsJsWiM&SB%S=5btYh^iYogF0amJqv4ue4D&#kZfN3AFA9*mBF3t0A!tta+E>7Ue< zIao*Ue1FtB%mQ^&e|CKm$iD_%r`(MKK&&oIcmzoFX^>I^xMrd0G_`A(-SH3d+FOia`MxRpt$UG4_>GOF38X*D} r{%_a+LhZP0=k-tWLDjeXU#R^barlDskUz6Q00000NkvXXu0mjf1O9nm literal 0 HcmV?d00001 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_och_bus_operation.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_och_bus_operation.xml index 7e19003a4d..af4a39dc8e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_och_bus_operation.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_och_bus_operation.xml @@ -60,6 +60,16 @@ android:textColor="@android:color/white" android:layout_width="wrap_content" android:layout_height="wrap_content"/> + + Date: Wed, 29 Mar 2023 20:35:15 +0800 Subject: [PATCH 07/23] =?UTF-8?q?[3.0.0]=20=E5=8F=B8=E6=9C=BA=E7=AB=AF?= =?UTF-8?q?=E9=9F=A9=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/bus/bean/BusStationBean.java | 5 ++++ .../com/mogo/och/bus/model/OrderModel.java | 24 ++++++++++++------- .../com/mogo/och/bus/bean/BusStationBean.java | 5 ++++ .../com/mogo/och/bus/model/OrderModel.java | 24 ++++++++++++------- 4 files changed, 42 insertions(+), 16 deletions(-) diff --git a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/bean/BusStationBean.java b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/bean/BusStationBean.java index 33afb10366..43cfd8c9d9 100644 --- a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/bean/BusStationBean.java +++ b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/bean/BusStationBean.java @@ -8,6 +8,7 @@ package com.mogo.och.bus.bean; public class BusStationBean { private int siteId; private String name; + private String nameKr; private int seq; private double gcjLon; //高德 private double gcjLat; //高德 @@ -21,6 +22,10 @@ public class BusStationBean { private int status; private int ifStop = 1; // 是否需要停靠、1需要、0不需要 // TODO: 2021/10/19 原来站点里有设计是否需要停靠字段,现设计暂无,默认都需要停靠 + public String getNameKr() { + return nameKr; + } + public double getGcjLon() { return gcjLon; } diff --git a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java index fedea9b825..dba8586d78 100644 --- a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java +++ b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java @@ -581,11 +581,12 @@ public class OrderModel { * 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站, * 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染 */ - private void leaveStationSuccess(int leaveIndex, String leaveStation, String nextStation) { + private void leaveStationSuccess(int leaveIndex, String leaveStation, + String nextStation, String nextStationKr) { onStartAutopilot(leaveIndex); - leaveTTSTips(nextStation); + leaveTTSTips(nextStation,nextStationKr); if (busRoutesResult != null) { boolean isLastStop = false; @@ -657,6 +658,7 @@ public class OrderModel { } int arrivedStationIndex = backgroundCurrentStationIndex + 1; String arriveStation = stationList.get(arrivedStationIndex).getName(); + String arriveStationKr = stationList.get(arrivedStationIndex).getNameKr(); String departureStopName = stationList.get(backgroundCurrentStationIndex).getName(); CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex); @@ -672,7 +674,8 @@ public class OrderModel { queryBusRoutes(); isArrivedStation = true; isGoingToNextStation = false; - arriveStationSuccess(arrivedStationIndex, departureStopName, arriveStation); + arriveStationSuccess(arrivedStationIndex, departureStopName, + arriveStation,arriveStationKr); } //5s轮询核销乘客 // startOrStopQueryPassengerWriteOff(true); @@ -701,7 +704,8 @@ public class OrderModel { }); } - private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, String arriveStation) { + private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, + String arriveStation, String arriveStationKr) { if (busRoutesResult != null) { boolean isLastStop = false; if (arrivedStationIndex == busRoutesResult.getSites().size() - 1) { @@ -714,7 +718,7 @@ public class OrderModel { , arriveStation , isLastStop); } - VoiceManager.INSTANCE.arrivedStation(arriveStation); + VoiceManager.INSTANCE.arrivedStation(arriveStation,arriveStationKr); } /** @@ -723,11 +727,14 @@ public class OrderModel { public void leaveStation() { CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex); String nextStationName = ""; + String nextStationNameKr = ""; if (backgroundCurrentStationIndex < stationList.size() - 1) { nextStationName = stationList.get(backgroundCurrentStationIndex + 1).getName(); + nextStationNameKr = stationList.get(backgroundCurrentStationIndex + 1).getNameKr(); } final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName(); String finalNextStationName = nextStationName; + String finalNextStationNameKr = nextStationNameKr; OrderServiceManager.leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq(), stationList.get(backgroundCurrentStationIndex).getSiteId(), @@ -740,7 +747,8 @@ public class OrderModel { //需要更改当前站和下一站的状态 然后渲染 //startOrStopQueryPassengerWriteOff(false); queryBusRoutes(); - leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, finalNextStationName); + leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, + finalNextStationName,finalNextStationNameKr); } @@ -765,12 +773,12 @@ public class OrderModel { } //车站10s后播报 - private void leaveTTSTips(String nextStation) { + private void leaveTTSTips(String nextStation,String nextStationKr) { UiThreadHandler.postDelayed(new Runnable() { @Override public void run() { - VoiceManager.INSTANCE.leaveStation(nextStation); + VoiceManager.INSTANCE.leaveStation(nextStation,nextStationKr); } },DELAY_10S); } diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusStationBean.java b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusStationBean.java index 304e99b5c3..02087308ad 100644 --- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusStationBean.java +++ b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusStationBean.java @@ -8,6 +8,7 @@ package com.mogo.och.bus.bean; public class BusStationBean { private int siteId; private String name; + private String nameKr; private int seq; private double gcjLon; //高德 private double gcjLat; //高德 @@ -16,6 +17,10 @@ public class BusStationBean { private int drivingStatus;//行驶信息,0初始值;1已经过;2当前站;3未到站 private boolean leaving; + public String getNameKr() { + return nameKr; + } + public int getSiteId() { return siteId; } diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java index bc2f8186b1..6cede59cae 100644 --- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java +++ b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java @@ -568,11 +568,12 @@ public class OrderModel { * 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站, * 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染 */ - private void leaveStationSuccess(int leaveIndex, String leaveStation, String nextStation) { + private void leaveStationSuccess(int leaveIndex, String leaveStation, + String nextStation,String nextStationKr) { onStartAutopilot(leaveIndex); - leaveTTSTips(nextStation); + leaveTTSTips(nextStation,nextStationKr); sendStartStationToClient(nextStation); @@ -646,6 +647,7 @@ public class OrderModel { } int arrivedStationIndex = backgroundCurrentStationIndex + 1; String arriveStation = stationList.get(arrivedStationIndex).getName(); + String arriveStationKr = stationList.get(arrivedStationIndex).getNameKr(); String departureStopName = stationList.get(backgroundCurrentStationIndex).getName(); CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex); @@ -661,7 +663,8 @@ public class OrderModel { queryBusRoutes(); isArrivedStation = true; isGoingToNextStation = false; - arriveStationSuccess(arrivedStationIndex, departureStopName, arriveStation); + arriveStationSuccess(arrivedStationIndex, departureStopName, + arriveStation,arriveStationKr); } //5s轮询核销乘客 // startOrStopQueryPassengerWriteOff(true); @@ -690,7 +693,8 @@ public class OrderModel { }); } - private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, String arriveStation) { + private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, + String arriveStation,String arriveStationKr) { if (busRoutesResult != null) { boolean isLastStop = false; if (arrivedStationIndex == busRoutesResult.getSites().size() - 1) { @@ -704,7 +708,7 @@ public class OrderModel { , isLastStop); } - VoiceManager.INSTANCE.arrivedStation(arriveStation); + VoiceManager.INSTANCE.arrivedStation(arriveStation,arriveStationKr); sendArrivedStationToClient(arriveStation); } @@ -748,11 +752,14 @@ public class OrderModel { public void leaveStation() { CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex); String nextStationName = ""; + String nextStationNameKr = ""; if (backgroundCurrentStationIndex < stationList.size() - 1) { nextStationName = stationList.get(backgroundCurrentStationIndex + 1).getName(); + nextStationNameKr = stationList.get(backgroundCurrentStationIndex + 1).getNameKr(); } final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName(); String finalNextStationName = nextStationName; + String finalNextStationNameKr = nextStationNameKr; OrderServiceManager.leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq(), stationList.get(backgroundCurrentStationIndex).getSiteId(), @@ -765,7 +772,8 @@ public class OrderModel { //需要更改当前站和下一站的状态 然后渲染 //startOrStopQueryPassengerWriteOff(false); queryBusRoutes(); - leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, finalNextStationName); + leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, + finalNextStationName,finalNextStationNameKr); } @@ -790,11 +798,11 @@ public class OrderModel { } //车站10s后播报 - private void leaveTTSTips(String nextStation) { + private void leaveTTSTips(String nextStation,String nextStationKr) { UiThreadHandler.postDelayed(new Runnable() { @Override public void run() {//延迟10s播报 - VoiceManager.INSTANCE.leaveStation(nextStation); + VoiceManager.INSTANCE.leaveStation(nextStation,nextStationKr); } },DELAY_10S); From 5a15eb21eb2ebab3750c60dfc17eff769ee9dc5b Mon Sep 17 00:00:00 2001 From: yangyakun Date: Thu, 30 Mar 2023 14:37:00 +0800 Subject: [PATCH 08/23] =?UTF-8?q?[3.0.0]=20[=E9=9F=A9=E8=AF=ADnull?= =?UTF-8?q?=E3=80=81=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99=E7=9A=84=E7=AB=99?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Conflicts: # OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/voice/VoiceManager.kt --- .../och/common/module/voice/VoiceManager.kt | 90 +++++++++++-------- .../src/main/res/values/strings.xml | 2 +- 2 files changed, 54 insertions(+), 38 deletions(-) diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/voice/VoiceManager.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/voice/VoiceManager.kt index 69675d2061..6566ebb133 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/voice/VoiceManager.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/voice/VoiceManager.kt @@ -10,50 +10,66 @@ import java.util.ArrayList object VoiceManager { - fun arrivedStation(siteName: String) { - arrivedStation(siteName,null) + fun arrivedStation(siteNameCN: String?) { + arrivedStation(siteNameCN,"") } - fun arrivedStation(siteName: String,callBack: IMogoTTSCallback?=null) { + fun arrivedStation(siteNameCN: String?,siteNameKR: String?) { + arrivedStation(siteNameCN,siteNameKR,null) + } + + fun arrivedStation(siteNameCN: String?, siteNameKR: String?,callBack: IMogoTTSCallback?=null) { val contenxt = AbsMogoApplication.getApp() val list: MutableList = ArrayList() - val chineseTTS = LangTtsEntity( - contenxt.getString(R.string.arrived_station_zh, siteName), - LanguageType.CHINESE - ) - val engTTS = LangTtsEntity( - contenxt.getString(R.string.arrived_station_en, siteName), - LanguageType.CHINESE - ) - val koreanTTS = LangTtsEntity( - contenxt.getString(R.string.arrived_station_ko, siteName), - LanguageType.KOREAN - ) - list.add(chineseTTS) - list.add(engTTS) - list.add(koreanTTS) + siteNameCN?.let { + val chineseTTS = LangTtsEntity( + contenxt.getString(R.string.arrived_station_zh, it), + LanguageType.CHINESE + ) + val engTTS = LangTtsEntity( + contenxt.getString(R.string.arrived_station_en, it), + LanguageType.CHINESE + ) + val koreanTTS = LangTtsEntity( + contenxt.getString(R.string.arrived_station_ko, siteNameKR?:it), + LanguageType.KOREAN + ) + list.add(chineseTTS) + list.add(engTTS) + list.add(koreanTTS) + } + VoiceNotice.showNotice(list, AIAssist.LEVEL1,callBack) } - fun leaveStation(siteName: String){ - leaveStation(siteName,null) + + fun leaveStation(siteNameCN: String?){ + leaveStation(siteNameCN,"") } - fun leaveStation(siteName: String,callBack: IMogoTTSCallback?=null) { - val contenxt = AbsMogoApplication.getApp() + + fun leaveStation(siteNameCN: String?,siteNameKR: String?){ + leaveStation(siteNameCN,siteNameKR,null) + } + + fun leaveStation(siteNameCN: String?, siteNameKR: String?,callBack: IMogoTTSCallback?=null) { val list: MutableList = ArrayList() - val chineseTTS = LangTtsEntity( - contenxt.getString(R.string.leave_station_zh, siteName), - LanguageType.CHINESE - ) - val engTTS = LangTtsEntity( - contenxt.getString(R.string.leave_station_en, siteName), - LanguageType.CHINESE - ) - val koreanTTS = LangTtsEntity( - contenxt.getString(R.string.leave_station_ko, siteName), - LanguageType.KOREAN - ) - list.add(chineseTTS) - list.add(engTTS) - list.add(koreanTTS) + val contenxt = AbsMogoApplication.getApp() + siteNameCN?.let { + val chineseTTS = LangTtsEntity( + contenxt.getString(R.string.leave_station_zh, it), + LanguageType.CHINESE + ) + val engTTS = LangTtsEntity( + contenxt.getString(R.string.leave_station_en, it), + LanguageType.CHINESE + ) + list.add(chineseTTS) + list.add(engTTS) + + val koreanTTS = LangTtsEntity( + contenxt.getString(R.string.leave_station_ko, siteNameKR ?: it), + LanguageType.KOREAN + ) + list.add(koreanTTS) + } VoiceNotice.showNotice(list, AIAssist.LEVEL1,callBack) } diff --git a/OCH/mogo-och-common-module/src/main/res/values/strings.xml b/OCH/mogo-och-common-module/src/main/res/values/strings.xml index 9ca9718279..a018b9286c 100644 --- a/OCH/mogo-och-common-module/src/main/res/values/strings.xml +++ b/OCH/mogo-och-common-module/src/main/res/values/strings.xml @@ -17,7 +17,7 @@ We are arriving at %1$s %1$s 역에 도착했습니다 - 已到达%1$s站 + 已到达%1$s 车辆起步,请扶稳坐好,前方到站 %1$s The next station is %1$s From 6dab66de8487deb428bf6f9639d14fd4e40395c5 Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Fri, 7 Apr 2023 14:01:20 +0800 Subject: [PATCH 09/23] =?UTF-8?q?[shuttle]=20=E9=9F=A9=E8=AF=AD=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/bus/model/OrderModel.java | 6 +- .../com/mogo/och/bus/model/OrderModel.java | 6 +- .../och/common/module/voice/VoiceManager.kt | 61 +++++++++++++++++++ .../src/main/res/values/strings.xml | 12 ++++ 4 files changed, 79 insertions(+), 6 deletions(-) diff --git a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java index dba8586d78..98e2f413aa 100644 --- a/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java +++ b/OCH/mogo-och-bus/src/jinlvvan/java/com/mogo/och/bus/model/OrderModel.java @@ -718,7 +718,7 @@ public class OrderModel { , arriveStation , isLastStop); } - VoiceManager.INSTANCE.arrivedStation(arriveStation,arriveStationKr); + VoiceManager.INSTANCE.arrivedStationBus(arriveStation,arriveStationKr); } /** @@ -778,7 +778,7 @@ public class OrderModel { UiThreadHandler.postDelayed(new Runnable() { @Override public void run() { - VoiceManager.INSTANCE.leaveStation(nextStation,nextStationKr); + VoiceManager.INSTANCE.leaveStationBus(nextStation,nextStationKr); } },DELAY_10S); } @@ -1049,7 +1049,7 @@ public class OrderModel { } private void ttsEndTask() { - VoiceManager.INSTANCE.endOrder(); + VoiceManager.INSTANCE.endOrderBus(); } /** diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java index 6cede59cae..2c33669eb9 100644 --- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java +++ b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java @@ -708,7 +708,7 @@ public class OrderModel { , isLastStop); } - VoiceManager.INSTANCE.arrivedStation(arriveStation,arriveStationKr); + VoiceManager.INSTANCE.arrivedStationBus(arriveStation,arriveStationKr); sendArrivedStationToClient(arriveStation); } @@ -802,7 +802,7 @@ public class OrderModel { UiThreadHandler.postDelayed(new Runnable() { @Override public void run() {//延迟10s播报 - VoiceManager.INSTANCE.leaveStation(nextStation,nextStationKr); + VoiceManager.INSTANCE.leaveStationBus(nextStation,nextStationKr); } },DELAY_10S); @@ -1049,7 +1049,7 @@ public class OrderModel { queryBusRoutes();// 重新获取任务 removeTipRunnables(); // startOrStopQueryPassengerWriteOff(false); - VoiceManager.INSTANCE.endOrder(); + VoiceManager.INSTANCE.endOrderBus(); sendEndTaskToClient(); } } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/voice/VoiceManager.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/voice/VoiceManager.kt index 6566ebb133..bf1bc8d602 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/voice/VoiceManager.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/voice/VoiceManager.kt @@ -102,4 +102,65 @@ object VoiceManager { list.add(koreanTTS) VoiceNotice.showNotice(list, AIAssist.LEVEL0,callBack) } + + fun arrivedStationBus(siteNameCN: String?, siteNameKR: String?) { + val context = AbsMogoApplication.getApp() + val list: MutableList = ArrayList() + siteNameCN?.let { + val chineseTTS = LangTtsEntity( + context.getString(R.string.bus_arrived_station_tip, it), + LanguageType.CHINESE + ) + val engTTS = LangTtsEntity( + context.getString(R.string.bus_arrived_station_english_tip, it), + LanguageType.CHINESE + ) + val koreanTTS = LangTtsEntity( + context.getString(R.string.bus_arrived_station_korean_tip, siteNameKR?:it), + LanguageType.KOREAN + ) + list.add(chineseTTS) + list.add(engTTS) + list.add(koreanTTS) + } + + VoiceNotice.showNotice(list, AIAssist.LEVEL1,null) + } + + fun leaveStationBus(siteNameCN: String?, siteNameKR: String?) { + val list: MutableList = ArrayList() + val context = AbsMogoApplication.getApp() + siteNameCN?.let { + val chineseTTS = LangTtsEntity( + context.getString(R.string.bus_leave_station_tip, it), + LanguageType.CHINESE + ) + val engTTS = LangTtsEntity( + context.getString(R.string.bus_leave_station_english_tip, it), + LanguageType.CHINESE + ) + list.add(chineseTTS) + list.add(engTTS) + + val koreanTTS = LangTtsEntity( + context.getString(R.string.bus_leave_station_korean_tip, siteNameKR ?: it), + LanguageType.KOREAN + ) + list.add(koreanTTS) + } + VoiceNotice.showNotice(list, AIAssist.LEVEL1,null) + } + + fun endOrderBus() { + val context = AbsMogoApplication.getApp() + val list: MutableList = ArrayList() + val chineseTTS = LangTtsEntity(context.getString(R.string.bus_end_task_tip), LanguageType.CHINESE) + val engTTS = LangTtsEntity(context.getString(R.string.bus_end_task_english_tip), LanguageType.ENGLISH) + val koreanTTS = LangTtsEntity(context.getString(R.string.bus_end_task_korean_tip), LanguageType.KOREAN) + list.add(chineseTTS) + list.add(engTTS) + list.add(koreanTTS) + VoiceNotice.showNotice(list, AIAssist.LEVEL0,null) + } + } \ No newline at end of file diff --git a/OCH/mogo-och-common-module/src/main/res/values/strings.xml b/OCH/mogo-och-common-module/src/main/res/values/strings.xml index a018b9286c..5aed40ce2e 100644 --- a/OCH/mogo-och-common-module/src/main/res/values/strings.xml +++ b/OCH/mogo-och-common-module/src/main/res/values/strings.xml @@ -31,6 +31,18 @@ Thank you for experiencing the self-driving minibus. See you next time 자율주행 버스를 체험해 주셔서 감사합니다. 다음에 또 뵙겠습니다 + 已到达%1$s,带好随身物品,下车请注意安全。 + We are arriving at %1$s ,get off with your belongings + %1$s 역에 도착했습니다 , 소지품 챙겨서 내리세요 + + 车辆起步,请扶稳坐好,前方到站是%1$s,请下车的乘客做好准备。 + The next station is %1$s ,please get ready for your arrival + 전방에서 역에 도착하는 %1$s ,차에서 내리는 승객은 준비하세요 + + 感谢您体验\'蘑菇车联\'自动驾驶小巴车,我们下次再见。 + Thank you for experiencing the self-driving minibus. See you next time + 자율주행 버스를 체험해 주셔서 감사합니다. 다음에 또 뵙겠습니다 + 取消 扫描二维码完成车辆绑定 \ No newline at end of file From 8038a94e267043e4c906e7d8618329a2425623cf Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Mon, 10 Apr 2023 17:30:41 +0800 Subject: [PATCH 10/23] =?UTF-8?q?[mini=20bus3.0.0]=20=E5=8F=B8=E6=9C=BA?= =?UTF-8?q?=E7=AB=AF=E4=BA=8C=E7=BB=B4=E7=A0=81=E5=90=88=E5=B9=B6=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/och/bus/fragment/BusFragment.java | 44 +- .../mogo/och/bus/fragment/BusFragment.java | 557 ------------------ app/urlConfig.json | 12 +- 3 files changed, 39 insertions(+), 574 deletions(-) delete mode 100644 OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/fragment/BusFragment.java diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java index f61820f87d..8ba9fb1404 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java @@ -1,10 +1,10 @@ package com.mogo.och.bus.fragment; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS; - import android.content.Intent; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.os.Bundle; -import android.util.Log; import android.view.View; import android.widget.TextView; @@ -14,7 +14,9 @@ import androidx.constraintlayout.widget.Group; import androidx.annotation.Nullable; import com.alibaba.android.arouter.launcher.ARouter; +import com.mogo.cloud.passport.MoGoAiCloudClientConfig; import com.mogo.commons.AbsMogoApplication; +import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.map.CenterLine; import com.mogo.eagle.core.data.temp.EventLogout; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; @@ -37,6 +39,8 @@ import com.mogo.och.common.module.biz.constant.OchCommonConst; import com.mogo.och.common.module.biz.provider.LoginService; import com.mogo.och.common.module.utils.BlinkAnimationUtil; import com.mogo.och.common.module.utils.OCHThreadPoolManager; +import com.mogo.och.common.module.utils.QRUtilsKt; +import com.mogo.och.common.module.wigets.BindQRCodeDialog; import com.mogo.och.common.module.wigets.MarqueeTextView; import com.mogo.och.common.module.wigets.OCHCommitDialog; @@ -46,6 +50,8 @@ import org.greenrobot.eventbus.ThreadMode; import java.util.List; import java.util.Objects; +import me.jessyan.autosize.utils.AutoSizeUtils; + /** * 网约车小巴界面 @@ -125,6 +131,22 @@ public class BusFragment extends BaseBusTabFragment if (eventLogout.getMessgae() == EventLogout.LOGOUT_TYPE){ CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event消息去登出"); mPresenter.logout(); + }else if (eventLogout.getMessgae() == EventLogout.SHOW_QR_TYPE){ //显示二维码 + CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event qrcode"); + String qrUrl = String.format(FunctionBuildConfig.urlJson.getBindDriverQRUrl(), + MoGoAiCloudClientConfig.getInstance().getSn()); + Bitmap bmQr = QRUtilsKt.createQRCodeWithPicture( + BitmapFactory.decodeResource(getResources(), R.drawable.icon_qr_center_logo) + ,qrUrl, AutoSizeUtils.dp2px(getContext(),340f), + AutoSizeUtils.dp2px(getContext(),340f),true); + if (bmQr != null){ + BindQRCodeDialog.Builder builder = new BindQRCodeDialog.Builder(); + builder.title(getString(R.string.bind_driver_qr_title)) + .cancelStr(getString(R.string.qr_cancel)) + .qrBm(bmQr).build(getContext()).show(); + }else { + CallerLogger.INSTANCE.d(M_BUS + TAG,"bmQr = null "); + } } } @@ -360,16 +382,16 @@ public class BusFragment extends BaseBusTabFragment }else { firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color)); thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected)); - if (isArrived){ //到终点 - firstStationItem.setStationPointBg(0); - firstStationItem.setStationArrowBg(0); - thirdStationItem.setStationPointBg(1); + if (isArrived){ //到终点 + firstStationItem.setStationPointBg(0); + firstStationItem.setStationArrowBg(0); + thirdStationItem.setStationPointBg(1); - }else { //到终点途中 - firstStationItem.setStationPointBg(0); - firstStationItem.setStationArrowBg(1); - thirdStationItem.setStationPointBg(1); - } + }else { //到终点途中 + firstStationItem.setStationPointBg(0); + firstStationItem.setStationArrowBg(1); + thirdStationItem.setStationPointBg(1); + } } } diff --git a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/fragment/BusFragment.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/fragment/BusFragment.java deleted file mode 100644 index 65a4763f31..0000000000 --- a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/fragment/BusFragment.java +++ /dev/null @@ -1,557 +0,0 @@ -package com.mogo.och.bus.fragment; - -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS; -import android.content.Intent; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.os.Bundle; -import android.view.View; -import android.widget.TextView; - -import androidx.annotation.NonNull; -import androidx.constraintlayout.widget.ConstraintLayout; -import androidx.constraintlayout.widget.Group; -import androidx.annotation.Nullable; - -import com.alibaba.android.arouter.launcher.ARouter; -import com.mogo.cloud.passport.MoGoAiCloudClientConfig; -import com.mogo.commons.AbsMogoApplication; -import com.mogo.eagle.core.data.config.FunctionBuildConfig; -import com.mogo.eagle.core.data.map.CenterLine; -import com.mogo.eagle.core.data.temp.EventLogout; -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; -import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant; -import com.mogo.eagle.core.utilcode.util.ToastUtils; -import com.mogo.map.marker.IMogoMarker; -import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.och.bus.R; -import com.mogo.och.bus.bean.BusStationBean; -import com.mogo.och.bus.constant.BusConst; -import com.mogo.och.bus.net.login.LoginBusImpl; -import com.mogo.och.bus.presenter.BusPresenter; -import com.mogo.och.bus.ui.BusStationCommonItem; -import com.mogo.och.bus.ui.BusSwitchLineActivity; -import com.mogo.och.bus.view.SlidePanelView; -import com.mogo.och.common.module.biz.constant.OchCommonConst; -import com.mogo.och.common.module.biz.provider.LoginService; -import com.mogo.och.common.module.utils.BlinkAnimationUtil; -import com.mogo.och.common.module.utils.OCHThreadPoolManager; -import com.mogo.och.common.module.utils.QRUtilsKt; -import com.mogo.och.common.module.wigets.BindQRCodeDialog; -import com.mogo.och.common.module.wigets.MarqueeTextView; -import com.mogo.och.common.module.wigets.OCHCommitDialog; - -import org.greenrobot.eventbus.Subscribe; -import org.greenrobot.eventbus.ThreadMode; - -import java.util.List; -import java.util.Objects; - -import me.jessyan.autosize.utils.AutoSizeUtils; - - -/** - * 网约车小巴界面 - * - * @author tongchenfei - */ -public class BusFragment extends BaseBusTabFragment - implements SlidePanelView.OnSlidePanelMoveToEndListener, View.OnClickListener { - public static final String TAG = "BusFragment"; - - private TextView mSwitchLine; //切换路线 - private MarqueeTextView mLineName; - private TextView mTaskTime; - private Group groupStationsPanel; - private ConstraintLayout noDataView; - - private BusStationBean startStation = null; - private BusStationBean endStation = null; - private BusStationCommonItem firstStationItem; - private BusStationCommonItem secondStationItem; - private BusStationCommonItem thirdStationItem; - - private LoginService loginService; - - @Override - public String getTagName() { - return "BusFragment"; - } - - @Override - public void onActivityCreated(@Nullable Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); - loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation(); - if(loginService!=null){ - loginService.registerFragment(this, getPresenter(),new LoginBusImpl()); - } - } - @Override - public void onDestroyView() { - super.onDestroyView(); - loginService.unRegisterFragment(); - loginService = null; - } - - @Override - protected void initViews() { - super.initViews(); - - mSwitchLine = findViewById(R.id.switch_line_btn); - mSwitchLine.setTag(0); - mLineName = findViewById(R.id.module_och_bus_line_name); - - firstStationItem = findViewById(R.id.bus_panel_first_station); - secondStationItem = findViewById(R.id.bus_panel_second_station); - thirdStationItem = findViewById(R.id.bus_panel_third_station); - mTaskTime = findViewById(R.id.bus_task_time_tv); - groupStationsPanel = findViewById(R.id.group_stations_panel); - noDataView = findViewById(R.id.no_line_data_view); - - CallerLogger.INSTANCE.d(M_BUS + TAG, "initView: " + CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()); - // 初始化的时候设置 UI 按钮状态 - showAutopilotBiz(); - - mSwitchLine.setOnClickListener(this); - - mLineName.setOnLongClickListener(new View.OnLongClickListener() { - @Override - public boolean onLongClick(View v) { - showHideTestBar(); - return false; - } - }); - } - - @Subscribe(threadMode = ThreadMode.MAIN) - public void changeOverview(EventLogout eventLogout){ - if (eventLogout.getMessgae() == EventLogout.LOGOUT_TYPE){ - CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event消息去登出"); - mPresenter.logout(); - }else if (eventLogout.getMessgae() == EventLogout.SHOW_QR_TYPE){ //显示二维码 - CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event qrcode"); - String qrUrl = String.format(FunctionBuildConfig.urlJson.getBindDriverQRUrl(), - MoGoAiCloudClientConfig.getInstance().getSn()); - Bitmap bmQr = QRUtilsKt.createQRCodeWithPicture( - BitmapFactory.decodeResource(getResources(), R.drawable.icon_qr_center_logo) - ,qrUrl, AutoSizeUtils.dp2px(getContext(),340f), - AutoSizeUtils.dp2px(getContext(),340f),true); - if (bmQr != null){ - BindQRCodeDialog.Builder builder = new BindQRCodeDialog.Builder(); - builder.title(getString(R.string.bind_driver_qr_title)) - .cancelStr(getString(R.string.qr_cancel)) - .qrBm(bmQr).build(getContext()).show(); - }else { - CallerLogger.INSTANCE.d(M_BUS + TAG,"bmQr = null "); - } - } - } - - @Override - protected void onArriveStation() { - mPresenter.onAutopilotArriveAtStation(null); - } - - @Override - protected void debugArrivedStation() { - mPresenter.onAutopilotArriveAtStation(null); - } - - @NonNull - @Override - protected BusPresenter createPresenter() { - return new BusPresenter(this); - } - - @Override - public void onResume() { - super.onResume(); - } - - public void hideStationsPanel(){ - groupStationsPanel.setVisibility(View.GONE); - noDataView.setVisibility(View.VISIBLE); - } - - public void showStationsPanel(){ - groupStationsPanel.setVisibility(View.VISIBLE); - noDataView.setVisibility(View.GONE); - } - - public void updateLineEmptyUI(){ - setArrivedClikable(false); - showOrHideSwitchLineBtn(true); - hideStationsPanel(); - hideSlidePanel(); - resetStationBlinkAnim(); - } - - private void resetStationBlinkAnim() { - BlinkAnimationUtil.clearAnimation(firstStationItem.getCircleImageView()); - BlinkAnimationUtil.clearAnimation(secondStationItem.getCircleImageView()); - BlinkAnimationUtil.clearAnimation(thirdStationItem.getCircleImageView()); - } - - public void updateBusTaskStatus(String lineName, String lineTime, - List stationList, - int arrivingOrArrivedIndex, - boolean isArrived){ - - if (getActivity() == null) { - return; - } - - getActivity().runOnUiThread(() -> { - if (stationList == null) { - // 获取小巴数据失败 - return; - } - - showStationsPanel(); - showOrHideSwitchLineBtn(false); - - mLineName.setText(lineName); - mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime); - // 渲染小巴路线数据 - updateBusStationStatus(stationList,arrivingOrArrivedIndex,isArrived); - }); - } - - private void updateBusStationStatus(List stationList, - int arrivingOrArrivedIndex, - boolean isArrived) { - - startStation = stationList.get(0); - endStation = stationList.get(stationList.size() - 1); - - if (arrivingOrArrivedIndex == stationList.size() - 1 && isArrived){ - //切换路线和结束路线按钮切换 - showSlidePanel("单程结束"); - - setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat() - , endStation.getLon(),R.raw.end_marker); - }else if (arrivingOrArrivedIndex == 0 && isArrived){ - - showSlidePanel("滑动出发"); - - setOrRemoveMapMaker(true, BusConst.BUS_START_MAP_MAKER, - startStation.getLat(), startStation.getLon(),R.raw.star_marker); - setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, - endStation.getLat(), endStation.getLon(),R.raw.end_marker); - }else{ - if (isArrived){ - // 重置滑动按钮文字 - showSlidePanel("滑动出发"); - } - - setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat() - , startStation.getLon(),R.raw.star_marker); - setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat() - , endStation.getLon(),R.raw.end_marker); - } - - if (stationList.size() > 2){ //只有两个站点 - updateMoreThanTwoStationsUI(stationList,arrivingOrArrivedIndex,isArrived); - }else { - updateTwoStationsUI(stationList,arrivingOrArrivedIndex,isArrived); - } - - updateBusTestBarInfo(); - } - - /** - * 有两个以上站点的路线 - * @param stationList - * @param arrivingOrArrivedIndex - * @param isArrived - */ - private void updateMoreThanTwoStationsUI(List stationList, - int arrivingOrArrivedIndex, - boolean isArrived) { - secondStationItem.setStationTag(""); - secondStationItem.showOrHideStationArrowBg(true); - thirdStationItem.setStationTag(""); - secondStationItem.setVisibility(View.VISIBLE); - thirdStationItem.showOrHideStationArrowBg(false); - - if (arrivingOrArrivedIndex == 0 || arrivingOrArrivedIndex -1 == 0 - || (arrivingOrArrivedIndex -2 == 0 && stationList.size() == 3)){ - firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start)); - }else { - firstStationItem.setStationTag(""); - } - - if (arrivingOrArrivedIndex + 1 == stationList.size() - 1 || arrivingOrArrivedIndex == stationList.size() - 1 - || (arrivingOrArrivedIndex == 0 && arrivingOrArrivedIndex + 2 == stationList.size() - 1)){ //确认是否显示 "终" - thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end)); - }else { - thirdStationItem.setStationTag(""); - } - - //圆点: 0:灰色 过站 1:绿色 到站或者即将到站 2:蓝色:未到站 - if (arrivingOrArrivedIndex == 0 && isArrived){ - firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected)); - secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color)); - thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color)); - - firstStationItem.setStationName(stationList.get(0).getName()); - secondStationItem.setStationName(stationList.get(1).getName()); - thirdStationItem.setStationName(stationList.get(2).getName()); - - firstStationItem.setStationPointBg(1); - secondStationItem.setStationPointBg(2); - thirdStationItem.setStationPointBg(2); - - firstStationItem.setStationArrowBg(2); - secondStationItem.setStationArrowBg(2); - - }else if (arrivingOrArrivedIndex == stationList.size() - 1){ - firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color)); - secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color)); - thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected)); - - firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -2).getName()); - secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName()); - thirdStationItem.setStationName(stationList.get(arrivingOrArrivedIndex).getName()); - - firstStationItem.setStationPointBg(0); - secondStationItem.setStationPointBg(0); - thirdStationItem.setStationPointBg(1); - - firstStationItem.setStationArrowBg(0); - if (isArrived){ - secondStationItem.setStationArrowBg(0); - }else { - secondStationItem.setStationArrowBg(1); - } - - }else { - firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color)); - secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected)); - thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color)); - - firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName()); - secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex).getName()); - thirdStationItem.setStationName(stationList.get(arrivingOrArrivedIndex + 1).getName()); - - firstStationItem.setStationPointBg(0); - secondStationItem.setStationPointBg(1); - thirdStationItem.setStationPointBg(2); - - secondStationItem.setStationArrowBg(2); - if (isArrived){ - firstStationItem.setStationArrowBg(0); - }else { - firstStationItem.setStationArrowBg(1); - } - } - - } - - /** - * 只有两个站点的路线 - * @param stationList - * @param arrivingOrArrivedIndex - * @param isArrived - */ - private void updateTwoStationsUI(List stationList, - int arrivingOrArrivedIndex, - boolean isArrived) { - - secondStationItem.setVisibility(View.GONE); - secondStationItem.showOrHideStationArrowBg(false); - thirdStationItem.showOrHideStationArrowBg(false); - - firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start)); - thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end)); - - firstStationItem.setStationName(stationList.get(0).getName()); - thirdStationItem.setStationName(stationList.get(1).getName()); - - //圆点: 0:灰色 过站 1:绿色 到站或者即将到站 2:蓝色:未到站 - if (arrivingOrArrivedIndex == 0 && isArrived){//到站 - firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected)); - thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color)); - firstStationItem.setStationPointBg(1); - firstStationItem.setStationArrowBg(2); - thirdStationItem.setStationPointBg(0); - - }else { - firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color)); - thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected)); - if (isArrived){ //到终点 - firstStationItem.setStationPointBg(0); - firstStationItem.setStationArrowBg(0); - thirdStationItem.setStationPointBg(1); - - }else { //到终点途中 - firstStationItem.setStationPointBg(0); - firstStationItem.setStationArrowBg(1); - thirdStationItem.setStationPointBg(1); - } - } - } - - private void showOrHideSwitchLineBtn(boolean isShow) { - if (isShow){//显示切换路线 - mSwitchLine.setTag(0); - mSwitchLine.setText(getResources().getString(R.string.bus_switch_line_btn)); - }else {//显示结束路线 - mSwitchLine.setTag(1); - mSwitchLine.setText(getResources().getString(R.string.bus_close_line_btn)); - } - } - - public void hideOchBus() { -// tvNotice.setVisibility(View.GONE); - } - - @Override - public int getStationPanelViewId() { - return R.layout.fragment_och_bus; - } - - @Override - public void restartAutopilot() { - if (!isAnimateRunning) { - mPresenter.restartAutopilot(); - } - } - - @Override - public SlidePanelView.OnSlidePanelMoveToEndListener getSlidePanelOnEndListener() { - return this; - } - - @Override - public void moveToEnd() { - // 开启自动驾驶到下一站 - if (isAnimateRunning){ - stopAutopilotAnimation(); - } - mPresenter.autoDriveToNextStation(); - } - - /** - * 设置自动驾驶可用状态 - */ - public void onAutopilotEnableChange(boolean isEnable) { - if (isEnable) { - showAutopilotBiz(); - } else { - hideAutopilotBiz(); - } - } - - public void clearBusStationsMarkers(){ - CallerLogger.INSTANCE.d(M_BUS + TAG,"clearBusStationsMarkers()"); - if (null != startStation) { - setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat() - , startStation.getLon(),R.raw.star_marker); - } - if (null != endStation) { - setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat() - , endStation.getLon(),R.raw.end_marker); - } - - //清除鹰眼右下角小地图轨迹 - CallerLogger.INSTANCE.d(SceneConstant.M_MAP, "clearBusStationsMarkers --------->"); - smallMapView.clearPolyline(); - } - - /** - * VR模式切换 - * - * @param isVRMode - */ - public void onVRModeChanged(boolean isVRMode) { - if (mRootView != null) { - mRootView.setVisibility(isVRMode ? View.VISIBLE : View.GONE); - } - } - - /** - * 绘制地图起点终点 - * - * @param isAdd - * @param uuid - */ - private void setOrRemoveMapMaker(boolean isAdd, String uuid, double lat, double longi,int resourceId) { - if (isAdd) { - Runnable setMapMarkerRunnable = () -> { - CallerLogger.INSTANCE.d(M_BUS + "setMapMaker= "+Thread.currentThread().getName(), - uuid + "=latitude=" + lat + ",longitude=" + longi); - - MogoMarkerOptions options = new MogoMarkerOptions() - .owner(BusConst.TYPE_MARKER_BUS_ORDER) - .anchor(0.5f, 0.5f) - .set3DMode(true) - .gps(true) - .controlAngle(true) - .icon3DRes(resourceId) - .latitude(lat) - .longitude(longi); - IMogoMarker marker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).addMarker(uuid, options); - CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo( - longi,lat,-1); - if (null != centerLine && marker != null) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空 - marker.setRotateAngle(centerLine.getAngle().floatValue()); - } - }; - - OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable); - - }else { - Runnable removeMapMarkerRunnable = () -> { - CallerLogger.INSTANCE.d(M_BUS + "RemoveMapMaker="+Thread.currentThread().getName(), - uuid+"=latitude="+lat+",longitude="+longi); - Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).removeMarkers(uuid); - }; - OCHThreadPoolManager.getsInstance().execute(removeMapMarkerRunnable); - } - } - - @Override - public void debugAutoPilotStatus(int status) { - mPresenter.debugAutoPilotStatus(status); - } - - @Override - public void onClick(View v) { - if (v.getId() == R.id.switch_line_btn) {//切换路线条件: 自动驾驶过程中,点击则toast提示:自动驾驶中,不可切换路线 - //本次行程未结束,不支持切换路线。点击则toast提示:当前行程未完成,不可切换路线 - if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() - == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) { - ToastUtils.showLong(getResources().getString(R.string.bus_switch_line_btn_warning1)); - return; - } - if ((int)mSwitchLine.getTag() == 0){//切换路线 - Intent intent = new Intent(getContext(), BusSwitchLineActivity.class); - startActivity(intent); - }else {//结束任务 - OCHCommitDialog.Builder builder = new OCHCommitDialog.Builder(); - OCHCommitDialog closeLineConfirmDialog = builder - .title(getString(R.string.bus_dialog_title)) - .tips(getString(R.string.bus_dialog_tips)) - .confirmStr(getString(R.string.bus_dialog_confirm)) - .cancelStr(getString(R.string.bus_dialog_cancel)) - .build(getContext()); - closeLineConfirmDialog.setClickListener(new OCHCommitDialog.ClickListener() { - @Override - public void confirm() { - mPresenter.abortTask(); - } - - @Override - public void cancel() { - closeLineConfirmDialog.dismiss(); - } - }); - closeLineConfirmDialog.show(); - } - } - } -} diff --git a/app/urlConfig.json b/app/urlConfig.json index a767ba07c1..9fe30af3fd 100644 --- a/app/urlConfig.json +++ b/app/urlConfig.json @@ -40,7 +40,7 @@ "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/", "eagle_mis_url": "http://eagle-mis-a.zhidaozhixing.com/", "eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/", - "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=asafety&sn=%1$s" + "bind_driver_qr_url": "https://och-mini-eh.zhidaozhixing.com?pipe=ehsafety&sn=%1$s" }, "online": { "och_url": "https://och-driver-eh.zhidaozhixing.com:18182", @@ -50,7 +50,7 @@ "socket_tech_url": "https://och-driver-eh.zhidaozhixing.com:18182/arch/", "eagle_mis_url": "https://och-hailing-eh.zhidaozhixing.com:18182/", "eagle_dns_url": "https://och-hailing-eh.zhidaozhixing.com:18182/", - "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ehsafety&sn=%1$s" + "bind_driver_qr_url": "https://och-mini-eh.zhidaozhixing.com?pipe=ehsafety&sn=%1$s" }, "demo": { "och_url": "https://och-a.zhidaozhixing.com", @@ -60,7 +60,7 @@ "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/", "eagle_mis_url": "http://och-hailing-eh.zhidaozhixing.com:18181/", "eagle_dns_url": "http://och-hailing-eh.zhidaozhixing.com:18181/", - "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ehsafety&sn=%1$s" + "bind_driver_qr_url": "https://och-mini-eh.zhidaozhixing.com?pipe=ehsafety&sn=%1$s" } }, "yantai": { @@ -72,7 +72,7 @@ "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/", "eagle_mis_url": "http://eagle-mis-a.zhidaozhixing.com/", "eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/", - "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=asafety&sn=%1$s" + "bind_driver_qr_url": "https://och-mini-yt.zhidaozhixing.com?pipe=ytsafety&sn=%1$s" }, "online": { "och_url": "https://och-driver-yt.zhidaozhixing.com", @@ -82,7 +82,7 @@ "socket_tech_url": "https://och-driver-yt.zhidaozhixing.com/arch/", "eagle_mis_url": "https://och-hailing-yt.zhidaozhixing.com/", "eagle_dns_url": "https://och-hailing-yt.zhidaozhixing.com/", - "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ytsafety&sn=%1$s" + "bind_driver_qr_url": "https://och-mini-yt.zhidaozhixing.com?pipe=ytsafety&sn=%1$s" }, "demo": { "och_url": "https://och-a.zhidaozhixing.com", @@ -92,7 +92,7 @@ "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/", "eagle_mis_url": "http://eagle-mis-a.zhidaozhixing.com/", "eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/", - "bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ytsafety&sn=%1$s" + "bind_driver_qr_url": "https://och-mini-yt.zhidaozhixing.com?pipe=ytsafety&sn=%1$s" } } } From 59d48423b697f9bf044910b0e5f88945f0550dfc Mon Sep 17 00:00:00 2001 From: yangyakun Date: Wed, 29 Mar 2023 20:10:54 +0800 Subject: [PATCH 11/23] =?UTF-8?q?[mini=20bus2.0.0]=20=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=8C=85=E8=BD=A6=E9=9F=A9=E8=AF=AD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bean/response/OrderInfoResponse.kt | 2 ++ .../passenger/model/CharterPassengerModel.kt | 28 ++++++++----------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/bean/response/OrderInfoResponse.kt b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/bean/response/OrderInfoResponse.kt index 9d05dc05e0..c510232abf 100644 --- a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/bean/response/OrderInfoResponse.kt +++ b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/bean/response/OrderInfoResponse.kt @@ -14,8 +14,10 @@ data class OrderInfoResponse(val data: OrderInfo?) : BaseData() { val lineName: String?,//线路名称 var startSiteId: Int?, var startSiteName: String?, + var startSiteNameKr: String?, val siteId: Long?,//站点id val siteName: String?,//站点名称 + val siteNameKr: String?,//站点名称 val wgs84Lat: Double?, val wgs84Lon: Double?, var gcj02Lat: Double?, diff --git a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/model/CharterPassengerModel.kt b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/model/CharterPassengerModel.kt index f0be5f21dc..8f38ab143a 100644 --- a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/model/CharterPassengerModel.kt +++ b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/model/CharterPassengerModel.kt @@ -548,11 +548,7 @@ object CharterPassengerModel { AbsMogoApplication.getApp() .getString(R.string.m1_end_order_5min), 2 ) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - VoiceManager.surplus5min(VoiceFocusManager.getVoiceCmdCallBack()) - }else{ - VoiceManager.surplus5min() - } + VoiceManager.surplus5min(VoiceFocusManager.getVoiceCmdCallBack()) CallerLogger.d(M_BUS_P+ TAG,"倒计时5分钟${it.orderNo}") SharedPrefs.getInstance(mContext).putBoolean("${it.orderNo}$min5Speak",true) } @@ -858,12 +854,11 @@ object CharterPassengerModel { mContext, lindId = it, object : OchCommonServiceCallback { override fun onSuccess(data: BaseData?) { if (null != data && 0 == data.code) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - VoiceManager.arrivedStation(orderInfo!!.siteName!!, - VoiceFocusManager.getVoiceCmdCallBack()) - }else{ - VoiceManager.arrivedStation(orderInfo!!.siteName!!,) - } + VoiceManager.arrivedStation( + orderInfo!!.siteName!!, + orderInfo!!.siteNameKr!!, + VoiceFocusManager.getVoiceCmdCallBack() + ) broadcastList["${it}$endKey"] = true // 到站结束自驾 CallerAutoPilotControlManager.cancelAutoPilot() @@ -883,13 +878,12 @@ object CharterPassengerModel { } } - fun leaveStation(){ - orderInfo?.siteName?.let { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - VoiceManager.leaveStation(it,VoiceFocusManager.getVoiceCmdCallBack()) - }else{ - VoiceManager.leaveStation(it) + fun leaveStation() { + orderInfo?.siteName?.let {cn-> + orderInfo?.siteNameKr?.let {kr-> + VoiceManager.leaveStation(cn,kr, VoiceFocusManager.getVoiceCmdCallBack()) } + } } From 5caa72202fc28b3488d23739774a7f63ba9798f7 Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Mon, 10 Apr 2023 19:38:35 +0800 Subject: [PATCH 12/23] =?UTF-8?q?[3.0.0]=20=E5=A4=84=E7=90=86=E5=8C=85?= =?UTF-8?q?=E8=BD=A6=E5=8F=B8=E6=9C=BA=E7=AB=AF=E5=80=92=E8=AE=A1=E6=97=B6?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../magic/mogo/och/charter/callback/DriverM1OrderCallback.kt | 1 + .../com/magic/mogo/och/charter/fragment/DriverM1Fragment.kt | 2 +- .../java/com/magic/mogo/och/charter/model/DriverM1Model.kt | 1 + .../com/magic/mogo/och/charter/presenter/DriverM1Presenter.kt | 4 ++++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/callback/DriverM1OrderCallback.kt b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/callback/DriverM1OrderCallback.kt index ac199b8ed6..32496916dc 100644 --- a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/callback/DriverM1OrderCallback.kt +++ b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/callback/DriverM1OrderCallback.kt @@ -9,5 +9,6 @@ import com.magic.mogo.och.charter.bean.QueryCurrentOrderResponse interface DriverM1OrderCallback { fun updateOrderUI(orderStatus: QueryCurrentOrderResponse.Result) // 到达站 fun updateOverCountDown(minutes: Long) //倒计时ms + fun clearCountDown() //清除倒计时 fun updateReturnCarStatus(returnSuccess: Boolean) } \ No newline at end of file diff --git a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/fragment/DriverM1Fragment.kt b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/fragment/DriverM1Fragment.kt index 08cf7824a9..8ad297cf23 100644 --- a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/fragment/DriverM1Fragment.kt +++ b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/fragment/DriverM1Fragment.kt @@ -186,7 +186,7 @@ class DriverM1Fragment : CharterBaseFragment Date: Mon, 10 Apr 2023 19:39:02 +0800 Subject: [PATCH 13/23] =?UTF-8?q?[mini=20bus3.0.0]=20=E5=8F=B8=E6=9C=BA?= =?UTF-8?q?=E7=AB=AF=E7=89=88=E6=9C=AC=E5=8F=B7=E4=B8=BA3.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index f8e20f3ee9..b0d479bb7f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -93,8 +93,8 @@ WEBSOCKET_VERSION=1.1.7 applicationId=com.mogo.launcer applicationName=IntelligentPilot # RoboBus司机端:2.5.1;RoboTaxi司机端:2.5.1;RoboTaxi乘客端:1.0.0 -versionCode=2000000 -versionName=2.0.0 +versionCode=3000000 +versionName=3.0.0 ################# 新架构模块Maven版本管理 ################# MOGO_CORE_FUNCTION_HMI_VERSION=0.0.58.10 From 8d5465920bdc2d55de1d275cd0d87e5bde62abd1 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Wed, 29 Mar 2023 18:31:18 +0800 Subject: [PATCH 14/23] =?UTF-8?q?[dev=5Frobobus-d=5F230322=5F3.0.0]?= =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E7=8E=AF=E5=A2=83=E5=8E=BB=E9=99=A4=E7=AB=AF?= =?UTF-8?q?=E5=8F=A3=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Conflicts: # app/urlConfig.json --- app/urlConfig.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/urlConfig.json b/app/urlConfig.json index 9fe30af3fd..b672be5238 100644 --- a/app/urlConfig.json +++ b/app/urlConfig.json @@ -43,13 +43,13 @@ "bind_driver_qr_url": "https://och-mini-eh.zhidaozhixing.com?pipe=ehsafety&sn=%1$s" }, "online": { - "och_url": "https://och-driver-eh.zhidaozhixing.com:18182", - "shuttle_url": "https://och-driver-eh.zhidaozhixing.com:18182", - "passport_url": "https://och-driver-eh.zhidaozhixing.com:18182/arch/passport/", - "socket_base_url": "https://och-driver-eh.zhidaozhixing.com:18182/arch/push/", - "socket_tech_url": "https://och-driver-eh.zhidaozhixing.com:18182/arch/", - "eagle_mis_url": "https://och-hailing-eh.zhidaozhixing.com:18182/", - "eagle_dns_url": "https://och-hailing-eh.zhidaozhixing.com:18182/", + "och_url": "https://och-driver-eh.zhidaozhixing.com", + "shuttle_url": "https://och-driver-eh.zhidaozhixing.com", + "passport_url": "https://och-driver-eh.zhidaozhixing.com/arch/passport/", + "socket_base_url": "https://och-driver-eh.zhidaozhixing.com/arch/push/", + "socket_tech_url": "https://och-driver-eh.zhidaozhixing.com/arch/", + "eagle_mis_url": "https://och-hailing-eh.zhidaozhixing.com/", + "eagle_dns_url": "https://och-hailing-eh.zhidaozhixing.com/", "bind_driver_qr_url": "https://och-mini-eh.zhidaozhixing.com?pipe=ehsafety&sn=%1$s" }, "demo": { @@ -58,8 +58,8 @@ "passport_url": "https://och-a.zhidaozhixing.com/arch/passport/", "socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/", "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/", - "eagle_mis_url": "http://och-hailing-eh.zhidaozhixing.com:18181/", - "eagle_dns_url": "http://och-hailing-eh.zhidaozhixing.com:18181/", + "eagle_mis_url": "http://och-hailing-eh.zhidaozhixing.com/", + "eagle_dns_url": "http://och-hailing-eh.zhidaozhixing.com/", "bind_driver_qr_url": "https://och-mini-eh.zhidaozhixing.com?pipe=ehsafety&sn=%1$s" } }, From 3aee93c15df2116684dfbc5c0f1d4d52b165c0bb Mon Sep 17 00:00:00 2001 From: yangyakun Date: Wed, 12 Apr 2023 12:50:58 +0800 Subject: [PATCH 15/23] =?UTF-8?q?[bugfix]=20[=E6=97=A0=E6=B3=95=E5=88=B0?= =?UTF-8?q?=E7=AB=99=E3=80=81=E5=88=B0=E7=AB=99=E5=90=8E=E9=9F=A9=E6=96=87?= =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../passenger/model/CharterPassengerModel.kt | 19 +++++++++++-------- .../mogo/och/bus/passenger/ui/MainFragment.kt | 3 +++ .../och/bus/passenger/ui/view/LineSiteView.kt | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/model/CharterPassengerModel.kt b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/model/CharterPassengerModel.kt index 8f38ab143a..be2a5d03d1 100644 --- a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/model/CharterPassengerModel.kt +++ b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/model/CharterPassengerModel.kt @@ -848,18 +848,19 @@ object CharterPassengerModel { @Synchronized fun arriveDest() { orderInfo?.lineId?.let { - if(orderInfo!!.arriveStatus==OrderInfoResponse.ARRIVING) { - if (broadcastList.get("${it}$endKey")==null||broadcastList.get("${it}$endKey")==false) { + orderInfo?.siteId?.let { siteId -> + if (orderInfo!!.arriveStatus == OrderInfoResponse.ARRIVING) { + if (broadcastList.get("${siteId}$endKey") == null || broadcastList.get("${siteId}$endKey") == false) { BusPassengerServiceManager.arriveDest( mContext, lindId = it, object : OchCommonServiceCallback { override fun onSuccess(data: BaseData?) { if (null != data && 0 == data.code) { VoiceManager.arrivedStation( orderInfo!!.siteName!!, - orderInfo!!.siteNameKr!!, + orderInfo!!.siteNameKr ?: "", VoiceFocusManager.getVoiceCmdCallBack() ) - broadcastList["${it}$endKey"] = true + broadcastList["${siteId}$endKey"] = true // 到站结束自驾 CallerAutoPilotControlManager.cancelAutoPilot() // 结束路距计算 @@ -874,16 +875,18 @@ object CharterPassengerModel { } }) } + } } } } + fun cleanbroadcastListInfo(){ + broadcastList.clear() + } + fun leaveStation() { orderInfo?.siteName?.let {cn-> - orderInfo?.siteNameKr?.let {kr-> - VoiceManager.leaveStation(cn,kr, VoiceFocusManager.getVoiceCmdCallBack()) - } - + VoiceManager.leaveStation(cn,orderInfo?.siteNameKr?:"", VoiceFocusManager.getVoiceCmdCallBack()) } } diff --git a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/MainFragment.kt b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/MainFragment.kt index 6e17e00b9f..6bbc80bb3a 100644 --- a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/MainFragment.kt +++ b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/MainFragment.kt @@ -80,6 +80,9 @@ class MainFragment : ToastUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver)) } } + ll_car_speed.setOnClickListener { + CharterPassengerModel.arriveDest() + } viewBusPM1MsgBoxButton.setClickListener(object : MMsgBoxButtonView.ClickListener { override fun showMsgBoxList(show: Boolean) { diff --git a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/view/LineSiteView.kt b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/view/LineSiteView.kt index 138d2c8079..f604e7ac28 100644 --- a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/view/LineSiteView.kt +++ b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/view/LineSiteView.kt @@ -442,6 +442,7 @@ class LineSiteView @JvmOverloads constructor( } go2StartCar() CharterPassengerModel.queryOrder() + CharterPassengerModel.cleanbroadcastListInfo() } else { tempCheckLineIsSubmit = true ToastUtils.showShort("司机端拒绝请重新选择") From 2067769d037a0c6aceb825fa74cff2b84c4ba450 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Wed, 12 Apr 2023 13:52:59 +0800 Subject: [PATCH 16/23] [delete function] --- .../src/m1/java/com/mogo/och/bus/passenger/ui/MainFragment.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/MainFragment.kt b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/MainFragment.kt index 6bbc80bb3a..6e17e00b9f 100644 --- a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/MainFragment.kt +++ b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/ui/MainFragment.kt @@ -80,9 +80,6 @@ class MainFragment : ToastUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver)) } } - ll_car_speed.setOnClickListener { - CharterPassengerModel.arriveDest() - } viewBusPM1MsgBoxButton.setClickListener(object : MMsgBoxButtonView.ClickListener { override fun showMsgBoxList(show: Boolean) { From fb1dc67d25585a126b48caf6a4ba21366b6d9a4d Mon Sep 17 00:00:00 2001 From: yangyakun Date: Fri, 7 Apr 2023 20:59:34 +0800 Subject: [PATCH 17/23] =?UTF-8?q?[m2]=20[3.0.0]=20[=E5=B9=BF=E5=91=8A?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E4=BB=8Ejson=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=8E=B7=E5=8F=96=E8=A7=86=E9=A2=91]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../passenger/ui/video/PM2VideoFragment.kt | 196 ++---------------- .../ui/widget/video/AdvancePagerAdapter.kt | 2 +- .../ui/widget/video/ImageAndVideoRotation.kt | 2 + .../passenger/ui/widget/video/RotationItem.kt | 12 -- .../common/module/wigets/video/AdsDatas.kt | 10 + .../wigets/video/ImageVideoRotationView.kt | 1 - .../wigets/video/VideoPlayerFragment.kt | 91 +------- .../module/wigets/video/VideoPlayerView.kt | 8 +- app/build.gradle | 40 +++- app/config/tempConfig.json | 176 ++++++++++++++++ app/{ => config}/urlConfig.json | 0 .../mogo/launcher/startup/ConfigStartUp.kt | 2 + .../core/data/config/FunctionBuildConfig.kt | 10 + 13 files changed, 263 insertions(+), 287 deletions(-) delete mode 100644 OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/RotationItem.kt create mode 100644 OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/AdsDatas.kt create mode 100644 app/config/tempConfig.json rename app/{ => config}/urlConfig.json (100%) diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/video/PM2VideoFragment.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/video/PM2VideoFragment.kt index 6eee9039d4..6b6767c0e6 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/video/PM2VideoFragment.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/video/PM2VideoFragment.kt @@ -1,9 +1,13 @@ package com.mogo.och.bus.passenger.ui.video +import com.google.gson.reflect.TypeToken import com.mogo.commons.mvp.MvpFragment +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.utilcode.util.GsonUtils import com.mogo.och.bus.passenger.R import com.mogo.och.bus.passenger.presenter.PM2VideoPresenter -import com.mogo.och.bus.passenger.ui.widget.video.RotationItem +import com.mogo.och.common.module.wigets.video.AdsDatas +import com.mogo.och.common.module.wigets.video.RotationItem import kotlinx.android.synthetic.m2.p_m2_video_fragment.* /** @@ -48,187 +52,13 @@ class PM2VideoFragment : } private fun initResourceData() { - arrayListOf.clear() - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678946244305/dalim2.mp4", - 1, - "", - "1" - ) - ) -// if (BuildConfig.FLAVOR.contains("dali")){ //大理 目前还都使用的mogo 的cos https://img.zhidaohulian.com/fileServer/online_car_hailing/1678932482045/1080%2A565%20.mp4 -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678932482045/1080%2A565%20.mp4", -// 1, -// "", -// "1" -// ) -// ) -// }else if (BuildConfig.FLAVOR.contains("yantai")){ //烟台 -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357256102/1.jpg", -// 0, -// "", -// "1" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", -// 0, -// "", -// "2" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357557335/3.mp4", -// 1, -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", -// "3" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", -// 0, -// "", -// "4" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357834634/5.m4v", -// 1, -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", -// "5" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676358660379/6.m4v", -// 1, -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", -// "6" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360154589/7.jpg", -// 0, -// "", -// "7" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360185500/8.jpg", -// 0, -// "", -// "8" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", -// 0, -// "", -// "9" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360274126/10.mp4", -// 1, -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", -// "10" -// ) -// ) -// }else{ // mogo -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357256102/1.jpg", -// 0, -// "", -// "1" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", -// 0, -// "", -// "2" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357557335/3.mp4", -// 1, -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", -// "3" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", -// 0, -// "", -// "4" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357834634/5.m4v", -// 1, -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", -// "5" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676358660379/6.m4v", -// 1, -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", -// "6" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360154589/7.jpg", -// 0, -// "", -// "7" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360185500/8.jpg", -// 0, -// "", -// "8" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", -// 0, -// "", -// "9" -// ) -// ) -// arrayListOf.add( -// RotationItem( -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360274126/10.mp4", -// 1, -// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", -// "10" -// ) -// ) -// } -// + + try { + arrayListOf.clear() + var datas: AdsDatas = GsonUtils.fromJson(FunctionBuildConfig.tempConfig,object : TypeToken() {}.type) + arrayListOf.addAll(datas.ads) + } catch (e: Exception) { + e.printStackTrace() } + } } \ No newline at end of file diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvancePagerAdapter.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvancePagerAdapter.kt index db42808e75..2d68d3b34d 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvancePagerAdapter.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvancePagerAdapter.kt @@ -9,7 +9,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.utilcode.mogo.logger.Logger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.util.CountDownTimer -import com.mogo.eagle.core.utilcode.util.UiThreadHandler +import com.mogo.och.common.module.wigets.video.RotationItem import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack /** diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/ImageAndVideoRotation.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/ImageAndVideoRotation.kt index 92d3b3dbda..02205dd945 100644 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/ImageAndVideoRotation.kt +++ b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/ImageAndVideoRotation.kt @@ -5,6 +5,8 @@ import android.content.Context import android.util.AttributeSet import android.widget.RelativeLayout import androidx.viewpager.widget.ViewPager +import com.mogo.och.common.module.wigets.video.RotationItem + /** * @author: wangmingjun * @date: 2023/2/6 diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/RotationItem.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/RotationItem.kt deleted file mode 100644 index ed788c6179..0000000000 --- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/RotationItem.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.mogo.och.bus.passenger.ui.widget.video - -/** - * @author: wangmingjun - * @date: 2023/2/6 - * type:0 图片 - * type:1 视频 - */ -data class RotationItem(var path: String, - var type: Int, - var cacheImgPath: String, - var title: String) \ No newline at end of file diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/AdsDatas.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/AdsDatas.kt new file mode 100644 index 0000000000..777f13a502 --- /dev/null +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/AdsDatas.kt @@ -0,0 +1,10 @@ +package com.mogo.och.common.module.wigets.video + +data class AdsDatas(val ads:MutableList) + +data class RotationItem( + var path: String, + var type: Int, + var cacheImgPath: String, + var title: String +) diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/ImageVideoRotationView.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/ImageVideoRotationView.kt index 6457ffd54b..cdf8741b67 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/ImageVideoRotationView.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/ImageVideoRotationView.kt @@ -2,7 +2,6 @@ package com.mogo.och.common.module.wigets.video import AdvancePagerAdapter import AdvanceViewPager -import RotationItem import android.annotation.SuppressLint import android.content.Context import android.util.AttributeSet diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/VideoPlayerFragment.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/VideoPlayerFragment.kt index f1a759a353..1e1a3cbd17 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/VideoPlayerFragment.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/VideoPlayerFragment.kt @@ -1,8 +1,10 @@ package com.mogo.och.common.module.wigets.video -import RotationItem +import com.google.gson.reflect.TypeToken import com.mogo.commons.mvp.MvpFragment import com.mogo.commons.mvp.Presenter +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.utilcode.util.GsonUtils import com.mogo.och.common.module.R import kotlinx.android.synthetic.main.fragment_video_player.* @@ -47,87 +49,12 @@ class VideoPlayerFragment : } private fun initResourceData() { - arrayListOf.clear() - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357256102/1.jpg", - 0, - "", - "1" - ) - ) - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", - 0, - "", - "2" - ) - ) - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357557335/3.mp4", - 1, - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", - "3" - ) - ) - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", - 0, - "", - "4" - ) - ) - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357834634/5.m4v", - 1, - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", - "5" - ) - ) - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676358660379/6.m4v", - 1, - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", - "6" - ) - ) - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360154589/7.jpg", - 0, - "", - "7" - ) - ) - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360185500/8.jpg", - 0, - "", - "8" - ) - ) - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", - 0, - "", - "9" - ) - ) - arrayListOf.add( - RotationItem( - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360274126/10.mp4", - 1, - "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", - "10" - ) - ) + try { + arrayListOf.clear() + var datas: AdsDatas = GsonUtils.fromJson(FunctionBuildConfig.tempConfig,object : TypeToken() {}.type) + arrayListOf.addAll(datas.ads) + } catch (e: Exception) { + } } } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/VideoPlayerView.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/VideoPlayerView.kt index bd43556851..200ebaea1c 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/VideoPlayerView.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/wigets/video/VideoPlayerView.kt @@ -24,6 +24,7 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.och.common.module.R import com.mogo.och.common.module.wigets.video.ImageVideoRotationView +import com.mogo.och.common.module.wigets.video.RotationItem import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack import com.shuyu.gsyvideoplayer.utils.Debuger @@ -456,13 +457,6 @@ class AdvancePagerAdapter(context: Context, viewPager: ViewPager) : PagerAdapter } } -data class RotationItem( - var path: String, - var type: Int, - var cacheImgPath: String, - var title: String -) - class AdvanceImageView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null ) : RelativeLayout(context, attrs) { diff --git a/app/build.gradle b/app/build.gradle index fac1a5d598..9450b280c0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -228,15 +228,18 @@ android { mogo { dimension "project" buildConfigField 'String', 'URLs', "\"${readFileToJson("mogo").replace("\"", "\\\"")}\"" + buildConfigField 'String', 'tempConfig', "\"${readFileToJsonTemp("mogo").replace("\"", "\\\"")}\"" } yantai { dimension "project" buildConfigField 'String', 'URLs', "\"${readFileToJson("yantai").replace("\"", "\\\"")}\"" + buildConfigField 'String', 'tempConfig', "\"${readFileToJsonTemp("yantai").replace("\"", "\\\"")}\"" } dali { dimension "project" buildConfigField 'String', 'URLs', "\"${readFileToJson("dali").replace("\"", "\\\"")}\"" + buildConfigField 'String', 'tempConfig', "\"${readFileToJsonTemp("dali").replace("\"", "\\\"")}\"" } // 空业务 主要是给鹰眼使用 @@ -462,7 +465,7 @@ boolean isReleaseBuild() { Object readFileToJson(env){ try { // 加载config.json 文件 - File file = new File("${rootDir}/app/urlConfig.json") + File file = new File("${rootDir}/app/config/urlConfig.json") def jsonSlurper = new JsonSlurper() // 解析json def config = jsonSlurper.parse(file) @@ -512,3 +515,38 @@ def variantName() { } +Object readFileToJsonTemp(env){ + try { + // 加载config.json 文件 + File file = new File("${rootDir}/app/config/tempConfig.json") + def jsonSlurper = new JsonSlurper() + // 解析json + def config = jsonSlurper.parse(file) + def flavorNames = variantVehicleName() + def jsonOutput = new JsonOutput() + def getKey = flavorNames + config.get(env).each {key, value -> + // 匹配flavor对应的 json + if(flavorNames.toLowerCase().contains(key)){ + getKey = key + return true + } + } + return jsonOutput.toJson(config.get(env).get(getKey)) + } catch (IOException e) { + e.printStackTrace() + } + return null +} + +def variantVehicleName() { + if(gradle.startParameter.taskNames.size()>0) { + for (String taskName : gradle.startParameter.taskNames) { + if (taskName.contains("Debug") | taskName.contains("Release")) { + return taskName + } + } + } + return "buspassenger" +} + diff --git a/app/config/tempConfig.json b/app/config/tempConfig.json new file mode 100644 index 0000000000..e8d8cb38fb --- /dev/null +++ b/app/config/tempConfig.json @@ -0,0 +1,176 @@ +{ + "mogo": { + "shuttlepassenger": { + "ads": [ + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357256102/1.jpg", + "type": 0, + "cacheImgPath": "", + "title": "1" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", + "type": 0, + "cacheImgPath": "", + "title": "2" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357557335/3.mp4", + "type": 1, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", + "title": "3" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", + "type": 0, + "cacheImgPath": "", + "title": "4" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357834634/5.m4v", + "type": 0, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", + "title": "5" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676358660379/6.m4v", + "type": 1, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", + "title": "6" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360154589/7.jpg", + "type": 0, + "cacheImgPath": "", + "title": "7" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360185500/8.jpg", + "type": 0, + "cacheImgPath": "", + "title": "8" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", + "type": 0, + "cacheImgPath": "", + "title": "9" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360274126/10.mp4", + "type": 1, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", + "title": "10" + } + ] + }, + "shuttlepassengerm2": { + "ads": [ + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678946244305/dalim2.mp4", + "type": 1, + "cacheImgPath": "", + "title": "1" + } + ] + } + }, + "dali": { + "shuttlepassenger": { + "ads": [ + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357256102/1.jpg", + "type": 0, + "cacheImgPath": "", + "title": "1" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", + "type": 0, + "cacheImgPath": "", + "title": "2" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357557335/3.mp4", + "type": 1, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png", + "title": "3" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", + "type": 0, + "cacheImgPath": "", + "title": "4" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357834634/5.m4v", + "type": 0, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", + "title": "5" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676358660379/6.m4v", + "type": 1, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg", + "title": "6" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360154589/7.jpg", + "type": 0, + "cacheImgPath": "", + "title": "7" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360185500/8.jpg", + "type": 0, + "cacheImgPath": "", + "title": "8" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", + "type": 0, + "cacheImgPath": "", + "title": "9" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360274126/10.mp4", + "type": 1, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png", + "title": "10" + } + ] + }, + "shuttlepassengerm2": { + "ads": [ + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678946244305/dalim2.mp4", + "type": 1, + "cacheImgPath": "", + "title": "1" + } + ] + } + }, + "yantai": { + "shuttlepassenger": { + "ads": [ + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1680774790614/yangmadao_photo.jpg", + "type": 1, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1680774847276/yangmadao_video.mp4", + "title": "1" + } + ] + }, + "shuttlepassengerm2": { + "ads": [ + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678946244305/dalim2.mp4", + "type": 1, + "cacheImgPath": "", + "title": "1" + } + ] + } + } +} diff --git a/app/urlConfig.json b/app/config/urlConfig.json similarity index 100% rename from app/urlConfig.json rename to app/config/urlConfig.json diff --git a/app/src/main/java/com/mogo/launcher/startup/ConfigStartUp.kt b/app/src/main/java/com/mogo/launcher/startup/ConfigStartUp.kt index 6e70b33d3e..b93b46cfa0 100644 --- a/app/src/main/java/com/mogo/launcher/startup/ConfigStartUp.kt +++ b/app/src/main/java/com/mogo/launcher/startup/ConfigStartUp.kt @@ -46,6 +46,8 @@ object ConfigStartUp { FunctionBuildConfig.urlJson = GsonUtils.fromJson(BuildConfig.URLs, UrlConfig::class.java) //不能启动自动驾驶的档位 FunctionBuildConfig.unableLaunchAutopilotGear = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR + // 临时配置json + FunctionBuildConfig.tempConfig = BuildConfig.tempConfig // // 这里影响当前Activity的身份信息,多进程先保持与原来一样,主进程为司机端,:passenger 进程为乘客端 TODO 暂时不启用,仅做洱海交付,独立乘客屏+宣传视频 // if (ProcessUtils.getCurrentProcessName().contains(":passenger")) { diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt index c02056061b..9403bc2da5 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt @@ -105,6 +105,16 @@ object FunctionBuildConfig { @JvmField var appIdentityMode = "Taxi_Driver_Base" + /** + * 临时配置json + * 广告json + * + */ + @Volatile + @JvmField + var tempConfig = "" + + /** * 配置连接工控机的IP地址 * 小巴车 192.168.8.102 From 4b9dd12accc7d12b0ffcc9199805849216ac833a Mon Sep 17 00:00:00 2001 From: yangyakun Date: Wed, 12 Apr 2023 20:51:13 +0800 Subject: [PATCH 18/23] =?UTF-8?q?[shuttle]=20[=E8=A7=86=E9=A2=91=E6=92=AD?= =?UTF-8?q?=E6=94=BE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/config/tempConfig.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/config/tempConfig.json b/app/config/tempConfig.json index e8d8cb38fb..edfa2e2ead 100644 --- a/app/config/tempConfig.json +++ b/app/config/tempConfig.json @@ -67,7 +67,7 @@ "shuttlepassengerm2": { "ads": [ { - "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678946244305/dalim2.mp4", + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681210902933/erhaim2.mp4", "type": 1, "cacheImgPath": "", "title": "1" @@ -143,7 +143,7 @@ "shuttlepassengerm2": { "ads": [ { - "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678946244305/dalim2.mp4", + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681210902933/erhaim2.mp4", "type": 1, "cacheImgPath": "", "title": "1" @@ -155,9 +155,9 @@ "shuttlepassenger": { "ads": [ { - "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1680774790614/yangmadao_photo.jpg", + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681210971943/yangmadou.mp4", "type": 1, - "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1680774847276/yangmadao_video.mp4", + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1680774790614/yangmadao_photo.jpg", "title": "1" } ] @@ -165,7 +165,7 @@ "shuttlepassengerm2": { "ads": [ { - "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678946244305/dalim2.mp4", + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681210902933/erhaim2.mp4", "type": 1, "cacheImgPath": "", "title": "1" From 0d4fceaadbb340b2ed6585c6d8b39d7b3f6a1314 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Wed, 12 Apr 2023 22:02:33 +0800 Subject: [PATCH 19/23] =?UTF-8?q?[shuttle]=20[=E8=A7=86=E9=A2=91=E6=92=AD?= =?UTF-8?q?=E6=94=BE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/config/tempConfig.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/config/tempConfig.json b/app/config/tempConfig.json index edfa2e2ead..eccb7d7646 100644 --- a/app/config/tempConfig.json +++ b/app/config/tempConfig.json @@ -1,6 +1,6 @@ { "mogo": { - "shuttlepassenger": { + "fochshuttlepassenger": { "ads": [ { "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357256102/1.jpg", @@ -64,7 +64,7 @@ } ] }, - "shuttlepassengerm2": { + "fochbuspassengerm2": { "ads": [ { "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681210902933/erhaim2.mp4", @@ -76,7 +76,7 @@ } }, "dali": { - "shuttlepassenger": { + "fochshuttlepassenger": { "ads": [ { "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357256102/1.jpg", @@ -140,7 +140,7 @@ } ] }, - "shuttlepassengerm2": { + "fochbuspassengerm2": { "ads": [ { "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681210902933/erhaim2.mp4", @@ -152,7 +152,7 @@ } }, "yantai": { - "shuttlepassenger": { + "fochshuttlepassenger": { "ads": [ { "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681210971943/yangmadou.mp4", @@ -162,7 +162,7 @@ } ] }, - "shuttlepassengerm2": { + "fochbuspassengerm2": { "ads": [ { "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681210902933/erhaim2.mp4", From 1ff26bf25b40781b50e2b8ca103cd4ade10ffb82 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Thu, 13 Apr 2023 10:20:31 +0800 Subject: [PATCH 20/23] =?UTF-8?q?[video]=20[=E8=A7=86=E9=A2=91=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E4=B8=8D=E8=83=BD=E8=AE=BE=E7=BD=AE=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E4=B8=8D=E8=AE=A9=E8=BD=AE=E6=92=AD=E4=B8=8D=E8=B5=B7=E6=9D=A5?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/config/tempConfig.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/config/tempConfig.json b/app/config/tempConfig.json index eccb7d7646..d6a0988f84 100644 --- a/app/config/tempConfig.json +++ b/app/config/tempConfig.json @@ -159,6 +159,12 @@ "type": 1, "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1680774790614/yangmadao_photo.jpg", "title": "1" + }, + { + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681210971943/yangmadou.mp4", + "type": 1, + "cacheImgPath": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1680774790614/yangmadao_photo.jpg", + "title": "2" } ] }, From 81e778aa84ea8b2becad7839aa20986d6a7f7645 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Thu, 13 Apr 2023 11:32:27 +0800 Subject: [PATCH 21/23] =?UTF-8?q?[video]=20[=E8=A7=86=E9=A2=91=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E5=9B=9E=E6=BB=9A]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/config/tempConfig.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/config/tempConfig.json b/app/config/tempConfig.json index d6a0988f84..0099a46a60 100644 --- a/app/config/tempConfig.json +++ b/app/config/tempConfig.json @@ -67,7 +67,7 @@ "fochbuspassengerm2": { "ads": [ { - "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681210902933/erhaim2.mp4", + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678946244305/dalim2.mp4", "type": 1, "cacheImgPath": "", "title": "1" @@ -143,7 +143,7 @@ "fochbuspassengerm2": { "ads": [ { - "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681210902933/erhaim2.mp4", + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678946244305/dalim2.mp4", "type": 1, "cacheImgPath": "", "title": "1" @@ -171,7 +171,7 @@ "fochbuspassengerm2": { "ads": [ { - "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1681210902933/erhaim2.mp4", + "path": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678946244305/dalim2.mp4", "type": 1, "cacheImgPath": "", "title": "1" From dbb570723952a1ba9591d7edfe4077de2c58f3c8 Mon Sep 17 00:00:00 2001 From: pangfan Date: Thu, 13 Apr 2023 20:46:49 +0800 Subject: [PATCH 22/23] =?UTF-8?q?[=E5=A4=A7=E7=90=86/=E7=83=9F=E5=8F=B0?= =?UTF-8?q?=E4=BA=A4=E4=BB=98]release=20v3.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 95037549ea..afacfe1894 100644 --- a/gradle.properties +++ b/gradle.properties @@ -93,8 +93,8 @@ WEBSOCKET_VERSION=1.1.7 applicationId=com.mogo.launcer applicationName=IntelligentPilot # RoboBus司机端:2.5.1;RoboTaxi司机端:2.5.1;RoboTaxi乘客端:1.0.0 -versionCode=3000000 -versionName=3.0.0 +versionCode=3010000 +versionName=3.1.0 ################# 新架构模块Maven版本管理 ################# MOGO_CORE_FUNCTION_HMI_VERSION=0.0.58.10 From 943abe317174095784e9c2546cdbd4a7d97fa5cc Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Fri, 14 Apr 2023 11:43:23 +0800 Subject: [PATCH 23/23] =?UTF-8?q?[dev=5Frobobus-d=5F230413=5F3.1.0]fix?= =?UTF-8?q?=E8=BD=A6=E9=80=9F=E8=AE=BE=E7=BD=AE=E5=85=89=E6=A0=87=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt index e4d55ce80c..2b5bbfbf0b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt @@ -165,6 +165,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( return@setOnTouchListener true } etInputSpeed.isFocusableInTouchMode = true + etInputSpeed.setSelection(speedLimit.toString().length) if (keyBoardUtil == null) { keyBoardUtil = KeyBoardUtil(sKeyBoardView, etInputSpeed) } @@ -191,6 +192,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( } else{ ToastUtils.showShort("车速不能再减了") } + etInputSpeed.setSelection(speedLimit.toString().length) } ivSpeedAdd.setOnClickListener { @@ -203,6 +205,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( } else{ ToastUtils.showShort("车速不能再加了") } + etInputSpeed.setSelection(speedLimit.toString().length) } //速度确认