Merge branch 'merge_6.2.9_master' into 'master'

Merge 6.2.9 master

See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!859
This commit is contained in:
yangyakun
2024-02-06 10:44:07 +00:00
49 changed files with 673 additions and 430 deletions

View File

@@ -193,42 +193,46 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
d(SceneConstant.M_TAXI + TAG, "没有点")
return
}
texIndexList.clear()
val allPoints = ArrayList(routeArrived)
for (i in routeArrived.indices) {
if (routeArrived.size > 1 && i < routeArrived.size - 1) {
texIndexList.add(0)
try {
texIndexList.clear()
val allPoints = ArrayList(routeArrived)
for (i in routeArrived.indices) {
if (routeArrived.size > 1 && i < routeArrived.size - 1) {
texIndexList.add(0)
}
}
texIndexList.add(0)
location?.let {
allPoints.add(LatLng(it.latitude, it.longitude))
}
allPoints.addAll(routeArriving)
for (ignored in routeArrived) {
texIndexList.add(1)
}
mPolyline?.let {
it.points = allPoints
it.options.customTextureIndex = texIndexList
return
}
if(textureList.isEmpty()) {
textureList.add(mArrivedRes)
textureList.add(mUnArrivedRes)
}
//设置线段纹理
val polylineOptions = PolylineOptions().apply {
addAll(allPoints)
isUseTexture = true
width(15f)
lineCapType(PolylineOptions.LineCapType.LineCapRound)
customTextureList = textureList
customTextureIndex = texIndexList
}
}
texIndexList.add(0)
location?.let {
allPoints.add(LatLng(it.latitude, it.longitude))
}
allPoints.addAll(routeArriving)
for (ignored in routeArrived) {
texIndexList.add(1)
}
mPolyline?.let {
it.points = allPoints
it.options.customTextureIndex = texIndexList
return
}
if(textureList.isEmpty()) {
textureList.add(mArrivedRes)
textureList.add(mUnArrivedRes)
}
//设置线段纹理
val polylineOptions = PolylineOptions().apply {
addAll(allPoints)
isUseTexture = true
width(15f)
lineCapType(PolylineOptions.LineCapType.LineCapRound)
customTextureList = textureList
customTextureIndex = texIndexList
}
// 绘制线
mPolyline = mAMap.addPolyline(polylineOptions)
// 绘制线
mPolyline = mAMap.addPolyline(polylineOptions)
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun clearPolyline() {

View File

@@ -17,6 +17,7 @@ data class SiteInfoResponse(val data: List<SiteInfo>?) : BaseData(){
val Wgs84Lat: Double?,//高精坐标
val GcjLon: Double?,//高德坐标
val GcjLat: Double?,//高德坐标
val introduction: String?,//站点介绍
val seq: Double?,
val type: Int?,
var isNear:Boolean=false,

View File

@@ -23,7 +23,8 @@ class CharterPassengerConst {
// 到达起始点围栏
const val ARRIVE_AT_START_STATION_DISTANCE = 15 //围栏由20m改为50m 再次改为15m
const val ARRIVE_SOON_AT_START_STATION_DISTANCE = 100 //100米提示
const val ARRIVE_SOON_AT_START_STATION_DISTANCE = 50 //100米提示
const val ARRIVE_DISTANCE_4_STATION_INTRODUCE = 200 //站点介绍
const val MIN_DISTANCE_STATION = 30 //站点选择小于30m 不能选
}

View File

@@ -111,7 +111,8 @@ object CharterPassengerModel {
// 到站仅一次
private val endKey = "arrivedLine"
private val endKeyRequestIng = "arrivedLineRequestIng"
private val ending100Key = "arrivingLine"
private val ending50Key = "arrivingLine"
private val ending200Key = "palyStationInfo"
private val min5Speak = "min5Speak"
private var carTypeChageListener: IOrderChangeCallback? = null
@@ -421,9 +422,13 @@ object CharterPassengerModel {
checkArriveDesk(currentInfo)
}
if (calculateLineDistance < CharterPassengerConst.ARRIVE_SOON_AT_START_STATION_DISTANCE && calculateLineDistance > 0) {
d(M_BUS_P + TAG, "小于100米到站")
d(M_BUS_P + TAG, "小于50米到站")
arriveDestSoon()
}
if (calculateLineDistance < CharterPassengerConst.ARRIVE_DISTANCE_4_STATION_INTRODUCE && calculateLineDistance > 0) {
d(M_BUS_P + TAG, "小于200米到站")
playSiteInfomation()
}
}
}
// 启动时间校准
@@ -448,7 +453,8 @@ object CharterPassengerModel {
GcjLat = null,
GcjLon = null,
seq = null,
type = null
type = null,
introduction = "简介"
)
return Pair(lineInfo, targetSizt)
}
@@ -713,8 +719,14 @@ object CharterPassengerModel {
M_BUS_P + "calculateDistance",
"最终信息:lastSumLength: ${lastSumLength}lastTime : $lastTime thread = ${Thread.currentThread().name}"
)
if (lastSumLength < CharterPassengerConst.ARRIVE_DISTANCE_4_STATION_INTRODUCE && lastSumLength > 0) {
d(M_BUS_P + TAG, "小于200米到站")
playSiteInfomation()
}
if (lastSumLength < CharterPassengerConst.ARRIVE_SOON_AT_START_STATION_DISTANCE && lastSumLength > 0) {
d(M_BUS_P + TAG, "小于100米到站2")
d(M_BUS_P + TAG, "小于50米到站2")
arriveDestSoon()
}
if (lastSumLength < CharterPassengerConst.ARRIVE_AT_START_STATION_DISTANCE && lastSumLength > 0) {
@@ -1018,16 +1030,65 @@ object CharterPassengerModel {
return Triple(null, null, null)
}
@Synchronized
fun playSiteInfomation() {
orderInfo?.let { order ->
order.lineId?.let { lineId ->
order.siteId?.let { siteId ->
if (order.arriveStatus == OrderInfoResponse.ARRIVING) {
if (isSuccess("${siteId}$ending200Key")) {
broadcastList["${siteId}$ending50Key"] = true
getSiteInfo2Play(lineId,siteId,1)
}
}
}
}
}
}
private fun getSiteInfo2Play(lineId: Long, siteId: Long, size: Int) {
if(size>3){
return
}
BusPassengerServiceManager.queryLineSiteList(mContext,"$lineId",object :OchCommonServiceCallback<SiteInfoResponse>{
override fun onSuccess(data: SiteInfoResponse?) {
data?.data?.forEach {
if (it.siteId==siteId) {
if (!StringUtils.isEmpty(it.introduction)) {
VoiceNotice.showNotice(it.introduction)
}
return
}
}
}
override fun onFail(code: Int, msg: String?) {
getSiteInfo2Play(lineId,siteId,size+1)
}
override fun onError() {
super.onError()
getSiteInfo2Play(lineId,siteId,size+1)
}
override fun onError(msg: String?) {
super.onError(msg)
getSiteInfo2Play(lineId,siteId,size+1)
}
})
}
@Synchronized
fun arriveDestSoon() {
orderInfo?.let { order ->
order.siteId?.let { siteId ->
if (order.arriveStatus == OrderInfoResponse.ARRIVING) {
if (isSuccess("${siteId}$ending100Key")) {
if (isSuccess("${siteId}$ending50Key")) {
val string =
mContext.getString(R.string.charter_p_arrived_station_left_100, order.siteName)
VoiceNotice.showNotice(string)
broadcastList["${siteId}$ending100Key"] = true
broadcastList["${siteId}$ending50Key"] = true
}
}
}

View File

@@ -163,12 +163,8 @@ class MainFragment : MvpFragment<MainFragment?, BusPassengerPresenter?>(), IMogo
}
aciv_map_2_default.setOnClickListener {
omvOverMap.displayCustomOverView()
val controller = getMapUIController()
if (controller != null) {
//切换到地图中间
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
// 切换缩放到中视角
controller.changeZoom2(0.8f)
mapBizView.getUI()?.let {
it.changeMapVisualAngle(it.getVrAngleDefaultMode(), null)
}
}
MogoMapListenerHandler.mogoMapListenerHandler.registerHostMapListener(TAG, this)

View File

@@ -91,10 +91,10 @@ class GoViewWithArrive @JvmOverloads constructor(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
// 重新起步
StopSideManager.resetStopSide()
CharterPassengerModel.leaveStation()
ToastCharterUtils.showToastShort("车辆行驶中,不要频繁点击哦~")
}
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
ToastCharterUtils.showToastShort("安全守护中,无需操作")
ToastCharterUtils.showToastShort("车辆行驶中,不要频繁点击哦")
}
else -> {}
}

View File

@@ -52,7 +52,7 @@ object LockManager {
fun reStartCountDown(){
CallerLogger.d(TAG,"重置时间")
handler?.removeMessages(1)
handler?.sendEmptyMessageDelayed(1,120_000)
handler?.sendEmptyMessageDelayed(1,60_000)
}
@Synchronized

View File

@@ -0,0 +1,57 @@
package com.mogo.och.charter.passenger.ui.map
import android.content.Context
import android.os.Bundle
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.MotionEvent
import android.widget.FrameLayout
import com.mogo.eagle.core.function.view.MapBizView
import com.mogo.map.uicontroller.IMogoMapUIController
import com.mogo.och.charter.passenger.R
class BizMapView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : FrameLayout(context, attrs, defStyleAttr) {
private lateinit var mapBizView: MapBizView
init {
LayoutInflater.from(context).inflate(R.layout.charter_p_bizmap, this, true)
mapBizView = findViewById(R.id.bizMapView)
}
override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean {
return true
}
fun getUI(): IMogoMapUIController? {
return mapBizView.getUI()
}
fun onCreate(bundle: Bundle?) {
mapBizView.onCreate(bundle)
}
fun onResume() {
mapBizView.onResume()
}
fun onSaveInstanceState(outState: Bundle){
mapBizView.onSaveInstanceState(outState)
}
fun onLowMemory() {
mapBizView.onLowMemory()
}
fun onPause() {
mapBizView.onPause()
}
fun onDestroy() {
mapBizView.onDestroy()
}
}

View File

@@ -383,11 +383,11 @@ class SoftControlView : ConstraintLayout, SoftControlViewModel.SoftControlCallba
override fun setLightTop1View(leftLight: Boolean, isFirst: Boolean) {
tv_light_top_01?.let {
if (leftLight) {
tv_light_top_01.text = context.getString(R.string.charter_p_close_light1)
tv_light_top_01.text = context.getString(R.string.charter_p_open_light1)
tv_light_top_01.isChecked = true
if (!isFirst) ToastCharterUtils.showToastShort("打开顶灯1")
} else {
tv_light_top_01.text = context.getString(R.string.charter_p_open_light1)
tv_light_top_01.text = context.getString(R.string.charter_p_close_light1)
tv_light_top_01.isChecked = false
if (!isFirst) ToastCharterUtils.showToastShort("关闭顶灯1")
}
@@ -397,11 +397,11 @@ class SoftControlView : ConstraintLayout, SoftControlViewModel.SoftControlCallba
override fun setLightTop2View(rightLight: Boolean, isFirst: Boolean) {
tv_light_top_02?.let {
if (rightLight) {
tv_light_top_02.text = context.getString(R.string.charter_p__close_light2)
tv_light_top_02.text = context.getString(R.string.charter_p_open_light2)
tv_light_top_02.isChecked = true
if (!isFirst) ToastCharterUtils.showToastShort("打开顶灯2")
} else {
tv_light_top_02.text = context.getString(R.string.charter_p_open_light2)
tv_light_top_02.text = context.getString(R.string.charter_p__close_light2)
tv_light_top_02.isChecked = false
if (!isFirst) ToastCharterUtils.showToastShort("关闭顶灯2")
}
@@ -411,12 +411,12 @@ class SoftControlView : ConstraintLayout, SoftControlViewModel.SoftControlCallba
override fun setLightAtmosphereView(atmosphereLight: Boolean, isFirst: Boolean) {
tv_light_atmosphere?.let {
if (atmosphereLight) {
tv_light_atmosphere.text = context.getString(R.string.charter_p_close_atmosphere)
tv_light_atmosphere.text = context.getString(R.string.charter_p_open_atmosphere)
tv_light_atmosphere.isChecked = true
iv_bottom_light_setting.setImageResource(R.drawable.charter_p_function_atmosphere_select)
if (!isFirst) ToastCharterUtils.showToastShort("打开氛围灯")
} else {
tv_light_atmosphere.text = context.getString(R.string.charter_p_open_atmosphere)
tv_light_atmosphere.text = context.getString(R.string.charter_p_close_atmosphere)
tv_light_atmosphere.isChecked = false
iv_bottom_light_setting.setImageResource(R.drawable.charter_p_function_atmosphere_nor)
if (!isFirst) ToastCharterUtils.showToastShort("关闭氛围灯")

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:parentTag="FrameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mogo.eagle.core.function.view.MapBizView
android:id="@+id/bizMapView"
app:styleMode="MAP_STYLE_DAY_VR"
app:isWeatherEnable="false"
app:locationIcon3DRes="@raw/m1"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</merge>

View File

@@ -4,13 +4,10 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mogo.eagle.core.function.view.MapBizView
<com.mogo.och.charter.passenger.ui.map.BizMapView
android:id="@+id/mapBizView"
android:layout_width="0dp"
app:layout_constraintWidth_percent="0.6045"
app:styleMode="MAP_STYLE_DAY_VR"
app:isWeatherEnable="false"
app:locationIcon3DRes="@raw/m1"
android:layout_height="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@@ -13,13 +13,13 @@
<string name="charter_p_wind_speed_high"></string>
<string name="charter_p_close_light1">关闭顶灯1</string>
<string name="charter_p__close_light2">关闭顶灯2</string>
<string name="charter_p_close_atmosphere">关闭氛围灯</string>
<string name="charter_p_close_light1">开启顶灯1</string>
<string name="charter_p__close_light2">开启顶灯2</string>
<string name="charter_p_close_atmosphere">开启氛围灯</string>
<string name="charter_p_open_light1">开启顶灯1</string>
<string name="charter_p_open_light2">开启顶灯2</string>
<string name="charter_p_open_atmosphere">开启氛围灯</string>
<string name="charter_p_open_light1">关闭顶灯1</string>
<string name="charter_p_open_light2">关闭顶灯2</string>
<string name="charter_p_open_atmosphere">关闭氛围灯</string>
<string name="charter_p_speed_unit">KM/h</string>

View File

@@ -18,6 +18,8 @@ public class BusStationBean {
private double lat; //高精坐标
private int drivingStatus;//行驶信息0初始值1已经过2当前站3未到站
private boolean leaving;
private String introduction;// 站点简介
private boolean isPlayTts;
public String getNameKr() {
return nameKr;
@@ -95,6 +97,22 @@ public class BusStationBean {
this.leaving = leaving;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public boolean isPlayTts() {
return isPlayTts;
}
public void setPlayTts(boolean playTts) {
isPlayTts = playTts;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;

View File

@@ -0,0 +1,15 @@
package com.mogo.och.bus.bean;
import com.mogo.eagle.core.data.BaseData;
import java.util.List;
/**
* @author: wangmingjun
* @date: 2022/2/9
*/
public class WriteOffCountResponse extends BaseData {
public Integer data;
}

View File

@@ -8,8 +8,6 @@ import com.mogo.eagle.core.data.map.MogoLocation;
* Model->Presenter回调状态控制器监听accOn、adas ui show、voice ui show、push ui show、v2x ui show等等
*/
public interface IBusControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MogoLocation location);
//开始开启自动驾驶

View File

@@ -1,11 +0,0 @@
package com.mogo.och.bus.callback;
import com.mogo.och.bus.bean.WriteOffPassenger;
/**
* @author: wangmingjun
* @date: 2022/9/26
*/
public interface IPassengerCallback {
void playPassenger(WriteOffPassenger passenger);
}

View File

@@ -464,17 +464,6 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
smallMapView.clearPolyline();
}
/**
* VR模式切换
*
* @param isVRMode
*/
public void onVRModeChanged(boolean isVRMode) {
if (mRootView != null) {
mRootView.setVisibility(isVRMode ? View.VISIBLE : View.GONE);
}
}
/**
* 绘制地图起点终点
*

View File

@@ -6,28 +6,17 @@ import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_ARRIVING;
import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_STOPPED;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.amap.api.maps.model.LatLng;
import com.elegant.network.utils.GsonUtil;
import com.mogo.aicloud.services.socket.IMogoOnMessageListener;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.msgbox.MsgBoxBean;
import com.mogo.eagle.core.data.msgbox.MsgBoxType;
import com.mogo.eagle.core.data.msgbox.V2XMsg;
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager;
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.module.status.IMogoStatusChangedListener;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.module.status.StatusDescriptor;
import com.mogo.eagle.core.data.BaseData;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
@@ -38,19 +27,15 @@ import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg;
import com.mogo.och.common.module.bean.dpmsg.DPMsgType;
import com.mogo.och.common.module.bean.dpmsg.LoginCacheStatus;
import com.mogo.och.common.module.bean.dpmsg.TaskDetailsMsg;
import com.mogo.och.common.module.bean.dpmsg.WriteOffDevicesMsg;
import com.mogo.och.common.module.bean.dpmsg.WriteOffMsg;
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
import com.mogo.och.data.bean.BusStationBean;
import com.mogo.och.common.module.biz.common.socketmessage.data.SystemMsg;
import com.mogo.och.common.module.biz.constant.OchCommonConst;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.GsonUtils;
@@ -58,12 +43,9 @@ import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.bus.R;
import com.mogo.och.bus.bean.BusRoutePlanningUpdateReqBean;
import com.mogo.och.data.bean.BusRoutesResult;
import com.mogo.och.bus.bean.WriteOffPassenger;
import com.mogo.och.bus.callback.IBusADASStatusCallback;
import com.mogo.och.bus.callback.IBusControllerStatusCallback;
import com.mogo.och.bus.callback.IPassengerCallback;
import com.mogo.och.bus.callback.IRefreshBusStationsCallback;
import com.mogo.och.bus.callback.ISlidePannelHideCallback;
import com.mogo.och.bus.constant.BusConst;
@@ -77,7 +59,6 @@ import com.mogo.och.common.module.biz.provider.LoginService;
import com.mogo.och.common.module.callback.OchAdasStartFailureCallback;
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager;
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
import com.mogo.och.common.module.utils.DateTimeUtil;
import com.mogo.och.common.module.utils.NumberFormatUtil;
import com.mogo.och.common.module.utils.PinYinUtil;
@@ -106,13 +87,8 @@ import mogo.telematics.pad.MessagePad;
*/
public class OrderModel {
private final String TAG = OrderModel.class.getSimpleName();
private int currentLineId = -1;
private int currentTaskId = -1;
private int backgroundCurrentStationIndex = 0;//A->B 此处值是A站点索引
private static volatile OrderModel sInstance;
public double mLongitude = 0;
public double mLatitude = 0;
private Context mContext;
private final List<BusStationBean> stationList = new ArrayList<>();
private BusRoutesResult busRoutesResult = null;
@@ -122,17 +98,12 @@ public class OrderModel {
private boolean isGoingToNextStation = false;
// 运营类型
private static final int VEHICLE_TYPE = 10;
private static final int MSG_QUERY_BUS_STATION = 1001;
private static final long QUERY_BUS_STATION_DELAY = 5000;
private IRefreshBusStationsCallback refreshBusStationsCallback;
private ISlidePannelHideCallback slidePanelHideCallback;
private IBusControllerStatusCallback mControllerStatusCallback; //Model->PresenterVR mode等
private IPassengerCallback mPassengerCallback; //乘客核销回调
private IBusADASStatusCallback mADASStatusCallback;
List<BusRoutePlanningUpdateReqBean.Result> points = new ArrayList<>();//全路径信息
private volatile boolean isArrivedStation = false;
//0: 代表没有启动过 1代表是启动第一次当>=1 代表是重试 每次到站/路线结束清空置为0
@@ -140,17 +111,6 @@ public class OrderModel {
private LoginService loginService;
private final Handler handler = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
if (msg.what == MSG_QUERY_BUS_STATION) {
queryBusRoutes();
return true;
}
return false;
}
});
public static OrderModel getInstance() {
if (sInstance == null) {
synchronized (OrderModel.class) {
@@ -172,11 +132,6 @@ public class OrderModel {
// 定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,10,mMapLocationListener);
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
//自动驾驶路线规划接口
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
//开启自驾后 异常信息返回
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener);
@@ -184,9 +139,6 @@ public class OrderModel {
OCHSocketMessageManager.msgMonitorType,
mMogoOnMessageListener);
// OCHSocketMessageManager.INSTANCE.registerSocketMessageListener(//监听核销乘客
// OCHSocketMessageManager.msgWriteOffPassengerType,
// mWriteOffPassengeOnMessageListener);
TicketModel.INSTANCE.load();
AbnormalFactorsLoopManager.INSTANCE.startLoopAbnormalFactors(mContext);
@@ -289,24 +241,6 @@ public class OrderModel {
}
};
// private final IMogoOnMessageListener<WriteOffPassenger> mWriteOffPassengeOnMessageListener =
// new IMogoOnMessageListener<WriteOffPassenger>() {
// @Override
// public Class<WriteOffPassenger> target() {
// return WriteOffPassenger.class;
// }
//
// @Override
// public void onMsgReceived(WriteOffPassenger passenger) {
// //进行播报
// CallerLogger.i(M_BUS + TAG,"passenger = "+ GsonUtil.jsonFromObject(passenger));
// if (passenger != null && passenger.passengerSize == 0) return;
// if (mPassengerCallback != null){
// mPassengerCallback.playPassenger(passenger);
// }
// }
// };
public void setAdasStatusCallback(IBusADASStatusCallback callback){
this.mADASStatusCallback = callback;
}
@@ -315,10 +249,6 @@ public class OrderModel {
this.refreshBusStationsCallback = callback;
}
public void setPassengerCallback(IPassengerCallback callback) {
this.mPassengerCallback = callback;
}
public void setSlidePanelHideCallback(ISlidePannelHideCallback callback) {
this.slidePanelHideCallback = callback;
}
@@ -327,44 +257,11 @@ public class OrderModel {
this.mControllerStatusCallback = callback;
}
private final IMoGoPlanningRottingListener moGoAutopilotPlanningListener = new IMoGoPlanningRottingListener() {
@Override
public void onAutopilotRotting(MessagePad.GlobalPathResp routeList) {
if (null != routeList && routeList.getWayPointsList().size() > 0) {
points.clear();
points.addAll(coordinateConverterWgsToGcjList(mContext, routeList.getWayPointsList()));
}
}
};
public static List<BusRoutePlanningUpdateReqBean.Result> coordinateConverterWgsToGcjList(Context mContext, List<MessagePad.Location> mogoLatLngList) {
List<BusRoutePlanningUpdateReqBean.Result> points = new ArrayList<>();
for (MessagePad.Location m : mogoLatLngList) {
LatLng mogoLatLng = CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(mContext, m);
BusRoutePlanningUpdateReqBean.Result result = new BusRoutePlanningUpdateReqBean.Result();
result.latitude = mogoLatLng.latitude;
result.longitude = mogoLatLng.longitude;
points.add(result);
}
return points;
}
public void debugUpdateOrderRoute(List<MessagePad.Location> list) {
points.clear();
points.addAll(coordinateConverterWgsToGcjList(mContext, list));
}
public void release() {
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
// 注销定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
//自动驾驶路线规划接口
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
loginService = null;
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null);
@@ -384,18 +281,6 @@ public class OrderModel {
return sInstance;
}
private final IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() {
// VR mode变更回调
@Override
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
if (StatusDescriptor.VR_MODE == descriptor) {
if (mControllerStatusCallback != null) {
mControllerStatusCallback.onVRModeChanged(isTrue);
}
}
}
};
private final OchAdasStartFailureCallback mAdasStartFailureListener = new OchAdasStartFailureCallback() {
@Override
public void brakeStatusChanged(boolean isBrakeAvailable) {
@@ -418,8 +303,6 @@ public class OrderModel {
@Override
public void onChassisLocationGCJ02(@Nullable MogoLocation mogoLocation) {
if (null == mogoLocation) return;
mLongitude = mogoLocation.getLongitude();
mLatitude = mogoLocation.getLatitude();
if (mControllerStatusCallback != null) {
mControllerStatusCallback.onCarLocationChanged(mogoLocation);
}
@@ -450,7 +333,6 @@ public class OrderModel {
CallerLogger.d(M_BUS + TAG, "行程日志-judgeArrivedStation() distance = " + distance
+ " to " + upcomingStation.getName());
onArriveAt(null); //无自动驾驶到站信息传null
return;
}
}
@@ -605,7 +487,7 @@ public class OrderModel {
*/
public void abortTask() {
CallerLogger.d(M_BUS + TAG, "结束当前路线abortTask");
OrderServiceManager.abortTask(mContext, currentTaskId
OrderServiceManager.abortTask(mContext, busRoutesResult.getTaskId()
, new OchCommonServiceCallback<BaseData>() {
@Override
public void onSuccess(BaseData o) {
@@ -617,7 +499,6 @@ public class OrderModel {
removeTipRunnables();
// 取消自驾
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
// startOrStopQueryPassengerWriteOff(false);
}
}
@@ -788,41 +669,19 @@ public class OrderModel {
OrderServiceManager.arriveSiteStation(mContext,
stationList.get(arrivedStationIndex).getSeq(),
stationList.get(arrivedStationIndex).getSiteId(),
currentTaskId,writeVersion,
busRoutesResult.getTaskId(),writeVersion,
new OchCommonServiceCallback<BaseData>() {
@Override
public void onSuccess(BaseData o) {
CallerLogger.d(M_BUS + TAG, "行程日志-arriveSiteStation success");
// if (o != null && o.code == 0){
// queryBusRoutes();
// isArrivedStation = true;
// isGoingToNextStation = false;
// arriveStationSuccess(arrivedStationIndex, departureStopName,
// arriveStation,arriveStationKr);
// }
//5s轮询核销乘客
// startOrStopQueryPassengerWriteOff(true);
}
@Override
public void onError() {
// if (!NetworkUtils.isConnected(mContext)) {
// ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
// } else {
// ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
// }
}
@Override
public void onFail(int code, String failMsg) {
// if (ToastUtilsOch.isCustomFastClick(5000)) {
// if (!NetworkUtils.isConnected(mContext)) {
// ToastUtils.showShort("网络异常,请稍后重试");
// } else {
// if (isArrivedStation) return;
// ToastUtils.showShort(failMsg);
// }
// }
}
});
}
@@ -925,36 +784,19 @@ public class OrderModel {
OrderServiceManager.leaveStation(mContext,
stationList.get(backgroundCurrentStationIndex).getSeq(),
stationList.get(backgroundCurrentStationIndex).getSiteId(),
currentTaskId,writeVersion,
busRoutesResult.getTaskId(),writeVersion,
new OchCommonServiceCallback<BaseData>() {
@Override
public void onSuccess(BaseData o) {
// isArrivedStation = false;
// CallerLogger.d(M_BUS + TAG, "行程日志-离站成功开往下一站====");
// //需要更改当前站和下一站的状态 然后渲染
// //startOrStopQueryPassengerWriteOff(false);
// queryBusRoutes();
// leaveStationSuccess(backgroundCurrentStationIndex, currentStationName,
// finalNextStationName,finalNextStationNameKr);
}
@Override
public void onError() {
// if (!NetworkUtils.isConnected(mContext)) {
// ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
// } else {
// ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
// }
}
@Override
public void onFail(int code, String failMsg) {
// if (!NetworkUtils.isConnected(mContext)) {
// ToastUtils.showShort("网络异常,请稍后重试");
// } else {
// ToastUtils.showShort("离站上报失败:" + failMsg);
// }
}
});
}
@@ -1004,12 +846,8 @@ public class OrderModel {
private void updateBusStatus(BusRoutesResult result) {
if (result == null) return;
busRoutesResult = result;
List<BusStationBean> site = result.getSites();
currentTaskId = result.getTaskId();
currentLineId = result.getLineId();
stationList.clear();
stationList.addAll(site);
stationList.addAll(result.getSites());
for (int i = 0; i < stationList.size(); i++) {
BusStationBean s = stationList.get(i);
@@ -1039,7 +877,6 @@ public class OrderModel {
if (busRoutesResult != null){
beforeTaskTips();
}
// startOrStopQueryPassengerWriteOff(true);
}else {
removeTipRunnables();
}
@@ -1162,13 +999,6 @@ public class OrderModel {
}
}
/**
* 延时查询站点信心
*/
private void queryBusStationDelay() {
handler.sendEmptyMessageDelayed(MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY);
}
/**
* 在踩刹车、控制方向盘等操作后,会停止自动驾驶,重启自动驾驶的话相当于重新设置自动驾驶目的地
*/
@@ -1202,7 +1032,7 @@ public class OrderModel {
*/
private void endTask() {
CallerLogger.d(M_BUS + TAG, "任务正常走完endTask()");
OrderServiceManager.endTask(mContext, currentTaskId
OrderServiceManager.endTask(mContext, busRoutesResult.getTaskId()
, new OchCommonServiceCallback<BaseData>() {
@Override
public void onSuccess(BaseData o) {
@@ -1212,7 +1042,6 @@ public class OrderModel {
clearBusStationDatas();
queryBusRoutes();// 重新获取任务
removeTipRunnables();
// startOrStopQueryPassengerWriteOff(false);
VoiceManager.INSTANCE.endOrderBus();
sendEndTaskToClient();
}
@@ -1281,7 +1110,8 @@ public class OrderModel {
// 登出
public void logout() {
loginService.loginOut(mLatitude, mLongitude);
MogoLocation gcj02 = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02();
loginService.loginOut(gcj02.getLatitude(), gcj02.getLongitude());
}
public void triggerStartServiceEvent(boolean isRestart, boolean send) {
@@ -1291,7 +1121,7 @@ public class OrderModel {
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
BusAnalyticsManager.getInstance().triggerStartAutopilotEvent(isRestart, send,
currentStation.getName(), nextStation.getName(), currentLineId);
currentStation.getName(), nextStation.getName(), busRoutesResult.getLineId());
}
public void triggerUnableStartAPReasonEvent() {
@@ -1301,7 +1131,7 @@ public class OrderModel {
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
BusAnalyticsManager.getInstance().triggerUnableStartAPReasonEvent(
currentStation.getName(), nextStation.getName(), currentLineId,
currentStation.getName(), nextStation.getName(), busRoutesResult.getLineId(),
OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason());
}
@@ -1309,6 +1139,14 @@ public class OrderModel {
return busRoutesResult;
}
public BusStationBean getBusNextStation() {
// A->B 的过程中A站点的信息
if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) {
return null;
}
return stationList.get(backgroundCurrentStationIndex);
}
public int getCurrentStationIndex() {
return backgroundCurrentStationIndex;
}
@@ -1376,12 +1214,4 @@ public class OrderModel {
return parameters;
}
//接驳车不需要实现
public void startOrStopOrderLoop(boolean start) {
}
// //接驳车不需要实现
public void runCarHeartbeat() {
}
}

View File

@@ -2,6 +2,7 @@ package com.mogo.och.bus.model
import com.elegant.network.utils.GsonUtil
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
@@ -14,19 +15,34 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.och.bus.bean.WriteOffCountResponse
import com.mogo.och.bus.bean.WriteOffPassenger
import com.mogo.och.bus.net.OrderServiceManager
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
import com.mogo.och.common.module.bean.dpmsg.WriteOffDevicesMsg
import com.mogo.och.common.module.bean.dpmsg.WriteOffMsg
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.manager.loopmanager.BizLoopManager
import com.mogo.och.common.module.manager.loopmanager.LoopInfo
import com.mogo.och.common.module.voice.VoiceNotice.showNotice
import io.reactivex.Observable
import io.reactivex.ObservableEmitter
import io.reactivex.ObservableOnSubscribe
import io.reactivex.schedulers.Schedulers
object TicketModel : IReceivedMsgListener, IMogoOnMessageListener<WriteOffPassenger> {
private val TAG = "TicketModel"
private val SELECTWRITEOFFCOUNT = "SELECTWRITEOFFCOUNT"
private var emitterMain: ObservableEmitter<Int>?=null
private val observable = Observable.create(ObservableOnSubscribe<Int> { emitter -> emitterMain = emitter })
init {
//监听乘客屏发来的消息
@@ -38,7 +54,7 @@ object TicketModel : IReceivedMsgListener, IMogoOnMessageListener<WriteOffPassen
}
fun load(){
BizLoopManager.setLoopFunction(SELECTWRITEOFFCOUNT, LoopInfo(3,::selectWriteOffCount,scheduler = Schedulers.io()))
}
// 收到局域网的核验信息
@@ -75,6 +91,36 @@ object TicketModel : IReceivedMsgListener, IMogoOnMessageListener<WriteOffPassen
passenger.ticketName?:"",
passenger.orderNo?:""
)
selectWriteOffCount()
}
private fun selectWriteOffCount(){
val busRoutesResult = OrderModel.getInstance().busRoutesResult
val busNextStation = OrderModel.getInstance().busNextStation
if(busRoutesResult==null||busNextStation==null){
emitterMain?.onNext(0)
d(SceneConstant.M_BUS + TAG, "线路或者站点未空:${busRoutesResult}----${busNextStation}")
return
}
OrderServiceManager.queryBusTaskByLineId(AbsMogoApplication.getApp(),
"${busRoutesResult.taskId}",
"${busNextStation.siteId}",
object :OchCommonServiceCallback<WriteOffCountResponse>{
override fun onSuccess(data: WriteOffCountResponse?) {
data?.data?.let {
emitterMain?.onNext(it)
d(SceneConstant.M_BUS + TAG, "${busNextStation.name}核销人数:${it}")
}
}
override fun onFail(code: Int, msg: String?) {
}
})
}
fun getWriteOffCountObservable():Observable<Int>{
return observable
}
private fun receiveWrteOffInfo(writeOffMsg: WriteOffMsg?) {

View File

@@ -10,6 +10,7 @@ import com.mogo.och.bus.bean.QueryLeaveAwayPassengersRequest;
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersResponse;
import com.mogo.och.bus.bean.BusResetDrivingLineRequest;
import com.mogo.och.bus.bean.BusUpdateSiteStatusRequest;
import com.mogo.och.bus.bean.WriteOffCountResponse;
import io.reactivex.Observable;
import retrofit2.http.Body;
@@ -125,5 +126,11 @@ public interface IBascApiService {
@Headers( {"Content-type:application/json;charset=UTF-8"} )
@POST("/och-shuttle-cabin/api/flow/v1/driver/endTask")
Observable<BaseData> endTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusCloseTaskRequest data);
@Headers( {"Content-type:application/json;charset=UTF-8"} )
@GET("och-shuttle-cabin/api/business/v1/task/writeOffCount")
Observable<WriteOffCountResponse> writeOffCount(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("taskId") String taskId, @Query("siteId") String siteId);
}

View File

@@ -202,4 +202,21 @@ object OrderServiceManager {
.transformTry()
.subscribe(OchCommonSubscribeImpl(context, callback, "queryBusLines"))
}
@JvmStatic
fun queryBusTaskByLineId(
context: Context,
taskId: String?,
siteId: String?,
callback: OchCommonServiceCallback<WriteOffCountResponse>?
) {
mService.writeOffCount(
MoGoAiCloudClientConfig.getInstance().serviceAppId,
SharedPrefsMgr.getInstance().token,
taskId,
siteId
)
.transformTry()
.subscribe(OchCommonSubscribeImpl(context, callback, "writeOffCount"))
}
}

View File

@@ -53,25 +53,4 @@ public class BusModelLoopManager {
// mQueryPassengerDisposable = null;
// }
// }
public void startHeartbeatLoop() {
if (mHeartbeatDisposable != null && !mHeartbeatDisposable.isDisposed()) {
return;
}
CallerLogger.i(M_BUS + TAG, "startHeartbeatLoop()");
mHeartbeatDisposable = Observable.interval(BusConst.LOOP_DELAY,
BusConst.LOOP_PERIOD_60S, TimeUnit.MILLISECONDS)
.map((aLong -> aLong + 1))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(aLong -> OrderModel.getInstance().runCarHeartbeat());
}
public void stopHeartbeatLoop() {
if (mHeartbeatDisposable != null) {
CallerLogger.i(M_BUS + TAG, "stopHeartbeatLoop()");
mHeartbeatDisposable.dispose();
mHeartbeatDisposable = null;
}
}
}

View File

@@ -10,7 +10,6 @@ import androidx.lifecycle.LifecycleOwner;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.mvp.Presenter;
import com.mogo.commons.voice.AIAssist;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
@@ -18,10 +17,8 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.data.bean.BusStationBean;
import com.mogo.och.bus.bean.WriteOffPassenger;
import com.mogo.och.bus.callback.IBusADASStatusCallback;
import com.mogo.och.bus.callback.IBusControllerStatusCallback;
import com.mogo.och.bus.callback.IPassengerCallback;
import com.mogo.och.bus.callback.IRefreshBusStationsCallback;
import com.mogo.och.bus.callback.ISlidePannelHideCallback;
import com.mogo.och.bus.fragment.BusFragment;
@@ -31,7 +28,6 @@ import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean;
import com.mogo.och.common.module.biz.callback.ILoginCallback;
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
import com.mogo.och.common.module.voice.VoiceNotice;
import java.util.ArrayList;
@@ -49,7 +45,7 @@ import system_master.SystemStatusInfo;
*/
public class BusPresenter extends Presenter<BusFragment>
implements IRefreshBusStationsCallback, ISlidePannelHideCallback
, IMoGoAutopilotStatusListener, IBusControllerStatusCallback, ILoginCallback, IPassengerCallback, IBusADASStatusCallback {
, IMoGoAutopilotStatusListener, IBusControllerStatusCallback, ILoginCallback, IBusADASStatusCallback {
private static final String TAG = "BusPresenter";
@@ -83,7 +79,6 @@ public class BusPresenter extends Presenter<BusFragment>
OrderModel.getInstance().setRefreshBusStationsCallback(this);
OrderModel.getInstance().setSlidePanelHideCallback(this);
OrderModel.getInstance().setControllerStatusCallback(this);
OrderModel.getInstance().setPassengerCallback(this);
OrderModel.getInstance().setAdasStatusCallback(this);
}
@@ -91,7 +86,6 @@ public class BusPresenter extends Presenter<BusFragment>
OrderModel.getInstance().setRefreshBusStationsCallback(null);
OrderModel.getInstance().setSlidePanelHideCallback(null);
OrderModel.getInstance().setControllerStatusCallback(null);
OrderModel.getInstance().setPassengerCallback(null);
OrderModel.getInstance().setAdasStatusCallback(null);
OCHAdasAbilityManager.getInstance().release();
}
@@ -192,11 +186,6 @@ public class BusPresenter extends Presenter<BusFragment>
}
}
@Override
public void onVRModeChanged(boolean isVRMode) {
runOnUIThread(() -> mView.onVRModeChanged(isVRMode));
}
@Override
public void onCarLocationChanged(MogoLocation location) {
if (null != location) {
@@ -261,12 +250,10 @@ public class BusPresenter extends Presenter<BusFragment>
public void loginSuccess(DriverStatusQueryRespBean data) {
CallerLogger.d(M_BUS + TAG, " loginStatus =" + LoginStatusManager.isLogin());
if(LoginStatusManager.isLogin()){
OrderModel.getInstance().startOrStopOrderLoop(true);
// OrderModel.getInstance().queryBusRoutes();
OrderModel.getInstance().queryBusCacheRoutes();
}else {
BusTrajectoryManager.getInstance().stopTrajReqLoop();
OrderModel.getInstance().startOrStopOrderLoop(false);
BusTrajectoryManager.getInstance().stopTrajReqLoop();
clearBusStationsMarkers();
mView.hideSlidePanel();
@@ -279,19 +266,6 @@ public class BusPresenter extends Presenter<BusFragment>
}
@Override
public void playPassenger(WriteOffPassenger passenger) {
int passengerNum = passenger.passengerSize;
if (passengerNum > 1){ //多人播报 "x人" ---》x人核验通过
VoiceNotice.showNotice(passengerNum+"人核验通过", AIAssist.LEVEL3);
OrderModel.getInstance().sendWriteOffNumToClient(passengerNum+"人核验通过");
}else { //是 1 播放 "滴" 2022.11.09 改为: "核验通过"
// mView.playDI();
VoiceNotice.showNotice("核验通过", AIAssist.LEVEL3);
OrderModel.getInstance().sendWriteOffNumToClient("核验通过");
}
}
@Override
public void onStartAdasFailure() {
runOnUIThread(() -> mView.stopAnimAndUpdateBtnStatus());

View File

@@ -0,0 +1,54 @@
package com.mogo.och.bus.ui.writeoff
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.findViewTreeViewModelStoreOwner
import com.mogo.och.bus.R
import kotlinx.android.synthetic.main.shuttle_wirte_off_view.view.tv_write_off_count
class WriteOffView : ConstraintLayout, WriteOffViewModel.IwriteOffViewCallback {
private val TAG = "ItineraryView"
constructor(context: Context) : super(context)
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
private fun initView() {
LayoutInflater.from(context).inflate(R.layout.shuttle_wirte_off_view, this, true)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
val viewModel = findViewTreeViewModelStoreOwner()?.let {
ViewModelProvider(it).get(WriteOffViewModel::class.java)
}
viewModel?.setWriteOffCallback(this)
}
init {
try {
initView()
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun setWriteOffCount(showText: String) {
tv_write_off_count.text = showText
}
}

View File

@@ -0,0 +1,68 @@
package com.mogo.och.bus.ui.writeoff
import androidx.lifecycle.ViewModel
import com.mogo.commons.AbsMogoApplication
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.bus.R
import com.mogo.och.bus.model.TicketModel
import com.mogo.och.common.module.utils.RxUtils
import io.reactivex.Observable
import io.reactivex.Observer
import io.reactivex.disposables.Disposable
class WriteOffViewModel : ViewModel() {
private val TAG = WriteOffViewModel::class.java.simpleName
private var viewCallback: IwriteOffViewCallback? = null
init {
}
private var disposable: Disposable? = null
private val observer = object : Observer<String> {
override fun onSubscribe(d: Disposable) {
disposable = d
}
override fun onError(e: Throwable) {
}
override fun onComplete() {
}
override fun onNext(countInfo: String) {
viewCallback?.setWriteOffCount(countInfo)
}
}
fun setWriteOffCallback(viewCallback: IwriteOffViewCallback) {
this.viewCallback = viewCallback
TicketModel
.getWriteOffCountObservable()
.flatMap { t ->
val showText =
AbsMogoApplication.getApp().getString(R.string.shuttle_write_off_count, t)
CallerLogger.d(SceneConstant.M_BUS + TAG, "显示文案:${showText}")
Observable.just(showText)
}
.subscribe(observer)
}
override fun onCleared() {
super.onCleared()
this.viewCallback = null
RxUtils.disposeSubscribe(disposable)
}
interface IwriteOffViewCallback {
fun setWriteOffCount(count:String)
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

View File

@@ -201,6 +201,29 @@
app:layout_constraintLeft_toLeftOf="@id/module_mogo_och_station_panel_container"
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container"
tools:visibility="visible" />
<com.mogo.och.bus.ui.writeoff.WriteOffView
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@+id/module_mogo_och_arrived_tv"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginBottom="-40dp"
android:background="@drawable/shuttle_write_off_bg"
android:layout_width="@dimen/dp_618"
android:layout_height="@dimen/dp_186"/>
<TextView
android:id="@+id/module_mogo_och_arrived_tv"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:text="@string/bus_arrived_str"
android:textColor="@color/bus_autopilot_text_color_selector"
android:textSize="@dimen/module_mogo_och_arrived_text_size"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<!--切换地图远近事件 @dimen/module_switch_map -->
<LinearLayout
@@ -220,36 +243,7 @@
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80" />
</LinearLayout>
<!-- <CheckedTextView-->
<!-- android:id="@+id/module_mogo_och_operation_status"-->
<!-- android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"-->
<!-- android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"-->
<!-- android:background="@drawable/bus_operation_status_bg"-->
<!-- android:elevation="@dimen/dp_10"-->
<!-- android:gravity="center"-->
<!-- android:text="出车"-->
<!-- android:textAlignment="center"-->
<!-- android:textColor="@color/bus_autopilot_text_color_selector"-->
<!-- android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"-->
<!-- android:textStyle="bold"-->
<!-- android:layout_marginLeft="@dimen/module_mogo_och_margin_left"-->
<!-- android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"/>-->
<TextView
android:id="@+id/module_mogo_och_arrived_tv"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:text="@string/bus_arrived_str"
android:textColor="@color/bus_autopilot_text_color_selector"
android:textSize="@dimen/module_mogo_och_arrived_text_size"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<RelativeLayout
android:id="@+id/module_mogo_och_setting_layout"

View File

@@ -10,6 +10,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<!-- 线路名称 -->
<com.mogo.och.common.module.wigets.MarqueeTextView
android:id="@+id/module_och_bus_line_name"
android:layout_width="0dp"
@@ -27,6 +28,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toLeftOf="@+id/bus_task_time_tv"/>
<!-- 班次名称 -->
<TextView
android:id="@+id/bus_task_time_tv"
android:layout_width="200dp"
@@ -98,7 +100,7 @@
android:layout_height="@dimen/bus_switch_line_btn_height_1"
android:layout_marginLeft="@dimen/dp_28"
android:layout_marginTop="@dimen/dp_40"
app:layout_goneMarginTop="@dimen/dp_600"
app:layout_goneMarginTop="@dimen/dp_550"
android:background="@drawable/bus_switch_line_btn"
android:gravity="center"
android:text="@string/bus_switch_line_btn"

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"
android:id="@+id/no_line_data_view">
<TextView
android:id="@+id/tv_write_off_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/shuttle_driver_cad6ff"
android:textSize="32dp"
android:layout_marginStart="@dimen/dp_68"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:text="@string/shuttle_write_off_count_default"/>
</merge>

View File

@@ -57,4 +57,7 @@
<color name="sweeper_mogo_autopilot_status_disable">#4DFFFFFF</color>
<color name="sweeper_mogo_autopilot_status_enable">#FFFFFF</color>
<color name="sweeper_switch_map_bg">#323C6F</color>
<color name="shuttle_driver_cad6ff">#CAD6FF</color>
<color name="shuttle_driver_bf0e3dbc">#BF0E3DBC</color>
<color name="shuttle_driver_bf1e2e89">#BF1E2E89</color>
</resources>

View File

@@ -39,6 +39,8 @@
<string name="bus_dialog_cancel">取消</string>
<string name="bus_no_task_tip">暂无任务</string>
<string name="shuttle_write_off_count">本站核销成功:%1$d人</string>
<string name="shuttle_write_off_count_default">本站核销成功0人</string>
<!-- region tts -->

View File

@@ -24,7 +24,7 @@ class BusPassengerConst {
const val STATION_STATUS_ARRIVING = 3
//bus平均速度 bus的平均里程25km/h
const val BUS_AVERAGE_SPEED = 25
const val BUS_AVERAGE_SPEED = 10
//接驳/B2平均速度 bus的平均里程10km/h
const val SHUTTLE_AVERAGE_SPEED = 10
@@ -32,5 +32,7 @@ class BusPassengerConst {
const val BUS_SP_KEY_ORDER_SUM_DIS = "BUS_SP_KEY_ORDER_SUM_DIS"
const val QUERY_BUS_P_STATION_DELAY = 3 * 1000L
const val ARRIVE_DISTANCE_4_STATION_INTRODUCE = 200 //站点介绍
}
}

View File

@@ -39,7 +39,7 @@ public interface ServiceApi {
Observable<PassengerOperationStatusResponse> queryDriverOperationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
/**
* 查询司机端的登陆状态
* 核销接口
*/
@Headers({"Content-type:application/json;charset=UTF-8"})
@POST("/och-vehicle/api/scanner/device/writeOff")

View File

@@ -26,7 +26,9 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant;
import com.mogo.eagle.core.utilcode.util.GsonUtils;
import com.mogo.eagle.core.utilcode.util.StringUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.och.common.module.voice.VoiceNotice;
import com.mogo.och.shuttle.passenger.R;
import com.mogo.och.common.module.bean.dpmsg.AppConnectMsg;
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg;
@@ -111,8 +113,6 @@ public class BusPassengerModel {
List<BusStationBean> mStations = new ArrayList<>();
private int mNextStationIndex = 0;// 要到达站的index
private List<MogoLocation> mTwoStationsRouts = new ArrayList<>();
private int mPreRouteIndex = 0;
private int mWipePreIndex = 0;
private volatile boolean isGoingToNextStation = false;
@@ -298,7 +298,6 @@ public class BusPassengerModel {
isGoingToNextStation = false;
Logger.d(M_BUS_P + TAG, "order = station= arrive");
mPreRouteIndex = 0;
mRouteLineInfoCallback.updateStationsInfo(stations,i,true);
return;
}
@@ -388,6 +387,16 @@ public class BusPassengerModel {
}
}
}
// 小于200m 播报站点介绍
if(distance<200){
BusStationBean stationNext = mStations.get(mNextStationIndex);
if(!stationNext.isPlayTts()){
if (!StringUtils.isEmpty(stationNext.getIntroduction())) {
VoiceNotice.showNotice(stationNext.getIntroduction());
stationNext.setPlayTts(true);
}
}
}
mAutopilotPlanningCallback.routePlanningToNextStationChanged(
(long)distance, (long)lastTime
);

View File

@@ -210,42 +210,46 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
d(SceneConstant.M_TAXI + TAG, "没有点")
return
}
texIndexList.clear()
val allPoints = ArrayList(routeArrived)
for (i in routeArrived.indices) {
if (routeArrived.size > 1 && i < routeArrived.size - 1) {
texIndexList.add(0)
try {
texIndexList.clear()
val allPoints = ArrayList(routeArrived)
for (i in routeArrived.indices) {
if (routeArrived.size > 1 && i < routeArrived.size - 1) {
texIndexList.add(0)
}
}
texIndexList.add(0)
location?.let {
allPoints.add(LatLng(it.latitude, it.longitude))
}
allPoints.addAll(routeArriving)
for (ignored in routeArrived) {
texIndexList.add(1)
}
mPolyline?.let {
it.points = allPoints
it.options.customTextureIndex = texIndexList
return
}
if (textureList.isEmpty()) {
textureList.add(mArrivedRes)
textureList.add(mUnArrivedRes)
}
//设置线段纹理
val polylineOptions = PolylineOptions().apply {
addAll(allPoints)
isUseTexture = true
width(15f)
lineCapType(PolylineOptions.LineCapType.LineCapRound)
customTextureList = textureList
customTextureIndex = texIndexList
}
}
texIndexList.add(0)
location?.let {
allPoints.add(LatLng(it.latitude, it.longitude))
}
allPoints.addAll(routeArriving)
for (ignored in routeArrived) {
texIndexList.add(1)
}
mPolyline?.let {
it.points = allPoints
it.options.customTextureIndex = texIndexList
return
}
if (textureList.isEmpty()) {
textureList.add(mArrivedRes)
textureList.add(mUnArrivedRes)
}
//设置线段纹理
val polylineOptions = PolylineOptions().apply {
addAll(allPoints)
isUseTexture = true
width(15f)
lineCapType(PolylineOptions.LineCapType.LineCapRound)
customTextureList = textureList
customTextureIndex = texIndexList
}
// 绘制线
mPolyline = mAMap.addPolyline(polylineOptions)
// 绘制线
mPolyline = mAMap.addPolyline(polylineOptions)
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun clearPolyline() {

View File

@@ -30,12 +30,8 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.NetworkUtils
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.shuttle.passenger.R
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst
import com.mogo.och.shuttle.passenger.callback.AutoPilotStatusCallback
import com.mogo.och.shuttle.passenger.callback.DrivingInfoCallback
import com.mogo.och.shuttle.passenger.network.PM2ModelLoopManager
import com.mogo.och.common.module.bean.dpmsg.*
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.pushAppOperationalMsgBox
import com.mogo.och.common.module.biz.constant.OchCommonConst
@@ -43,11 +39,17 @@ import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.common.module.utils.RxUtils
import com.mogo.och.common.module.voice.VoiceNotice.showNotice
import com.mogo.och.data.bean.BusRoutesResult
import com.mogo.och.data.bean.BusStationBean
import com.mogo.och.data.bean.BusTransferData
import com.mogo.och.shuttle.passenger.R
import com.mogo.och.shuttle.passenger.bean.response.PassengerOperationStatusResponse
import com.mogo.och.shuttle.passenger.bean.response.PassengerRoutesResponse
import com.mogo.och.shuttle.passenger.callback.AutoPilotStatusCallback
import com.mogo.och.shuttle.passenger.callback.DrivingInfoCallback
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst
import com.mogo.och.shuttle.passenger.network.PM2ModelLoopManager
import com.mogo.och.shuttle.passenger.network.PassengerServiceManager
import io.reactivex.disposables.Disposable
import mogo.telematics.pad.MessagePad
@@ -545,6 +547,21 @@ class PM2DrivingModel private constructor() {
}
val lastTime = lastSumLength / BusPassengerConst.SHUTTLE_AVERAGE_SPEED * 3.6 //秒
d(SceneConstant.M_BUS_P + TAG, "och-rotting==lastSumLength = $lastSumLength")
// 小于200m 播报站点介绍
// 小于200m 播报站点介绍
if (lastSumLength < 200) {
val stationNext = mStations[mNextStationIndex]
if (!stationNext.isPlayTts) {
if (!StringUtils.isEmpty(stationNext.introduction)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
speakTTS(stationNext.introduction)
}
stationNext.isPlayTts = true
}
}
}
mDrivingInfoCallback?.updateRemainMT(
lastSumLength.toLong(),
lastTime.toLong()

View File

@@ -51,7 +51,7 @@ class SweeperConst {
const val EVENT_PARAM_ENV_ONLINE = "env_online" // 是否线上环境true/false
// 埋点key开启自动驾驶前已识别的异常会导致无法开启自驾
const val EVENT_KEY_AP_UNABLE_START_REASON = "event_key_och_bus_ap_unable_start_reason"
const val EVENT_KEY_AP_UNABLE_START_REASON = "event_key_och_sweeper_ap_unable_start_reason"
const val EVENT_PARAM_UNABLE_START_REASON = "unable_start_reason";
// 埋点Key: 切换清扫业务模式

View File

@@ -219,7 +219,7 @@ ext {
//========================= 扫码机 ======================
serialport : 'com.mogo.support.serialport:client:1.0.0-alpha5',
thread_opt : "com.mogo.thread.opt:lib:10.10.2",
thread_opt : "com.mogo.thread.opt:lib:10.10.3",
weak_network : "com.mogo.weak:network:1.0.1",
btrace : "com.bytedance.btrace:rhea-core:2.0.0",
@@ -228,7 +228,7 @@ ext {
log_runtime : "com.mogo.eagle.core.log.record:runtime:1.0.30",
// 安全证书
passport_secret : "com.zhidaoauto:sdk-java:1.0.5-SNAPSHOT",
passport_secret : "com.zhidaoauto:sdk-java:1.0.6-SNAPSHOT",
// 主线程卡顿监测
block_detector : "com.mogo.eagle.core.block:runtime:10.90.60",

View File

@@ -9,6 +9,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.zhjt.mogo.adas.data.bean.MogoReport
import mogo_msg.MogoReportMsg
/**
@@ -87,7 +88,32 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|| it.resultList.contains(RESULT_REMOTEPILOT_DISABLE)
|| it.resultList.contains(RESULT_AUTOPILOT_INFERIOR)
|| it.resultList.contains(RESULT_SHOW_WARNING)
|| it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){
|| it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)
|| it.code == MogoReport.Code.Info.ISYS.STARTING
|| it.code == MogoReport.Code.Info.ISYS.RUNNING
|| it.code == MogoReport.Code.Info.IMAP.ENTRY_AUTOPILOT
|| it.code == MogoReport.Code.Info.IMAP.EXIT_AUTOPILOT
|| it.code == MogoReport.Code.Info.IMAP.ENTRY_REMOTEPILOT
|| it.code == MogoReport.Code.Info.IMAP.EXIT_REMOTEPILOT
|| it.code == MogoReport.Code.Info.IMAP.CONTROLLER_START_FM_COMMAND
|| it.code == MogoReport.Code.Info.IMAP.CONTROLLER_FINISH_FM_COMMAND
|| it.code == MogoReport.Code.Info.IMAP.CONTROLLER_ABORT_FM_COMMAND
|| it.code == MogoReport.Code.Info.IMAP.PLANNING_START_FM_COMMAND
|| it.code == MogoReport.Code.Info.IMAP.PLANNING_FINISH_FM_COMMAND
|| it.code == MogoReport.Code.Info.IMAP.PLANNING_ABORT_FM_COMMAND
|| it.code == MogoReport.Code.Info.ISYS.ALREADY_AUTOPILOT_STATE
|| it.code == MogoReport.Code.Info.ISYS.AUTOPILOT_TAKEN_OVER_BY_REMOTE
|| it.code == MogoReport.Code.Info.ISSM.OTA_UPGRADE_START
|| it.code == MogoReport.Code.Info.ISSM.OTA_UPGRADE_FINISH
|| it.code == MogoReport.Code.Info.ISSM.OTA_UPGRADE_LOADING
|| it.code == MogoReport.Code.Info.ISYS.INIT_TRAJECTORY_START
|| it.code == MogoReport.Code.Info.ISYS.INIT_TRAJECTORY_SUCCESS
|| it.code == MogoReport.Code.Info.ISYS.INIT_TRAJECTORY_TIMEOUT
|| it.code == MogoReport.Code.Info.ISYS.INIT_TRAJECTORY_FAILURE
|| it.code == MogoReport.Code.Info.IPARALLEL.AICLOUD_CONNECTION_OK
|| it.code == MogoReport.Code.Info.IVEHICLE.NOT_IN_TROUBLE
|| it.code == MogoReport.Code.Info.ILCT.RTK_STATUS_NORMAL
){
val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList,false)
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity))

View File

@@ -52,6 +52,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
private val RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED"
private val RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE"
//Warning
private val RESULT_AUTOPILOT_INFERIOR = "RESULT_AUTOPILOT_INFERIOR"
private val RESULT_SHOW_WARNING = "RESULT_SHOW_WARNING"
private val RESULT_REMOTEPILOT_INFERIOR = "RESULT_REMOTEPILOT_INFERIOR"
fun setData(data: List<MsgBoxBean>) {
this.data = data
notifyDataSetChanged()
@@ -378,13 +383,23 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_error_open))
holder.tvReportLevelNormal.text = "Error"
holder.tvReportLevelOpen.text = "Error"
} else {
} else if(reportEntity.resultList.contains(RESULT_AUTOPILOT_INFERIOR)
|| reportEntity.resultList.contains(RESULT_SHOW_WARNING)
|| reportEntity.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)
){
//Warning
holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_warning_normal))
holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_warning_open))
holder.tvReportLevelNormal.text = "Warning"
holder.tvReportLevelOpen.text = "Warning"
}else {
//INFO
holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_warning_normal))
holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_warning_open))
holder.tvReportLevelNormal.text = "Info"
holder.tvReportLevelOpen.text = "Info"
}
holder.tvReportTimeNormal.text =
"时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvReportTimeOpen.text =

View File

@@ -280,9 +280,9 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
linkChainLog = CHAIN_TYPE_STATUS,
linkCode = CHAIN_SOURCE_CLOUD,
nodeAliasCode = CHAIN_CODE_CLOUD_PASSPORT_AUTH_OK,
paramIndexes = [0]
paramIndexes = [0,1]
)
override fun onSuccess(securityKey: String) {
override fun onSuccess(securityKey: String, rootKey: String) {
CallerLogger.d(
"$M_MAIN$TAG",
"onSuccess securityKey:$securityKey , thread:${Thread.currentThread().name}"
@@ -295,6 +295,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
)
SharedPrefsMgr.getInstance()
.putBoolean("securityKey-${DebugConfig.getNetMode()}", true)
CallerCloudListenerManager.invokeCloudCrtFile(securityKey, rootKey)
}
@ChainLog(

View File

@@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.startup.stageone.secret;
public interface IPassportSecret {
void onSuccess(String secretKey);
void onSuccess(String secretKey, String rootKey);
void onFailed(int errorCode, String errorMsg);
}

View File

@@ -5,6 +5,7 @@ import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import java.io.UnsupportedEncodingException;
import java.util.List;
import constant.ErrorCode;
import domain.Passport;
@@ -42,14 +43,15 @@ public class PassPortSecret {
secretCB.onFailed(r.getCode(), r.getMsg());
}
Passport passport = (Passport) r.getData();
domain.R<String> res = passportService.deviceActive(passport);
domain.R<List<String>> res = passportService.deviceActive(passport);
if (res.getCode() != ErrorCode.OK.getCode()) {
secretCB.onFailed(res.getCode(), res.getMsg());
} else {
String secretKey = res.getData();
List<String> secretKey = res.getData();
try {
String result = new String(Base64.encode(secretKey.getBytes("utf-8"), Base64.NO_WRAP), "utf-8");
secretCB.onSuccess(result);
String result = new String(Base64.encode(secretKey.get(0).getBytes("utf-8"), Base64.NO_WRAP), "utf-8");
String root = new String(Base64.encode(secretKey.get(1).getBytes("utf-8"), Base64.NO_WRAP), "utf-8");
secretCB.onSuccess(result, root);
} catch (UnsupportedEncodingException e) {
secretCB.onFailed(5000, "url encode error :" + secretKey);
}

View File

@@ -4,6 +4,8 @@ import com.mogo.eagle.core.data.v2x.V2XEvent
interface IMoGoCloudListener{
fun authCrtFile(device:String, root:String){}
fun tokenGot(token: String, sn: String){}
/**

View File

@@ -12,6 +12,12 @@ object CallerCloudListenerManager : CallerBase<IMoGoCloudListener>() {
@Volatile
private var sn: String? = null
@Volatile
private var deviceCrtFile: String? = null
@Volatile
private var rootCrtFile: String? = null
override fun doSomeAfterAddListener(tag: String, listener: IMoGoCloudListener) {
super.doSomeAfterAddListener(tag, listener)
if (!token.isNullOrEmpty() && !sn.isNullOrEmpty()) {
@@ -19,6 +25,23 @@ object CallerCloudListenerManager : CallerBase<IMoGoCloudListener>() {
}
}
fun getRootCrtF(): String? {
return rootCrtFile
}
fun getDeviceCrtF(): String? {
return deviceCrtFile
}
fun invokeCloudCrtFile(deviceCrtFile: String, rootCrtFile: String) {
this.deviceCrtFile = deviceCrtFile
this.rootCrtFile = rootCrtFile
M_LISTENERS.forEach {
val listener = it.value
listener.authCrtFile(deviceCrtFile, rootCrtFile)
}
}
/**
* 分发获取到的设备sn
*/

View File

@@ -150,28 +150,28 @@ MATRIX_VERSION=2.0.8
# 测试模式司机端版本号
NOOP_DRIVER_VERSION=3.2.0
# 公交模式司机端版本号
BUS_DRIVER_VERSION=6.2.8
BUS_DRIVER_VERSION=6.2.9
# 公交模式乘客端端版本号
BUS_PASSENGER_VERSION=5.2.8
BUS_PASSENGER_VERSION=5.2.9
# 接驳模式司机端版本号
SHUTTLE_DRIVER_VERSION=6.2.8
SHUTTLE_DRIVER_VERSION=6.2.9
# 接驳模式乘客端端版本号
SHUTTLE_PASSENGER_VERSION=5.2.8
SHUTTLE_PASSENGER_VERSION=5.2.9
# 出租车模式司机端版本号
TAXI_DRIVER_VERSION=6.2.8
TAXI_DRIVER_VERSION=6.2.9
# 出租车模式乘客端端版本号
TAXI_PASSENGER_VERSION=5.2.8
TAXI_PASSENGER_VERSION=5.2.9
# 出租车模式司机端版本号
TAXIUNMANNED_DRIVER_VERSION=6.2.8
TAXIUNMANNED_DRIVER_VERSION=6.2.9
# 出租车模式乘客端端版本号
TAXIUNMANNED_PASSENGER_VERSION=5.2.8
TAXIUNMANNED_PASSENGER_VERSION=5.2.9
# 包车模式司机端版本号
CHARTER_DRIVER_VERSION=6.2.8
CHARTER_DRIVER_VERSION=6.2.9
# 包车模式乘客端端版本号
CHARTER_PASSENGER_VERSION=5.2.8
CHARTER_PASSENGER_VERSION=5.2.9
# 支持云控清扫车模式司机端版本号
SWEEPERCLOUD_DRIVER_VERSION=6.2.8
SWEEPERCLOUD_DRIVER_VERSION=6.2.9
# 清扫车模式司机端版本号
SWEEPEROPERATE_DRIVER_VERSION=6.2.8
SWEEPEROPERATE_DRIVER_VERSION=6.2.9

View File

@@ -7,7 +7,7 @@ import java.util.Map;
/**
* 监控事件报告中定义的事件以及解释
* 根据MAP3.7.1事件定义编写
* http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=123445235 最后修改于2023-11-07
* http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=123445242 最后修改于2024-01-22
*/
public class MogoReport {
public static final String RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED";//自动驾驶系统启动失败
@@ -478,6 +478,8 @@ public class MogoReport {
String TASK_CONFIG_EMPTY = "ERECORD_TASK_CONFIG_EMPTY";//配置为空
@CodeInfo("2.10.0")
String TASK_QUEUE_EMPTY = "ERECORD_TASK_QUEUE_EMPTY";//数据队列为空
@CodeInfo("3.6.0")
String TASK_NODE_TO_TOPICS_EMPTY = "ERECORD_TASK_NODE_TO_TOPICS_EMPTY";//通过节点名获取不到topic列表---ROS2版本新增
}
/**
@@ -627,7 +629,7 @@ public class MogoReport {
@CodeInfo("2.6.0")
String SYSTEM_OUT_IDLE = "ISYS_SYSTEM_OUT_IDLE";//系统退出空闲状态
@CodeInfo("3.3.0")
String ALREADY_AUTOPILOT_STATE = "ISYS_ALREADY_AUTOPILOT_STATE";//已经在自驾状态驾驶,忽略自驾命令
String ALREADY_AUTOPILOT_STATE = "ISYS_ALREADY_AUTOPILOT_STATE";//已经在自驾状态驾驶,继续自驾命令
@CodeInfo("3.3.1")
String AUTOPILOT_TAKEN_OVER_BY_REMOTE = "ISYS_AUTOPILOT_TAKEN_OVER_BY_REMOTE";//自动驾驶被远程驾驶接管
@CodeInfo("3.6.0")
@@ -686,6 +688,8 @@ public class MogoReport {
String OTA_UPGRADE_START = "ISSM_OTA_UPGRADE_START";//OTA升级开始升级内容见msg
@CodeInfo("3.7.0")
String OTA_UPGRADE_FINISH = "ISSM_OTA_UPGRADE_FINISH";//OTA升级结束升级内容见msg
@CodeInfo("3.8.0")
String OTA_UPGRADE_LOADING = "ISSM_OTA_UPGRADE_LOADING";//OTA升级进行中
@CodeInfo("3.7.0")
String RECEIVE_SHUTDOWN_SIGNAL = "ISSM_RECEIVE_SHUTDOWN_SIGNAL";//SSM收到下电信号
@CodeInfo("3.3.0")

View File

@@ -81,7 +81,7 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
.token(isDebug ? BYTEAMP_AppToken_DEV : BYTEAMP_AppToken)// 设置鉴权token可从平台应用信息处获取token错误无法上报数据
.versionCode(CommonUtils.getVersionCode(context))// 可选默认取PackageInfo中的versionCode
.versionName(CommonUtils.getVersionName(context))// 可选默认取PackageInfo中的versionName
.channel(MetaDataUtils.getMetaDataInApp("BUGLY_APP_CHANNEL"))// 可选设置App发布渠道在平台可以筛选
.channel(FunctionBuildConfig.appIdentityMode)// 可选设置App发布渠道在平台可以筛选
// .url("www.xxx.com")// 默认不需要,私有化部署才配置上报地址
//可选,可以设置自定义 did不设置会使用内部默认的
.dynamicParams(new MonitorCrash.Config.IDynamicParams() {
@@ -124,7 +124,7 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
// 地图版本
dimension.put("APP_MAP_SDK_VERSION", DebugConfig.getMapVersion());
// 渠道信息
dimension.put("APP_CHANNEL", MetaDataUtils.getMetaDataInApp("BUGLY_APP_CHANNEL"));
dimension.put("APP_CHANNEL", FunctionBuildConfig.appIdentityMode);
// 车辆类型
dimension.put("APP_CAR_TYPE", AppIdentityModeUtils.INSTANCE.getBuildCarType(FunctionBuildConfig.appIdentityMode));
//************************************* APP构建的信息 ***********************************************
@@ -176,7 +176,7 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
// 地图版本
map.put("APP_MAP_SDK_VERSION", DebugConfig.getMapVersion());
// 渠道信息
map.put("APP_CHANNEL", MetaDataUtils.getMetaDataInApp("BUGLY_APP_CHANNEL"));
map.put("APP_CHANNEL", FunctionBuildConfig.appIdentityMode);
// 车辆类型
map.put("APP_CAR_TYPE", AppIdentityModeUtils.INSTANCE.getBuildCarType(FunctionBuildConfig.appIdentityMode));
//************************************* APP构建的信息 ***********************************************
@@ -256,7 +256,7 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
//私有化部署:配置数据上报的域名 私有化部署才需要配置内部有默认域名测试支持设置http://www.xxx.com 默认是https协议
// builder.defaultReportDomain("www.xxx.com");
//设置渠道。1.3.16版本增加接口
builder.channel(MetaDataUtils.getMetaDataInApp("BUGLY_APP_CHANNEL"));
builder.channel(FunctionBuildConfig.appIdentityMode);
//打开自定义日志回捞能力1.4.1版本新增接口
builder.enableLogRecovery(true);
//设置数据和Rangers Applog数据打通设备标识did必填。1.3.16版本增加接口