[6.6.0]
[fea]
This commit is contained in:
@@ -10,10 +10,26 @@ import com.mogo.och.data.bean.LineInfo
|
||||
* 订单中
|
||||
*/
|
||||
object LineManager : CallerBase<ILineCallback>() {
|
||||
|
||||
/**
|
||||
* 线路信息
|
||||
*/
|
||||
@JvmStatic
|
||||
var lineInfos: LineInfo? = null
|
||||
|
||||
/**
|
||||
* 启动自驾信息
|
||||
*/
|
||||
@JvmStatic
|
||||
var contraiInfo: ContraiInfo? = null
|
||||
|
||||
/**
|
||||
* 起始站点
|
||||
*/
|
||||
var startStation: BusStationBean? = null
|
||||
|
||||
/**
|
||||
* 结束站点
|
||||
*/
|
||||
var endStation: BusStationBean? = null
|
||||
|
||||
@JvmStatic
|
||||
|
||||
@@ -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<String, Any>?=null) {
|
||||
try {
|
||||
d(SceneConstant.M_OCHCOMMON + TAG, title)
|
||||
d(SceneConstant.M_OCHCOMMON + TAG, info)
|
||||
d("${TAG}_${eventID}", "${title}_${info}")
|
||||
if(upload) {
|
||||
val params = HashMap<String, Any>()
|
||||
addCommonParams(params)
|
||||
params["info"] = title
|
||||
params["changeInfo"] = info
|
||||
params["title"] = title
|
||||
params["info"] = info
|
||||
patch?.let {
|
||||
params.putAll(it)
|
||||
}
|
||||
|
||||
@@ -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<String, LoopInfo>()
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,22 +19,6 @@ public class BusQueryLineTaskResponse extends BaseData {
|
||||
|
||||
public List<Result> data;
|
||||
|
||||
public static void save2Db(@NotNull BusQueryLineTaskResponse data,long lineId) {
|
||||
List<TaskDataBean> 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;
|
||||
|
||||
@@ -26,6 +26,9 @@ data class CarExecutableTaskResponse(val data: List<Result>?) : 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<Result>?) : BaseData(){
|
||||
var lat:Double?,
|
||||
){
|
||||
companion object{
|
||||
/**
|
||||
* 把net站点信息转为数据库bean信息并保存
|
||||
*/
|
||||
fun toDbBeans(siteListInfo: List<SiteInfo>,lineId: Long?): List<SiteDataBean> {
|
||||
val reuslts = mutableListOf<SiteDataBean>()
|
||||
var tempSiteDataBean:SiteDataBean?=null
|
||||
@@ -72,6 +78,9 @@ data class CarExecutableTaskResponse(val data: List<Result>?) : 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<Result>?) : BaseData(){
|
||||
val taskStartTime:Long?,
|
||||
) {
|
||||
companion object {
|
||||
|
||||
/**
|
||||
* 把网络传来的任务信息转成数据库结构
|
||||
*/
|
||||
fun toDbBeans(taskInfs: List<TaskInfo>, lineId: Long?
|
||||
): List<TaskDataBean> {
|
||||
val reuslts = mutableListOf<TaskDataBean>()
|
||||
@@ -110,6 +123,9 @@ data class CarExecutableTaskResponse(val data: List<Result>?) : BaseData(){
|
||||
|
||||
|
||||
companion object{
|
||||
/**
|
||||
* 保存 线路信息、自驾轨迹信息、站点信息和任务到数据库
|
||||
*/
|
||||
fun save2Db(data: CarExecutableTaskResponse) {
|
||||
val lineList = mutableListOf<LineDataBean>()
|
||||
val contrailList = mutableListOf<ContrailDataBean>()
|
||||
|
||||
@@ -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
|
||||
*
|
||||
* <p>
|
||||
* Model->Presenter回调:ADAS相关(自动驾驶状态回调,到达终点等等)
|
||||
*/
|
||||
public interface IBusADASStatusCallback {
|
||||
//自驾返回失败
|
||||
void onStartAdasFailure();
|
||||
|
||||
void startOpenAutopilot();
|
||||
|
||||
void updateBusTaskStatus(String lineName, String lintTime,
|
||||
List<BusStationBean> stationList,
|
||||
int arrivingOrArrivedIndex,
|
||||
boolean isArrived);
|
||||
|
||||
|
||||
/**
|
||||
* 结束清理一遍、选择任务后清理一遍
|
||||
*/
|
||||
void clearBusStationsMarkers();
|
||||
|
||||
void updateEmptyUi();
|
||||
|
||||
void hideSlidePanel();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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<BusStationBean> stationList,
|
||||
int arrivingOrArrivedIndex,
|
||||
boolean isArrived);
|
||||
|
||||
/**
|
||||
* 结束清理一遍、选择任务后清理一遍
|
||||
*/
|
||||
void clearBusStationsMarkers();
|
||||
|
||||
void updateEmptyUi();
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.mogo.och.weaknet.callback;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
public interface ISlidePannelHideCallback {
|
||||
void hideSlidePanel();
|
||||
}
|
||||
@@ -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(
|
||||
|
||||
@@ -4,6 +4,9 @@ import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
/**
|
||||
* 上报给服务器端的 选择线路、滑动出发、进站 完成线路的对象
|
||||
*/
|
||||
@Entity(tableName = EventDataBean.evnetDataTable)
|
||||
data class EventDataBean(
|
||||
|
||||
|
||||
@@ -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<V : IView?, P : Presenter<V>?> : MvpFragme
|
||||
findViewById<View>(R.id.btnAutopilotArrive)!!.setOnClickListener { view: View? -> debugArrivedStation() }
|
||||
|
||||
tvArrived!!.setOnClickListener { view: View? ->
|
||||
ToastUtils.showLong("weak_net")
|
||||
onArriveStation()
|
||||
}
|
||||
|
||||
@@ -504,66 +501,6 @@ abstract class BaseShuttleTabFragment<V : IView?, P : Presenter<V>?> : 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
|
||||
|
||||
@@ -49,6 +49,9 @@ import java.util.Objects
|
||||
*/
|
||||
class ShuttleFragment : BaseShuttleTabFragment<ShuttleFragment?, BusPresenter?>(),
|
||||
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<ShuttleFragment?, BusPresenter?>(
|
||||
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<ShuttleFragment?, BusPresenter?>(
|
||||
|
||||
mSwitchLine!!.setOnClickListener(this)
|
||||
|
||||
mLineName!!.setOnLongClickListener {
|
||||
showHideTestBar()
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@@ -152,16 +147,13 @@ class ShuttleFragment : BaseShuttleTabFragment<ShuttleFragment?, BusPresenter?>(
|
||||
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<ShuttleFragment?, BusPresenter?>(
|
||||
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<ShuttleFragment?, BusPresenter?>(
|
||||
updateTwoStationsUI(stationList, arrivingOrArrivedIndex, isArrived)
|
||||
}
|
||||
|
||||
updateBusTestBarInfo()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -539,7 +530,4 @@ class ShuttleFragment : BaseShuttleTabFragment<ShuttleFragment?, BusPresenter?>(
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG: String = "BusFragment"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<BusStationBean>? = mutableListOf<BusStationBean>()
|
||||
|
||||
|
||||
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<CarExecutableTaskResponse> {
|
||||
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)
|
||||
|
||||
@@ -59,4 +59,8 @@ object EventModel : EventRepository.EventCallback {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun haveDataWaitSyn(): Boolean {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
)
|
||||
|
||||
@@ -34,14 +34,23 @@ public interface IBascApiService {
|
||||
@POST( "/och-shuttle-cabin/api/business/v1/driver/lineDataWithDriver/query" )
|
||||
Observable<BusRoutesResponse> 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<WriteOffCountResponse> 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<CarExecutableTaskResponse> 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<BaseData> reportCabinEvent(@Header ("appId") String appId, @Header("ticket") String ticket, @Body ShuttleEventRequest request);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -76,8 +76,8 @@ class BusLinePresenter(view: BusSwitchLineView?) : Presenter<BusSwitchLineView?>
|
||||
}
|
||||
}
|
||||
|
||||
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() {
|
||||
|
||||
@@ -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<ShuttleFragment?>(view),
|
||||
IRefreshBusStationsCallback, ISlidePannelHideCallback, IOchAutopilotStatusListener,
|
||||
IBusControllerStatusCallback, ILoginCallback, IBusADASStatusCallback {
|
||||
IOchAutopilotStatusListener, ILoginCallback, IBusADASStatusCallback {
|
||||
private val mStationList: MutableList<BusStationBean> = ArrayList()
|
||||
private var mCurrentStation = 0
|
||||
|
||||
@@ -50,7 +45,6 @@ class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(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<ShuttleFragment?>(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)
|
||||
|
||||
@@ -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<BusSwitchLineView?, BusLinePresenter?>
|
||||
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<BusSwitchLineView?, BusLinePresenter?>
|
||||
}
|
||||
//切换路线提交
|
||||
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("请选择任务")
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -215,18 +215,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<include
|
||||
android:id="@+id/module_mogo_och_bus_test_bar"
|
||||
layout="@layout/shuttle_weak_test_bar_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_mogo_och_station_panel_container"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
<com.mogo.och.weaknet.ui.writeoff.WriteOffView
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/module_mogo_och_arrived_tv"
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_test_bar_current_line_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_test_bar_current_line_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_test_bar_current_traj_md5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_test_bar_current_stop_md5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_test_bar_current_traj_md5_dpqp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_test_bar_current_stop_md5_dpqp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -22,7 +22,6 @@
|
||||
<string name="bus_line_goto_end">往%1$s方向</string>
|
||||
<string name="bus_change_line_commit_tip_s">更换任务成功</string>
|
||||
<string name="bus_change_line_commit_tip_f">更换任务失败</string>
|
||||
<!-- <string name="bus_arrive_to_end_title">去往下车地点</string>-->
|
||||
<string name="bus_arrive_to_end_start">起点:</string>
|
||||
<string name="bus_arrive_to_end_end">终点:</string>
|
||||
<string name="bus_arrive_to_current_tag">当前站点:</string>
|
||||
@@ -31,7 +30,7 @@
|
||||
<string name="bus_arrived_str">进站</string>
|
||||
<string name="bus_station_txt_tag_start">起</string>
|
||||
<string name="bus_station_txt_tag_end">终</string>
|
||||
<string name="bus_line_time_tag">班次:</string>
|
||||
<string name="bus_line_time_tag">班次:%1$s</string>
|
||||
|
||||
<string name="bus_refresh_time">更新时间:%1$s</string>
|
||||
|
||||
|
||||
@@ -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()}"
|
||||
|
||||
Reference in New Issue
Block a user