Merge branch 'dev_robotaxi-d_240807_6.6.0' into tmp_6.7.0_arrow
This commit is contained in:
@@ -7,6 +7,7 @@ import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_STOPPED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.ArrayMap;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -742,7 +743,7 @@ public class OrderModel {
|
||||
|
||||
if(CallerAutoPilotStatusListenerManager.INSTANCE.getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
|
||||
// 预写日志
|
||||
triggerStartServiceEvent(isRestart, false);
|
||||
triggerStartServiceEvent(isRestart, false,0);
|
||||
}
|
||||
|
||||
AutopilotControlParameters parameters = initAutopilotControlParameters(leaveIndex);
|
||||
@@ -956,7 +957,17 @@ public class OrderModel {
|
||||
currentTaskId = result.getTaskId();
|
||||
currentLineId = result.getLineId();
|
||||
String lineName = result.getName();
|
||||
LineManager.setLineInfo(new LineInfo(currentLineId,lineName));
|
||||
ArrayMap<String, String> objectObjectArrayMap = new ArrayMap<>();
|
||||
try{
|
||||
String lineTime = DateTimeUtil.formatLongToString(
|
||||
busRoutesResult.getTaskTime(),
|
||||
DateTimeUtil.HH_mm);
|
||||
objectObjectArrayMap.put("taskInfo",lineTime);
|
||||
}catch (Exception e){
|
||||
OchChainLogManager.writeChainLog("设置任务名称","设置任务名称报错"+e.getStackTrace());
|
||||
}
|
||||
LineManager.setLineInfo(new LineInfo(currentLineId,lineName,objectObjectArrayMap));
|
||||
|
||||
stationList.clear();
|
||||
stationList.addAll(site);
|
||||
|
||||
@@ -1255,14 +1266,14 @@ public class OrderModel {
|
||||
LoginStatusManager.loginOut();
|
||||
}
|
||||
|
||||
public void triggerStartServiceEvent(boolean isRestart, boolean send) {
|
||||
public void triggerStartServiceEvent(boolean isRestart, boolean send,int source) {
|
||||
if (backgroundCurrentStationIndex >= stationList.size() - 1) {
|
||||
return;
|
||||
}
|
||||
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
|
||||
OchAutopilotAnalytics.INSTANCE.triggerStartAutopilotEvent(isRestart, send,
|
||||
currentStation.getName(), nextStation.getName(), currentLineId,"",System.currentTimeMillis());
|
||||
currentStation.getName(), nextStation.getName(), currentLineId,"",System.currentTimeMillis(),source);
|
||||
}
|
||||
|
||||
public void triggerUpdateStartAutoPilotSessionId(long sessionId) {
|
||||
|
||||
@@ -212,7 +212,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
|
||||
OrderModel.getInstance().triggerStartServiceEvent(
|
||||
OrderModel.getInstance().isRestartAutopilot(), true);
|
||||
OrderModel.getInstance().isRestartAutopilot(), true,0);
|
||||
// 改变UI自动驾驶状态
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
@@ -236,6 +236,14 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponseFromCan(int state) {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
OrderModel.getInstance().triggerStartServiceEvent(
|
||||
OrderModel.getInstance().isRestartAutopilot(), true,1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startOpenAutopilot() {
|
||||
//非美化模式下启动动画
|
||||
|
||||
@@ -488,7 +488,7 @@ class DriverM1Model {
|
||||
return;
|
||||
}
|
||||
|
||||
triggerStartServiceEvent(false, false)
|
||||
triggerStartServiceEvent(false, false,0)
|
||||
|
||||
val parameters = initAutopilotControlParameters()
|
||||
if (null == parameters) {
|
||||
@@ -526,7 +526,7 @@ class DriverM1Model {
|
||||
LoginStatusManager.loginOut()
|
||||
}
|
||||
|
||||
fun triggerStartServiceEvent(isRestart: Boolean, send: Boolean) {
|
||||
fun triggerStartServiceEvent(isRestart: Boolean, send: Boolean,source:Int) {
|
||||
if (mCurrentOrder == null) {
|
||||
return
|
||||
}
|
||||
@@ -538,7 +538,8 @@ class DriverM1Model {
|
||||
|
||||
OchAutopilotAnalytics.triggerStartAutopilotEvent(
|
||||
isRestart, send,
|
||||
startSiteName, endSiteName, it, orderNo?:"", System.currentTimeMillis()
|
||||
startSiteName, endSiteName, it, orderNo?:"", System.currentTimeMillis(),
|
||||
source
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ class DriverM1Presenter(view: DriverM1Fragment?) :
|
||||
//
|
||||
// }
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING ->{
|
||||
DriverM1Model.get().triggerStartServiceEvent(false,true)
|
||||
DriverM1Model.get().triggerStartServiceEvent(false,true,0)
|
||||
}
|
||||
// IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE ->{
|
||||
//
|
||||
@@ -150,6 +150,15 @@ class DriverM1Presenter(view: DriverM1Fragment?) :
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponseFromCan(state: Int) {
|
||||
super.onAutopilotStatusResponseFromCan(state)
|
||||
when(state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
DriverM1Model.get().triggerStartServiceEvent(false, true,1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStartAutopilotFailure(
|
||||
actionStatus: StopSideStatus,
|
||||
stopSideStatus: Boolean?,
|
||||
|
||||
@@ -15,12 +15,14 @@ import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.KeyboardUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.biz.BuildConfig
|
||||
import com.mogo.och.biz.R
|
||||
import com.mogo.och.biz.login.callback.ILoginViewCallback
|
||||
import com.mogo.och.biz.login.presenter.LoginPresenter
|
||||
import kotlinx.android.synthetic.main.biz_login_view.bg_start_bar
|
||||
import kotlinx.android.synthetic.main.biz_login_view.biz_acbtn_login
|
||||
import kotlinx.android.synthetic.main.biz_login_view.biz_ace_login_phone_value
|
||||
import kotlinx.android.synthetic.main.biz_login_view.biz_acet_phone_code_value
|
||||
@@ -77,7 +79,11 @@ class LoginFragment : MvpFragment<LoginFragment?, LoginPresenter?>(), ILoginView
|
||||
}
|
||||
|
||||
private fun initBg() {
|
||||
|
||||
bg_start_bar.post {
|
||||
val params: ViewGroup.LayoutParams = bg_start_bar.getLayoutParams()
|
||||
params.height = BarUtils.getStatusBarHeight()
|
||||
bg_start_bar.layoutParams = params
|
||||
}
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
|
||||
@@ -23,6 +23,13 @@
|
||||
android:layout_width="1071dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/bg_start_bar"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:background="@color/biz_login_171D2B"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_72"/>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/biz_actv_welcome_login_title"
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
<color name="biz_login_5F6582">#5F6582</color>
|
||||
<color name="biz_login_72A7FF">#72A7FF</color>
|
||||
<color name="biz_login_A0B3DA">#A0B3DA</color>
|
||||
<color name="biz_login_171D2B">#171D2B</color>
|
||||
|
||||
</resources>
|
||||
@@ -19,6 +19,7 @@ public class LoginInfo {
|
||||
private String carModel;//E70 型号
|
||||
private String photos;//车身照片:
|
||||
private long tenantId;//租户id:
|
||||
private long driverId;
|
||||
|
||||
public int getDriverStatus() {
|
||||
return driverStatus;
|
||||
@@ -148,6 +149,14 @@ public class LoginInfo {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public long getDriverId() {
|
||||
return driverId;
|
||||
}
|
||||
|
||||
public void setDriverId(long driverId) {
|
||||
this.driverId = driverId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LoginInfo{" +
|
||||
@@ -167,6 +176,7 @@ public class LoginInfo {
|
||||
", carModel='" + carModel + '\'' +
|
||||
", photos='" + photos + '\'' +
|
||||
", tenantId='" + tenantId + '\'' +
|
||||
", driverId='" + driverId + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@@ -182,6 +192,7 @@ public class LoginInfo {
|
||||
if (businessType != loginInfo.businessType) return false;
|
||||
if (purpose != loginInfo.purpose) return false;
|
||||
if (tenantId != loginInfo.tenantId) return false;
|
||||
if (driverId != loginInfo.driverId) return false;
|
||||
if (!Objects.equals(orderNo, loginInfo.orderNo))
|
||||
return false;
|
||||
if (!Objects.equals(sn, loginInfo.sn)) return false;
|
||||
@@ -207,6 +218,7 @@ public class LoginInfo {
|
||||
result = 31 * result + servingStatus;
|
||||
result = 31 * result + businessType;
|
||||
result = 31 * result + (int)tenantId;
|
||||
result = 31 * result + (int)driverId;
|
||||
result = 31 * result + (orderNo != null ? orderNo.hashCode() : 0);
|
||||
result = 31 * result + purpose;
|
||||
result = 31 * result + (sn != null ? sn.hashCode() : 0);
|
||||
|
||||
@@ -89,4 +89,11 @@ public interface IOchAutopilotStatusListener {
|
||||
default void canStartAutopilot(boolean canStart) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶状态信息 数据源来自底盘 不管是否存在FSM 都将进行底盘自驾状态的转发
|
||||
*
|
||||
* @param state 状态信息
|
||||
*/
|
||||
default void onAutopilotStatusResponseFromCan(int state) {}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,11 +54,17 @@ object OchAutoPilotManager : IMoGoReceiveReceivedAckListener, IMoGoFsm2024Listen
|
||||
fun canStartAutopilotBySessionId():Boolean{
|
||||
return (globalSessionId.get()==-1L).apply {
|
||||
if(!this) {
|
||||
OchAutopilotAnalytics.triggerDistance2LineorStation(globalSessionId.get())
|
||||
ToastUtils.showLong("自驾启动中,请勿重复点击")
|
||||
OchAutopilotAnalytics.triggerCanStartAutopilotBySessionId(globalSessionId.get())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun canStartAutopilotBySessionIdInner():Boolean{
|
||||
return (globalSessionId.get()==-1L)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun canStartAutoPilotSSM(): Boolean {
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
|
||||
@@ -113,9 +119,9 @@ object OchAutoPilotManager : IMoGoReceiveReceivedAckListener, IMoGoFsm2024Listen
|
||||
/**
|
||||
* 启动自驾失败切 FSM返回的Session和启动SessionId 不同
|
||||
*/
|
||||
fun checkStartSeesionAndFailSessionId(){
|
||||
fun checkStartSessionAndFailSessionId(){
|
||||
if(globalSessionId.get() != fsmBackSessionId.get()){
|
||||
OchAutopilotAnalytics.triggerStartAutopilotFailCheckSeesiongDiff(globalSessionId.get(),
|
||||
OchAutopilotAnalytics.triggerStartAutopilotFailCheckSessionDiff(globalSessionId.get(),
|
||||
fsmBackSessionId.get())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +180,9 @@ object OchAutoPilotStatusListenerManager : CallerBase<IOchAutopilotStatusListene
|
||||
|
||||
override fun onAutopilotStatusResponseFromCan(state: Int) {
|
||||
super.onAutopilotStatusResponseFromCan(state)
|
||||
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onAutopilotStatusResponseFromCan(state)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ object OchAutopilotAnalytics {
|
||||
private const val EVENT_PARAM_MAP_ORIGINAL_DATA = "map_original_data" // 域控原始状态信息
|
||||
private const val EVENT_PARAM_AUTOPILOT_STATE = "autopilot_state" //原始的自动驾驶状态
|
||||
private const val EVENT_PARAM_START_RESULT = "start_autopilot" // true/false
|
||||
private const val EVENT_PARAM_START_RESULT_SOURCE = "start_autopilot_source" // true/false
|
||||
private const val EVENT_PARAM_START_FAILURE_CODE = "start_autopilot_failure_code" // 启动自驾失败code
|
||||
private const val EVENT_PARAM_START_FAILURE_MSG = "start_autopilot_failure_msg" // 启动自驾失败原因
|
||||
private const val EVENT_PARAM_START_AUTOPILOT_SESSION_ID = "start_autopilot_cmd_session_id" //启动自驾命令请求的sessionId
|
||||
@@ -41,7 +42,11 @@ object OchAutopilotAnalytics {
|
||||
private const val EVENT_PARAM_START_AUTOPILOT_ACK_SUCCESS= "start_autopilot_parameters_ack_isSuccess" // 启动自驾参数
|
||||
|
||||
private const val EVENT_KEY_INFO_AUTOPILOT_DISTANCE = "event_key_vehicle_start_autopilot_state_distance_15"
|
||||
private const val EVENT_KEY_INFO_AUTOPILOT_SESSION = "event_key_vehicle_start_autopilot_state_sessiong"
|
||||
|
||||
private const val EVENT_KEY_VEHICLE_START_AUTOPILOT_CMD_SESSION_DUPLICATED = "event_key_vehicle_start_autopilot_cmd_session_duplicated"
|
||||
private const val EVENT_KEY_VEHICLE_START_AUTOPILOT_CMD_SESSION_DIFF = "event_key_vehicle_start_autopilot_cmd_session_diff"
|
||||
private const val EVENT_PARAM_VEHICLE_START_AUTOPILOT_CMD_SESSION_ID_START = "cmd_session_id_start"
|
||||
private const val EVENT_PARAM_VEHICLE_START_AUTOPILOT_CMD_SESSION_ID_FSM_RETURN = "cmd_session_id_fsm_return"
|
||||
|
||||
private val LOOP_PERIOD_15S = 15 * 1000L
|
||||
|
||||
@@ -89,23 +94,25 @@ object OchAutopilotAnalytics {
|
||||
/**
|
||||
* 等待底盘返回的间隙 重复启动自驾
|
||||
*/
|
||||
fun triggerDistance2LineorStation(globalSessionId : Long){
|
||||
fun triggerCanStartAutopilotBySessionId(globalSessionId : Long){
|
||||
val map = hashMapOf<String, Any>()
|
||||
map[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
|
||||
OchChainLogManager.writeChainLog("启动自驾Sessiong判断","已有globalSessionId:${globalSessionId}", eventID = EVENT_KEY_INFO_AUTOPILOT_SESSION, patch = map)
|
||||
OchChainLogManager.writeChainLog("启动自驾Session判断","已有globalSessionId:${globalSessionId}", eventID = EVENT_KEY_VEHICLE_START_AUTOPILOT_CMD_SESSION_DUPLICATED, patch = map)
|
||||
}
|
||||
|
||||
/**
|
||||
* 等待底盘返回的间隙 重复启动自驾
|
||||
* 启动失败后 对比两个session是否相同
|
||||
*/
|
||||
fun triggerStartAutopilotFailCheckSeesiongDiff(globalSessionId: Long, fsmBackSessionId: Long){
|
||||
fun triggerStartAutopilotFailCheckSessionDiff(globalSessionId: Long, fsmBackSessionId: Long){
|
||||
val map = hashMapOf<String, Any>()
|
||||
map[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
|
||||
OchChainLogManager.writeChainLog("启动自驾失败且SessionId不同","globalSessionId:${globalSessionId}——————fsmBackSessionId:${fsmBackSessionId}", eventID = EVENT_KEY_INFO_AUTOPILOT_SESSION, patch = map)
|
||||
map[EVENT_PARAM_VEHICLE_START_AUTOPILOT_CMD_SESSION_ID_START] = globalSessionId
|
||||
map[EVENT_PARAM_VEHICLE_START_AUTOPILOT_CMD_SESSION_ID_FSM_RETURN] = fsmBackSessionId
|
||||
OchChainLogManager.writeChainLog("启动自驾失败且SessionId不同","globalSessionId:${globalSessionId}——————fsmBackSessionId:${fsmBackSessionId}", eventID = EVENT_KEY_VEHICLE_START_AUTOPILOT_CMD_SESSION_DIFF, patch = map)
|
||||
}
|
||||
|
||||
|
||||
private val timeOutRunnable = Runnable {
|
||||
private val timeOutRunnable = Runnable {
|
||||
// 15s内未开启,上报失败埋点
|
||||
triggerStartAutopilotFailureEvent("", "15s后app等待超时", System.currentTimeMillis())
|
||||
}
|
||||
@@ -116,16 +123,20 @@ object OchAutopilotAnalytics {
|
||||
fun triggerStartAutopilotFailureEventByAdas(failCode: String, failMsg: String, startFailDate: Long) {
|
||||
BizLoopManager.removeCallback(timeOutRunnable)
|
||||
// 判断Session 是否相同
|
||||
OchAutoPilotManager.checkStartSeesionAndFailSessionId()
|
||||
OchAutoPilotManager.checkStartSessionAndFailSessionId()
|
||||
triggerStartAutopilotFailureEvent(failCode, failMsg, startFailDate)
|
||||
}
|
||||
|
||||
private fun clearStartAutopilotParams() {
|
||||
mStartAutopilotParams.clear()
|
||||
OchAutoPilotManager.clearGlobalSessionId()
|
||||
}
|
||||
|
||||
private fun triggerStartAutopilotFailureEvent(failCode: String, failMsg: String, startFailDate: Long) {
|
||||
if(OchAutoPilotManager.canStartAutopilotBySessionIdInner()){
|
||||
CallerLogger.e(SceneConstant.M_OCHCOMMON + "triggerStartAutopilotFailureEvent canStartAutopilotBySessionIdInner == false")
|
||||
return
|
||||
}
|
||||
OchAutoPilotManager.clearGlobalSessionId()
|
||||
if (mStartAutopilotParams.isEmpty()) return
|
||||
CallerLogger.e(SceneConstant.M_OCHCOMMON + "triggerStartAutopilotFailureEvent", failMsg)
|
||||
if (CallerAutoPilotStatusListenerManager.getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
@@ -156,16 +167,23 @@ object OchAutopilotAnalytics {
|
||||
endName: String,
|
||||
lineId: Int,
|
||||
orderId:String?,
|
||||
triggerDate: Long
|
||||
triggerDate: Long,
|
||||
source:Int = 0
|
||||
) {
|
||||
mStartAutopilotKey = if (restart) getEventKeyRestartService() else getEventKeyStartService()
|
||||
if (send) {
|
||||
if (mStartAutopilotParams.isEmpty()) return
|
||||
if(OchAutoPilotManager.canStartAutopilotBySessionIdInner()){
|
||||
CallerLogger.e(SceneConstant.M_OCHCOMMON + "triggerStartAutopilotEvent canStartAutopilotBySessionIdInner == false")
|
||||
return
|
||||
}
|
||||
OchAutoPilotManager.clearGlobalSessionId()
|
||||
BizLoopManager.removeCallback(timeOutRunnable)
|
||||
if (mStartAutopilotParams.isEmpty()) return
|
||||
// 开启成功,上报埋点
|
||||
mStartAutopilotParams[EVENT_PARAM_START_FAILURE_CODE] = ""
|
||||
mStartAutopilotParams[EVENT_PARAM_START_FAILURE_MSG] = ""
|
||||
mStartAutopilotParams[EVENT_PARAM_START_RESULT] = true
|
||||
mStartAutopilotParams[EVENT_PARAM_START_RESULT_SOURCE] = source
|
||||
// 自动驾驶状态变更时间
|
||||
mStartAutopilotParams[EVENT_PARAM_START_SUCCESS_TIME] = DateTimeUtils.getTimeText(triggerDate,DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
mStartAutopilotParams[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.line
|
||||
|
||||
import com.mogo.commons.env.ProjectUtils
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapGlobalTrajectoryDrawManager
|
||||
import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.utils.CallerBase
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.data.bean.ContraiInfo
|
||||
@@ -32,12 +35,76 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
*/
|
||||
var endStation: BusStationBean? = null
|
||||
|
||||
/**
|
||||
* 设置站点信息
|
||||
*/
|
||||
fun setStartAndEndStation(startStation: BusStationBean?,endStation: BusStationBean?){
|
||||
this.startStation = startStation
|
||||
this.endStation = endStation
|
||||
OchChainLogManager.writeChainLogAutopilot("自驾参数","${startStation}---${endStation}")
|
||||
}
|
||||
|
||||
fun getStations(function: (start:BusStationBean,end:BusStationBean) -> Unit){
|
||||
startStation?.let { start->
|
||||
endStation?.let { end ->
|
||||
function.invoke(start,end)
|
||||
}
|
||||
}
|
||||
}
|
||||
fun getStationsWithContrai(function: (start:BusStationBean,end:BusStationBean,contrai: ContraiInfo) -> Unit){
|
||||
startStation?.let { start->
|
||||
endStation?.let { end ->
|
||||
contraiInfo?.let {contrai->
|
||||
function.invoke(start,end,contrai)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getStationsWithLine(function: (start:BusStationBean,end:BusStationBean,lineInfo: LineInfo) -> Unit){
|
||||
startStation?.let { start->
|
||||
endStation?.let { end ->
|
||||
lineInfos?.let {line->
|
||||
function.invoke(start,end, line)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fun getStationsWithLineAndContrai(function: (start:BusStationBean,end:BusStationBean,lineInfo: LineInfo,contrai: ContraiInfo) -> Unit){
|
||||
startStation?.let { start->
|
||||
endStation?.let { end ->
|
||||
lineInfos?.let {line->
|
||||
contraiInfo?.let { contrai ->
|
||||
function.invoke(start,end, line,contrai)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getStartStation(function: (start:BusStationBean) -> Unit){
|
||||
startStation?.let { start ->
|
||||
function.invoke(start)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun setLineInfo(lineInfo: LineInfo?){
|
||||
if(lineInfo==null){
|
||||
clearGlobalTrajectory(true)
|
||||
CallerOrderListenerManager.invokeOrderLineUpdate("")
|
||||
}
|
||||
this.lineInfos = lineInfo
|
||||
this.lineInfos?.let { line ->
|
||||
if(ProjectUtils.isSaas()) {
|
||||
val sb = StringBuilder()
|
||||
sb.append(line.lineName)
|
||||
line.multiMap?.forEach {
|
||||
sb.append(it.value)
|
||||
}
|
||||
CallerOrderListenerManager.invokeOrderLineUpdate(sb.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ object OchChainLogManager {
|
||||
// 局域网内socket 连接状态流转
|
||||
const val EVENT_KEY_INFO_SCANNER = "analytics_event_och_scanner"
|
||||
|
||||
// 局域网内socket 连接状态流转
|
||||
// 自动驾驶日志群
|
||||
const val EVENT_KEY_INFO_AUTOPILOT = "analytics_event_och_autopilot"
|
||||
|
||||
const val EVENT_KEY_INFO_VOICE_TTS = "analytics_event_och_voice_tts"
|
||||
@@ -124,13 +124,6 @@ object OchChainLogManager {
|
||||
|
||||
|
||||
fun addCommonParams(params:MutableMap<String,Any>){
|
||||
val plateNum = AppConfigInfo.plateNumber
|
||||
params["sn"] = SharedPrefsMgr.getInstance().sn
|
||||
params["env"] = DebugConfig.getNetMode()
|
||||
params["product"] = AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode).name
|
||||
params["role"] = AppIdentityModeUtils.getRole(FunctionBuildConfig.appIdentityMode).name
|
||||
params["cartype"] = AppIdentityModeUtils.getCarType(FunctionBuildConfig.appIdentityMode).name
|
||||
params["plate_number"] = if (TextUtils.isEmpty(plateNum)) "" else plateNum
|
||||
params["time"] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.view.animation.LinearInterpolator
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.map.listener.IMogoMapListener
|
||||
@@ -55,6 +56,7 @@ class CommonLoadingView @JvmOverloads constructor(
|
||||
HdMapBuildConfig.isMapLoaded = true
|
||||
// 设置地图样式
|
||||
MogoMapListenerHandler.mogoMapListenerHandler.onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR)
|
||||
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(HdMapBuildConfig.currentCarVrIconRes)
|
||||
UiThreadHandler.postDelayed({ visibility = GONE },2_000,UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
|
||||
@@ -144,6 +144,7 @@ public class BusStationBean {
|
||||
return "BusStationBean{" +
|
||||
"siteId=" + siteId +
|
||||
", name='" + name + '\'' +
|
||||
", nameKr='" + nameKr + '\'' +
|
||||
", seq=" + seq +
|
||||
", gcjLon=" + gcjLon +
|
||||
", gcjLat=" + gcjLat +
|
||||
@@ -151,8 +152,8 @@ public class BusStationBean {
|
||||
", lat=" + lat +
|
||||
", drivingStatus=" + drivingStatus +
|
||||
", leaving=" + leaving +
|
||||
", introduction='" + introduction + '\'' +
|
||||
", isPlayTts=" + isPlayTts +
|
||||
'}';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,4 +11,9 @@ data class LineInfo(
|
||||
*/
|
||||
val lineName: String,
|
||||
|
||||
/**
|
||||
* 附加信息
|
||||
*/
|
||||
var multiMap: MutableMap<String,String>? = mutableMapOf()
|
||||
|
||||
)
|
||||
|
||||
@@ -58,13 +58,12 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
|
||||
|
||||
private fun showFragment() {
|
||||
val supportFragmentManager: FragmentManager? = activity?.supportFragmentManager
|
||||
injectStatusBar()
|
||||
val fragment = if (LoginStatusManager.isLogin()) {
|
||||
val fragment = getFragment()
|
||||
injectStatusBar()
|
||||
LoginStatusManager.resetFragment()
|
||||
fragment
|
||||
} else {
|
||||
removeStatusBar()
|
||||
CallerHmiManager.hideToolsView()
|
||||
ToggleDebugView.toggleDebugView.dismiss()
|
||||
SopView.sopView.dismiss()
|
||||
@@ -200,8 +199,8 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
|
||||
}
|
||||
|
||||
override fun onBusinessChangeDebug(businessEnum: BusinessEnum) {
|
||||
injectStatusBar()
|
||||
if (businessEnum == BusinessEnum.None) {
|
||||
removeStatusBar()
|
||||
CallerHmiManager.hideToolsView()
|
||||
ToggleDebugView.toggleDebugView.dismiss()
|
||||
SopView.sopView.dismiss()
|
||||
@@ -217,7 +216,6 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
|
||||
onBusinessChange(businessEnum)
|
||||
val supportFragmentManager: FragmentManager? = activity?.supportFragmentManager
|
||||
val fragment = getFragment()
|
||||
injectStatusBar()
|
||||
d(TAG, "切换 fragment:${fragment}")
|
||||
LoginStatusManager.resetFragment()
|
||||
if (supportFragmentManager != null) {
|
||||
@@ -237,6 +235,9 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
|
||||
contentView.fitsSystemWindows = false
|
||||
decorView.clipToPadding = false
|
||||
var statusBarView = decorView.findViewWithTag<View>("status_bar")
|
||||
if(statusBarView!=null){
|
||||
return
|
||||
}
|
||||
val statusBar = commonService?.getStatusBarView(it)
|
||||
statusBarView = statusBar ?: StatusBarView(it)
|
||||
statusBarView.tag = "status_bar"
|
||||
|
||||
@@ -561,7 +561,7 @@ public class OrderModel {
|
||||
|
||||
firstStartAutopilot++;
|
||||
|
||||
triggerStartServiceEvent(isRestart, false);
|
||||
triggerStartServiceEvent(isRestart, false,0);
|
||||
|
||||
AutopilotControlParameters parameters = initAutopilotControlParameters(leaveIndex);
|
||||
if (null == parameters) {
|
||||
@@ -994,14 +994,14 @@ public class OrderModel {
|
||||
LoginStatusManager.loginOut();
|
||||
}
|
||||
|
||||
public void triggerStartServiceEvent(boolean isRestart, boolean send) {
|
||||
public void triggerStartServiceEvent(boolean isRestart, boolean send,int source) {
|
||||
if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) {
|
||||
return;
|
||||
}
|
||||
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
|
||||
OchAutopilotAnalytics.INSTANCE.triggerStartAutopilotEvent(isRestart, send,
|
||||
currentStation.getName(), nextStation.getName(), busRoutesResult.getLineId(), "", System.currentTimeMillis());
|
||||
currentStation.getName(), nextStation.getName(), busRoutesResult.getLineId(), "", System.currentTimeMillis(),source);
|
||||
}
|
||||
|
||||
public void triggerUpdateStartAutoPilotSessionId(long sessionId) {
|
||||
|
||||
@@ -208,7 +208,7 @@ public class BusPresenter extends Presenter<ShuttleFragment>
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
|
||||
OrderModel.getInstance().triggerStartServiceEvent(
|
||||
OrderModel.getInstance().isRestartAutopilot(), true);
|
||||
OrderModel.getInstance().isRestartAutopilot(), true,0);
|
||||
// 改变UI自动驾驶状态
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
@@ -232,6 +232,14 @@ public class BusPresenter extends Presenter<ShuttleFragment>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponseFromCan(int state) {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
OrderModel.getInstance().triggerStartServiceEvent(
|
||||
OrderModel.getInstance().isRestartAutopilot(), true,1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
// if (null != location) {
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_40" />
|
||||
|
||||
<com.mogo.och.shuttle.passenger.manager.scnner.ScannerStateView
|
||||
<com.mogo.och.common.module.manager.scnner.ScannerStateView
|
||||
android:id="@+id/scannerStateView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_32" />
|
||||
|
||||
<com.mogo.och.shuttle.passenger.manager.scnner.ScannerStateView
|
||||
<com.mogo.och.common.module.manager.scnner.ScannerStateView
|
||||
android:id="@+id/scannerStateView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -4,6 +4,7 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.ArrayMap;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -652,7 +653,7 @@ public class OrderModel {
|
||||
|
||||
firstStartAutopilot++;
|
||||
|
||||
triggerStartServiceEvent(isRestart, false);
|
||||
triggerStartServiceEvent(isRestart, false,0);
|
||||
|
||||
AutopilotControlParameters parameters = initAutopilotControlParameters(leaveIndex);
|
||||
if (null == parameters) {
|
||||
@@ -870,7 +871,17 @@ public class OrderModel {
|
||||
return;
|
||||
}
|
||||
busRoutesResult = result;
|
||||
LineManager.setLineInfo(new LineInfo(busRoutesResult.getLineId(),busRoutesResult.getName()));
|
||||
ArrayMap<String, String> attach = new ArrayMap<>();
|
||||
try {
|
||||
String lineTime = DateTimeUtil.formatLongToString(
|
||||
busRoutesResult.getTaskTime(),
|
||||
DateTimeUtil.HH_mm);
|
||||
attach.put("taskInfo",lineTime);
|
||||
}catch (Exception e){
|
||||
OchChainLogManager.writeChainLog("设置任务名称","设置任务名称报错"+e.getStackTrace());
|
||||
}
|
||||
LineInfo lineInfo = new LineInfo(busRoutesResult.getLineId(), busRoutesResult.getName(),attach);
|
||||
LineManager.setLineInfo(lineInfo);
|
||||
stationList.clear();
|
||||
stationList.addAll(result.getSites());
|
||||
for (int i = 0; i < stationList.size(); i++) {
|
||||
@@ -1136,14 +1147,14 @@ public class OrderModel {
|
||||
LoginStatusManager.loginOut();
|
||||
}
|
||||
|
||||
public void triggerStartServiceEvent(boolean isRestart, boolean send) {
|
||||
public void triggerStartServiceEvent(boolean isRestart, boolean send,int source) {
|
||||
if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) {
|
||||
return;
|
||||
}
|
||||
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
|
||||
OchAutopilotAnalytics.INSTANCE.triggerStartAutopilotEvent(isRestart, send,
|
||||
currentStation.getName(), nextStation.getName(), busRoutesResult.getLineId(),"",System.currentTimeMillis());
|
||||
currentStation.getName(), nextStation.getName(), busRoutesResult.getLineId(),"",System.currentTimeMillis(),source);
|
||||
}
|
||||
|
||||
public void triggerUpdateStartAutoPilotSessionId(long sessionId) {
|
||||
|
||||
@@ -207,7 +207,7 @@ public class BusPresenter extends Presenter<ShuttleFragment>
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
|
||||
OrderModel.getInstance().triggerStartServiceEvent(
|
||||
OrderModel.getInstance().isRestartAutopilot(), true);
|
||||
OrderModel.getInstance().isRestartAutopilot(), true,0);
|
||||
// 改变UI自动驾驶状态
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
@@ -231,6 +231,14 @@ public class BusPresenter extends Presenter<ShuttleFragment>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponseFromCan(int state) {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
OrderModel.getInstance().triggerStartServiceEvent(
|
||||
OrderModel.getInstance().isRestartAutopilot(), true,1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
// if (null != location) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.data.bean.LineInfo
|
||||
import com.mogo.och.weaknet.database.bean.TaskSiteDataBean
|
||||
import com.mogo.och.weaknet.database.repository.TaskSiteRepository
|
||||
import com.mogo.och.weaknet.model.BusLineModel
|
||||
import java.lang.Boolean
|
||||
import kotlin.String
|
||||
|
||||
@@ -60,6 +61,7 @@ class BusRoutesResponse : BaseData() {
|
||||
if (lineInfo == null && taskAndsite.lineId != null && taskAndsite.lineName != null) {
|
||||
lineInfo = LineInfo(taskAndsite.lineId!!, taskAndsite.lineName!!)
|
||||
}
|
||||
lineInfo?.multiMap?.put("taskInfo",BusLineModel.getTaskTime())
|
||||
}
|
||||
LineManager.setLineInfo(lineInfo)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.och.weaknet.bean
|
||||
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.network.utils.digest.DigestUtils
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.weaknet.database.bean.EventDataBean
|
||||
|
||||
/**
|
||||
@@ -17,9 +18,15 @@ data class ShuttleEventRequest(val requestId: String, val sn: String, val busine
|
||||
val md5Hex = DigestUtils.md5Hex(waitUpdateEvent.toString())
|
||||
val eventList4Request = mutableListOf<Event>()
|
||||
var tempEvent:Event?=null
|
||||
var driverId = 0L
|
||||
LoginStatusManager.getLoginInfo()?.let {
|
||||
if(it.driverId>0){
|
||||
driverId = it.driverId
|
||||
}
|
||||
}
|
||||
waitUpdateEvent.forEach {
|
||||
tempEvent = Event(it.eventType,
|
||||
EventData(it.taskId,it.businessTime,it.writeVersion,it.siteId,it.seq)
|
||||
EventData(it.taskId,it.businessTime,it.writeVersion,it.siteId,it.seq,driverId)
|
||||
)
|
||||
eventList4Request.add(tempEvent!!)
|
||||
}
|
||||
@@ -35,5 +42,6 @@ data class EventData(
|
||||
var businessTime: Long?,
|
||||
var writeVersion: Long?,
|
||||
var siteId: Long?,
|
||||
var seq: Int?
|
||||
var seq: Int?,
|
||||
var driverId:Long?
|
||||
)
|
||||
@@ -81,10 +81,12 @@ object TaskRepository {
|
||||
it.status = TaskDataBean.useing
|
||||
// 更新任务状态
|
||||
taskDataDao?.insert(it)
|
||||
OchChainLogManager.writeChainLogDb("开始任务", "变更线路:${lineId}_${lineName}_task:${taskId} 为正在使用的状态")
|
||||
}
|
||||
CallerLogger.d(TAG,"更新任务状态用时:${System.currentTimeMillis()-startTime}")
|
||||
startTime = System.currentTimeMillis()
|
||||
updateCount = TaskSiteRepository.startTask(taskId, lineId, lineName)
|
||||
OchChainLogManager.writeChainLogDb("开始任务", "把正在使用的数据更新到RunningTask表格一共${updateCount}行数据")
|
||||
CallerLogger.d(TAG,"插入正在运行的线路用时:${System.currentTimeMillis()-startTime}")
|
||||
} catch (e: Exception) {
|
||||
if (e is DataException) {
|
||||
@@ -95,6 +97,7 @@ object TaskRepository {
|
||||
it.status = TaskDataBean.unUse
|
||||
// 更新任务状态
|
||||
taskDataDao?.insert(it)
|
||||
OchChainLogManager.writeChainLogDb("开始任务", "异常情况${lineId}_${lineName}_task:${taskId} 为未使用的状态 原因:${e.message}")
|
||||
}
|
||||
}
|
||||
updateCount = null
|
||||
|
||||
@@ -254,8 +254,6 @@ object BusLineModel {
|
||||
.putLong(BusSwitchLineActivity.LASTCOMMITLINEID, line.lineId)
|
||||
EventRepository.saveEventTaskStart(task.id,line.lineId,task.taskStartTime,line.name)
|
||||
mBusLinesCallback?.onChangeLineIdSuccess()
|
||||
val taskTime = DateTimeUtil.formatLongToString(task.taskStartTime, DateTimeUtil.HH_mm)
|
||||
CallerOrderListenerManager.invokeOrderLineUpdate("${line.name} ${taskTime}")
|
||||
}
|
||||
|
||||
override fun startFail(msg: String) {
|
||||
@@ -288,16 +286,17 @@ object BusLineModel {
|
||||
// 获取正在进行中的具体信息
|
||||
val runnintTaskAndSites = TaskSiteRepository.queryRunningTask(it)
|
||||
if(runnintTaskAndSites.isNullOrEmpty()||runnintTaskAndSites.size<2){
|
||||
// TODO: 错误数据需要上报一下 有进行中的任务 在正在跑的任务重没有数据
|
||||
OchChainLogManager.writeChainLogDb("加载任务", "异常情况:有任务:${runningTaskInfo} runningTask 表格没有对应的数据:${runnintTaskAndSites}")
|
||||
return
|
||||
}
|
||||
val db2Beans = BusRoutesResponse.db2Beans(runnintTaskAndSites)
|
||||
stationList = db2Beans.first
|
||||
startStationIndex = db2Beans.second
|
||||
stationList?.let {stationlist->
|
||||
LineManager.startStation = stationlist[startStationIndex]
|
||||
val startStation = stationlist[startStationIndex]
|
||||
if (startStationIndex < stationlist.size-1) {
|
||||
LineManager.endStation = stationlist[startStationIndex + 1]
|
||||
val endStation = stationlist[startStationIndex + 1]
|
||||
LineManager.setStartAndEndStation(startStation,endStation)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,6 +325,7 @@ object BusLineModel {
|
||||
}
|
||||
TaskRepository.addOrUpdate(*tempList.toTypedArray())
|
||||
OrderModel.queryBusRoutes()
|
||||
OchChainLogManager.writeChainLogDb("加载任务", "异常情况:多个正在进行的任务 task:${runningTaskInfo} event:${queryLastData.taskId}有一个和event表对应使用相同的一个 另一个置为已使用")
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -333,6 +333,7 @@ object BusLineModel {
|
||||
runningTaskInfo.forEach {
|
||||
it.status = TaskDataBean.used
|
||||
}
|
||||
OchChainLogManager.writeChainLogDb("加载任务", "异常情况:多个正在进行的任务 task:${runningTaskInfo} 全部置为已使用 从后台加载正在使用的任务")
|
||||
TaskRepository.addOrUpdate(*runningTaskInfo.toTypedArray())
|
||||
loadServerRuningTask()
|
||||
}
|
||||
@@ -347,7 +348,7 @@ object BusLineModel {
|
||||
if(queryTaskById==null||queryTaskById.status!=TaskDataBean.used) {
|
||||
OchChainLogManager.writeChainLogDb(
|
||||
"业务数据",
|
||||
"本地没有正在运行的数据,服务器端有"
|
||||
"本地没有正在运行的数据,服务器端有${it}"
|
||||
)
|
||||
LineRepository.saveRunningInfo(
|
||||
it.lineId,
|
||||
@@ -397,27 +398,26 @@ object BusLineModel {
|
||||
// 滑动出发
|
||||
fun leaveStation(){
|
||||
//开始站点: leaving false->true
|
||||
LineManager.startStation?.let { startStation ->
|
||||
startStation.drivingStatus = TaskSiteDataBean.drivingStatusCurrent
|
||||
startStation.isLeaving = true
|
||||
LineManager.getStartStation {
|
||||
it.drivingStatus = TaskSiteDataBean.drivingStatusCurrent
|
||||
it.isLeaving = true
|
||||
if (currentTask != null && currentTask!!.taskId != null) {
|
||||
currentTask?.let { task ->
|
||||
if (task.taskId!=null&&task.lineId!=null) {
|
||||
TaskSiteRepository.updateLeave(task.taskId!!, startStation.siteId.toLong(), true)
|
||||
TaskSiteRepository.updateLeave(task.taskId!!, it.siteId.toLong(), true)
|
||||
OchChainLogManager.writeChainLogDb("滑动出发", "task:${currentTask}__taskId:${currentTask?.taskId}")
|
||||
// 设置滑动出发任务
|
||||
LineManager.lineInfos?.lineName?.let { lineName->
|
||||
EventRepository.saveEventTaskLeaveSite(
|
||||
task.taskId!!,
|
||||
task.lineId!!,
|
||||
startStation.siteId.toLong(),
|
||||
startStation.seq,
|
||||
it.siteId.toLong(),
|
||||
it.seq,
|
||||
task.taskStartTime,
|
||||
lineName
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
OchChainLogManager.writeChainLog(
|
||||
@@ -432,41 +432,43 @@ object BusLineModel {
|
||||
}
|
||||
// 到站
|
||||
fun arrivedStation() {
|
||||
// 开始站点:leaving true->false drivingStatus 2->1
|
||||
LineManager.startStation?.let {
|
||||
it.drivingStatus = TaskSiteDataBean.drivingStatusPassed
|
||||
it.isLeaving = false
|
||||
LineManager.getStations { start, end ->
|
||||
// 开始站点:leaving true->false drivingStatus 2->1
|
||||
start.drivingStatus = TaskSiteDataBean.drivingStatusPassed
|
||||
start.isLeaving = false
|
||||
if(currentTask!=null&& currentTask!!.taskId!=null){
|
||||
currentTask?.let { task->
|
||||
if (task.taskId!=null&&task.lineId!=null) {
|
||||
TaskSiteRepository.updateDrivingStatusAndLeave(task.taskId!!,it.siteId.toLong(),TaskSiteDataBean.drivingStatusPassed,false)
|
||||
TaskSiteRepository.updateDrivingStatusAndLeave(task.taskId!!,start.siteId.toLong(),TaskSiteDataBean.drivingStatusPassed,false)
|
||||
// 设置到站任务
|
||||
LineManager.lineInfos?.let {lineInfo ->
|
||||
EventRepository.saveEventTaskArriveSite(task.taskId!!,task.lineId!!,it.siteId.toLong(),it.seq,task.taskStartTime,lineInfo.lineName)
|
||||
EventRepository.saveEventTaskArriveSite(task.taskId!!,task.lineId!!,start.siteId.toLong(),start.seq,task.taskStartTime,lineInfo.lineName)
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
OchChainLogManager.writeChainLog("到站_数据更新_error","task:${currentTask}__taskId:${currentTask?.taskId}")
|
||||
}
|
||||
}
|
||||
// 结束站点: drivingStatus 3-2
|
||||
LineManager.endStation?.let {
|
||||
it.drivingStatus = TaskSiteDataBean.drivingStatusCurrent
|
||||
// 结束站点: drivingStatus 3-2
|
||||
end.drivingStatus = TaskSiteDataBean.drivingStatusCurrent
|
||||
if(currentTask!=null&& currentTask!!.taskId!=null){
|
||||
currentTask?.taskId?.let { taskId->
|
||||
TaskSiteRepository.updateDrivingStatus(taskId,it.siteId.toLong(),TaskSiteDataBean.drivingStatusCurrent)
|
||||
TaskSiteRepository.updateDrivingStatus(taskId,end.siteId.toLong(),TaskSiteDataBean.drivingStatusCurrent)
|
||||
}
|
||||
}else{
|
||||
OchChainLogManager.writeChainLog("到站_数据更新_error","task:${currentTask}__taskId:${currentTask?.taskId}")
|
||||
}
|
||||
val changeInfo =
|
||||
"taskId:${currentTask?.taskId}--lineId:${currentTask?.lineId}--currentStationName:${start.name}--finalNextStationName:${end.name}"
|
||||
OchChainLogManager.writeChainLog("到站", changeInfo)
|
||||
}
|
||||
|
||||
stationList?.let {
|
||||
startStationIndex+=1
|
||||
LineManager.startStation = LineManager.endStation
|
||||
val startStation = LineManager.endStation
|
||||
if(startStationIndex+1< it.size){
|
||||
LineManager.endStation = it[startStationIndex+1]
|
||||
val endStation = it[startStationIndex+1]
|
||||
LineManager.setStartAndEndStation(startStation,endStation)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -488,7 +490,6 @@ object BusLineModel {
|
||||
}
|
||||
|
||||
fun endTask() {
|
||||
CallerOrderListenerManager.invokeOrderLineUpdate("")
|
||||
currentTask?.let {task->
|
||||
if (task.taskId!=null&&task.lineId!=null) {
|
||||
TaskRepository.endTask(task.taskId!!)
|
||||
@@ -497,11 +498,12 @@ object BusLineModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
val changeInfo = "taskId:${currentTask?.taskId}--lineInfo:${LineManager.lineInfos}"
|
||||
OchChainLogManager.writeChainLog("结束任务", changeInfo)
|
||||
|
||||
currentTask = null
|
||||
LineManager.lineInfos = null
|
||||
LineManager.startStation = null
|
||||
LineManager.endStation = null
|
||||
LineManager.setStartAndEndStation(null,null)
|
||||
stationList = mutableListOf()
|
||||
startStationIndex = 0
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.och.weaknet.model
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
|
||||
@@ -327,27 +327,18 @@ object OrderModel {
|
||||
*/
|
||||
private fun leaveStationSuccess() {
|
||||
onStartAutopilot()
|
||||
|
||||
if(LineManager.startStation!=null&&LineManager.endStation!=null&&LineManager.lineInfos!=null){
|
||||
LineManager.startStation?.let {startStation->
|
||||
LineManager.endStation?.let {endStation->
|
||||
leaveTTSTips(endStation.name, startStation.nameKr)
|
||||
|
||||
//给bus外屏发送
|
||||
LedScreenManager.sendTripInfo2Led(
|
||||
LedScreenManager.LEAVE_STATION,
|
||||
LineManager.lineInfos!!.lineName,
|
||||
startStation.name,
|
||||
endStation.name,
|
||||
BusLineModel.isLastStation()==true
|
||||
)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
ToastUtils.showShort("未设置起始或终点站点")
|
||||
LineManager.getStations { start, end ->
|
||||
leaveTTSTips(end.name, end.nameKr)
|
||||
//给bus外屏发送
|
||||
LedScreenManager.sendTripInfo2Led(
|
||||
LedScreenManager.LEAVE_STATION,
|
||||
LineManager.lineInfos!!.lineName,
|
||||
start.name,
|
||||
end.name,
|
||||
BusLineModel.isLastStation()==true
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
BusLineModel.leaveStation()
|
||||
|
||||
updateBusStatus()
|
||||
@@ -423,7 +414,7 @@ object OrderModel {
|
||||
|
||||
firstStartAutopilot++
|
||||
|
||||
triggerStartServiceEvent(isRestart, false)
|
||||
triggerStartServiceEvent(isRestart, false,0)
|
||||
|
||||
val parameters = initAutopilotControlParameters()
|
||||
if (null == parameters) {
|
||||
@@ -461,22 +452,16 @@ object OrderModel {
|
||||
}
|
||||
|
||||
private fun arriveStationSuccess() {
|
||||
if(LineManager.startStation!=null&&LineManager.endStation!=null&&LineManager.lineInfos!=null){
|
||||
LineManager.startStation?.let {startStation->
|
||||
LineManager.endStation?.let {endStation->
|
||||
ShuttleVoiceManager.arrivedStationBus(endStation.name, endStation.nameKr)
|
||||
//给bus外屏发送
|
||||
LedScreenManager.sendTripInfo2Led(
|
||||
LedScreenManager.ARRIVE_STATION,
|
||||
LineManager.lineInfos!!.lineName,
|
||||
startStation.name,
|
||||
endStation.name,
|
||||
BusLineModel.isLastStation()==true
|
||||
)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
ToastUtils.showShort("未设置起始或终点站点")
|
||||
LineManager.getStations { start, end ->
|
||||
ShuttleVoiceManager.arrivedStationBus(end.name, end.nameKr)
|
||||
//给bus外屏发送
|
||||
LedScreenManager.sendTripInfo2Led(
|
||||
LedScreenManager.ARRIVE_STATION,
|
||||
LineManager.lineInfos!!.lineName,
|
||||
start.name,
|
||||
end.name,
|
||||
BusLineModel.isLastStation()==true
|
||||
)
|
||||
}
|
||||
BusLineModel.arrivedStation()
|
||||
updateBusStatus()
|
||||
@@ -560,8 +545,8 @@ object OrderModel {
|
||||
|
||||
BusLineModel.setDemoMode()
|
||||
|
||||
LineManager.startStation?.let {startStation ->
|
||||
if (startStation.isLeaving) {
|
||||
LineManager.getStartStation {
|
||||
if (it.isLeaving) {
|
||||
mADASStatusCallback?.hideSlidePanel()
|
||||
isGoingToNextStation = true
|
||||
}else{
|
||||
@@ -703,21 +688,19 @@ object OrderModel {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun triggerStartServiceEvent(isRestart: Boolean, send: Boolean) {
|
||||
LineManager.startStation?.let {startStation->
|
||||
LineManager.endStation?.let {endStation->
|
||||
OchAutopilotAnalytics.triggerStartAutopilotEvent(
|
||||
isRestart,
|
||||
send,
|
||||
startStation.name,
|
||||
endStation.name,
|
||||
LineManager.lineInfos!!.lineId.toInt(),
|
||||
"",
|
||||
System.currentTimeMillis()
|
||||
)
|
||||
}
|
||||
fun triggerStartServiceEvent(isRestart: Boolean, send: Boolean,source:Int) {
|
||||
LineManager.getStations { start, end ->
|
||||
OchAutopilotAnalytics.triggerStartAutopilotEvent(
|
||||
isRestart,
|
||||
send,
|
||||
start.name,
|
||||
end.name,
|
||||
LineManager.lineInfos!!.lineId.toInt(),
|
||||
"",
|
||||
System.currentTimeMillis(),
|
||||
source
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun triggerUpdateStartAutoPilotSessionId(sessionId: Long) {
|
||||
@@ -725,15 +708,11 @@ object OrderModel {
|
||||
}
|
||||
|
||||
fun triggerUnableStartAPReasonEvent() {
|
||||
LineManager.startStation?.let {startStation->
|
||||
LineManager.endStation?.let {endStation->
|
||||
if(LineManager.lineInfos!=null){
|
||||
OchAutopilotAnalytics.triggerUnableStartAPReasonEvent(
|
||||
startStation.name, endStation.name,LineManager.lineInfos!!.lineId.toString() , "",
|
||||
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason
|
||||
)
|
||||
}
|
||||
}
|
||||
LineManager.getStationsWithLine { start, end, line ->
|
||||
OchAutopilotAnalytics.triggerUnableStartAPReasonEvent(
|
||||
start.name, end.name,line.lineId.toString() , "",
|
||||
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -756,40 +735,36 @@ object OrderModel {
|
||||
}
|
||||
|
||||
private fun initAutopilotControlParameters(): AutopilotControlParameters? {
|
||||
if(LineManager.startStation!=null&&LineManager.endStation!=null&&LineManager.lineInfos!=null&&LineManager.contraiInfo!=null){
|
||||
LineManager.startStation?.let {startStation->
|
||||
LineManager.endStation?.let {endStation->
|
||||
val parameters = AutopilotControlParameters()
|
||||
parameters.routeID = LineManager.lineInfos!!.lineId.toInt()
|
||||
parameters.routeName = LineManager.lineInfos!!.lineName
|
||||
parameters.startName = startStation.name
|
||||
parameters.endName = endStation.name
|
||||
parameters.startLatLon = AutoPilotLonLat(startStation.lat, startStation.lon)
|
||||
parameters.endLatLon = AutoPilotLonLat(endStation.lat, endStation.lon)
|
||||
parameters.vehicleType = VEHICLE_TYPE
|
||||
var parameters:AutopilotControlParameters? = null
|
||||
LineManager.getStationsWithLineAndContrai { start, end, lineInfo, contrai ->
|
||||
parameters = AutopilotControlParameters()
|
||||
parameters?.routeID = lineInfo.lineId.toInt()
|
||||
parameters?.routeName = lineInfo.lineName
|
||||
parameters?.startName = start.name
|
||||
parameters?.endName = end.name
|
||||
parameters?.startLatLon = AutoPilotLonLat(start.lat, start.lon)
|
||||
parameters?.endLatLon = AutoPilotLonLat(end.lat, end.lon)
|
||||
parameters?.vehicleType = VEHICLE_TYPE
|
||||
|
||||
if (parameters.autoPilotLine == null) {
|
||||
parameters.autoPilotLine = AutoPilotLine(
|
||||
LineManager.lineInfos!!.lineId,
|
||||
LineManager.lineInfos!!.lineName,
|
||||
LineManager.contraiInfo!!.csvFileUrl,
|
||||
LineManager.contraiInfo!!.csvFileMd5,
|
||||
LineManager.contraiInfo!!.txtFileUrl,
|
||||
LineManager.contraiInfo!!.txtFileMd5,
|
||||
LineManager.contraiInfo!!.contrailSaveTime,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0L
|
||||
)
|
||||
}
|
||||
|
||||
return parameters
|
||||
}
|
||||
if (parameters?.autoPilotLine == null) {
|
||||
parameters?.autoPilotLine = AutoPilotLine(
|
||||
lineInfo.lineId,
|
||||
lineInfo.lineName,
|
||||
contrai.csvFileUrl,
|
||||
contrai.csvFileMd5,
|
||||
contrai.txtFileUrl,
|
||||
contrai.txtFileMd5,
|
||||
contrai.contrailSaveTime,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0L
|
||||
)
|
||||
}
|
||||
}else{
|
||||
}
|
||||
if(parameters==null){
|
||||
ToastUtils.showShort("未设置起始或终点站点")
|
||||
}
|
||||
return null
|
||||
@@ -800,21 +775,15 @@ object OrderModel {
|
||||
TrajectoryAndDistanceManager.setStationPoint(null, null, null)
|
||||
return
|
||||
}
|
||||
if(LineManager.startStation!=null&&LineManager.endStation!=null&&LineManager.lineInfos!=null){
|
||||
LineManager.startStation?.let {startStation->
|
||||
LineManager.endStation?.let {endStation->
|
||||
val startStationLocation = MogoLocation()
|
||||
startStationLocation.latitude = startStation.gcjLat
|
||||
startStationLocation.longitude = startStation.gcjLon
|
||||
LineManager.getStationsWithLine { start, end, lineInfo ->
|
||||
val startStationLocation = MogoLocation()
|
||||
startStationLocation.latitude = start.gcjLat
|
||||
startStationLocation.longitude = start.gcjLon
|
||||
|
||||
val endStationLocation = MogoLocation()
|
||||
endStationLocation.latitude = endStation.gcjLat
|
||||
endStationLocation.longitude = endStation.gcjLon
|
||||
TrajectoryAndDistanceManager.setStationPoint(startStationLocation, endStationLocation, LineManager.lineInfos!!.lineId)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
ToastUtils.showShort("未设置起始或终点站点")
|
||||
val endStationLocation = MogoLocation()
|
||||
endStationLocation.latitude = end.gcjLat
|
||||
endStationLocation.longitude = end.gcjLon
|
||||
TrajectoryAndDistanceManager.setStationPoint(startStationLocation, endStationLocation, lineInfo.lineId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
}
|
||||
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
OrderModel.triggerStartServiceEvent(OrderModel.isRestartAutopilot, true)
|
||||
OrderModel.triggerStartServiceEvent(OrderModel.isRestartAutopilot, true,0)
|
||||
// 改变UI自动驾驶状态
|
||||
UiThreadHandler.post({
|
||||
if (mView != null) {
|
||||
@@ -172,6 +172,14 @@ class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponseFromCan(state: Int) {
|
||||
when (state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
OrderModel.triggerStartServiceEvent(OrderModel.isRestartAutopilot, true,1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun startOpenAutopilot() {
|
||||
//非美化模式下启动动画
|
||||
UiThreadHandler.post({
|
||||
|
||||
@@ -127,7 +127,7 @@ object RunningTaskManager : LifecycleEventObserver{
|
||||
}
|
||||
|
||||
override fun show() {
|
||||
pop.showAtLocation(activity.window.decorView, gravity, startX, if (isImmersiveMode) 0 else BarUtils.getStatusBarHeight() + startY)
|
||||
pop.showAtLocation(activity.window.decorView, gravity, startX, startY)
|
||||
}
|
||||
override fun isOverride(): Boolean = isOverride
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ class RunningTaskManagerView: WindowRelativeLayout, RunningTastViewModel.Running
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
background = ColorDrawable(Color.parseColor("#F0151D41"))
|
||||
clLayout.setOnClickListener {
|
||||
}
|
||||
//关闭BadCase管理窗口
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
android:layout_width="960dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#F0151D41"
|
||||
android:paddingBottom="@dimen/dp_72"
|
||||
android:layout_marginTop="@dimen/dp_72"
|
||||
android:id="@+id/clLayout"
|
||||
>
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_40" />
|
||||
|
||||
<com.mogo.och.shuttle.passenger.manager.scnner.ScannerStateView
|
||||
<com.mogo.och.common.module.manager.scnner.ScannerStateView
|
||||
android:id="@+id/scannerStateView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -983,7 +983,7 @@ public class TaxiModel {
|
||||
OchAutopilotAnalytics.INSTANCE.triggerStartAutopilotEvent(isRestartAutopilot, false,
|
||||
mCurrentOCHOrder.startSiteAddr, mCurrentOCHOrder.endSiteAddr,
|
||||
(int) mCurrentOCHOrder.lineId,
|
||||
mCurrentOCHOrder.orderNo,System.currentTimeMillis());
|
||||
mCurrentOCHOrder.orderNo,System.currentTimeMillis(),0);
|
||||
OchAutopilotAnalytics.INSTANCE.triggerUpdateStartAutoPilotSessionId(sessionId);
|
||||
|
||||
if (mControllerStatusCallback != null) {
|
||||
@@ -1208,6 +1208,15 @@ public class TaxiModel {
|
||||
TaxiTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo,lineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponseFromCan(int state) {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
OchAutopilotAnalytics.INSTANCE.triggerStartAutopilotEvent(isRestartAutopilot, true,
|
||||
mCurrentOCHOrder.startSiteAddr, mCurrentOCHOrder.endSiteAddr,
|
||||
(int) mCurrentOCHOrder.lineId, mCurrentOCHOrder.orderNo,System.currentTimeMillis(),1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(int state) {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
@@ -1218,7 +1227,7 @@ public class TaxiModel {
|
||||
&& TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == mCurrentOCHOrder.orderStatus) {
|
||||
OchAutopilotAnalytics.INSTANCE.triggerStartAutopilotEvent(isRestartAutopilot, true,
|
||||
mCurrentOCHOrder.startSiteAddr, mCurrentOCHOrder.endSiteAddr,
|
||||
(int) mCurrentOCHOrder.lineId, mCurrentOCHOrder.orderNo,System.currentTimeMillis());
|
||||
(int) mCurrentOCHOrder.lineId, mCurrentOCHOrder.orderNo,System.currentTimeMillis(),0);
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
|
||||
|
||||
@@ -4,6 +4,7 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAX
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.util.ArrayMap;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
@@ -290,7 +291,7 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
OchChainLogManager.writeChainLog("订单信息变化",order.toString());
|
||||
OrderModel.INSTANCE.invokeListener(order);
|
||||
CallerLogger.d(M_TAXI + TAG, "order = " + order.toString());
|
||||
LineManager.setLineInfo(new LineInfo(order.lineId,order.lineName));
|
||||
LineManager.setLineInfo(new LineInfo(order.lineId,order.lineName,new ArrayMap<>()));
|
||||
if (TaxiOrderStatusEnum.UserArriveAtStart.getCode() == order.orderStatus) {
|
||||
TaxiModel.getInstance().queryAutopilotStatus(true);
|
||||
TaxiModel.getInstance().setStation();
|
||||
|
||||
@@ -133,7 +133,7 @@ object AutopilotManager : IOchAutopilotStatusListener {
|
||||
TaxiPassengerModel.currentOCHOrder!!.endSiteAddr,
|
||||
TaxiPassengerModel.currentOCHOrder!!.lineId.toInt(),
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderNo,
|
||||
System.currentTimeMillis()
|
||||
System.currentTimeMillis(),0
|
||||
)
|
||||
OchAutopilotAnalytics.triggerUpdateStartAutoPilotSessionId(sessionId)
|
||||
return ""
|
||||
@@ -220,7 +220,7 @@ object AutopilotManager : IOchAutopilotStatusListener {
|
||||
TaxiPassengerModel.currentOCHOrder!!.endSiteAddr,
|
||||
TaxiPassengerModel.currentOCHOrder!!.lineId.toInt(),
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderNo,
|
||||
System.currentTimeMillis()
|
||||
System.currentTimeMillis(),0
|
||||
)
|
||||
//startServicePilotDone()
|
||||
}
|
||||
@@ -229,6 +229,26 @@ object AutopilotManager : IOchAutopilotStatusListener {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponseFromCan(state: Int) {
|
||||
super.onAutopilotStatusResponseFromCan(state)
|
||||
when (state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
if (TaxiPassengerModel.currentOCHOrder != null && TaxiPassengerModel.curOrderStatus === TaxiOrderStatusEnum.UserArriveAtStart) {
|
||||
OchAutopilotAnalytics.triggerStartAutopilotEvent(
|
||||
false,
|
||||
true,
|
||||
TaxiPassengerModel.currentOCHOrder!!.startSiteAddr,
|
||||
TaxiPassengerModel.currentOCHOrder!!.endSiteAddr,
|
||||
TaxiPassengerModel.currentOCHOrder!!.lineId.toInt(),
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderNo,
|
||||
System.currentTimeMillis(),1
|
||||
)
|
||||
//startServicePilotDone()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 乘客屏启动自动驾驶成功
|
||||
*/
|
||||
|
||||
@@ -300,6 +300,23 @@ object TaxiTaskModel {
|
||||
TaxiTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo,lineId)
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponseFromCan(state: Int) {
|
||||
super.onAutopilotStatusResponseFromCan(state)
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
if ((QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder))) {
|
||||
OchAutopilotAnalytics.triggerStartAutopilotEvent(
|
||||
isRestartAutopilot,
|
||||
true,
|
||||
mCurrentTaskWithOrder!!.order!!.orderStartSite!!.siteName,
|
||||
mCurrentTaskWithOrder!!.order!!.orderEndSite!!.siteName,
|
||||
mCurrentTaskWithOrder!!.lineId.toInt(),
|
||||
mCurrentTaskWithOrder!!.order!!.orderNo,
|
||||
System.currentTimeMillis(),1
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
i(TAG, "onAutopilotStatusResponse autopilotsState= $state")
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
@@ -313,7 +330,7 @@ object TaxiTaskModel {
|
||||
mCurrentTaskWithOrder!!.order!!.orderEndSite!!.siteName,
|
||||
mCurrentTaskWithOrder!!.lineId.toInt(),
|
||||
mCurrentTaskWithOrder!!.order!!.orderNo,
|
||||
System.currentTimeMillis()
|
||||
System.currentTimeMillis(),0
|
||||
)
|
||||
setBeautificationMode(true)
|
||||
}
|
||||
@@ -1342,7 +1359,7 @@ object TaxiTaskModel {
|
||||
mCurrentTaskWithOrder!!.endSite!!.siteName,
|
||||
mCurrentTaskWithOrder!!.lineId.toInt(),
|
||||
if (mCurrentTaskWithOrder!!.order != null) mCurrentTaskWithOrder!!.order!!.orderNo else "",
|
||||
System.currentTimeMillis()
|
||||
System.currentTimeMillis(),0
|
||||
)
|
||||
OchAutopilotAnalytics.triggerUpdateStartAutoPilotSessionId(sessionId)
|
||||
mControllerStatusCallback?.startOpenAutopilot()
|
||||
|
||||
@@ -123,7 +123,8 @@ object AutopilotManager : IOchAutopilotStatusListener {
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderEndSite.siteName,
|
||||
lineId.toInt(),
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderNo,
|
||||
System.currentTimeMillis()
|
||||
System.currentTimeMillis(),
|
||||
0
|
||||
)
|
||||
OchAutopilotAnalytics.triggerUpdateStartAutoPilotSessionId(sessionId)
|
||||
needSpeakByStartAutopilot = true
|
||||
@@ -203,6 +204,26 @@ object AutopilotManager : IOchAutopilotStatusListener {
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(null)
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponseFromCan(state: Int) {
|
||||
super.onAutopilotStatusResponseFromCan(state)
|
||||
when (state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
if (TaxiPassengerModel.currentOCHOrder != null && TaxiPassengerModel.curOrderStatus === TaxiOrderStatusEnum.UserArriveAtStart) {
|
||||
OchAutopilotAnalytics.triggerStartAutopilotEvent(
|
||||
false,
|
||||
true,
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderStartSite.siteName,
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderEndSite.siteName,
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderNo.toInt(),
|
||||
TaxiPassengerModel.currentLineId.toString(),
|
||||
System.currentTimeMillis(),
|
||||
1
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
// 启动自驾成功
|
||||
when (state) {
|
||||
@@ -215,7 +236,8 @@ object AutopilotManager : IOchAutopilotStatusListener {
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderEndSite.siteName,
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderNo.toInt(),
|
||||
TaxiPassengerModel.currentLineId.toString(),
|
||||
System.currentTimeMillis()
|
||||
System.currentTimeMillis(),
|
||||
0
|
||||
)
|
||||
if(needSpeakByStartAutopilot) {
|
||||
VoiceNotice.showNotice("坐稳扶好,我们出发咯!", AIAssist.LEVEL2)
|
||||
|
||||
@@ -9,8 +9,8 @@ android {
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
multiDexEnabled true
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
versionCode 2
|
||||
versionName "2.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
|
||||
@@ -20,10 +20,34 @@ android {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
signingConfigs {
|
||||
release {
|
||||
keyAlias = 'CarLauncher'
|
||||
storeFile file('../keystore/car_launcher.jks')
|
||||
storePassword 'ZDauto123456'
|
||||
keyPassword 'ZDauto123456'
|
||||
}
|
||||
releaseEB5 {
|
||||
keyAlias = 'android_platform'
|
||||
storeFile file('../keystore/EB5/car_launcher.jks')
|
||||
storePassword 'ZDauto123456'
|
||||
keyPassword 'ZDauto123456'
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
debug {
|
||||
debuggable true
|
||||
minifyEnabled false
|
||||
zipAlignEnabled false
|
||||
shrinkResources false
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
release {
|
||||
debuggable false
|
||||
minifyEnabled false
|
||||
zipAlignEnabled false
|
||||
shrinkResources false
|
||||
signingConfig signingConfigs.release
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,13 @@ package com.zhidao.adas.magic;
|
||||
import android.app.Application;
|
||||
|
||||
import com.zhidao.adas.magic.utils.CrashHandler;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
|
||||
public class App extends Application {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
CrashHandler.getInstance().init(this);
|
||||
AdasManager.getInstance().init(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,18 +48,21 @@ import com.zhidao.support.adas.high.AdasOptions;
|
||||
import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.bean.VersionCompatibility;
|
||||
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus;
|
||||
import com.zhjt.mogo.adas.data.AdasConstants;
|
||||
import com.zhjt.mogo.adas.data.AiCloudTask;
|
||||
import com.zhjt.mogo.adas.data.bean.AdasParam;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableAutopilotReason;
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask;
|
||||
import com.zhjt.mogo.adas.data.bean.LaunchConditionData;
|
||||
import com.zhjt.mogo.adas.data.bean.ReceivedAck;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason;
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.big.SweeperBigTaskStatus;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.cloud.s_r.SweeperTaskCloudSuspendResume;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop;
|
||||
|
||||
@@ -77,17 +80,24 @@ import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import chassis.VehicleStateOuterClass;
|
||||
import fault_management.FmInfo;
|
||||
import fsm.Fsm2024;
|
||||
import function_state_management.FunctionStates;
|
||||
import localization.LocState;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo.v2x.MogoV2X;
|
||||
import mogo.v2x.RoadOverviewEvents;
|
||||
import mogo.yycp.paralleldriving.protocol.ParallelTaskProcessNoticeOuterClass;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import perception.TrafficLightOuterClass;
|
||||
import perception.FusionTrafficLightOuterClass;
|
||||
import perception.LaneMarkOuterClass;
|
||||
import planning.RoboSweeperTaskIndexOuterClass;
|
||||
import prediction.Prediction;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
import system_master.SsmInfo;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
public class MainActivity extends BaseActivity implements OnAdasListener, OnAdasConnectStatusListener, BaseAdapter.OnItemClickListener<TitleBean> {
|
||||
@@ -106,8 +116,8 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
private RadioGroup connectionType;
|
||||
private AppCompatButton connect;
|
||||
private AppCompatButton disconnect;
|
||||
private RadioButton fixation;
|
||||
private RadioButton assign;
|
||||
private RadioButton specified;
|
||||
private RadioButton ping;
|
||||
private RecyclerView infoBtn;
|
||||
private TextView tvConnectState;
|
||||
private TextView gnss_hint;
|
||||
@@ -116,7 +126,8 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
private Timer timerAcc;
|
||||
private final List<TitleBean> titleBtnData = new ArrayList<>();
|
||||
private final List<IPCConnectState> connectStatusList = new ArrayList<>();
|
||||
private int connectStatus;
|
||||
private AdasConstants.IpcConnectionStatus connectStatus;
|
||||
private String certificationResult = "未开启认证";
|
||||
private ListPopupWindow listPopupWindow;
|
||||
private FloatWindow floatWindow;
|
||||
private View include_title;
|
||||
@@ -130,7 +141,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
initView();
|
||||
initAdas();
|
||||
connectStatus = AdasManager.getInstance().getIpcConnectionStatus();
|
||||
onUpdateConnectStateView();
|
||||
onUpdateConnectStateView("未连接");
|
||||
showIPCIP();
|
||||
AdasManager.getInstance().setEnableLog(false);
|
||||
vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
||||
@@ -168,21 +179,29 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
|
||||
|
||||
private void connect(boolean isConnect) {
|
||||
AdasOptions options = AdasManager.getInstance().getAdasOptions();
|
||||
AdasOptions.Builder builder;
|
||||
if (options == null) {
|
||||
builder = AdasOptions.newBuilder().setPassenger(false);
|
||||
} else {
|
||||
builder = options.toBuilder();
|
||||
}
|
||||
if (isConnect) {
|
||||
switch (Constants.getIpcConnectionMode(this)) {
|
||||
case AdasOptions.IPC_CONNECTION_MODE.FIXATION:
|
||||
AdasManager.getInstance().getAdasOptions().setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(this));
|
||||
case AdasOptions.IPC_CONNECTION_MODE.PING:
|
||||
builder.setPingAddressList(AdasManager.getInstance().getPingAddressList());
|
||||
break;
|
||||
case AdasOptions.IPC_CONNECTION_MODE.ASSIGN:
|
||||
case AdasOptions.IPC_CONNECTION_MODE.SPECIFIED:
|
||||
String ip = etIp.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(ip)) {
|
||||
Toast.makeText(this, "请输入指定IP", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
AdasManager.getInstance().getAdasOptions().setIpcAssignIP(ip);
|
||||
builder.setSpecifiedAddress(ip);
|
||||
break;
|
||||
}
|
||||
AdasManager.getInstance().getAdasOptions().setIpcConnectionMode(Constants.getIpcConnectionMode(this));
|
||||
builder.setConnectionMode(Constants.getIpcConnectionMode(this));
|
||||
AdasManager.getInstance().setAdasOptions(builder.build());
|
||||
AdasManager.getInstance().connect();
|
||||
} else
|
||||
AdasManager.getInstance().disconnect();
|
||||
@@ -197,8 +216,8 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
tvIp = findViewById(R.id.tv_ip);
|
||||
connect = findViewById(R.id.connect);
|
||||
disconnect = findViewById(R.id.disconnect);
|
||||
fixation = findViewById(R.id.fixation);
|
||||
assign = findViewById(R.id.assign);
|
||||
specified = findViewById(R.id.specified);
|
||||
ping = findViewById(R.id.ping);
|
||||
|
||||
title = findViewById(R.id.title);
|
||||
infoBtn = findViewById(R.id.info_btn);
|
||||
@@ -221,11 +240,11 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
initListData();
|
||||
initBtnRecyclerView();
|
||||
switch (Constants.getIpcConnectionMode(this)) {
|
||||
case 0:
|
||||
fixation.setChecked(true);
|
||||
break;
|
||||
case 1:
|
||||
assign.setChecked(true);
|
||||
specified.setChecked(true);
|
||||
break;
|
||||
case 0:
|
||||
ping.setChecked(true);
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -241,14 +260,10 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||
AdasManager.getInstance().disconnect();
|
||||
int type;
|
||||
switch (checkedId) {
|
||||
default:
|
||||
case R.id.assign:
|
||||
type = AdasOptions.IPC_CONNECTION_MODE.ASSIGN;
|
||||
break;
|
||||
case R.id.fixation:
|
||||
type = AdasOptions.IPC_CONNECTION_MODE.FIXATION;
|
||||
break;
|
||||
if (checkedId == R.id.specified) {
|
||||
type = AdasOptions.IPC_CONNECTION_MODE.SPECIFIED;
|
||||
} else {
|
||||
type = AdasOptions.IPC_CONNECTION_MODE.PING;
|
||||
}
|
||||
Constants.setIpcConnectionMode(MainActivity.this, type);
|
||||
}
|
||||
@@ -407,56 +422,6 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
|
||||
}
|
||||
|
||||
private int getStatusColor(int connectStatus) {
|
||||
int color;
|
||||
switch (connectStatus) {
|
||||
case IPC_CONNECTION_STATUS.CONNECTED:
|
||||
color = R.color.connect_status_connected;
|
||||
break;
|
||||
default:
|
||||
case IPC_CONNECTION_STATUS.DISCONNECTED:
|
||||
color = R.color.connect_status_disconnected;
|
||||
break;
|
||||
case IPC_CONNECTION_STATUS.CONNECTING:
|
||||
color = R.color.connect_status_connecting;
|
||||
break;
|
||||
case IPC_CONNECTION_STATUS.SEARCH_ADDRESS:
|
||||
color = R.color.connect_status_search_address;
|
||||
break;
|
||||
case IPC_CONNECTION_STATUS.NOT_FOUND_ADDRESS:
|
||||
color = R.color.connect_status_disconnecting;
|
||||
break;
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
private String onUpdateConnectStateView() {
|
||||
String status;
|
||||
switch (connectStatus) {
|
||||
case IPC_CONNECTION_STATUS.CONNECTED:
|
||||
status = "已连接";
|
||||
break;
|
||||
default:
|
||||
case IPC_CONNECTION_STATUS.DISCONNECTED:
|
||||
status = "未连接";
|
||||
break;
|
||||
case IPC_CONNECTION_STATUS.CONNECTING:
|
||||
status = "连接中";
|
||||
break;
|
||||
case IPC_CONNECTION_STATUS.SEARCH_ADDRESS:
|
||||
status = "搜索IP";
|
||||
break;
|
||||
case IPC_CONNECTION_STATUS.NOT_FOUND_ADDRESS:
|
||||
status = "未找到";
|
||||
break;
|
||||
}
|
||||
Message msg = Message.obtain();
|
||||
msg.obj = new IPCConnectState(status, getStatusColor(connectStatus));
|
||||
msg.what = WHAT_IPC_CONNECT_STATE;
|
||||
getHandler().sendMessage(msg);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onError(ProtocolStatus status, byte[] bytes) {
|
||||
@@ -491,6 +456,11 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLightSwitch(@NonNull Chassis.LightSwitch light) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotState(MessagePad.Header header, MessagePad.AutopilotState autopilotState) {
|
||||
}
|
||||
@@ -500,7 +470,8 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPerceptionTrafficLight(MessagePad.Header header, TrafficLightOuterClass.TrafficLights trafficLights) {
|
||||
public void onPerceptionTrafficLight(MessagePad.Header header, FusionTrafficLightOuterClass.FusionTrafficLights trafficLights) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -546,6 +517,26 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
public void onStatusQueryResp(MessagePad.Header header, SystemStatusInfo.StatusInfo statusInfo) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSystemStatus(MessagePad.Header header, SsmInfo.SsmStatusInf statusInf) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFaultManagementState(MessagePad.Header header, @NonNull FmInfo.FaultResultMsg fmInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFSM2024State(@NonNull MessagePad.Header header, @NonNull Fsm2024.FSMStateMsg fsmState) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocalizationState(MessagePad.Header header, @NonNull LocState.loc_state locState) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecordDataConfigResp(MessagePad.Header header, MessagePad.RecordDataConfig config) {
|
||||
|
||||
@@ -593,45 +584,57 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCloudTask(@NonNull MessagePad.Header header, @NonNull SweeperCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperTask.TaskInfo taskInfo) {
|
||||
public void onSweeperFutianCloudTask(@NonNull MessagePad.Header header, @NonNull AiCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperTask.TaskInfo taskInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCloudTaskConfirm(@NonNull MessagePad.Header header, @NonNull SweeperCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperTaskConfirm.TaskConfirm taskConfirm) {
|
||||
public void onSweeperFutianCloudTaskConfirm(@NonNull MessagePad.Header header, @NonNull AiCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperTaskConfirm.TaskConfirm taskConfirm) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCloudTaskStatus(@NonNull MessagePad.Header header, @NonNull SweeperCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperTaskStatus.TaskStatusPush taskStatusPush) {
|
||||
public void onSweeperFutianCloudTaskStatus(@NonNull MessagePad.Header header, @NonNull AiCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperTaskStatus.TaskStatusPush taskStatusPush) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCloudTaskStop(@NonNull MessagePad.Header header, @NonNull SweeperCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperTaskStop.StopTaskReq stopTaskReq) {
|
||||
public void onSweeperFutianCloudTaskStop(@NonNull MessagePad.Header header, @NonNull AiCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperTaskStop.StopTaskReq stopTaskReq) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCloudTaskSuspendResume(@NonNull MessagePad.Header header, @NonNull SweeperCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperTaskSuspendResume.SuspendResumeTaskResp suspendResumeTaskResp) {
|
||||
public void onSweeperFutianCloudTaskSuspendResume(@NonNull MessagePad.Header header, @NonNull AiCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperTaskSuspendResume.SuspendResumeTaskResp suspendResumeTaskResp) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCloudBootable(@NonNull MessagePad.Header header, @NonNull SweeperCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperBootable.IsBootableResp isBootableResp) {
|
||||
public void onSweeperFutianCloudBootable(@NonNull MessagePad.Header header, @NonNull AiCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperBootable.IsBootableResp isBootableResp) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCloudBigTaskStatus(@NonNull MessagePad.Header header, @NonNull SweeperCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperBigTaskStatus.BigTaskStatusPush bigTaskStatusPush) {
|
||||
public void onSweeperFutianCloudBigTaskStatus(@NonNull MessagePad.Header header, @NonNull AiCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperBigTaskStatus.BigTaskStatusPush bigTaskStatusPush) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCloudTaskCloudSuspendResume(@NonNull MessagePad.Header header, @NonNull AiCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable SweeperTaskCloudSuspendResume.BigTaskActionPush bigTaskActionPush) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCloudTaskUnknown(@NonNull MessagePad.Header header, @NonNull byte[] bytes) {
|
||||
public void onParallelDrivingResp(@NonNull MessagePad.Header header, @NonNull AiCloudTask.MessageType messageType, @Nullable String reqNo, long sysTime, @Nullable ParallelTaskProcessNoticeOuterClass.ParallelTaskProcessNotice parallelTaskProcessNotice) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAiCloudTaskUnknown(@NonNull MessagePad.Header header, @NonNull byte[] bytes) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBagManagerCmd(MessagePad.Header header, BagManagerOuterClass.BagManager bagManager) {
|
||||
|
||||
@@ -658,7 +661,52 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotAbility(boolean isAutopilotAbility, @Nullable List<UnableAutopilotReason> unableAutopilotReasons) {
|
||||
public void onV2nNioGreenWavePassageEvent(@NonNull MessagePad.Header header, @NonNull MessagePad.V2nCrossSpeed crossSpeed) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onV2nNioCrossoverEvent(@NonNull MessagePad.Header header, @NonNull MessagePad.Event event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onV2nNioOtherRetrogradeEvent(@NonNull MessagePad.Header header, @NonNull MessagePad.Event event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onV2nNioCongestionEvent(@NonNull MessagePad.Header header, @NonNull MessagePad.V2nCongestion congestion) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLaneMarksTran(@NonNull MessagePad.Header header, @NonNull LaneMarkOuterClass.LaneMarks laneMarks) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSsmReceiveTimeout(boolean isTimeout) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFsm2024ReceiveTimeout(boolean isTimeout) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotAbility(boolean isAutopilotAbility, @NonNull LaunchConditionData launchConditionData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onParallelDrivingAbility(boolean isParallelDrivingAbility) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveReceivedAck(@NonNull ReceivedAck receivedAck) {
|
||||
|
||||
}
|
||||
|
||||
@@ -670,41 +718,133 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
int mode = Constants.getIpcConnectionMode(this);
|
||||
switch (mode) {
|
||||
default:
|
||||
case AdasOptions.IPC_CONNECTION_MODE.FIXATION:
|
||||
options = new AdasOptions.Builder().setClient(false).setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(this)).setIpcConnectionMode(mode).build();
|
||||
case AdasOptions.IPC_CONNECTION_MODE.PING:
|
||||
options = AdasOptions.newBuilder().setPassenger(false).setPingAddressList(AdasManager.getInstance().getPingAddressList()).setConnectionMode(mode).build();
|
||||
break;
|
||||
case AdasOptions.IPC_CONNECTION_MODE.ASSIGN:
|
||||
options = new AdasOptions.Builder().setClient(false).setIpcAssignIP(Constants.getIPCIp(this)).setIpcConnectionMode(mode).build();
|
||||
case AdasOptions.IPC_CONNECTION_MODE.SPECIFIED:
|
||||
options = AdasOptions.newBuilder().setPassenger(false).setSpecifiedAddress(Constants.getIPCIp(this)).setConnectionMode(mode).build();
|
||||
break;
|
||||
}
|
||||
AdasManager.getInstance().create(options, this);
|
||||
AdasManager.getInstance().create(this, options, this);
|
||||
AdasManager.getInstance().setOnAdasListener(this);
|
||||
}
|
||||
|
||||
private int getStatusColor(AdasConstants.IpcConnectionStatus connectStatus) {
|
||||
int color;
|
||||
if (connectStatus == AdasConstants.IpcConnectionStatus.CONNECTED) {
|
||||
color = R.color.connect_status_connected;
|
||||
} else if (connectStatus == AdasConstants.IpcConnectionStatus.CONNECTING) {
|
||||
color = R.color.connect_status_connecting;
|
||||
} else if (connectStatus == AdasConstants.IpcConnectionStatus.RECONNECTING_TIMER) {
|
||||
color = R.color.connect_status_reconnecting_timer;
|
||||
} else if (connectStatus == AdasConstants.IpcConnectionStatus.RECONNECTING_NETWORK) {
|
||||
color = R.color.connect_status_reconnecting_network;
|
||||
} else if (connectStatus == AdasConstants.IpcConnectionStatus.CONNECT_EXCEPTION) {
|
||||
color = R.color.connect_status_connect_failed;
|
||||
} else if (connectStatus == AdasConstants.IpcConnectionStatus.ILLEGAL_ADDRESS) {
|
||||
color = R.color.connect_status_illegal_address;
|
||||
} else if (connectStatus == AdasConstants.IpcConnectionStatus.SEARCH_ADDRESS) {
|
||||
color = R.color.connect_status_search_address;
|
||||
} else if (connectStatus == AdasConstants.IpcConnectionStatus.NOT_FOUND_ADDRESS) {
|
||||
color = R.color.connect_status_not_found_address;
|
||||
} else if (connectStatus == AdasConstants.IpcConnectionStatus.CERTIFICATION_FAILED) {
|
||||
color = R.color.connect_status_certification_failed;
|
||||
} else if (connectStatus == AdasConstants.IpcConnectionStatus.HEARTBEAT_TIMEOUT) {
|
||||
color = R.color.connect_status_heartbeat_timeout;
|
||||
} else if (connectStatus == AdasConstants.IpcConnectionStatus.PROTOCOL_MISMATCH) {
|
||||
color = R.color.connect_status_protocol_mismatch;
|
||||
} else if (connectStatus == AdasConstants.IpcConnectionStatus.SERVER_DISCONNECTED) {
|
||||
color = R.color.connect_status_server_disconnect;
|
||||
} else {
|
||||
color = R.color.connect_status_disconnected;
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
private void onUpdateConnectStateView(String status) {
|
||||
Message msg = Message.obtain();
|
||||
msg.obj = new IPCConnectState(status, getStatusColor(connectStatus));
|
||||
msg.what = WHAT_IPC_CONNECT_STATE;
|
||||
getHandler().sendMessage(msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionIPCStatus(int ipcConnectionStatus, String reason) {
|
||||
String time = sdf.format(new Date());
|
||||
connectStatusList.add(0, new IPCConnectState(reason == null ? "主动断开连接" : reason, getStatusColor(ipcConnectionStatus)));
|
||||
public void onConnectionIPCStatus(AdasConstants.IpcConnectionStatus ipcConnectionStatus, @Nullable String reason) {
|
||||
String connectStatusDescribe = "未连接";
|
||||
if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.DISCONNECTED) {
|
||||
connectStatusDescribe = "主动断开连接\n未连接或主动断开连接(未连接:鹰眼首次启动时未调用连接函数【目前鹰眼默认启动就会调用连接函数】;主动断开连接:主动调用断开连接函数;";
|
||||
} else if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CONNECTED) {
|
||||
connectStatusDescribe = "已连接";
|
||||
} else if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CONNECTING) {
|
||||
connectStatusDescribe = "连接中";
|
||||
} else if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.RECONNECTING_TIMER) {
|
||||
connectStatusDescribe = "重连中\n类型:定时器";
|
||||
} else if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.RECONNECTING_NETWORK) {
|
||||
connectStatusDescribe = "重连中\n类型:网络监听";
|
||||
} else if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CONNECT_EXCEPTION) {
|
||||
connectStatusDescribe = "连接异常\n鹰眼与域控连接失败、无法连接、非正常断开等,原因:" + reason;
|
||||
} else if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.ILLEGAL_ADDRESS) {
|
||||
connectStatusDescribe = "非法地址\n连接模式为指定地址时:表示当前鹰眼调用连接时传入的域控地址错误或不符合规则【不修改默认配置不会出现此问题】;连接模式为PING模式时:表示传入的PING地址列表存在问题";
|
||||
} else if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.SEARCH_ADDRESS) {
|
||||
connectStatusDescribe = "正在搜索域控地址";
|
||||
} else if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.NOT_FOUND_ADDRESS) {
|
||||
connectStatusDescribe = "找不到可用地址\n域控地址列表中的全部地址均无法连通【不修改默认配置的情况下需要排查PAD是否连接车载路由器、工控机是否连接车载路由器、工控机是否开机等】";
|
||||
} else if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CERTIFICATION_FAILED) {
|
||||
connectStatusDescribe = "域控证书认证异常\n鹰眼端或鹰眼端和域控端启用认证后出现异常,原因:" + certificationResult;
|
||||
} else if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.HEARTBEAT_TIMEOUT) {
|
||||
connectStatusDescribe = "心跳超时\n连接域控成功后在一段时间内未收到域控任何数据),超时时间:" + reason + "秒";
|
||||
} else if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.PROTOCOL_MISMATCH) {
|
||||
connectStatusDescribe = "協議不匹配\n被连接的域控端非WebSocket协议【可能性非常低】";
|
||||
} else if (ipcConnectionStatus == AdasConstants.IpcConnectionStatus.SERVER_DISCONNECTED) {
|
||||
connectStatusDescribe = "域控主动断开连接\n域控主动发起断开WebSocket连接,目前主要原因有:1.证书认证失败;2.老版本MAP不支持多连接的情况下会踢掉客户端;域控断开发送的消息:" + reason;
|
||||
}
|
||||
|
||||
connectStatusList.add(0, new IPCConnectState(connectStatusDescribe, getStatusColor(ipcConnectionStatus)));
|
||||
if (connectStatusList.size() > 100) {
|
||||
connectStatusList.remove(connectStatusList.size() - 1);
|
||||
}
|
||||
connectStatus = ipcConnectionStatus;
|
||||
String status = onUpdateConnectStateView();
|
||||
if (connectStatus == IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
if (connectStatusDescribe.contains("\n")) {
|
||||
connectStatusDescribe = connectStatusDescribe.substring(0, connectStatusDescribe.indexOf("\n"));
|
||||
}
|
||||
onUpdateConnectStateView(connectStatusDescribe);
|
||||
if (connectStatus == AdasConstants.IpcConnectionStatus.CONNECTED) {
|
||||
getHandler().sendEmptyMessage(WHAT_IPC_IP);
|
||||
String tem = getIPCIP();
|
||||
if (!TextUtils.isEmpty(tem)) {
|
||||
List<String> ips = Constants.getIpcUsedIps(this);
|
||||
Constants.addIpcUsedIps(this, ips, tem);
|
||||
}
|
||||
} else if (connectStatus == IPC_CONNECTION_STATUS.DISCONNECTED) {
|
||||
} else if (connectStatus == AdasConstants.IpcConnectionStatus.DISCONNECTED) {
|
||||
getHandler().sendEmptyMessage(WHAT_IPC_IP);
|
||||
}
|
||||
// LogSave.getInstance().saveLog("连接状态", status);
|
||||
// CupidLogUtils.i(TAG, "connectStatus=" + status);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCertification(@NonNull AdasConstants.CertificationStatus status) {
|
||||
if (status == AdasConstants.CertificationStatus.TIMEOUT) {
|
||||
certificationResult = "证书认证超时(表示域控未发送BasicInfoReq接口的数据【这种情况可能是连接出现了问题】)";
|
||||
|
||||
} else {
|
||||
if (status != AdasConstants.CertificationStatus.NOT_ENABLED) {
|
||||
if (status == AdasConstants.CertificationStatus.CERTIFICATE_CHAIN_SUCCESS) {
|
||||
certificationResult = "成功校验域控证书";
|
||||
} else if (status == AdasConstants.CertificationStatus.ROOT_CRT_ERROR) {
|
||||
certificationResult = "获取ROOT证书异常(表示未传递证书,没有拿到ROOT证书)";
|
||||
|
||||
} else if (status == AdasConstants.CertificationStatus.IPC_CRT_ERROR) {
|
||||
certificationResult = "获取域控证书异常(表示域控发送了BasicInfoReq接口的数据但是未传递证书或证书解码失败【失败的可能性很低】)";
|
||||
|
||||
} else if (status == AdasConstants.CertificationStatus.CERTIFICATE_CHAIN_FAILED) {
|
||||
certificationResult = "域控证书校验失败(表示证书链未验证通过。证书不匹配、证书格式不正确)";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompatibility(VersionCompatibility versionCompatibility) {
|
||||
showToastCenter("所连工控机:\n" + (versionCompatibility == null ? "未连接" : versionCompatibility.toString()), Toast.LENGTH_LONG);
|
||||
@@ -746,7 +886,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
}
|
||||
}
|
||||
|
||||
if (connectStatus != IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
if (connectStatus != AdasConstants.IpcConnectionStatus.CONNECTED) {
|
||||
String msg = "未连接工控机";
|
||||
showToastCenter(msg);
|
||||
return;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Constants {
|
||||
|
||||
|
||||
/***********************是否使用固定IP******************/
|
||||
// 0:固定IP 1:指定 2:UDP
|
||||
// 0:Ping 1:指定
|
||||
private static final String IPC_CONNECTION_MODE = "ipc_connection_mode";
|
||||
|
||||
public static void setIpcConnectionMode(Context context, int type) {
|
||||
|
||||
@@ -36,8 +36,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
android:layoutDirection="ltr"
|
||||
android:gravity="center|start"
|
||||
android:text="未连接"
|
||||
android:textColor="@color/colorWhile"
|
||||
android:textSize="16dp"
|
||||
@@ -128,17 +127,17 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/assign"
|
||||
android:id="@+id/specified"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="指定"
|
||||
android:textColor="#ffffff" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/fixation"
|
||||
android:id="@+id/ping"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="固定"
|
||||
android:text="PING"
|
||||
android:textColor="#ffffff" />
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
@@ -12,9 +12,17 @@
|
||||
<color name="colorCrimson">#DC143C</color>
|
||||
<color name="colorLimeGreen">#32CD32</color>
|
||||
<color name="colorSlateGray">#708090</color>
|
||||
<color name="connect_status_connected">#32CD32</color>
|
||||
<color name="connect_status_disconnected">#DC143C</color>
|
||||
<color name="connect_status_connecting">#FF00FF</color>
|
||||
<color name="connect_status_disconnecting">#DAA520</color>
|
||||
<color name="connect_status_search_address">#1E90FF</color>
|
||||
<color name="connect_status_disconnected">#FF0000</color>
|
||||
<color name="connect_status_connected">#00FF00</color>
|
||||
<color name="connect_status_connecting">#800080</color>
|
||||
<color name="connect_status_reconnecting_timer">#BF9548</color>
|
||||
<color name="connect_status_reconnecting_network">#FFA500</color>
|
||||
<color name="connect_status_connect_failed">#FF6347</color>
|
||||
<color name="connect_status_illegal_address">#b408aa</color>
|
||||
<color name="connect_status_search_address">#00FFFF</color>
|
||||
<color name="connect_status_not_found_address">#FFC0CB</color>
|
||||
<color name="connect_status_certification_failed">#800000</color>
|
||||
<color name="connect_status_heartbeat_timeout">#FFD700</color>
|
||||
<color name="connect_status_protocol_mismatch">#01014F</color>
|
||||
<color name="connect_status_server_disconnect">#4d0303</color>
|
||||
</resources>
|
||||
|
||||
@@ -30,7 +30,7 @@ ext {
|
||||
amapsearch : "com.amap.api:search:9.7.0",
|
||||
amaplocation : "com.amap.api:location:6.3.0",
|
||||
|
||||
downloader : "com.mogo.core.net:downloader:1.0.6.3",
|
||||
downloader : "com.mogo.core.net:downloader:1.0.6.6",
|
||||
|
||||
// json 转换
|
||||
gson : "com.google.code.gson:gson:2.8.4",
|
||||
|
||||
@@ -140,52 +140,6 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
car.longitude,
|
||||
car.latitude
|
||||
)
|
||||
// if (polygon.isNotEmpty()) {
|
||||
// val decision = V2NUtils.computeOccupyLanesInfo(Triple(car.longitude, car.latitude, car.heading.toFloat()), Triple(itx.longitude, itx.latitude, itx.heading.toFloat()), polygon.map { kotlin.Pair(it.first, it.second) })
|
||||
// if (decision != null) {
|
||||
// val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
// val total = decision.total
|
||||
// val occupy = decision.occupy
|
||||
// val laneId = decision.laneId
|
||||
// val sb = StringBuilder()
|
||||
// V2XBizTrace.onAck(decision, "计算出道路事件占道决策数据1")
|
||||
// if (laneId != null) {
|
||||
// val isOccupy = occupy.find { it.id == laneId } != null
|
||||
// if (isOccupy) {
|
||||
// if (isDriver) {
|
||||
// val bestLane = V2NUtils.computeBestLane(laneId, occupy, total)
|
||||
// V2XBizTrace.onAck(bestLane, "计算出最优车道")
|
||||
// sb.append("发现前方${distance.toInt()}米${ if (poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType) "车道施工" else "车道事故" }@@, 蘑菇建议您尽快${bestLane.second}")
|
||||
// } else {
|
||||
// sb.append("发现前方${distance.toInt()}米${ if (poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType) "车道施工" else "车道事故" }@@, 蘑菇时刻为您守护")
|
||||
// }
|
||||
// } else {
|
||||
// if (isDriver) {
|
||||
// sb.append("发现前方${distance.toInt()}米${ if (poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType) "车道施工" else "车道事故" }@@, 蘑菇提醒您小心${ if (computeDirection(laneId, occupy) > 0) "右侧" else "左侧" }行人及来车")
|
||||
// } else {
|
||||
// sb.append("发现前方${distance.toInt()}米${ if (poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType) "车道施工" else "车道事故" }@@, 蘑菇时刻为您守护")
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// sb.append("发现前方${distance.toInt()}米${ if (poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType) "车道施工" else "车道事故" }@@, 蘑菇时刻为您守护")
|
||||
// }
|
||||
// if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
// runCatching {
|
||||
// CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), START)
|
||||
// }
|
||||
// scope.launch {
|
||||
// delay(5000)
|
||||
// runCatching {
|
||||
// CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), STOP)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// val ss = sb.toString()
|
||||
// val content = ss.substring(0, ss.indexOf("@@"))
|
||||
// val tts = ss.replace("@@", "")
|
||||
// CallerRoadV2NEventWindowListenerManager.showLiveVideo(id, itx.detectStartTime.takeIf { it > 0 } ?: System.currentTimeMillis(), EventTypeEnumNew.getUpdateIconRes(poiType), content, isDriver, tts, itx.cameraIp, itx.longitude, itx.latitude)
|
||||
// }
|
||||
// }
|
||||
val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
if (!isDriver) {
|
||||
runCatching {
|
||||
|
||||
@@ -46,7 +46,7 @@ class AiRoadMarker {
|
||||
val aiMakers = ConcurrentHashMap<String, AiRoadMarker>()
|
||||
|
||||
private const val TAG = "AiRoadMarker"
|
||||
private val COLOR_START = Color.parseColor("#002ABAD9")
|
||||
private val COLOR_START = Color.parseColor("#0030A3FF")
|
||||
private val COLOR_END = Color.parseColor("#66FF7A30")
|
||||
private val builders by lazy { ConcurrentHashMap<String, Point.Options.Builder>() }
|
||||
|
||||
|
||||
@@ -38,12 +38,12 @@ class V2XAiRoadEventMarker {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
val colors = ArrayList<Int>()
|
||||
colors.add(Color.argb(204, 237, 172, 21))
|
||||
colors.add(Color.argb(0, 255, 255, 255))
|
||||
colors.add(Color.argb(0, 48, 163, 255))
|
||||
builder.colors(colors)
|
||||
} else {
|
||||
val colors = ArrayList<Int>()
|
||||
colors.add(Color.parseColor("#99FF8F2A"))
|
||||
colors.add(Color.argb(0, 255, 255, 255))
|
||||
colors.add(Color.argb(0, 48, 163, 255))
|
||||
builder.colors(colors)
|
||||
}
|
||||
val dispersedPoints = getDispersedPoints(polygon.map { Pair<Double, Double>(it.first, it.second) }, 3)
|
||||
|
||||
@@ -117,6 +117,7 @@ import mogo.v2x.RoadOverviewEvents
|
||||
import mogo.yycp.paralleldriving.protocol.ParallelTaskProcessNoticeOuterClass
|
||||
import mogo_msg.MogoReportMsg
|
||||
import perception.FusionTrafficLightOuterClass
|
||||
import perception.LaneMarkOuterClass
|
||||
import planning.RoboSweeperTaskIndexOuterClass
|
||||
import prediction.Prediction
|
||||
import record_cache.RecordPanelOuterClass
|
||||
@@ -1030,6 +1031,19 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
CallerV2nNioEventListenerManager.invokeV2nNioCongestionEvent(congestion)
|
||||
}
|
||||
|
||||
/**
|
||||
* 车道线
|
||||
*
|
||||
* @param header 头
|
||||
* @param laneMarks 数据
|
||||
*/
|
||||
override fun onLaneMarksTran(
|
||||
header: MessagePad.Header,
|
||||
laneMarks: LaneMarkOuterClass.LaneMarks
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 所连接的域控的节点状态信息
|
||||
* 目前包含状态 节点是否存在;节点是否超时;
|
||||
|
||||
@@ -5,7 +5,6 @@ package com.zhjt.mogo_core_function_devatools
|
||||
import android.app.Activity
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
@@ -13,7 +12,6 @@ import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.EnvConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig.isShowRouteStrategy
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
@@ -60,10 +58,8 @@ import com.zhjt.mogo_core_function_devatools.binding.BindingCarManager
|
||||
import com.zhjt.mogo_core_function_devatools.block.MoGoBlockProviderImpl
|
||||
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
|
||||
import com.zhjt.mogo_core_function_devatools.exam.ExamControlManager
|
||||
import com.zhjt.mogo_core_function_devatools.exam.ExamControlWindow
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigCenter.Companion.bizConfigCenter
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigImpl
|
||||
import com.zhjt.mogo_core_function_devatools.logcat.CrashLogAnalyticsManager
|
||||
import com.zhjt.mogo_core_function_devatools.logcat.MoGoLogRecordProviderImpl
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchManager
|
||||
import com.zhjt.mogo_core_function_devatools.lookaround.MoGoLookAroundProviderImpl
|
||||
@@ -91,11 +87,7 @@ import com.zhjt.service.chain.ChainLog
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import java.io.BufferedReader
|
||||
import java.io.File
|
||||
import java.io.FileReader
|
||||
import java.io.IOException
|
||||
import java.lang.StringBuilder
|
||||
import java.lang.ref.WeakReference
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
@@ -250,26 +242,6 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener {
|
||||
val crashDir = File(it.getExternalFilesDir(null), "crash")
|
||||
if(crashDir.exists() && crashDir.canExecute() && crashDir.listFiles()?.isNotEmpty() == true){
|
||||
it.lifeCycleScope.launch(Dispatchers.IO){
|
||||
crashDir.listFiles()?.forEach {crash->
|
||||
val file = File(crash.absolutePath)
|
||||
try {
|
||||
BufferedReader(FileReader(file)).use { reader ->
|
||||
var line: String?
|
||||
//读取读取文件内容并打印
|
||||
while (reader.readLine().also { line = it } != null) {
|
||||
line?.let { content->
|
||||
if(content.contains("Crash type")){
|
||||
CrashLogAnalyticsManager.crashLogAnalytics(content)
|
||||
return@use
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
val startTime = crashDir.lastModified() - 60*1000
|
||||
val endTime = if(System.currentTimeMillis() - crashDir.lastModified()>60*1000){
|
||||
crashDir.lastModified() + 60*1000
|
||||
|
||||
@@ -246,32 +246,21 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
if (ClickUtils.isFastClick()){
|
||||
if (NetworkUtils.isConnected()){
|
||||
if (BadCaseConfig.dockerVersion != null){
|
||||
if(ProjectUtils.isSaas()){
|
||||
//660版本数据闭环增加统一上报问题入口(仅限于saas渠道)
|
||||
if(reportTypeWindow == null){
|
||||
reportTypeWindow = ReportTypeWindow(activity)
|
||||
reportTypeWindow?.setClickListener(object: ReportTypeWindow.ClickListener{
|
||||
override fun closeWindow() {
|
||||
reportTypeWindow?.hideFloatWindow()
|
||||
reportTypeWindow = null
|
||||
}
|
||||
})
|
||||
}
|
||||
if(reportTypeWindow?.getWindowShowStatus() == true){
|
||||
reportTypeWindow?.hideFloatWindow()
|
||||
reportTypeWindow = null
|
||||
}else{
|
||||
reportTypeWindow?.showFloatWindow(xPosition,yPosition)
|
||||
}
|
||||
}else{
|
||||
//展示工单上报弹窗
|
||||
val workOrderWindow = WorkOrderWindow(activity)
|
||||
workOrderWindow.setClickListener(object: WorkOrderWindow.ClickListener{
|
||||
//660版本数据闭环增加统一上报问题入口(仅限于saas渠道)
|
||||
if(reportTypeWindow == null){
|
||||
reportTypeWindow = ReportTypeWindow(activity)
|
||||
reportTypeWindow?.setClickListener(object: ReportTypeWindow.ClickListener{
|
||||
override fun closeWindow() {
|
||||
workOrderWindow.hideFloatWindow()
|
||||
reportTypeWindow?.hideFloatWindow()
|
||||
reportTypeWindow = null
|
||||
}
|
||||
})
|
||||
workOrderWindow.showFloatWindow()
|
||||
}
|
||||
if(reportTypeWindow?.getWindowShowStatus() == true){
|
||||
reportTypeWindow?.hideFloatWindow()
|
||||
reportTypeWindow = null
|
||||
}else{
|
||||
reportTypeWindow?.showFloatWindow(xPosition,yPosition)
|
||||
}
|
||||
}else{
|
||||
ToastUtils.showShort("工控机连接状态异常")
|
||||
@@ -373,29 +362,31 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
fun onReceiveBadCaseRecord(msgBoxBean: MsgBoxBean, activity: Activity, countdown: Boolean) {
|
||||
CallerLogger.d("$M_DEVA$TAG", "收到录包结果回调${record}")
|
||||
CallerLogger.d("$M_DEVA$TAG", "开始创建被动录包弹窗,window num=${BadCaseConfig.windowNum}")
|
||||
ThreadUtils.runOnUiThread {
|
||||
val passiveBadCaseWindow = PassiveBadCaseWindow(activity)
|
||||
passiveBadCaseWindow.setRecord(msgBoxBean)
|
||||
passiveBadCaseWindow.setClickListener(object : PassiveBadCaseWindow.ClickListener {
|
||||
override fun closeWindow() {
|
||||
passiveBadCaseWindow.hideFloatWindow()
|
||||
}
|
||||
})
|
||||
passiveBadCaseWindow.showFloatWindow()
|
||||
if (countdown) {
|
||||
val countDownTimer = object : CountDownTimer(10000, 10000) {
|
||||
override fun onTick(p0: Long) {
|
||||
if(!ProjectUtils.isSaas()){
|
||||
ThreadUtils.runOnUiThread {
|
||||
val passiveBadCaseWindow = PassiveBadCaseWindow(activity)
|
||||
passiveBadCaseWindow.setRecord(msgBoxBean)
|
||||
passiveBadCaseWindow.setClickListener(object : PassiveBadCaseWindow.ClickListener {
|
||||
override fun closeWindow() {
|
||||
passiveBadCaseWindow.hideFloatWindow()
|
||||
}
|
||||
})
|
||||
passiveBadCaseWindow.showFloatWindow()
|
||||
if (countdown) {
|
||||
val countDownTimer = object : CountDownTimer(10000, 10000) {
|
||||
override fun onTick(p0: Long) {
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
//如果有页面操作,则不自动关闭窗口
|
||||
if(!passiveBadCaseWindow.isOperated()){
|
||||
passiveBadCaseWindow.hideFloatWindow()
|
||||
BadCaseConfig.windowNum--
|
||||
override fun onFinish() {
|
||||
//如果有页面操作,则不自动关闭窗口
|
||||
if(!passiveBadCaseWindow.isOperated()){
|
||||
passiveBadCaseWindow.hideFloatWindow()
|
||||
BadCaseConfig.windowNum--
|
||||
}
|
||||
}
|
||||
}
|
||||
countDownTimer.start()
|
||||
}
|
||||
countDownTimer.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -579,26 +570,35 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
*/
|
||||
override fun onFSM2024State(fsmState: Fsm2024.FSMStateMsg) {
|
||||
Log.i(TAG,"onFSM2024State fsmState.pilotStandbyFlag="+fsmState.pilotStandbyFlag+" pilotNotStandbyReason="+ fsmState.pilotNotStandbyReason)
|
||||
if(!fsmState.pilotStandbyFlag){
|
||||
//pilotStandbyFlag == false代表自动驾驶无法启动
|
||||
if(!BadCaseConfig.alreadyShowOneReport){
|
||||
//触发一键上报
|
||||
ThreadUtils.runOnUiThread {
|
||||
if(reportTypeWindow == null){
|
||||
reportTypeWindow = ReportTypeWindow(activity)
|
||||
reportTypeWindow?.setClickListener(object: ReportTypeWindow.ClickListener{
|
||||
override fun closeWindow() {
|
||||
reportTypeWindow?.hideFloatWindow()
|
||||
reportTypeWindow = null
|
||||
}
|
||||
})
|
||||
if(fsmState.pilotStandbyFlag){
|
||||
BadCaseConfig.fsmAlreadyStandby = true
|
||||
}
|
||||
if(BadCaseConfig.fsmAlreadyStandby){
|
||||
if(!fsmState.pilotStandbyFlag){
|
||||
//pilotStandbyFlag == false代表自动驾驶无法启动
|
||||
if(!BadCaseConfig.alreadyShowOneReport){
|
||||
//触发一键上报
|
||||
ThreadUtils.runOnUiThread {
|
||||
val activity = AppStateManager.currentActivity()
|
||||
if (activity !is AppCompatActivity) {
|
||||
return@runOnUiThread
|
||||
}
|
||||
if(reportTypeWindow == null){
|
||||
reportTypeWindow = ReportTypeWindow(activity)
|
||||
reportTypeWindow?.setClickListener(object: ReportTypeWindow.ClickListener{
|
||||
override fun closeWindow() {
|
||||
reportTypeWindow?.hideFloatWindow()
|
||||
reportTypeWindow = null
|
||||
}
|
||||
})
|
||||
}
|
||||
reportTypeWindow?.showOneClickReportWindow(xPosition,yPosition)
|
||||
BadCaseConfig.alreadyShowOneReport = true
|
||||
}
|
||||
reportTypeWindow?.showOneClickReportWindow(xPosition,yPosition)
|
||||
BadCaseConfig.alreadyShowOneReport = true
|
||||
}
|
||||
}else{
|
||||
BadCaseConfig.alreadyShowOneReport = false
|
||||
}
|
||||
}else{
|
||||
BadCaseConfig.alreadyShowOneReport = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -614,6 +614,10 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
if(it.status == AutopilotStatistics.AUTOPILOT_START_STATUS.FAILED){
|
||||
//触发一键上报
|
||||
ThreadUtils.runOnUiThread{
|
||||
val activity = AppStateManager.currentActivity()
|
||||
if (activity !is AppCompatActivity) {
|
||||
return@runOnUiThread
|
||||
}
|
||||
if(reportTypeWindow == null){
|
||||
reportTypeWindow = ReportTypeWindow(activity)
|
||||
reportTypeWindow?.setClickListener(object: ReportTypeWindow.ClickListener{
|
||||
@@ -655,6 +659,10 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
}else if(state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE ||
|
||||
state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE){
|
||||
if(shouldRecord){
|
||||
val activity = AppStateManager.currentActivity()
|
||||
if (activity !is AppCompatActivity) {
|
||||
return
|
||||
}
|
||||
val geocodeSearch = GeocodeSearch(activity)
|
||||
geocodeSearch.setOnGeocodeSearchListener(object: GeocodeSearch.OnGeocodeSearchListener {
|
||||
override fun onRegeocodeSearched(regeocodeResult: RegeocodeResult?, p1: Int) {
|
||||
|
||||
@@ -130,7 +130,7 @@ fun Context.enqueuePop(content: View, width: Int, height: Int, key: String = "",
|
||||
}
|
||||
|
||||
override fun show() {
|
||||
pop.showAtLocation(activity.window.decorView, gravity, startX, if (isImmersiveMode) 0 else BarUtils.getStatusBarHeight() + startY)
|
||||
pop.showAtLocation(activity.window.decorView, gravity, startX, startY)
|
||||
}
|
||||
override fun isOverride(): Boolean = isOverride
|
||||
}
|
||||
|
||||
@@ -507,9 +507,6 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY
|
||||
if(((mInScreenX - mInViewX)-mWindowParams!!.x).absoluteValue>150 || ((mInScreenY - mInViewY)-mWindowParams!!.y).absoluteValue>150){
|
||||
return true
|
||||
}
|
||||
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
|
||||
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
|
||||
@@ -505,9 +505,6 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY
|
||||
if(((mInScreenX - mInViewX)-mWindowParams!!.x).absoluteValue>150 || ((mInScreenY - mInViewY)-mWindowParams!!.y).absoluteValue>150){
|
||||
return true
|
||||
}
|
||||
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
|
||||
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
|
||||
@@ -62,6 +62,9 @@ object BadCaseConfig {
|
||||
//本次问题是否已经触发一键上报
|
||||
@JvmField
|
||||
var alreadyShowOneReport: Boolean = false
|
||||
//FSM是否已经变为可以启自驾
|
||||
@JvmField
|
||||
var fsmAlreadyStandby: Boolean = false
|
||||
//租户ID
|
||||
@JvmField
|
||||
var tenantId: Long = 0
|
||||
|
||||
@@ -240,9 +240,6 @@ class ExamControlWindow constructor(activity: Activity): View.OnTouchListener{
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY
|
||||
if(((mInScreenX - mInViewX)-mWindowParams!!.x).absoluteValue>150 || ((mInScreenY - mInViewY)-mWindowParams!!.y).absoluteValue>150){
|
||||
return true
|
||||
}
|
||||
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
|
||||
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
|
||||
@@ -24,6 +24,8 @@ object CrashLogAnalyticsManager {
|
||||
private const val crashEyeVersion = "eyeVersion" //鹰眼版本
|
||||
private const val crashAppFlavor = "appFlavor" //渠道信息
|
||||
private const val crashBranchHash = "branchHash" //Git Hash
|
||||
private const val crashKeyMessage = "keyMessage" //崩溃核心信息
|
||||
private const val crashIsDriver = "isDriver" //是否是司机屏
|
||||
|
||||
/**
|
||||
* 崩溃统计
|
||||
@@ -37,7 +39,7 @@ object CrashLogAnalyticsManager {
|
||||
* @param branchHash Git Hash
|
||||
*/
|
||||
private fun realCrashLogAnalytics(cosPath: String,type: String,plateNumber: String,carSn: String,mapVersion: String,eyeVersion: String,
|
||||
appFlavor: String,branchHash: String){
|
||||
appFlavor: String,branchHash: String,keyMessage: String,isDriver: Boolean){
|
||||
val crashLogParams = HashMap<String,Any>()
|
||||
crashLogParams[crashCosPath] = cosPath
|
||||
crashLogParams[crashType] = type
|
||||
@@ -47,14 +49,17 @@ object CrashLogAnalyticsManager {
|
||||
crashLogParams[crashEyeVersion] = eyeVersion
|
||||
crashLogParams[crashAppFlavor] = appFlavor
|
||||
crashLogParams[crashBranchHash] = branchHash
|
||||
crashLogParams[crashKeyMessage] = keyMessage
|
||||
crashLogParams[crashIsDriver] = isDriver
|
||||
MogoAnalyticUtils.track(crashLogRecord,crashLogParams)
|
||||
}
|
||||
|
||||
/**
|
||||
* 崩溃统计
|
||||
* @param crashType 崩溃类型
|
||||
* @param keyMessage 崩溃关键信息
|
||||
*/
|
||||
fun crashLogAnalytics(crashType: String){
|
||||
fun crashLogAnalytics(crashType: String,keyMessage: String){
|
||||
val crashCosPath = StringBuilder()
|
||||
crashCosPath.append("CarPad/")
|
||||
if(DebugConfig.isDebug()){
|
||||
@@ -66,10 +71,10 @@ object CrashLogAnalyticsManager {
|
||||
crashCosPath.append("/")
|
||||
crashCosPath.append(millis2String(System.currentTimeMillis(), TimeUtils.getMdFormat()))
|
||||
crashCosPath.append("/")
|
||||
realCrashLogAnalytics(crashCosPath.toString(),crashType.replace("Crash type:","").trim(), AppConfigInfo.plateNumber,
|
||||
realCrashLogAnalytics(crashCosPath.toString(),crashType, AppConfigInfo.plateNumber,
|
||||
SharedPrefsMgr.getInstance().sn,
|
||||
CallerAutoPilotStatusListenerManager.getDockerVersion() ?: "",
|
||||
AppUtils.getAppVersionName(),AppConfigInfo.flavor,AppConfigInfo.workingBranchHash)
|
||||
AppUtils.getAppVersionName(),AppConfigInfo.flavor,AppConfigInfo.workingBranchHash,keyMessage,AppConfigInfo.isDriver)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,12 @@ import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.core.log.record.*
|
||||
import com.mogo.core.log.record.config.*
|
||||
import com.mogo.core.log.record.config.crash.ANRCrash
|
||||
import com.mogo.core.log.record.config.crash.CrashConfig
|
||||
import com.mogo.core.log.record.config.crash.CrashType
|
||||
import com.mogo.core.log.record.config.crash.JavaCrash
|
||||
import com.mogo.core.log.record.config.crash.NativeCrash
|
||||
import com.mogo.core.log.record.config.crash.upload.ICrashFileUploader
|
||||
import com.mogo.core.log.record.config.extra.IExtraFileToUpload
|
||||
import com.mogo.core.log.record.config.extra.ToUploadFile
|
||||
import com.mogo.core.log.record.config.state.IStateProvider
|
||||
@@ -137,6 +142,7 @@ internal class MoGoLogRecordProviderImpl: IMoGoLogRecordProvider,
|
||||
builder.crashConfig(
|
||||
CrashConfig.Builder()
|
||||
.enabled(true)
|
||||
.uploader(CrashLogUploader(context))
|
||||
.crashDir(File(context.getExternalFilesDir(null), "crash"))
|
||||
.expireDuration(TimeUnit.DAYS.toMillis(3))
|
||||
.javaCrash(true)
|
||||
@@ -156,6 +162,7 @@ internal class MoGoLogRecordProviderImpl: IMoGoLogRecordProvider,
|
||||
}
|
||||
})
|
||||
LogcatManager.init(builder)
|
||||
LogcatManager.uploadForCrashIfNeed()
|
||||
}
|
||||
|
||||
override fun target(): Class<RemoteLogPushContent> {
|
||||
@@ -235,4 +242,33 @@ internal class MoGoLogRecordProviderImpl: IMoGoLogRecordProvider,
|
||||
override fun testAnrCrash() {
|
||||
SystemClock.sleep(15000)
|
||||
}
|
||||
|
||||
private class CrashLogUploader(private val mContext: Context): ICrashFileUploader {
|
||||
|
||||
override suspend fun upload(
|
||||
type: CrashType,
|
||||
crashTime: String,
|
||||
file: File,
|
||||
extra: Map<String, String>?
|
||||
): Boolean {
|
||||
try {
|
||||
val keyMessage = when(type) {
|
||||
JavaCrash -> extra?.get("java stacktrace") ?: extra?.get("backtrace") ?: "#"
|
||||
NativeCrash -> extra?.get("backtrace") ?: "#"
|
||||
ANRCrash -> extra?.get("backtrace") ?: "#"
|
||||
}
|
||||
val typeStr = when(type){
|
||||
JavaCrash -> "JavaCrash"
|
||||
NativeCrash -> "NativeCrash"
|
||||
ANRCrash -> "ANRCrash"
|
||||
}
|
||||
CrashLogAnalyticsManager.crashLogAnalytics(typeStr,keyMessage)
|
||||
return true
|
||||
} catch (t: Throwable) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -94,7 +94,6 @@ object StatusManager {
|
||||
is GpsStatus -> GpsImpl(ctx)
|
||||
is TracingStatus -> TracingImpl(ctx)
|
||||
is RTKStatus -> RTKImpl(ctx)
|
||||
is FSMStatus -> FSMImpl(ctx)
|
||||
is OverViewStatus -> OverViewImpl(ctx)
|
||||
is SteerStatus -> SteerImpl(ctx)
|
||||
is AcceleratorStatus -> AcceleratorImpl(ctx)
|
||||
@@ -102,6 +101,7 @@ object StatusManager {
|
||||
is DoubleFlashStatus -> DoubleFlashImpl(ctx)
|
||||
is GearStatus -> GearImpl(ctx)
|
||||
is SpeedStatus -> SpeedImpl(ctx)
|
||||
is FSMStatus -> FSMImpl(ctx)
|
||||
is RouteDownloadStatus -> RouteDownloadImpl(ctx)
|
||||
}
|
||||
}.also { flows += it }
|
||||
@@ -214,6 +214,7 @@ object StatusManager {
|
||||
is DoubleFlashStatus -> "双闪"
|
||||
is GearStatus -> "档位"
|
||||
is RouteDownloadStatus -> if (item.state == RouteStart) "轨迹下载中" else "轨迹下载失败"
|
||||
is FSMStatus -> "FSM"
|
||||
else -> "其它"
|
||||
}
|
||||
}
|
||||
@@ -239,7 +240,6 @@ object StatusManager {
|
||||
} else {
|
||||
ret or shl
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return ret
|
||||
|
||||
@@ -141,7 +141,7 @@ enum class FSMStateCode {
|
||||
/**
|
||||
* FSM模块状态
|
||||
*/
|
||||
class FSMStatus(var state: FSMStateCode, var desc: String = ""): Status() {
|
||||
class FSMStatus(var state: FSMStateCode, var desc: String = ""): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
@@ -9,6 +9,7 @@ import androidx.recyclerview.widget.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.rv.divider.*
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.FSMStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.IAutopilotPreLaunchStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.Status
|
||||
import com.zhjt.mogo_core_function_devatools.status.model.StatusModel
|
||||
@@ -48,11 +49,11 @@ internal class StatusView(private val model: StatusModel, ctx: Context): Constra
|
||||
.horizontalInnerSpace(10.PX)
|
||||
.build()
|
||||
)
|
||||
val adapter = model.status.value?.let { data -> StatusAdapter(context, data.second.filter { it !is IAutopilotPreLaunchStatus }) }?.also { adapter -> itx.adapter = adapter }
|
||||
val adapter = model.status.value?.let { data -> StatusAdapter(context, data.second.filter { (it !is IAutopilotPreLaunchStatus) || (it is FSMStatus)}) }?.also { adapter -> itx.adapter = adapter }
|
||||
adapter?.let { _ ->
|
||||
model.status.observeForever(Observer<Pair<Status?, ArrayList<Status>>> { data ->
|
||||
val old = adapter.data
|
||||
val update = data.second.filter { it !is IAutopilotPreLaunchStatus }
|
||||
val update = data.second.filter { (it !is IAutopilotPreLaunchStatus) || (it is FSMStatus) }
|
||||
val result = DiffUtil.calculateDiff(StatusDiffCallback(old, update))
|
||||
adapter.data = update
|
||||
result.dispatchUpdatesTo(adapter)
|
||||
|
||||
@@ -22,7 +22,6 @@ import android.view.animation.ScaleAnimation
|
||||
import android.widget.EditText
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import android.widget.ToggleButton
|
||||
import androidx.appcompat.widget.AppCompatEditText
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -62,7 +61,6 @@ import com.mogo.tts.base.SpeechUtils
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.workorder.adapter.OrderReasonAdapter
|
||||
import kotlin.math.absoluteValue
|
||||
|
||||
/**
|
||||
* 故障原因编辑窗口
|
||||
@@ -192,12 +190,15 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
//故障类型选择没有变化
|
||||
reasonList?.let { orderReasonAdapter.setData(it,2) }
|
||||
}else{
|
||||
//故障类型发生了变化
|
||||
level2Id = reason.id
|
||||
level2Name = reason.name
|
||||
|
||||
source = 2
|
||||
//获取故障三级分类即故障原因
|
||||
CallerDevaToolsManager.getCategories(BadCaseConfig.tenantId,3,level2Id,type,0)
|
||||
tvFaultReason.text = ""
|
||||
level3Id = 0
|
||||
level3Name = ""
|
||||
}
|
||||
}else{
|
||||
//原因
|
||||
@@ -347,6 +348,7 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
ToastUtils.showShort("请完整填写再上报")
|
||||
return@setOnClickListener
|
||||
}
|
||||
reportNote = etNoteInput.text.toString()
|
||||
//故障码列表赋值
|
||||
BadCaseConfig.newFMInfoMsg?.fmInfoList?.forEach {
|
||||
faultCodeList.add(it.faultId)
|
||||
@@ -507,9 +509,6 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY
|
||||
if(((mInScreenX - mInViewX)-mWindowParams!!.x).absoluteValue>150 || ((mInScreenY - mInViewY)-mWindowParams!!.y).absoluteValue>150){
|
||||
return true
|
||||
}
|
||||
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
|
||||
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
@@ -533,6 +532,7 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
}
|
||||
|
||||
fun hideFloatWindow() {
|
||||
etNoteInput.clearFocus()
|
||||
CallerDevaToolsListenerManager.removeListener(TAG)
|
||||
CallerOrderListenerManager.removeListener(TAG)
|
||||
if (mFloatLayout.parent != null){
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.amap.api.services.geocoder.GeocodeResult
|
||||
import com.amap.api.services.geocoder.GeocodeSearch
|
||||
import com.amap.api.services.geocoder.RegeocodeQuery
|
||||
import com.amap.api.services.geocoder.RegeocodeResult
|
||||
import com.mogo.commons.env.ProjectUtils
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.deva.report.CategoryInfo
|
||||
@@ -77,8 +78,6 @@ class ReportTypeWindow constructor(activity: Activity): IMoGoDevaToolsListener {
|
||||
private var level1Name: String = ""
|
||||
private var level2Name: String = ""
|
||||
private var level3Name: String = ""
|
||||
private var lineName: String = "" //行驶路线
|
||||
private var reportNote: String = "" //上报描述
|
||||
private val reportType: Int = 1 //上报方式:0:小程序 1:司机屏 2:云端上报
|
||||
private var level: Int = 1
|
||||
|
||||
@@ -143,7 +142,7 @@ class ReportTypeWindow constructor(activity: Activity): IMoGoDevaToolsListener {
|
||||
}
|
||||
val padProblemList= ArrayList<PadProblemInfo>()
|
||||
val padProblemInfo = PadProblemInfo(address,faultCodeList,millis2String(System.currentTimeMillis()),level1Id,
|
||||
level2Id,level3Id,lineName,reportNote,reportType,
|
||||
level2Id,level3Id,BadCaseConfig.lineName,"${level1Name}-${level2Name}-${level3Name}",reportType,
|
||||
SharedPrefsMgr.getInstance().getString("och_account",""))
|
||||
padProblemList.add(padProblemInfo)
|
||||
val padAddProblemReq = PadAddProblemReq(padProblemList, AppConfigInfo.plateNumber)
|
||||
@@ -160,8 +159,14 @@ class ReportTypeWindow constructor(activity: Activity): IMoGoDevaToolsListener {
|
||||
}
|
||||
//故障类
|
||||
tvReportTypeFault.setOnClickListener {
|
||||
val faultReasonWindow = FaultReasonWindow(mActivity)
|
||||
faultReasonWindow.showFloatWindow()
|
||||
if(ProjectUtils.isSaas()){
|
||||
val faultReasonWindow = FaultReasonWindow(mActivity)
|
||||
faultReasonWindow.showFloatWindow()
|
||||
}else{
|
||||
//展示工单上报弹窗
|
||||
val workOrderWindow = WorkOrderWindow(mActivity)
|
||||
workOrderWindow.showFloatWindow()
|
||||
}
|
||||
clickListener?.closeWindow()
|
||||
}
|
||||
//主动录包
|
||||
@@ -287,7 +292,7 @@ class ReportTypeWindow constructor(activity: Activity): IMoGoDevaToolsListener {
|
||||
/**
|
||||
* 设置弹窗展示状态
|
||||
*/
|
||||
fun setWindowShowStatus(isShow: Boolean){
|
||||
private fun setWindowShowStatus(isShow: Boolean){
|
||||
isShowing = isShow
|
||||
}
|
||||
|
||||
@@ -312,6 +317,7 @@ class ReportTypeWindow constructor(activity: Activity): IMoGoDevaToolsListener {
|
||||
override fun problemPadAddError(msg: String) {
|
||||
super.problemPadAddError(msg)
|
||||
ToastUtils.showShort("故障原因上报失败$msg")
|
||||
clickListener?.closeWindow()
|
||||
}
|
||||
|
||||
override fun getCategoriesSuccess(list: List<CategoryInfo>) {
|
||||
|
||||
@@ -109,6 +109,8 @@ class TakeOverReasonWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
private var level2Name: String = ""
|
||||
private var level3Name: String = ""
|
||||
|
||||
private var isShowing: Boolean = false //弹窗是否是展示状态
|
||||
|
||||
init {
|
||||
initFloatWindow()
|
||||
}
|
||||
@@ -156,14 +158,19 @@ class TakeOverReasonWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
//选择了接管类型
|
||||
tvTakeOverType.performClick()
|
||||
if(level2Id != 0 && level2Id == reason.id){
|
||||
//故障类型选择没有变化
|
||||
//接管类型选择没有变化
|
||||
reasonList?.let { orderReasonAdapter.setData(it,2) }
|
||||
}else{
|
||||
//接管类型发生变化
|
||||
level2Id = reason.id
|
||||
level2Name = reason.name
|
||||
source = 2
|
||||
//获取故障三级分类即故障原因
|
||||
//获取接管三级分类即接管原因
|
||||
CallerDevaToolsManager.getCategories(BadCaseConfig.tenantId,3,level2Id,type,0)
|
||||
//将接管原因置空
|
||||
tvTakeOverReason.text = ""
|
||||
level3Name = ""
|
||||
level3Id = 0
|
||||
}
|
||||
}else{
|
||||
//原因
|
||||
@@ -299,10 +306,12 @@ class TakeOverReasonWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
mTakeOverRecordInfo.level3Name = level3Name
|
||||
CallerTakeOverManager.updateRecord(mActivity,mTakeOverRecordInfo)
|
||||
clickListener?.onSaveReason(mTakeOverRecordInfo)
|
||||
clickListener?.closeWindow()
|
||||
hideFloatWindow()
|
||||
}
|
||||
//取消
|
||||
tvTakeOverCancel.setOnClickListener {
|
||||
clickListener?.closeWindow()
|
||||
hideFloatWindow()
|
||||
}
|
||||
}
|
||||
@@ -421,9 +430,6 @@ class TakeOverReasonWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY
|
||||
if(((mInScreenX - mInViewX)-mWindowParams!!.x).absoluteValue>150 || ((mInScreenY - mInViewY)-mWindowParams!!.y).absoluteValue>150){
|
||||
return true
|
||||
}
|
||||
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
|
||||
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
@@ -451,21 +457,40 @@ class TakeOverReasonWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
tvTakeOverTime.text = mActivity.resources.getString(R.string.take_over_time) +
|
||||
millis2String(mTakeOverRecordInfo.faultStartTime, TimeUtils.getHourMinSecondFormat())
|
||||
}
|
||||
setWindowShowStatus(true)
|
||||
}
|
||||
|
||||
fun hideFloatWindow() {
|
||||
etNoteInput.clearFocus()
|
||||
if (mFloatLayout.parent != null){
|
||||
mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
setWindowShowStatus(false)
|
||||
CallerDevaToolsListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取弹窗展示状态
|
||||
*/
|
||||
fun getWindowShowStatus(): Boolean{
|
||||
return isShowing
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置弹窗展示状态
|
||||
*/
|
||||
private fun setWindowShowStatus(isShow: Boolean){
|
||||
isShowing = isShow
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener {
|
||||
fun onSaveReason(info: TakeOverRecordInfo)
|
||||
|
||||
fun closeWindow()
|
||||
}
|
||||
|
||||
override fun getCategoriesSuccess(list: List<CategoryInfo>) {
|
||||
|
||||
@@ -58,6 +58,7 @@ class TakeOverRecordView @JvmOverloads constructor(
|
||||
private var clickListener: ClickListener? = null
|
||||
private val selectedUploadRecord = ArrayList<TakeOverRecordInfo>()
|
||||
private var recordList: MutableList<TakeOverRecordInfo> ?= null
|
||||
private var takeOverReasonWindow: TakeOverReasonWindow ?= null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_take_over_record, this, true)
|
||||
@@ -80,13 +81,23 @@ class TakeOverRecordView @JvmOverloads constructor(
|
||||
//展示接管原因窗口
|
||||
val activity = context as? FragmentActivity
|
||||
?: throw IllegalStateException("please ensure context is FragmentActivity.")
|
||||
val takeOverReasonWindow = TakeOverReasonWindow(activity)
|
||||
takeOverReasonWindow.setClickListener(object: TakeOverReasonWindow.ClickListener{
|
||||
override fun onSaveReason(info: TakeOverRecordInfo) {
|
||||
takeOverListAdapter?.notifyRecordItemChanged(info)
|
||||
}
|
||||
})
|
||||
takeOverReasonWindow.showFloatWindow(takeOverRecordInfo)
|
||||
if(takeOverReasonWindow == null){
|
||||
takeOverReasonWindow = TakeOverReasonWindow(activity)
|
||||
takeOverReasonWindow?.setClickListener(object: TakeOverReasonWindow.ClickListener{
|
||||
override fun onSaveReason(info: TakeOverRecordInfo) {
|
||||
takeOverListAdapter?.notifyRecordItemChanged(info)
|
||||
}
|
||||
|
||||
override fun closeWindow() {
|
||||
takeOverReasonWindow = null
|
||||
}
|
||||
})
|
||||
}
|
||||
if(takeOverReasonWindow?.getWindowShowStatus() == true){
|
||||
ToastUtils.showShort("接管原因弹窗已存在,请先编辑现有接管原因")
|
||||
}else{
|
||||
takeOverReasonWindow?.showFloatWindow(takeOverRecordInfo)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSelectRecord(
|
||||
@@ -143,14 +154,28 @@ class TakeOverRecordView @JvmOverloads constructor(
|
||||
if(selectedUploadRecord.isEmpty()){
|
||||
ToastUtils.showShort("请选择需要删除的接管记录")
|
||||
}else{
|
||||
val iterator = selectedUploadRecord.iterator()
|
||||
while (iterator.hasNext()){
|
||||
val removeRecord = iterator.next()
|
||||
CallerTakeOverManager.deleteRecord(context,removeRecord)
|
||||
scope.launch(Dispatchers.IO){
|
||||
val iterator = selectedUploadRecord.iterator()
|
||||
while (iterator.hasNext()){
|
||||
val removeRecord = iterator.next()
|
||||
CallerTakeOverManager.deleteRecord(context,removeRecord)
|
||||
// takeOverListAdapter?.notifyRecordItemRemoved(removeRecord)
|
||||
iterator.remove()
|
||||
iterator.remove()
|
||||
}
|
||||
recordList = CallerTakeOverManager.getAllRecord(context)
|
||||
ThreadUtils.runOnUiThread {
|
||||
if(recordList.isNullOrEmpty()){
|
||||
tvRecordNoData.visibility = View.VISIBLE
|
||||
recordGroup.visibility = View.GONE
|
||||
}else{
|
||||
tvRecordNoData.visibility = View.GONE
|
||||
recordGroup.visibility = View.VISIBLE
|
||||
//更新列表
|
||||
takeOverListAdapter?.setData(recordList!!)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
refreshList()
|
||||
}
|
||||
}
|
||||
//获取接管记录列表
|
||||
@@ -198,6 +223,7 @@ class TakeOverRecordView @JvmOverloads constructor(
|
||||
CallerTakeOverManager.updateRecord(context,it)
|
||||
takeOverListAdapter?.notifyRecordItemChanged(it)
|
||||
}
|
||||
selectedUploadRecord.clear()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ class WorkOrderWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
}
|
||||
//取消
|
||||
tvWorkOrderCancel.setOnClickListener {
|
||||
clickListener?.closeWindow()
|
||||
hideFloatWindow()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -356,9 +356,6 @@ class WorkOrderWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY
|
||||
if(((mInScreenX - mInViewX)-mWindowParams!!.x).absoluteValue>150 || ((mInScreenY - mInViewY)-mWindowParams!!.y).absoluteValue>150){
|
||||
return true
|
||||
}
|
||||
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
|
||||
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_960"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_72"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_take_over_record">
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.text.method.ScrollingMovementMethod
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.FrameLayout
|
||||
@@ -35,6 +36,7 @@ class FSMStatusDetailView @JvmOverloads constructor(
|
||||
private fun initView() {
|
||||
tvTitle = findViewById(R.id.tvTitle)
|
||||
tvContent = findViewById(R.id.tvContent)
|
||||
tvContent?.movementMethod = ScrollingMovementMethod.getInstance()
|
||||
}
|
||||
|
||||
fun setFsmMsg(title: String, titleColor: String , content: String) {
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
@@ -26,19 +25,16 @@ import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.mvp.MvpActivity
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoRequestActivityHandler
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiFloatViewManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerRequestActivityHandleManager
|
||||
import com.mogo.eagle.core.function.call.startup.CallerStartUpManager.initStageTwo
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
import com.mogo.eagle.core.function.main.modules.MogoModulesManager
|
||||
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils
|
||||
@@ -49,9 +45,6 @@ import com.mogo.eagle.core.utilcode.mogo.permissions.PermissionsDialogUtils
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.map.listener.IMogoMapListener
|
||||
import com.mogo.map.listener.MogoMapListenerHandler.Companion.mogoMapListenerHandler
|
||||
import com.mogo.map.uicontroller.EnumMapUI
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import kotlinx.android.synthetic.main.module_main_activity_main.module_main_id_cover_up
|
||||
@@ -73,7 +66,8 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
private var isFirst = false
|
||||
private var mConnAdapter: ConnInfoAdapter? = null
|
||||
private val dataList: List<AutopilotStatusInfo> = ArrayList()
|
||||
// private var mLastStatus = AdasConstants.IpcConnectionStatus.CONNECTED
|
||||
|
||||
// private var mLastStatus = AdasConstants.IpcConnectionStatus.CONNECTED
|
||||
private var mLastStatus = AdasConstants.IpcConnectionStatus.DISCONNECTED
|
||||
private var isFloatingLayerHidden = false
|
||||
|
||||
@@ -326,6 +320,10 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
val properties = java.util.HashMap<String, Any>()
|
||||
properties["app_destroy_time"] = System.currentTimeMillis()
|
||||
MogoAnalyticUtils.track("app_lifecycle_destroy", properties)
|
||||
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerRequestActivityHandleManager.removeListener(TAG)
|
||||
//mogoMapListenerHandler.unregisterHostMapListener(TAG)
|
||||
|
||||
@@ -20,6 +20,8 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 默认初始化一些基础服务配置
|
||||
*/
|
||||
@@ -45,6 +47,15 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
initModules();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTerminate() {
|
||||
super.onTerminate();
|
||||
|
||||
HashMap<String, Object> properties = new HashMap<>();
|
||||
properties.put("app_destroy_time", System.currentTimeMillis());
|
||||
MogoAnalyticUtils.INSTANCE.track("app_lifecycle_destroy", properties);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化异常采集配置
|
||||
*/
|
||||
@@ -56,6 +67,11 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
protected void initLogConfig() {
|
||||
// 初始化埋点
|
||||
MogoAnalyticUtils.INSTANCE.init(this, DebugConfig.isDebug());
|
||||
|
||||
HashMap<String, Object> properties = new HashMap<>();
|
||||
properties.put("app_start_time", System.currentTimeMillis());
|
||||
MogoAnalyticUtils.INSTANCE.track("app_lifecycle_start", properties);
|
||||
|
||||
// 初始化DevaTools,开始链路记录
|
||||
CallerDevaToolsManager.INSTANCE.init();
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
android:ellipsize="end"
|
||||
android:gravity="left|center_vertical"
|
||||
android:text=""
|
||||
android:maxLines="5"
|
||||
android:scrollbars="vertical"
|
||||
android:textColor="#D5D5D5"
|
||||
android:textSize="@dimen/dp_28"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
|
||||
@@ -73,7 +73,7 @@ public class RouteOverlayDrawer {
|
||||
List<Integer> alphas = MapTools.INSTANCE.getColorAlpha(temps);
|
||||
if (alphas != null && !alphas.isEmpty()) {
|
||||
for (int i : alphas) {
|
||||
greenWaveColors.add(Color.argb(i, 109,254,208));
|
||||
greenWaveColors.add(Color.argb(i, 48, 163, 255));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ public class RouteOverlayDrawer {
|
||||
if (alphas != null && !alphas.isEmpty()) {
|
||||
colors = new CopyOnWriteArrayList<>();
|
||||
for (int i : alphas) {
|
||||
colors.add(Color.argb(i, 48,203,251));
|
||||
colors.add(Color.argb(i, 48,163,255));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,33 +93,37 @@ object CallerAutoPilotControlManager {
|
||||
*/
|
||||
fun isCanStartAutopilot(isShowTip: Boolean, source: Int = 0): Boolean {
|
||||
/**
|
||||
* 方向盘: 1<<0
|
||||
* 油门 : 1<<1
|
||||
* 刹车: 1<<2
|
||||
* 双闪: 1<<3
|
||||
* 档位: 1<<4
|
||||
* 轨迹下载: (下载中) 1<<5; (下载失败)1<<6
|
||||
* FSM: 1<<0
|
||||
* 方向盘: 1<<1
|
||||
* 油门 : 1<<2
|
||||
* 刹车: 1<<3
|
||||
* 双闪: 1<<4
|
||||
* 档位: 1<<5
|
||||
* 轨迹下载: (下载中) 1<<6; (下载失败)1<<7
|
||||
*/
|
||||
val exceptionValue = CallerDevaToolsManager.getExceptionStatusBeforeLaunchAutopilot(source)
|
||||
if (exceptionValue != 0) {
|
||||
if (isShowTip) {
|
||||
val sb = StringBuilder("请检查车辆")
|
||||
if ((exceptionValue and 1) != 0) {
|
||||
sb.append("FSM$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 1)) != 0) {
|
||||
sb.append("方向盘$")
|
||||
}
|
||||
if (((exceptionValue and (1 shl 1)) != 0)) {
|
||||
if (((exceptionValue and (1 shl 2)) != 0)) {
|
||||
sb.append("油门$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 2)) != 0) {
|
||||
if ((exceptionValue and (1 shl 3)) != 0) {
|
||||
sb.append("刹车$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 3)) != 0) {
|
||||
if ((exceptionValue and (1 shl 4)) != 0) {
|
||||
sb.append("双闪$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 4)) != 0) {
|
||||
if ((exceptionValue and (1 shl 5)) != 0) {
|
||||
sb.append("档位$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 5)) != 0 || ((exceptionValue and (1 shl 6)) != 0)) {
|
||||
if ((exceptionValue and (1 shl 6)) != 0 || ((exceptionValue and (1 shl 7)) != 0)) {
|
||||
if (!sb.contains("$")) {
|
||||
sb.setLength(0)
|
||||
sb.append("轨迹未就绪,请稍后重试")
|
||||
|
||||
@@ -3,5 +3,15 @@
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
|
||||
<application>
|
||||
<meta-data android:name="com.elegant.analytics.AnalyticsConfig.BulkUploadLimit" android:value="100"/>
|
||||
<meta-data android:name="com.elegant.analytics.AnalyticsConfig.FlushInterval" android:value="50000"/>
|
||||
</application>
|
||||
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -8,8 +8,14 @@ import com.elegant.analytics.AnalyticsConfig
|
||||
import com.elegant.analytics.IAnalyticsParamsProvider
|
||||
import com.elegant.analytics.UploadMode
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import org.json.JSONObject
|
||||
|
||||
/**
|
||||
* 埋点&数据统计 管理
|
||||
@@ -22,18 +28,19 @@ object MogoAnalyticUtils {
|
||||
// 1 - debug 近实时上报,积累一条埋点上报,或者积累3秒上报一次。
|
||||
// 2 - 本地缓存,聚合上报,积累30条埋点上报,或者积累60秒上报一次。
|
||||
AnalyticsConfig.getInstance(context).appKey = "0915430e5fdcbb553391f2a35cb8489f"
|
||||
AnalyticsConfig.getInstance(context).uploadMode = if (isDebug) UploadMode.instant else UploadMode.cache
|
||||
AnalyticsConfig.getInstance(context).uploadMode =
|
||||
if (isDebug) UploadMode.instant else UploadMode.cache
|
||||
AnalyticsConfig.getInstance(context).setShouldLog(isDebug)
|
||||
// 设置参数提供者
|
||||
AnalyticsConfig.getInstance(context).paramsProvider = object : IAnalyticsParamsProvider {
|
||||
// 静态参数
|
||||
override fun staticParams(): Map<String, Any> {
|
||||
return getAnalyticsCustomParams(isDebug)
|
||||
override fun staticParams(): Map<String, Any>? {
|
||||
return null
|
||||
}
|
||||
|
||||
//动态参数
|
||||
override fun dynamicParams(): Map<String, Any>? {
|
||||
return null
|
||||
return getAnalyticsCustomParams(isDebug)
|
||||
}
|
||||
}
|
||||
Analytics.getInstance().start(context)
|
||||
@@ -46,6 +53,25 @@ object MogoAnalyticUtils {
|
||||
* @param properties 事件参数
|
||||
*/
|
||||
fun track(event: String?, properties: MutableMap<String, Any>) {
|
||||
try {
|
||||
properties["network_type"] = NetworkUtils.getNetworkType()
|
||||
properties["network_ssid"] = NetworkUtils.getSSID()
|
||||
properties["network_wifi_enabled "] = NetworkUtils.getWifiEnabled()
|
||||
properties["network_is_available"] = NetworkUtils.isAvailable()
|
||||
properties["network_is_available_by_ping"] = NetworkUtils.isAvailableByPing("49.233.99.26")
|
||||
} catch (e: Exception) {
|
||||
properties["network_type"] = "获取设备网络状态错误"
|
||||
}
|
||||
Analytics.getInstance().track(event, properties)
|
||||
}
|
||||
|
||||
/**
|
||||
* 埋点
|
||||
*
|
||||
* @param event 事件名称
|
||||
* @param properties json事件参数
|
||||
*/
|
||||
fun track(event: String?, properties: JSONObject) {
|
||||
Analytics.getInstance().track(event, properties)
|
||||
}
|
||||
|
||||
@@ -58,7 +84,35 @@ object MogoAnalyticUtils {
|
||||
map["debug"] = if (isDebug) 1 else 0
|
||||
map["sn"] = SharedPrefsMgr.getInstance().sn
|
||||
map["app_version"] = AppUtils.getAppVersionName()
|
||||
map["app_version_code"] = AppUtils.getAppVersionCode()
|
||||
|
||||
map["app_identity_mode"] = FunctionBuildConfig.appIdentityMode
|
||||
map["app_build_time"] = AppConfigInfo.appBuildTime
|
||||
map["app_working_branch_hash"] = AppConfigInfo.workingBranchHash
|
||||
map["app_working_branch_name"] = AppConfigInfo.workingBranchName
|
||||
map["app_flavor"] = AppConfigInfo.flavor
|
||||
map["app_net_mode"] = AppConfigInfo.netMode
|
||||
map["app_net_mode_name"] = when (AppConfigInfo.netMode) {
|
||||
2 -> "测试环境"
|
||||
3 -> "生产环境"
|
||||
4 -> "演示环境"
|
||||
else -> {
|
||||
AppConfigInfo.netMode
|
||||
}
|
||||
}
|
||||
map["app_support_business"] = FunctionBuildConfig.supportBusiness
|
||||
|
||||
map["product_type"] =
|
||||
AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode).name
|
||||
map["time"] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
|
||||
// 自动驾驶工控机相关信息
|
||||
map["plate_number"] = AppConfigInfo.plateNumber
|
||||
map["docker_version"] = AppConfigInfo.dockerVersion
|
||||
map["ipc_mac_address"] = AppConfigInfo.iPCMacAddress
|
||||
map["protocol_version_number"] = AppConfigInfo.protocolVersionNumber
|
||||
map["ad_hd_map_version"] = AppConfigInfo.adHdMapVersion
|
||||
map["car_type"] = AppIdentityModeUtils.getCarType(FunctionBuildConfig.appIdentityMode).name
|
||||
|
||||
return map
|
||||
}
|
||||
|
||||
@@ -695,13 +695,15 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "destroyop--MapEngine.unload-start")
|
||||
}
|
||||
mMapEngine.unload()
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "destroyop-mapop-surfaceop----onDetachedFromWindow-over:")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun unloadEngine() {
|
||||
mMapEngine.unload()
|
||||
}
|
||||
|
||||
override fun onSurfaceCreated(gl: GL10, config: EGLConfig) {
|
||||
if (DEBUG) {
|
||||
|
||||
@@ -647,6 +647,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
||||
mTrafficHelper = null
|
||||
mEventController?.exit()
|
||||
mPanelManager = null
|
||||
mMapView?.unloadEngine()
|
||||
mMapView = null
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "destroyop--autoop--onDestroy--removeAllViews-start")
|
||||
|
||||
@@ -87,6 +87,7 @@ public enum MessageType {
|
||||
TYPE_RECEIVE_V2N_NIO_CROSSOVER_EVENT(MessagePad.MessageType.MsgTypeV2nNioCrossoverEvent, "V2N NIO行人横穿(路侧)"),
|
||||
TYPE_RECEIVE_V2N_NIO_OTHER_RETROGRADE_EVENT(MessagePad.MessageType.MsgTypeV2nNioOtherRetrogradeEvent, "V2N NIO他车逆行(路侧)"),
|
||||
TYPE_RECEIVE_V2N_NIO_CONGESTION_EVENT(MessagePad.MessageType.MsgTypeV2nNioCongestionEvent, "V2N NIO拥堵事件"),
|
||||
TYPE_RECEIVE_LANE_MARKS_TRAN(MessagePad.MessageType.MsgTypeLaneMarksTran, "车道线"),
|
||||
//TODO 透传原始pb文件中不存在以下type。由于Java中无法强转,所以在mogo-adas-data/message_pad.proto中放开注释
|
||||
TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态"),
|
||||
TYPE_RECEIVE_SWEEPER_TASK_INDEX_DATA(MessagePad.MessageType.MsgTypeSweeperTaskIndexData, "清扫车指标数据"),
|
||||
|
||||
81
libraries/mogo-adas-data/src/main/proto/lane_mark.proto
Normal file
81
libraries/mogo-adas-data/src/main/proto/lane_mark.proto
Normal file
@@ -0,0 +1,81 @@
|
||||
syntax = "proto2";
|
||||
package perception;
|
||||
|
||||
import "header.proto";
|
||||
import "geometry.proto";
|
||||
|
||||
enum LaneMarkColor {
|
||||
COLOR_WHITE = 0;
|
||||
COLOR_YELLOW = 1;
|
||||
}
|
||||
|
||||
enum LaneMarkType {
|
||||
LANE_MARK_NONE = 0;
|
||||
LANE_MARK_SOLID = 1;
|
||||
LANE_MARK_BROKEN = 2;
|
||||
}
|
||||
|
||||
|
||||
message LaneLineCubicCurve
|
||||
{
|
||||
optional double x_start = 1;
|
||||
optional double x_end = 2;
|
||||
optional double a = 3;
|
||||
optional double b = 4;
|
||||
optional double c = 5;
|
||||
optional double d = 6;
|
||||
} // add by qianlei
|
||||
|
||||
message LaneMark {
|
||||
optional LaneMarkColor color = 1;
|
||||
optional LaneMarkType type = 2;
|
||||
optional float confidence = 3; // valid length / 60.0 meters
|
||||
repeated geometry.Point2D points = 4;
|
||||
optional LaneLineCubicCurve curve_car_coord = 5; // add by qianlei
|
||||
repeated geometry.Point2D curve_image_coord_point_set = 6; // add by qianlei
|
||||
repeated geometry.Point3D curve_car_coord_point_set = 7; // add by qianlei
|
||||
optional int32 track_id = 8;
|
||||
optional int32 frame_lane_line_id = 9;
|
||||
optional int32 color_telematics = 10;
|
||||
optional int32 type_telematics = 11;
|
||||
}
|
||||
|
||||
message LaneCenter {
|
||||
repeated geometry.Point2D points = 1;
|
||||
}
|
||||
|
||||
message RoadSide {
|
||||
optional int32 type = 1;
|
||||
optional int32 frame_roadside_id = 2;
|
||||
repeated geometry.Point2D img_point_set = 3;
|
||||
repeated geometry.Point3D car_coord_point_set = 4;
|
||||
}
|
||||
|
||||
message RoadArrow {
|
||||
optional int32 x = 1;
|
||||
optional int32 y = 2;
|
||||
optional int32 w = 3;
|
||||
optional int32 h = 4;
|
||||
optional int32 type = 5;
|
||||
}
|
||||
|
||||
message LaneMarks {
|
||||
optional common.Header header = 1;
|
||||
|
||||
optional LaneMark left = 2;
|
||||
optional LaneMark right = 3;
|
||||
optional LaneMark left2 = 4;
|
||||
optional LaneMark right2 = 5;
|
||||
repeated LaneMark lanemarks = 6; // add by qianlei
|
||||
optional common.Header header_ros_time_start = 7;
|
||||
optional common.Header header_ros_time_end = 8;
|
||||
repeated RoadSide roadsides = 9;
|
||||
repeated RoadArrow arrows = 10;
|
||||
optional bytes lane_arrow_stopline_crossing_seg = 11;
|
||||
optional bytes fs_rs_seg = 12;
|
||||
optional bytes laneline_inst_seg = 13;
|
||||
optional bool laneline_exist_flag = 14;
|
||||
optional bool arrow_exist_flag = 15;
|
||||
optional bool stopline_exist_flag = 16;
|
||||
optional bool crossing_exist_flag = 17;
|
||||
}
|
||||
@@ -92,6 +92,7 @@ enum MessageType
|
||||
MsgTypeV2nNioCrossoverEvent = 0x10129; //行人横穿(路侧)事件推送, 透传
|
||||
MsgTypeV2nNioOtherRetrogradeEvent = 0x1012a; //他车逆行(路侧)事件推送, 透传
|
||||
MsgTypeV2nNioCongestionEvent = 0x1012b; //拥堵事件推送, 透传
|
||||
MsgTypeLaneMarksTran = 0x1012c;//车道线上传
|
||||
}
|
||||
|
||||
message Header
|
||||
@@ -678,6 +679,7 @@ enum OperatorCmdType
|
||||
OPERATOR_CMD_CHANGE_LANE = 1;
|
||||
OPERATOR_CMD_SET_ACCELERATED_SPEED = 2;
|
||||
OPERATOR_CMD_SET_HORN = 3;
|
||||
OPERATOR_CMD_SEND_LANE_MARKS = 4;
|
||||
}
|
||||
|
||||
message OperatorCmdReq
|
||||
@@ -686,6 +688,7 @@ message OperatorCmdReq
|
||||
double value = 2; //OPERATOR_CMD_CHANGE_LANE: 1: left 2: right
|
||||
//OPERATOR_CMD_SET_ACCELERATED_SPEED: accelerated speed
|
||||
//OPERATOR_CMD_SET_HORN: 1: honk 2: stop honking
|
||||
//OPERATOR_CMD_SEND_LANE_MARKS 0: 开始发送车道线 1:结束发送车道线
|
||||
}
|
||||
|
||||
//message definition for MsgTypePlanningDecisionState
|
||||
|
||||
@@ -2177,6 +2177,26 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
return sendOperatorCmdSetHorn(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 车道线
|
||||
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck
|
||||
*
|
||||
* @param value 0: 开始发送车道线 1:结束发送车道线
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
@Override
|
||||
public long sendOperatorCmdSendLaneMarks(double value) {
|
||||
MessagePad.OperatorCmdReq req = MessagePad.OperatorCmdReq
|
||||
.newBuilder()
|
||||
.setCmdType(MessagePad.OperatorCmdType.OPERATOR_CMD_SEND_LANE_MARKS)
|
||||
.setValue(value)
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_OPERATOR_CMD_REQ, req.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置参数命令
|
||||
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck
|
||||
|
||||
@@ -1218,6 +1218,21 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel == null ? -1L : mChannel.sendOperatorCmdStopHonking();
|
||||
}
|
||||
|
||||
/**
|
||||
* 车道线
|
||||
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck
|
||||
*
|
||||
* @param value 0: 开始发送车道线 1:结束发送车道线
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
@Override
|
||||
public long sendOperatorCmdSendLaneMarks(double value) {
|
||||
return mChannel == null ? -1L : mChannel.sendOperatorCmdSendLaneMarks(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绕障类功能开关
|
||||
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck
|
||||
|
||||
@@ -800,6 +800,18 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
long sendOperatorCmdStopHonking();
|
||||
|
||||
/**
|
||||
* 车道线
|
||||
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL},详情参见CheckSystemView中的onReceiveReceivedAck
|
||||
*
|
||||
* @param value 0: 开始发送车道线 1:结束发送车道线
|
||||
* @return 消息是否添加到WS消息发送队列,返回值为非0的正整数时表示下发消息的消息ID
|
||||
* * >=0:表示添加到WS发送消息队列
|
||||
* * =0:表示乘客屏模式添加到WS发送消息队列
|
||||
* * -1L:添加到WS发送消息队列失败
|
||||
*/
|
||||
long sendOperatorCmdSendLaneMarks(double value);
|
||||
|
||||
/*******************************设置参数命令 包括V1************************************/
|
||||
/**
|
||||
* 绕障类功能开关
|
||||
|
||||
@@ -40,6 +40,7 @@ import mogo.v2x.RoadOverviewEvents;
|
||||
import mogo.yycp.paralleldriving.protocol.ParallelTaskProcessNoticeOuterClass;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import perception.FusionTrafficLightOuterClass;
|
||||
import perception.LaneMarkOuterClass;
|
||||
import planning.RoboSweeperTaskIndexOuterClass;
|
||||
import prediction.Prediction;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
@@ -534,6 +535,14 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onV2nNioCongestionEvent(@NonNull MessagePad.Header header, @NonNull MessagePad.V2nCongestion congestion);
|
||||
|
||||
/**
|
||||
* 车道线
|
||||
*
|
||||
* @param header 头
|
||||
* @param laneMarks 数据
|
||||
*/
|
||||
void onLaneMarksTran(@NonNull MessagePad.Header header, @NonNull LaneMarkOuterClass.LaneMarks laneMarks);
|
||||
|
||||
/**
|
||||
* 所连接的域控的节点状态信息
|
||||
* 目前包含状态 节点是否存在;节点是否超时;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.AdasChannel;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import perception.LaneMarkOuterClass;
|
||||
|
||||
/**
|
||||
* 车道线
|
||||
*/
|
||||
public class LaneMarksTranMessage extends MyAbstractMessageHandler {
|
||||
|
||||
public LaneMarksTranMessage() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
LaneMarkOuterClass.LaneMarks laneMarks = LaneMarkOuterClass.LaneMarks.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("车道线", raw.receiveTime);
|
||||
long nowTime = 0;
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
adasListener.onLaneMarksTran(raw.getHeader(), laneMarks);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("车道线", nowTime);
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,7 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg v2nNioCrossoverEventMessage;//V2N NIO行人横穿(路侧)
|
||||
private IMsg v2nNioOtherRetrogradeEventMessage;//V2N NIO他车逆行(路侧)
|
||||
private IMsg v2nNioCongestionEventMessage;//V2N NIO拥堵事件
|
||||
private IMsg laneMarksTranMessage;//车道线
|
||||
|
||||
private final AutopilotReview autopilotReview;
|
||||
private final TurnLightState lightLeft = new TurnLightState();
|
||||
@@ -296,6 +297,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
v2nNioCongestionEventMessage = new V2nNioCongestionEventMessage();
|
||||
}
|
||||
return v2nNioCongestionEventMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_LANE_MARKS_TRAN.typeCode) {
|
||||
//车道线
|
||||
if (laneMarksTranMessage == null) {
|
||||
laneMarksTranMessage = new LaneMarksTranMessage();
|
||||
}
|
||||
return laneMarksTranMessage;
|
||||
} else {
|
||||
//MessageType.TYPE_DEFAULT.typeCode
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user