(view)
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/provider/M2StatusViewManager.java b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/provider/M2StatusViewManager.java
deleted file mode 100644
index 8966090d91..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/provider/M2StatusViewManager.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.mogo.och.bus.passenger.provider;
-
-import android.content.Context;
-import android.view.View;
-
-import com.mogo.och.bus.passenger.ui.widget.M2StatusBarView;
-import androidx.annotation.NonNull;
-
-import com.alibaba.android.arouter.facade.annotation.Route;
-import com.mogo.eagle.core.data.constants.MogoServicePaths;
-import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout;
-
-/**
- * @author congtaowang
- * @since 2020-01-06
- *
- * 根据优先级控制显示 window view.
- */
-@Route( path = MogoServicePaths.PATH_STATUS_VIEW_MANAGER )
-public class M2StatusViewManager implements IStatusViewLayout {
-
-
- @NonNull
- @Override
- public View getStatusView(Context context) {
- return new M2StatusBarView(context);
- }
-
- @Override
- public void init(Context context) {
-
- }
-}
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2BaseFragment.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2BaseFragment.kt
deleted file mode 100644
index a90221bd15..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2BaseFragment.kt
+++ /dev/null
@@ -1,72 +0,0 @@
-package com.mogo.och.bus.passenger.ui
-
-import android.provider.Settings
-import android.view.Surface
-import com.mogo.commons.mvp.MvpFragment
-import com.mogo.och.bus.passenger.R
-import com.mogo.och.bus.passenger.presenter.PM2Presenter
-import com.mogo.och.bus.passenger.ui.video.PM2VideoFragment
-
-/**
- * @author: wangmingjun
- * @date: 2022/4/12
- */
-class PM2BaseFragment :
- MvpFragment() {
-
- private var drivingFragment : PM2DrivingInfoFragment? = null
- private var hdMapFragment : PM2HPMapFragment? = null
- private var videoFragment : PM2VideoFragment? = null
-
- override fun getLayoutId(): Int {
- return R.layout.p_m2_fragment
- }
-
- override fun getTagName(): String {
- return TAG
- }
-
- override fun initViews() {
- //横竖屏
-// setScreenDirection()
-
- //隐藏小地图
- initFragment()
- }
-
-// private fun setScreenDirection() {
-// var ro = Settings.System.getInt(context?.contentResolver,
-// Settings.System.USER_ROTATION,Surface.ROTATION_270)
-// if (ro != Surface.ROTATION_270){
-// ro = Surface.ROTATION_270
-// }
-// Settings.System.putInt(context?.contentResolver,
-// Settings.System.USER_ROTATION,ro)
-// }
-
- /**
- * 初始化行程信息,高静地图,宣传 三个fragment
- */
- private fun initFragment() {
-
- if (drivingFragment == null) drivingFragment = PM2DrivingInfoFragment()
- childFragmentManager.beginTransaction().add(R.id.driving_fragment, drivingFragment!!)
- .show(drivingFragment!!).commitAllowingStateLoss()
-
- if (hdMapFragment == null) hdMapFragment = PM2HPMapFragment()
- childFragmentManager.beginTransaction().add(R.id.hd_map_fragment, hdMapFragment!!)
- .show(hdMapFragment!!).commitAllowingStateLoss()
-
- if (videoFragment == null) videoFragment = PM2VideoFragment()
- childFragmentManager.beginTransaction().add(R.id.video_fragment, videoFragment!!)
- .show(videoFragment!!).commitAllowingStateLoss()
- }
-
- override fun createPresenter(): PM2Presenter {
- return PM2Presenter(this)
- }
-
- companion object {
- private val TAG = PM2BaseFragment::class.java.simpleName
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt
deleted file mode 100644
index a9abc4ee54..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt
+++ /dev/null
@@ -1,253 +0,0 @@
-package com.mogo.och.bus.passenger.ui
-
-import android.graphics.BitmapFactory
-import android.os.Bundle
-import android.os.Handler
-import android.os.Looper
-import android.os.Message
-import android.view.View
-import androidx.core.content.ContextCompat
-import com.amap.api.maps.model.LatLng
-import com.mogo.commons.mvp.MvpFragment
-import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
-import com.mogo.eagle.core.utilcode.kotlin.onClick
-import com.mogo.eagle.core.utilcode.util.DateTimeUtils
-import com.mogo.eagle.core.utilcode.util.UiThreadHandler
-import com.mogo.och.bus.passenger.R
-import com.mogo.och.bus.passenger.bean.PM2Station
-import com.mogo.och.bus.passenger.presenter.PM2DrivingPresenter
-import com.mogo.och.common.module.utils.DateTimeUtil.*
-import com.mogo.och.common.module.utils.NumberFormatUtil
-import kotlinx.android.synthetic.m2.p_m2_driving_info_fragment.*
-import java.lang.ref.WeakReference
-import kotlin.math.ceil
-import kotlin.math.roundToInt
-
-/**
- * @author: wangmingjun
- * @date: 2022/4/12
- */
-class PM2DrivingInfoFragment :
- MvpFragment() {
-
-// private var timeHandler: TimeHandler? = null
-
- /**
- * 改变自动驾驶状态
- *
- * @param status 2 - running 1 - enable 2 - disable
- */
- override fun getLayoutId(): Int {
- return R.layout.p_m2_driving_info_fragment
- }
-
- override fun getTagName(): String {
- return TAG
- }
-
- override fun initViews() {
- speed_tv.setOnLongClickListener {
- context?.let { ToggleDebugView.toggleDebugView.toggle(it) }
- true
- }
-
- line_name_tv.setTextColor(resources.getColor(R.color.m2_line_name_tv_color))
- station_name_tv.setTextColor(resources.getColor(R.color.m2_line_name_tv_color))
-
-// current_time_tv.onClick {
-
-// //测试V2X消息
-// CallerMsgBoxManager.saveMsgBox(
-// MsgBoxBean(
-// MsgBoxType.V2X,
-// V2XMsg(
-// "6666",
-// "超速行驶",
-// ""
-// )
-// )
-// )
-//
-// val noticeTrafficStylePushData = NoticeTrafficStylePushData()
-// noticeTrafficStylePushData.content= "测试公告布局"
-// val noticeFromCloudMsg = NoticeFrCloudMsg(null, noticeTrafficStylePushData, 1)
-// CallerMsgBoxManager.saveMsgBox(
-// MsgBoxBean(
-// MsgBoxType.NOTICE, noticeFromCloudMsg)
-// )
-// BPRouteDataTestUtils.converToRouteData()
-// }
- updateCurrentTime()
- }
-
- override fun initViews(savedInstanceState: Bundle?) {
- super.initViews(savedInstanceState)
- overMapView?.let {
- it.onCreateView(savedInstanceState)
- }
- }
-
- override fun onResume() {
- super.onResume()
- overMapView?.let{
- it.onResume()
- }
- }
-
- override fun onPause() {
- super.onPause()
- overMapView?.let{
- it.onPause()
- }
- }
-
- override fun onDestroy() {
-// timeHandler?.removeCallbacksAndMessages(null)
- super.onDestroy()
- overMapView?.let{
- it.onDestroy()
- }
- }
-
- fun updateSpeed(speed: Int){
- speed_tv.text = speed.toString()
- }
-
- fun updateCarPlateNum(plateNum : String){
-
- }
-
- fun updateTaskName(name: String){
- line_name_tv.text = name
- }
-
- fun updateTaskDuringTime(time : String){
- line_during_tv.text = time
- }
-
- private fun updateCurrentTime(){
- current_time_tv.text = formatCalendarToString(
- DateTimeUtils.getCurrentDateTime(),HH_mm)
-
- val date = formatCalendarToString(
- DateTimeUtils.getCurrentDateTime(), yy_MM_dd)
- val weekDay = DateTimeUtils.getWeekDayFromCalendar1(DateTimeUtils.getCurrentDateTime())
- "$date $weekDay".also { current_weekday_tv.text = it }
-
- sendUpdateTimeTask() // 每10s更新一次
- }
-
- fun changeOperationStatus(status:Boolean){
- if (!status){
- updateNoOrderUI()
- }
- }
-
- fun showNoTaskView(haveTask: Boolean){
- setLineInfoView(haveTask)
- }
-
- private fun setLineInfoView(isShow: Boolean){
- if (isShow){
- line_name_tv.visibility = View.VISIBLE
- line_during_tv.visibility = View.VISIBLE
- no_line_tv.visibility = View.GONE
- }else{
- updateNoOrderUI()
- }
- }
-
- private fun updateNoOrderUI() {
- line_name_tv.visibility = View.GONE
- line_during_tv.visibility = View.GONE
- no_line_tv.visibility = View.VISIBLE
- updateNoStationView()
- overMapView?.let {
- it.clearSiteMarkers()
- }
- overMapView?.let {
- it.clearCustomPolyline()
- }
- }
-
- private fun updateNoStationView(){
- station_name_tv.setTextColor(resources.getColor(R.color.m2_next_tv_color))
- station_name_title_tv.text = resources.getString(R.string.m2_p_station_title_tv)
- station_name_tv.text = resources.getString(R.string.m2_p_empty_tv)
- remain_mt.text = resources.getString(R.string.m2_p_empty_remain_km_minute)
- }
-
- override fun createPresenter(): PM2DrivingPresenter {
- return PM2DrivingPresenter(this)
- }
-
- fun updateAutoStatus(isAutoPilot: Boolean) {
- if (isAutoPilot){
- context?.let { auto_tv.setTextColor(ContextCompat.getColor(it,R.color.m2_p_white_color)) }
- context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.auto_button_bg) }
- }else{
- context?.let { auto_tv.setTextColor(ContextCompat.getColor(it,R.color.m2_button_auto_tv_color)) }
- context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.bg_p_m2_auto) }
- }
- }
-
- fun updateLineStations(stations: MutableList){
- var stationsList = mutableListOf()
- for (i in stations.indices){
- val station = stations[i]
- var latLng = LatLng(station.gcjLat,station.gcjLon)
- stationsList.add(latLng)
- }
- overMapView?.let {
- it.drawSiteMarkers(stationsList,
- BitmapFactory.decodeResource(resources,R.drawable.m2_map_staton_icon),0.5f,0.9f)
- }
- }
-
- fun updateStationsInfo(stations: MutableList, i: Int, isArrived: Boolean){
- if (stations.size == 0) return
- if (0<= i && i 0) {
- if (meters / 1000 < 1) {
- disUnit = "米"
- remainDis = meters.toFloat().roundToInt().toString()
- } else {
- disUnit = "公里"
- remainDis = NumberFormatUtil.formatLong(meters.toDouble() / 1000)
- }
- }
-
- val time = ceil(timeInSecond / 60f).toInt()
-
- "$remainDis$disUnit | $time 分钟".also { remain_mt.text = it }
- }
-
- private fun sendUpdateTimeTask() {
- UiThreadHandler.postDelayed({
- updateCurrentTime()
- },LOOP_TIME_TEXT)
- }
-
- companion object {
- private val TAG = PM2DrivingInfoFragment::class.java.simpleName
- const val LOOP_TIME_TEXT = 10 * 1000L
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2HPMapFragment.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2HPMapFragment.kt
deleted file mode 100644
index 05b1101cfd..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2HPMapFragment.kt
+++ /dev/null
@@ -1,122 +0,0 @@
-package com.mogo.och.bus.passenger.ui
-
-import android.os.Bundle
-import com.mogo.commons.AbsMogoApplication
-import com.mogo.commons.mvp.MvpFragment
-import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
-import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMarkerManager
-import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
-import com.mogo.map.marker.MogoMarkerOptions
-import com.mogo.och.bus.passenger.R
-import com.mogo.och.bus.passenger.constant.M2Const.Companion.TYPE_MARKER_M2_LINE
-import com.mogo.och.bus.passenger.presenter.PM2ADASPresenter
-import com.mogo.och.common.module.utils.OCHThreadPoolManager
-import kotlinx.android.synthetic.m2.p_m2_hpmap_fragment.*
-import java.util.*
-
-/**
- * @author: wangmingjun
- * @date: 2022/4/12
- */
-class PM2HPMapFragment :
- MvpFragment() {
- /**
- * 改变自动驾驶状态
- *
- * @param status 2 - running 1 - enable 2 - disable
- */
- override fun getLayoutId(): Int {
- return R.layout.p_m2_hpmap_fragment
- }
-
- override fun getTagName(): String {
- return TAG
- }
-
- override fun initViews() {
- }
-
- override fun initViews(savedInstanceState: Bundle?) {
- super.initViews(savedInstanceState)
- mapBizView.onCreate(savedInstanceState)
- }
-
- override fun onResume() {
- super.onResume()
- mapBizView.onResume()
- }
-
- override fun onLowMemory() {
- super.onLowMemory()
- mapBizView.onLowMemory()
- }
-
- override fun onSaveInstanceState(outState: Bundle) {
- super.onSaveInstanceState(outState)
- mapBizView.onSaveInstanceState(outState)
- }
-
- override fun onPause() {
- super.onPause()
- mapBizView.onPause()
- }
-
- override fun onDestroyView() {
- mapBizView.onDestroy()
- super.onDestroyView()
- }
-
- override fun createPresenter(): PM2ADASPresenter {
- return PM2ADASPresenter(this)
- }
-
- companion object {
- private val TAG = PM2HPMapFragment::class.java.simpleName
- }
-
- fun setMapMaker(
- uuid: String,
- station: MutableList,
- ) {
- //开启线程执行起终点marker设置
- val setMapMarkerRunnable = Runnable {
- d("setMapMaker= " + Thread.currentThread().name,
- uuid + "=latitude=" + station[1] + ",longitude=" + station[0])
- val options = MogoMarkerOptions()
- .owner(TYPE_MARKER_M2_LINE)
- .anchor(0.5f, 0.5f)
- .set3DMode(true)
- .gps(true)
- .controlAngle(true)
- .icon3DRes(R.raw.star_marker)
- .longitude(station[0])
- .latitude(station[1])
- val marker = Objects.requireNonNull(
- getMarkerManager(AbsMogoApplication.getApp())
- )?.addMarker(uuid, options)
- val centerLine =
- getMapUIController()!!
- .getCenterLineInfo(
- station[0], station[1], -1f
- )
- if (null != centerLine && marker != null) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
- marker.setRotateAngle(centerLine.angle!!.toFloat())
- }
- }
- OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable)
- }
-
- fun removeMapMaker(
- uuid: String,
- ) {
- //开启线程移除起终点marker设置
- val removeMapMarkerRunnable = Runnable {
- d("RemoveMapMaker=" + Thread.currentThread().name, uuid)
- Objects.requireNonNull(
- getMarkerManager(AbsMogoApplication.getApp())
- )?.removeMarkers(uuid)
- }
- OCHThreadPoolManager.getsInstance().execute(removeMapMarkerRunnable)
- }
-
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/video/PM2VideoFragment.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/video/PM2VideoFragment.kt
deleted file mode 100644
index 6eee9039d4..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/video/PM2VideoFragment.kt
+++ /dev/null
@@ -1,234 +0,0 @@
-package com.mogo.och.bus.passenger.ui.video
-
-import com.mogo.commons.mvp.MvpFragment
-import com.mogo.och.bus.passenger.R
-import com.mogo.och.bus.passenger.presenter.PM2VideoPresenter
-import com.mogo.och.bus.passenger.ui.widget.video.RotationItem
-import kotlinx.android.synthetic.m2.p_m2_video_fragment.*
-
-/**
- * @author: wangmingjun
- * @date: 2022/4/12
- */
-class PM2VideoFragment :
- MvpFragment() {
-
- private var arrayListOf = mutableListOf()
-
- override fun getLayoutId(): Int {
- return R.layout.p_m2_video_fragment
- }
-
-
- override fun createPresenter(): PM2VideoPresenter {
- return PM2VideoPresenter(this)
- }
-
- companion object {
- private val TAG = PM2VideoFragment::class.java.simpleName
- }
-
- override fun getTagName(): String {
- return TAG
- }
-
- override fun initViews() {
- initResourceData()
- imageVideoRotationView.setData(arrayListOf)
- }
-
- override fun onPause() {
- super.onPause()
- imageVideoRotationView.setPause()
- }
-
- override fun onResume() {
- super.onResume()
- imageVideoRotationView.setResume()
- }
-
- private fun initResourceData() {
- arrayListOf.clear()
- arrayListOf.add(
- RotationItem(
- "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678946244305/dalim2.mp4",
- 1,
- "",
- "1"
- )
- )
-// if (BuildConfig.FLAVOR.contains("dali")){ //大理 目前还都使用的mogo 的cos https://img.zhidaohulian.com/fileServer/online_car_hailing/1678932482045/1080%2A565%20.mp4
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1678932482045/1080%2A565%20.mp4",
-// 1,
-// "",
-// "1"
-// )
-// )
-// }else if (BuildConfig.FLAVOR.contains("yantai")){ //烟台
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357256102/1.jpg",
-// 0,
-// "",
-// "1"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png",
-// 0,
-// "",
-// "2"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357557335/3.mp4",
-// 1,
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png",
-// "3"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg",
-// 0,
-// "",
-// "4"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357834634/5.m4v",
-// 1,
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg",
-// "5"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676358660379/6.m4v",
-// 1,
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg",
-// "6"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360154589/7.jpg",
-// 0,
-// "",
-// "7"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360185500/8.jpg",
-// 0,
-// "",
-// "8"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png",
-// 0,
-// "",
-// "9"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360274126/10.mp4",
-// 1,
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png",
-// "10"
-// )
-// )
-// }else{ // mogo
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357256102/1.jpg",
-// 0,
-// "",
-// "1"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png",
-// 0,
-// "",
-// "2"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357557335/3.mp4",
-// 1,
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357382357/2.png",
-// "3"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg",
-// 0,
-// "",
-// "4"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357834634/5.m4v",
-// 1,
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg",
-// "5"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676358660379/6.m4v",
-// 1,
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357598483/4.jpg",
-// "6"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360154589/7.jpg",
-// 0,
-// "",
-// "7"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360185500/8.jpg",
-// 0,
-// "",
-// "8"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png",
-// 0,
-// "",
-// "9"
-// )
-// )
-// arrayListOf.add(
-// RotationItem(
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360274126/10.mp4",
-// 1,
-// "https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360224773/9.png",
-// "10"
-// )
-// )
-// }
-//
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2BlueToothView.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2BlueToothView.kt
deleted file mode 100644
index f11882f70d..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2BlueToothView.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.mogo.och.bus.passenger.ui.widget
-
-import android.content.Context
-import android.util.AttributeSet
-import android.view.LayoutInflater
-import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
-import com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView
-import com.mogo.eagle.core.utilcode.util.ThreadUtils
-import com.mogo.och.bus.passenger.R
-import kotlinx.android.synthetic.m2.p_m2_view_blue_tooth.view.*
-
-/**
- * 魔戒蓝牙控件
- * 放置于StatusBar右侧位置
- * todo arrow
- */
-class M2BlueToothView @JvmOverloads constructor(
- context: Context,
- attrs: AttributeSet? = null,
- defStyleAttr: Int = 0
-) : BlueToothView(context, attrs, defStyleAttr),IMoGoDevaToolsListener {
-
- init {
- LayoutInflater.from(context).inflate(R.layout.p_m2_view_blue_tooth, this, true)
- }
-
- override fun mofangStatus(status: Boolean) {
- ThreadUtils.runOnUiThread {
- if (status) {
- blueView.setImageResource(R.drawable.m2_blue_tooth_close)
- } else {
- blueView.setImageResource(R.drawable.m2_blue_tooth_open)
- }
- }
- }
-
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2PTrafficLightView.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2PTrafficLightView.kt
deleted file mode 100644
index 8560ce030b..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2PTrafficLightView.kt
+++ /dev/null
@@ -1,179 +0,0 @@
-package com.mogo.och.bus.passenger.ui.widget
-
-import android.content.Context
-import android.util.AttributeSet
-import android.view.LayoutInflater
-import android.widget.LinearLayout
-import com.mogo.eagle.core.data.enums.DataSourceType
-import com.mogo.eagle.core.data.enums.TrafficLightEnum
-import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
-import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
-import com.mogo.eagle.core.utilcode.util.UiThreadHandler
-import com.mogo.och.bus.passenger.R
-import kotlinx.android.synthetic.m2.m2_p_traffic_light_view.view.*
-
-/**
- * bus乘客端:红绿灯view
- *
- * Created on 2022/3/14
- */
-class M2PTrafficLightView @JvmOverloads constructor(
- context: Context?,
- attrs: AttributeSet? = null,
- defStyleAttr: Int = 0
-) : LinearLayout(context, attrs, defStyleAttr), IMoGoTrafficLightListener {
-
- companion object {
- private const val TAG = "M2PTrafficLightView"
- }
-
- private var mCurrentLightId = TrafficLightEnum.BLACK
-
- init {
- init(context)
- }
-
- private fun init(context: Context?) {
- LayoutInflater.from(context).inflate(R.layout.m2_p_traffic_light_view, this, true)
- }
-
- override fun onAttachedToWindow() {
- super.onAttachedToWindow()
- CallerTrafficLightListenerManager.addListener(TAG, this)
- }
-
- override fun onDetachedFromWindow() {
- super.onDetachedFromWindow()
- CallerTrafficLightListenerManager.removeListener(TAG)
- }
-
- /**
- * 展示红绿灯预警
- *
- * @param checkLightId 0-都是默认,1-红,2-黄,3-绿
- * @param lightSource 1:云端下发;2:自车感知
- */
- override fun showTrafficLight(checkLightId: TrafficLightEnum, lightSource: DataSourceType) {
- super.showTrafficLight(checkLightId, lightSource)
- mCurrentLightId = checkLightId
- updateTrafficLightIcon(checkLightId)
- }
-
- /**
- * 关闭红绿灯预警展示,并重制灯态
- */
- override fun disableTrafficLight() {
- super.disableTrafficLight()
- UiThreadHandler.post {
- mCurrentLightId = TrafficLightEnum.BLACK
- this@M2PTrafficLightView.visibility = GONE
- }
- }
-
- /**
- * @param redNum 红灯倒计时
- * @param yellowNum 黄灯倒计时
- * @param greenNum 绿灯倒计时
- */
- override fun changeCountdownTrafficLightNum(redNum: Int, yellowNum: Int, greenNum: Int) {
- super.changeCountdownTrafficLightNum(redNum, yellowNum, greenNum)
- resetView()
- when (mCurrentLightId) {
- TrafficLightEnum.RED -> changeCountdownRed(redNum)
- TrafficLightEnum.YELLOW -> changeCountdownYellow(yellowNum)
- TrafficLightEnum.GREEN -> changeCountdownGreen(greenNum)
- else -> UiThreadHandler.post { m2_p_traffic_light_time_tv.text = "" }
- }
- }
-
- override fun changeCountdownRed(redNum: Int) {
- super.changeCountdownRed(redNum)
- UiThreadHandler.post {
- if (redNum > 0) {
- resetView()
- m2_p_traffic_light_time_tv.text = redNum.toString()
- } else {
- disableTrafficLightCountDown()
- m2_p_traffic_light_time_tv.text = ""
- }
- }
- }
-
- override fun changeCountdownGreen(greenNum: Int) {
- super.changeCountdownGreen(greenNum)
- UiThreadHandler.post {
- if (greenNum > 0) {
- resetView()
- m2_p_traffic_light_time_tv.text = greenNum.toString()
- } else {
- disableTrafficLightCountDown()
- m2_p_traffic_light_time_tv.text = ""
- }
- }
- }
-
- override fun changeCountdownYellow(yellowNum: Int) {
- super.changeCountdownYellow(yellowNum)
- UiThreadHandler.post {
- if (yellowNum > 0) {
- resetView()
- m2_p_traffic_light_time_tv.text = yellowNum.toString()
- } else {
- disableTrafficLightCountDown()
- m2_p_traffic_light_time_tv.text = ""
- }
- }
- }
-
- /**
- * 更新红绿灯icon
- *
- * @param lightId 0-都是默认,1-红,2-黄,3-绿
- */
- private fun updateTrafficLightIcon(lightId: TrafficLightEnum) {
- UiThreadHandler.post {
- when (lightId) {
- TrafficLightEnum.RED -> {
- m2_p_traffic_light_iv.setBackgroundResource(R.drawable.m2_light_red_nor)
- this@M2PTrafficLightView.visibility = VISIBLE
- }
- TrafficLightEnum.YELLOW -> {
- m2_p_traffic_light_iv.setBackgroundResource(R.drawable.m2_light_yellow_nor)
- this@M2PTrafficLightView.visibility = VISIBLE
- }
- TrafficLightEnum.GREEN -> {
- m2_p_traffic_light_iv.setBackgroundResource(R.drawable.m2_light_green_nor)
- this@M2PTrafficLightView.visibility = VISIBLE
- }
- else -> this@M2PTrafficLightView.visibility = GONE
- }
- }
- }
-
- override fun disableTrafficLightCountDown() {
- super.disableTrafficLightCountDown()
- UiThreadHandler.post {
- val layoutParams = layoutParams
- if (layoutParams is MarginLayoutParams) {
- val lp = layoutParams
- lp.width = resources.getDimension(R.dimen.dp_40).toInt()
- setLayoutParams(lp)
- m2_p_traffic_light_time_tv.visibility = GONE
- m2_p_traffic_light_bg.layoutParams.width =
- resources.getDimension(R.dimen.dp_40).toInt()
- }
- }
- }
-
- private fun resetView() {
- val layoutParams = layoutParams
- if (layoutParams is MarginLayoutParams) {
- val lp = layoutParams
- lp.width = resources.getDimension(R.dimen.m2_p_light_width).toInt()
- setLayoutParams(lp)
- m2_p_traffic_light_time_tv.visibility = VISIBLE
- m2_p_traffic_light_bg.layoutParams.width =
- resources.getDimension(R.dimen.m2_p_light_width).toInt()
- }
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2StatusBarView.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2StatusBarView.kt
deleted file mode 100644
index 932bd2f659..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2StatusBarView.kt
+++ /dev/null
@@ -1,109 +0,0 @@
-package com.mogo.och.bus.passenger.ui.widget
-
-import android.annotation.*
-import android.content.Context
-import android.graphics.Color
-import android.util.AttributeSet
-import android.view.LayoutInflater
-import android.view.ViewGroup
-import androidx.constraintlayout.widget.ConstraintLayout
-import chassis.ChassisStatesOuterClass
-import com.mogo.eagle.core.function.api.autopilot.IMoGoBatteryManagementSystemListener
-import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
-import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
-import com.mogo.eagle.core.function.call.autopilot.CallerBatteryManagementSystemListenerManager
-import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
-import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
-import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
-import com.mogo.eagle.core.utilcode.kotlin.*
-import com.mogo.eagle.core.utilcode.util.ClickUtils
-import com.mogo.och.bus.passenger.R
-import kotlinx.android.synthetic.m2.p_m2_view_status_bar.view.*
-import kotlinx.coroutines.*
-import me.jessyan.autosize.utils.AutoSizeUtils
-
-/**
- * @author: wangmingjun
- * @date: 2023/2/14
- */
-class M2StatusBarView @JvmOverloads constructor(
- context: Context, attrs: AttributeSet? = null
-) : ConstraintLayout(context, attrs), IViewControlListener, IMoGoSkinModeChangeListener,
- IMoGoBatteryManagementSystemListener {
-
- companion object {
- const val TAG = "M2StatusBarView"
- }
-
- @Volatile
- private var oldBmsSoc: Float = -1.0f
-
- init {
- LayoutInflater.from(context).inflate(R.layout.p_m2_view_status_bar, this, true)
- setBackgroundColor(Color.parseColor("#80FFFFFF"))
- isClickable = true
- isFocusable = true
- }
-
-
- @SuppressLint("ClickableViewAccessibility")
- override fun onAttachedToWindow() {
- super.onAttachedToWindow()
- post {
- val params: ViewGroup.LayoutParams = getLayoutParams()
- params.height = AutoSizeUtils.dp2px(context,40f)
- layoutParams = params
- }
- //添加view控制
- CallerHmiViewControlListenerManager.addListener(TAG,this)
- // 添加换肤监听
- CallerSkinModeListenerManager.addListener(TAG, this)
- //电量
- CallerBatteryManagementSystemListenerManager.addListener(TAG,this)
-
- progress?.also {
- it.progress = 50
- }
- tv_power_cos?.also {
- it.text = "50%"
- }
- }
-
- override fun onSkinModeChange(skinMode: Int) {
- when (skinMode) {
- 0 -> setStatusBarDarkOrLight(false)
- 1 -> setStatusBarDarkOrLight(true)
- }
- }
-
- override fun onDetachedFromWindow() {
- super.onDetachedFromWindow()
- CallerHmiViewControlListenerManager.removeListener(TAG)
- CallerSkinModeListenerManager.removeListener(TAG)
- CallerDevaToolsManager.hideStatusBar()
- }
-
- @SuppressLint("SetTextI18n")
- override fun onBatteryManagementSystemStates(states: ChassisStatesOuterClass.BMSSystemStates) {
- if (ClickUtils.isClickTooFrequent(this,1000)) {
- return
- }
- val bmsSoc = states.bmsSoc
- try {
- if (oldBmsSoc != bmsSoc ) {
- scope.launch {
- if(bmsSoc >1){
- progress?.also { it.progress = bmsSoc.toInt() }
- tv_power_cos?.also { it.text = "${bmsSoc.toInt()}%" }
- }else{
- val power = (bmsSoc * 100).toInt()
- progress?.also { it.progress = power }
- tv_power_cos?.also {it.text = "$power%" }
- }
- }
- }
- } finally {
- oldBmsSoc = bmsSoc
- }
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2TurnLightView.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2TurnLightView.kt
deleted file mode 100644
index 17d5780835..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/M2TurnLightView.kt
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.mogo.och.bus.passenger.ui.widget
-
-import android.content.Context
-import android.util.AttributeSet
-import com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
-
-/**
- * @author: wangmingjun
- * @date: 2023/2/13
- */
-class M2TurnLightView @JvmOverloads constructor(
- context: Context, attrs: AttributeSet? = null
-) : TurnLightViewStatus(context, attrs) {
-
-
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceGSYVideoPlayer.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceGSYVideoPlayer.kt
deleted file mode 100644
index d3244e8f7b..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceGSYVideoPlayer.kt
+++ /dev/null
@@ -1,127 +0,0 @@
-package com.mogo.och.bus.passenger.ui.widget.video
-
-import android.content.Context
-import android.media.AudioManager
-import android.util.AttributeSet
-import com.mogo.eagle.core.utilcode.mogo.logger.Logger
-import com.shuyu.gsyvideoplayer.utils.Debuger
-import com.shuyu.gsyvideoplayer.utils.GSYVideoType
-import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
-
-/**
- * @author: wangmingjun
- * @date: 2023/2/17
- * 隐藏所有控件的player
- */
-class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer {
- constructor(context: Context?) : super(context)
- constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
-
- init {
- hideWidget()
- GSYVideoType.setShowType(GSYVideoType.SCREEN_MATCH_FULL)
- GSYVideoType.setRenderType(GSYVideoType.GLSURFACE)
- }
-
- override fun hideAllWidget() {
- Logger.d(ImageAndVideoRotation.TAG, "hideAllWidget")
-// hideWidget()
- }
-
- override fun changeUiToNormal() {
- Logger.d(ImageAndVideoRotation.TAG, "changeUiToNormal-hide")
- hideWidget()
- }
-
- override fun changeUiToPreparingShow() {
- Logger.d(ImageAndVideoRotation.TAG, "changeUiToPreparingShow-hide")
- hideWidget()
- }
-
- override fun changeUiToPlayingShow() {
- Logger.d(ImageAndVideoRotation.TAG, "changeUiToPlayingShow")
- setCacheImageViewGone()
- }
-
- override fun changeUiToPauseShow() {
- Logger.d(ImageAndVideoRotation.TAG, "changeUiToPauseShow-hide")
- startPlayLogic()
-// hideWidget()
- }
-
- override fun changeUiToCompleteShow() {
- Logger.d(ImageAndVideoRotation.TAG, "changeUiToCompleteShow")
- setCacheImageViewGone()
- }
-
- override fun changeUiToPlayingBufferingShow() {
- Logger.d(ImageAndVideoRotation.TAG, "changeUiToPlayingBufferingShow -hide")
- hideWidget()
- }
-
- override fun changeUiToError() {
- Logger.d(ImageAndVideoRotation.TAG, "changeUiToError-hide")
- hideWidget()
- }
-
- private fun hideWidget(){
- setViewShowState(mBottomContainer, INVISIBLE)
- setViewShowState(mProgressBar, INVISIBLE)
- setViewShowState(mCurrentTimeTextView, INVISIBLE)
- setViewShowState(mTotalTimeTextView, INVISIBLE)
- setViewShowState(mBottomProgressBar, INVISIBLE)
- setViewShowState(mBackButton, INVISIBLE)
- setViewShowState(mStartButton, INVISIBLE)
-
- setViewShowState(mThumbImageViewLayout, VISIBLE)
- setViewShowState(mThumbImageView, VISIBLE)
-
- setViewShowState(mTopContainer, INVISIBLE)
-
- setViewShowState(mLoadingProgressBar, INVISIBLE)
- setViewShowState(
- mLockScreen, INVISIBLE
- )
-
- setIsTouchWiget(false)
- isFocusableInTouchMode = false
- }
-
- fun setCacheImageViewVisible() {
- Logger.d(ImageAndVideoRotation.TAG, "CacheImageViewVISIBLE")
- setViewShowState(mThumbImageViewLayout, VISIBLE)
-// setViewShowState(mThumbImageView, VISIBLE)
- }
-
- fun setCacheImageViewGone() {
- Logger.d(ImageAndVideoRotation.TAG, "CacheImageViewGONE")
- setViewShowState(mThumbImageViewLayout, INVISIBLE)
-// setViewShowState(mThumbImageView, INVISIBLE)
- }
-
- //失去焦点声音压低
- override fun onLossTransientCanDuck() {
-// setStreamVolume(0.2f)
- setNeedMute(true)
- }
-
- //获取焦点声音恢复
- override fun onGankAudio() {
-// setStreamVolume(5.0f)
- setNeedMute(false)
- }
-
- private fun setStreamVolume(percent: Float){
- var mAudioManager = mContext?.getSystemService(Context.AUDIO_SERVICE) as AudioManager
- var maxVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC)
- var volume = (percent * maxVolume).toInt()
- if (volume < 0 ){
- volume = 0
- }
- mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC,volume,0)
- }
-
- private fun setNeedMute(isMute: Boolean){
- gsyVideoManager?.player?.setNeedMute(isMute)
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceImageView.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceImageView.kt
deleted file mode 100644
index cf0d030989..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceImageView.kt
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.mogo.och.bus.passenger.ui.widget.video
-
-import android.annotation.SuppressLint
-import android.content.Context
-import android.util.AttributeSet
-import android.widget.ImageView
-import android.widget.RelativeLayout
-import com.bumptech.glide.Glide
-import com.bumptech.glide.request.RequestOptions
-import com.mogo.och.bus.passenger.R
-
-/**
- * @author: wangmingjun
- * @date: 2023/2/6
- */
-class AdvanceImageView @JvmOverloads constructor(
- context: Context, attrs: AttributeSet? = null
-) : RelativeLayout(context, attrs) {
-
- private var imageView: ImageView? = null
-
- init {
- initView()
- }
-
- private fun initView() {
- imageView = ImageView(context)
- imageView?.scaleType = ImageView.ScaleType.FIT_XY
- addView(imageView, LayoutParams(-1, -1))
- }
-
- @SuppressLint("CheckResult")
- fun setImagePath(path: String){
- imageView?.setImageResource(R.drawable.m2_p_video_holder)
- imageView?.let { Glide.with(context).asBitmap().load(path)
- .apply(
- RequestOptions().useUnlimitedSourceGeneratorsPool(true)
- .placeholder(R.drawable.m2_p_video_holder)
- .error(R.drawable.m2_p_video_holder)
- .fallback(R.drawable.m2_p_video_holder)
- .centerCrop()
- )
- .into(it) }
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvancePagerAdapter.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvancePagerAdapter.kt
deleted file mode 100644
index db42808e75..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvancePagerAdapter.kt
+++ /dev/null
@@ -1,211 +0,0 @@
-package com.mogo.och.bus.passenger.ui.widget.video
-
-import android.content.Context
-import android.view.View
-import android.view.ViewGroup
-import androidx.viewpager.widget.PagerAdapter
-import androidx.viewpager.widget.ViewPager
-import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
-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.CountDownTimer
-import com.mogo.eagle.core.utilcode.util.UiThreadHandler
-import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
-
-/**
- * @author: wangmingjun
- * @date: 2023/2/6
- */
-class AdvancePagerAdapter(context: Context, viewPager: ViewPager) : PagerAdapter(),
- ViewPager.OnPageChangeListener {
-
- private val mContext: Context = context
- private val mViewPager: ViewPager = viewPager
-
- private var dataList = mutableListOf()
- private var viewList = mutableListOf()
-
- private var lastPosition = -1
-
- private var current = 0
- private val time = 5000
- private var pause = false
- private var countDownTimer: CountDownTimer? = null
-
- fun setData(list: MutableList) {
- if (list.isEmpty()) return
- dataList.addAll(list)
-
- viewList.clear()
-
- list.forEach {
- addView(it)
- }
-
- mViewPager.addOnPageChangeListener(this)
-
- notifyDataSetChanged()
-
- mViewPager.currentItem = 0
-
- if (viewList.size > 0) {
- if (viewList[mViewPager.currentItem] is AdvanceVideoView) {//有人反应第一个是视频不播放这边优化了一下
- Logger.d(ImageAndVideoRotation.TAG, "第一个是视频")
- val video = viewList[mViewPager.currentItem] as AdvanceVideoView
- video.setVideo(gsySampleCallBack)
-
- } else if (viewList[mViewPager.currentItem] is AdvanceImageView) {
- Logger.d(ImageAndVideoRotation.TAG, "startTimer()_1")
- current = 0//换页重新计算时间
- startTimer()
- }
- }
- }
-
- override fun getCount(): Int {
- return dataList.size
- }
-
- override fun isViewFromObject(view: View, `object`: Any): Boolean {
- return view === `object`
- }
-
- override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
- container.removeView(viewList[position])
- }
-
- override fun instantiateItem(container: ViewGroup, position: Int): Any {
- val view: View = viewList[position]
- container.addView(view)
- return view
-
- }
-
- override fun getItemPosition(`object`: Any): Int {
- return POSITION_NONE
- }
-
- private fun addView(item: RotationItem) {
- if (item.type == 1) { // 表示视频
- val videoView = AdvanceVideoView(mContext)
- videoView.setVideoPath(item.path,item.cacheImgPath)
- viewList.add(videoView)
- } else { // 表示图片
- val imageView = AdvanceImageView(mContext)
- imageView.setImagePath(item.path)
- viewList.add(imageView)
- }
- }
-
- fun setPause() {
- pause = true
- if (viewList.size > 0 && viewList[mViewPager.currentItem] is AdvanceVideoView) {
- val videoView = viewList[mViewPager.currentItem] as AdvanceVideoView
- videoView.setPause()
- }
- }
-
- fun setResume() {
- pause = false
- if (viewList.size > 0 && viewList[mViewPager.currentItem] is AdvanceVideoView) {
- val videoView = viewList[mViewPager.currentItem] as AdvanceVideoView
- videoView.setResume()
- }
- }
-
- override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
- }
-
- override fun onPageSelected(position: Int) {
- }
-
- override fun onPageScrollStateChanged(state: Int) {
- // 由于viewpager的预加载机制onPageSelected这里面加载videoview 放的跟玩一样 等操作完成后再播放videoview就香了 很丝滑
- if (state == 0) { //静止,什么都没做
- val currentItem = mViewPager.currentItem
- Logger.d(ImageAndVideoRotation.TAG,
- "state = $state currentItem = $currentItem lastPosition = $lastPosition")
-
- if (viewList.size > 1) { //多于1,才会循环跳转
-
- if (viewList[mViewPager.currentItem] is AdvanceVideoView) {
-
- val videoView = (viewList[mViewPager.currentItem] as AdvanceVideoView)
- videoView.setCacheImageViewVisible()
- videoView.setVideo(gsySampleCallBack)
-
- } else if (viewList[mViewPager.currentItem] is AdvanceImageView) {
- Logger.d(ImageAndVideoRotation.TAG, "startTimer()")
- current = 0//换页重新计算时间
- startTimer()
- }
- lastPosition = mViewPager.currentItem
- }
- }
- }
-
- private var gsySampleCallBack = object : GSYSampleCallBack() {
-
- override fun onPrepared(url: String?, vararg objects: Any?) {
- Logger.d(ImageAndVideoRotation.TAG, "onPrepared--$url")
- }
-
- override fun onAutoComplete(url: String?, vararg objects: Any?) {
- Logger.d(ImageAndVideoRotation.TAG, "onAutoComplete()-$url")
- if (viewList[mViewPager.currentItem] is AdvanceVideoView){
- val videoView = (viewList[mViewPager.currentItem] as AdvanceVideoView)
- if (viewList.size == 1){
- videoView.startPlay(url)
- }else{
- videoView.onVideoReset()
- goNextItemView()
- }
- }
- }
-
- override fun onPlayError(url: String?, vararg objects: Any?) {
- super.onPlayError(url, *objects)
- Logger.d(ImageAndVideoRotation.TAG, "onPlayError()-$url")
- if (viewList[mViewPager.currentItem] is AdvanceVideoView){
- val videoView = (viewList[mViewPager.currentItem] as AdvanceVideoView)
- videoView.onVideoReset()
-// videoView.setCacheImageViewVisible()
- videoView.clearLocalErrorVideo()
- goNextItemView()
- }
- }
- }
-
- private fun startTimer() {
- if (countDownTimer != null){
- countDownTimer?.cancel()
- countDownTimer = null
- }
- countDownTimer = object : CountDownTimer(5000,1000){
- override fun onTick(millisUntilFinished: Long) {
- d(SceneConstant.M_BUS_P + "startTimer", "倒计时秒 = ${millisUntilFinished/1000}" )
- }
-
- override fun onFinish() {
- d(ImageAndVideoRotation.TAG+ "startTimer", "5s到,跳转")
- goNextItemView()
- }
-
- }.start()
- }
-
- /**
- * view 跳转
- */
- private fun goNextItemView() {
- if (mViewPager.currentItem == viewList.size - 1) {//已经到最后一个
- mViewPager.post {
- mViewPager.setCurrentItem(0, true)
- }
- } else {
- mViewPager.post {
- mViewPager.setCurrentItem(mViewPager.currentItem + 1, true)
- }
- }
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceVideoView.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceVideoView.kt
deleted file mode 100644
index 29a678e59a..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceVideoView.kt
+++ /dev/null
@@ -1,248 +0,0 @@
-package com.mogo.och.bus.passenger.ui.widget.video
-
-import android.annotation.SuppressLint
-import android.content.Context
-import android.net.Uri
-import android.util.AttributeSet
-import android.widget.ImageView
-import android.widget.RelativeLayout
-import com.mogo.eagle.core.utilcode.breakpoint.bean.ThreadBean
-import com.mogo.eagle.core.utilcode.breakpoint.callback.IDownload
-import com.mogo.eagle.core.utilcode.breakpoint.utils.DownloadUtils
-import com.mogo.eagle.core.utilcode.mogo.logger.Logger
-import com.mogo.eagle.core.utilcode.util.FileUtils
-import com.mogo.eagle.core.utilcode.util.ThreadUtils
-import com.mogo.eagle.core.utilcode.util.UiThreadHandler
-import com.mogo.och.bus.passenger.R
-import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
-import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
-import java.io.File
-
-/**
- * @author: wangmingjun
- * @date: 2023/2/8
- */
-class AdvanceVideoView @JvmOverloads constructor(
- context: Context, attrs: AttributeSet? = null
-) : RelativeLayout(context, attrs) {
-
- private var videoRelativeLayout: RelativeLayout? = null
- private var cacheImage: ImageView? = null
- private var videoViewPlayer: AdvanceGSYVideoPlayer? = null
- private var gsyVideoOptionBuilder: GSYVideoOptionBuilder? = null
- private var mOnCompletionListener: GSYSampleCallBack? = null
- private var downloadVideoName = ""
- private var fileNetPath: String? = ""
- private var cacheImageUrl: String? = ""
- private var mVideoDirPath: String? = ""
-
- init {
- mVideoDirPath = context.filesDir.absolutePath+ File.separator + "video" + File.separator
-// mVideoDirPath = Config.downLoadPath
- initView()
- }
-
- private fun initView() {
- initVideoView()
- initCacheImgView()
- }
-
- private fun initCacheImgView() {
- cacheImage = ImageView(context)
- cacheImage?.scaleType = ImageView.ScaleType.FIT_XY
-// addView(cacheImage, LayoutParams(-1, -1))
- }
-
- private fun initVideoView() {
- videoRelativeLayout = RelativeLayout(context)
- addView(videoRelativeLayout, LayoutParams(-1, -1))
-
- if (videoViewPlayer === null) {
- //视频播放控件
- videoViewPlayer = AdvanceGSYVideoPlayer(context)
- }
-
- var layoutParams = LayoutParams(-1, -1)
- //设置videoview占满父view播放
- layoutParams.addRule(ALIGN_PARENT_LEFT)
- layoutParams.addRule(ALIGN_PARENT_RIGHT)
- layoutParams.addRule(ALIGN_PARENT_TOP)
- layoutParams.addRule(ALIGN_PARENT_BOTTOM)
-
- videoRelativeLayout?.addView(videoViewPlayer, layoutParams)
- }
-
- fun setVideoPath(path: String,cacheImageUrl: String) {
- // https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357834634/5.m4v
- // https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360274126/10.mp4
- this.fileNetPath = path
- this.cacheImageUrl = cacheImageUrl
- val pathList = path.split("/")
- if (pathList.isNotEmpty()){
- this.downloadVideoName = pathList[pathList.size - 1]
- }
- }
-
- private fun loadCacheImg() {
- // BitmapHelper.getVideoThumbnail(path) /*获取第一帧图*
-// OCHThreadPoolManager.getsInstance().execute {
-// var bitmap = BitmapHelper.getVideoThumbnail(fileNetPath)
- Logger.d(ImageAndVideoRotation.TAG, "setVideoPath")
-// ThreadUtils.runOnUiThread {
-// Logger.d(ImageAndVideoRotation.TAG, "bitmap加载")
- cacheImage?.setImageResource(R.drawable.m2_p_video_holder)
-// cacheImage?.let { //暂时去掉加载首帧图,加载视频时,用本地默认图
-// Glide.with(context).asBitmap().load(cacheImageUrl)
-// .apply(
-// RequestOptions().useUnlimitedSourceGeneratorsPool(true)
-// .placeholder(R.drawable.m2_p_video_holder)
-// .error(R.drawable.m2_p_video_holder)
-// .fallback(R.drawable.m2_p_video_holder)
-// .centerCrop()
-// )
-// .into(it)
-// }
- videoViewPlayer?.thumbImageView = cacheImage
-// setCacheImageViewVisible()
-// }
-// }
- }
-
- fun clearLocalErrorVideo(){
- if (downloadVideoName.isNotEmpty()
- && FileUtils.isFileExists(mVideoDirPath + downloadVideoName)){
- FileUtils.delete(mVideoDirPath + downloadVideoName)
- }
- }
-
- @SuppressLint("CheckResult")
- fun setCacheImageViewVisible() {
- UiThreadHandler.post {
-// cacheImage?.visibility = VISIBLE
- videoViewPlayer?.setCacheImageViewVisible()
- }
- }
-
- fun setCacheImageViewGone() {
- UiThreadHandler.post {
-// cacheImage?.visibility = GONE
- videoViewPlayer?.setCacheImageViewGone()
- }
-
- }
-
- fun setVideo(onCompletionListener: GSYSampleCallBack) {
- loadCacheImg()
- Logger.d(ImageAndVideoRotation.TAG, "setVideo")
- mOnCompletionListener = onCompletionListener
- //判断是否已经下载
- if (downloadVideoName.isNotEmpty()){
- Logger.d(ImageAndVideoRotation.TAG,
- "video local url = $mVideoDirPath$downloadVideoName"
- )
- if (FileUtils.isFileExists(mVideoDirPath+downloadVideoName)){
- Logger.d(ImageAndVideoRotation.TAG, "have cache startPlay")
- startPlay(Uri.fromFile(File(mVideoDirPath+downloadVideoName)).toString())
- return
- }
- startDownLoadVideo()
- }
- }
-
- private fun startDownLoadVideo(){
- //下载视频, 下载成功后再播放
- Logger.d(ImageAndVideoRotation.TAG, "startDownLoadVideo")
- FileUtils.createFileDir(mVideoDirPath)
- DownloadUtils.downLoad(context,fileNetPath,mVideoDirPath
- ,downloadVideoName,5,downListener)
- }
-
- fun startPlay(localVideoPath: String?){
- if (localVideoPath === "") return
- try {
- Logger.d(ImageAndVideoRotation.TAG, "startPlay")
- gsyVideoOptionBuilder = GSYVideoOptionBuilder()
- gsyVideoOptionBuilder
-// ?.setUrl("file:///mnt/sdcard/downloads/$downloadVideoName")
- ?.setUrl(localVideoPath) // "/data/user/0/com.mogo.launcher.f/files/video/"
- ?.setPlayTag(downloadVideoName)
- ?.setCacheWithPlay(false)
- ?.setThumbPlay(false)
- ?.build(videoViewPlayer)
-
- videoViewPlayer?.isFocusableInTouchMode = false
- videoViewPlayer?.setVideoAllCallBack(mOnCompletionListener)
- videoViewPlayer?.startPlayLogic()
- }catch (e: Exception){
- Logger.d(ImageAndVideoRotation.TAG, "startPlay e = ${e.message}")
- }
- }
-
- fun onVideoReset(){
- videoViewPlayer?.onVideoReset()
- mOnCompletionListener = null
- }
-
- fun setPause() {
- if (videoViewPlayer !== null) {
- videoViewPlayer?.onVideoPause()
- }
- }
-
- fun setResume() {
- if (videoViewPlayer !== null) {
- videoViewPlayer?.onVideoResume()
- }
- }
-
- private val downListener = object : IDownload{
- override fun onStart(url: String?) {
- setCacheImageViewVisible()
- Logger.d(ImageAndVideoRotation.TAG, "download-onStart")
- }
-
- override fun onPause(url: String?, threadBean: ThreadBean?) {
- Logger.d(ImageAndVideoRotation.TAG, "download-onPause")
-// UiThreadHandler.postDelayed(Runnable {
-// startDownLoadVideo()
-// },DOWNLOAD_DELAY)
- // todo 测试下网络断掉是否会走onpause,且网络回复也不会继续下载
- }
-
- override fun onProgress(url: String?, length: Int) {
- Logger.d(ImageAndVideoRotation.TAG, "download-onProgress== $length")
- }
-
- override fun onFinished(url: String?, threadBean: ThreadBean?) {
- Logger.d(ImageAndVideoRotation.TAG, "download-onFinished = $url")
- if (url.equals(fileNetPath)){ //发现下载工具在断网又连网后,已完成的任务又都下载,跳转播放出现问题
- //下载完成
- ThreadUtils.runOnUiThread {
- startPlay(Uri.fromFile(File(mVideoDirPath+downloadVideoName)).toString())
- }
- }else{//如果当前文件不存在再次去下载当前的
- Logger.d(ImageAndVideoRotation.TAG, "download-onFinished = not current" +
- ",currentUrl = $fileNetPath ")
- if (FileUtils.isFileExists(mVideoDirPath+downloadVideoName)){
- Logger.d(ImageAndVideoRotation.TAG, "have download startPlay")
- ThreadUtils.runOnUiThread {
- startPlay(Uri.fromFile(File(mVideoDirPath+downloadVideoName)).toString())
- }
- return
- }else{
- startDownLoadVideo()
- }
- }
- }
-
- override fun onError(url: String?, errorMsg: String?) {
- Logger.d(ImageAndVideoRotation.TAG, "download-onError-$errorMsg")
- //出错再次下载
- if (errorMsg != null) {
- if (errorMsg.startsWith("initFailed")){
- startDownLoadVideo()
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceViewPager.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceViewPager.kt
deleted file mode 100644
index 1ec09195c3..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/AdvanceViewPager.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.mogo.och.bus.passenger.ui.widget.video
-
-import android.content.Context
-import android.util.AttributeSet
-import android.view.MotionEvent
-import androidx.viewpager.widget.ViewPager
-
-/**
- * @author: wangmingjun
- * @date: 2023/2/21
- */
-class AdvanceViewPager: ViewPager{
-
- constructor(context: Context) : super(context)
- constructor(context: Context,attrs: AttributeSet?) : super(context,attrs)
-
- override fun onTouchEvent(ev: MotionEvent?): Boolean {
- return false
- }
-
- override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean {
- return false
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/ImageAndVideoRotation.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/ImageAndVideoRotation.kt
deleted file mode 100644
index 92d3b3dbda..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/ImageAndVideoRotation.kt
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.mogo.och.bus.passenger.ui.widget.video
-
-import android.annotation.SuppressLint
-import android.content.Context
-import android.util.AttributeSet
-import android.widget.RelativeLayout
-import androidx.viewpager.widget.ViewPager
-/**
- * @author: wangmingjun
- * @date: 2023/2/6
- */
-class ImageAndVideoRotation @JvmOverloads constructor(
- context: Context, attrs: AttributeSet? = null
-) : RelativeLayout(context, attrs) {
-
- private var viewPager: AdvanceViewPager? = null
- private var pagerAdapter: AdvancePagerAdapter? = null
-
- companion object {
- const val TAG = "ImageAndVideoRotation"
- }
-
- init {
- initView()
- }
-
- @SuppressLint("ClickableViewAccessibility")
- private fun initView() {
- viewPager = AdvanceViewPager(context)
- pagerAdapter = AdvancePagerAdapter(context, viewPager!!)
- viewPager?.adapter = pagerAdapter
-
- addView(viewPager, LayoutParams(-1, -1))
- }
-
- fun setData(list: MutableList){
- pagerAdapter?.setData(list)
- }
-
- fun setPause(){
- pagerAdapter?.setPause()
- }
-
- fun setResume(){
- pagerAdapter?.setResume()
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/RotationItem.kt b/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/RotationItem.kt
deleted file mode 100644
index ed788c6179..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/widget/video/RotationItem.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.mogo.och.bus.passenger.ui.widget.video
-
-/**
- * @author: wangmingjun
- * @date: 2023/2/6
- * type:0 图片
- * type:1 视频
- */
-data class RotationItem(var path: String,
- var type: Int,
- var cacheImgPath: String,
- var title: String)
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/auto_button_bg.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/auto_button_bg.png
deleted file mode 100644
index fb4ddc5279..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/auto_button_bg.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/bus_light_green_nor.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/bus_light_green_nor.png
deleted file mode 100644
index bc9fed952d..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/bus_light_green_nor.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/bus_light_red_nor.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/bus_light_red_nor.png
deleted file mode 100644
index 8732508ded..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/bus_light_red_nor.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/bus_lightyellow_nor.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/bus_lightyellow_nor.png
deleted file mode 100644
index bae01408fd..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/bus_lightyellow_nor.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/clock_bg.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/clock_bg.png
deleted file mode 100644
index a380c3f3b7..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/clock_bg.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/img_drive_bg.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/img_drive_bg.png
deleted file mode 100644
index 7412ab3c90..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/img_drive_bg.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/img_line_bg.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/img_line_bg.png
deleted file mode 100644
index dd78f6fc9e..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/img_line_bg.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/img_time_bg.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/img_time_bg.png
deleted file mode 100644
index ba735834b6..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/img_time_bg.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_blue_tooth_close.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_blue_tooth_close.png
deleted file mode 100644
index 0c292d2cf3..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_blue_tooth_close.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_blue_tooth_open.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_blue_tooth_open.png
deleted file mode 100644
index cccf9e10fa..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_blue_tooth_open.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_green_nor.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_green_nor.png
deleted file mode 100644
index 3135524a79..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_green_nor.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_red_nor.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_red_nor.png
deleted file mode 100644
index e873c2b85e..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_red_nor.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_yellow_nor.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_yellow_nor.png
deleted file mode 100644
index 8046782601..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_light_yellow_nor.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_line_location_bg.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_line_location_bg.png
deleted file mode 100644
index 593db1abc5..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_line_location_bg.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_car_icon.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_car_icon.png
deleted file mode 100644
index 2520ae1c9e..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_car_icon.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_end_icon.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_end_icon.png
deleted file mode 100644
index 2efd3a52eb..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_end_icon.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_start_icon.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_start_icon.png
deleted file mode 100644
index d7ab9231d9..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_start_icon.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_staton_icon.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_staton_icon.png
deleted file mode 100644
index 1314028434..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_map_staton_icon.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_p_video_holder.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_p_video_holder.png
deleted file mode 100644
index d8c5951e43..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_p_video_holder.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_status_bar_logo.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_status_bar_logo.png
deleted file mode 100644
index ad3bd7fda7..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_status_bar_logo.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_youzhuan_open.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_youzhuan_open.png
deleted file mode 100644
index bbd2c12d90..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_youzhuan_open.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_youzhuan_un_open.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_youzhuan_un_open.png
deleted file mode 100644
index 7c0dcaabe1..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_youzhuan_un_open.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_zuozhuan_open.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_zuozhuan_open.png
deleted file mode 100644
index 9bbda22cb7..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_zuozhuan_open.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_zuozhuan_un_open.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_zuozhuan_un_open.png
deleted file mode 100644
index 7c33fddbd9..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable-nodpi/m2_zuozhuan_un_open.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_dashed_line.xml b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_dashed_line.xml
deleted file mode 100644
index f6917017e5..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_dashed_line.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_driving_selector.xml b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_driving_selector.xml
deleted file mode 100644
index 21a6524032..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_driving_selector.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- -
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_auto.xml b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_auto.xml
deleted file mode 100644
index 0497ff212e..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_auto.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_traffic_light.xml b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_traffic_light.xml
deleted file mode 100644
index 5a27da20e0..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_p_m2_traffic_light.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_pnc.xml b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_pnc.xml
deleted file mode 100644
index 0357ebb192..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bg_pnc.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/brakelight_background_daytime.xml b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/brakelight_background_daytime.xml
deleted file mode 100644
index b6cbdbd569..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/brakelight_background_daytime.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bus_light_green_nor.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bus_light_green_nor.png
deleted file mode 100644
index bc9fed952d..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bus_light_green_nor.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bus_light_red_nor.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bus_light_red_nor.png
deleted file mode 100644
index 8732508ded..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bus_light_red_nor.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bus_lightyellow_nor.png b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bus_lightyellow_nor.png
deleted file mode 100644
index bae01408fd..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/bus_lightyellow_nor.png and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/m2_power_seekbar_style.xml b/OCH/mogo-och-bus-passenger/src/m2/res/drawable/m2_power_seekbar_style.xml
deleted file mode 100644
index 3ac0c761ba..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/drawable/m2_power_seekbar_style.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/m2_p_traffic_light_view.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/m2_p_traffic_light_view.xml
deleted file mode 100644
index 360a67883b..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/m2_p_traffic_light_view.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml
deleted file mode 100644
index eb8eed4b1f..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml
+++ /dev/null
@@ -1,235 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_fragment.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_fragment.xml
deleted file mode 100644
index c4a848c6bd..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_fragment.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_hpmap_fragment.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_hpmap_fragment.xml
deleted file mode 100644
index 851d3a25bb..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_hpmap_fragment.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_video_fragment.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_video_fragment.xml
deleted file mode 100644
index 6c82b8c9dc..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_video_fragment.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_video_view.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_video_view.xml
deleted file mode 100644
index 9d75478ee1..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_video_view.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_view_blue_tooth.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_view_blue_tooth.xml
deleted file mode 100644
index 69ae14c394..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_view_blue_tooth.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_view_status_bar.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_view_status_bar.xml
deleted file mode 100644
index 20461e6c5a..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/p_m2_view_status_bar.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/layout/view_turn_light_status_daytime.xml b/OCH/mogo-och-bus-passenger/src/m2/res/layout/view_turn_light_status_daytime.xml
deleted file mode 100644
index 3ba54be149..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/layout/view_turn_light_status_daytime.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/raw/station_marker.nt3d b/OCH/mogo-och-bus-passenger/src/m2/res/raw/station_marker.nt3d
deleted file mode 100644
index a00207ba3f..0000000000
Binary files a/OCH/mogo-och-bus-passenger/src/m2/res/raw/station_marker.nt3d and /dev/null differ
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/values/colors.xml b/OCH/mogo-och-bus-passenger/src/m2/res/values/colors.xml
deleted file mode 100644
index c752b78caf..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/values/colors.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- #FFFFFF
- #0B1E38
- #2D3E5F
-
- #BBDAFB
- #0B1E38
- #5D7199
- #0B1E38
- #6B7EA6
- #2D3E5F
- #A5D8FF
- #1B2546
- #23355D
- #374E7F
-
- #FFFFA28B
- #FFDA1100
- #FF60FFD3
- #FF006D43
- #FFFFE198
- #FFFF9B00
- #59FFFFFF
- #8895B7
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/values/dimens.xml b/OCH/mogo-och-bus-passenger/src/m2/res/values/dimens.xml
deleted file mode 100644
index ca8e0dcfc1..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/values/dimens.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- 60dp
- 40dp
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus-passenger/src/m2/res/values/strings.xml b/OCH/mogo-och-bus-passenger/src/m2/res/values/strings.xml
deleted file mode 100644
index e113235a28..0000000000
--- a/OCH/mogo-och-bus-passenger/src/m2/res/values/strings.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- KM/H
- 您已收车
- 暂无路线
- 起
- 终
- 到达站:
- 下一站:
- 始发站:
- 请携带好随身物品下车。
- 欢迎乘坐蘑菇车联自动驾驶车。
-
- m2_map_style.data
- m2_map_style_extra.data
- Auto
- 下一站:
- 已到站:
- 暂无站点
- —公里 | —分钟
-
-
-
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/constant/URLConst.kt b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/constant/URLConst.kt
deleted file mode 100644
index dce7719222..0000000000
--- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/constant/URLConst.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.mogo.och.bus.constant
-
-import com.mogo.commons.debug.DebugConfig
-
-/**
- * Created on 2021/12/6
- */
-class URLConst {
- companion object {
-
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java
deleted file mode 100644
index bc2f8186b1..0000000000
--- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java
+++ /dev/null
@@ -1,1215 +0,0 @@
-package com.mogo.och.bus.model;
-
-import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
-import static com.mogo.och.bus.constant.BusConst.DELAY_10S;
-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.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;
-import com.mogo.eagle.core.data.map.MogoLocation;
-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.data.telematic.TelematicConstant;
-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;
-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.bus.bean.BusRoutesResponse;
-import com.mogo.och.bus.bean.BusRoutesResult;
-import com.mogo.och.bus.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.constant.BusConst;
-import com.mogo.och.bus.net.OrderServiceManager;
-import com.mogo.och.bus.util.BusAnalyticsManager;
-import com.mogo.och.bus.util.BusSendTripInfoManager;
-import com.mogo.och.bus.util.BusTrajectoryManager;
-import com.mogo.och.common.module.bean.AppConnectMsg;
-import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager;
-import com.mogo.och.common.module.biz.common.socketmessage.data.OCHOperationalMessage;
-import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
-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.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;
-import com.mogo.och.common.module.utils.ToastUtilsOch;
-import com.mogo.och.common.module.voice.VoiceManager;
-import com.mogo.och.common.module.voice.VoiceNotice;
-
-import org.jetbrains.annotations.NotNull;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import io.reactivex.exceptions.UndeliverableException;
-import io.reactivex.functions.Consumer;
-import io.reactivex.plugins.RxJavaPlugins;
-import mogo.telematics.pad.MessagePad;
-
-/**
- * @author congtaowang
- * @since 2021/3/23
- *
- * 小巴订单管理
- */
-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 stationList = new ArrayList<>();
- private BusRoutesResult busRoutesResult = null;
- /**
- * 用来表示是否正在开往下一站
- */
- 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->Presenter:VR mode等
- private IPassengerCallback mPassengerCallback; //乘客核销回调
- private IBusADASStatusCallback mADASStatusCallback;
-
- List points = new ArrayList<>();//全路径信息
-
- private volatile boolean isArrivedStation = false;
-
- //0: 代表没有启动过 1代表是启动第一次,当>=1 代表是重试 每次到站/路线结束清空置为0
- private volatile int firstStartAutopilot = 0;
-
- 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) {
- if (sInstance == null) {
- sInstance = new OrderModel();
- }
- }
- }
- return sInstance;
- }
-
- private OrderModel() {
-
- }
-
- public void init() {
- mContext = AbsMogoApplication.getApp();
- loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
- // 定位监听
- CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,mMapLocationListener);
-// CallerChassisLocationGCJ02ListenerManager.INSTANCE.setListenerHz(TAG,2);//设置5hz, 1s返回一次
-
- MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
-
- //自动驾驶路线规划接口
- CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
-
- //开启自驾后 异常信息返回
- OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener);
-
- OCHSocketMessageManager.INSTANCE.registerSocketMessageListener(//监听运营消息
- OCHSocketMessageManager.msgMonitorType,
- mMogoOnMessageListener);
-
- OCHSocketMessageManager.INSTANCE.registerSocketMessageListener(//监听核销乘客
- OCHSocketMessageManager.msgWriteOffPassengerType,
- mWriteOffPassengeOnMessageListener);
-
- AbnormalFactorsLoopManager.INSTANCE.startLoopAbnormalFactors(mContext);
-
- //2022.1.28
- // 调用Disposable.dispose() 时候会出现InterruptedException 导致出现崩溃
- // The exception could not be delivered to the consumer because it has already canceled/disposed
- // the flow or the excTeption has nowhere to go to begin with
- RxJavaPlugins.setErrorHandler(new Consumer() {
- @Override
- public void accept(Throwable e) {
- if (e instanceof UndeliverableException) {
- e = e.getCause();
- CallerLogger.INSTANCE.d(M_BUS + TAG, "UndeliverableException");
- }
- if ((e instanceof IOException)) {//
- // fine, irrelevant network problem or API that throws on cancellation
- CallerLogger.INSTANCE.d(M_BUS + TAG, "IOException");
- return;
- }
- if (e instanceof InterruptedException) {
- // fine, some blocking code was interrupted by a dispose call
- CallerLogger.INSTANCE.d(M_BUS + TAG, "InterruptedException");
- return;
- }
- if ((e instanceof NullPointerException) || (e instanceof IllegalArgumentException)) {
- // that's likely a bug in the application
- CallerLogger.INSTANCE.d(M_BUS + TAG, "NullPointerException or IllegalArgumentException");
- Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
- return;
- }
- if (e instanceof IllegalStateException) {
- // that's a bug in RxJava or in a custom operator
- CallerLogger.INSTANCE.d(M_BUS + TAG, "IllegalStateException");
- Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
- return;
- }
- CallerLogger.INSTANCE.d(M_BUS + TAG, "Undeliverable exception");
- }
- });
- }
-
- private final IMogoOnMessageListener mMogoOnMessageListener =
- new IMogoOnMessageListener() {
- @Override
- public Class target() {
- return SystemMsg.class;
- }
-
- @Override
- public void onMsgReceived(SystemMsg obj) {
- if (obj == null){
- CallerLogger.INSTANCE.d(M_BUS + TAG, "onMsgReceived = null");
- return;
- }
- CallerLogger.INSTANCE.i(M_BUS + TAG,"onMsgReceived = "+obj.getContext());
- List list = obj.getScreenList();
- CallerLogger.INSTANCE.i(M_BUS + TAG,"onMsgReceived = "+GsonUtils.toJson(list));
-
- if (list != null && list.contains(1)){ // 1司机端
- OCHSocketMessageManager.INSTANCE.pushAppOperationalMsgBox(DateTimeUtil.getCurrentTimeStamp(),
- obj.getContext(),OCHSocketMessageManager.OPERATION_SYSTEM);
- }
-
- if (list != null && list.contains(2)){ //乘客屏
- AppConnectMsg msg = new AppConnectMsg(true,false,obj.getContext());
- CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
- GsonUtils.toJson(msg).getBytes());
- }
-
- }
- };
-
- private final IMogoOnMessageListener mWriteOffPassengeOnMessageListener =
- new IMogoOnMessageListener() {
- @Override
- public Class target() {
- return WriteOffPassenger.class;
- }
-
- @Override
- public void onMsgReceived(WriteOffPassenger passenger) {
- //进行播报
- CallerLogger.INSTANCE.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;
- }
-
- public void setRefreshBusStationsCallback(IRefreshBusStationsCallback callback){
- this.refreshBusStationsCallback = callback;
- }
-
- public void setPassengerCallback(IPassengerCallback callback) {
- this.mPassengerCallback = callback;
- }
-
- public void setSlidePanelHideCallback(ISlidePannelHideCallback callback) {
- this.slidePanelHideCallback = callback;
- }
-
- public void setControllerStatusCallback(IBusControllerStatusCallback callback) {
- 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 coordinateConverterWgsToGcjList(Context mContext, List mogoLatLngList) {
- List 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 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);
-
- OCHSocketMessageManager.INSTANCE.releaseSocketMessageListener(
- OCHSocketMessageManager.msgMonitorType);
- OCHSocketMessageManager.INSTANCE.releaseSocketMessageListener(
- OCHSocketMessageManager.msgWriteOffPassengerType);
-
- AbnormalFactorsLoopManager.INSTANCE.stopLoopAbnormalFactors();
- }
-
- private Object readResolve() {
- // 阻止反序列化,必须实现 Serializable 接口
- 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 onStartAutopilotFailure(@NotNull String startFailedCode, @NonNull String startFailedMessage) {
- BusAnalyticsManager.getInstance().triggerStartAutopilotFailureEventByAdas(startFailedCode, startFailedMessage);
- if (mADASStatusCallback != null && !FunctionBuildConfig.isDemoMode){
- CallerLogger.INSTANCE.e( M_BUS + TAG, "mAdasStartFailureListener = "+startFailedMessage );
- mADASStatusCallback.onStartAdasFailure();
- }
- }
- };
-
- // 自车定位
- private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
-
- @Override
- public void onChassisLocationGCJ02(@Nullable MogoLocation mogoLocation) {
- if (null == mogoLocation) return;
- mLongitude = mogoLocation.getLongitude();
- mLatitude = mogoLocation.getLatitude();
- if (mControllerStatusCallback != null) {
- mControllerStatusCallback.onCarLocationChanged(mogoLocation);
- }
-
- //是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
- if (isGoingToNextStation && !isArrivedStation) {
- judgeArrivedStation(mogoLocation);
- }
- }
- };
-
- //根据围栏判断,是否到达站点
- private void judgeArrivedStation(MogoLocation location) {
-
- if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
- CallerLogger.INSTANCE.e(M_BUS + TAG, "到站数组越界");
- return;
- }
- BusStationBean upcomingStation = stationList.get(backgroundCurrentStationIndex + 1);
-
- double startLon = upcomingStation.getGcjLon();
- double startLat = upcomingStation.getGcjLat();
- double distance = CoordinateUtils.calculateLineDistance(
- startLon, startLat,
- location.getLongitude(), location.getLatitude());
-
- if (distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE) {
- CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-judgeArrivedStation() distance = " + distance
- + " to " + upcomingStation.getName());
- onArriveAt(null); //无自动驾驶到站信息传null
- return;
- }
- }
-
- /**
- * 查询小巴路线
- */
- public void queryBusRoutes() {
- CallerLogger.INSTANCE.d(M_BUS + TAG, "查询小巴路线");
- OrderServiceManager.queryBusRoutes(mContext, new OchCommonServiceCallback() {
- @Override
- public void onSuccess(BusRoutesResponse data) {
- if (data == null
- || data.getResult() == null
- || data.getResult().getSites() == null
- || data.getResult().getSites().isEmpty()) {
- //当为空时,显示无绑定路线图
- CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据:空 ");
- if (refreshBusStationsCallback != null) {
- refreshBusStationsCallback.updateEmptyUi();
- }
- clearAutopilotControlParameters();
- closeBeautificationMode();
- clearStartAutopilotTag();
- removeTipRunnables();
- return;
- }
- CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data);
- updateBusStatus(data.getResult());
- }
-
-
- @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);
- }
- }
- });
-
- }
-
- /**
- * 更新正在运行的任务UI
- *
- * @param stations
- */
- private void updateBusTaskStatus(List stations) {
-
- int arrivingOrArrivedStationIndex = 0;//已经到站或者即将到站的索引呢
-
- for (int i = 0; i < stations.size(); i++) {
- BusStationBean station = stations.get(i);
-
- if (i == 0) { // 首发站 显示在最上面
- if (station.getDrivingStatus() == STATION_STATUS_STOPPED
- && !station.isLeaving()) { //到达第一站
- arrivingOrArrivedStationIndex = i;
- break;
- }
- } else {
- BusStationBean preStation = stations.get(i - 1);
- if ((station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving())
- || (station.getDrivingStatus() == STATION_STATUS_ARRIVING
- && preStation.isLeaving())) {
- //到站未离开 | 即将到站 显示在最中间
- arrivingOrArrivedStationIndex = i;
- break;
- }
- }
- }
-
- BusStationBean arrivingOrArrivedStation = stations.get(arrivingOrArrivedStationIndex);
-
- String lineTime = DateTimeUtil.formatLongToString(
- busRoutesResult.getTaskTime(),
- DateTimeUtil.HH_mm);
-
- if (arrivingOrArrivedStationIndex == 0 ||
- arrivingOrArrivedStation.getDrivingStatus() == STATION_STATUS_STOPPED
- && !arrivingOrArrivedStation.isLeaving()) {
- if (refreshBusStationsCallback != null) {
- refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(), lineTime,
- stationList, arrivingOrArrivedStationIndex, true);
- }
- clearAutopilotControlParameters();
- } else {
- if (refreshBusStationsCallback != null) {
- refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(), lineTime,
- stationList, arrivingOrArrivedStationIndex, false);
- }
- updateAutopilotControlParameters();
- }
- }
-
- /**
- * 重置路线站点状态--结束路线,当前路线恢复到始发站
- */
- public void abortTask() {
- CallerLogger.INSTANCE.d(M_BUS + TAG, "结束当前路线abortTask");
- OrderServiceManager.abortTask(mContext, currentTaskId
- , new OchCommonServiceCallback() {
- @Override
- public void onSuccess(BaseData o) {
- CallerLogger.INSTANCE.d(M_BUS + TAG, "abortTask success: " + o);
- if (o.code == 0) { // 重置成功
- endOrAbortTaskSuccess();
- clearBusStationDatas();
- queryBusRoutes();
- removeTipRunnables();
- // startOrStopQueryPassengerWriteOff(false);
- }
- }
-
- @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);
- }
- }
- });
-
- }
-
- /**
- * 中断或者正常结束任务后的处理
- */
- private void endOrAbortTaskSuccess() {
-
- isGoingToNextStation = false;
- backgroundCurrentStationIndex = 0;
-
- if (busRoutesResult != null) {
- BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.END_TRIP
- , busRoutesResult.getName()
- , ""
- , ""
- , false);
- }
- }
-
- /**
- * 离站上报成功后渲染站点
- * 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
- * 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染
- */
- private void leaveStationSuccess(int leaveIndex, String leaveStation, String nextStation) {
-
- onStartAutopilot(leaveIndex);
-
- leaveTTSTips(nextStation);
-
- sendStartStationToClient(nextStation);
-
- if (busRoutesResult != null) {
- boolean isLastStop = false;
- if (leaveIndex + 1 == stationList.size() - 1) {
- isLastStop = true;
- }
- //给bus外屏发送
- BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.LEAVE_STATION
- , busRoutesResult.getName()
- , leaveStation
- , nextStation
- , isLastStop);
- }
- }
-
- private void onStartAutopilot(int leaveIndex) {
- //开启自动驾驶 2.10.0: 如果自动驾驶状态下开启, 非自动驾驶状态下不开启,需手动点击自动驾驶按钮开启
- isGoingToNextStation = true;
- if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()
- == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
- startAutopilot(false, leaveIndex);
- } else {
- firstStartAutopilot = 0;
- }
- }
-
- /**
- * 开启自动驾驶
- *
- * @param isRestart
- */
- private void startAutopilot(boolean isRestart, int leaveIndex) {
-
- if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
- ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
- ", 请稍候重试");
- triggerUnableStartAPReasonEvent();
- return;
- }
-
- firstStartAutopilot++;
-
- triggerStartServiceEvent(isRestart, false);
-
- AutopilotControlParameters parameters = initAutopilotControlParameters(leaveIndex);
- if (null == parameters) {
- CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-AutopilotControlParameters is empty.");
- return;
- }
-
- CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
-
- CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
- + " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName +
- "isRestart = " + isRestart);
-
- if (mControllerStatusCallback != null) {
- mControllerStatusCallback.startOpenAutopilot();
- }
- }
-
- /**
- * 到站后重置站点状态
- */
- private void arriveSiteStation() {
- if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) { //到站短时间内调用多次
- CallerLogger.INSTANCE.e( M_BUS + TAG, "数组越界" );
- return;
- }
- int arrivedStationIndex = backgroundCurrentStationIndex + 1;
- String arriveStation = stationList.get(arrivedStationIndex).getName();
- String departureStopName = stationList.get(backgroundCurrentStationIndex).getName();
- CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex);
-
- OrderServiceManager.arriveSiteStation(mContext,
- stationList.get(arrivedStationIndex).getSeq(),
- stationList.get(arrivedStationIndex).getSiteId(),
- currentTaskId,
- new OchCommonServiceCallback() {
- @Override
- public void onSuccess(BaseData o) {
- CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-arriveSiteStation success");
- if (o != null && o.code == 0){
- queryBusRoutes();
- isArrivedStation = true;
- isGoingToNextStation = false;
- arriveStationSuccess(arrivedStationIndex, departureStopName, arriveStation);
- }
- //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);
- }
- }
- }
- });
- }
-
- private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, String arriveStation) {
- if (busRoutesResult != null) {
- boolean isLastStop = false;
- if (arrivedStationIndex == busRoutesResult.getSites().size() - 1) {
- isLastStop = true;
- }
- //给bus外屏发送
- BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.ARRIVE_STATION
- , busRoutesResult.getName()
- , departureStopName
- , arriveStation
- , isLastStop);
- }
-
- VoiceManager.INSTANCE.arrivedStation(arriveStation);
-
- sendArrivedStationToClient(arriveStation);
- }
-
- private void sendArrivedStationToClient(String arriveStation) {
- AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,String.format(mContext
- .getString(R.string.bus_arrived_station_tip),
- arriveStation));
- CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
- GsonUtils.toJson(arrivedMsg).getBytes());
- }
-
- private void sendStartStationToClient(String nextStation) {
- AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,String.format(mContext
- .getString(R.string.bus_leave_station_tip),
- nextStation));
- UiThreadHandler.postDelayed(()->{
- CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
- GsonUtils.toJson(arrivedMsg).getBytes());
- },DELAY_10S);
- }
-
- private void sendEndTaskToClient() {
- AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,mContext
- .getString(R.string.bus_end_task_tip));
-
- CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
- GsonUtils.toJson(arrivedMsg).getBytes());
- }
-
- public void sendWriteOffNumToClient(String msg){
- AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,msg);
-
- CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
- GsonUtils.toJson(arrivedMsg).getBytes());
- }
-
- /**
- * 离站上报
- */
- public void leaveStation() {
- CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex);
- String nextStationName = "";
- if (backgroundCurrentStationIndex < stationList.size() - 1) {
- nextStationName = stationList.get(backgroundCurrentStationIndex + 1).getName();
- }
- final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName();
- String finalNextStationName = nextStationName;
- OrderServiceManager.leaveStation(mContext,
- stationList.get(backgroundCurrentStationIndex).getSeq(),
- stationList.get(backgroundCurrentStationIndex).getSiteId(),
- currentTaskId,
- new OchCommonServiceCallback() {
- @Override
- public void onSuccess(BaseData o) {
- isArrivedStation = false;
- CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-离站成功开往下一站====");
- //需要更改当前站和下一站的状态 然后渲染
- //startOrStopQueryPassengerWriteOff(false);
- queryBusRoutes();
- leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, finalNextStationName);
- }
-
-
- @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);
- }
- }
- });
- }
-
- //车站10s后播报
- private void leaveTTSTips(String nextStation) {
- UiThreadHandler.postDelayed(new Runnable() {
- @Override
- public void run() {//延迟10s播报
- VoiceManager.INSTANCE.leaveStation(nextStation);
- }
- },DELAY_10S);
-
- }
-
- /**
- * 关闭美化模式
- */
- public void closeBeautificationMode() {
- if (FunctionBuildConfig.isDemoMode) {//收车结束美化
- FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false; //是否强制绘制引导线
- CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(false);// 同步给乘客屏
- CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);//是否自动启动自驾
- CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为false");
- }
- }
-
- /**
- * 开启自动驾驶到下一站
- */
- public void autoDriveToNextStation() {
- if (backgroundCurrentStationIndex >= stationList.size() - 1) {
- // 当前站是最后一站,结束当前行程
- travelOver();
- return;
- }
- leaveStation();
- }
-
- /**
- * 渲染站点信息
- * 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
- * 车机端展示 三站: 中间为即将到到达或者刚到达的站
- *
- * @param result
- */
- private void updateBusStatus(BusRoutesResult result) {
- if (result == null) return;
- busRoutesResult = result;
- List site = result.getSites();
- currentTaskId = result.getTaskId();
- currentLineId = result.getLineId();
- stationList.clear();
- stationList.addAll(site);
-
- for (int i = 0; i < stationList.size(); i++) {
- BusStationBean s = stationList.get(i);
-
- CallerLogger.INSTANCE.d(M_BUS + "updateBusStationsStatus--",
- "Index=" + i + " ,name = " + s.getName() + " ," + s.isLeaving() + "," + s.getDrivingStatus());
-
- // 是否正在开往下一站
- if (s.isLeaving()) {
- isGoingToNextStation = true;
- }
- // 当前站点信息
- if (s.getDrivingStatus() == STATION_STATUS_STOPPED) {
- backgroundCurrentStationIndex = i;
- break;
- }
- }
-
- if (backgroundCurrentStationIndex == 0 &&
- stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED
- && !stationList.get(0).isLeaving()) { //默认是第一站到站查询
- if (busRoutesResult != null) { // 第一站到站也是行程开始的时候
- BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.START_TRIP
- , busRoutesResult.getName(), "", "", false);
- }
-
- //任务选择后首发前给司机提示任务
- if (busRoutesResult != null){
- beforeTaskTips();
- }
-// startOrStopQueryPassengerWriteOff(true);
- }else {
- removeTipRunnables();
- }
-
- BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
-
- CallerLogger.INSTANCE.d(M_BUS + TAG,
- "行程日志-STATION_STATUS_STOPPED-backgroundCurrentStationIndex="
- + backgroundCurrentStationIndex
- + " isLeaving()=" + currentStation.isLeaving());
-
- // 美化是否开始
- if (FunctionBuildConfig.isDemoMode && (backgroundCurrentStationIndex >= 0
- && backgroundCurrentStationIndex <= stationList.size() - 1)) {//行驶过程中设置美化
- if (stationList.get(backgroundCurrentStationIndex).isLeaving()) {
- startBeautificationMode();
- CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)");
- } else if (backgroundCurrentStationIndex > 0 && backgroundCurrentStationIndex < stationList.size() - 1) {
- //美化模式下 中间站点到站 引导线要一直绘制,所以此处不出强制绘制不传false
- CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
- CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:false(到达中间站)");
- clearStartAutopilotTag();
- } else {
- closeBeautificationMode();
- clearStartAutopilotTag();
- }
- }
-
-
- if (currentStation.isLeaving() && slidePanelHideCallback != null) {
- slidePanelHideCallback.hideSlidePanel();
- }
-
- //更新bus路线面板
- updateBusTaskStatus(stationList);
-
- //需放在currentStationIndex赋值之后
- BusTrajectoryManager.getInstance().syncTrajectoryInfo();
- }
-
- private void beforeTaskTips() {
- if (busRoutesResult == null) return;
-
- removeTipRunnables();
-
- long taskTime = busRoutesResult.getTaskTime();
- long tip3Time = taskTime- 3*60*1000 - DateTimeUtil.getCurrentTimeStamp(); // 首站离开前3分钟提示
- long tip1Time = taskTime-60*1000 - DateTimeUtil.getCurrentTimeStamp(); // 首站离开前1分钟提示
-
- if (tip3Time > 0){
- UiThreadHandler.postDelayed(tip3Runnable,tip3Time);
- }
-
- if (tip1Time > 0){
- UiThreadHandler.postDelayed(tip1Runnable,tip1Time);
- }
- }
-
- Runnable tip3Runnable = new Runnable() {
- @Override
- public void run() {
-
- if (backgroundCurrentStationIndex == 0 && stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED
- && !stationList.get(0).isLeaving()){
- tipStartTask("3");
- }else {
- removeTipRunnables();
- }
- }
- };
-
- private void tipStartTask(String s) {
- String tips = String.format(mContext
- .getString(R.string.bus_before_tips_s), s);
- //展示在运营消息
- OCHSocketMessageManager.INSTANCE.pushAppOperationalMsgBox(
- DateTimeUtil.getCurrentTimeStamp(),
- tips,OCHSocketMessageManager.OPERATION_SYSTEM);
- //语音提示
- VoiceNotice.showNotice(tips);
- }
-
- Runnable tip1Runnable = new Runnable() {
- @Override
- public void run() {
- if (backgroundCurrentStationIndex == 0 && stationList != null &&
- stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED
- && !stationList.get(0).isLeaving()){
- tipStartTask("1");
- }else {
- removeTipRunnables();
- }
- }
- };
-
- public void removeTipRunnables(){
- if (tip3Runnable != null){
- UiThreadHandler.removeCallbacks(tip3Runnable);
- }
- if (tip1Runnable != null){
- UiThreadHandler.removeCallbacks(tip1Runnable);
- }
- }
-
- private void clearStartAutopilotTag() {
- firstStartAutopilot = 0;
- }
-
- private void startBeautificationMode() {
- FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
- CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(true);
- CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true);
- }
-
- public void clearBusStationDatas() {
- if (refreshBusStationsCallback != null) {
- refreshBusStationsCallback.clearBusStationsMarkers();
- }
- }
-
- /**
- * 延时查询站点信心
- */
- private void queryBusStationDelay() {
- handler.sendEmptyMessageDelayed(MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY);
- }
-
- /**
- * 在踩刹车、控制方向盘等操作后,会停止自动驾驶,重启自动驾驶的话相当于重新设置自动驾驶目的地
- */
- public void restartAutopilot() {
- CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-重启自动驾驶===" + isGoingToNextStation);
- //只去启动自动驾驶,不再去上报离站
- startAutopilot(firstStartAutopilot >= 1, -1);
- }
-
- public boolean isRestartAutopilot() {
- return firstStartAutopilot > 1;
- }
-
- /**
- * 行程结束
- */
- private void travelOver() {
-
- if (backgroundCurrentStationIndex >= stationList.size()) {
- CallerLogger.INSTANCE.e(M_BUS + TAG, "travel over index out of station list");
- return;
- }
- CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束====");
- CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
-
- endTask();
- }
-
- /**
- * task正常结束
- */
- private void endTask() {
- CallerLogger.INSTANCE.d(M_BUS + TAG, "任务正常走完endTask()");
- OrderServiceManager.endTask(mContext, currentTaskId
- , new OchCommonServiceCallback() {
- @Override
- public void onSuccess(BaseData o) {
- CallerLogger.INSTANCE.d(M_BUS + TAG, "endTask success: " + o);
- if (o.code == 0) {
- endOrAbortTaskSuccess();
- clearBusStationDatas();
- queryBusRoutes();// 重新获取任务
- removeTipRunnables();
-// startOrStopQueryPassengerWriteOff(false);
- VoiceManager.INSTANCE.endOrder();
- sendEndTaskToClient();
- }
- }
-
- @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);
- }
- }
- });
- }
-
- /**
- * 到站
- *
- * @param data
- */
- public void onArriveAt(MessagePad.ArrivalNotification data) {
- if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
- CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-到站异常,取消后续操作结束");
- return;
- }
-
- //MAP 280 每隔100ms左右返回一次到站, 导致在到达中间站后再次滑动出发后会有时间差,收到一次到站,出现问题
- //此处比对 自驾告诉的到站站点坐标和本地应到站站点坐标, 一致时才能到站
- if (data != null && data.getEndLocation() != null) {
-
- String latitude = NumberFormatUtil.cutOutNumber(data.getEndLocation().getLatitude(), 5); //wgs
- String longitude = NumberFormatUtil.cutOutNumber(data.getEndLocation().getLongitude(), 5);
-
- int arrivedStationIndex = backgroundCurrentStationIndex + 1;
- BusStationBean arriveStation = stationList.get(arrivedStationIndex);
- String arriveLat = NumberFormatUtil.cutOutNumber(arriveStation.getLat(), 5);
- String arriveLon = NumberFormatUtil.cutOutNumber(arriveStation.getLon(), 5);
-
- if (!latitude.equals(arriveLat) || !longitude.equals(arriveLon)) {
- CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-到站拦截,到站坐标不一致");
- return;
- }
- }
-
- if (isArrivedStation) return;
-
- CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-当前==backgroundCurrentStationIndex="
- + backgroundCurrentStationIndex);
-
- arriveSiteStation();
- }
-
- public boolean isGoingToNextStation() {
- return isGoingToNextStation;
- }
-
- // 登出
- public void logout() {
- loginService.loginOut(mLatitude, mLongitude);
- }
-
- public void triggerStartServiceEvent(boolean isRestart, boolean send) {
- if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) {
- return;
- }
- BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
- BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
- BusAnalyticsManager.getInstance().triggerStartAutopilotEvent(isRestart, send,
- currentStation.getName(), nextStation.getName(), currentLineId);
- }
-
- public void triggerUnableStartAPReasonEvent() {
- if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) {
- return;
- }
- BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
- BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
- BusAnalyticsManager.getInstance().triggerUnableStartAPReasonEvent(
- currentStation.getName(), nextStation.getName(), currentLineId,
- OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason());
- }
-
- public BusRoutesResult getBusRoutesResult() {
- return busRoutesResult;
- }
-
- public int getCurrentStationIndex() {
- return backgroundCurrentStationIndex;
- }
-
- /**
- * 将业务订单信息保存,鹰眼可取用
- */
- private void updateAutopilotControlParameters() {
-
- AutopilotControlParameters parameters = initAutopilotControlParameters(-1);
- if (null == parameters) {
- CallerLogger.INSTANCE.e(M_BUS + TAG, "AutopilotControlParameters is empty.");
- return;
- }
- CallerLogger.INSTANCE.d(M_BUS + TAG, "AutopilotControlParameters is update.");
- CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(parameters);
- }
-
- private void clearAutopilotControlParameters() {
- CallerLogger.INSTANCE.d(M_BUS + TAG, "AutopilotControlParameters is clear.");
- CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(null);
- }
-
- private AutopilotControlParameters initAutopilotControlParameters(int leaveIndex) {
- BusStationBean currentStation = null;
- BusStationBean nextStation = null;
-
- if (leaveIndex < 0) {
- if (backgroundCurrentStationIndex + 1 > stationList.size() - 1 || !isGoingToNextStation) {
- CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-mismatch condition1.");
- return null;
- }
- currentStation = stationList.get(backgroundCurrentStationIndex);
- nextStation = stationList.get(backgroundCurrentStationIndex + 1);
- } else {
- if (leaveIndex + 1 > stationList.size() - 1 || !isGoingToNextStation) {
- CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-mismatch condition2.");
- return null;
- }
- currentStation = stationList.get(leaveIndex);
- nextStation = stationList.get(leaveIndex + 1);
- }
-
- AutopilotControlParameters parameters = new AutopilotControlParameters();
- parameters.routeID = busRoutesResult.getLineId();
- parameters.routeName = busRoutesResult.getName();
- parameters.startName = PinYinUtil.getPinYinHeadChar(currentStation.getName());
- parameters.endName = PinYinUtil.getPinYinHeadChar(nextStation.getName());
- parameters.startLatLon = new AutopilotControlParameters
- .AutoPilotLonLat(currentStation.getLat(), currentStation.getLon());
- parameters.endLatLon = new AutopilotControlParameters
- .AutoPilotLonLat(nextStation.getLat(), nextStation.getLon());
- parameters.vehicleType = VEHICLE_TYPE;
- if (parameters.autoPilotLine == null) {
- parameters.autoPilotLine = new AutopilotControlParameters.AutoPilotLine(
- busRoutesResult.getLineId(),
- busRoutesResult.csvFileUrl, busRoutesResult.csvFileMd5,
- busRoutesResult.txtFileUrl, busRoutesResult.txtFileMd5,
- busRoutesResult.contrailSaveTime, busRoutesResult.carModel,
- busRoutesResult.csvFileUrlDPQP, busRoutesResult.csvFileMd5DPQP,
- busRoutesResult.txtFileUrlDPQP, busRoutesResult.txtFileMd5DPQP,
- busRoutesResult.contrailSaveTimeDPQP);
- }
-
- return parameters;
- }
-
- //接驳车不需要实现
- public void startOrStopOrderLoop(boolean start) {
-
- }
- // //接驳车不需要实现
- public void runCarHeartbeat() {
-
- }
-}
diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/IBascApiService.java b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/IBascApiService.java
deleted file mode 100644
index d88d494ebb..0000000000
--- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/IBascApiService.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package com.mogo.och.bus.net;
-import com.mogo.eagle.core.data.BaseData;
-import com.mogo.och.bus.bean.BusCloseTaskRequest;
-import com.mogo.och.bus.bean.BusOrdersResponse;
-import com.mogo.och.bus.bean.BusQueryLineTaskResponse;
-import com.mogo.och.bus.bean.BusQueryLinesResponse;
-import com.mogo.och.bus.bean.BusRoutesResponse;
-import com.mogo.och.bus.bean.BusQueryLineStationsRequest;
-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 io.reactivex.Observable;
-import retrofit2.http.Body;
-import retrofit2.http.GET;
-import retrofit2.http.Header;
-import retrofit2.http.Headers;
-import retrofit2.http.POST;
-import retrofit2.http.Query;
-
-/**
- * 小巴车相关接口
- *
- * @author tongchenfei
- *
- * wiki: http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=48970072
- */
-public interface IBascApiService {
- /**
- * 查询当前运行任务
- *
- * @param request 请求参数
- * @return 接口返回数据
- */
- @Headers( {"Content-Type:application/json;charset=UTF-8"} )
- @POST( "/och-shuttle-cabin/api/business/v1/driver/lineDataWithDriver/query" )
- Observable queryBusRoutes(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusQueryLineStationsRequest request);
-
- /**
- * @param request 请求参数{"destLine":1,"sn":"F803EB2046PZD00229"} 这个接口是重置bus线路的, 不是重置线路中站点的
- * @return 返回值是重置后的车站列表
- * 开始路线
- */
- @Headers( {"Content-Type:application/json;charset=UTF-8"} )
- @POST( "/och-shuttle-cabin/api/flow/v1/driver/startTask" )
- Observable switchLine(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusResetDrivingLineRequest request);
-
- /**
- * 离站,通知服务器
- * @param request
- * @return
- */
- @Headers({"Content-Type:application/json;charset=UTF-8"})
- @POST("/och-shuttle-cabin/api/flow/v1/driver/leave")
- Observable leaveStation(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusUpdateSiteStatusRequest request);
-
- /**
- * 到站 更新到站信息
- * @param request
- * @return
- */
- @Headers({"Content-type:application/json;charset=UTF-8"})
- @POST("/och-shuttle-cabin/api/flow/v1/driver/arrive")
- Observable arriveSiteStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body BusUpdateSiteStatusRequest request);
-
-
- /**
- * 到站查询下车乘客
- * @param request
- * @return
- */
- @Headers({"Content-type:application/json;charset=UTF-8"})
- @POST("/och-shuttle-cabin/api/business/v1/driver/siteArrivedOrders")
- Observable< QueryLeaveAwayPassengersResponse > queryStationLeaveAwayPassengers(@Header ("appId") String appId,@Header("ticket") String ticket,@Body QueryLeaveAwayPassengersRequest request);
-
- /**
- *
- * @param appId
- * @param ticket
- * @param sn
- * @return todo 修改结构
- */
- @Headers({"Content-type:application/json;charset=UTF-8"})
- @GET("/och-shuttle-cabin/api/business/v1/driver/servicingOrders/query")
- Observable queryBusOrders(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
-
- /**
- * 查询车辆配置的所有路线
- * @param appId
- * @param ticket
- * @param sn
- * @return
- */
- @GET("/och-shuttle-cabin/api/business/v1/driver/bindLine/query")
- Observable queryBusLines(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
-
- /**
- * 查询路线当天的任务
- * @param appId
- * @param ticket
- * @param lineId 线路id
- * @return
- */
- @GET("/och-shuttle-cabin/api/business/v1/driver/task/query")
- Observable queryBusTaskByLineId(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("lineId") String lineId);
-
- /**
- * 中止任务
- * @param appId
- * @param ticket
- * @param data
- * @return
- */
- @POST("/och-shuttle-cabin/api/flow/v1/driver/abortTask")
- Observable abortTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusCloseTaskRequest data);
-
- /**
- * 任务正常跑完结束
- * @param appId
- * @param ticket
- * @param data
- * @return
- */
- @Headers( {"Content-type:application/json;charset=UTF-8"} )
- @POST("/och-shuttle-cabin/api/flow/v1/driver/endTask")
- Observable endTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusCloseTaskRequest data);
-}
-
diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/OrderServiceManager.kt b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/OrderServiceManager.kt
deleted file mode 100644
index a239420e1a..0000000000
--- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/OrderServiceManager.kt
+++ /dev/null
@@ -1,203 +0,0 @@
-package com.mogo.och.bus.net
-
-import android.content.Context
-import com.mogo.cloud.passport.MoGoAiCloudClientConfig
-import com.mogo.eagle.core.data.BaseData
-import com.mogo.eagle.core.network.MoGoRetrofitFactory
-import com.mogo.och.bus.bean.*
-import com.mogo.och.common.module.biz.constant.OchCommonConst
-import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
-import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
-import com.mogo.och.common.module.biz.network.interceptor.transformTry
-
-/**
- * @author: wangmingjun
- * @date: 2021/10/20
- */
-object OrderServiceManager {
-
- private val mService: IBascApiService = MoGoRetrofitFactory.getInstance(OchCommonConst.getShuttleUrl()).create(
- IBascApiService::class.java
- )
-
-
- /**
- * 查询小巴车当前任务
- * @param context
- * @param callback
- */
- @JvmStatic
- fun queryBusRoutes(context: Context, callback: OchCommonServiceCallback?) {
- //获取当前高德坐标
- mService.queryBusRoutes(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- BusQueryLineStationsRequest()
- )
- .transformTry()
- .subscribe(OchCommonSubscribeImpl(context, callback, "queryBusRoutes"))
- }
-
- /**
- * 重置线路站点
- * @param context
- * @param taskId
- * @param callback
- */
- @JvmStatic
- fun switchLine(
- context: Context,
- taskId: Int,
- callback: OchCommonServiceCallback?
- ) {
- mService.switchLine(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- BusResetDrivingLineRequest(taskId)
- )
- .transformTry()
- .subscribe(OchCommonSubscribeImpl(context, callback, "switchLine"))
- }
-
- /**
- * 中断当前任务
- * @param context
- * @param taskId
- * @param callback
- */
- @JvmStatic
- fun abortTask(context: Context, taskId: Int, callback: OchCommonServiceCallback?) {
- mService.abortTask(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- BusCloseTaskRequest(taskId)
- )
- .transformTry()
- .subscribe(OchCommonSubscribeImpl(context, callback, "abortTask"))
- }
-
- /**
- * 正常结束任务
- * @param context
- * @param taskId
- * @param callback
- */
- @JvmStatic
- fun endTask(context: Context, taskId: Int, callback: OchCommonServiceCallback?) {
- mService.endTask(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- BusCloseTaskRequest(taskId)
- )
- .transformTry()
- .subscribe(OchCommonSubscribeImpl(context, callback, "endTask"))
- }
-
- /**
- * 离站上报
- * @param context
- * @param seq
- * @param siteId
- * @param callback
- */
- @JvmStatic
- fun leaveStation(
- context: Context,
- seq: Int,
- siteId: Int,
- taskId: Int,
- callback: OchCommonServiceCallback?
- ) {
- mService.leaveStation(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- BusUpdateSiteStatusRequest(taskId, siteId, seq)
- )
- .transformTry()
- .subscribe(OchCommonSubscribeImpl(context, callback, "leaveStation"))
- }
-
- /**
- * 到站更新站点状态
- * @param context
- * @param seq
- * @param siteId
- * @param callback
- */
- @JvmStatic
- fun arriveSiteStation(
- context: Context, seq: Int, siteId: Int, taskId: Int,
- callback: OchCommonServiceCallback?
- ) {
- mService.arriveSiteStation(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- BusUpdateSiteStatusRequest(taskId, siteId, seq)
- )
- .transformTry()
- .subscribe(OchCommonSubscribeImpl(context, callback, "arriveSiteStation"))
- }
-
- /**
- * 查询下车乘客
- * @param context
- * @param seq
- * @param siteId
- * @param callback
- */
- @JvmStatic
- fun queryStationLeaveAwayPassengers(
- context: Context,
- seq: Int,
- siteId: Int,
- callback: OchCommonServiceCallback?
- ) {
- mService.queryStationLeaveAwayPassengers(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- QueryLeaveAwayPassengersRequest(seq, siteId)
- )
- .transformTry()
- .subscribe(OchCommonSubscribeImpl(context, callback, "queryStationLeaveAwayPassengers"))
- }
-
- /**
- * 查询小巴车订单
- * @param context
- * @param callback
- */
- @JvmStatic
- fun queryBusOrders(context: Context, callback: OchCommonServiceCallback?) {
- mService.queryBusOrders(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- MoGoAiCloudClientConfig.getInstance().sn
- )
- .transformTry()
- .subscribe(OchCommonSubscribeImpl(context, callback, "queryBusOrders"))
- }
- @JvmStatic
- fun queryBusLines(context: Context, callback: OchCommonServiceCallback?) {
- mService.queryBusLines(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- MoGoAiCloudClientConfig.getInstance().sn
- )
- .transformTry()
- .subscribe(OchCommonSubscribeImpl(context, callback, "queryBusLines"))
- }
- @JvmStatic
- fun queryBusTaskByLineId(
- context: Context,
- lineId: String?,
- callback: OchCommonServiceCallback?
- ) {
- mService.queryBusTaskByLineId(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- lineId
- )
- .transformTry()
- .subscribe(OchCommonSubscribeImpl(context, callback, "queryBusLines"))
- }
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/login/OchCommonServiceManager.kt b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/login/OchCommonServiceManager.kt
deleted file mode 100644
index d331b69633..0000000000
--- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/login/OchCommonServiceManager.kt
+++ /dev/null
@@ -1,107 +0,0 @@
-package com.mogo.och.bus.net.login
-
-import android.content.Context
-import com.mogo.cloud.passport.MoGoAiCloudClientConfig
-import com.mogo.och.common.module.biz.bean.TaxiLoginSmsReqBean
-import com.mogo.och.common.module.biz.bean.TaxiLoginReqBean
-import com.mogo.och.common.module.biz.bean.TaxiLoginRespBean
-import com.mogo.och.common.module.biz.bean.TaxiLogoutReqBean
-import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean
-import com.mogo.och.common.module.biz.constant.OchCommonConst
-import com.mogo.cloud.passport.MoGoAiCloudClient
-import com.mogo.eagle.core.data.BaseData
-import com.mogo.eagle.core.network.MoGoRetrofitFactory
-import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
-import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
-import com.mogo.och.common.module.biz.network.interceptor.transformTry
-
-/**
- * Created by pangfan on 2021/8/19
- */
-object OchCommonServiceManager {
-
- private const val TAG = "OchCommonServiceManager"
-
- private val mLoginServiceApi: OchLoginServiceApi =
- MoGoRetrofitFactory.getInstance(OchCommonConst.getShuttleUrl()).create(
- OchLoginServiceApi::class.java
- )
-
- /**
- * 获取手机验证码
- * @param context
- * @param callback
- */
- @JvmStatic
- fun getPhoneCode(
- context: Context, phone: String?,
- callback: OchCommonServiceCallback?
- ) {
- mLoginServiceApi.getPhoneCode(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- TaxiLoginSmsReqBean(phone)
- ).transformTry()
- .subscribe(OchCommonSubscribeImpl(context, callback, "getPhoneCode"))
- }
-
- /**
- * 通过验证码登录
- * @param context
- * @param callback
- */
- @JvmStatic
- fun gotoLoginBycode(
- context: Context, phone: String?, code: String?,
- location4Login: TaxiLoginReqBean.Location4Login?,
- callback: OchCommonServiceCallback?
- ) {
- val sn = MoGoAiCloudClientConfig.getInstance().sn
- mLoginServiceApi.gotoLoginBycode4Bus(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- TaxiLoginReqBean(phone, code, sn, location4Login)
- ).transformTry().subscribe(OchCommonSubscribeImpl(context, callback, "gotoLoginBycode"))
- }
-
- /**
- * 登出
- */
- @JvmStatic
- fun logout(
- context: Context,
- location4Login: TaxiLogoutReqBean.Location4Login?,
- callback: OchCommonServiceCallback?
- ) {
- mLoginServiceApi.logout4Bus(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- TaxiLogoutReqBean(MoGoAiCloudClientConfig.getInstance().sn, location4Login)
- ).transformTry().subscribe(OchCommonSubscribeImpl(context, callback, "logout"))
- }
-
- /**
- * 接单状态和登录状态查询
- *
- * @param context
- * @param callback
- */
- @JvmStatic
- fun queryDriverServiceStatus(
- context: Context,
- callback: OchCommonServiceCallback?
- ) {
- if (MoGoAiCloudClientConfig.getInstance().token.isEmpty()) {
- callback?.onFail(OchCommonConst.WAIT_TAKEN, "等待令牌中请稍等")
- MoGoAiCloudClient.getInstance().refreshToken()
- return
- }
- mLoginServiceApi.queryDriverServiceStatusAndLoginStatus(
- MoGoAiCloudClientConfig.getInstance().serviceAppId,
- MoGoAiCloudClientConfig.getInstance().token,
- MoGoAiCloudClientConfig.getInstance().sn
- ).transformTry()
- .subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverServiceStatus"))
- }
-
-}
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/login/OchLoginServiceApi.java b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/login/OchLoginServiceApi.java
deleted file mode 100644
index 81a0206a40..0000000000
--- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/net/login/OchLoginServiceApi.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.mogo.och.bus.net.login;
-
-import com.mogo.eagle.core.data.BaseData;
-import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean;
-import com.mogo.och.common.module.biz.bean.TaxiLoginReqBean;
-import com.mogo.och.common.module.biz.bean.TaxiLoginRespBean;
-import com.mogo.och.common.module.biz.bean.TaxiLoginSmsReqBean;
-import com.mogo.och.common.module.biz.bean.TaxiLogoutReqBean;
-
-import io.reactivex.Observable;
-import retrofit2.http.Body;
-import retrofit2.http.GET;
-import retrofit2.http.Header;
-import retrofit2.http.Headers;
-import retrofit2.http.POST;
-import retrofit2.http.Path;
-import retrofit2.http.Query;
-
-/**
- * Created by pangfan on 2021/8/19
- *
- * 网约车-出租车接口定义
- */
-interface OchLoginServiceApi {
- /**
- * 获取手机验证码
- *
- * @return
- */
- @Headers( {"Content-type:application/json;charset=UTF-8"} )
- @POST( "/och-shuttle-cabin/api/sms/v1/driver/sendSms" )
- Observable getPhoneCode(@Header("appId") String appId
- , @Header("ticket") String ticket, @Body TaxiLoginSmsReqBean data);
-
- /**
- * 通过验证码登录
- * @param appId
- * @param ticket
- * @param data
- * @return
- */
- @Headers( {"Content-type:application/json;charset=UTF-8"} )
- @POST( "/och-shuttle-cabin/api/flow/v1/driver/startOperation" )
- Observable gotoLoginBycode4Bus(@Header("appId") String appId
- , @Header("ticket") String ticket, @Body TaxiLoginReqBean data);
-
- /**
- * 登出接口
- */
- @Headers({"Content-type:application/json;charset=UTF-8"})
- @POST("/och-shuttle-cabin/api/flow/v1/driver/endOperation")
- Observable logout4Bus(@Header("appId") String appId, @Header("ticket") String ticket,
- @Body TaxiLogoutReqBean data);
-
- /**
- * 接单状态和登录状态查询 出租车司机端、小巴车司机端、小巴车乘客端
- * @param sn
- * @return
- */
- @Headers( {"Content-type:application/json;charset=UTF-8"} )
- @GET( "/och-shuttle-cabin/api/business/v1/driver/loginStatus")
- Observable queryDriverServiceStatusAndLoginStatus(@Header("appId") String appId
- , @Header("ticket") String ticket, @Query("sn") String sn);
-
-}
diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusOrdersResponse.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/bean/BusOrdersResponse.java
similarity index 100%
rename from OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusOrdersResponse.java
rename to OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/bean/BusOrdersResponse.java
diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusRoutesResponse.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/bean/BusRoutesResponse.java
similarity index 100%
rename from OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusRoutesResponse.java
rename to OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/bean/BusRoutesResponse.java
diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusStationBean.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/bean/BusStationBean.java
similarity index 100%
rename from OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/bean/BusStationBean.java
rename to OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/bean/BusStationBean.java
diff --git a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/callback/IRefreshBusStationsCallback.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/callback/IRefreshBusStationsCallback.java
index 03fcce170f..95292ef6a6 100644
--- a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/callback/IRefreshBusStationsCallback.java
+++ b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/callback/IRefreshBusStationsCallback.java
@@ -1,5 +1,7 @@
package com.mogo.och.bus.callback;
+import com.mogo.och.bus.bean.BusStationBean;
+
import java.util.List;
/**
diff --git a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/fragment/BusFragment.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/fragment/BusFragment.java
index 04308c836b..cd85e7eaa1 100644
--- a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/fragment/BusFragment.java
+++ b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/fragment/BusFragment.java
@@ -25,6 +25,7 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.och.bus.R;
+import com.mogo.och.bus.bean.BusStationBean;
import com.mogo.och.bus.constant.BusConst;
import com.mogo.och.bus.net.login.LoginBusImpl;
import com.mogo.och.bus.presenter.BusPresenter;
diff --git a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/BusLineModel.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/BusLineModel.java
index 723ee5d32a..fe5138ed11 100644
--- a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/BusLineModel.java
+++ b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/BusLineModel.java
@@ -9,6 +9,7 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.och.bus.R;
import com.mogo.och.bus.bean.BusQueryLineTaskResponse;
import com.mogo.och.bus.bean.BusQueryLinesResponse;
+import com.mogo.och.bus.bean.BusRoutesResponse;
import com.mogo.och.bus.callback.IBusLinesCallback;
import com.mogo.och.bus.net.OrderServiceManager;
import com.mogo.och.bus.ui.BusSwitchLineActivity;
diff --git a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/OrderModel.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/OrderModel.java
index 782e846a97..1eaef27632 100644
--- a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/OrderModel.java
+++ b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/OrderModel.java
@@ -25,6 +25,8 @@ import com.mogo.eagle.core.data.BaseData;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
+import com.mogo.och.bus.bean.BusRoutesResponse;
+import com.mogo.och.bus.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;
diff --git a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/net/IBascApiService.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/net/IBascApiService.java
index 14820d0c07..2c46b0fb79 100644
--- a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/net/IBascApiService.java
+++ b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/net/IBascApiService.java
@@ -1,9 +1,11 @@
package com.mogo.och.bus.net;
import com.mogo.eagle.core.data.BaseData;
import com.mogo.och.bus.bean.BusCloseTaskRequest;
+import com.mogo.och.bus.bean.BusOrdersResponse;
import com.mogo.och.bus.bean.BusQueryLineTaskResponse;
import com.mogo.och.bus.bean.BusQueryLinesResponse;
import com.mogo.och.bus.bean.BusQueryLineStationsRequest;
+import com.mogo.och.bus.bean.BusRoutesResponse;
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersRequest;
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersResponse;
import com.mogo.och.bus.bean.BusResetDrivingLineRequest;
diff --git a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/net/OrderServiceManager.kt b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/net/OrderServiceManager.kt
index 1857146fcd..a239420e1a 100644
--- a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/net/OrderServiceManager.kt
+++ b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/net/OrderServiceManager.kt
@@ -27,7 +27,7 @@ object OrderServiceManager {
* @param callback
*/
@JvmStatic
- fun queryBusRoutes(context: Context, callback: OchCommonServiceCallback?) {
+ fun queryBusRoutes(context: Context, callback: OchCommonServiceCallback?) {
//获取当前高德坐标
mService.queryBusRoutes(
MoGoAiCloudClientConfig.getInstance().serviceAppId,
@@ -48,7 +48,7 @@ object OrderServiceManager {
fun switchLine(
context: Context,
taskId: Int,
- callback: OchCommonServiceCallback?
+ callback: OchCommonServiceCallback?
) {
mService.switchLine(
MoGoAiCloudClientConfig.getInstance().serviceAppId,
@@ -167,7 +167,7 @@ object OrderServiceManager {
* @param callback
*/
@JvmStatic
- fun queryBusOrders(context: Context, callback: OchCommonServiceCallback?) {
+ fun queryBusOrders(context: Context, callback: OchCommonServiceCallback?) {
mService.queryBusOrders(
MoGoAiCloudClientConfig.getInstance().serviceAppId,
MoGoAiCloudClientConfig.getInstance().token,
diff --git a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java
index a0885dbae8..3e97df4a91 100644
--- a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java
+++ b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java
@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
+import com.mogo.och.bus.bean.BusStationBean;
import com.mogo.och.bus.bean.WriteOffPassenger;
import com.mogo.och.bus.callback.IBusADASStatusCallback;
import com.mogo.och.bus.callback.IBusControllerStatusCallback;