Merge branch 'dev_robotaxi-d_250603_8.1.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_250603_8.1.0

This commit is contained in:
xinfengkun
2025-06-20 14:40:36 +08:00
47 changed files with 1513 additions and 1106 deletions

View File

@@ -22,6 +22,16 @@
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.AutopilotCheckAct"
android:configChanges="orientation|screenSize|keyboardHidden"
android:exported="true"
android:label="自动驾驶检测"
android:launchMode="singleTop"
android:screenOrientation="landscape"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<!-- 故障码数据库更新服务 -->
<service android:name=".service.FmCodeUpdateService" />
<service android:name=".service.FaultManagementDiagnosisService" />

View File

@@ -75,8 +75,8 @@ class SelectAutopilotLineDialog(context: Context) : Dialog(context), LifecycleOw
val divider = DividerItemDecoration(context, linearLayoutManager.orientation)
rvLineList.addItemDecoration(divider)
val params: WindowManager.LayoutParams = window!!.attributes
params.width = WindowUtils.dip2px(context,context.resources.getDimension(R.dimen.dp_280))
params.height = WindowUtils.dip2px(context,context.resources.getDimension(R.dimen.dp_250))
params.width = WindowUtils.dip2px(context,context.resources.getDimension(R.dimen.dp_1200))
params.height = WindowUtils.dip2px(context,context.resources.getDimension(R.dimen.dp_1000))
window?.attributes = params
window?.setBackgroundDrawable(null)
initEvent()
@@ -108,28 +108,28 @@ class SelectAutopilotLineDialog(context: Context) : Dialog(context), LifecycleOw
// 处理Taxi
// 处理BUS包含JV、KW、FT、SW
// CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().cityCode?.let {
// TrajectoryApiClient.queryTrajectoryList(
// this,
// VehicleConfigData.getCarType().name,
// it,
// object :
// NetworkCallback<ArrayList<TrajectoryListInfo>> {
// override fun onSuccess(data: ArrayList<TrajectoryListInfo>) {
// setSelectLineData(data)
// tvLoading.hide()
// }
//
// override fun onError(msg: String) {
// ToastUtils.showLong("获取 Bus 站点列表异常,异常原因:${msg}")
// tvLoading.show("获取 Bus 站点列表异常")
// }
// }
// )
// } ?: let {
// ToastUtils.showLong("获取 Bus 站点列表异常,获取当前未知失败,请开启定位权限")
// tvLoading.show("获取 Bus 站点列表异常,请开启定位权限")
// }
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().cityCode?.let {
TrajectoryApiClient.queryTrajectoryList(
this,
VehicleConfigData.getCarType().name,
it,
object :
NetworkCallback<ArrayList<TrajectoryListInfo>> {
override fun onSuccess(data: ArrayList<TrajectoryListInfo>) {
setSelectLineData(data)
tvLoading.hide()
}
override fun onError(msg: String) {
ToastUtils.showLong("获取 Bus 站点列表异常,异常原因:${msg}")
tvLoading.show("获取 Bus 站点列表异常")
}
}
)
} ?: let {
ToastUtils.showLong("获取 Bus 站点列表异常,获取当前未知失败,请开启定位权限")
tvLoading.show("获取 Bus 站点列表异常,请开启定位权限")
}
}
//取消
@@ -186,6 +186,7 @@ class SelectAutopilotLineDialog(context: Context) : Dialog(context), LifecycleOw
}
override fun dismiss() {
mLifecycleRegistry.currentState = Lifecycle.State.DESTROYED
scopeQueryTrajectoryList.cancel()
mActivity = null
super.dismiss()
@@ -198,7 +199,7 @@ class SelectAutopilotLineDialog(context: Context) : Dialog(context), LifecycleOw
}
override fun getLifecycle(): Lifecycle {
return lifecycle
return mLifecycleRegistry
}

View File

@@ -5,7 +5,7 @@ import com.mogo.eagle.core.data.EnvConfig
object MisHost {
private const val HOST_QA = "https://eagle-qa.zhidaozhixing.com/"
private const val HOST_RELEASE = "https://eagle-mis-v6.zhidaozhixing.com/"
private const val HOST_RELEASE = "https://eagle-mis.zhidaozhixing.com/"
private const val LOGIN_HOST_QA =
"https://carlife-test.zhidaohulian.com/qa/eagle/login/index.html?deviceId="

View File

@@ -17,119 +17,119 @@ object TrajectoryApiClient {
private val apiService: TrajectoryApiService =
NetworkManager.getInstance().createService(TrajectoryApiService::class.java, baseUrl)
// /**
// * 查询 Bus&Taxi 有轨迹的QA线路列表
// */
// fun queryTrajectoryList(
// owner: LifecycleOwner,
// carType: String,
// cityCode: String,
// callback: NetworkCallback<ArrayList<TrajectoryListInfo>>
// ) {
// val reqBody = TrajectoryLisReq()
// reqBody.page = 1
// reqBody.pageSize = 1000
// reqBody.cityCode = cityCode
//
// val observable = if (carType == "TAXI") {
// apiService.queryTaxiTrajectoryList(reqBody)
// } else {
// apiService.queryBusTrajectoryList(reqBody)
// }
//
// NetworkManager.getInstance()
// .sendRequest(
// observable,
// owner,
// object :
// NetworkManager.NetworkCallback<BaseResponse<ArrayList<TrajectoryListInfo>>> {
// override fun onSuccess(response: BaseResponse<ArrayList<TrajectoryListInfo>>?) {
// Log.d(TAG, "查询 $carType 有轨迹的QA线路列表$response")
// // 处理网络请求成功的响应
// response?.result?.let { callback.onSuccess(it) }
// }
//
// override fun onError(throwable: String) {
// Log.e(TAG, "查询 $carType 有轨迹的QA线路列表$throwable")
// // 处理网络请求失败的情况
// callback.onError(throwable)
// }
// }
// )
// }
//
//
// /**
// * 查询 Bus&Taxi 线路对应的站点
// */
// fun querySiteList(
// owner: LifecycleOwner,
// carType: String,
// lineId: Int,
// callback: NetworkCallback<ArrayList<TrajectorySiteInfo>>
// ) {
// val observable = if (carType == "TAXI") {
// apiService.queryTaxiSiteList(lineId)
// } else {
// apiService.queryBusSiteList(lineId)
// }
//
// NetworkManager.getInstance()
// .sendRequest(
// observable,
// owner,
// object :
// NetworkManager.NetworkCallback<BaseResponse<ArrayList<TrajectorySiteInfo>>> {
// override fun onSuccess(response: BaseResponse<ArrayList<TrajectorySiteInfo>>?) {
// Log.d(TAG, "查询 $carType 线路对应的站点:$response")
// // 处理网络请求成功的响应
// response?.result?.let { callback.onSuccess(it) }
// }
//
// override fun onError(throwable: String) {
// Log.e(TAG, "查询 $carType 线路对应的站点:$throwable")
// // 处理网络请求失败的情况
// callback.onError(throwable)
// }
// }
// )
// }
//
// /**
// * 查询 Bus&Taxi 线路对应的轨迹
// */
// fun queryTrajectoryInfo(
// owner: LifecycleOwner,
// carType: String,
// reqBody: TrajectoryInfoReq,
// callback: NetworkCallback<TrajectoryInfo>
// ) {
//
// val observable = if (carType == "TAXI") {
// apiService.queryTaxiTrajectoryInfo(reqBody)
// } else {
// apiService.queryBusTrajectoryInfo(reqBody)
// }
//
// NetworkManager.getInstance()
// .sendRequest(
// observable,
// owner,
// object :
// NetworkManager.NetworkCallback<BaseResponse<TrajectoryInfo>> {
// override fun onSuccess(response: BaseResponse<TrajectoryInfo>?) {
// Log.d(TAG, "查询 $carType 线路对应的轨迹:$response")
// // 处理网络请求成功的响应
// response?.result?.let { callback.onSuccess(it) }
// }
//
// override fun onError(throwable: String) {
// Log.e(TAG, "查询 $carType 线路对应的轨迹:$throwable")
// // 处理网络请求失败的情况
// callback.onError(throwable)
// }
// }
// )
// }
/**
* 查询 Bus&Taxi 有轨迹的QA线路列表
*/
fun queryTrajectoryList(
owner: LifecycleOwner,
carType: String,
cityCode: String,
callback: NetworkCallback<ArrayList<TrajectoryListInfo>>
) {
val reqBody = TrajectoryLisReq()
reqBody.page = 1
reqBody.pageSize = 1000
reqBody.cityCode = cityCode
val observable = if (carType == "TAXI") {
apiService.queryTaxiTrajectoryList(reqBody)
} else {
apiService.queryBusTrajectoryList(reqBody)
}
NetworkManager.getInstance()
.sendRequest(
observable,
owner,
object :
NetworkManager.NetworkCallback<BaseResponse<ArrayList<TrajectoryListInfo>>> {
override fun onSuccess(response: BaseResponse<ArrayList<TrajectoryListInfo>>?) {
Log.d(TAG, "查询 $carType 有轨迹的QA线路列表$response")
// 处理网络请求成功的响应
response?.result?.let { callback.onSuccess(it) }
}
override fun onError(throwable: String) {
Log.e(TAG, "查询 $carType 有轨迹的QA线路列表$throwable")
// 处理网络请求失败的情况
callback.onError(throwable)
}
}
)
}
/**
* 查询 Bus&Taxi 线路对应的站点
*/
fun querySiteList(
owner: LifecycleOwner,
carType: String,
lineId: Int,
callback: NetworkCallback<ArrayList<TrajectorySiteInfo>>
) {
val observable = if (carType == "TAXI") {
apiService.queryTaxiSiteList(lineId)
} else {
apiService.queryBusSiteList(lineId)
}
NetworkManager.getInstance()
.sendRequest(
observable,
owner,
object :
NetworkManager.NetworkCallback<BaseResponse<ArrayList<TrajectorySiteInfo>>> {
override fun onSuccess(response: BaseResponse<ArrayList<TrajectorySiteInfo>>?) {
Log.d(TAG, "查询 $carType 线路对应的站点:$response")
// 处理网络请求成功的响应
response?.result?.let { callback.onSuccess(it) }
}
override fun onError(throwable: String) {
Log.e(TAG, "查询 $carType 线路对应的站点:$throwable")
// 处理网络请求失败的情况
callback.onError(throwable)
}
}
)
}
/**
* 查询 Bus&Taxi 线路对应的轨迹
*/
fun queryTrajectoryInfo(
owner: LifecycleOwner,
carType: String,
reqBody: TrajectoryInfoReq,
callback: NetworkCallback<TrajectoryInfo>
) {
val observable = if (carType == "TAXI") {
apiService.queryTaxiTrajectoryInfo(reqBody)
} else {
apiService.queryBusTrajectoryInfo(reqBody)
}
NetworkManager.getInstance()
.sendRequest(
observable,
owner,
object :
NetworkManager.NetworkCallback<BaseResponse<TrajectoryInfo>> {
override fun onSuccess(response: BaseResponse<TrajectoryInfo>?) {
Log.d(TAG, "查询 $carType 线路对应的轨迹:$response")
// 处理网络请求成功的响应
response?.result?.let { callback.onSuccess(it) }
}
override fun onError(throwable: String) {
Log.e(TAG, "查询 $carType 线路对应的轨迹:$throwable")
// 处理网络请求失败的情况
callback.onError(throwable)
}
}
)
}
}

View File

@@ -1,12 +1,11 @@
package com.mogo.module.common.net.mis.trajectory.net
import com.mogo.eagle.core.data.BaseResponse
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectoryInfo
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectoryInfoReq
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectoryLisReq
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectoryListInfo
import com.zhjt.mogo_core_function_devatools.rviz.bean.TrajectorySiteInfo
import com.zhjt.mogo_core_function_devatools.rviz.net.BaseResponse
import io.reactivex.Observable
import retrofit2.http.Body
import retrofit2.http.GET

View File

@@ -0,0 +1,16 @@
package com.zhjt.mogo_core_function_devatools.rviz.ui.activity
import android.os.Bundle
import com.zhjt.mogo_core_function_devatools.rviz.R
import com.zhjt.mogo_core_function_devatools.rviz.common.base.BaseActivity
import kotlinx.android.synthetic.main.layout_autopilot_check.viewCheckAutopilot
class AutopilotCheckAct: BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?){
super.onCreate(savedInstanceState)
setContentView(R.layout.layout_autopilot_check)
viewCheckAutopilot.setActivity(this)
}
}

View File

@@ -0,0 +1,31 @@
package com.zhjt.mogo_core_function_devatools.rviz.utils;
import net.sourceforge.pinyin4j.PinyinHelper;
/**
* @author: wangmingjun
* @date: 2021/11/26
*/
public class PinYinUtil {
/**
* 得到中文字符串首字母
* @param str 需要转化的中文字符串
* @return 大写首字母缩写的字符串
*/
public static String getPinYinHeadChar(String str) {
str = str.replaceAll("[\\p{P}‘’“”|+=¥$<>^~]", "");
StringBuilder convert = new StringBuilder();
for (int j = 0; j < str.length(); j++) {
char word = str.charAt(j);
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(word);
if (pinyinArray != null) {
convert.append(pinyinArray[0].charAt(0));
} else {
if (!"".equals(String.valueOf(word).trim())){
convert.append(word);
}
}
}
return convert.toString().trim().toUpperCase();
}
}

View File

@@ -9,10 +9,10 @@
android:id="@+id/tvSelectLineTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_15"
android:layout_margin="@dimen/dp_30"
android:text="请选择自动驾驶路线"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/sp_18"
android:textSize="@dimen/sp_36"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -33,8 +33,8 @@
<ImageView
android:id="@+id/ivSearch"
android:layout_width="@dimen/dp_25"
android:layout_height="@dimen/dp_25"
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_50"
android:layout_marginEnd="@dimen/dp_15"
android:src="@drawable/icon_line_search"
app:layout_constraintBottom_toBottomOf="parent"
@@ -50,7 +50,7 @@
android:hint="自动驾驶路线搜索"
android:textColor="#FFFFFFFF"
android:textColorHint="#B3FFFFFF"
android:textSize="@dimen/sp_16"
android:textSize="@dimen/sp_32"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/ivSearch"
@@ -91,10 +91,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dp_15"
android:padding="@dimen/dp_30"
android:text="取消"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/sp_18"
android:textSize="@dimen/sp_36"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />

View File

@@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="@dimen/sp_16"
android:textSize="@dimen/sp_32"
android:gravity="center_horizontal"
android:padding="@dimen/dp_10"
>

View File

@@ -14,13 +14,13 @@
android:layout_marginEnd="@dimen/dp_5"
android:gravity="start"
android:textColor="@color/white"
android:textSize="@dimen/sp_12"
android:textSize="@dimen/sp_30"
tools:text="ReportMsg" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_15"
android:background="@color/white" />
</LinearLayout>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.zhjt.mogo_core_function_devatools.rviz.ui.views.CheckAutopilotView
android:id="@+id/viewCheckAutopilot"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>

View File

@@ -17,12 +17,12 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toTopOf="@id/ivSpeedReduce"
android:text="请选择自动驾驶路线"
android:padding="@dimen/dp_5"
android:textSize="@dimen/sp_18"
android:padding="@dimen/dp_10"
android:textSize="@dimen/sp_36"
android:textColor="@color/white"
android:gravity="center_horizontal"
android:layout_margin="@dimen/dp_10"
android:layout_margin="@dimen/dp_20"
/>
<TextView
@@ -31,7 +31,7 @@
android:layout_height="wrap_content"
android:text="车 速 设 置:"
android:textColor="@color/white"
android:textSize="@dimen/sp_18"
android:textSize="@dimen/sp_36"
app:layout_constraintStart_toStartOf="@id/tvAutoDriveLineSelect"
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
@@ -39,8 +39,8 @@
<ImageView
android:id="@+id/ivSpeedReduce"
android:layout_width="@dimen/dp_28"
android:layout_height="@dimen/dp_35"
android:layout_width="@dimen/dp_105"
android:layout_height="@dimen/dp_140"
android:layout_marginTop="@dimen/dp_10"
android:src="@drawable/icon_speed_reduce"
app:layout_constraintStart_toEndOf="@id/tvSpeedTitle"
@@ -51,14 +51,14 @@
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etInputSpeed"
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_35"
android:layout_width="@dimen/dp_200"
android:layout_height="@dimen/dp_140"
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
app:layout_constraintLeft_toRightOf="@id/ivSpeedReduce"
android:background="#1E3062"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/sp_16"
android:textSize="@dimen/sp_32"
android:gravity="center"
tools:ignore="SpeakableTextPresentCheck"
android:focusableInTouchMode="false"
@@ -66,8 +66,8 @@
<ImageView
android:id="@+id/ivSpeedAdd"
android:layout_width="@dimen/dp_28"
android:layout_height="@dimen/dp_35"
android:layout_width="@dimen/dp_105"
android:layout_height="@dimen/dp_140"
app:layout_constraintTop_toTopOf="@id/etInputSpeed"
app:layout_constraintBottom_toBottomOf="@id/etInputSpeed"
app:layout_constraintLeft_toRightOf="@id/etInputSpeed"
@@ -81,11 +81,11 @@
android:layout_height="wrap_content"
android:text="km/h"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/sp_18"
android:textSize="@dimen/sp_36"
app:layout_constraintTop_toTopOf="@id/ivSpeedAdd"
app:layout_constraintBottom_toBottomOf="@id/ivSpeedAdd"
app:layout_constraintLeft_toRightOf="@id/ivSpeedAdd"
android:layout_marginStart="@dimen/dp_10" />
android:layout_marginStart="@dimen/dp_20" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvSureModify"
@@ -95,7 +95,7 @@
android:gravity="center"
android:text="确定"
android:textColor="@android:color/white"
android:textSize="@dimen/sp_18"
android:textSize="@dimen/sp_36"
android:paddingTop="@dimen/dp_5"
android:paddingBottom="@dimen/dp_5"
android:paddingStart="@dimen/dp_20"
@@ -116,9 +116,9 @@
android:text="P"
android:textAlignment="center"
android:textColor="@color/p_default_txt_color"
android:textSize="@dimen/sp_20"
android:textSize="@dimen/sp_40"
android:textStyle="bold"
android:layout_marginStart="@dimen/dp_10"
android:layout_marginStart="@dimen/dp_20"
/>
<TextView
@@ -131,9 +131,9 @@
android:text="R"
android:textAlignment="center"
android:textColor="@color/p_default_txt_color"
android:textSize="@dimen/sp_20"
android:textSize="@dimen/sp_40"
android:textStyle="bold"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginStart="@dimen/dp_20"
/>
<TextView
@@ -146,9 +146,9 @@
android:text="N"
android:textAlignment="center"
android:textColor="@color/p_default_txt_color"
android:textSize="@dimen/sp_20"
android:textSize="@dimen/sp_40"
android:textStyle="bold"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginStart="@dimen/dp_20"
/>
<TextView
@@ -161,40 +161,41 @@
android:text="D"
android:textAlignment="center"
android:textColor="@color/p_default_txt_color"
android:textSize="@dimen/sp_20"
android:textSize="@dimen/sp_40"
android:textStyle="bold"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginStart="@dimen/dp_20"
/>
<Button
android:id="@+id/btnAutoPilotStatus"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_35"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
app:layout_constraintLeft_toRightOf="@id/tvGearD"
app:layout_constraintRight_toLeftOf="@id/btnControlAutoPilot"
app:layout_constraintTop_toTopOf="@id/btnControlAutoPilot"
app:layout_constraintBottom_toBottomOf="@id/btnControlAutoPilot"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_15"
android:textSize="@dimen/sp_18"
android:layout_marginStart="@dimen/dp_30"
android:layout_marginEnd="@dimen/dp_30"
android:paddingStart="@dimen/dp_30"
android:paddingEnd="@dimen/dp_30"
android:textSize="@dimen/sp_36"
android:text="自驾状态"
/>
<ToggleButton
android:id="@+id/btnControlAutoPilot"
android:layout_width="@dimen/dp_0"
android:layout_height="@dimen/dp_35"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_10"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginEnd="@dimen/dp_20"
android:enabled="false"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:textColor="@color/white"
android:textOff="启动自动驾驶"
android:textOn="退出自动驾驶"
android:textSize="@dimen/sp_18"
android:textSize="@dimen/sp_36"
app:layout_constraintTop_toBottomOf="@+id/ivSpeedReduce"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toRightOf="@id/btnAutoPilotStatus"