Merge branch 'dev_robobus-d_240116' into dev_robobus-d_240123_6.2.9

This commit is contained in:
yangyakun
2024-01-24 15:45:29 +08:00
34 changed files with 477 additions and 323 deletions

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()
}
}
}
// 启动时间校准
@@ -713,8 +718,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 +1029,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

@@ -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

@@ -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,31 @@ object TicketModel : IReceivedMsgListener, IMogoOnMessageListener<WriteOffPassen
passenger.ticketName?:"",
passenger.orderNo?:""
)
selectWriteOffCount()
}
private fun selectWriteOffCount(){
val busRoutesResult = OrderModel.getInstance().busRoutesResult?:return
val busNextStation = OrderModel.getInstance().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

@@ -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,19 @@ 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)) {
showNotice(stationNext.introduction)
stationNext.isPlayTts = true
}
}
}
mDrivingInfoCallback?.updateRemainMT(
lastSumLength.toLong(),
lastTime.toLong()

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版本增加接口