Merge branch 'dev_minibus-d_230425_3.2.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_minibus-d_230425_3.2.0

This commit is contained in:
lixiaopeng
2023-05-30 14:17:37 +08:00
12 changed files with 198 additions and 68 deletions

View File

@@ -237,8 +237,11 @@ object CharterPassengerModel {
}
when (state) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
cleanRoutePoints()
CallerAutoPilotControlManager.getGlobalPath()
RxUtils.createSubscribe(5_000) {
cleanRoutePoints()
CallerLogger.d(M_BUS_P + TAG,"请求底盘轨迹")
CallerAutoPilotControlManager.getGlobalPath()
}
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {}
@@ -248,7 +251,7 @@ object CharterPassengerModel {
}
}
override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
CallerLogger.d(SceneConstant.M_BUS_P + TAG,"底盘给到站信息")
CallerLogger.d(M_BUS_P + TAG,"底盘给到站信息")
arriveDest()
}
}
@@ -387,7 +390,7 @@ object CharterPassengerModel {
}
}else {
// 判断是否有订单
ordrLagic(data?.data)
ordrLagic(data.data)
}
}
@@ -734,6 +737,7 @@ object CharterPassengerModel {
it,
mogoLocation
)
CallerLogger.d(M_BUS_P + TAG, "使用轨迹轨迹:${mRoutePoints?.size}--第一个点${mRoutePoints!![0]}--最后一个点:${mRoutePoints!!.last()}")
CallerLogger.d(M_BUS_P + "calculateDistance", "轨迹计算的距离$templastSumLength")
if(templastSumLength>100){
lastSumLength = templastSumLength

View File

@@ -145,6 +145,10 @@ class MainFragment :
}
}
debug_show_endview.setOnClickListener {
showOpenAndCloseDoor()
}
}
private fun openSettingPage(tab: String) {

View File

@@ -15,6 +15,8 @@ import com.mogo.och.bus.passenger.model.IOrderStatusChangeListener
import com.mogo.och.bus.passenger.model.OrderStatusEnum
import com.mogo.och.common.module.utils.DateTimeUtil
import kotlinx.android.synthetic.main.m1_bottom_orderinfo.view.*
import java.util.UUID
import kotlin.random.Random
open class BottomOrderInfoView @JvmOverloads constructor(
context: Context,
@@ -33,6 +35,7 @@ open class BottomOrderInfoView @JvmOverloads constructor(
} catch (e: Exception) {
e.printStackTrace()
}
tag = UUID.randomUUID().toString()
}
fun setCheck(isCheck:Boolean){
@@ -51,16 +54,16 @@ open class BottomOrderInfoView @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerLogger.d(SceneConstant.M_BUS_P + TAG,"onAttachedToWindow$this")
CharterPassengerModel.setOrderLeftTimeListeners(this.toString(),this)
CharterPassengerModel.setStatusChangeListener(this.toString(),this)
CallerLogger.d(SceneConstant.M_BUS_P + TAG,"onAttachedToWindow$tag")
CharterPassengerModel.setOrderLeftTimeListeners(tag.toString(),this)
CharterPassengerModel.setStatusChangeListener(tag.toString(),this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerLogger.d(SceneConstant.M_BUS_P + TAG,"onDetachedFromWindow$this")
CharterPassengerModel.setOrderLeftTimeListeners(this.toString(),null)
CharterPassengerModel.setStatusChangeListener(this.toString(),null)
CallerLogger.d(SceneConstant.M_BUS_P + TAG,"onDetachedFromWindow$tag")
CharterPassengerModel.setOrderLeftTimeListeners(tag.toString(),null)
CharterPassengerModel.setStatusChangeListener(tag.toString(),null)
}
private fun setViewByOrderStatus(currentOrderStatus: OrderStatusEnum) {

View File

@@ -15,6 +15,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.och.bus.passenger.utils.ToastCharterUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.callback.ICharterPassengerAutoStatusChangeCallback
@@ -65,6 +66,10 @@ class GoViewWithArrive @JvmOverloads constructor(
}
})
setOnClickListener {
if (ClickUtils.isClickTooFrequent(this,3000)) {
ToastCharterUtils.showShort("请稍后点击")
return@setOnClickListener
}
startGo()
applyClickListener?.onApplyClick()
}

View File

@@ -278,9 +278,19 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="显示结束页面"
android:id="@+id/debug_show_endview"
app:layout_constraintTop_toBottomOf="@+id/debug_change_modle"
android:layout_marginTop="@dimen/dp_17"
app:layout_constraintEnd_toEndOf="@+id/mapBizView"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.constraintlayout.widget.Group
android:id="@+id/group_debug"
app:constraint_referenced_ids="debug_arrive_dest,debug_show_noviceGuidance,debug_change_modle"
app:constraint_referenced_ids="debug_arrive_dest,debug_show_noviceGuidance,debug_change_modle,debug_show_endview"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

View File

@@ -4,64 +4,72 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/m1_function_bg"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/charter_end_order_openclosedoor"
android:clickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1031:500"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginBottom="@dimen/dp_181"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_percent="0.53698">
<!-- 结束包车 后展示的界面 根据车辆状态来显示 -->
<ImageView
android:id="@+id/iv_end_order_opendoor"
android:layout_width="@dimen/dp_108"
android:layout_height="@dimen/dp_108"
android:layout_marginBottom="@dimen/dp_100"
android:src="@drawable/m1_order_end_opendoor_selecotr"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/iv_end_order_closedoor"
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/iv_end_order_closedoor"
android:layout_width="@dimen/dp_108"
android:layout_height="@dimen/dp_108"
android:layout_marginBottom="@dimen/dp_100"
android:src="@drawable/m1_order_end_closedoor_selecotr"
android:layout_width="match_parent"
android:background="@drawable/m1_function_bg"
android:layout_marginEnd="@dimen/dp_5"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/charter_end_order_openclosedoor"
android:clickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1031:500"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_end_order_opendoor" />
android:layout_marginBottom="@dimen/dp_181"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_percent="0.53698">
<!-- 结束包车 后展示的界面 根据车辆状态来显示 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_19"
android:text="开车门"
android:textColor="@color/bus_p_m1_23293b"
android:textSize="@dimen/dp_28"
app:layout_constraintEnd_toEndOf="@+id/iv_end_order_opendoor"
app:layout_constraintStart_toStartOf="@+id/iv_end_order_opendoor"
app:layout_constraintTop_toBottomOf="@+id/iv_end_order_opendoor" />
<ImageView
android:id="@+id/iv_end_order_opendoor"
android:layout_width="@dimen/dp_108"
android:layout_height="@dimen/dp_108"
android:layout_marginBottom="@dimen/dp_100"
android:src="@drawable/m1_order_end_opendoor_selecotr"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/iv_end_order_closedoor"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_19"
android:text="关车门"
android:textColor="@color/bus_p_m1_23293b"
android:textSize="@dimen/dp_28"
app:layout_constraintEnd_toEndOf="@+id/iv_end_order_closedoor"
app:layout_constraintStart_toStartOf="@+id/iv_end_order_closedoor"
app:layout_constraintTop_toBottomOf="@+id/iv_end_order_closedoor" />
<ImageView
android:id="@+id/iv_end_order_closedoor"
android:layout_width="@dimen/dp_108"
android:layout_height="@dimen/dp_108"
android:layout_marginBottom="@dimen/dp_100"
android:src="@drawable/m1_order_end_closedoor_selecotr"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_end_order_opendoor" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_19"
android:text="开车门"
android:textColor="@color/bus_p_m1_23293b"
android:textSize="@dimen/dp_28"
app:layout_constraintEnd_toEndOf="@+id/iv_end_order_opendoor"
app:layout_constraintStart_toStartOf="@+id/iv_end_order_opendoor"
app:layout_constraintTop_toBottomOf="@+id/iv_end_order_opendoor" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_19"
android:text="关车门"
android:textColor="@color/bus_p_m1_23293b"
android:textSize="@dimen/dp_28"
app:layout_constraintEnd_toEndOf="@+id/iv_end_order_closedoor"
app:layout_constraintStart_toStartOf="@+id/iv_end_order_closedoor"
app:layout_constraintTop_toBottomOf="@+id/iv_end_order_closedoor" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -26,7 +26,7 @@ buildscript {
dependencies {
classpath "com.android.tools.build:gradle:${gradle_version}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
classpath "com.alibaba:arouter-register:${plugin_version}"
classpath "com.alibaba:arouter-register:10.0.5_mogo"
classpath 'com.tencent.bugly:symtabfileuploader:2.2.1'
classpath "com.bytedance.android.byteX:base-plugin:${plugin_version}"
classpath "com.mogo.cloud:hook:${plugin_version}"

View File

@@ -65,7 +65,9 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
import com.mogo.eagle.core.function.hmi.ui.map.OfflineMapDialog
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.function.hmi.ui.widget.SystemVersionView
import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -76,6 +78,7 @@ import com.mogo.eagle.core.utilcode.mogo.permissions.BackgrounderPermission
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.hdcache.IHdCacheListener
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.map.uicontroller.VisualAngleMode.*
import kotlinx.android.synthetic.main.view_debug_setting.view.*
@@ -180,6 +183,9 @@ internal class DebugSettingView @JvmOverloads constructor(
private var isStarted = false
// 高精地图是否已缓存
private var isHDCached = false
init {
LayoutInflater.from(context).inflate(R.layout.view_debug_setting, this, true)
initView()
@@ -571,6 +577,32 @@ internal class DebugSettingView @JvmOverloads constructor(
}
}
btn_cache_hd_map?.onClick {
if (isHDCached) {
ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded))
} else {
if (CallerMapUIServiceManager.getCityCode().isNullOrEmpty()) {// 未拿到高德的cityCode
if (mGnssInfo == null || (mGnssInfo!!.longitude <= 0.0 && mGnssInfo!!.latitude <= 0.0)) {// 未拿到高精的经纬度
ToastUtils.showShort(resources.getString(R.string.location_try_again))
} else {// 拿到了高精的经纬度
cacheHDOfflineData(false)
}
} else {// 拿到高德的cityCode
cacheHDOfflineData(true)
}
}
}
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
ThreadUtils.getIoPool().execute {
val isCached = CallerMapUIServiceManager.isCityDataCached()
isHDCached = isCached
UiThreadHandler.post {
btn_cache_hd_map.text = "缓存高精离线地图(${if (isCached) "已是最新版" else "待更新"}!)"
}
}
btn_cache_hd_map.visibility = View.VISIBLE
}
/**
* 修改自车按钮(出租车、小巴车)
@@ -2123,6 +2155,52 @@ internal class DebugSettingView @JvmOverloads constructor(
Process.killProcess(Process.myPid())
}
private fun cacheHDOfflineData(isGaoDe: Boolean) {
var progss = 0
if (isGaoDe) {// 拿到了高德地图的cityCode
CallerMapUIServiceManager.cacheHDDataByCity(object : IHdCacheListener {
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
// 更新进度
progss = progress.toInt()
if (progss == 100) {
isHDCached = true
btn_cache_hd_map.text = "缓存高精离线地图(已是最新版!)"
} else {
btn_cache_hd_map.text = "缓存高精离线地图(进度:${progss}%)"
}
}
override fun onMapHdCacheResult(cityId: Int, state: Int) {
if (state == 0) {// 失败
btn_cache_hd_map.text = "缓存高精离线地图(下载失败!)"
ToastUtils.showShort("下载失败,请重试!")
}
}
})
} else {// 只拿到了高精的经纬度
mGnssInfo?.let { loc ->
CallerMapUIServiceManager.cacheHDDataByCityByLonLat(object : IHdCacheListener {
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
progss = progress.toInt()
if (progss == 100) {
isHDCached = true
btn_cache_hd_map.text = "缓存高精离线地图(已是最新版!)"
} else {
btn_cache_hd_map.text = "缓存高精离线地图(进度:${progss}%)"
}
}
override fun onMapHdCacheResult(cityId: Int, state: Int) {
if (state == 0) {// 失败
btn_cache_hd_map.text = "缓存高精离线地图(下载失败!)"
ToastUtils.showShort("下载失败,请重试!")
}
}
}, loc)
}
}
}
override fun fwThreadClose() {
refreshTraceInfo()
}

View File

@@ -1560,6 +1560,21 @@
app:layout_constraintRight_toRightOf="@id/changesight_cross_btn"
app:layout_constraintTop_toBottomOf="@id/changesight_cross_btn" />
<Button
android:id="@+id/btn_cache_hd_map"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:gravity="center"
android:text="缓存高精离线地图"
android:padding="@dimen/dp_20"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toRightOf="@id/reset_changesight"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/changesight_far_btn"
android:visibility="gone"
/>
<ToggleButton
android:id="@+id/tbChangeCurrentCarIcon"
android:layout_width="0dp"

View File

@@ -113,7 +113,11 @@ object MarkerDrawerManager {
baseDiffDis = diff
// 距离最近的时候判断是否走过
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(realLon, realLat, latLng.longitude, latLng.latitude, heading) >= 90) {
currentIndex = i
currentIndex = if (i < lastArrivedIndex) {
lastArrivedIndex
} else {
i
}
}
}
}

View File

@@ -146,7 +146,6 @@ ADAS_DATA_LIB_CHILD_VERSION=.4
# 是否支持patch升级
PATCH_UPGRADE_SUPPORT=true
MOGO_PLUGIN_VERSION=1.0.0.31
# 线程优化版本
THREAD_OPT_VERSION=4.0.1

View File

@@ -1084,7 +1084,7 @@ public class AMapViewWrapper implements IMogoMapView,
if (hdCacheListener != null) {
hdCacheListener.onMapHdCacheProgress(cityId, progress * 100);
}
});
}, UiThreadHandler.MODE.QUEUE);
}
}
@@ -1099,7 +1099,7 @@ public class AMapViewWrapper implements IMogoMapView,
if (hdCacheListener != null) {
hdCacheListener.onMapHdCacheResult(i, state);
}
});
}, UiThreadHandler.MODE.QUEUE);
}
}
});
@@ -1124,7 +1124,7 @@ public class AMapViewWrapper implements IMogoMapView,
if (hdCacheListener != null) {
hdCacheListener.onMapHdCacheProgress(cityId, progress * 100);
}
});
}, UiThreadHandler.MODE.QUEUE);
}
}
@@ -1139,7 +1139,7 @@ public class AMapViewWrapper implements IMogoMapView,
if (hdCacheListener != null) {
hdCacheListener.onMapHdCacheResult(i, state);
}
});
}, UiThreadHandler.MODE.QUEUE);
}
}
});