diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/line/LineManager.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/line/LineManager.kt index 4e73682e5a..fc45ca1caa 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/line/LineManager.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/line/LineManager.kt @@ -10,10 +10,26 @@ import com.mogo.och.data.bean.LineInfo * 订单中 */ object LineManager : CallerBase() { - + /** + * 线路信息 + */ + @JvmStatic var lineInfos: LineInfo? = null + + /** + * 启动自驾信息 + */ + @JvmStatic var contraiInfo: ContraiInfo? = null + + /** + * 起始站点 + */ var startStation: BusStationBean? = null + + /** + * 结束站点 + */ var endStation: BusStationBean? = null @JvmStatic diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/logchainanalytic/OchChainLogManager.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/logchainanalytic/OchChainLogManager.kt index 95670c2da0..ccf997dd39 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/logchainanalytic/OchChainLogManager.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/logchainanalytic/OchChainLogManager.kt @@ -106,13 +106,12 @@ object OchChainLogManager { @JvmStatic fun writeChainLog(title: String, info: String, upload:Boolean = true, eventID:String=EVENT_KEY_INFE_WITH_CHANGE, patch:HashMap?=null) { try { - d(SceneConstant.M_OCHCOMMON + TAG, title) - d(SceneConstant.M_OCHCOMMON + TAG, info) + d("${TAG}_${eventID}", "${title}_${info}") if(upload) { val params = HashMap() addCommonParams(params) - params["info"] = title - params["changeInfo"] = info + params["title"] = title + params["info"] = info patch?.let { params.putAll(it) } diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/loop/BizLoopManager.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/loop/BizLoopManager.kt index d91edc23b4..19184579d7 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/loop/BizLoopManager.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/loop/BizLoopManager.kt @@ -1,6 +1,11 @@ package com.mogo.och.common.module.manager.loop +import android.os.Handler +import android.os.HandlerThread +import android.os.Looper +import android.os.Message import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P import com.mogo.och.common.module.utils.RxUtils import io.reactivex.Observable @@ -21,6 +26,20 @@ object BizLoopManager { private val mControllerStatusCallbackMap = ConcurrentHashMap() + val frequentThread = HandlerThread("och_biz") + + var handler:Handler + + init { + frequentThread.start() + handler = object : Handler(frequentThread.looper) { + override fun handleMessage(msg: Message) { + super.handleMessage(msg) + CallerLogger.d(SceneConstant.M_BUS_P + TAG, "2分钟没有触摸屏幕导致锁屏") + } + } + } + const val LOOP_LINE_2S = 2 * 1000L const val LOOP_LINE_1S = 1 * 1000L const val LOOP_DELAY = 100L @@ -101,4 +120,14 @@ object BizLoopManager { RxUtils.disposeSubscribe(mQueryLineDisposable) } + + fun postDelayed(function:Runnable,delayMillis:Long){ + handler.postDelayed(function,delayMillis) + + } + + fun removeCallback(function:Runnable){ + handler.removeCallbacks(function) + } + } \ No newline at end of file diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/bean/BusQueryLineTaskResponse.java b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/bean/BusQueryLineTaskResponse.java index 3bd282f492..3e4124a352 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/bean/BusQueryLineTaskResponse.java +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/bean/BusQueryLineTaskResponse.java @@ -19,22 +19,6 @@ public class BusQueryLineTaskResponse extends BaseData { public List data; - public static void save2Db(@NotNull BusQueryLineTaskResponse data,long lineId) { - List save2Db = new ArrayList<>(); - TaskDataBean temp = null; - for (Result datum : data.data) { - temp = new TaskDataBean(); - temp.setLineId((long)lineId); - temp.setTaskId((long)datum.id); - temp.setTaskDate(DateTimeUtil.getCurrentDateZero()); - temp.setTaskStartTime(datum.taskStartTime); - temp.setTaskgetTime(DateTimeUtil.getCurrentTimeStamp()); - temp.setStatus(TaskDataBean.unUse); - save2Db.add(temp); - } - TaskRepository.INSTANCE.addOrUpdate(save2Db,(long)lineId); - } - public static class Result { public long id; public long taskStartTime; diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/bean/CarExecutableTaskResponse.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/bean/CarExecutableTaskResponse.kt index 62af69aace..c6f233a517 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/bean/CarExecutableTaskResponse.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/bean/CarExecutableTaskResponse.kt @@ -26,6 +26,9 @@ data class CarExecutableTaskResponse(val data: List?) : BaseData(){ val lineId:Long?, var lineName:String?, ) { + /** + * 把线路net bean 转为db bean + */ fun toDbBean(endStationName:String?): LineDataBean { val result = LineDataBean() result.lineId = lineId @@ -45,6 +48,9 @@ data class CarExecutableTaskResponse(val data: List?) : BaseData(){ var lat:Double?, ){ companion object{ + /** + * 把net站点信息转为数据库bean信息并保存 + */ fun toDbBeans(siteListInfo: List,lineId: Long?): List { val reuslts = mutableListOf() var tempSiteDataBean:SiteDataBean?=null @@ -72,6 +78,9 @@ data class CarExecutableTaskResponse(val data: List?) : BaseData(){ val txtFileMd5:String?, val contrailSaveTime:Long?, ) { + /** + * 把net bean转为数据库bean + */ fun toDbBean(lineId: Long?): ContrailDataBean { val result = ContrailDataBean() result.lineId = lineId @@ -91,6 +100,10 @@ data class CarExecutableTaskResponse(val data: List?) : BaseData(){ val taskStartTime:Long?, ) { companion object { + + /** + * 把网络传来的任务信息转成数据库结构 + */ fun toDbBeans(taskInfs: List, lineId: Long? ): List { val reuslts = mutableListOf() @@ -110,6 +123,9 @@ data class CarExecutableTaskResponse(val data: List?) : BaseData(){ companion object{ + /** + * 保存 线路信息、自驾轨迹信息、站点信息和任务到数据库 + */ fun save2Db(data: CarExecutableTaskResponse) { val lineList = mutableListOf() val contrailList = mutableListOf() diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/IBusADASStatusCallback.java b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/IBusADASStatusCallback.java index 71bb55e671..61baba1ffc 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/IBusADASStatusCallback.java +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/IBusADASStatusCallback.java @@ -1,11 +1,32 @@ package com.mogo.och.weaknet.callback; +import com.mogo.och.data.bean.BusStationBean; + +import java.util.List; + /** * Created on 2021/9/8 - * + *

* Model->Presenter回调:ADAS相关(自动驾驶状态回调,到达终点等等) */ public interface IBusADASStatusCallback { //自驾返回失败 void onStartAdasFailure(); + + void startOpenAutopilot(); + + void updateBusTaskStatus(String lineName, String lintTime, + List stationList, + int arrivingOrArrivedIndex, + boolean isArrived); + + + /** + * 结束清理一遍、选择任务后清理一遍 + */ + void clearBusStationsMarkers(); + + void updateEmptyUi(); + + void hideSlidePanel(); } diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/IBusControllerStatusCallback.java b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/IBusControllerStatusCallback.java deleted file mode 100644 index 045ddc1be9..0000000000 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/IBusControllerStatusCallback.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.mogo.och.weaknet.callback; - -import com.mogo.eagle.core.data.map.MogoLocation; - -/** - * Created on 2021/9/10 - * - * Model->Presenter回调:状态控制器监听(accOn、adas ui show、voice ui show、push ui show、v2x ui show等等) - */ -public interface IBusControllerStatusCallback { - //开始开启自动驾驶 - void startOpenAutopilot(); -} diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/IRefreshBusStationsCallback.java b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/IRefreshBusStationsCallback.java deleted file mode 100644 index 20b4c86690..0000000000 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/IRefreshBusStationsCallback.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.mogo.och.weaknet.callback; - -import com.mogo.och.data.bean.BusStationBean; - -import java.util.List; - -/** - * @author: wangmingjun - * @date: 2021/10/22 - */ -public interface IRefreshBusStationsCallback { - void updateBusTaskStatus(String lineName,String lintTime, - List stationList, - int arrivingOrArrivedIndex, - boolean isArrived); - - /** - * 结束清理一遍、选择任务后清理一遍 - */ - void clearBusStationsMarkers(); - - void updateEmptyUi(); -} diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/ISlidePannelHideCallback.java b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/ISlidePannelHideCallback.java deleted file mode 100644 index 0865abccfe..0000000000 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/callback/ISlidePannelHideCallback.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.mogo.och.weaknet.callback; - -/** - * @author: wangmingjun - * @date: 2021/10/22 - */ -public interface ISlidePannelHideCallback { - void hideSlidePanel(); -} diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/database/bean/ContrailDataBean.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/database/bean/ContrailDataBean.kt index c10288b71f..f07542ca67 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/database/bean/ContrailDataBean.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/database/bean/ContrailDataBean.kt @@ -10,7 +10,7 @@ import com.mogo.och.data.bean.ContraiInfo import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager /** - * 启动自驾的信息 + * 启动自驾使用的轨迹信息 */ @Entity(tableName = ContrailDataBean.ContrailDataTable) data class ContrailDataBean( diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/database/bean/EventDataBean.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/database/bean/EventDataBean.kt index a98b5ec624..28c02bbbbb 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/database/bean/EventDataBean.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/database/bean/EventDataBean.kt @@ -4,6 +4,9 @@ import androidx.room.ColumnInfo import androidx.room.Entity import androidx.room.PrimaryKey +/** + * 上报给服务器端的 选择线路、滑动出发、进站 完成线路的对象 + */ @Entity(tableName = EventDataBean.evnetDataTable) data class EventDataBean( diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/fragment/BaseShuttleTabFragment.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/fragment/BaseShuttleTabFragment.kt index 5080a5ea84..72ac73b75d 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/fragment/BaseShuttleTabFragment.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/fragment/BaseShuttleTabFragment.kt @@ -31,7 +31,6 @@ import com.mogo.eagle.core.function.smp.view.SmallMapView import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isB1 import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isB2 import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener -import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.map.MogoMap import com.mogo.och.common.module.utils.ResourcesUtils @@ -40,7 +39,6 @@ import com.mogo.och.common.module.utils.SoundPoolHelper import com.mogo.och.common.module.wigets.SlidePanelView import com.mogo.och.shuttle.weaknet.R import com.mogo.och.weaknet.constant.BusConst -import com.mogo.och.weaknet.model.OrderModel.busRoutesResult import com.mogo.och.weaknet.view.BizMapView import org.greenrobot.eventbus.EventBus @@ -150,7 +148,6 @@ abstract class BaseShuttleTabFragment?> : MvpFragme findViewById(R.id.btnAutopilotArrive)!!.setOnClickListener { view: View? -> debugArrivedStation() } tvArrived!!.setOnClickListener { view: View? -> - ToastUtils.showLong("weak_net") onArriveStation() } @@ -504,66 +501,6 @@ abstract class BaseShuttleTabFragment?> : MvpFragme } } - /** - * Bus调试信息:线路、轨迹等信息 - * - * - * START - */ - private var busTestBar: View? = null - private var lineIdTV: TextView? = null - private var lineNameTV: TextView? = null - private var trajMd5TV: TextView? = null - private var stopMd5TV: TextView? = null - private var trajMd5DPQPTV: TextView? = null - private var stopMd5DPQPTV: TextView? = null - - fun showHideTestBar() { - if (busTestBar == null) { - busTestBar = findViewById(R.id.module_mogo_och_bus_test_bar) - lineIdTV = findViewById(R.id.bus_test_bar_current_line_id) - lineNameTV = findViewById(R.id.bus_test_bar_current_line_name) - trajMd5TV = findViewById(R.id.bus_test_bar_current_traj_md5) - stopMd5TV = findViewById(R.id.bus_test_bar_current_stop_md5) - trajMd5DPQPTV = findViewById(R.id.bus_test_bar_current_traj_md5_dpqp) - stopMd5DPQPTV = findViewById(R.id.bus_test_bar_current_stop_md5_dpqp) - } - - if (busTestBar!!.visibility == View.VISIBLE) { - busTestBar!!.visibility = View.GONE - } else { - val routesResult = busRoutesResult - lineIdTV!!.text = - "lineId:" + (routesResult?.lineId?.toString() ?: "") - lineNameTV!!.text = - "lineName:" + (if (routesResult == null) "" else routesResult.name) - trajMd5TV!!.text = "TMd5:" + (if (routesResult == null) "" else routesResult.csvFileMd5) - stopMd5TV!!.text = - "SMd5:" + (if (routesResult == null) "" else routesResult.txtFileMd5) - trajMd5DPQPTV!!.text = - "TMd5DPQP:" + (if (routesResult == null) "" else routesResult.csvFileMd5DPQP) - stopMd5DPQPTV!!.text = - "SMd5DPQP:" + (if (routesResult == null) "" else routesResult.txtFileMd5DPQP) - busTestBar!!.visibility = View.VISIBLE - } - } - - fun updateBusTestBarInfo() { - if (busTestBar != null && busTestBar!!.visibility == View.VISIBLE) { - val routesResult = busRoutesResult - lineIdTV!!.text = - "lineId:" + (routesResult?.lineId?.toString() ?: "") - lineNameTV!!.text = "lineName:" + (if (routesResult == null) "" else routesResult.name) - trajMd5TV!!.text = - "TMd5:" + (if (routesResult == null) "" else routesResult.csvFileMd5) - stopMd5TV!!.text = - "SMd5:" + (if (routesResult == null) "" else routesResult.txtFileMd5) - trajMd5DPQPTV!!.text = - "TMd5DPQP:" + (if (routesResult == null) "" else routesResult.csvFileMd5DPQP) - stopMd5DPQPTV!!.text = - "SMd5DPQP:" + (if (routesResult == null) "" else routesResult.txtFileMd5DPQP) - } - } /** * END diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/fragment/ShuttleFragment.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/fragment/ShuttleFragment.kt index 788163ffd2..cfd7163ff1 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/fragment/ShuttleFragment.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/fragment/ShuttleFragment.kt @@ -49,6 +49,9 @@ import java.util.Objects */ class ShuttleFragment : BaseShuttleTabFragment(), SlidePanelView.OnSlidePanelMoveToEndListener, View.OnClickListener { + + private val TAG = "BusFragment" + private var mSwitchLine: TextView? = null //切换路线 private var mLineName: MarqueeTextView? = null private var mTaskTime: TextView? = null @@ -66,10 +69,6 @@ class ShuttleFragment : BaseShuttleTabFragment( return "BusFragment" } - override fun onActivityCreated(savedInstanceState: Bundle?) { - super.onActivityCreated(savedInstanceState) - } - override fun onDestroyView() { if (mPresenter != null) { mPresenter!!.onDestroy(this) @@ -102,10 +101,6 @@ class ShuttleFragment : BaseShuttleTabFragment( mSwitchLine!!.setOnClickListener(this) - mLineName!!.setOnLongClickListener { - showHideTestBar() - false - } } @Subscribe(threadMode = ThreadMode.MAIN) @@ -152,16 +147,13 @@ class ShuttleFragment : BaseShuttleTabFragment( return BusPresenter(this) } - override fun onResume() { - super.onResume() - } - fun hideStationsPanel() { + private fun hideStationsPanel() { groupStationsPanel!!.visibility = View.GONE noDataView!!.visibility = View.VISIBLE } - fun showStationsPanel() { + private fun showStationsPanel() { groupStationsPanel!!.visibility = View.VISIBLE noDataView!!.visibility = View.GONE } @@ -199,7 +191,7 @@ class ShuttleFragment : BaseShuttleTabFragment( showOrHideSwitchLineBtn(false) mLineName!!.text = lineName - mTaskTime!!.text = getString(R.string.bus_line_time_tag) + lineTime + mTaskTime!!.text = ResourcesUtils.getString(R.string.bus_line_time_tag,lineTime) // 渲染小巴路线数据 updateBusStationStatus(stationList, arrivingOrArrivedIndex, isArrived) }, UiThreadHandler.MODE.QUEUE) @@ -254,7 +246,6 @@ class ShuttleFragment : BaseShuttleTabFragment( updateTwoStationsUI(stationList, arrivingOrArrivedIndex, isArrived) } - updateBusTestBarInfo() } /** @@ -539,7 +530,4 @@ class ShuttleFragment : BaseShuttleTabFragment( } } - companion object { - const val TAG: String = "BusFragment" - } } diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/BusLineModel.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/BusLineModel.kt index 5436035600..251097a12f 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/BusLineModel.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/BusLineModel.kt @@ -6,6 +6,7 @@ import com.mogo.commons.AbsMogoApplication import com.mogo.commons.storage.SharedPrefsMgr import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager +import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager import com.mogo.eagle.core.network.utils.digest.DigestUtils import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d @@ -42,6 +43,7 @@ import com.mogo.och.weaknet.net.OrderServiceManager import com.mogo.och.weaknet.ui.BusSwitchLineActivity import io.reactivex.Observer import io.reactivex.disposables.Disposable +import java.util.concurrent.atomic.AtomicBoolean /** * @author: wangmingjun @@ -65,25 +67,32 @@ object BusLineModel { // 当前任务的站点列表 var stationList:MutableList? = mutableListOf() + + private val isRequesting = AtomicBoolean(false) + private val loopQueryInfo = object :Runnable{ + override fun run() { + queryCarExecutableTaskList(true) + } + } + // 当前站点 + @JvmStatic var startStationIndex: Int = 0 //A->B 此处值是A站点索引 @JvmStatic fun init() { mContext = AbsMogoApplication.getApp() EventModel.load() - BizLoopManager.setLoopFunction( - "${TAG}_${LoopCarInfo}", - LoopInfo(60, ::backRefreshTask, immediately = true) - ) + loopQueryInfo.run() } @JvmStatic + @Synchronized fun release() { mContext = null EventModel.release() mBusLinesCallback = null - BizLoopManager.removeLoopFunction("${TAG}_${LoopCarInfo}") + BizLoopManager.removeCallback(loopQueryInfo) } @JvmStatic @@ -92,22 +101,25 @@ object BusLineModel { } fun refreshTask() { - queryCarExecutableTaskList(true) - } - - fun backRefreshTask(){ + BizLoopManager.removeCallback(loopQueryInfo) queryCarExecutableTaskList(false) } /** * 同步基础信息 */ - private fun queryCarExecutableTaskList(showError:Boolean) { + private fun queryCarExecutableTaskList(isBackground:Boolean) { + if(isRequesting.get()){ + return + } + isRequesting.set(true) mContext?.let { OrderServiceManager.queryCarExecutableTaskList( it, object : OchCommonServiceCallback { override fun onSuccess(data: CarExecutableTaskResponse) { + isRequesting.set(false) + BizLoopManager.postDelayed(loopQueryInfo,60_000) // 第一次过滤 请求返回值的md5 val currentRequest = DigestUtils.md5Hex(data.data.toString()) val lastChangeMd5 = @@ -118,7 +130,7 @@ object BusLineModel { SharedPrefsMgr.getInstance().putLong(executableChangeTime, currentTimeStamp) val sameDay = DateTimeUtil.isSameDay(currentTimeStamp, lastUpdateTime) mBusLinesCallback?.onRefreshSuccess(currentTimeStamp) - if(!showError){ + if(isBackground){ if (currentRequest == lastChangeMd5 && sameDay) { return } @@ -132,24 +144,27 @@ object BusLineModel { } override fun onError() { - if(showError){ + isRequesting.set(false) + if(!isBackground){ if (!NetworkUtils.isConnected(mContext)) { ToastUtils.showShort(ResourcesUtils.getString(R.string.network_error_tip)); } else { ToastUtils.showShort(ResourcesUtils.getString(R.string.request_error_tip)); } - } + BizLoopManager.postDelayed(loopQueryInfo,60_000) } override fun onFail(code: Int, failMsg: String) { - if(showError){ + isRequesting.set(false) + if(!isBackground){ if (!NetworkUtils.isConnected(mContext)) { ToastUtils.showShort("网络异常,请稍后重试"); }else { ToastUtils.showShort(failMsg); } } + BizLoopManager.postDelayed(loopQueryInfo,60_000) } }) } @@ -218,19 +233,21 @@ object BusLineModel { * 开始任务 */ @JvmStatic - fun commitSwitchLineId(taskId: Long, lineId: Long, lineName: String) { + fun commitSwitchLineId(task: BusQueryLineTaskResponse.Result, line: BusQueryLinesResponse.Result) { TaskRepository.startTask( - taskId, - lineId, - lineName, + task.id, + line.lineId, + line.name, object : TaskRepository.TaskStatusCallback { override fun startSuccess() { SharedPrefsMgr.getInstance() - .putLong(BusSwitchLineActivity.LASTCOMMITLINEID, lineId) - EventRepository.saveEventTaskStart(taskId) + .putLong(BusSwitchLineActivity.LASTCOMMITLINEID, line.lineId) + EventRepository.saveEventTaskStart(task.id) if (mBusLinesCallback != null) { mBusLinesCallback!!.onChangeLineIdSuccess() } + val taskTime = DateTimeUtil.formatLongToString(task.taskStartTime, DateTimeUtil.HH_mm) + CallerOrderListenerManager.invokeOrderLineUpdate("${line.name} ${taskTime}") } override fun startFail(msg: String) { @@ -355,7 +372,8 @@ object BusLineModel { ) } - fun abortTask() { + fun endTask() { + CallerOrderListenerManager.invokeOrderLineUpdate("") currentTask?.taskId?.let { TaskRepository.endTask(it) EventRepository.saveEventTaskEnd(it) diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/EventModel.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/EventModel.kt index d5f9332822..2f15710053 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/EventModel.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/EventModel.kt @@ -59,4 +59,8 @@ object EventModel : EventRepository.EventCallback { } } + + fun haveDataWaitSyn(): Boolean { + TODO("Not yet implemented") + } } \ No newline at end of file diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt index bd669a6173..42638821ee 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt @@ -51,13 +51,9 @@ import com.mogo.och.common.module.utils.ResourcesUtils import com.mogo.och.common.module.utils.RxUtils import com.mogo.och.common.module.voice.VoiceNotice.showNotice import com.mogo.och.data.bean.BusRoutesResult -import com.mogo.och.data.bean.BusStationBean import com.mogo.och.data.bean.BusTransferData import com.mogo.och.shuttle.weaknet.R import com.mogo.och.weaknet.callback.IBusADASStatusCallback -import com.mogo.och.weaknet.callback.IBusControllerStatusCallback -import com.mogo.och.weaknet.callback.IRefreshBusStationsCallback -import com.mogo.och.weaknet.callback.ISlidePannelHideCallback import com.mogo.och.weaknet.constant.BusConst import com.mogo.och.weaknet.util.BusAnalyticsManager import com.mogo.och.weaknet.util.BusTrajectoryManager @@ -79,17 +75,12 @@ object OrderModel { var busRoutesResult: BusRoutesResult? = null private set + private var mADASStatusCallback: IBusADASStatusCallback? = null /** * 用来表示是否正在开往下一站 */ @JvmStatic var isGoingToNextStation: Boolean = false - private set - private var refreshBusStationsCallback: IRefreshBusStationsCallback? = null - private var slidePanelHideCallback: ISlidePannelHideCallback? = null - private var mControllerStatusCallback: IBusControllerStatusCallback? = - null //Model->Presenter:VR mode等 - private var mADASStatusCallback: IBusADASStatusCallback? = null @Volatile private var isArrivedStation = false @@ -162,21 +153,6 @@ object OrderModel { this.mADASStatusCallback = callback } - @JvmStatic - fun setRefreshBusStationsCallback(callback: IRefreshBusStationsCallback?) { - this.refreshBusStationsCallback = callback - } - - @JvmStatic - fun setSlidePanelHideCallback(callback: ISlidePannelHideCallback?) { - this.slidePanelHideCallback = callback - } - - @JvmStatic - fun setControllerStatusCallback(callback: IBusControllerStatusCallback?) { - this.mControllerStatusCallback = callback - } - private val mAdasStartFailureListener: OchAdasStartFailureCallback = object : OchAdasStartFailureCallback { override fun brakeStatusChanged(isBrakeAvailable: Boolean) { @@ -188,9 +164,9 @@ object OrderModel { startFailedMessage, System.currentTimeMillis() ) - if (mADASStatusCallback != null && !FunctionBuildConfig.isDemoMode) { + if (!FunctionBuildConfig.isDemoMode) { e(M_BUS + TAG, "mAdasStartFailureListener = $startFailedMessage") - mADASStatusCallback!!.onStartAdasFailure() + mADASStatusCallback?.onStartAdasFailure() } } } @@ -240,9 +216,7 @@ object OrderModel { BusLineModel.loadStartedTaskAndDefaultInfo() if(BusLineModel.stationList.isNullOrEmpty()){ d(M_BUS + TAG, "获取到小巴路线数据:空 ") - if (refreshBusStationsCallback != null) { - refreshBusStationsCallback!!.updateEmptyUi() - } + mADASStatusCallback?.updateEmptyUi() LineManager.setLineInfo(null); updateBusStatus() clearAutopilotControlParameters() @@ -290,13 +264,13 @@ object OrderModel { arrivingOrArrivedStation.drivingStatus == BusConst.STATION_STATUS_STOPPED && !arrivingOrArrivedStation.isLeaving) ) { - refreshBusStationsCallback?.updateBusTaskStatus( + mADASStatusCallback?.updateBusTaskStatus( lineInfo.lineName, lineTime, it, arrivingOrArrivedStationIndex, true ) clearAutopilotControlParameters() } else { - refreshBusStationsCallback?.updateBusTaskStatus( + mADASStatusCallback?.updateBusTaskStatus( lineInfo.lineName, lineTime, it, arrivingOrArrivedStationIndex, false ) @@ -340,7 +314,7 @@ object OrderModel { false ) } - BusLineModel.abortTask() + BusLineModel.endTask() sendTaskDetailsToClients() } @@ -457,9 +431,7 @@ object OrderModel { "isRestart = " + isRestart ) - if (mControllerStatusCallback != null) { - mControllerStatusCallback!!.startOpenAutopilot() - } + mADASStatusCallback?.startOpenAutopilot() } /** @@ -588,8 +560,11 @@ object OrderModel { BusLineModel.setDemoMode() LineManager.startStation?.let {startStation -> - if (startStation.isLeaving && slidePanelHideCallback != null) { - slidePanelHideCallback!!.hideSlidePanel() + if (startStation.isLeaving) { + mADASStatusCallback?.hideSlidePanel() + isGoingToNextStation = true + }else{ + isGoingToNextStation = false } } @@ -604,11 +579,11 @@ object OrderModel { } private fun beforeTaskTips() { - if (busRoutesResult == null) return + if (BusLineModel.currentTask == null) return removeTipRunnables() - val taskTime = busRoutesResult!!.taskTime + val taskTime = BusLineModel.currentTask!!.taskStartTime?:return val tip3Time = taskTime - 3 * 60 * 1000 - DateTimeUtil.getCurrentTimeStamp() // 首站离开前3分钟提示 val tip1Time = taskTime - 60 * 1000 - DateTimeUtil.getCurrentTimeStamp() // 首站离开前1分钟提示 @@ -663,9 +638,7 @@ object OrderModel { @JvmStatic fun clearBusStationDatas() { - if (refreshBusStationsCallback != null) { - refreshBusStationsCallback!!.clearBusStationsMarkers() - } + mADASStatusCallback?.clearBusStationsMarkers() } /** @@ -736,6 +709,9 @@ object OrderModel { @JvmStatic fun logout() { // TODO: 检测是否有本地任务没有同步到服务器端 + if(EventModel.haveDataWaitSyn()){ + + } LoginStatusManager.loginOut() } @@ -748,7 +724,7 @@ object OrderModel { send, startStation.name, endStation.name, - busRoutesResult!!.lineId, + LineManager.lineInfos!!.lineId.toInt(), "", System.currentTimeMillis() ) diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/net/IBascApiService.java b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/net/IBascApiService.java index c9300fc033..fd0ae91808 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/net/IBascApiService.java +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/net/IBascApiService.java @@ -34,14 +34,23 @@ public interface IBascApiService { @POST( "/och-shuttle-cabin/api/business/v1/driver/lineDataWithDriver/query" ) Observable queryBusRoutes(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusQueryLineStationsRequest request); + /** + * 查询当前站点核销的人数 + */ @Headers( {"Content-type:application/json;charset=UTF-8"} ) @GET("och-shuttle-cabin/api/business/v1/task/writeOffCount") Observable writeOffCount(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("taskId") String taskId, @Query("siteId") String siteId); + /** + * 同步 线路、站点、任务、自驾轨迹信息 + */ @Headers( {"Content-type:application/json;charset=UTF-8"} ) @GET("/och-vehicle/cabin/queryCarExecutableTaskList") Observable queryCarExecutableTaskList(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn); + /** + * 上传 开始线路 滑动出发 到站 完成线路 各个任务到服务器端 + */ @Headers( {"Content-Type:application/json;charset=UTF-8"} ) @POST( "/och-vehicle/cabin/reportCabinEvent" ) Observable reportCabinEvent(@Header ("appId") String appId, @Header("ticket") String ticket, @Body ShuttleEventRequest request); diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/net/OrderServiceManager.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/net/OrderServiceManager.kt index 65b00942a1..f2589b490d 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/net/OrderServiceManager.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/net/OrderServiceManager.kt @@ -44,6 +44,9 @@ object OrderServiceManager { .subscribe(OchCommonSubscribeImpl(context, callback, "queryBusRoutes")) } + /** + * 只发生在大理环境 查询当前站点核销的人数 + */ @JvmStatic fun queryBusTaskByLineId( context: Context, @@ -61,6 +64,9 @@ object OrderServiceManager { .subscribe(OchCommonSubscribeImpl(context, callback, "writeOffCount")) } + /** + * 同步 线路、站点、任务、自驾轨迹信息 + */ @JvmStatic fun queryCarExecutableTaskList( context: Context, @@ -75,6 +81,9 @@ object OrderServiceManager { .subscribe(OchCommonSubscribeImpl(context, callback, "queryCarExecutableTaskList")) } + /** + * 上传 开始线路 滑动出发 到站 完成线路 各个任务到服务器端 + */ @JvmStatic fun reportCabinEvent( context: Context, diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/presenter/BusLinePresenter.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/presenter/BusLinePresenter.kt index 2a6bd1ca08..7bbd1f10a5 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/presenter/BusLinePresenter.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/presenter/BusLinePresenter.kt @@ -76,8 +76,8 @@ class BusLinePresenter(view: BusSwitchLineView?) : Presenter } } - fun commitSwitchLineId(taskId: Long, lineId: Long,lineName: String) { - BusLineModel.commitSwitchLineId(taskId, lineId, lineName) + fun commitSwitchLineId(taskId: BusQueryLineTaskResponse.Result, lineId: BusQueryLinesResponse.Result) { + BusLineModel.commitSwitchLineId(taskId, lineId) } fun removeListener() { diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/presenter/BusPresenter.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/presenter/BusPresenter.kt index 78325944dd..cf2ec10039 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/presenter/BusPresenter.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/presenter/BusPresenter.kt @@ -21,11 +21,7 @@ import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatu import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager import com.mogo.och.data.bean.BusStationBean import com.mogo.och.weaknet.callback.IBusADASStatusCallback -import com.mogo.och.weaknet.callback.IBusControllerStatusCallback -import com.mogo.och.weaknet.callback.IRefreshBusStationsCallback -import com.mogo.och.weaknet.callback.ISlidePannelHideCallback import com.mogo.och.weaknet.fragment.ShuttleFragment -import com.mogo.och.weaknet.model.BusLineModel import com.mogo.och.weaknet.model.OrderModel import com.mogo.och.weaknet.util.BusTrajectoryManager import mogo_msg.MogoReportMsg.MogoReportMessage @@ -36,8 +32,7 @@ import mogo_msg.MogoReportMsg.MogoReportMessage * @author tongchenfei */ class BusPresenter(view: ShuttleFragment?) : Presenter(view), - IRefreshBusStationsCallback, ISlidePannelHideCallback, IOchAutopilotStatusListener, - IBusControllerStatusCallback, ILoginCallback, IBusADASStatusCallback { + IOchAutopilotStatusListener, ILoginCallback, IBusADASStatusCallback { private val mStationList: MutableList = ArrayList() private var mCurrentStation = 0 @@ -50,7 +45,6 @@ class BusPresenter(view: ShuttleFragment?) : Presenter(view), override fun onCreate(owner: LifecycleOwner) { super.onCreate(owner) initModelListener() - OrderModel.queryBusRoutes() } override fun onDestroy(owner: LifecycleOwner) { @@ -60,18 +54,12 @@ class BusPresenter(view: ShuttleFragment?) : Presenter(view), } fun initModelListener() { - OrderModel.setRefreshBusStationsCallback(this) - OrderModel.setSlidePanelHideCallback(this) - OrderModel.setControllerStatusCallback(this) OrderModel.setAdasStatusCallback(this) OchAutoPilotStatusListenerManager.addListener(TAG, this) LoginStatusManager.addListener(TAG, this) } fun releaseListener() { - OrderModel.setRefreshBusStationsCallback(null) - OrderModel.setSlidePanelHideCallback(null) - OrderModel.setControllerStatusCallback(null) OrderModel.setAdasStatusCallback(null) OCHAdasAbilityManager.getInstance().release() OchAutoPilotStatusListenerManager.removeListener(TAG) diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/BusSwitchLineActivity.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/BusSwitchLineActivity.kt index 95d3d50449..5b61e4303e 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/BusSwitchLineActivity.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/BusSwitchLineActivity.kt @@ -1,6 +1,5 @@ package com.mogo.och.weaknet.ui -import android.animation.Animator import android.animation.ObjectAnimator import android.animation.ValueAnimator import android.graphics.Point @@ -184,12 +183,14 @@ class BusSwitchLineActivity : MvpActivity result.taskList.clear() result.taskList.addAll(lineTaskInfo) if(autoRefresh) { - mAdapter.checkTaskId = -1 - mAdapter.checkLineId = -1 - lineTaskInfo.forEach { - if (it.id == mAdapter.checkTaskId) { - mAdapter.checkTaskId = it.id - mAdapter.checkLineId = result.lineId + mAdapter.checkTask = null + mAdapter.checkLine = null + lineTaskInfo.forEach {lineTaskInfoInner-> + mAdapter.checkTask?.let { + if (lineTaskInfoInner.id == it.id) { + mAdapter.checkTask = lineTaskInfoInner + mAdapter.checkLine = result + } } } } @@ -237,8 +238,8 @@ class BusSwitchLineActivity : MvpActivity } //切换路线提交 if (v.id == R.id.switch_line_btn_commit) { - if(mAdapter.checkLineId!=-1L&&mAdapter.checkTaskId!=-1L){ - mPresenter?.commitSwitchLineId(mAdapter.checkTaskId,mAdapter.checkLineId,mAdapter.checkLineName) + if(mAdapter.checkLine!=null&&mAdapter.checkTask!=null){ + mPresenter?.commitSwitchLineId(mAdapter.checkTask!!,mAdapter.checkLine!!) }else{ ToastUtils.showLong("请选择任务") } diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/adapter/SwitchLineAdapter.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/adapter/SwitchLineAdapter.kt index dfa9b716f6..3bd7e197a4 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/adapter/SwitchLineAdapter.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/adapter/SwitchLineAdapter.kt @@ -12,6 +12,7 @@ import androidx.recyclerview.widget.RecyclerView import com.mogo.och.weaknet.bean.BusQueryLinesResponse import com.mogo.och.weaknet.ui.adapter.SwitchLineAdapter.SwitchLineViewHolder import com.mogo.och.shuttle.weaknet.R +import com.mogo.och.weaknet.bean.BusQueryLineTaskResponse import kotlin.text.StringBuilder /** @@ -26,9 +27,8 @@ class SwitchLineAdapter( } // RecyclerView设置点击事件 private var mItemClickListener: LineItemClickListener? = null - var checkLineId:Long = -1 - var checkTaskId:Long = -1 - var checkLineName:String = "" + var checkLine:BusQueryLinesResponse.Result? = null + var checkTask: BusQueryLineTaskResponse.Result? = null override fun onCreateViewHolder( parent: ViewGroup, viewType: Int @@ -59,25 +59,22 @@ class SwitchLineAdapter( holder.rvLineTask.layoutManager = GridLayoutManager(mContext, 3) val switchLineTaskAdapter = SwitchLineTaskAdapter( mContext, - checkTaskId, + if(checkTask==null) -1 else checkTask!!.id, line.taskList, object : SwitchLineTaskAdapter.TaskItemClickListener { override fun onItemClick(position: Int,isCheck:Boolean) { try { if(isCheck) { - checkLineId = line.lineId - checkTaskId = line.taskList[position].id - checkLineName = line.name + checkLine = line + checkTask = line.taskList[position] }else{ - checkLineId=-1 - checkTaskId=-1 - checkLineName = "" + checkLine=null + checkTask=null } }catch (e:Exception){ e.printStackTrace() - checkLineId=-1 - checkTaskId=-1 - checkLineName = "" + checkLine=null + checkTask=null } } }) diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/util/BusTrajectoryManager.java b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/util/BusTrajectoryManager.java index f8b6459d25..9b7b5f14d0 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/util/BusTrajectoryManager.java +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/util/BusTrajectoryManager.java @@ -9,8 +9,11 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.GsonUtils; import com.mogo.och.common.module.biz.login.LoginStatusManager; +import com.mogo.och.common.module.manager.autopilot.line.LineManager; import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager; import com.mogo.och.data.bean.BusRoutesResult; +import com.mogo.och.data.bean.ContraiInfo; +import com.mogo.och.data.bean.LineInfo; import com.mogo.och.weaknet.constant.BusConst; import com.mogo.och.weaknet.model.OrderModel; import com.mogo.och.weaknet.model.BusLineModel; @@ -51,9 +54,8 @@ public class BusTrajectoryManager { * 同步Bus路线信息 */ public void syncTrajectoryInfo() { - BusRoutesResult routesResult = OrderModel.getBusRoutesResult(); - if (LoginStatusManager.isLogin() && routesResult != null - && BusLineModel.INSTANCE.getStartStationIndex() == 0 + if (LoginStatusManager.isLogin() && BusLineModel.INSTANCE.getCurrentTask() != null + && BusLineModel.getStartStationIndex() == 0 && !OrderModel.isGoingToNextStation()) { CallerLogger.d(M_BUS + TAG, "syncTrajectoryInfo() start."); startTrajReqLoop(); @@ -112,35 +114,30 @@ public class BusTrajectoryManager { } private void setupAutoPilotLine() { - BusRoutesResult routesResult = OrderModel.getBusRoutesResult(); - if (routesResult == null) { + ContraiInfo contraiInfo = LineManager.getContraiInfo(); + LineInfo lineInfos = LineManager.getLineInfos(); + if (contraiInfo == null || lineInfos == null) { CallerLogger.e(M_BUS + TAG, "setupAutoPilotLine(): routesResult is null."); return; } else { if (mAutoPilotLine == null) { mAutoPilotLine = new AutopilotControlParameters.AutoPilotLine( - routesResult.getLineId(), routesResult.getName(), - routesResult.csvFileUrl, routesResult.csvFileMd5, - routesResult.txtFileUrl, routesResult.txtFileMd5, - routesResult.contrailSaveTime, routesResult.carModel, - routesResult.csvFileUrlDPQP, routesResult.csvFileMd5DPQP, - routesResult.txtFileUrlDPQP, routesResult.txtFileMd5DPQP, - routesResult.contrailSaveTimeDPQP); + lineInfos.getLineId(), lineInfos.getLineName(), + contraiInfo.getCsvFileUrl(), contraiInfo.getCsvFileMd5(), + contraiInfo.getTxtFileUrl(), contraiInfo.getTxtFileMd5(), + contraiInfo.getContrailSaveTime(), "", + "", "", + "", "", + 0); } else { - mAutoPilotLine.setLineId(routesResult.getLineId()); - mAutoPilotLine.setLineName(routesResult.getName()); - mAutoPilotLine.setTrajUrl(routesResult.csvFileUrl); - mAutoPilotLine.setTrajMd5(routesResult.csvFileMd5); - mAutoPilotLine.setStopUrl(routesResult.txtFileUrl); - mAutoPilotLine.setStopMd5(routesResult.txtFileMd5); - mAutoPilotLine.setTimestamp(routesResult.contrailSaveTime); - mAutoPilotLine.setVehicleModel(routesResult.carModel); - mAutoPilotLine.setTrajUrl_dpqp(routesResult.csvFileUrlDPQP); - mAutoPilotLine.setTrajMd5_dpqp(routesResult.csvFileMd5DPQP); - mAutoPilotLine.setStopUrl_dpqp(routesResult.txtFileUrlDPQP); - mAutoPilotLine.setStopMd5_dpqp(routesResult.txtFileMd5DPQP); - mAutoPilotLine.setTimestamp_dpqp(routesResult.contrailSaveTimeDPQP); + mAutoPilotLine.setLineId(lineInfos.getLineId()); + mAutoPilotLine.setLineName(lineInfos.getLineName()); + mAutoPilotLine.setTrajUrl(contraiInfo.getCsvFileUrl()); + mAutoPilotLine.setTrajMd5(contraiInfo.getCsvFileMd5()); + mAutoPilotLine.setStopUrl(contraiInfo.getTxtFileUrl()); + mAutoPilotLine.setStopMd5(contraiInfo.getTxtFileMd5()); + mAutoPilotLine.setTimestamp(contraiInfo.getContrailSaveTime()); } } } @@ -193,7 +190,7 @@ public class BusTrajectoryManager { } private void sendTrajectoryReq() { - if (mAutoPilotLine == null) { + if (mAutoPilotLine == null||mAutoPilotLine.getLineId()==-1) { CallerLogger.e(M_BUS + TAG, "sendTrajectoryReq(): mAutoPilotLine is null!!!"); return; } diff --git a/OCH/shuttle/driver_weaknet/src/main/res/layout/shuttle_weak_base_fragment.xml b/OCH/shuttle/driver_weaknet/src/main/res/layout/shuttle_weak_base_fragment.xml index c81adb63bf..e66b6e78cf 100644 --- a/OCH/shuttle/driver_weaknet/src/main/res/layout/shuttle_weak_base_fragment.xml +++ b/OCH/shuttle/driver_weaknet/src/main/res/layout/shuttle_weak_base_fragment.xml @@ -215,18 +215,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content"/> - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OCH/shuttle/driver_weaknet/src/main/res/values/strings.xml b/OCH/shuttle/driver_weaknet/src/main/res/values/strings.xml index 9edcc82ff7..c120ea0b01 100644 --- a/OCH/shuttle/driver_weaknet/src/main/res/values/strings.xml +++ b/OCH/shuttle/driver_weaknet/src/main/res/values/strings.xml @@ -22,7 +22,6 @@ 往%1$s方向 更换任务成功 更换任务失败 - 起点: 终点: 当前站点: @@ -31,7 +30,7 @@ 进站 - 班次: + 班次:%1$s 更新时间:%1$s diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 968137ce61..f76b845ab1 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -2170,9 +2170,9 @@ internal class DebugSettingView @JvmOverloads constructor( * 版本信息 */ tvAppVersionName.text = - "鹰眼版本:${AppUtils.getAppVersionName()} Git Hash:${AppConfigInfo.workingBranchHash} \n渠道信息:${AppConfigInfo.flavor}" + "鹰眼版本:${AppUtils.getAppVersionName()} Git Hash:${AppConfigInfo.workingBranchHash} \n渠道信息:${AppConfigInfo.flavor}_${AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode)}" tvAppVersionNameKey.text = - "鹰眼版本:${AppUtils.getAppVersionName()} Git Hash:${AppConfigInfo.workingBranchHash}\n渠道信息:${AppConfigInfo.flavor}" + "鹰眼版本:${AppUtils.getAppVersionName()} Git Hash:${AppConfigInfo.workingBranchHash}\n渠道信息:${AppConfigInfo.flavor}_${AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode)}" tvAutopilotProtocolVersionInfo.text = "Autopilot协议版本:${CallerAutoPilotControlManager.getProtocolVersion()}"