[3.2.0] bus/taxi司机端增加 后台未发布轨迹不可启动自驾开关

This commit is contained in:
wangmingjun
2023-05-17 19:24:20 +08:00
parent ff31290f45
commit 26e70f41e6
5 changed files with 57 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_STOPPED;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -620,6 +621,18 @@ public class OrderModel {
*/
private void startAutopilot(boolean isRestart, int leaveIndex) {
//根据开关和后台是否发布轨迹启动自驾
if (FunctionBuildConfig.isPassStartAutopilotCommand && (TextUtils.isEmpty(busRoutesResult.csvFileUrl)
|| TextUtils.isEmpty(busRoutesResult.csvFileUrlDPQP))){
ToastUtils.showLong("无发布轨迹, 请发布后重试");
CallerLogger.INSTANCE.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand);
return;
}
CallerLogger.INSTANCE.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand);
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");

View File

@@ -3,6 +3,7 @@ package com.mogo.och.taxi.model;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -898,12 +899,25 @@ public class TaxiModel {
clientPkFileName = "sn"
)
public void startAutoPilot() {
if (!checkCurrentOCHOrder()) {
CallerLogger.INSTANCE.e(M_TAXI + TAG, "no order or order is empty.");
ToastUtils.showShort("当前订单不存在或异常!");
return;
}
//根据开关和后台是否发布轨迹启动自驾
if (FunctionBuildConfig.isPassStartAutopilotCommand && (TextUtils.isEmpty(mCurrentOCHOrder.csvFileUrl)
|| TextUtils.isEmpty(mCurrentOCHOrder.csvFileUrlDPQP))){
ToastUtils.showLong("无发布轨迹, 请发布后重试");
CallerLogger.INSTANCE.e(M_TAXI + TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand);
return;
}
CallerLogger.INSTANCE.e(M_TAXI + TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand);
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()){
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");

View File

@@ -1010,6 +1010,19 @@ internal class DebugSettingView @JvmOverloads constructor(
tbReportWarning.visibility = GONE
}
//是否开启无轨迹发送自驾命令
tbStartAutopilotCommand.isChecked = FunctionBuildConfig.isPassStartAutopilotCommand
tbStartAutopilotCommand.setOnCheckedChangeListener { _, isChecked ->
FunctionBuildConfig.isPassStartAutopilotCommand = isChecked
}
if (!AppIdentityModeUtils.isTaxiDriver(FunctionBuildConfig.appIdentityMode)
&& !AppIdentityModeUtils.isBusDriver(FunctionBuildConfig.appIdentityMode)){
tbStartAutopilotCommand.visibility = GONE
}
//切换环境
tvCurEnv.text = "当前环境:${CallerDevaToolsManager.getEnvCityName()}${CallerDevaToolsManager.getEnvNetMode()}"
btChangeEnv.onClick {

View File

@@ -1346,6 +1346,19 @@
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/btnConnectServerIp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbStartAutopilotCommand"
style="@style/DebugSettingText"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_80"
android:layout_gravity="end"
android:layout_marginRight="@dimen/dp_20"
app:switchMinWidth="60dp"
android:text="后台未发布轨迹不可启动自驾"
android:textSize="@dimen/dp_28"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tbReportWarning" />
</androidx.constraintlayout.widget.ConstraintLayout>
<ToggleButton

View File

@@ -238,4 +238,8 @@ object FunctionBuildConfig {
@Volatile
@JvmField
var isV2NPnc = false
@Volatile
@JvmField
var isPassStartAutopilotCommand = true
}