From 6628c735fa23ffafb32c4322c4b4e8764a977901 Mon Sep 17 00:00:00 2001 From: renwj Date: Tue, 15 Oct 2024 12:18:06 +0800 Subject: [PATCH 1/9] =?UTF-8?q?[6.7.0][=E8=BF=90=E8=90=A5=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF]=20=E8=9E=8D=E5=90=88=E6=A8=A1=E5=BC=8F=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/operate/OperatePanelLayout.kt | 184 +++++++++++++----- .../preferences/PreferenceWithSpeedSetting.kt | 9 +- ...nel_preference_widget_edit_with_button.xml | 3 +- 3 files changed, 146 insertions(+), 50 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt index dd19d91f7e..dfd6c591e8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt @@ -25,6 +25,7 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig import com.mogo.eagle.core.data.multidisplay.TelematicConstant import com.mogo.eagle.core.data.obu.MogoObuConst import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener +import com.mogo.eagle.core.function.api.autopilot.IMoGoGetParamResponseListener import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangProvider import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_DEMO @@ -33,6 +34,7 @@ import com.mogo.eagle.core.function.api.setting.ISopSettingListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotGetParamResponseDispatcher import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager @@ -58,6 +60,8 @@ import com.mogo.eagle.core.utilcode.mogo.vehicle.SweeperVehicleConfigUtils import com.mogo.eagle.core.utilcode.rv.divider.CommonDividerItemDecoration import com.mogo.eagle.core.utilcode.util.AppStateManager import com.mogo.eagle.core.utilcode.util.ToastUtils +import com.zhjt.mogo.adas.data.AdasConstants +import com.zhjt.mogo.adas.data.bean.AdasParam import kotlinx.android.synthetic.main.layout_operate_panel.view.iv_operate_panel_close import kotlinx.coroutines.launch import me.jessyan.autosize.utils.AutoSizeUtils @@ -915,7 +919,7 @@ class OperatePanelLayout : LinearLayout { } } - class VehiclesPreferenceFragmentCompat : OperatePanelDetailBase(), IMoGoAutopilotCarConfigListener, ISopSettingListener, IViewControlListener { + class VehiclesPreferenceFragmentCompat : OperatePanelDetailBase(), IMoGoAutopilotCarConfigListener, ISopSettingListener, IViewControlListener, IMoGoGetParamResponseListener { companion object { private const val TAG = "VehiclesPreferenceFragmentCompat" private const val KEY_PNC_PARK_INTERSECTION_CAR = "pnc_park_intersection_car" @@ -938,15 +942,28 @@ class OperatePanelLayout : LinearLayout { private var prevCheckedKeyForFusionMode: String? = null override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { + Logger.d(TAG, "--- onCreateView --- 1 ---") if (AppConfigInfo.isConnectAutopilot) { - CallerAutoPilotControlManager.getCarConfig() + Logger.d(TAG, "--- onCreateView --- 2 ---") //获取车辆配置 + CallerAutoPilotControlManager.getCarConfig() //查询融合模式 + CallerAutoPilotControlManager.sendGetParamReq(AdasConstants.MapSystemParamType.FUSION_MODE) + CallerAutoPilotControlManager.sendGetParamReq(AdasConstants.MapSystemParamType.OVERTAKE_MAX_SPEED) } + CallerAutopilotGetParamResponseDispatcher.addListener(TAG, this) CallerAutopilotCarConfigListenerManager.addListener(TAG, this) CallerSopSettingManager.addListener(TAG, this) CallerHmiViewControlListenerManager.addListener(TAG, this) return super.onCreateView(inflater, container, savedInstanceState) } + override fun onDestroyView() { + CallerAutopilotGetParamResponseDispatcher.removeListener(TAG) + CallerAutopilotCarConfigListenerManager.removeListener(TAG) + CallerSopSettingManager.removeListener(TAG) + CallerHmiViewControlListenerManager.removeListener(TAG) + super.onDestroyView() + } + override fun updateFuncMode(tag: String, boolean: Boolean) { super.updateFuncMode(tag, boolean) if (tag == FUNC_MODE_RAIN) { @@ -957,11 +974,86 @@ class OperatePanelLayout : LinearLayout { } } - override fun onDestroyView() { - CallerAutopilotCarConfigListenerManager.removeListener(TAG) - CallerSopSettingManager.removeListener(TAG) - CallerHmiViewControlListenerManager.removeListener(TAG) - super.onDestroyView() + override fun onGetParamResp(header: MessagePad.Header, getParamResp: MessagePad.SetParamReq, adasParam: AdasParam) { + Logger.d(TAG, "-- onGetParamResp --: fusion-mode:${adasParam.fusionMode}, over-take-speed:${adasParam.overtakeMaxSpeed} ") + lifecycleScope.launch { + when(FunctionBuildConfig.fusionMode) { + 1 -> { + //全融合模式 + FunctionBuildConfig.fusionMode = 1 + prevCheckedKeyForFusionMode?.takeIf { it != KEY_ALL_MERGE_MODE }?.let { + preferenceScreen.findPreferenceReal(it) + }?.also { + changeValue(it, false) + } + prevCheckedKeyForFusionMode = KEY_ALL_MERGE_MODE + preferenceScreen.findPreferenceReal(KEY_ALL_MERGE_MODE)?.also { + it.extras.putBoolean("is_checked", true) + changeValue(it, true) + } + } + 2 -> { + //盲区模式 + FunctionBuildConfig.fusionMode = 2 + prevCheckedKeyForFusionMode?.takeIf { it != KEY_BLIND_AREA_MODE }?.let { + preferenceScreen.findPreferenceReal(it) + }?.also { + changeValue(it, false) + } + prevCheckedKeyForFusionMode = KEY_BLIND_AREA_MODE + preferenceScreen.findPreferenceReal(KEY_BLIND_AREA_MODE)?.also { + it.extras.putBoolean("is_checked", true) + changeValue(it, true) + } + } + 3 -> { + //超视距模式 + FunctionBuildConfig.fusionMode = 3 + prevCheckedKeyForFusionMode?.takeIf { it != KEY_BEYOND_VISUAL_RANGE_MODE }?.let { + preferenceScreen.findPreferenceReal(it) + }?.also { + changeValue(it, false) + } + prevCheckedKeyForFusionMode = KEY_BEYOND_VISUAL_RANGE_MODE + preferenceScreen.findPreferenceReal(KEY_BEYOND_VISUAL_RANGE_MODE)?.also { + it.extras.putBoolean("is_checked", true) + changeValue(it, true) + } + } + 4 -> { + //透传模式 + FunctionBuildConfig.fusionMode = 4 + prevCheckedKeyForFusionMode?.takeIf { it != KEY_TRANSPARENT_TRANSFER_MODE }?.let { + preferenceScreen.findPreferenceReal(it) + }?.also { + changeValue(it, false) + } + prevCheckedKeyForFusionMode = KEY_TRANSPARENT_TRANSFER_MODE + preferenceScreen.findPreferenceReal(KEY_TRANSPARENT_TRANSFER_MODE)?.also { + it.extras.putBoolean("is_checked", true) + changeValue(it, true) + } + } + 5 -> { + //纯路侧模式 + FunctionBuildConfig.fusionMode = 5 + prevCheckedKeyForFusionMode?.takeIf { it != KEY_PURE_OBU_MODE }?.let { + preferenceScreen.findPreferenceReal(it) + }?.also { + changeValue(it, false) + } + prevCheckedKeyForFusionMode = KEY_PURE_OBU_MODE + preferenceScreen.findPreferenceReal(KEY_PURE_OBU_MODE)?.also { + it.extras.putBoolean("is_checked", true) + changeValue(it, true) + } + } + } + if (adasParam.overtakeMaxSpeed > 0) { + FunctionBuildConfig.overTakeSpeed = adasParam.overtakeMaxSpeed + preferenceScreen.findPreferenceReal(KEY_OVERTAKE_SPEED_THRESHOLDSS)?.update(listOf("3.0", "12.5", "${FunctionBuildConfig.overTakeSpeed}", "0.5", "m/s")) + } + } } override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { @@ -983,7 +1075,7 @@ class OperatePanelLayout : LinearLayout { lifecycleScope.launch { if (carConfigResp.speedLimit > 0) { FunctionBuildConfig.maxSpeedLimit = min(carConfigResp.speedLimit * 3.6, 60.0) - preferenceScreen.findPreferenceReal(KEY_AUTO_PILOT_SPEED_THRESHOLDS)?.update(listOf("0", "60.0", "${FunctionBuildConfig.maxSpeedLimit}", "5")) + preferenceScreen.findPreferenceReal(KEY_AUTO_PILOT_SPEED_THRESHOLDS)?.update(listOf("0", "60.0", "${FunctionBuildConfig.maxSpeedLimit}", "5", "km/h")) } } } @@ -1018,48 +1110,28 @@ class OperatePanelLayout : LinearLayout { return FunctionBuildConfig.isFaultSlowDown } KEY_ALL_MERGE_MODE -> { - val checked = FunctionBuildConfig.fusionMode == 1 - if (checked) { - prevCheckedKeyForFusionMode = KEY_ALL_MERGE_MODE - } - return checked + return false } KEY_BLIND_AREA_MODE -> { - val checked = FunctionBuildConfig.fusionMode == 2 - if (checked) { - prevCheckedKeyForFusionMode = KEY_BLIND_AREA_MODE - } - return checked + return false } KEY_BEYOND_VISUAL_RANGE_MODE -> { - val checked = FunctionBuildConfig.fusionMode == 3 - if (checked) { - prevCheckedKeyForFusionMode = KEY_BEYOND_VISUAL_RANGE_MODE - } - return checked + return false } KEY_TRANSPARENT_TRANSFER_MODE -> { - val checked = FunctionBuildConfig.fusionMode == 4 - if (checked) { - prevCheckedKeyForFusionMode = KEY_TRANSPARENT_TRANSFER_MODE - } - return checked + return false } KEY_PURE_OBU_MODE -> { - val checked = FunctionBuildConfig.fusionMode == 5 - if (checked) { - prevCheckedKeyForFusionMode = KEY_PURE_OBU_MODE - } - return checked + return false } KEY_AUTO_PILOT_SPEED_THRESHOLDS -> { - return listOf("0.0", "60.0", "${FunctionBuildConfig.maxSpeedLimit}", "5.0") + return listOf("0.0", "60.0", "${FunctionBuildConfig.maxSpeedLimit}", "5.0", "km/h") } KEY_CHANGE_LANE_SPEED_THRESHOLDS -> { - return listOf("3.0", "7.0", "${FunctionBuildConfig.detouringSpeed}", "0.5") + return listOf("3.0", "7.0", "${FunctionBuildConfig.detouringSpeed}", "0.5", "m/s") } KEY_OVERTAKE_SPEED_THRESHOLDSS -> { - return listOf("3.0", "12.5", "${FunctionBuildConfig.overTakeSpeed}", "0.5") + return listOf("3.0", "12.5", "${FunctionBuildConfig.overTakeSpeed}", "0.5", "m/s") } } return super.getDefaultVal(pref) @@ -1181,6 +1253,10 @@ class OperatePanelLayout : LinearLayout { return true } KEY_ALL_MERGE_MODE -> { + if (preference.extras.containsKey("is_checked")) { + preference.extras.remove("is_checked") + return true + } val isChecked = newValue as? Boolean ?: false if (isChecked) { FunctionBuildConfig.fusionMode = 1 @@ -1197,6 +1273,10 @@ class OperatePanelLayout : LinearLayout { return isChecked } KEY_BLIND_AREA_MODE -> { + if (preference.extras.containsKey("is_checked")) { + preference.extras.remove("is_checked") + return true + } val isChecked = newValue as? Boolean ?: false if (isChecked) { FunctionBuildConfig.fusionMode = 2 @@ -1213,15 +1293,19 @@ class OperatePanelLayout : LinearLayout { return isChecked } KEY_BEYOND_VISUAL_RANGE_MODE -> { + if (preference.extras.containsKey("is_checked")) { + preference.extras.remove("is_checked") + return true + } val isChecked = newValue as? Boolean ?: false if (isChecked) { FunctionBuildConfig.fusionMode = 3 prevCheckedKeyForFusionMode?.takeIf { it != KEY_BEYOND_VISUAL_RANGE_MODE }?.let { - preferenceScreen.findPreferenceReal(it) - }?.also { - prevCheckedKeyForFusionMode = KEY_BEYOND_VISUAL_RANGE_MODE - changeValue(it, false) - } + preferenceScreen.findPreferenceReal(it) + }?.also { + prevCheckedKeyForFusionMode = KEY_BEYOND_VISUAL_RANGE_MODE + changeValue(it, false) + } hmiAction("SOP 融合模式, ", FunctionBuildConfig.fusionMode) clickEventAnalytics("融合模式", true) CallerAutoPilotControlManager.sendFusionMode(FunctionBuildConfig.fusionMode) @@ -1229,15 +1313,19 @@ class OperatePanelLayout : LinearLayout { return isChecked } KEY_TRANSPARENT_TRANSFER_MODE -> { + if (preference.extras.containsKey("is_checked")) { + preference.extras.remove("is_checked") + return true + } val isChecked = newValue as? Boolean ?: false if (isChecked) { FunctionBuildConfig.fusionMode = 4 prevCheckedKeyForFusionMode?.takeIf { it != KEY_TRANSPARENT_TRANSFER_MODE }?.let { - preferenceScreen.findPreferenceReal(it) - }?.also { - prevCheckedKeyForFusionMode = KEY_TRANSPARENT_TRANSFER_MODE - changeValue(it, false) - } + preferenceScreen.findPreferenceReal(it) + }?.also { + prevCheckedKeyForFusionMode = KEY_TRANSPARENT_TRANSFER_MODE + changeValue(it, false) + } hmiAction("SOP 融合模式, ", FunctionBuildConfig.fusionMode) clickEventAnalytics("融合模式", true) CallerAutoPilotControlManager.sendFusionMode(FunctionBuildConfig.fusionMode) @@ -1245,6 +1333,10 @@ class OperatePanelLayout : LinearLayout { return isChecked } KEY_PURE_OBU_MODE -> { + if (preference.extras.containsKey("is_checked")) { + preference.extras.remove("is_checked") + return true + } val isChecked = newValue as? Boolean ?: false if (isChecked) { FunctionBuildConfig.fusionMode = 5 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithSpeedSetting.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithSpeedSetting.kt index 1164fc41f1..4647c88469 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithSpeedSetting.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/preferences/PreferenceWithSpeedSetting.kt @@ -42,13 +42,14 @@ class PreferenceWithSpeedSetting : Preference { override fun onBindViewHolder(holder: PreferenceViewHolder) { super.onBindViewHolder(holder) val speedData = mSpeedData ?: return - if (speedData !is List<*> || speedData.size != 4) { + if (speedData !is List<*> || speedData.size != 5) { throw AssertionError() } val min = (speedData.elementAt(0) as String).toDouble() val max = (speedData.elementAt(1) as String).toDouble() var cur = (speedData.elementAt(2) as String).toDouble() val step = (speedData.elementAt(3) as String).toDouble() + val unit = speedData.elementAt(4) as String if (min > max) { throw AssertionError() } @@ -60,6 +61,8 @@ class PreferenceWithSpeedSetting : Preference { } val ll = holder.findViewById(R.id.ll_speed) val btnOk = holder.findViewById(R.id.bt_ok) + val speedUnit = holder.findViewById(R.id.tv_speed_unit) as? TextView + speedUnit?.text = unit val speedLimit = holder.findViewById(R.id.tv_speed_limit) as? TextView if (cache.containsKey(key)) { cur = max(cur, cache[key] ?: 0.0) @@ -73,7 +76,7 @@ class PreferenceWithSpeedSetting : Preference { minus.onClickWidthDuration(100) { val minusAfter = cur - step if (minusAfter < min) { - ToastUtils.showShort("阈值最小可为${BigDecimal.valueOf(min).setScale(1)}km/h") + ToastUtils.showShort("阈值最小为${BigDecimal.valueOf(min).setScale(1)}$unit") return@onClickWidthDuration } cur = minusAfter @@ -89,7 +92,7 @@ class PreferenceWithSpeedSetting : Preference { add.onClickWidthDuration(100) { val addAfter = cur + step if (addAfter > max) { - ToastUtils.showShort("阈值最大可为${BigDecimal.valueOf(max).setScale(1)}km/h") + ToastUtils.showShort("阈值最大为${BigDecimal.valueOf(max).setScale(1)}$unit") return@onClickWidthDuration } holder.itemView.isEnabled = false diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_edit_with_button.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_edit_with_button.xml index fde0695380..7c77ecc177 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_edit_with_button.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_edit_with_button.xml @@ -47,11 +47,12 @@ From a537dee56ab282a82047802ce2b535a7650761e8 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Tue, 15 Oct 2024 13:57:29 +0800 Subject: [PATCH 2/9] =?UTF-8?q?[6.7.0]=20[fix]=20[=E6=B7=BB=E5=8A=A0mark?= =?UTF-8?q?=20=E5=BC=82=E6=AD=A5=E9=97=AE=E9=A2=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/weaknet/model/LineModel.kt | 4 ---- .../com/mogo/och/weaknet/model/OrderModel.kt | 19 +++++-------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/LineModel.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/LineModel.kt index ad1efeea92..848cd531f3 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/LineModel.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/LineModel.kt @@ -249,10 +249,6 @@ object LineModel { } } - // 到站 - fun arrivedStation() { - - } fun arrivedStationSuccess(){ mBusLinesCallbackMap.forEach {callback-> callback.value.onArriveStationSuccess() diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt index 91d02508ef..429d4d6b2e 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt @@ -267,11 +267,15 @@ object OrderModel { * 渲染站点信息 * 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站, * 车机端展示 三站: 中间为即将到到达或者刚到达的站 + * queryBusRoutes + * queryBusRoutes + * queryBusRoutes + * driveToNextStation + * onArriveAt */ private fun updateBusStatus() { val (startStation, endStation) = LineManager.getStations() if(startStation!=null&&endStation!=null){ - MapMakerManager.removeAllMapMarkerByOwner(TAG) if(startStation.isLeaving){// 出发需要移除 MapMakerManager.removeMapMaker(BusConst.BUS_START_MAP_MAKER,startStation.lat,startStation.lon) }else{// 为出发展示 @@ -378,19 +382,6 @@ object OrderModel { //MAP 280 每隔100ms左右返回一次到站, 导致在到达中间站后再次滑动出发后会有时间差,收到一次到站,出现问题 //此处比对 自驾告诉的到站站点坐标和本地应到站站点坐标, 一致时才能到站 LineManager.getStations { start, end -> - if (data != null && data.endLocation != null) { - val latitude = NumberFormatUtil.cutOutNumber(data.endLocation.latitude, 5) //wgs - val longitude = NumberFormatUtil.cutOutNumber(data.endLocation.longitude, 5) - - val arriveLat = NumberFormatUtil.cutOutNumber(end.lat, 5) - val arriveLon = NumberFormatUtil.cutOutNumber(end.lon, 5) - - if (latitude != arriveLat || longitude != arriveLon) { - e(M_BUS + TAG, "行程日志-到站拦截,到站坐标不一致") - OchChainLogManager.writeChainLog("shuttle弱网","$type 行程日志-到站拦截,到站坐标不一致") - return@getStations - } - } if (isArrivedStation) return@getStations From e5b58a731935da939111df34a715d763deb49f32 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Tue, 15 Oct 2024 14:24:41 +0800 Subject: [PATCH 3/9] =?UTF-8?q?[6.7.0]=20[fix]=20[=E6=96=87=E6=A1=88?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/shuttle_weak_switch_line.xml | 12 ++++++------ .../src/main/res/layout/shuttle_weak_switch_task.xml | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/OCH/shuttle/driver_weaknet/src/main/res/layout/shuttle_weak_switch_line.xml b/OCH/shuttle/driver_weaknet/src/main/res/layout/shuttle_weak_switch_line.xml index 80180f639b..2aa5f7ad18 100644 --- a/OCH/shuttle/driver_weaknet/src/main/res/layout/shuttle_weak_switch_line.xml +++ b/OCH/shuttle/driver_weaknet/src/main/res/layout/shuttle_weak_switch_line.xml @@ -47,16 +47,16 @@ app:layout_constraintTop_toBottomOf="@+id/actv_last_refresh_date" app:layout_constraintBottom_toBottomOf="parent" android:layout_marginTop="@dimen/dp_22" /> - - + app:layout_constraintTop_toTopOf="parent" + android:layout_width="wrap_content" + android:layout_height="wrap_content"/> \ No newline at end of file diff --git a/OCH/shuttle/driver_weaknet/src/main/res/layout/shuttle_weak_switch_task.xml b/OCH/shuttle/driver_weaknet/src/main/res/layout/shuttle_weak_switch_task.xml index 6724fa0837..328b10aae9 100644 --- a/OCH/shuttle/driver_weaknet/src/main/res/layout/shuttle_weak_switch_task.xml +++ b/OCH/shuttle/driver_weaknet/src/main/res/layout/shuttle_weak_switch_task.xml @@ -101,16 +101,16 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" /> - + app:layout_constraintTop_toTopOf="parent" + android:layout_width="wrap_content" + android:layout_height="wrap_content"/> Date: Tue, 15 Oct 2024 14:35:49 +0800 Subject: [PATCH 4/9] =?UTF-8?q?[6.7.0][=E8=BF=90=E8=90=A5=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF]=20=E8=9E=8D=E5=90=88=E6=A8=A1=E5=BC=8F=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=962?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt index dfd6c591e8..2d5e45b4c1 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt @@ -977,7 +977,7 @@ class OperatePanelLayout : LinearLayout { override fun onGetParamResp(header: MessagePad.Header, getParamResp: MessagePad.SetParamReq, adasParam: AdasParam) { Logger.d(TAG, "-- onGetParamResp --: fusion-mode:${adasParam.fusionMode}, over-take-speed:${adasParam.overtakeMaxSpeed} ") lifecycleScope.launch { - when(FunctionBuildConfig.fusionMode) { + when(adasParam.fusionMode) { 1 -> { //全融合模式 FunctionBuildConfig.fusionMode = 1 From 7305f6172acaa2177ce5e54c1e4168f496ed2b0a Mon Sep 17 00:00:00 2001 From: yangyakun Date: Tue, 15 Oct 2024 14:44:36 +0800 Subject: [PATCH 5/9] =?UTF-8?q?[6.7.0]=20[fix]=20[=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E7=8F=AD=E6=AC=A1=E6=88=90=E5=8A=9F=E5=90=8E=E9=87=8D=E7=BD=AE?= =?UTF-8?q?=E7=8F=AD=E6=AC=A1]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/och/weaknet/ui/switchtask/SwitchTaskView.kt | 4 ++++ .../com/mogo/och/weaknet/ui/switchtask/SwtichTaskModel.kt | 2 ++ 2 files changed, 6 insertions(+) diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/switchtask/SwitchTaskView.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/switchtask/SwitchTaskView.kt index f8a05a838d..b4e01f4b66 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/switchtask/SwitchTaskView.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/switchtask/SwitchTaskView.kt @@ -154,6 +154,10 @@ class SwitchTaskView: WindowRelativeLayout, SwtichTaskModel.SwtichLineViewCallba viewbizModel?.showSwitchTaskInfo() } + override fun resetRecycleView() { + mAdapter.setDataList(mutableListOf()) + } + private fun showEmptyView(){ actv_submit_task.setTextColor(ResourcesUtils.getColor(R.color.bus_color_66666)) actv_submit_task.isEnabled = false diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/switchtask/SwtichTaskModel.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/switchtask/SwtichTaskModel.kt index ed4c3005ef..287799a79d 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/switchtask/SwtichTaskModel.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/switchtask/SwtichTaskModel.kt @@ -77,6 +77,7 @@ class SwtichTaskModel : ViewModel(), IBusLinesCallback { fun hideLoading() fun startTaskSuccess() fun showErrorInfo() + fun resetRecycleView() } fun onBusLineTasks(o: MutableList?) { @@ -96,6 +97,7 @@ class SwtichTaskModel : ViewModel(), IBusLinesCallback { BizLoopManager.runInMainThread{ viewCallback?.hideLoading() viewCallback?.startTaskSuccess() + viewCallback?.resetRecycleView() } } // 选择线路失败 From c1a6a97db8dbf4282f2259b9ae49553aa9d14f73 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Tue, 15 Oct 2024 14:57:02 +0800 Subject: [PATCH 6/9] =?UTF-8?q?[6.7.0]=E5=86=B7=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/hmi/ui/widget/ColdStartView.kt | 80 +++++++++++++++++ .../drawable-xhdpi/icon_cold_start_fail.png | Bin 0 -> 939 bytes .../icon_cold_start_process.png | Bin 0 -> 1126 bytes .../icon_cold_start_success.png | Bin 0 -> 1530 bytes .../res/drawable/bg_cold_start_divider.xml | 7 ++ .../src/main/res/layout/view_cold_start.xml | 84 ++++++++++++++++++ .../src/main/res/values/strings.xml | 3 + .../src/main/res/values/dimens.xml | 1 + 8 files changed, 175 insertions(+) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ColdStartView.kt create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_cold_start_fail.png create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_cold_start_process.png create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_cold_start_success.png create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_cold_start_divider.xml create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_cold_start.xml diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ColdStartView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ColdStartView.kt new file mode 100644 index 0000000000..21d71e9d08 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ColdStartView.kt @@ -0,0 +1,80 @@ +package com.mogo.eagle.core.function.hmi.ui.widget + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import androidx.constraintlayout.widget.ConstraintLayout +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.function.hmi.R +import com.zhjt.mogo.adas.data.AdasConstants +import system_master.SsmInfo +import system_master.SystemStatusInfo + +/** + * 冷启动呈现二期 + * 前置展示冷启动过程和结果 + */ +class ColdStartView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener { + + companion object { + const val TAG = "ColdStartView" + } + + init { + LayoutInflater.from(context).inflate(R.layout.view_cold_start, this, true) + initView() + } + + private fun initView(){ + + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + CallerAutoPilotStatusListenerManager.addListener(TAG, this) + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerAutoPilotStatusListenerManager.removeListener(TAG) + } + + override fun onAutopilotIpcConnectStatusChanged( + status: AdasConstants.IpcConnectionStatus, + reason: String? + ){ + if(status == AdasConstants.IpcConnectionStatus.CONNECTED){ + //域控连接成功 + + }else{ + //域控连接失败 + + } + } + + /** + * 状态查询应答 + * @param status 数据 + * HQ、M1 MAP350开始弃用,其他车型MAP360开始弃用 + */ + override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) { + + } + + + /** + * 定频SSM接口 + * 1hz hq m1 MAP350开始支持,其他车型MAP360开始支持 + * 定频SSM接入后 onStatusQueryResp 状态查询应答接口将弃用 + * @param statusInf 数据 + */ + override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) { + + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_cold_start_fail.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_cold_start_fail.png new file mode 100644 index 0000000000000000000000000000000000000000..e469e824d27c5a66c719951c54ba2be0bfda12dc GIT binary patch literal 939 zcmV;c162HpP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91D4+uX1ONa40RR91C;$Ke0D9(TtN;K56-h)vR9FeknLTI}Q4q&xHYbU4 zq_9x9LIf=WM*O%m9wAuS`hj9;FIt&SP+}cBv9Pn0gh*PkkTaa1o+3uD&{l~>)DZMS zE<66`z1{oF-repV&mDN#x3}-j{NC)okC`wf6nR@ZLY{XX-HSwAAfF1vC@MnV$U`AP zp(^?QGEY^$nrAWpaGdt?p>%+DMsASEML}8i{wEi{+(WJ-w)h zBE(XizKhW=4joR7ngPqA+E80j9J@Y{%9*`1w&yXvwJT8_hx$A70@b#!ap~3HPQ6_o zG^23|r$p)q*xb#NU4Zm%`i?WtwYp0o)pm!py<#&V^qa$U?P%xfR$%&a>%?h*n5AT^ z{w4W@fU5oH>_FC^;R;(xL}&MC?r69K(b;WS zXioc?Z_w-zb`g%HtF7_qq2_ICz4>d58qZp$0Fbu5o9LZ(hll~tw`tyNsc2?rG1G;< zU0gRX`#k{7sU-Hs?}C;mmCXx|OfD?Ow}IoFzG9r`GAl&@;;@-n;euyQ!dV5xDc!@S zmR%2mO~1i}dy*5kiwC^#PD~{+0yZo&8hvF{z=l_BLc@#_iUJ~T9frtOQ;T0~*3;Fh zSZ4g?bUK3Gzsf{^KHKv9qQgG4j!uAQT zIO^e(I=ynQ({rJ|NWiec|4v}`1ys;Xr+`CG8qlmJ(OV(Ix~qRf`~z82A06hcnc4sV N002ovPDHLkV1lx|rM&Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91D4+uX1ONa40RR91C;$Ke0D9(TtN;K5&`Cr=R9Fe^m%nQiK@`Vxd%wIp z(g{Hn6vZYWVl7GxS|p;4jbN*dg?3hoffS||ME`*lmTDk{pqNsy@dp?X{6R=i5%EX3 z+uPeaKi_jl_U?9e@6HWr?!n{D&b;})@4lURGn*MpNm{K|7N|Vxpk5}E@zQ`6SXv^2 znLu}>1)3&7kuwr*o4%oJngm-zF-Vw{CP5P_wd@ISD+n5*saPw)TCH}v(P+G@*Xyr6 z&zl-BT4EO2^=0$`dJrAA;ah zg+k$Exc`6K5S#`hsa(}^j^n7d>6mH@ZPWbsjE~pRna)G|Qjq|abs#j4(*{)X@SJ=@xZZmf% zJI@m*g&eqG?9b(L$LZp};XbQWD(j(PYqKwckUPSTz5$AMoObs&f?c$tMhs91E(O;# zl{F8{<#M^a7U9~_rR^Lm-Q;lAeK7J$9|uGU(f^I&Wsy85(+os)!;Y0$f&sbfWK8u* zwNZ7l2JpRD)QCZjRGnBl1sq;5ix$w?B$C!o%sM&5dYc1KpH*+KLhf?Iz6HrwJa-5L zj?yuU`h5N+e0tU>^Y=pPEIvw18x!jh=MnxJw0p#wK_*SoqUm>@KosT0IMker>G)_daTCG07?>pGPiM3+$x2{3k1Y19! z^)`Whr5higwR+9wJ4k>0s}6#M?_X{MPD*f3m0&`wp@z4FVA2{KglTF7wb)HyKJ~yS sjhWkRQzHoQ61qwDHX*y*9cb9+KcT0psKS)k{r~^~07*qoM6N<$f@>P@_y7O^ literal 0 HcmV?d00001 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_cold_start_success.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_cold_start_success.png new file mode 100644 index 0000000000000000000000000000000000000000..3c6cc6ebd90755b3a2449f230445f19b98d4aaaf GIT binary patch literal 1530 zcmVPx#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91D4+uX1ONa40RR91C;$Ke0D9(TtN;K7WJyFpR9FekS$S-fMHGKCyQT4{ zB?vu*Hej?;+O-w5Au1_tXf)J|ROunc5@WoG`j22y8?+%N5~D_=28|(>)Vf9@CKzaI zAr@0D(zRl(2W`P#Y1)!-EX(c;v~EC-po6G`{sBvvkW3EYg`S> z6j1L62DwZ?Dw;|2ex|T(5Cnbz1{o7=iY@M&*6fFeBXPyTQCj^=eFn3$P3Zgq)LR^e zt^i=|AjFq8rhK&DvEi&$T}uEVD7Y zSOV1cx#({tMqid_2CS&Kv%W+Z)&Nq5@NU9-`(>|f%x8A__!Ge1tQEByHtkDGU$f5; zK2FS-tGFGuW!?>6XRm`*iHib@F>oAmWoZl5GsK?U8dx}rt?}FjZ)C25mDi=i)jSRg z=b8W{pG;7`2TrFFtQQk=Ig6cfcrD{Da9o?Dxxu{;_Dvi&b;&^7hldNswIh?MSado# z&bO_LR>JKGbSm?dcLsij_DMRCnU?gT&M%g8I?tJkM4P<{D4Lro?SD4X1>hq#N6Xb7$|^UpfnA3$oy`t#m3q=f5G%kc}RU~}*Ha8A9bH$`0I$nGI!nu8cW;l$A?(C9F}Xzp$4I|$XuxiAOk<)_2H zYI89R6Xv2!d_|qwxU6yQy2cH5N{%V!8Zqs0HajZH$RlmkpuLsga|F@S0;ERILyo963dE2e z7o3;wE2x?@`t$)v9rTccE2qvV6a!kpjkv5OXZ=6^zAgbs0`!oB2U!aB>{5Zhx4`^3 zf-7lpRI~)@_H6%wda#Y&N>HF4$pjOT**166um*~pZa82B^-la%d+DtNPb1BGTa;=A z?Rq97PJ@)b0KMlkdoK{tNXm^thj1+3Ff+UJa0NibE*0LchFM`$;Gyi{xVRshd& zCYT56!^E%UR!m<_xm8`E#Et!70W>PorJC-obT!0$ltvdEx + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_cold_start.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_cold_start.xml new file mode 100644 index 0000000000..1da924a954 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_cold_start.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml index 61244a3c46..a219598048 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml @@ -213,4 +213,7 @@ 红绿灯信号来源 已发起上报 + 域控连接状态图标 + SSM连接状态图标 + diff --git a/core/mogo-core-res/src/main/res/values/dimens.xml b/core/mogo-core-res/src/main/res/values/dimens.xml index aec6045a64..4bf0a083d8 100644 --- a/core/mogo-core-res/src/main/res/values/dimens.xml +++ b/core/mogo-core-res/src/main/res/values/dimens.xml @@ -1112,6 +1112,7 @@ 55dp 57dp 69dp + 70dp 72dp 76dp 80dp From 1e4e60d0d1254f092c63469db3bc5f73e76b617f Mon Sep 17 00:00:00 2001 From: yangyakun Date: Tue, 15 Oct 2024 15:24:51 +0800 Subject: [PATCH 7/9] =?UTF-8?q?[6.7.0]=20[fix]=20[=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=8C=87=E5=AF=BC=E4=B8=8B=E8=BD=BD=E8=BD=A8=E8=BF=B9=E7=9A=84?= =?UTF-8?q?=E6=97=A5=E5=BF=97]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/och/weaknet/util/BusTrajectoryManager.java | 3 +++ .../mogo/och/unmanned/taxi/utils/TaxiTrajectoryManager.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/util/BusTrajectoryManager.java b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/util/BusTrajectoryManager.java index 8c0515d42b..c0ebf6c186 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/util/BusTrajectoryManager.java +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/util/BusTrajectoryManager.java @@ -53,6 +53,7 @@ public class BusTrajectoryManager { * 同步Bus路线信息 */ public void syncTrajectoryInfo() { + OchChainLogManager.writeChainLog("轨迹监控","开始或者结束下发轨迹 轨迹id"+mAutoPilotLine.getLineId(), true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); if (LoginStatusManager.isLogin() && LineModel.INSTANCE.getCurrentTask() != null && LineModel.getStartStationIndex() == 0 && !OrderModel.isGoingToNextStation()) { @@ -159,6 +160,7 @@ public class BusTrajectoryManager { } private void startTrajReqLoop() { + OchChainLogManager.writeChainLog("轨迹监控","开始下发轨迹 轨迹id"+mAutoPilotLine.getLineId(), true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); if (mSendReqDisposable != null && !mSendReqDisposable.isDisposed()) { return; } @@ -180,6 +182,7 @@ public class BusTrajectoryManager { } public void stopTrajReqLoop() { + OchChainLogManager.writeChainLog("轨迹监控","结束下发轨迹 轨迹id"+mAutoPilotLine.getLineId(), true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); if (mSendReqDisposable != null) { CallerLogger.d(M_BUS + TAG, "stopTrajReqLoop()"); mSendReqDisposable.dispose(); diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/utils/TaxiTrajectoryManager.java b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/utils/TaxiTrajectoryManager.java index a6765abf80..5a2d1706fb 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/utils/TaxiTrajectoryManager.java +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/utils/TaxiTrajectoryManager.java @@ -70,6 +70,7 @@ public class TaxiTrajectoryManager { * 同步订单信息 */ public void syncTrajectoryInfo() { + OchChainLogManager.writeChainLog("轨迹监控","开始或者结束下发轨迹 轨迹id"+mAutoPilotLine.getLineId(), true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); QueryCurrentTaskRespBean.Result taskAndOrder = TaxiTaskModel.INSTANCE.getCurrentTaskWithOrder(); if (taskAndOrder == null || taskAndOrder.getCurrentStatus() >= TaskStatusEnum.StartTask.getCode()) { CallerLogger.d(M_TAXI + TAG, "syncTrajectoryInfo() stop."); @@ -251,6 +252,7 @@ public class TaxiTrajectoryManager { } private void startTrajReqLoop() { + OchChainLogManager.writeChainLog("轨迹监控","开始下发轨迹 轨迹id"+mAutoPilotLine.getLineId(), true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); if (mSendReqDisposable != null && !mSendReqDisposable.isDisposed()) { return; } @@ -274,6 +276,7 @@ public class TaxiTrajectoryManager { } private void stopTrajReqLoop() { + OchChainLogManager.writeChainLog("轨迹监控","结束下发轨迹 轨迹id"+mAutoPilotLine.getLineId(), true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY); DebugView.Companion.printInfoMsg("[下发轨迹] stopTrajectoryReqLoop"); if (mSendReqDisposable != null) { CallerLogger.d(M_TAXI + TAG, "stopTrajReqLoop()"); From 60fa7775b4597852fbf51f13ab16f30f550f11ae Mon Sep 17 00:00:00 2001 From: yangyakun Date: Tue, 15 Oct 2024 19:02:36 +0800 Subject: [PATCH 8/9] =?UTF-8?q?[6.7.0]=20[fea]=20[taxi=E6=97=A0=E4=BA=BA?= =?UTF-8?q?=E5=8C=96=E3=80=81=E8=87=AA=E9=A9=BE=E4=BF=A1=E6=81=AF]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/autopilot/line/LineManager.kt | 4 +- .../com/mogo/och/data/bean/ContraiInfo.kt | 1 + .../taxi/bean/TaxiDriverTaskWithOrderBean.kt | 20 +++- .../callback/ITaxiADASStatusCallback.java | 18 ---- .../ITaxiControllerStatusCallback.java | 3 - .../och/unmanned/taxi/ui/base/TaxiFragment.kt | 98 +----------------- .../unmanned/taxi/ui/base/TaxiPresenter.java | 96 +----------------- .../unmanned/taxi/ui/task/TaxiTaskModel.kt | 99 ++----------------- .../itinerarycurrent/ItineraryCurrentView.kt | 87 +++++++++++++--- .../res/layout/unmanned_itinerary_current.xml | 8 -- 10 files changed, 107 insertions(+), 327 deletions(-) diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/line/LineManager.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/line/LineManager.kt index fa8becee66..80e94d6caf 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/line/LineManager.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/line/LineManager.kt @@ -133,12 +133,13 @@ object LineManager : CallerBase() { }else { setAutopilotControlParameters() } - OchChainLogManager.writeChainLogAutopilot("自驾参数", "${startStation}---${endStation}") + OchChainLogManager.writeChainLogAutopilot("自驾参数", "站点信息:${startStation}---${endStation}") } fun setContraiInfo(contraiInfo: ContraiInfo?){ this._contraiInfo = contraiInfo setAutopilotControlParameters() + OchChainLogManager.writeChainLogAutopilot("自驾参数", "轨迹信息:${contraiInfo}") } @JvmStatic @@ -159,6 +160,7 @@ object LineManager : CallerBase() { CallerEagleBaseFunctionCall4OchManager.updateOrderLine(sb.toString()) } } + OchChainLogManager.writeChainLogAutopilot("自驾参数", "线路信息:${contraiInfo}") } fun getStations(): Pair { diff --git a/OCH/common/data/src/main/java/com/mogo/och/data/bean/ContraiInfo.kt b/OCH/common/data/src/main/java/com/mogo/och/data/bean/ContraiInfo.kt index e876374a68..5ae6b1ca1c 100644 --- a/OCH/common/data/src/main/java/com/mogo/och/data/bean/ContraiInfo.kt +++ b/OCH/common/data/src/main/java/com/mogo/och/data/bean/ContraiInfo.kt @@ -33,4 +33,5 @@ data class ContraiInfo( var passPoints: MutableList?=null, // 用于算路的经停点 var blackPoints: MutableList?=null, // 用于算路的黑名單點 + val source:Int = 1, //轨迹来源:1 录制;2 自主计算 ) diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/bean/TaxiDriverTaskWithOrderBean.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/bean/TaxiDriverTaskWithOrderBean.kt index d10bc93287..574d0583b6 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/bean/TaxiDriverTaskWithOrderBean.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/bean/TaxiDriverTaskWithOrderBean.kt @@ -4,6 +4,8 @@ import com.mogo.eagle.core.data.BaseData import com.mogo.och.data.taxi.BaseOrderBean import com.mogo.och.unmanned.taxi.constant.TaskStatusEnum import com.mogo.och.common.module.biz.order.TaxiOrderStatusEnum +import com.mogo.och.data.bean.BusStationBean +import com.mogo.och.data.bean.ContraiInfo /** * @author: wangmingjun @@ -73,6 +75,17 @@ data class Site( if (wgs84Lat != other.wgs84Lat) return false return true } + fun toCommonStation(): BusStationBean { + val result = BusStationBean() + result.siteId = siteId.toInt() + result.name = siteName + result.gcjLat = gcjLat + result.gcjLon = gcjLon + result.lat = wgs84Lat + result.lon = wgs84Lon + result.isLeaving = true + return result + } } data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() { @@ -254,6 +267,11 @@ data class TrajectoryListRespBean(var data: MutableList?) : BaseData() { var txtFileUrlDPQP: String, var txtFileMd5DPQP: String, var contrailSaveTimeDPQP: Long - ) + ){ + fun toCommonContraiInfo(): ContraiInfo { + val result = ContraiInfo(lineId,csvFileUrl,csvFileMd5,txtFileUrl,txtFileMd5,contrailSaveTime,source = source) + return result + } + } } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/callback/ITaxiADASStatusCallback.java b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/callback/ITaxiADASStatusCallback.java index ce946a51d0..16da2773ee 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/callback/ITaxiADASStatusCallback.java +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/callback/ITaxiADASStatusCallback.java @@ -6,23 +6,5 @@ package com.mogo.och.unmanned.taxi.callback; * Model->Presenter回调:ADAS相关(自动驾驶状态回调,到达终点等等) */ public interface ITaxiADASStatusCallback { - // 自动驾驶触发的已到达目的地:暂未用到 - void onAutopilotArriveEnd(); - // 自动驾驶可用状态 - void onAutopilotEnable(boolean canStartAuto); - - // 自动驾驶不可用状态 - void onAutopilotDisable(boolean canStartAuto); - - // 自动驾驶运行中 - void onAutopilotRunning(boolean canStartAuto); - - //人机共驾 - void onParallelDrivingStatus(boolean canStartAuto); - - //自驾返回失败 - void onStartAdasFailure(); - - void updateAutopilotStatus(boolean canStartAuto); } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/callback/ITaxiControllerStatusCallback.java b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/callback/ITaxiControllerStatusCallback.java index e6a180ba28..600fa04bc8 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/callback/ITaxiControllerStatusCallback.java +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/callback/ITaxiControllerStatusCallback.java @@ -9,9 +9,6 @@ import com.mogo.eagle.core.data.map.MogoLocation; */ public interface ITaxiControllerStatusCallback { - //开始开启自动驾驶 - void startOpenAutopilot(); - //自动开启自动驾驶 void startOpenAutopilotNonManual(); diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/TaxiFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/TaxiFragment.kt index 833f324793..fb1af09e0c 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/TaxiFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/TaxiFragment.kt @@ -39,6 +39,7 @@ import com.mogo.och.unmanned.taxi.ui.navi.auto.TaxiRoutingNaviFragment import com.mogo.och.unmanned.taxi.ui.operational.TaxiOperationalDialogFragment import com.mogo.och.unmanned.taxi.ui.task.TaxiTaskModel import com.mogo.och.unmanned.taxi.ui.task.TaxiTaskTabFragment +import com.mogo.och.unmanned.taxi.ui.task.itinerarycurrent.ItineraryCurrentView import com.mogo.och.unmanned.taxi.utils.TPRouteDataTestUtils import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.unmannedMapCL import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_mogo_och_navi_panel_container @@ -86,11 +87,6 @@ class TaxiFragment :MvpFragment(), @SuppressLint("UseCompatLoadingForDrawables") override fun initViews() { - onAutopilotStatusChanged( - getState(), - CallerAutoPilotControlManager.isCanStartAutopilot(false) - ) - CallerHmiViewControlListenerManager.invokeMainPageViewVisible(View.VISIBLE) taxi_close_navi_icon.setOnClickListener { @@ -200,92 +196,8 @@ class TaxiFragment :MvpFragment(), super.onDestroyView() } - /** - * 改变自动驾驶状态 - * - * @param status 2 - running 1 - enable 2 - disable - */ - fun onAutopilotStatusChanged(status: Int, canStartAuto: Boolean) { - activity?.runOnUiThread(Runnable runOnUiThread@{ - if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) { - // 1. 主动开启自动驾驶中,不为2(为0、1)则继续loading - return@runOnUiThread - } - if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status - ) { - // 2. 主动开启自动驾驶中,为2则停止loading,并isStarting = false - startAutopilotDone(true) - return@runOnUiThread - } - // 3. 其他过程直接更新 - startOrStopLoadingAnim(false) - }) - } - - /** - * 停止【开启自动驾驶按钮】动画,并更新按钮状态 - */ - fun stopAnimAndUpdateBtnStatus() { - startOrStopLoadingAnim(false) - startAutopilotDone(false) - } - - var isStarting = false - @SuppressLint("ObjectAnimatorBinding") - fun startOrStopLoadingAnim(start: Boolean) { - if (start) { - isStarting = true - startingAutopilotCountDown() - } else { - isStarting = false - } - } - - private fun startAutopilotDone(success: Boolean) { - UiThreadHandler.postDelayed({ - startOrStopLoadingAnim(false) - onAutopilotStatusChanged( - getState(), - CallerAutoPilotControlManager.isCanStartAutopilot(false) - ) - }, 1000L) - } - - private fun startingAutopilotCountDown() { - UiThreadHandler.postDelayed({ - //未启动成功10s后做处理 - if (isStarting) { //判断动画是否在进行 - //并且根据状态来设置自动驾驶启动成功还是失败 - if (getState() - == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING - ) { - startAutopilotDone(true) - } else { - startAutopilotDone(false) - } - } - }, TaxiUnmannedConst.TIMER_START_AUTOPILOT_INTERVAL) - } - - - /** - * 重新开启自动驾驶 - */ - - fun startAutopilot() { - // 在自动驾驶中,或者自己确认车辆环境可开启自动驾驶 则可点击 - if (!isStarting) { - d(SceneConstant.M_TAXI + TAG, "startAutopilot") - mPresenter?.startAutoPilot() - } - } - - fun changeOperationViewVisible(visible: Int) { - - } - override fun onMapVisualAngleChanged(visualAngleMode: VisualAngleMode?) { } @@ -401,9 +313,6 @@ class TaxiFragment :MvpFragment(), fun setGuidHide() { } - fun updateAutopilotStatus(status: Int, canStartAuto: Boolean) { - onAutopilotStatusChanged(status, canStartAuto) - } /** * 状态变更 * @param inOperation true 可以接单 false 暂停接单 @@ -423,9 +332,8 @@ class TaxiFragment :MvpFragment(), if (MogoStatusManager.getInstance().isTaxiUnmanedDriverLineRoutingVerifyMode) { showAmapNaviToStationFragment(isShow) } else { - // TODO: 需要复原 -// if (null == taskTabFragment || taskTabFragment!!.get() == null) return -// taskTabFragment!!.get()!!.onNaviToEndStationByAMap(isShow) + val currentItinerary = findViewById(R.id.currentItinerary) + currentItinerary?.onNaviToEndStationByAMap(isShow) } } else if (isShow) { //使用routing数据 showRoutingToStationFragment(true) diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/TaxiPresenter.java b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/TaxiPresenter.java index 9ca319f52b..e2ff3cb07f 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/TaxiPresenter.java +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/TaxiPresenter.java @@ -79,7 +79,7 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS TaxiTaskModel.INSTANCE.startAutopilotByClick(); } - private OchTransformDispatch ochTransform = new OchTransformDispatch(){ + private final OchTransformDispatch ochTransform = new OchTransformDispatch(){ @Override public void logout() { TaxiTaskModel.INSTANCE.logout(); @@ -92,82 +92,6 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS } - @Override - public void onAutopilotArriveEnd() { - } - - @Override - public void onAutopilotEnable(boolean canStartAuto) { - UiThreadHandler.post(new Runnable() { - @Override - public void run() { - if(mView!=null) { - mView.updateAutopilotStatus( - IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE,canStartAuto); - } - } - }, UiThreadHandler.MODE.QUEUE); - - } - - @Override - public void onAutopilotDisable(boolean canStartAuto) { - UiThreadHandler.post(new Runnable() { - @Override - public void run() { - if(mView!=null) { - mView.updateAutopilotStatus( - IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE,canStartAuto); - } - } - }, UiThreadHandler.MODE.QUEUE); - - } - - @Override - public void onAutopilotRunning(boolean canStartAuto) { - UiThreadHandler.post(new Runnable() { - @Override - public void run() { - if(mView!=null) { - mView.updateAutopilotStatus( - IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING,canStartAuto); - } - } - }, UiThreadHandler.MODE.QUEUE); - - } - - @Override - public void onParallelDrivingStatus(boolean canStartAuto) { - UiThreadHandler.post(new Runnable() { - @Override - public void run() { - - } - }, UiThreadHandler.MODE.QUEUE); - - } - - @Override - public void onStartAdasFailure() { - UiThreadHandler.post(new Runnable() { - @Override - public void run() { - if(mView!=null) { - mView.stopAnimAndUpdateBtnStatus(); - } - } - }, UiThreadHandler.MODE.QUEUE); - - } - - @Override - public void updateAutopilotStatus(boolean canStartAuto) { - if(mView!=null) { - mView.updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), canStartAuto); - } - } @Override public void onNaviToEnd(boolean isAmap, boolean isShow) { @@ -182,18 +106,6 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS } - @Override - public void startOpenAutopilot() { - UiThreadHandler.post(new Runnable() { - @Override - public void run() { - if(mView!=null) { - mView.startOrStopLoadingAnim(true); - } - } - }, UiThreadHandler.MODE.QUEUE); - - } @Override public void startOpenAutopilotNonManual() { @@ -201,7 +113,6 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS @Override public void run() { if(mView!=null) { - mView.startOrStopLoadingAnim(true); mView.showStartAutopilotBlinkAnimation(); } } @@ -215,8 +126,6 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS @Override public void run() { if(mView!=null) { - mView.startOrStopLoadingAnim(false); - mView.updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),canStartAuto); mView.stopAutopilotBlinkAnimation(); } } @@ -230,8 +139,6 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS @Override public void run() { if(mView!=null) { - mView.startOrStopLoadingAnim(false); - mView.updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),canStartAuto); mView.pauseAutopilotBlinkAnimation(); } } @@ -245,7 +152,6 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS @Override public void run() { if(mView!=null) { - mView.startOrStopLoadingAnim(true); mView.resumeAutopilotBlinkAnimation(); } } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiTaskModel.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiTaskModel.kt index 83f27f04c6..c2e4c9383f 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiTaskModel.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiTaskModel.kt @@ -311,7 +311,6 @@ object TaxiTaskModel { i(TAG, "onAutopilotStatusResponse autopilotsState= $state") if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) { DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_RUNNING,meaning=自动驾驶中") - mADASStatusCallback?.onAutopilotRunning(CallerAutoPilotControlManager.isCanStartAutopilot(false)) if ((QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder))) { OchAutopilotAnalytics.triggerStartAutopilotEvent( isRestartAutopilot, @@ -334,7 +333,6 @@ object TaxiTaskModel { // 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态 return } - mADASStatusCallback?.onAutopilotEnable(CallerAutoPilotControlManager.isCanStartAutopilot(false)) } else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) { DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_DISABLE,meaning=不可自动驾驶") if ((FunctionBuildConfig.isDemoMode @@ -345,7 +343,6 @@ object TaxiTaskModel { // 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态 return } - mADASStatusCallback?.onAutopilotDisable(CallerAutoPilotControlManager.isCanStartAutopilot(false)) } else if (state == IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) { DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_PARALLEL_DRIVING,meaning=平行驾驶中") if (FunctionBuildConfig.isDemoMode) { @@ -357,11 +354,9 @@ object TaxiTaskModel { ) { //订单中 // 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态 } else { //美化模式下没订单,显示人工驾驶 - mADASStatusCallback?.onAutopilotDisable(CallerAutoPilotControlManager.isCanStartAutopilot(false)) } return } - mADASStatusCallback?.onParallelDrivingStatus(CallerAutoPilotControlManager.isCanStartAutopilot(false)) } } @@ -417,7 +412,6 @@ object TaxiTaskModel { override fun canStartAutopilot(canStart: Boolean) { super.canStartAutopilot(canStart) - mADASStatusCallback?.updateAutopilotStatus(CallerAutoPilotControlManager.isCanStartAutopilot(false)) } } @@ -487,7 +481,6 @@ object TaxiTaskModel { TAG, "onStartAutopilotFailure: startFailedMessage=$startFailedMessage" ) - mADASStatusCallback?.onStartAdasFailure() } } } @@ -778,6 +771,7 @@ object TaxiTaskModel { } clearCurrentOCHOrder() clearLocalCalculateStation() + LineManager.setStartAndEndStation(null,null) return } @@ -789,13 +783,16 @@ object TaxiTaskModel { listener.onTaskStarted(result) } } + if (result.startSite!=null && result.endSite!=null) { + LineManager.setStartAndEndStation(result.startSite!!.toCommonStation(),result.endSite!!.toCommonStation()) + } + //当前任务完成且订单状态到达乘客上车点, 则立马去拉取任务 不再等120s,否则送驾任务要等120s后才能去执行(8.29废) //8.29更新: 当前任务完成且订单状态为乘客已上车, 则立马去拉取任务 不再等120s,否则送驾任务要等120s后才能去执行 // 主要是解决A-B演练任务同时接到A-B订单状态流转的问题 //注意: 需要去除到达乘客上车点的节点, 这个节点不拉取任务 if (QueryCurrentTaskRespBean.isTaskCompleteTaskType(result)) { - mADASStatusCallback?.updateAutopilotStatus(CallerAutoPilotControlManager.isCanStartAutopilot(false)) mTaxiTaskWithOrderCallbackMap.forEach { val listener = it.value listener.onTaskCompleted(result) @@ -1095,6 +1092,7 @@ object TaxiTaskModel { mCurrentTaskTrajectory = it.first { currentTaskLineId == it.lineId } mCurrentTaskTrajectory?.let {traj-> LineManager.setLineInfo(LineInfo(traj.lineId,traj.lineName)) + LineManager.setContraiInfo(traj.toCommonContraiInfo()) } } mTaxiTaskWithOrderCallbackMap.forEach { @@ -1221,15 +1219,6 @@ object TaxiTaskModel { fun startAutoPilot() { - /** - * 存在Session - */ - if (!OchAutoPilotManager.canStartAutopilotBySessionId()) { - return - } - - OchAutopilotAnalytics.triggerClickStartAutopilotTime(System.currentTimeMillis()) - DebugView.printInfoMsg("[启自驾] startAutoPilot") if (!checkCurrentTaskCondition()) { e(TAG, "no order or order is empty.") @@ -1264,81 +1253,7 @@ object TaxiTaskModel { TAG, "isPassStartAutopilotCommand = " + FunctionBuildConfig.isPassStartAutopilotCommand ) - //2、6个条件判断 - if (!CallerAutoPilotControlManager.isCanStartAutopilot(true)) { - return - } - // 3、距离轨迹15m计算 - mCurrentTaskWithOrder?.let { - var resion = OchAutoPilotManager.canStartAutoPilotByDistance(it.lineId) - if (TrajectoryAndDistanceManager.errorTypeNoneLineId == resion) { - val curTaskAndOrder = getCurrentTaskWithOrder() - if (curTaskAndOrder!=null) { - if (curTaskAndOrder.startSite != null && curTaskAndOrder.endSite != null) { - val startStation = MogoLocation() - startStation.longitude = curTaskAndOrder.startSite!!.gcjLon - startStation.latitude = curTaskAndOrder.startSite!!.gcjLat - val endStation = MogoLocation() - endStation.longitude = curTaskAndOrder.endSite!!.gcjLon - endStation.latitude = curTaskAndOrder.endSite!!.gcjLat - TrajectoryAndDistanceManager.setStationPoint( - startStation, - endStation, - curTaskAndOrder.lineId - ) - } - } - resion = OchAutoPilotManager.canStartAutoPilotByDistance(it.lineId) - } - if(!StringUtils.isEmpty(resion)){ - ToastUtils.showShort(resion) - VoiceNotice.showNotice(resion) - return - } - } - // 4、ssm 给出数据 - if (!OchAutoPilotManager.canStartAutoPilotSSM()) { - DebugView.printErrorMsg("[启自驾] ${OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason}") - val orderNo = mCurrentTaskWithOrder?.order?.orderNo - OchAutopilotAnalytics.triggerUnableStartAPReasonEvent( - mCurrentTaskWithOrder!!.startSite!!.siteName, - mCurrentTaskWithOrder!!.endSite!!.siteName, - mCurrentTaskWithOrder!!.lineId.toString(), // todo 这里原来传的是订单号, 现在是任务没有订单号,传了路线id - orderNo?:"", - OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason - ) - return - } - - //点击开始自动驾驶按钮订单状态去流转, 不再与自动驾驶是否启动成功挂钩 - isRestartAutopilot = mCurrentTaskWithOrder!!.currentStatus != TaskStatusEnum.StartTask.code - - val parameters = initAutopilotControlParameters() - if (null == parameters) { - e(TAG, "AutopilotControlParameters is empty.") - return - } - - val sessionId = OchAutoPilotManager.startAutoPilot(parameters) - DebugView.printInfoMsg("[启自驾] 调用成功") - d( - TAG, "start autopilot with parameter: %s", - GsonUtil.jsonFromObject(parameters) - + " ,startSiteName=" + mCurrentTaskWithOrder?.startSite?.siteName - + " ,endSiteName=" + mCurrentTaskWithOrder?.endSite?.siteName - + "isRestartAutopilot = " + isRestartAutopilot - ) - OchAutopilotAnalytics.triggerStartAutopilotEvent( - isRestartAutopilot, - false, - mCurrentTaskWithOrder!!.startSite!!.siteName, - mCurrentTaskWithOrder!!.endSite!!.siteName, - mCurrentTaskWithOrder!!.lineId.toInt(), - if (mCurrentTaskWithOrder!!.order != null) mCurrentTaskWithOrder!!.order!!.orderNo else "", - System.currentTimeMillis(),0 - ) - OchAutopilotAnalytics.triggerUpdateStartAutoPilotSessionId(sessionId) - mControllerStatusCallback?.startOpenAutopilot() + LineManager.startAutopilot() } fun initAutopilotControlParameters(): AutopilotControlParameters? { diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/itinerarycurrent/ItineraryCurrentView.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/itinerarycurrent/ItineraryCurrentView.kt index c0e72f1d27..c86f05350e 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/itinerarycurrent/ItineraryCurrentView.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/itinerarycurrent/ItineraryCurrentView.kt @@ -58,6 +58,7 @@ import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.aciv_task_ import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.aciv_task_type_order import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.actv_distance_end import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.actv_end_order +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.actv_order_phone import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.actv_submit_task import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.cancelOrder import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.commonSlideViewStartServer @@ -145,12 +146,13 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi updateNextTaskFragment(currentTaskWithOrder) } + // 全程距离和时间 is TaskWithOrderUIState.UpdateOrderTripInfo -> { dialog?.setOrderMileage(taskAndOrderUiState.mileage*1000) actv_distance_end.text = TaskUtils.getCurrentTaskDistance(taskAndOrderUiState.mileage.toLong()) actv_time_end.text = TaskUtils.getCurrentTaskTime(taskAndOrderUiState.duration.toLong()) } - + // 根据轨迹计算剩余距离和时间 is TaskWithOrderUIState.UpdateTaskTripLocalCalculateInfo -> { actv_distance_end.text = TaskUtils.getCurrentTaskDistance(taskAndOrderUiState.meters.toLong()) actv_time_end.text = TaskUtils.getCurrentTaskTime(taskAndOrderUiState.timeInSecond.toLong()) @@ -299,6 +301,11 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi group_itinerary_info.visibility = GONE include_empty.visibility = VISIBLE prepareTaskCountdownTv.visibility = GONE + + actv_end_order.visibility = GONE + commonSlideViewStartServer.visibility = GONE + actv_submit_task.visibility = GONE + } private fun initOnClickListener() { @@ -410,7 +417,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi naviToStart.id, naviToEnd.id -> { - showNaviToEndStationFragment(true) + showNaviToEndStationFragment() } } } @@ -420,10 +427,9 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi * * @param isShow */ - private fun showNaviToEndStationFragment(isShow: Boolean) { + private fun showNaviToEndStationFragment() { fragment?.let { - FlowBus.with(TaxiDriverEventConst.TaxiFragmentEvent.EVENT_TYPE_START_NAVI_TO_END_STATION) - .post(it.lifecycleScope, isShow) + TaxiTaskModel.startNaviToEndStation(true); } } @@ -455,6 +461,12 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi aciv_task_type_exercise.visibility = View.GONE // 轨迹标识 trajectoryType.visibility = View.GONE + + + actv_end_order.visibility = GONE + commonSlideViewStartServer.visibility = GONE + actv_submit_task.visibility = GONE + } } @@ -505,6 +517,21 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi order.bookingUserPhone, order.passengerSize ) + + var tempPhone = order.bookingUserPhone + tempPhone.let { + if (it.length > 8) { + //截取电话号码前三位 + val phoneNumPre = it.substring(0, 3) + //截取电话号码后四位 + val phoneNumFix = it.substring(7) + tempPhone = "$phoneNumPre****$phoneNumFix" + } + } + actv_order_phone.text = tempPhone + orderPhoneAndNum.text = "${ order.passengerSize}人" + + startStationName.text = order.orderStartSite?.siteName endStationName.text = order.orderEndSite?.siteName TaxiTaskModel.getCurrentOrderTrajectoryList().also { @@ -518,6 +545,9 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi dismissDialog() initContainerView(false) removeAllMapMarker() + actv_end_order.visibility = GONE + commonSlideViewStartServer.visibility = GONE + actv_submit_task.visibility = GONE } TaxiOrderStatusEnum.ArriveAtEnd.code -> { //到达目的地 @@ -549,15 +579,14 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi taskStatus.text = resources.getString(R.string.arrived_start_site) actv_end_order.visibility = GONE - commonSlideViewStartServer.visibility = GONE - actv_submit_task.visibility = VISIBLE + if (order.orderStatus == TaxiOrderStatusEnum.UserArriveAtStart.code) { - actv_submit_task.text = - ResourcesUtils.getString(R.string.module_och_taxi_order_server_start) + commonSlideViewStartServer.visibility = VISIBLE + actv_submit_task.visibility = GONE } else { - actv_submit_task.text = - ResourcesUtils.getString(R.string.module_och_taxi_order_server_start_wait_check) + commonSlideViewStartServer.visibility = GONE + actv_submit_task.visibility = VISIBLE } hideNaviBtns() actv_time_end.text = TaskUtils.getCurrentTaskWaitTimeHtml() @@ -567,7 +596,12 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi dismissDialog() taskStatus.text = resources.getString(R.string.task_start_start_site) actv_end_order.visibility = GONE - commonSlideViewStartServer.visibility = VISIBLE + commonSlideViewStartServer.visibility = GONE + actv_submit_task.visibility = GONE + } + else ->{ + actv_end_order.visibility = GONE + commonSlideViewStartServer.visibility = GONE actv_submit_task.visibility = GONE } } @@ -597,6 +631,10 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi // 演练单标识 aciv_task_type_exercise.visibility = View.VISIBLE + actv_end_order.visibility = GONE + commonSlideViewStartServer.visibility = GONE + actv_submit_task.visibility = GONE + naviToStart.visibility = View.GONE naviToEnd.visibility = if (currentStatus >= TaskStatusEnum.StartTask.code) View.VISIBLE else View.GONE @@ -719,9 +757,11 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } else if (currentTaskWithOrder.currentStatus == TaskStatusEnum.CompleteTask.code && currentTaskWithOrder.taskType <= TaskTypeEnum.ToOrderStartTask.code ) { - actv_distance_end.text = "已到达 ${currentTaskWithOrder.endSite?.siteName}" + actv_distance_end.text = "" + actv_time_end.text = "" } else { - actv_distance_end.text = "距离 -- 公里, 用时 -- 分钟" + actv_distance_end.text = "-- 公里" + actv_time_end.text = "-- 分钟" } } @@ -815,4 +855,23 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi }, 3000) } + fun onNaviToEndStationByAMap(isShow: Boolean) { + val currentTaskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder() ?: return + fragment?.let { + if (currentTaskWithOrder.currentStatus == TaskStatusEnum.StartTask.code) + isShow else true + FlowBus.with(TaxiDriverEventConst.TaxiFragmentEvent.EVENT_TYPE_SHOW_AMAP_NAVI_TO_STATION_FRAGMENT) + .post(it.lifecycleScope, + if (currentTaskWithOrder.currentStatus == TaskStatusEnum.StartTask.code) + isShow + else + true + ) + updateRemainDistanceAndTime( + if (currentTaskWithOrder.currentStatus == TaskStatusEnum.StartTask.code) + isShow else true + ) + } + } + } diff --git a/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_itinerary_current.xml b/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_itinerary_current.xml index c473742cc3..9728f1bef6 100644 --- a/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_itinerary_current.xml +++ b/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_itinerary_current.xml @@ -298,14 +298,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content"/> - - - Date: Tue, 15 Oct 2024 19:13:52 +0800 Subject: [PATCH 9/9] =?UTF-8?q?[6.7.0]=20[fea]=20[taxi=E6=97=A0=E4=BA=BA?= =?UTF-8?q?=E5=8C=96=20=E5=88=B0=E7=AB=99=E9=80=BB=E8=BE=91=E7=AE=80?= =?UTF-8?q?=E5=8C=96]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unmanned/taxi/ui/task/TaxiTaskModel.kt | 103 +++++------------- 1 file changed, 27 insertions(+), 76 deletions(-) diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiTaskModel.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiTaskModel.kt index c2e4c9383f..fc0bc0cee0 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiTaskModel.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/TaxiTaskModel.kt @@ -45,6 +45,7 @@ import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatu import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutopilotAnalytics +import com.mogo.och.common.module.manager.autopilot.line.ILineCallback import com.mogo.och.common.module.manager.autopilot.line.LineManager import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager import com.mogo.och.common.module.manager.distance.IDistanceListener @@ -214,6 +215,7 @@ object TaxiTaskModel { OchAutoPilotStatusListenerManager.addListener(TAG, mMogoAutopilotStatusListener) //定位监听, 传false是高德坐标系 10 -> 100ms一次 OchLocationManager.addGCJ02Listener(TAG, 5, mMapLocationListener) + LineManager.addListener(TAG,iLineCallback) //2021.11.1 自动驾驶路线规划接口 CallerPlanningRottingListenerManager.addListener(TAG, mMogoAutopilotPlanningListener) //开启自驾后 异常信息返回 @@ -235,6 +237,7 @@ object TaxiTaskModel { // 注销地图监听 OchLocationManager.removeGCJ02Listener(TAG) + LineManager.removeListener(TAG) OCHSocketMessageManager.releaseSocketMessageListener(OCHSocketMessageManager.msgMonitorType) OchAutoPilotStatusListenerManager.removeListener(mMogoAutopilotStatusListener) CallerPlanningRottingListenerManager.removeListener(mMogoAutopilotPlanningListener) @@ -276,14 +279,6 @@ object TaxiTaskModel { private val mMogoAutopilotStatusListener: IOchAutopilotStatusListener = object : IOchAutopilotStatusListener { override fun onAutopilotIpcConnectStatusChanged(status: AdasConstants.IpcConnectionStatus, reason: String?) { -// DebugView.printInfoMsg( -// "[域控连接状态变化] status=$status, reason=${ -// if (TextUtils.isEmpty( -// reason -// ) -// ) "" else reason -// }" -// ) } override fun onAutopilotGuardian(guardianInfo: MogoReportMessage?, lineId: Long) { @@ -390,10 +385,10 @@ object TaxiTaskModel { ).toDouble() if (distance <= TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE){// 两坐标小于15米 DebugView.printInfoMsg("[MAP到站通知] 到站坐标和任务终点15米内, 请求到站") - autopilotArriveAtStation() }else{ DebugView.printInfoMsg("[MAP到站通知] 到站坐标和任务终点不一致, 不请求到站") } + autopilotArriveAtStation() }else{ DebugView.printInfoMsg("[MAP到站通知] endSiteLat = $endSiteLat, endSiteLon = $endSiteLon, " + "mapEndSiteLat = $mapEndSiteLatWgs, mapEndSiteLon = $mapEndSiteLonWgs") @@ -410,10 +405,17 @@ object TaxiTaskModel { } } - override fun canStartAutopilot(canStart: Boolean) { - super.canStartAutopilot(canStart) + } + private val iLineCallback: ILineCallback = + object : ILineCallback { + override fun arrivedStationSuccessBySearch() { + super.arrivedStationSuccessBySearch() + if (checkCurrentTaskCondition() + && QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder) + ) { + judgeTaskEndSiteStation() + } } - } // 自车定位 @@ -422,18 +424,12 @@ object TaxiTaskModel { override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) { //位置变化时,通过围栏判断是否到达x点 if (null == mogoLocation) return - - OCHThreadPoolManager.getsInstance().locationExecute { - if (mDriveToNearestStationTask != null) { - judgeDriveToNearestStationTaskStation(mDriveToNearestStationTask, mogoLocation) + if (mDriveToNearestStationTask != null) { + OCHThreadPoolManager.getsInstance().locationExecute { + if (mDriveToNearestStationTask != null) { + judgeDriveToNearestStationTaskStation(mDriveToNearestStationTask, mogoLocation) + } } - - if (checkCurrentTaskCondition() - && QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder) - ) { - judgeTaskEndSiteStation(mogoLocation) - } - } } } @@ -1310,65 +1306,20 @@ object TaxiTaskModel { } } - private fun judgeTaskEndSiteStation(currentLocation: MogoLocation) { + private fun judgeTaskEndSiteStation() { if (!checkCurrentTaskCondition() || !QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder)) { return } val endSite = mCurrentTaskWithOrder!!.endSite ?: return - val endLon = endSite.gcjLon - val endLat = endSite.gcjLat - val distance = CoordinateUtils.calculateLineDistance( - endLon, endLat, - currentLocation.longitude, currentLocation.latitude - ).toDouble() - i(TAG, "judgeEndStation() distance = $distance") - if (distance <= TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE) { //1、当前位置和站点围栏15m内 - - //2、开始计算当前位置和站点的向量角度 < 90度 未经过 >90度 经过 - val stationAngle = DrivingDirectionUtils.getDegreeOfCar2Poi( - currentLocation.longitude, - currentLocation.latitude, - endLon, - endLat, currentLocation.heading.toInt() - ).toDouble() - i( - TAG, - "judgeEndStation() stationAngle = $stationAngle" - ) - - if (!checkCurrentTaskCondition() - || !QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder) - ) { - i(TAG, "task null or TaskStatus = ${getCurTaskStatus()}") - return - } - //3、刚过站且过站距离在15m内, 提交到站 - if (stationAngle > 90) { - i(TAG, "judgeEndStation() = 刚过站且在15m内") - DebugView.printInfoMsg( - "[自车定位围栏] 触发围栏,任务类型:${ - TaskTypeEnum.valueOf( - mCurrentTaskWithOrder?.taskType ?: 0 - )?.name - },围栏范围:${TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE}米 刚过站且在15m内" - ) - submitArriveSite(endSite.siteId, true) - } else { - // 4、 没有过站距离小于15m 速度小于0.3(根据M1来的模数 可能要调) - if (currentLocation.gnssSpeed < 0.3) { - i(TAG, "judgeEndStation() = 没有过站、速度基本为零且在15m内") - DebugView.printInfoMsg( - "[自车定位围栏] 触发围栏,任务类型:${ - TaskTypeEnum.valueOf( - mCurrentTaskWithOrder?.taskType ?: 0 - )?.name - },围栏范围:${TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE}米 没有过站、速度基本为零且在15m内" - ) - submitArriveSite(endSite.siteId, true) - } - } + if (!checkCurrentTaskCondition() + || !QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder) + ) { + i(TAG, "task null or TaskStatus = ${getCurTaskStatus()}") + return } + + submitArriveSite(endSite.siteId, true) } /**