Merge branch 'release_robotaxi-d_240705_6.5.0.1' into 'master'
Release robotaxi d 240705 6.5.0.1 See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!871
@@ -119,11 +119,11 @@ public class BusLineModel {
|
||||
}
|
||||
|
||||
public void commitSwitchLineId(int taskId,int lineId){
|
||||
OchChainLogManager.writeChainLog("选择线路","taskId:"+taskId+"--lineId:"+lineId,true,OchChainLogManager.EVENT_KEY_INFE_WITH_BUS);
|
||||
OchChainLogManager.writeChainLog("选择线路","taskId:"+taskId+"--lineId:"+lineId);
|
||||
OrderServiceManager.switchLine(mContext,taskId, new OchCommonServiceCallback<BusRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(BusRoutesResponse o) {
|
||||
OchChainLogManager.writeChainLog("选择线路成功","taskId:"+taskId+"--lineId:"+lineId,true,OchChainLogManager.EVENT_KEY_INFE_WITH_BUS);
|
||||
OchChainLogManager.writeChainLog("选择线路成功","taskId:"+taskId+"--lineId:"+lineId);
|
||||
SharedPrefsMgr.getInstance().putInt(BusSwitchLineActivity.LASTCOMMITLINEID,lineId);
|
||||
if (mBusLinesCallback != null){
|
||||
mBusLinesCallback.onChangeLineIdSuccess();
|
||||
@@ -133,7 +133,7 @@ public class BusLineModel {
|
||||
@Override
|
||||
public void onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
OchChainLogManager.writeChainLog("选择线路失败","taskId:"+taskId+"--lineId:"+lineId,true,OchChainLogManager.EVENT_KEY_INFE_WITH_BUS);
|
||||
OchChainLogManager.writeChainLog("选择线路失败","taskId:"+taskId+"--lineId:"+lineId);
|
||||
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
} else {
|
||||
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
|
||||
@@ -22,10 +22,8 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
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.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
@@ -81,6 +79,7 @@ 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.data.manager.cache.CacheDataManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -143,7 +142,7 @@ public class OrderModel {
|
||||
public void init() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,5, mMapLocationListener);
|
||||
OchLocationManager.addGCJ02Listener(TAG,5, mMapLocationListener);
|
||||
|
||||
TrajectoryManager.INSTANCE.addTrajectoryListListenerr(TAG,iTrajectoryListener);
|
||||
|
||||
@@ -395,7 +394,7 @@ public class OrderModel {
|
||||
startOrStopOrderLoop(false);
|
||||
|
||||
// 注销定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
OchLocationManager.removeGCJ02Listener(TAG);
|
||||
|
||||
TrajectoryManager.INSTANCE.addTrajectoryListListenerr(TAG,null);
|
||||
|
||||
@@ -780,8 +779,7 @@ public class OrderModel {
|
||||
* 到站后重置站点状态
|
||||
*/
|
||||
private void arriveSiteStation(String changeInfo) {
|
||||
OchChainLogManager.writeChainLog("触发进站", changeInfo,
|
||||
true,OchChainLogManager.EVENT_KEY_INFE_WITH_BUS);
|
||||
OchChainLogManager.writeChainLog("触发进站", changeInfo);
|
||||
if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) { //到站短时间内调用多次
|
||||
CallerLogger.e( M_BUS + TAG, "数组越界" );
|
||||
return;
|
||||
@@ -891,8 +889,7 @@ public class OrderModel {
|
||||
|
||||
String changeInfo = "taskId:" + currentTaskId + "--lineId:" + currentLineId +
|
||||
"--currentStationName:"+currentStationName+"--finalNextStationName:"+finalNextStationName;
|
||||
OchChainLogManager.writeChainLog("滑动出发", changeInfo,
|
||||
true,OchChainLogManager.EVENT_KEY_INFE_WITH_BUS);
|
||||
OchChainLogManager.writeChainLog("滑动出发", changeInfo);
|
||||
OrderServiceManager.leaveStation(mContext,
|
||||
busStationBean.getSeq(),
|
||||
busStationBean.getSiteId(),
|
||||
@@ -900,8 +897,7 @@ public class OrderModel {
|
||||
new OchCommonServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
OchChainLogManager.writeChainLog("滑动出发成功", changeInfo,
|
||||
true,OchChainLogManager.EVENT_KEY_INFE_WITH_BUS);
|
||||
OchChainLogManager.writeChainLog("滑动出发成功", changeInfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -1239,8 +1235,9 @@ public class OrderModel {
|
||||
|
||||
// 车机端上传心跳数据(只在出车状态时上传)
|
||||
public void runCarHeartbeat() {
|
||||
double mLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude();
|
||||
double mLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude();
|
||||
MogoLocation gcj02Location = OchLocationManager.getGCJ02Location();
|
||||
double mLatitude = gcj02Location.getLatitude();
|
||||
double mLongitude = gcj02Location.getLongitude();
|
||||
OrderServiceManager.runCarHeartbeat(mContext, mLongitude, mLatitude,
|
||||
new OchCommonServiceCallback<BaseData>() {
|
||||
@Override
|
||||
@@ -1266,9 +1263,7 @@ public class OrderModel {
|
||||
|
||||
// 登出
|
||||
public void logout() {
|
||||
double mLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude();
|
||||
double mLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude();
|
||||
LoginStatusManager.loginOut(mLatitude, mLongitude);
|
||||
LoginStatusManager.loginOut();
|
||||
}
|
||||
|
||||
public void triggerStartServiceEvent(boolean isRestart, boolean send) {
|
||||
|
||||
@@ -324,7 +324,7 @@ object OrderServiceManager {
|
||||
)
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "runCarHeartbeat"))
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "runCarHeartbeat",false))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,6 @@ object BusVoiceManager {
|
||||
}
|
||||
|
||||
fun arrivedStationBus(siteNameCN: String?, siteNameKR: String?) {
|
||||
if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
return
|
||||
}
|
||||
val context = AbsMogoApplication.getApp()
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
siteNameCN?.let {
|
||||
@@ -33,7 +30,7 @@ object BusVoiceManager {
|
||||
)
|
||||
val engTTS = LangTtsEntity(
|
||||
context.getString(R.string.bus_arrived_station_english_tip, it),
|
||||
LanguageType.CHINESE
|
||||
LanguageType.ENGLISH
|
||||
)
|
||||
val koreanTTS = LangTtsEntity(
|
||||
context.getString(R.string.bus_arrived_station_korean_tip, siteNameKR?:it),
|
||||
@@ -57,7 +54,7 @@ object BusVoiceManager {
|
||||
)
|
||||
val engTTS = LangTtsEntity(
|
||||
context.getString(R.string.bus_leave_station_english_tip, it),
|
||||
LanguageType.CHINESE
|
||||
LanguageType.ENGLISH
|
||||
)
|
||||
list.add(chineseTTS)
|
||||
list.add(engTTS)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
android:layout_height="@dimen/dp_269"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--V2X预警红色边框-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
||||
@@ -101,11 +101,31 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_71"
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewLimitingVelocity"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="@dimen/dp_236"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"/>
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="@dimen/dp_236" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.greenwave.GreenWaveView
|
||||
android:layout_marginTop="@dimen/dp_71"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="@dimen/dp_236" />
|
||||
|
||||
<!-- 地图marker点击触发路侧直播 -->
|
||||
<com.mogo.eagle.core.function.hmi.ui.camera.RoadCrossLiveView
|
||||
android:layout_width="@dimen/dp_800"
|
||||
android:layout_height="@dimen/dp_560"
|
||||
android:layout_marginTop="@dimen/dp_333"
|
||||
android:layout_marginEnd="@dimen/dp_50"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
@@ -163,10 +183,10 @@
|
||||
android:layout_height="@dimen/dp_185"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:layout_marginTop="-31dp"
|
||||
android:paddingTop="@dimen/dp_27"
|
||||
android:paddingBottom="@dimen/dp_32"
|
||||
android:background="@drawable/bus_autopilot_0_1_status_bg"
|
||||
android:gravity="center"
|
||||
android:paddingTop="@dimen/dp_27"
|
||||
android:paddingBottom="@dimen/dp_32"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
|
||||
tools:visibility="visible">
|
||||
@@ -200,8 +220,16 @@
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginTop="-24dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.switchvisual.VisualViewDirver
|
||||
app:layout_constraintStart_toEndOf="@+id/module_mogo_och_station_panel_container"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_station_panel_container"
|
||||
android:layout_marginBottom="@dimen/dp_28"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<!--订单调试页面-->
|
||||
<include
|
||||
android:id="@+id/module_mogo_och_bus_test_bar"
|
||||
@@ -217,8 +245,8 @@
|
||||
android:id="@+id/module_mogo_och_arrived_tv"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_19"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:background="@drawable/common_arrive_station_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
@@ -230,40 +258,30 @@
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.toolsview.ToolsView
|
||||
android:id="@+id/toolsView"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_arrived_tv"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<!--切换地图远近事件 @dimen/module_switch_map -->
|
||||
<com.mogo.och.common.module.wigets.map.switchvisual.VisualView
|
||||
android:id="@+id/switch_visual_view"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/toolsView"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_arrived_tv" />
|
||||
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.reportworkorder.ReportWorkOrderView
|
||||
android:id="@+id/reportworkorderview"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/switch_visual_view"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
app:layout_constraintLeft_toRightOf="@id/toolsView" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaTaxiView
|
||||
android:id="@+id/rtv_switch"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/reportworkorderview"
|
||||
app:roma_close_bg="@drawable/common_driverroma_normal"
|
||||
app:roma_open_bg="@drawable/common_driver_roma_press" />
|
||||
@@ -314,7 +332,7 @@
|
||||
|
||||
<com.mogo.och.common.module.wigets.LoadingMapStatusView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.ConnectionProcessView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -322,8 +340,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_26"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewVersionName"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -8,7 +8,6 @@ import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
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.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -29,8 +28,10 @@ import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.biz.login.OpenOrderStatusEnum
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.manager.distance.IDistanceListener
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loop.LoopInfo
|
||||
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager
|
||||
@@ -79,7 +80,7 @@ object OrderModel {
|
||||
//自动驾驶状态监听
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, mMapLocationListener)
|
||||
OchLocationManager.addGCJ02Listener(TAG, 3, mMapLocationListener)
|
||||
// 距离终点站距离监听
|
||||
TrajectoryAndDistanceManager.addDistanceListener(TAG, trajectoryListener)
|
||||
AbnormalFactorsLoopManager.startLoopAbnormalFactors(mContext!!)
|
||||
@@ -93,7 +94,7 @@ object OrderModel {
|
||||
//自动驾驶状态监听
|
||||
OchAutoPilotStatusListenerManager.removeListener(mGoAutopilotStatusListener)
|
||||
// 注销定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
OchLocationManager.removeGCJ02Listener(TAG)
|
||||
// 距离终点站距离监听
|
||||
TrajectoryAndDistanceManager.removeListener(TAG)
|
||||
|
||||
@@ -261,6 +262,7 @@ object OrderModel {
|
||||
)
|
||||
return
|
||||
}
|
||||
OchChainLogManager.writeChainLog("订单信息流转","$data");
|
||||
|
||||
if (routesResult != null &&
|
||||
routesResult!!.writeVersion < data.result.writeVersion
|
||||
|
||||
@@ -41,14 +41,14 @@ object BusPassengerServiceManager {
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
LoginLanPassengerSocket.driverSn
|
||||
).transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverSiteByCoordinate"))
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverSiteByCoordinate",false))
|
||||
}else{
|
||||
mBusPassengerServiceApi.queryDriverSiteByCoordinate(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
BusPassengerQueryLineRequest(LoginLanPassengerSocket.driverSn)
|
||||
).transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverSiteByCoordinate"))
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverSiteByCoordinate",false))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
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.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -46,9 +45,11 @@ import com.mogo.och.common.module.manager.CharterSendTripInfoManager.END_TRIP
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.START_TRIP
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
import com.mogo.och.common.module.manager.device.LightAirconditionDoorManager
|
||||
import com.mogo.och.common.module.manager.device.LightAirconditionDoorStatusManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.startLoopAbnormalFactors
|
||||
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.stopLoopAbnormalFactors
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
|
||||
@@ -76,8 +77,6 @@ import com.mogo.och.data.bean.*
|
||||
*/
|
||||
class DriverM1Model {
|
||||
|
||||
var mLongitude = 0.0
|
||||
var mLatitude = 0.0
|
||||
private var mContext: Context? = null
|
||||
|
||||
private var isArrivedStation: Boolean = false
|
||||
@@ -118,7 +117,7 @@ class DriverM1Model {
|
||||
fun init(context: Context) {
|
||||
mContext = context
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 5, mMapLocationListener)
|
||||
OchLocationManager.addGCJ02Listener(TAG, 5, mMapLocationListener)
|
||||
|
||||
//开启自驾后 异常信息返回
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener)
|
||||
@@ -174,7 +173,7 @@ class DriverM1Model {
|
||||
|
||||
fun release() {
|
||||
// 注销定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
OchLocationManager.removeGCJ02Listener(TAG)
|
||||
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null)
|
||||
releaseSocketMessageListener(
|
||||
@@ -363,8 +362,6 @@ class DriverM1Model {
|
||||
object : IMoGoChassisLocationGCJ02Listener {
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||
if (null == gnssInfo) return
|
||||
mLongitude = gnssInfo.longitude
|
||||
mLatitude = gnssInfo.latitude
|
||||
|
||||
//是否到站的围栏判断 自动驾驶还未触发到站
|
||||
if (!isArrivedStation) {
|
||||
@@ -543,7 +540,7 @@ class DriverM1Model {
|
||||
|
||||
// 登出
|
||||
fun logout() {
|
||||
LoginStatusManager.loginOut(mLatitude, mLongitude)
|
||||
LoginStatusManager.loginOut()
|
||||
}
|
||||
|
||||
fun triggerStartServiceEvent(isRestart: Boolean, send: Boolean) {
|
||||
@@ -606,9 +603,10 @@ class DriverM1Model {
|
||||
parameters.routeName = mCurrentOrder?.lineName!!
|
||||
parameters.startName = PinYinUtil.getPinYinHeadChar(mCurrentOrder?.startSiteName)
|
||||
parameters.endName = PinYinUtil.getPinYinHeadChar(mCurrentOrder?.siteName)
|
||||
val gcJ02Location = OchLocationManager.getGCJ02Location()
|
||||
parameters.startLatLon = AutopilotControlParameters.AutoPilotLonLat(
|
||||
mLatitude,
|
||||
mLongitude
|
||||
gcJ02Location.latitude,
|
||||
gcJ02Location.longitude
|
||||
)
|
||||
parameters.endLatLon =
|
||||
AutopilotControlParameters.AutoPilotLonLat(mCurrentOrder?.wgs84Lat!!, mCurrentOrder?.wgs84Lon!!)
|
||||
@@ -746,6 +744,8 @@ class DriverM1Model {
|
||||
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "queryCurrentOrder order =" +
|
||||
GsonUtils.toJson(data.data))
|
||||
OchChainLogManager.writeChainLog("订单信息流转","$data");
|
||||
|
||||
|
||||
mCurrentOrder = data.data
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ object DriverM1ServiceManager {
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
SharedPrefsMgr.getInstance().sn
|
||||
)?.transformTry()
|
||||
?.subscribe(OchCommonSubscribeImpl(context!!, callback, "queryCurrentOrder"))
|
||||
?.subscribe(OchCommonSubscribeImpl(context!!, callback, "queryCurrentOrder",false))
|
||||
}
|
||||
|
||||
fun checkOrderCountDown(context: Context?,
|
||||
|
||||
@@ -5,8 +5,8 @@ import com.magic.mogo.och.charter.model.DriverM1Model
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import kotlin.math.abs
|
||||
|
||||
class CarStatusViewModel: ViewModel(), IMoGoAutopilotStatusListener,
|
||||
@@ -24,12 +24,12 @@ class CarStatusViewModel: ViewModel(), IMoGoAutopilotStatusListener,
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
this.viewCallback = null
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(DriverM1Model.TAG)
|
||||
OchLocationManager.removeGCJ02Listener(DriverM1Model.TAG)
|
||||
}
|
||||
|
||||
fun setAutopilotStatusCallback(viewCallback:ICarStatusCallback){
|
||||
this.viewCallback = viewCallback
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(DriverM1Model.TAG, 3, this)
|
||||
OchLocationManager.addGCJ02Listener(DriverM1Model.TAG, 3, this)
|
||||
}
|
||||
|
||||
interface ICarStatusCallback{
|
||||
|
||||
@@ -114,6 +114,16 @@
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.greenwave.GreenWaveView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_71"
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewLimitingVelocity"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="@dimen/dp_236"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"/>
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
android:id="@+id/viewDriverMsgBoxButton"
|
||||
@@ -187,6 +197,13 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/autopilot_status"
|
||||
app:layout_goneMarginTop="@dimen/dp_530" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.switchvisual.VisualViewDirver
|
||||
app:layout_constraintStart_toEndOf="@+id/module_mogo_och_station_panel_container"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_station_panel_container"
|
||||
android:layout_marginBottom="@dimen/dp_46"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<!--订单信息-->
|
||||
<include
|
||||
android:id="@+id/module_mogo_och_bus_test_bar"
|
||||
@@ -223,23 +240,13 @@
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<!--切换地图远近事件 @dimen/module_switch_map -->
|
||||
<com.mogo.och.common.module.wigets.map.switchvisual.VisualView
|
||||
android:id="@+id/switch_visual_view"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/toolsView"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.reportworkorder.ReportWorkOrderView
|
||||
android:id="@+id/reportworkorderview"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/switch_visual_view"
|
||||
app:layout_constraintLeft_toRightOf="@id/toolsView"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.manager.beautifymode.BeautifyManager
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
@@ -394,7 +395,7 @@ object CharterPassengerModel {
|
||||
this.orderInfo = orderData
|
||||
}
|
||||
//计算终点距离
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().let { currentInfo ->
|
||||
OchLocationManager.getGCJ02Location().let { currentInfo ->
|
||||
// 两点之间的距离
|
||||
val calculateLineDistance = CoordinateUtils.calculateLineDistance(
|
||||
currentInfo.longitude,
|
||||
@@ -644,7 +645,7 @@ object CharterPassengerModel {
|
||||
*/
|
||||
private fun calculateDistance() {
|
||||
//mLocation gcj坐标
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().let {
|
||||
OchLocationManager.getGCJ02Location().let {
|
||||
orderInfo?.let { order ->
|
||||
d(M_BUS_P + "calculateDistance", "订单信息:$order")
|
||||
if (order.siteId == null || order.siteId == 0L ||
|
||||
@@ -734,7 +735,7 @@ object CharterPassengerModel {
|
||||
private fun setOrderStatus(orderStatus: OrderStatusEnum) {
|
||||
if (this.orderStatus != orderStatus) {
|
||||
d(M_BUS_P + TAG, "${this.orderInfo?.orderNo}新的状态:$orderStatus")
|
||||
OchChainLogManager.writeChainLog(this.orderInfo.toString(),"新的状态:$orderStatus")
|
||||
OchChainLogManager.writeChainLog(this.orderStatus.name,"新的状态:${this.orderInfo}")
|
||||
this.orderStatus = orderStatus
|
||||
BeautifyManager.notifyViewChange(BeautifyManager.ChangeTypeEnum.ORDER_STATU_CHANGE)
|
||||
for (callback in orderStatusChangeListeners.values) {
|
||||
@@ -758,7 +759,7 @@ object CharterPassengerModel {
|
||||
val distanceMap: MutableMap<Float, Int> = TreeMap()
|
||||
// 计算所有点的距离
|
||||
data.forEachIndexed { index, siteInfo ->
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().let { currentInfo ->
|
||||
OchLocationManager.getGCJ02Location().let { currentInfo ->
|
||||
// 两点之间的距离
|
||||
val calculateLineDistance = CoordinateUtils.calculateLineDistance(
|
||||
currentInfo.longitude,
|
||||
@@ -806,7 +807,7 @@ object CharterPassengerModel {
|
||||
if (middle == 0) {
|
||||
return Pair(1, false)
|
||||
}
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().let {
|
||||
OchLocationManager.getGCJ02Location().let {
|
||||
// 仅计算 距离最近的站点middle 附近5个坐标的夹角
|
||||
|
||||
// middle middle-1
|
||||
@@ -1180,7 +1181,7 @@ object CharterPassengerModel {
|
||||
}
|
||||
val parameters = AutopilotControlParameters()
|
||||
orderInfo?.let { orderInfo ->
|
||||
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().let { startPoint ->
|
||||
OchLocationManager.getWgs02Location().let { startPoint ->
|
||||
val startWgsLon: Double = startPoint.longitude
|
||||
val startWgsLat: Double = startPoint.latitude
|
||||
val endWgsLon: Double = orderInfo.wgs84Lon!!
|
||||
|
||||
@@ -64,7 +64,7 @@ object BusPassengerServiceManager {
|
||||
return
|
||||
}
|
||||
mBusPassengerServiceApi.queryOrderInfo().transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "order"))
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "order",false))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@@ -93,7 +93,7 @@ object BusPassengerServiceManager {
|
||||
return
|
||||
}
|
||||
mBusPassengerServiceApi.queryBusinessStatus().transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "businessStatus"))
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "businessStatus",false))
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ object BusPassengerServiceManager {
|
||||
return
|
||||
}
|
||||
mBusPassengerServiceApi.queryBusinessTime().transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryBusinessTime"))
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryBusinessTime",false))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
|
||||
@@ -4,13 +4,13 @@ import androidx.lifecycle.ViewModel
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.charter.passenger.R
|
||||
import com.mogo.och.charter.passenger.callback.IDistanceCallback
|
||||
import com.mogo.och.charter.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.charter.passenger.model.IOrderStatusChangeListener
|
||||
import com.mogo.och.charter.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil
|
||||
import kotlin.math.abs
|
||||
@@ -24,7 +24,7 @@ class ItineraryViewModel : ViewModel(), IMoGoChassisLocationGCJ02Listener, IDist
|
||||
private var viewCallback: ItineraryViewCallback? = null
|
||||
|
||||
init {
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, this)
|
||||
OchLocationManager.addGCJ02Listener(TAG, 3, this)
|
||||
CharterPassengerModel.setStationDistanceListener(TAG, this)
|
||||
CharterPassengerModel.setStatusChangeListener(TAG, this)
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class ItineraryViewModel : ViewModel(), IMoGoChassisLocationGCJ02Listener, IDist
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
this.viewCallback = null
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
OchLocationManager.removeGCJ02Listener(TAG)
|
||||
CharterPassengerModel.setStationDistanceListener(TAG, null)
|
||||
CharterPassengerModel.setStatusChangeListener(TAG, null)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
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.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -26,6 +25,7 @@ import com.mogo.och.common.module.manager.socket.lan.bean.ChangeDestMsg
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.LineSite
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.stopside.StopSideManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
@@ -366,8 +366,7 @@ class SelectLineViewModel : ViewModel(), IOrderStatusChangeListener {
|
||||
}
|
||||
|
||||
fun canSwitchLine(): Boolean {
|
||||
val gnssSpeed =
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().gnssSpeed
|
||||
val gnssSpeed = OchLocationManager.getGCJ02Location().gnssSpeed
|
||||
if (gnssSpeed < 0.5) {
|
||||
when (CallerAutoPilotStatusListenerManager.getState()) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
|
||||
|
||||
@@ -21,7 +21,7 @@ object CharterVoiceManager {
|
||||
)
|
||||
val engTTS = LangTtsEntity(
|
||||
contenxt.getString(R.string.charter_arrived_station_en, it),
|
||||
LanguageType.CHINESE
|
||||
LanguageType.ENGLISH
|
||||
)
|
||||
val koreanTTS = LangTtsEntity(
|
||||
contenxt.getString(R.string.charter_arrived_station_ko, siteNameKR?:it),
|
||||
@@ -45,7 +45,7 @@ object CharterVoiceManager {
|
||||
)
|
||||
val engTTS = LangTtsEntity(
|
||||
contenxt.getString(R.string.charter_leave_station_en, it),
|
||||
LanguageType.CHINESE
|
||||
LanguageType.ENGLISH
|
||||
)
|
||||
list.add(chineseTTS)
|
||||
list.add(engTTS)
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.biz.login.RoleEnum
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusEnum
|
||||
import com.mogo.och.common.module.biz.login.OpenOrderStatusEnum
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.EnvType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.ProjectType
|
||||
@@ -97,9 +98,9 @@ class LoginProvider : LoginService {
|
||||
LoginModel.queryCarStatus()
|
||||
}
|
||||
|
||||
override fun loginOut(mLatitude: Double, mLongitude: Double) {
|
||||
CallerLogger.d(tag, "loginOut mLatitude:${mLatitude}--mLongitude:${mLongitude}")
|
||||
LoginModel.logout(mLatitude, mLongitude)
|
||||
override fun loginOut() {
|
||||
CallerLogger.d(tag, "loginOut ")
|
||||
LoginModel.logout()
|
||||
}
|
||||
|
||||
override fun checkBusiness(businessType: Int): Boolean {
|
||||
@@ -145,7 +146,9 @@ class LoginProvider : LoginService {
|
||||
|
||||
override fun setLoginInfo(loginInfo: LoginInfo) {
|
||||
CallerLogger.d(tag, "setLoginInfo:${loginInfo}")
|
||||
this.loginInfo = loginInfo
|
||||
if(this.loginInfo!=loginInfo){
|
||||
this.loginInfo = loginInfo
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLoginInfo(): LoginInfo? {
|
||||
@@ -172,6 +175,7 @@ class LoginProvider : LoginService {
|
||||
override fun setLoginStatus(loginStatus: LoginStatusEnum) {
|
||||
CallerLogger.d(tag, "setLoginStatus:${loginStatus}----old${this.loginStatus}")
|
||||
if (loginStatus != this.loginStatus) {
|
||||
OchChainLogManager.writeChainLog("登录状态变化","${this.loginStatus}-->${loginStatus}");
|
||||
this.loginStatus = loginStatus
|
||||
LoginStatusManager.invokeLoginStatusChange(loginStatus)
|
||||
}
|
||||
@@ -194,6 +198,7 @@ class LoginProvider : LoginService {
|
||||
override fun setOpenOrderStatusType(type: Int) {
|
||||
CallerLogger.d(tag, "setOpenOrderStatusType:${type}")
|
||||
if (openOrderStatusEnum.code != type) {
|
||||
OchChainLogManager.writeChainLog("接单状态变化","${this.openOrderStatusEnum}-->${OpenOrderStatusEnum.valueOf(type)}");
|
||||
this.openOrderStatusEnum = OpenOrderStatusEnum.valueOf(type)
|
||||
LoginStatusManager.invokeLOpenOrderStatusChange(this.openOrderStatusEnum)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.mogo.och.biz.login.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager;
|
||||
|
||||
/**
|
||||
* Created by yyk on 2021/8/19
|
||||
* 登出请求参数
|
||||
@@ -17,9 +20,10 @@ public class TaxiLogoutReqBean {
|
||||
public double lat;
|
||||
public double lon;
|
||||
|
||||
public Location4Login(double lat, double lon) {
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
public Location4Login() {
|
||||
MogoLocation gcj02Location = OchLocationManager.getGCJ02Location();
|
||||
this.lat = gcj02Location.getLatitude();
|
||||
this.lon = gcj02Location.getLongitude();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ import com.mogo.commons.module.intent.IMogoIntentListener
|
||||
import com.mogo.commons.module.intent.IntentManager
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -27,7 +25,7 @@ import com.mogo.och.common.module.biz.login.BusinessEnum
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusEnum
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusEnum.Companion.valueOf
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusCacheKey
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.LoginCacheStatus
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
@@ -125,7 +123,7 @@ object LoginModel {
|
||||
|
||||
fun gotoLogin(phone: String, code: String) {
|
||||
mContext?.let {
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val location = OchLocationManager.getGCJ02Location()
|
||||
val location4Login = TaxiLoginReqBean.Location4Login(location.latitude, location.longitude)
|
||||
OchCommonServiceManager.gotoLoginBycode(it, phone, code, location4Login,
|
||||
object : OchCommonServiceCallback<TaxiLoginRespBean> {
|
||||
@@ -179,9 +177,7 @@ object LoginModel {
|
||||
if (valueOf(data.data.driverStatus) == LoginStatusEnum.Login) {
|
||||
// 业务不支持 去退出登录
|
||||
if (!LoginStatusManager.checkBusiness(data.data.businessType)) {
|
||||
val mLatitude = getChassisLocationGCJ02().latitude
|
||||
val mLongitude = getChassisLocationGCJ02().longitude
|
||||
LoginStatusManager.loginOut(mLatitude, mLongitude)
|
||||
LoginStatusManager.loginOut()
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -220,8 +216,8 @@ object LoginModel {
|
||||
}
|
||||
|
||||
// 登出
|
||||
fun logout(mLatitude: Double, mLongitude: Double) {
|
||||
val location4Login = TaxiLogoutReqBean.Location4Login(mLatitude, mLongitude)
|
||||
fun logout() {
|
||||
val location4Login = TaxiLogoutReqBean.Location4Login()
|
||||
OchCommonServiceManager.logout(
|
||||
mContext!!, location4Login,
|
||||
object : OchCommonServiceCallback<BaseData> {
|
||||
|
||||
@@ -152,14 +152,14 @@ object OchCommonServiceManager {
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
sn
|
||||
).transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "loginStatus"))
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "loginStatus",false))
|
||||
}else{
|
||||
ochLoginServiceSaasEh.queryDriverServiceStatusAndLoginStatus(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
sn
|
||||
).transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "loginStatus"))
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "loginStatus",false))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ dependencies {
|
||||
|
||||
implementation rootProject.ext.dependencies.litezxing
|
||||
|
||||
api rootProject.ext.dependencies.flexbox
|
||||
api project(":OCH:common:data")
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
|
||||
@@ -11,6 +11,9 @@ import com.google.gson.reflect.TypeToken
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.angle.scenes.CrossRoad
|
||||
import com.mogo.eagle.core.function.angle.scenes.Default
|
||||
import com.mogo.eagle.core.function.angle.scenes.LongSight
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.V2N
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.state.State
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
@@ -23,6 +26,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
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.util.ActivityUtils
|
||||
@@ -57,6 +61,7 @@ object DebugDataDispatch {
|
||||
const val stopSite = "stopSite"
|
||||
const val v2N = "xiaozhiV2N"
|
||||
const val romal = "romal"
|
||||
const val visualView = "visual"
|
||||
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "location" --es path "1111/11111"
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "globalPath" --es path "sy73.json"
|
||||
@@ -69,6 +74,7 @@ object DebugDataDispatch {
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "stopSite" --ei state 6 --ei action 1
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "xiaozhiV2N" --es poiType "10002" --ei state 0
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "romal" --ei show 0
|
||||
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "visual" --ei show 0
|
||||
|
||||
|
||||
val ROOT_PATH =
|
||||
@@ -170,6 +176,22 @@ object DebugDataDispatch {
|
||||
pncAction.parkScenarioAction = planningaction.build()
|
||||
CallerPlanningActionsListenerManager.invokePNCActions(pncAction.build())
|
||||
}
|
||||
visualView ->{
|
||||
val state = intent.getIntExtra("show", 0)
|
||||
when (state) {
|
||||
0 -> {
|
||||
CallerVisualAngleManager.changeScene(LongSight())
|
||||
}
|
||||
1 -> {
|
||||
CallerVisualAngleManager.changeScene(Default())
|
||||
}
|
||||
2 -> {
|
||||
CallerVisualAngleManager.changeScene(CrossRoad())
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
|
||||
}
|
||||
romal ->{
|
||||
val state = intent.getIntExtra("show", 0)
|
||||
CallerMapRomaListener.invokeMapRomaRange(state==0)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.och.common.module.biz.login;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class LoginInfo {
|
||||
private int driverStatus; //1登录,0登出
|
||||
private int servingStatus;//1接单中,0暂停接单
|
||||
@@ -157,4 +159,54 @@ public class LoginInfo {
|
||||
", photos='" + photos + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
LoginInfo loginInfo = (LoginInfo) o;
|
||||
|
||||
if (driverStatus != loginInfo.driverStatus) return false;
|
||||
if (servingStatus != loginInfo.servingStatus) return false;
|
||||
if (businessType != loginInfo.businessType) return false;
|
||||
if (purpose != loginInfo.purpose) return false;
|
||||
if (!Objects.equals(orderNo, loginInfo.orderNo))
|
||||
return false;
|
||||
if (!Objects.equals(sn, loginInfo.sn)) return false;
|
||||
if (!Objects.equals(plateNumber, loginInfo.plateNumber))
|
||||
return false;
|
||||
if (!Objects.equals(phone, loginInfo.phone)) return false;
|
||||
if (!Objects.equals(lineId, loginInfo.lineId))
|
||||
return false;
|
||||
if (!Objects.equals(taskId, loginInfo.taskId))
|
||||
return false;
|
||||
if (!Objects.equals(vin, loginInfo.vin)) return false;
|
||||
if (!Objects.equals(cityCode, loginInfo.cityCode))
|
||||
return false;
|
||||
if (!Objects.equals(brand, loginInfo.brand)) return false;
|
||||
if (!Objects.equals(carModel, loginInfo.carModel))
|
||||
return false;
|
||||
return Objects.equals(photos, loginInfo.photos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = driverStatus;
|
||||
result = 31 * result + servingStatus;
|
||||
result = 31 * result + businessType;
|
||||
result = 31 * result + (orderNo != null ? orderNo.hashCode() : 0);
|
||||
result = 31 * result + purpose;
|
||||
result = 31 * result + (sn != null ? sn.hashCode() : 0);
|
||||
result = 31 * result + (plateNumber != null ? plateNumber.hashCode() : 0);
|
||||
result = 31 * result + (phone != null ? phone.hashCode() : 0);
|
||||
result = 31 * result + (lineId != null ? lineId.hashCode() : 0);
|
||||
result = 31 * result + (taskId != null ? taskId.hashCode() : 0);
|
||||
result = 31 * result + (vin != null ? vin.hashCode() : 0);
|
||||
result = 31 * result + (cityCode != null ? cityCode.hashCode() : 0);
|
||||
result = 31 * result + (brand != null ? brand.hashCode() : 0);
|
||||
result = 31 * result + (carModel != null ? carModel.hashCode() : 0);
|
||||
result = 31 * result + (photos != null ? photos.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ interface LoginService :CommonService {
|
||||
/**
|
||||
* 登出
|
||||
*/
|
||||
fun loginOut(mLatitude:Double,mLongitude:Double)
|
||||
fun loginOut()
|
||||
fun checkBusiness(businessType: Int): Boolean
|
||||
fun checkAllEnv(
|
||||
projectType: ProjectType,
|
||||
|
||||
@@ -36,8 +36,8 @@ object LoginStatusManager : CallerBase<ILoginCallback>() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun loginOut(mLatitude: Double, mLongitude: Double) {
|
||||
loginService?.loginOut(mLatitude, mLongitude)
|
||||
fun loginOut() {
|
||||
loginService?.loginOut()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
package com.mogo.och.taxi.passenger.ui.model.order
|
||||
package com.mogo.och.common.module.biz.order
|
||||
|
||||
import com.mogo.och.data.taxi.BaseOrderBean
|
||||
|
||||
interface OrderListener {
|
||||
// 当前进行单状态变更:新到进行中订单、进行中单状态变更
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.mogo.och.common.module.biz.order
|
||||
|
||||
import com.mogo.och.data.taxi.BaseOrderBean
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
object OrderModel {
|
||||
private val mOrderStatusCallbackMap: MutableMap<String, OrderListener> = ConcurrentHashMap()
|
||||
|
||||
var orderBean: BaseOrderBean?=null
|
||||
var preOrderBean: BaseOrderBean?=null
|
||||
|
||||
init {
|
||||
|
||||
}
|
||||
|
||||
fun setOrderStatusCallback(tag: String?, callback: OrderListener?) {
|
||||
if (tag == null || "" == tag) return
|
||||
if (callback == null) {
|
||||
mOrderStatusCallbackMap.remove(tag)
|
||||
return
|
||||
}
|
||||
mOrderStatusCallbackMap[tag] = callback
|
||||
}
|
||||
|
||||
fun <T: BaseOrderBean?>invokeListener(newOrderBean: T?){
|
||||
preOrderBean?.let {
|
||||
if(newOrderBean!=null){
|
||||
if(it.orderNo==newOrderBean.orderNo){
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.orderBean==null){
|
||||
this.orderBean = newOrderBean
|
||||
}else {
|
||||
if(newOrderBean==null){
|
||||
this.preOrderBean = this.orderBean
|
||||
this.orderBean = null
|
||||
}else{
|
||||
if(this.orderBean!!.orderNo == newOrderBean.orderNo){
|
||||
if(this.orderBean!!.orderStatus >= newOrderBean.orderStatus){
|
||||
return
|
||||
}else{
|
||||
this.orderBean = newOrderBean
|
||||
}
|
||||
}else{
|
||||
this.orderBean = newOrderBean
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (callback in mOrderStatusCallbackMap.values) {
|
||||
callback.onCurrentOrderStatusChanged(newOrderBean)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.taxi.constant
|
||||
package com.mogo.och.common.module.biz.order
|
||||
|
||||
/**
|
||||
* Created on 2021/12/7
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.location
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
|
||||
object OchLocationManager {
|
||||
|
||||
@JvmStatic
|
||||
fun getGCJ02Location(): MogoLocation {
|
||||
return CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getWgs02Location():MogoLocation {
|
||||
return CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun addGCJ02Listener(tag:String,callBackHz:Int,listener: IMoGoChassisLocationGCJ02Listener){
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(tag, callBackHz, listener)
|
||||
}
|
||||
@JvmStatic
|
||||
fun removeGCJ02Listener(tag:String){
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(tag)
|
||||
}
|
||||
@JvmStatic
|
||||
fun removeGCJ02Listener(listener: IMoGoChassisLocationGCJ02Listener){
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(listener)
|
||||
}
|
||||
@JvmStatic
|
||||
fun addWgs02Listener(tag:String,callBackHz:Int,listener: IMoGoChassisLocationWGS84Listener){
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(tag, callBackHz, listener)
|
||||
}
|
||||
@JvmStatic
|
||||
fun removeWgs02Listener(tag:String){
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(tag)
|
||||
}
|
||||
@JvmStatic
|
||||
fun removeWgs02Listener(listener: IMoGoChassisLocationWGS84Listener){
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(listener)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -8,7 +8,6 @@ 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.util.CoordinateUtils
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager.writeChainLog
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
@@ -105,7 +104,7 @@ object TrajectoryManager : IMoGoPlanningRottingListener {
|
||||
|
||||
fun addDownLoadSuccessLine(lineId:Long){
|
||||
if(lineId>0){
|
||||
writeChainLog("轨迹监控", "onAutopilotGuardian() 轨迹下载成功${lineId}", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY)
|
||||
OchChainLogManager.writeChainLog("轨迹监控", "onAutopilotGuardian() 轨迹下载成功${lineId}", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY)
|
||||
downLoadSuccessLineIds.add(lineId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.och.common.module.manager.device
|
||||
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
|
||||
import io.reactivex.disposables.Disposable
|
||||
@@ -35,7 +35,7 @@ object LightAirconditionDoorManager {
|
||||
}
|
||||
|
||||
private fun canOpenOrCloseDoor(): String? {
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val location = OchLocationManager.getGCJ02Location()
|
||||
return if(location.gnssSpeed<0.3){
|
||||
null
|
||||
}else{
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
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.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
@@ -13,6 +12,7 @@ import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.utilcode.util.LocationUtils
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutopilotAnalytics
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.manager.autopilot.trajectory.TrajectoryCache
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loop.LoopInfo
|
||||
@@ -270,7 +270,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
*/
|
||||
private fun calculateDistance() {
|
||||
//mLocation gcj坐标
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().let {
|
||||
OchLocationManager.getGCJ02Location().let {
|
||||
if (mRoutePoints.isNullOrEmpty() || endStationInfo.stationPoint == null) {
|
||||
d(M_OCHCOMMON + TAG, "没有轨迹或站点坐标停止计算")
|
||||
//结束距离计算
|
||||
@@ -677,23 +677,20 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
return if (redCatche.isNullOrEmpty()) {
|
||||
distanceWithStartStation()
|
||||
} else {
|
||||
val currentPoint =
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val currentPoint = OchLocationManager.getGCJ02Location()
|
||||
distanceWithTrajectory(redCatche,currentPoint)
|
||||
}
|
||||
|
||||
} else {
|
||||
return if (this.lineId == 0L || this.lineId == null) {
|
||||
val currentPoint =
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val currentPoint = OchLocationManager.getGCJ02Location()
|
||||
distanceWithTrajectory(mRoutePoints!!,currentPoint)
|
||||
} else {
|
||||
if (lineId.toLong() != this.lineId) {
|
||||
// 判断距离起始站的距离
|
||||
distanceWithStartStation()
|
||||
} else {
|
||||
val currentPoint =
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val currentPoint = OchLocationManager.getGCJ02Location()
|
||||
distanceWithTrajectory(mRoutePoints!!,currentPoint)
|
||||
}
|
||||
}
|
||||
@@ -712,7 +709,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
if (startStationInfo.stationPoint == null) {
|
||||
return errorTypeNoneLineId
|
||||
}
|
||||
val currentPoint = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val currentPoint = OchLocationManager.getGCJ02Location()
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
currentPoint.longitude,
|
||||
currentPoint.latitude,
|
||||
|
||||
@@ -16,22 +16,32 @@ import com.zhjt.service.chain.ChainLog
|
||||
object OchChainLogManager {
|
||||
|
||||
private val TAG = OchChainLogManager::class.java.simpleName
|
||||
|
||||
// 通用 title changeinfo 日志
|
||||
const val EVENT_KEY_INFE_WITH_CHANGE = "event_key_och_common_info_and_changeinfo"
|
||||
// 轨迹信息监控
|
||||
const val EVENT_KEY_INFE_WITH_TRAJECTORY = "event_key_och_trajectory_info"
|
||||
// 音乐播放日志
|
||||
const val EVENT_KEY_INFE_WITH_MUSIC = "event_key_och_music_info"
|
||||
const val EVENT_KEY_INFE_WITH_BUS = "event_key_och_bus_info"
|
||||
|
||||
// 需要举行观察的
|
||||
const val EVENT_KEY_INFE_ERROR = "event_key_och_error"
|
||||
|
||||
// 网络接口
|
||||
const val EVENT_KEY_INFO_Net = "event_key_och_net"
|
||||
// 初始化信息
|
||||
const val EVENT_KEY_INFO_INIT = "event_key_och_init"
|
||||
// 局域网内socket 通讯
|
||||
const val EVENT_KEY_INFO_SOCKET = "analytics_event_och_track_screen_msg"
|
||||
// 局域网内socket 连接状态流转
|
||||
const val EVENT_KEY_INFO_SOCKET_CONNECT = "analytics_event_och_track_screen_connect"
|
||||
|
||||
|
||||
fun writeChainLogNet(title: String, info: String){
|
||||
writeChainLog(title,info,true,EVENT_KEY_INFO_Net)
|
||||
fun writeChainLogNet(mustUpdate: Boolean, title: String, info: String) {
|
||||
if(mustUpdate){
|
||||
writeChainLog(title, info, true, EVENT_KEY_INFO_Net)
|
||||
}else {
|
||||
writeChainLog(title, info, DebugConfig.isDebug(), EVENT_KEY_INFO_Net)
|
||||
}
|
||||
}
|
||||
fun writeChainLogInit(title: String, info: String) {
|
||||
writeChainLog(title,info,true,EVENT_KEY_INFO_INIT)
|
||||
@@ -39,13 +49,17 @@ object OchChainLogManager {
|
||||
fun writeChainLogNetLanSocketConnect(title: String, info: String){
|
||||
writeChainLog(title,info,true,EVENT_KEY_INFO_SOCKET_CONNECT)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun writeChainLogLanSocket(title: String, info: String, action:String){
|
||||
val map = hashMapOf<String, Any>()
|
||||
map["action"] = action
|
||||
writeChainLog(title,info,true,EVENT_KEY_INFO_SOCKET, map)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun writeChainLog(title: String, info: String){
|
||||
writeChainLog(title,info,true,EVENT_KEY_INFE_WITH_CHANGE)
|
||||
}
|
||||
@JvmStatic
|
||||
fun writeChainLog(title: String, info: String, upload:Boolean = true, eventID:String=EVENT_KEY_INFE_WITH_CHANGE) {
|
||||
writeChainLog(title,info,upload,eventID,null)
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.AppConnectMsg
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BaseDPMsg
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.voice.VoiceNotice
|
||||
|
||||
|
||||
object LanSocketManager : LanSocketManagerJava() {
|
||||
@@ -89,7 +90,7 @@ object LanSocketManager : LanSocketManagerJava() {
|
||||
.build()
|
||||
mAudioManager.requestAudioFocus(mAudioFocusRequest) //抢占焦点
|
||||
|
||||
AIAssist.getInstance(mContext)
|
||||
VoiceNotice
|
||||
.speakTTSVoiceWithLevel(msg, AIAssist.LEVEL0, object : IMogoVoiceCmdCallBack {
|
||||
override fun onSpeakEnd(speakText: String?) {
|
||||
mAudioManager.abandonAudioFocusRequest(mAudioFocusRequest)
|
||||
|
||||
@@ -6,7 +6,9 @@ import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.V2N
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.listener.OnXiaoZhiStateChangeListener
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.state.State
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
|
||||
object ZhiV2NManager : OnXiaoZhiStateChangeListener {
|
||||
init {
|
||||
@@ -14,6 +16,7 @@ object ZhiV2NManager : OnXiaoZhiStateChangeListener {
|
||||
}
|
||||
|
||||
override fun onChanged(event: Event, state: State) {
|
||||
OchChainLogManager.writeChainLog("小智脸部消息","event:${event}-----state${state}")
|
||||
if (event is V2N) {
|
||||
var drawable: Int? = null
|
||||
when (event.type) {
|
||||
@@ -322,12 +325,14 @@ object ZhiV2NManager : OnXiaoZhiStateChangeListener {
|
||||
}
|
||||
}
|
||||
if (drawable != null) {
|
||||
if(state==State.START){
|
||||
ZhiViewmanager.warnAni.drawable = drawable
|
||||
ZhiViewmanager.showListeningAni(ZhiViewmanager.warnAni,true)
|
||||
}else if(state==State.STOP){
|
||||
ZhiViewmanager.stopWarnAni()
|
||||
}
|
||||
UiThreadHandler.post({
|
||||
if(state==State.START){
|
||||
ZhiViewmanager.warnAni.drawable = drawable
|
||||
ZhiViewmanager.showListeningAni(ZhiViewmanager.warnAni,true)
|
||||
}else if(state==State.STOP){
|
||||
ZhiViewmanager.stopWarnAni()
|
||||
}
|
||||
},UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.och.common.module.network
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.network.RequestOptions
|
||||
import com.mogo.eagle.core.network.SubscribeImpl
|
||||
@@ -23,7 +24,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
init {
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: 去请求()")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}_${tag}", "去请求")
|
||||
OchChainLogManager.writeChainLogNet(false,"接口:${apiName}", "去请求_${tag}")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +32,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
super.onSuccess(o)
|
||||
CallerLogger.d("$flavorTag$TAG", "$apiName: onSuccess() ${o.msg}")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}_${tag}", "请求成功:${o}")
|
||||
OchChainLogManager.writeChainLogNet(false,"接口:${apiName}", "请求成功:${o}_${tag}")
|
||||
}
|
||||
callback?.onSuccess(o)
|
||||
}
|
||||
@@ -40,7 +41,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
super.onError(e)
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: onError() ${e.message}")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet("接口:${apiName}_${tag}", "请求失败:${e.message}")
|
||||
OchChainLogManager.writeChainLogNet(false,"接口:${apiName}", "请求失败:${e.message}_${tag}")
|
||||
}
|
||||
callback?.onError("$apiName: onError() ${e.message}")
|
||||
callback?.onError()
|
||||
@@ -51,8 +52,9 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: onError() code = $code; message = $message")
|
||||
if(writeLog) {
|
||||
OchChainLogManager.writeChainLogNet(
|
||||
"接口:${apiName}_${tag}",
|
||||
"请求失败: onError() code = $code; message = $message\""
|
||||
true,
|
||||
"接口:${apiName}",
|
||||
"请求失败: onError() code = $code; message = $message\" _${tag}"
|
||||
)
|
||||
}
|
||||
callback?.onFail(code, message)
|
||||
|
||||
@@ -578,6 +578,20 @@ object CoordinateCalculateRouteUtil {
|
||||
return 360-bearing
|
||||
}
|
||||
|
||||
fun getHeadingAngleTemp(locationLongitude: Double, locationLatitude: Double,
|
||||
nextPointLongitude: Double, nextPointLatitude: Double): Double {
|
||||
val lat1Rad = Math.toRadians(locationLatitude)
|
||||
val lat2Rad = Math.toRadians(nextPointLatitude)
|
||||
val lon1Rad = Math.toRadians(locationLongitude)
|
||||
val lon2Rad = Math.toRadians(nextPointLongitude)
|
||||
|
||||
val y = sin(lon2Rad - lon1Rad) * cos(lat2Rad)
|
||||
val x = cos(lat1Rad) * sin(lat2Rad) - sin(lat1Rad) * cos(lat2Rad) * cos(lon2Rad - lon1Rad)
|
||||
|
||||
val bearing = Math.toDegrees(atan2(y, x))
|
||||
return (bearing + 360) % 360
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,13 +2,19 @@ package com.mogo.och.common.module.voice
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.manager.audiofocus.AudioFocusManager
|
||||
import com.mogo.tts.base.IMogoTTSCallback
|
||||
import com.mogo.tts.base.LangTtsEntity
|
||||
import com.mogo.tts.base.LanguageType
|
||||
import com.mogo.tts.base.MultiLangTtsEntity
|
||||
|
||||
object VoiceNotice {
|
||||
|
||||
const val onlyChinese = 1 //中文
|
||||
const val chineseEnglishKorean = 1 shl 1 // 左移一位 中英韩
|
||||
|
||||
@JvmStatic
|
||||
fun showNotice(notice: String?) {
|
||||
showNotice(notice, AIAssist.LEVEL0)
|
||||
@@ -59,11 +65,27 @@ object VoiceNotice {
|
||||
|
||||
@JvmStatic
|
||||
fun showNotice(listTTS: MutableList<LangTtsEntity>, level: Int,callBack: IMogoTTSCallback?=null) {
|
||||
if(FunctionBuildConfig.ttsLanguage and onlyChinese>0){
|
||||
val tempList = mutableListOf<LangTtsEntity>()
|
||||
listTTS.forEach {
|
||||
if(it.language != LanguageType.CHINESE){
|
||||
tempList.add(it)
|
||||
}
|
||||
}
|
||||
listTTS.removeAll(tempList)
|
||||
}
|
||||
AIAssist.getInstance(AbsMogoApplication.getApp())
|
||||
.speakMultiLangTTSWithLevel(MultiLangTtsEntity(listTTS), level,callCallBack(callBack))
|
||||
}
|
||||
|
||||
|
||||
fun speakTTSVoiceWithLevel(text:String, level:Int, callBack:IMogoTTSCallback){
|
||||
AIAssist.getInstance(AbsMogoApplication.getApp()).speakTTSVoiceWithLevel(text,level,callBack)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private fun callCallBack(callBack: IMogoTTSCallback?):IMogoTTSCallback{
|
||||
return object :IMogoTTSCallback{
|
||||
override fun onSpeakStart(speakText: String?) {
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.mogo.och.common.module.wigets.map.overmapview
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.function.business.travelreality.EventDrawBean
|
||||
import androidx.recyclerview.widget.DiffUtil.Callback
|
||||
import com.mogo.och.common.module.R
|
||||
|
||||
/**
|
||||
* Created by yangyakun on 06/06/17.
|
||||
*/
|
||||
class IconListItemAdapter(
|
||||
private val context: Context,
|
||||
private val dataList: MutableList<EventDrawBean>
|
||||
) : RecyclerView.Adapter<IconListItemAdapter.TextVH>() {
|
||||
|
||||
fun setDataList(dataList: List<EventDrawBean>) {
|
||||
if (this.dataList == dataList) {
|
||||
// 如果新旧列表一致,则直接返回
|
||||
return
|
||||
}
|
||||
|
||||
val diffResult = DiffUtil.calculateDiff(MyDiffCallback(this.dataList, dataList))
|
||||
this.dataList.clear()
|
||||
this.dataList.addAll(dataList)
|
||||
diffResult.dispatchUpdatesTo(this)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TextVH {
|
||||
val view: View
|
||||
val inflater = LayoutInflater.from(context)
|
||||
view = inflater.inflate(R.layout.taxt_d_icon_item, parent, false)
|
||||
return TextVH(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: TextVH, position: Int) {
|
||||
val errorInfo = dataList[holder.bindingAdapterPosition]
|
||||
holder.acivQuanxilukValue.text = errorInfo.title
|
||||
holder.acivQuanxiluk.setImageResource(errorInfo.resId)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return dataList.size
|
||||
}
|
||||
|
||||
inner class TextVH(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var acivQuanxiluk: AppCompatImageView
|
||||
var acivQuanxilukValue: AppCompatTextView
|
||||
init {
|
||||
acivQuanxiluk = itemView.findViewById(R.id.aciv_quanxiluk)
|
||||
acivQuanxilukValue = itemView.findViewById(R.id.aciv_quanxiluk_value)
|
||||
}
|
||||
}
|
||||
|
||||
inner class MyDiffCallback(val oldData:List<EventDrawBean>,val newData:List<EventDrawBean>):Callback(){
|
||||
override fun getOldListSize(): Int {
|
||||
return oldData.size
|
||||
}
|
||||
|
||||
override fun getNewListSize(): Int {
|
||||
return newData.size
|
||||
}
|
||||
|
||||
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
||||
val oldItem = oldData[oldItemPosition]
|
||||
val newItem = newData[newItemPosition]
|
||||
return oldItem.resId == newItem.resId
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
||||
val oldItem = oldData[oldItemPosition]
|
||||
val newItem = newData[newItemPosition]
|
||||
return oldItem.resId == newItem.resId
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.mogo.och.common.module.wigets.map.overmapview
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.och.common.module.R
|
||||
|
||||
class OverMapBottomView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr){
|
||||
|
||||
|
||||
private fun initView() {
|
||||
LayoutInflater.from(context).inflate(R.layout.common_overmap_bottom, this, true)
|
||||
}
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.mogo.och.common.module.wigets.map.overmapview
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
import com.mogo.och.common.module.R
|
||||
import kotlinx.android.synthetic.main.common_overmap_dialog.aciv_close_map
|
||||
import kotlinx.android.synthetic.main.common_overmap_dialog.repvErrorPointReason
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
class OverMapDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
init {
|
||||
setContentView(R.layout.common_overmap_dialog)
|
||||
setCanceledOnTouchOutside(true)
|
||||
aciv_close_map.onClick {
|
||||
hideDialog()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
repvErrorPointReason?.let {
|
||||
it.onCreateView(savedInstanceState)
|
||||
val radius = AutoSizeUtils.dp2px(context, 16f)
|
||||
it.outlineProvider = TextureVideoViewOutlineProvider(radius.toFloat())
|
||||
it.clipToOutline = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
repvErrorPointReason.onResume()
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
repvErrorPointReason.onResume()
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun showDialog() {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
show()
|
||||
}
|
||||
|
||||
fun hideDialog() {
|
||||
if (isShowing) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
fun destory(){
|
||||
repvErrorPointReason.onDestroy()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.mogo.och.common.module.wigets.map.overmapview
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.RelativeLayout
|
||||
import com.google.android.flexbox.AlignItems
|
||||
import com.google.android.flexbox.FlexDirection
|
||||
import com.google.android.flexbox.FlexWrap
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
import com.google.android.flexbox.JustifyContent
|
||||
import com.mogo.eagle.core.function.business.travelreality.EventDrawBean
|
||||
import com.mogo.eagle.core.function.view.TravelRealityView
|
||||
import com.mogo.och.common.module.R
|
||||
import kotlinx.android.synthetic.main.common_overmap_view.view.ovbv_bottom_icons
|
||||
import kotlinx.android.synthetic.main.common_overmap_view.view.ovbv_bottom_icons_cl
|
||||
import kotlinx.android.synthetic.main.common_overmap_view.view.travelRealityView
|
||||
import kotlinx.android.synthetic.main.common_overmap_view.view.tv_add_false
|
||||
import kotlinx.android.synthetic.main.common_overmap_view.view.tv_add_true
|
||||
|
||||
class OverMapView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : RelativeLayout(context, attrs, defStyleAttr){
|
||||
|
||||
private var iconListItemAdapter:IconListItemAdapter?=null
|
||||
|
||||
private val eventDrawBeansTrue = mutableListOf<EventDrawBean>()
|
||||
private val eventDrawBeansFalse = mutableListOf<EventDrawBean>()
|
||||
|
||||
private val listener = object : TravelRealityView.OnDrawListener{
|
||||
override fun onDraw(eventList: List<EventDrawBean>, isEvent: Boolean) {
|
||||
// if(isEvent){
|
||||
// eventDrawBeansTrue.clear()
|
||||
// eventDrawBeansTrue.addAll(eventList)
|
||||
// }else{
|
||||
// eventDrawBeansFalse.clear()
|
||||
// eventDrawBeansFalse.addAll(eventList)
|
||||
// }
|
||||
// iconListItemAdapter?.let {
|
||||
// it.setDataList(eventDrawBeansTrue+eventDrawBeansFalse)
|
||||
// if(it.itemCount==0){
|
||||
// ovbv_bottom_icons_cl.visibility = GONE
|
||||
// }else{
|
||||
// ovbv_bottom_icons_cl.visibility = VISIBLE
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
LayoutInflater.from(context).inflate(R.layout.common_overmap_view, this, true)
|
||||
|
||||
|
||||
|
||||
val flexboxLayoutManager = FlexboxLayoutManager(context)
|
||||
flexboxLayoutManager.flexDirection = FlexDirection.ROW;
|
||||
flexboxLayoutManager.alignItems = AlignItems.CENTER
|
||||
flexboxLayoutManager.flexWrap = FlexWrap.WRAP
|
||||
flexboxLayoutManager.justifyContent = JustifyContent.CENTER
|
||||
|
||||
ovbv_bottom_icons?.layoutManager = flexboxLayoutManager
|
||||
//ovbv_bottom_icons?.setHasFixedSize(true)
|
||||
iconListItemAdapter = IconListItemAdapter(
|
||||
context, mutableListOf(
|
||||
EventDrawBean(R.drawable.mogo_quanxi_lukou, "全息路口"),
|
||||
EventDrawBean(R.drawable.mogo_jingzhi_nor, "静止事件"),
|
||||
EventDrawBean(R.drawable.mogo_shigong_image, "道路施工"),
|
||||
EventDrawBean(R.drawable.mogo_shigu_nor, "交通事故")
|
||||
)
|
||||
)
|
||||
|
||||
ovbv_bottom_icons?.adapter = iconListItemAdapter
|
||||
|
||||
travelRealityView.setOnDrawListener(listener)
|
||||
|
||||
tv_add_true.setOnClickListener {
|
||||
listener.onDraw(mutableListOf(
|
||||
EventDrawBean(R.drawable.mogo_jingzhi_nor,"全息路口"),
|
||||
EventDrawBean(R.drawable.mogo_shigong_image,"静止事件"),
|
||||
),true)
|
||||
}
|
||||
|
||||
tv_add_false.setOnClickListener {
|
||||
listener.onDraw(mutableListOf(
|
||||
EventDrawBean(R.drawable.mogo_quanxi_lukou,"全息路口"),
|
||||
),false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun onCreateView(savedInstanceState: Bundle?) {
|
||||
travelRealityView.onCreateView(savedInstanceState)
|
||||
}
|
||||
|
||||
fun onResume() {
|
||||
travelRealityView.onResume()
|
||||
}
|
||||
|
||||
fun onPause() {
|
||||
travelRealityView.onPause()
|
||||
}
|
||||
|
||||
fun onDestroy() {
|
||||
travelRealityView.onDestroy()
|
||||
}
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
package com.mogo.och.common.module.wigets.map.switchvisual
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.graphics.LinearGradient
|
||||
import android.graphics.Paint
|
||||
import android.graphics.Shader
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.widget.ImageView
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.constraintlayout.widget.ConstraintSet
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.R
|
||||
import kotlinx.android.synthetic.main.taxi_p_seekbar_visualangle.view.iv_visualangle_bg
|
||||
import kotlinx.android.synthetic.main.taxi_p_seekbar_visualangle.view.iv_visualangle_value
|
||||
import kotlinx.android.synthetic.main.taxi_seekbar_visualangle.view.iv_visualangle_bg_dark
|
||||
import kotlinx.android.synthetic.main.taxi_seekbar_visualangle.view.iv_visualangle_value_dark
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
|
||||
class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback {
|
||||
|
||||
//定义、并创建画笔
|
||||
var p = Paint().apply {
|
||||
strokeWidth = 1f
|
||||
style = Paint.Style.STROKE
|
||||
isAntiAlias = true
|
||||
shader = LinearGradient(
|
||||
0f, 0f, 600f, 600f, intArrayOf(Color.RED, Color.BLUE, Color.BLACK),
|
||||
null, Shader.TileMode.CLAMP
|
||||
)
|
||||
}
|
||||
|
||||
private val TAG = "SeekBarView"
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attributeSet,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
private var viewModel: VisualViewModel? = null
|
||||
|
||||
var enableCallback:EnableCallback?=null
|
||||
|
||||
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
|
||||
super.onLayout(changed, left, top, right, bottom)
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
super.onDraw(canvas)
|
||||
}
|
||||
|
||||
private var initialX = 0f
|
||||
private var initialY = 0f
|
||||
private val tempSet = ConstraintSet()
|
||||
|
||||
/**
|
||||
* 为该组件的触碰事件重写事件处理方法
|
||||
*/
|
||||
override fun onTouchEvent(event: MotionEvent?): Boolean {
|
||||
if(value==VisualViewModel.Visualangle.UnChange){
|
||||
return true
|
||||
}
|
||||
when (event?.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
initialX = event.rawX;
|
||||
initialY = event.rawY;
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
|
||||
if(draggableButton.translationY<-draggableButton.height){
|
||||
tempSet.clone(this)
|
||||
tempSet.setTranslationY(draggableButton.id,-draggableButton.height.toFloat())
|
||||
tempSet.applyTo(this)
|
||||
return true
|
||||
}else if (draggableButton.translationY>(height)){
|
||||
tempSet.clone(this)
|
||||
tempSet.setTranslationY(draggableButton.id,(height).toFloat())
|
||||
tempSet.applyTo(this)
|
||||
return true
|
||||
}
|
||||
|
||||
val dx = event.rawX - initialX;
|
||||
val dy = event.rawY - initialY;
|
||||
initialX = event.rawX;
|
||||
initialY = event.rawY;
|
||||
|
||||
tempSet.clone(this)
|
||||
tempSet.setTranslationY(draggableButton.id,draggableButton.translationY+dy)
|
||||
tempSet.applyTo(this)
|
||||
}
|
||||
MotionEvent.ACTION_UP -> {
|
||||
if(draggableButton.translationY<0){
|
||||
translationByValue(VisualViewModel.Visualangle.Long)
|
||||
}else if (draggableButton.translationY>(height-draggableButton.height)){
|
||||
translationByValue(VisualViewModel.Visualangle.Middle)
|
||||
}else{
|
||||
val marginTop = draggableButton.translationY
|
||||
val split = (height - draggableButton.height) / 2
|
||||
|
||||
// if(marginTop>0&&marginTop<split){
|
||||
// translationByValue(Visualangle.Middle)
|
||||
// }else if(marginTop>split&&marginTop<split*2){
|
||||
// translationByValue(Visualangle.Crossroads)
|
||||
// }else if(marginTop*2>split&&marginTop<(height - draggableButton.height)){
|
||||
// translationByValue(Visualangle.Long)
|
||||
// }
|
||||
|
||||
if(marginTop>0&&marginTop<split){
|
||||
translationByValue(VisualViewModel.Visualangle.Long)
|
||||
}else if(marginTop>split&&marginTop<(height - draggableButton.height)){
|
||||
translationByValue(VisualViewModel.Visualangle.Middle)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private var value: VisualViewModel.Visualangle by Delegates.observable(VisualViewModel.Visualangle.None) { _, oldValue, newValue ->
|
||||
CallerLogger.d(TAG,"oldValue:${oldValue}____newValue:${newValue}")
|
||||
if (oldValue != newValue) {
|
||||
viewModel?.changeVisualView(newValue)
|
||||
if(newValue==VisualViewModel.Visualangle.UnChange){
|
||||
this.enableCallback?.enableChangeListener(false)
|
||||
}else{
|
||||
if (oldValue==VisualViewModel.Visualangle.UnChange) {
|
||||
this.enableCallback?.enableChangeListener(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun translationByValue(visualangle: VisualViewModel.Visualangle){
|
||||
value = visualangle
|
||||
when (visualangle) {
|
||||
VisualViewModel.Visualangle.Middle -> {
|
||||
ObjectAnimator.ofFloat(
|
||||
draggableButton, "translationY", draggableButton.translationY,
|
||||
(height - draggableButton.height).toFloat()
|
||||
).apply {
|
||||
duration = 100
|
||||
}.start()
|
||||
}
|
||||
VisualViewModel.Visualangle.Long -> {
|
||||
ObjectAnimator.ofFloat(
|
||||
draggableButton, "translationY", draggableButton.translationY,
|
||||
0f
|
||||
).apply {
|
||||
duration = 100
|
||||
}.start()
|
||||
}
|
||||
VisualViewModel.Visualangle.UnChange -> {
|
||||
ObjectAnimator.ofFloat(
|
||||
draggableButton, "translationY", draggableButton.translationY,
|
||||
(height - draggableButton.height) / 2f
|
||||
).apply {
|
||||
duration = 100
|
||||
}.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private lateinit var draggableButton:ImageView
|
||||
|
||||
private fun initView() {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_seekbar_visualangle, this, true)
|
||||
draggableButton = findViewById(R.id.iv_visualangle_value_dark)
|
||||
}else{
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_p_seekbar_visualangle, this, true)
|
||||
draggableButton = findViewById(R.id.iv_visualangle_value)
|
||||
}
|
||||
}
|
||||
|
||||
fun setBgResource(@DrawableRes resource:Int){
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
iv_visualangle_bg_dark.setImageResource(resource)
|
||||
}else{
|
||||
iv_visualangle_bg.setImageResource(resource)
|
||||
}
|
||||
}
|
||||
fun setHumbResource(@DrawableRes resource:Int){
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
iv_visualangle_value_dark.setImageResource(resource)
|
||||
}else{
|
||||
iv_visualangle_value.setImageResource(resource)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
viewModel = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(VisualViewModel::class.java)
|
||||
}
|
||||
|
||||
viewModel?.setDistanceCallback(this)
|
||||
|
||||
}
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun setMiddleAngle() {
|
||||
UiThreadHandler.post({
|
||||
translationByValue(VisualViewModel.Visualangle.Middle)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
|
||||
}
|
||||
|
||||
override fun setLongAngle() {
|
||||
UiThreadHandler.post({
|
||||
translationByValue(VisualViewModel.Visualangle.Long)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
|
||||
}
|
||||
|
||||
override fun setUnableChange() {
|
||||
UiThreadHandler.post({
|
||||
translationByValue(VisualViewModel.Visualangle.UnChange)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
override fun setSkyboxAngle() {
|
||||
UiThreadHandler.post({
|
||||
translationByValue(VisualViewModel.Visualangle.Middle)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
interface EnableCallback{
|
||||
fun enableChangeListener(enable:Boolean)
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.mogo.och.common.module.wigets.map.switchvisual
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.R
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class VisualView : AppCompatImageView, VisualViewModel.IVisualCallback {
|
||||
|
||||
private val TAG = "VisualView"
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attributeSet,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
private fun initView() {
|
||||
setImageResource(R.drawable.common_visual_medium)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
|
||||
val viewModel = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(VisualViewModel::class.java)
|
||||
}
|
||||
|
||||
viewModel?.setDistanceCallback(this)
|
||||
|
||||
onClick {
|
||||
viewModel?.changeVisualView()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun setViewShow(boolean: Boolean) {
|
||||
UiThreadHandler.post({
|
||||
if (boolean) {
|
||||
visibility = View.VISIBLE
|
||||
} else {
|
||||
visibility = View.GONE
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
override fun setViewResource(resource: Int) {
|
||||
UiThreadHandler.post({
|
||||
setImageResource(resource)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.mogo.och.common.module.wigets.map.switchvisual
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.och.common.module.R
|
||||
import kotlinx.android.synthetic.main.common_visualangle_black.view.iv_center_location_bg
|
||||
import kotlinx.android.synthetic.main.common_visualangle_black.view.iv_visual_angle_title_bottom
|
||||
import kotlinx.android.synthetic.main.common_visualangle_black.view.iv_visual_angle_title_head
|
||||
import kotlinx.android.synthetic.main.common_visualangle_black.view.iv_visual_angle_title_value_bg
|
||||
|
||||
|
||||
class VisualViewDirver : ConstraintLayout {
|
||||
|
||||
private val TAG = "LeftBarView"
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
|
||||
init {
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
LayoutInflater.from(context).inflate(R.layout.common_visualangle_black, this, true)
|
||||
|
||||
iv_visual_angle_title_value_bg.enableCallback = object :SeekBarView.EnableCallback{
|
||||
override fun enableChangeListener(enable: Boolean) {
|
||||
if(enable){
|
||||
iv_visual_angle_title_head.alpha = 1f
|
||||
iv_visual_angle_title_head.alpha = 1f
|
||||
iv_visual_angle_title_bottom.alpha = 1f
|
||||
iv_visual_angle_title_value_bg.alpha = 1f
|
||||
iv_visual_angle_title_value_bg.alpha = 1f
|
||||
iv_center_location_bg.alpha = 1f
|
||||
|
||||
// iv_visual_angle_title_head.setImageResource(R.drawable.commont_visual_head)
|
||||
// iv_visual_angle_title_bottom.setImageResource(R.drawable.common_visual_bottom)
|
||||
// iv_visual_angle_title_value_bg.setBgResource(R.drawable.common_visual_angle_bg)
|
||||
// iv_visual_angle_title_value_bg.setHumbResource(R.drawable.common_visual_angle)
|
||||
iv_center_location_bg.setImageResource(R.drawable.common_visualangle_bg)
|
||||
}else{
|
||||
iv_visual_angle_title_head.alpha = 0.5f
|
||||
iv_visual_angle_title_bottom.alpha = 0.5f
|
||||
iv_visual_angle_title_value_bg.alpha = 0.5f
|
||||
iv_visual_angle_title_value_bg.alpha = 0.5f
|
||||
iv_center_location_bg.alpha = 0.5f
|
||||
|
||||
// iv_visual_angle_title_head.setImageResource(R.drawable.commont_visual_head_unable)
|
||||
// iv_visual_angle_title_bottom.setImageResource(R.drawable.common_visual_bottom_unenable)
|
||||
// iv_visual_angle_title_value_bg.setBgResource(R.drawable.common_visual_angle_bg_unenable)
|
||||
// iv_visual_angle_title_value_bg.setHumbResource(R.drawable.common_visual_angle_unenable)
|
||||
// iv_center_location_bg.setImageResource(R.drawable.common_visualangle_bg_unenable)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
}
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +1,16 @@
|
||||
package com.mogo.och.common.module.wigets.map.switchvisual
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.map.listener.IMogoMapListener
|
||||
import com.mogo.map.listener.MogoMapListenerHandler
|
||||
import com.mogo.eagle.core.function.angle.scenes.LongSight
|
||||
import com.mogo.eagle.core.function.api.map.angle.IMoGoVisualAngleChangeProvider
|
||||
import com.mogo.eagle.core.function.api.map.angle.Scene
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.eagle.core.function.angle.scenes.Default
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
|
||||
class VisualViewModel : ViewModel(), IMogoMapListener {
|
||||
class VisualViewModel : ViewModel(),
|
||||
IMoGoVisualAngleChangeProvider.OnMoGoVisualAngleSceneChangeListener {
|
||||
|
||||
private val TAG = VisualViewModel::class.java.simpleName
|
||||
|
||||
@@ -20,72 +22,89 @@ class VisualViewModel : ViewModel(), IMogoMapListener {
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
MogoMapListenerHandler.mogoMapListenerHandler.unregisterHostMapListener(TAG)
|
||||
CallerVisualAngleManager.removeListener(TAG)
|
||||
this.viewCallback = null
|
||||
}
|
||||
|
||||
fun setDistanceCallback(viewCallback: IVisualCallback) {
|
||||
MogoMapListenerHandler.mogoMapListenerHandler.registerHostMapListener(TAG, this)
|
||||
CallerVisualAngleManager.addListener(TAG, this)
|
||||
this.viewCallback = viewCallback
|
||||
}
|
||||
|
||||
override fun onMapVisualAngleChanged(visualAngleMode: VisualAngleMode?) {
|
||||
CallerLogger.d(TAG,"视角切换成功${visualAngleMode}")
|
||||
visualAngleMode?.let {
|
||||
if (visualAngleMode.isMediumSight) {
|
||||
this.viewCallback?.setViewShow(true)
|
||||
this.viewCallback?.setViewResource(R.drawable.common_visual_medium)
|
||||
} else if (visualAngleMode.isLongSight) {
|
||||
this.viewCallback?.setViewShow(true)
|
||||
this.viewCallback?.setViewResource(R.drawable.common_visual_long)
|
||||
} else if (visualAngleMode.isCloseSight) {
|
||||
this.viewCallback?.setViewShow(false)
|
||||
} else{
|
||||
this.viewCallback?.setViewShow(false)
|
||||
override fun onSceneChanged(scene: Scene) {
|
||||
if (scene.isCanSwitch) {// 可切换
|
||||
when (scene.angle) {
|
||||
VisualAngleMode.MODE_MEDIUM_SIGHT -> {
|
||||
UiThreadHandler.post({
|
||||
this.viewCallback?.setViewShow(true)
|
||||
this.viewCallback?.setMiddleAngle()
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
VisualAngleMode.MODE_LONG_SIGHT -> {
|
||||
UiThreadHandler.post({
|
||||
this.viewCallback?.setViewShow(true)
|
||||
this.viewCallback?.setLongAngle()
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
|
||||
}
|
||||
|
||||
VisualAngleMode.MAP_STYLE_VR_SKY_BOX -> {
|
||||
UiThreadHandler.post({
|
||||
this.viewCallback?.setViewShow(true)
|
||||
this.viewCallback?.setSkyboxAngle()
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
else -> {
|
||||
// 不可切换
|
||||
UiThreadHandler.post({
|
||||
this.viewCallback?.setViewShow(false)
|
||||
this.viewCallback?.setUnableChange()
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
}
|
||||
} else {// 不可切换
|
||||
UiThreadHandler.post({
|
||||
this.viewCallback?.setViewShow(false)
|
||||
this.viewCallback?.setUnableChange()
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMapLoaded() {
|
||||
super.onMapLoaded()
|
||||
CallerLogger.d(TAG,"地图加载成功 onMapLoaded")
|
||||
val mapUIController = CallerMapUIServiceManager.getMapUIController()
|
||||
mapUIController?.let {
|
||||
val visualAngleMode = mapUIController.currentMapVisualAngle
|
||||
if (visualAngleMode.isMediumSight) {
|
||||
this.viewCallback?.setViewShow(true)
|
||||
this.viewCallback?.setViewResource(R.drawable.common_visual_medium)
|
||||
} else if (visualAngleMode.isLongSight) {
|
||||
this.viewCallback?.setViewShow(true)
|
||||
this.viewCallback?.setViewResource(R.drawable.common_visual_long)
|
||||
} else if (visualAngleMode.isCloseSight) {
|
||||
this.viewCallback?.setViewShow(false)
|
||||
} else{
|
||||
this.viewCallback?.setViewShow(false)
|
||||
fun changeVisualView(angle: Visualangle) {
|
||||
|
||||
when (angle) {
|
||||
Visualangle.Middle -> {
|
||||
CallerVisualAngleManager.changeScene(Default(forceClosePrev = true))
|
||||
}
|
||||
|
||||
Visualangle.Long -> {
|
||||
CallerVisualAngleManager.changeScene(LongSight())
|
||||
}
|
||||
|
||||
Visualangle.UnChange -> {
|
||||
viewCallback?.setUnableChange()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun changeVisualView() {
|
||||
val mapUIController = CallerMapUIServiceManager.getMapUIController()
|
||||
mapUIController?.currentMapVisualAngle?.let {
|
||||
CallerLogger.d(TAG,"切换视角:${it}")
|
||||
if (it.isLongSight) {
|
||||
mapUIController.setLockMode(true);
|
||||
mapUIController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
} else if (it.isMediumSight) {
|
||||
mapUIController.setLockMode(false);
|
||||
mapUIController.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
||||
} else {
|
||||
mapUIController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
}
|
||||
}
|
||||
enum class Visualangle {
|
||||
Middle, Long, UnChange,None
|
||||
}
|
||||
|
||||
|
||||
interface IVisualCallback {
|
||||
fun setViewShow(boolean: Boolean)
|
||||
fun setViewShow(boolean: Boolean) {}
|
||||
|
||||
fun setViewResource(resource: Int)
|
||||
fun setMiddleAngle() {}
|
||||
|
||||
fun setLongAngle() {}
|
||||
|
||||
fun setSkyboxAngle() {}
|
||||
|
||||
fun setUnableChange() {}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,12 +23,12 @@ import com.amap.api.maps.model.Polyline
|
||||
import com.amap.api.maps.model.PolylineOptions
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.shuttle.passenger.ui.mapdirectionview.MapDirectionViewModel
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
@@ -128,13 +128,13 @@ class MapDirectionView @JvmOverloads constructor(
|
||||
initAMapView()
|
||||
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 1, this)
|
||||
OchLocationManager.addGCJ02Listener(TAG, 1, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
OchLocationManager.removeGCJ02Listener(TAG)
|
||||
}
|
||||
|
||||
private fun initAMapView() {
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.mogo.och.common.module.wigets.rodedata
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.exploration.AutomaticExplorationView
|
||||
import com.mogo.och.data.taxi.BaseOrderBean
|
||||
import com.mogo.och.common.module.biz.order.OrderListener
|
||||
import com.mogo.och.common.module.biz.order.OrderModel
|
||||
import com.mogo.och.common.module.biz.order.TaxiOrderStatusEnum
|
||||
|
||||
class OchAutomaticExplorationView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : AutomaticExplorationView(context, attrs, defStyleAttr), OrderListener {
|
||||
private val TAG = "OchAutomaticExplorationView"
|
||||
init {
|
||||
OrderModel.setOrderStatusCallback(TAG,this)
|
||||
}
|
||||
|
||||
override fun onCurrentOrderStatusChanged(order: BaseOrderBean?) {
|
||||
if(order==null){
|
||||
cancelTimer()
|
||||
currentOrderStatus(false)
|
||||
Log.i(TAG,"onCurrentOrderStatusChanged order 为空")
|
||||
}else {
|
||||
when (order.orderStatus) {
|
||||
TaxiOrderStatusEnum.None.code -> {
|
||||
cancelTimer()
|
||||
currentOrderStatus(false)
|
||||
Log.i(TAG,"TaxiOrderStatusEnum.None.code")
|
||||
}
|
||||
TaxiOrderStatusEnum.OnTheWayToStart.code -> {
|
||||
startShowTimer()
|
||||
currentOrderStatus(true)
|
||||
Log.i(TAG,"TaxiOrderStatusEnum.OnTheWayToStart.code")
|
||||
}
|
||||
TaxiOrderStatusEnum.ArriveAtStart.code -> {
|
||||
startShowTimer()
|
||||
currentOrderStatus(true)
|
||||
Log.i(TAG,"TaxiOrderStatusEnum.ArriveAtStart.code")
|
||||
}
|
||||
TaxiOrderStatusEnum.UserArriveAtStart.code -> {
|
||||
startShowTimer()
|
||||
currentOrderStatus(true)
|
||||
Log.i(TAG,"TaxiOrderStatusEnum.UserArriveAtStart.code")
|
||||
}
|
||||
TaxiOrderStatusEnum.OnTheWayToEnd.code -> {
|
||||
startShowTimer()
|
||||
currentOrderStatus(true)
|
||||
Log.i(TAG,"TaxiOrderStatusEnum.OnTheWayToEnd.code")
|
||||
}
|
||||
TaxiOrderStatusEnum.ArriveAtEnd.code -> {
|
||||
startShowTimer()
|
||||
currentOrderStatus(true)
|
||||
Log.i(TAG,"TaxiOrderStatusEnum.ArriveAtEnd.code")
|
||||
}
|
||||
TaxiOrderStatusEnum.JourneyCompleted.code -> {
|
||||
cancelTimer()
|
||||
currentOrderStatus(false)
|
||||
Log.i(TAG,"TaxiOrderStatusEnum.JourneyCompleted.code")
|
||||
}
|
||||
TaxiOrderStatusEnum.Cancel.code -> {
|
||||
cancelTimer()
|
||||
currentOrderStatus(false)
|
||||
Log.i(TAG,"TaxiOrderStatusEnum.Cancel.code")
|
||||
}
|
||||
else -> {
|
||||
cancelTimer()
|
||||
currentOrderStatus(false)
|
||||
Log.i(TAG,"else")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
OCH/common/common/src/main/res/drawable-nodpi/common_close_100x100.png
Executable file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
OCH/common/common/src/main/res/drawable-nodpi/common_visual_angle.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
OCH/common/common/src/main/res/drawable-nodpi/common_visual_angle_bg.png
Executable file
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
BIN
OCH/common/common/src/main/res/drawable-nodpi/common_visual_bottom.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 800 B |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 11 KiB |
BIN
OCH/common/common/src/main/res/drawable-nodpi/commont_visual_head.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 572 B |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 573 B |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
112
OCH/common/common/src/main/res/layout/common_overmap_bottom.xml
Normal file
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_1860"
|
||||
android:layout_height="@dimen/dp_136"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_quanxiluk"
|
||||
android:layout_width="@dimen/dp_53"
|
||||
android:layout_height="@dimen/dp_53"
|
||||
android:src="@drawable/mogo_quanxi_lukou"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/aciv_quanxiluk_value"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/aciv_quanxiluk_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_19"
|
||||
android:layout_marginEnd="@dimen/dp_40"
|
||||
android:text="全息路口"
|
||||
android:textColor="#0D0D0D"
|
||||
app:layout_constraintTop_toTopOf="@+id/aciv_quanxiluk"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_quanxiluk"
|
||||
app:layout_constraintEnd_toStartOf="@+id/aciv_jingzhi"
|
||||
app:layout_constraintStart_toEndOf="@+id/aciv_quanxiluk"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_jingzhi"
|
||||
android:layout_width="@dimen/dp_53"
|
||||
android:layout_height="@dimen/dp_53"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
android:src="@drawable/mogo_jingzhi_nor"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/aciv_quanxiluk_value"
|
||||
app:layout_constraintEnd_toStartOf="@+id/aciv_jingzhi_value"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/aciv_jingzhi_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_19"
|
||||
android:text="全息路口"
|
||||
android:textColor="#0D0D0D"
|
||||
android:layout_marginEnd="@dimen/dp_40"
|
||||
app:layout_constraintTop_toTopOf="@+id/aciv_quanxiluk"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_quanxiluk"
|
||||
app:layout_constraintStart_toEndOf="@+id/aciv_jingzhi"
|
||||
app:layout_constraintEnd_toStartOf="@+id/aciv_shigong"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_shigong"
|
||||
android:layout_width="@dimen/dp_53"
|
||||
android:layout_height="@dimen/dp_53"
|
||||
android:src="@drawable/mogo_shigong_image"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/aciv_jingzhi_value"
|
||||
app:layout_constraintEnd_toStartOf="@+id/aciv_shigong_value"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/aciv_shigong_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_19"
|
||||
android:text="全息路口"
|
||||
android:textColor="#0D0D0D"
|
||||
android:layout_marginEnd="@dimen/dp_40"
|
||||
app:layout_constraintTop_toTopOf="@+id/aciv_shigong"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_shigong"
|
||||
app:layout_constraintStart_toEndOf="@+id/aciv_shigong"
|
||||
app:layout_constraintEnd_toStartOf="@+id/aciv_shigu"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_shigu"
|
||||
android:layout_width="@dimen/dp_53"
|
||||
android:layout_height="@dimen/dp_53"
|
||||
android:src="@drawable/mogo_shigu_nor"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/aciv_shigong_value"
|
||||
app:layout_constraintEnd_toStartOf="@+id/aciv_shigu_value"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/aciv_shigu_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_19"
|
||||
android:text="全息路口"
|
||||
android:textColor="#0D0D0D"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/aciv_shigu"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_shigu"
|
||||
app:layout_constraintStart_toEndOf="@+id/aciv_shigu"
|
||||
/>
|
||||
|
||||
</merge>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.och.common.module.wigets.map.overmapview.OverMapView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/repvErrorPointReason"
|
||||
android:layout_width="2286dp"
|
||||
android:layout_height="@dimen/dp_1200">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_close_map"
|
||||
android:src="@drawable/common_close_100x100"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginEnd="@dimen/dp_30"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_100"/>
|
||||
|
||||
|
||||
</com.mogo.och.common.module.wigets.map.overmapview.OverMapView>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:parentTag="RelativeLayout">
|
||||
|
||||
<com.mogo.eagle.core.function.view.TravelRealityView
|
||||
android:id="@+id/travelRealityView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:roadRangeDrawable="@drawable/taxi_overmap_road_range"
|
||||
app:roadTrajectoryDrawable="@drawable/taxi_orvermap_road_trajectory"
|
||||
app:globalPathColor="@color/common_39BA90"
|
||||
app:carDrawable="@drawable/taxt_u_p_map_car"
|
||||
app:compassDrawable="@drawable/taxt_u_p_map_car_light"
|
||||
app:endPointDrawable="@drawable/taxi_overmap_endpoint"
|
||||
app:mapStyleExtraPath="over_view_style_extra.data"
|
||||
app:mapStylePath="over_view_style.data"
|
||||
app:resetDrawable="@null"
|
||||
app:leftPadding="70"
|
||||
app:topPadding="70"
|
||||
app:rightPadding="70"
|
||||
app:bottomPadding="160" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ovbv_bottom_icons_cl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_150"
|
||||
android:background="@color/common_232A3F"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true">
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/ovbv_bottom_icons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:background="@color/common_232A3F"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_add_true"
|
||||
android:layout_marginTop="@dimen/dp_198"
|
||||
android:text="添加true"
|
||||
android:visibility="gone"
|
||||
android:background="@color/light_prompt_red"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_add_false"
|
||||
android:text="添加false"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/dp_198"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:background="@color/light_prompt_red"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</merge>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_308"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_center_location_bg"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_308"
|
||||
android:src="@drawable/common_visualangle_bg"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.switchvisual.SeekBarView
|
||||
android:id="@+id/iv_visual_angle_title_value_bg"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_169"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_visual_angle_title_head"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:src="@drawable/commont_visual_head"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_visual_angle_title_bottom"
|
||||
android:layout_width="@dimen/dp_31"
|
||||
android:layout_height="@dimen/dp_25"
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:src="@drawable/common_visual_bottom"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</merge>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="208dp"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_visualangle_bg"
|
||||
android:layout_width="39dp"
|
||||
android:layout_height="141dp"
|
||||
android:src="@drawable/taxi_p_visual_angle_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_visualangle_value"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@drawable/taxi_p_visual_angle"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</merge>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_169"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_visualangle_bg_dark"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_169"
|
||||
android:src="@drawable/common_visual_angle_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_visualangle_value_dark"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_33"
|
||||
android:src="@drawable/common_visual_angle"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</merge>
|
||||
31
OCH/common/common/src/main/res/layout/taxt_d_icon_item.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_quanxiluk"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_35"
|
||||
android:src="@drawable/mogo_quanxi_lukou"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/aciv_quanxiluk_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_17"
|
||||
android:layout_marginEnd="@dimen/dp_35"
|
||||
app:layout_constraintStart_toEndOf="@+id/aciv_quanxiluk"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:text="全息路口"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -27,4 +27,6 @@
|
||||
<color name="common_A0B3DA">#A0B3DA</color>
|
||||
|
||||
<color name="common_3B4577">#3B4577</color>
|
||||
<color name="common_232A3F">#232A3F</color>
|
||||
<color name="common_39BA90">#39BA90</color>
|
||||
</resources>
|
||||
@@ -41,7 +41,9 @@ dependencies {
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
api rootProject.ext.dependencies.mogoutils
|
||||
api rootProject.ext.dependencies.mogo_core_data
|
||||
}else {
|
||||
api project(":core:mogo-core-utils")
|
||||
api project(':core:mogo-core-data')
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.mogo.och.data.taxi;
|
||||
|
||||
public class BaseOrderBean {
|
||||
public String orderNo;// 订单号
|
||||
public int orderStatus;//订单状态
|
||||
|
||||
public String getEndSiteAddr() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BaseOrderBean{" +
|
||||
"orderNo='" + orderNo + '\'' +
|
||||
", orderStatus=" + orderStatus +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.taxi.bean;
|
||||
package com.mogo.och.data.taxi;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/7
|
||||
@@ -9,6 +9,14 @@ public class OrderQueryRouteInfoReqBean {
|
||||
public String sn;
|
||||
public String orderNo;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderQueryRouteInfoReqBean{" +
|
||||
"sn='" + sn + '\'' +
|
||||
", orderNo='" + orderNo + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public OrderQueryRouteInfoReqBean(String sn, String orderNo) {
|
||||
this.sn = sn;
|
||||
this.orderNo = orderNo;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.taxi.bean;
|
||||
package com.mogo.och.data.taxi;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
@@ -18,5 +18,15 @@ public class OrderQueryRouteInfoRespBean extends BaseData {
|
||||
// 起点至终点
|
||||
public long durationToEnd; //订单上车点到目的地的时长,单位:秒
|
||||
public long distanceToEnd; //订单上车点到目的地的距离,单位:米
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Result{" +
|
||||
"durationToStart=" + durationToStart +
|
||||
", distanceToStart=" + distanceToStart +
|
||||
", durationToEnd=" + durationToEnd +
|
||||
", distanceToEnd=" + distanceToEnd +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.mogo.och.data.taxi
|
||||
|
||||
data class QueryCarOrderByNoReqBean(
|
||||
var sn: String, var orderNo: String
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.mogo.och.data.taxi
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
|
||||
data class QueryCarOrderByNoRespBean(var data: Result) : BaseData() {
|
||||
data class Result(
|
||||
var sn: String,
|
||||
var bookingUserPhone: String,
|
||||
var businessType: String,
|
||||
var mileage: Float,
|
||||
var duration: Float,
|
||||
var passengerSize: Int
|
||||
):BaseOrderBean()
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.facade.route
|
||||
|
||||
import android.content.Context
|
||||
import android.media.AudioManager
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@@ -18,7 +19,9 @@ import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.eagle.core.utilcode.util.VolumeUtils
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.login.BusinessEnum
|
||||
import com.mogo.och.common.module.biz.login.ILoginCallback
|
||||
@@ -76,6 +79,15 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
|
||||
}
|
||||
|
||||
private fun getFragment(): Fragment {
|
||||
if(DeviceUtils.isEB5Model()&&AppIdentityModeUtils.isCharterPassenger(FunctionBuildConfig.appIdentityMode)){
|
||||
val maxVolume = VolumeUtils.getMaxVolume(AudioManager.STREAM_MUSIC)
|
||||
val volume = VolumeUtils.getVolume(AudioManager.STREAM_MUSIC)
|
||||
val tartgetVolume = (maxVolume * 0.8).toInt()
|
||||
OchChainLogManager.writeChainLog("音量","最大声音量:${maxVolume}------当前音量:${volume}----目的音量:${tartgetVolume}")
|
||||
if(volume<tartgetVolume){
|
||||
VolumeUtils.setVolume( AudioManager.STREAM_MUSIC, tartgetVolume, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE)
|
||||
}
|
||||
}
|
||||
if (AppIdentityModeUtils.isBusDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
return getFragmentByServeName(OchCommonConst.BUS_DRIVER)
|
||||
} else if (AppIdentityModeUtils.isShuttleDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager;
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager;
|
||||
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager;
|
||||
@@ -48,7 +49,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
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.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
@@ -135,7 +135,7 @@ public class OrderModel {
|
||||
public void init() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,5,mMapLocationListener);
|
||||
OchLocationManager.addGCJ02Listener(TAG,5,mMapLocationListener);
|
||||
|
||||
//开启自驾后 异常信息返回
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener);
|
||||
@@ -264,7 +264,7 @@ public class OrderModel {
|
||||
public void release() {
|
||||
|
||||
// 注销定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
OchLocationManager.removeGCJ02Listener(TAG);
|
||||
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null);
|
||||
|
||||
@@ -704,8 +704,7 @@ public class OrderModel {
|
||||
* 到站后重置站点状态
|
||||
*/
|
||||
private void arriveSiteStation(String changeInfo) {
|
||||
OchChainLogManager.writeChainLog("触发进站", changeInfo,
|
||||
true,OchChainLogManager.EVENT_KEY_INFE_WITH_BUS);
|
||||
OchChainLogManager.writeChainLog("触发进站", changeInfo);
|
||||
if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) { //到站短时间内调用多次
|
||||
CallerLogger.e( M_BUS + TAG, "数组越界" );
|
||||
return;
|
||||
@@ -856,8 +855,7 @@ public class OrderModel {
|
||||
|
||||
String changeInfo = "taskId:" + busRoutesResult.getTaskId() + "--lineId:" + busRoutesResult.getLineId() +
|
||||
"--currentStationName:"+currentStationName+"--finalNextStationName:"+finalNextStationName;
|
||||
OchChainLogManager.writeChainLog("滑动出发", changeInfo,
|
||||
true,OchChainLogManager.EVENT_KEY_INFE_WITH_BUS);
|
||||
OchChainLogManager.writeChainLog("滑动出发", changeInfo);
|
||||
OrderServiceManager.leaveStation(mContext,
|
||||
stationList.get(backgroundCurrentStationIndex).getSeq(),
|
||||
stationList.get(backgroundCurrentStationIndex).getSiteId(),
|
||||
@@ -865,8 +863,7 @@ public class OrderModel {
|
||||
new OchCommonServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
OchChainLogManager.writeChainLog("滑动出发成功", changeInfo,
|
||||
true,OchChainLogManager.EVENT_KEY_INFE_WITH_BUS);
|
||||
OchChainLogManager.writeChainLog("滑动出发成功", changeInfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -1192,8 +1189,7 @@ public class OrderModel {
|
||||
|
||||
// 登出
|
||||
public void logout() {
|
||||
MogoLocation gcj02 = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02();
|
||||
LoginStatusManager.loginOut(gcj02.getLatitude(), gcj02.getLongitude());
|
||||
LoginStatusManager.loginOut();
|
||||
}
|
||||
|
||||
public void triggerStartServiceEvent(boolean isRestart, boolean send) {
|
||||
|
||||
@@ -13,9 +13,6 @@ import java.util.ArrayList
|
||||
object ShuttleVoiceManager {
|
||||
|
||||
fun arrivedStationBus(siteNameCN: String?, siteNameKR: String?) {
|
||||
if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
return
|
||||
}
|
||||
val context = AbsMogoApplication.getApp()
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
siteNameCN?.let {
|
||||
@@ -25,7 +22,7 @@ object ShuttleVoiceManager {
|
||||
)
|
||||
val engTTS = LangTtsEntity(
|
||||
context.getString(R.string.bus_arrived_station_english_tip, it),
|
||||
LanguageType.CHINESE
|
||||
LanguageType.ENGLISH
|
||||
)
|
||||
val koreanTTS = LangTtsEntity(
|
||||
context.getString(R.string.bus_arrived_station_korean_tip, siteNameKR?:it),
|
||||
@@ -49,7 +46,7 @@ object ShuttleVoiceManager {
|
||||
)
|
||||
val engTTS = LangTtsEntity(
|
||||
context.getString(R.string.bus_leave_station_english_tip, it),
|
||||
LanguageType.CHINESE
|
||||
LanguageType.ENGLISH
|
||||
)
|
||||
list.add(chineseTTS)
|
||||
list.add(engTTS)
|
||||
|
||||
@@ -104,6 +104,16 @@
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.greenwave.GreenWaveView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_71"
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewLimitingVelocity"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="@dimen/dp_236"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"/>
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
android:id="@+id/viewDriverMsgBoxButton"
|
||||
@@ -198,6 +208,14 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
|
||||
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.switchvisual.VisualViewDirver
|
||||
app:layout_constraintStart_toEndOf="@+id/module_mogo_och_station_panel_container"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_station_panel_container"
|
||||
android:layout_marginBottom="@dimen/dp_28"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<include
|
||||
android:id="@+id/module_mogo_och_bus_test_bar"
|
||||
layout="@layout/shuttle_test_bar_view"
|
||||
@@ -241,23 +259,12 @@
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
<!--切换地图远近事件 @dimen/module_switch_map -->
|
||||
<com.mogo.och.common.module.wigets.map.switchvisual.VisualView
|
||||
android:id="@+id/switch_visual_view"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/toolsView"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.reportworkorder.ReportWorkOrderView
|
||||
android:id="@+id/reportworkorderview"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/switch_visual_view"
|
||||
app:layout_constraintLeft_toRightOf="@id/toolsView"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ object PassengerServiceManager {
|
||||
driverAppSn
|
||||
)
|
||||
).transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverSiteByCoordinate"))
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverSiteByCoordinate",false))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,8 @@ import com.mogo.eagle.core.utilcode.util.StringUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager;
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager;
|
||||
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager;
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
@@ -39,12 +41,10 @@ import com.mogo.och.common.module.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.manager.distance.IDistanceListener;
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager;
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.och.shuttle.passenger.bean.response.PassengerOperationStatusResponse;
|
||||
@@ -182,6 +182,8 @@ public class BusPassengerModel {
|
||||
return;
|
||||
}
|
||||
|
||||
OchChainLogManager.writeChainLog("线路发生变化",data.toString());
|
||||
|
||||
if (routesResult != null &&
|
||||
routesResult.getWriteVersion() < data.getResult().getWriteVersion()){
|
||||
routesResult = data.getResult();
|
||||
@@ -308,7 +310,7 @@ public class BusPassengerModel {
|
||||
OchAutoPilotStatusListenerManager.INSTANCE.addListener(TAG,mGoAutopilotStatusListener);
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 3,mMapLocationListener);
|
||||
OchLocationManager.addGCJ02Listener(TAG, 3,mMapLocationListener);
|
||||
|
||||
|
||||
//监听司机端消息
|
||||
@@ -321,7 +323,7 @@ public class BusPassengerModel {
|
||||
private void releaseListeners() {
|
||||
|
||||
// 注销定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
OchLocationManager.removeGCJ02Listener(TAG);
|
||||
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.unregisterLifecycleListener(10010);
|
||||
|
||||
@@ -18,7 +18,6 @@ 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.telematic.IReceivedMsgListener
|
||||
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.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
@@ -32,6 +31,7 @@ import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager.p
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.distance.IDistanceListener
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
|
||||
@@ -44,6 +44,7 @@ import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.TaskDetailsMsg
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.voice.VoiceNotice
|
||||
import com.mogo.och.common.module.voice.VoiceNotice.showNotice
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
@@ -113,7 +114,7 @@ class PM2DrivingModel private constructor() {
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
|
||||
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, mMapLocationListener)
|
||||
OchLocationManager.addGCJ02Listener(TAG, 3, mMapLocationListener)
|
||||
|
||||
//司乘屏通信监听
|
||||
CallerTelematicListenerManager.addListener(TAG, mReceivedMsgListener)
|
||||
@@ -131,7 +132,7 @@ class PM2DrivingModel private constructor() {
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
OchLocationManager.removeGCJ02Listener(TAG)
|
||||
|
||||
CallerTelematicListenerManager.removeListener(TAG)
|
||||
|
||||
@@ -246,7 +247,7 @@ class PM2DrivingModel private constructor() {
|
||||
.build()
|
||||
mAudioManager.requestAudioFocus(mAudioFocusRequest) //抢占焦点
|
||||
|
||||
AIAssist.getInstance(mContext).speakTTSVoiceWithLevel(msg,AIAssist.LEVEL0,object : IMogoVoiceCmdCallBack{
|
||||
VoiceNotice.speakTTSVoiceWithLevel(msg,AIAssist.LEVEL0,object : IMogoVoiceCmdCallBack{
|
||||
override fun onSpeakEnd(speakText: String?) {
|
||||
mAudioManager.abandonAudioFocusRequest(mAudioFocusRequest)
|
||||
}
|
||||
|
||||
@@ -22,13 +22,13 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCleanSystemL
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCloudTaskListener;
|
||||
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.autopilot.CallerSweeperFutianCleanSystemListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerSweeperFutianCloudTaskListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
import com.mogo.och.sweeper.cloud.callback.ISweeperCloudTaskCallback;
|
||||
@@ -131,7 +131,7 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
public void init() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener);
|
||||
OchLocationManager.addGCJ02Listener(TAG,10, mMapLocationListener);
|
||||
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
@@ -275,7 +275,7 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
public void release() {
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
// 注销定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
OchLocationManager.removeGCJ02Listener(TAG);
|
||||
//自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null);
|
||||
|
||||
@@ -14,11 +14,11 @@ import com.amap.api.maps.CameraUpdateFactory
|
||||
import com.amap.api.maps.model.*
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
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.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.sweeper.R
|
||||
import com.mogo.och.sweeper.common.bean.SweeperRoutePlanningUpdateReqBean
|
||||
import com.mogo.och.sweeper.common.constant.SweeperConst
|
||||
@@ -55,8 +55,7 @@ class WeltMapOverView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
|
||||
LayoutInflater.from(context).inflate(R.layout.sweeper_welt_map_overview, this)
|
||||
initAMapView()
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,5)
|
||||
OchLocationManager.addGCJ02Listener(TAG, 5,this)
|
||||
}
|
||||
|
||||
private fun initAMapView() {
|
||||
|
||||
@@ -14,11 +14,11 @@ import com.amap.api.maps.CameraUpdateFactory
|
||||
import com.amap.api.maps.model.*
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.sweeper.common.database.bean.WeltDataBean
|
||||
import com.mogo.och.sweeper.R
|
||||
import kotlinx.android.synthetic.main.sweeper_welt_small_map_view.view.*
|
||||
@@ -51,8 +51,7 @@ class WeltSmallMapView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
|
||||
LayoutInflater.from(context).inflate(R.layout.sweeper_welt_small_map_view, this)
|
||||
initAMapView()
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,5)
|
||||
OchLocationManager.addGCJ02Listener(TAG, 5,this)
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
|
||||
@@ -28,13 +28,13 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
|
||||
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.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.data.OCHOperationalMessage;
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback;
|
||||
@@ -130,7 +130,7 @@ public class SweeperOperateTaskModel {
|
||||
public void init() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener);
|
||||
OchLocationManager.addGCJ02Listener(TAG, 10,mMapLocationListener);
|
||||
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
@@ -255,7 +255,7 @@ public class SweeperOperateTaskModel {
|
||||
public void release() {
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
// 注销定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
OchLocationManager.removeGCJ02Listener(TAG);
|
||||
//自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.taxi.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.data.taxi.BaseOrderBean;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -13,13 +14,11 @@ import java.util.Objects;
|
||||
public class OrderQueryRespBean extends BaseData {
|
||||
public Result data;
|
||||
|
||||
public static class Result implements Comparable<Result>{
|
||||
// 订单no
|
||||
public String orderNo;
|
||||
public static class Result extends BaseOrderBean implements Comparable<Result>{
|
||||
|
||||
// 订单类型
|
||||
public int orderType; //1即时单 2预约单
|
||||
// 订单状态
|
||||
public int orderStatus;
|
||||
|
||||
// 订单运营类型 (9出租车,10小巴)
|
||||
public int businessType;
|
||||
// 起始站点id
|
||||
@@ -68,6 +67,11 @@ public class OrderQueryRespBean extends BaseData {
|
||||
// !!!接口中暂无此字段,仅用于本地实现逻辑使用:起始站目的站距离km
|
||||
public double travelDistance;
|
||||
|
||||
@Override
|
||||
public String getEndSiteAddr() {
|
||||
return endSiteAddr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param distance
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.och.taxi.callback;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.data.taxi.OrderQueryRouteInfoRespBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -29,12 +29,10 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
|
||||
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.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.commons.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils;
|
||||
@@ -44,6 +42,7 @@ import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.data.OCHOperationalMessage;
|
||||
@@ -66,7 +65,7 @@ import com.mogo.och.taxi.bean.DriverServiceDataRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderGrabRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderGrabStatusQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.data.taxi.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderRouteUpdateReqBean;
|
||||
import com.mogo.och.taxi.bean.OrdersInServiceQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrdersListQueryRespBean;
|
||||
@@ -80,7 +79,7 @@ import com.mogo.och.taxi.callback.ITaxiCarOperationalCallback;
|
||||
import com.mogo.och.taxi.callback.ITaxiControllerStatusCallback;
|
||||
import com.mogo.och.taxi.callback.ITaxiOrderStatusCallback;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.common.module.biz.order.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderTypeEnum;
|
||||
import com.mogo.och.taxi.network.TaxiServiceManager;
|
||||
import com.mogo.och.taxi.utils.OrderUtil;
|
||||
@@ -135,8 +134,6 @@ public class TaxiModel {
|
||||
private final List<MogoLocation> mRoutePoints = new ArrayList<>();
|
||||
private final int mPreRouteIndex = 0;
|
||||
|
||||
private double mLongitude, mLatitude;
|
||||
private MogoLocation mLocation = null;
|
||||
|
||||
private TaxiModel() {
|
||||
}
|
||||
@@ -218,7 +215,7 @@ public class TaxiModel {
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener);
|
||||
|
||||
//定位监听, 传false是高德坐标系
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,5, mMapLocationListener);
|
||||
OchLocationManager.addGCJ02Listener(TAG,5, mMapLocationListener);
|
||||
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
|
||||
@@ -259,7 +256,7 @@ public class TaxiModel {
|
||||
private void releaseListeners() {
|
||||
|
||||
// 注销地图监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
OchLocationManager.removeGCJ02Listener(TAG);
|
||||
|
||||
OCHSocketMessageManager.INSTANCE.releaseSocketMessageListener(OCHSocketMessageManager.msgMonitorType);
|
||||
|
||||
@@ -698,7 +695,9 @@ public class TaxiModel {
|
||||
|
||||
// 车机端上传心跳数据(只在出车状态时上传)
|
||||
public void runCarHeartbeat() {
|
||||
TaxiServiceManager.runCarHeartbeat(mContext, mLongitude, mLatitude,
|
||||
MogoLocation gcj02Location = OchLocationManager.getGCJ02Location();
|
||||
TaxiServiceManager.runCarHeartbeat(mContext,
|
||||
gcj02Location.getLongitude(), gcj02Location.getLatitude(),
|
||||
new OchCommonServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData data) {
|
||||
@@ -749,8 +748,6 @@ public class TaxiModel {
|
||||
public void confirmAutopilotConditionByDriver() {
|
||||
if (mCurrentOCHOrder == null) return;
|
||||
TaxiOrPassengerReadyReqBean.Result result = new TaxiOrPassengerReadyReqBean.Result();
|
||||
// result.lat = mLatitude;
|
||||
// result.lon = mLongitude;
|
||||
TaxiServiceManager.confirmAutopilotConditionByDriver(mContext,
|
||||
mCurrentOCHOrder.orderNo,
|
||||
result,
|
||||
@@ -1117,10 +1114,6 @@ public class TaxiModel {
|
||||
judgeEndStation(gnssInfo);
|
||||
}
|
||||
}
|
||||
|
||||
mLongitude = gnssInfo.getLongitude();
|
||||
mLatitude = gnssInfo.getLatitude();
|
||||
mLocation = gnssInfo;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1489,31 +1482,6 @@ public class TaxiModel {
|
||||
reportOrderRemain((long) lastSumLength, (long) lastTime);
|
||||
}
|
||||
|
||||
private void routeAndWipe() {
|
||||
if (mRoutePoints != null && mRoutePoints.size() > 0 && mLocation != null) {
|
||||
int haveArrivedIndex = CoordinateCalculateRouteUtil
|
||||
.getArrivedPointIndexNew(mPreRouteIndex,
|
||||
mRoutePoints,
|
||||
mLocation.getLongitude(),
|
||||
mLocation.getLatitude());
|
||||
List<LatLng> routePoints = CoordinateCalculateRouteUtil
|
||||
.coordinateConverterLocationToLatLng(mContext, mRoutePoints);
|
||||
List<LatLng> routeArrivied = new ArrayList<>();
|
||||
List<LatLng> routeArriving = new ArrayList<>();
|
||||
for (int i = 0; i < routePoints.size(); i++){
|
||||
if (i <= haveArrivedIndex){
|
||||
routeArrivied.add(routePoints.get(i));
|
||||
}else {
|
||||
routeArriving.add(routePoints.get(i));
|
||||
}
|
||||
}
|
||||
if (mAutopilotPlanningCallback != null) {
|
||||
mAutopilotPlanningCallback.routeResult(routeArrivied,routeArriving, mLocation);
|
||||
}
|
||||
setRouteLineMarker();
|
||||
}
|
||||
}
|
||||
|
||||
private final IDistanceListener distanceListener = new IDistanceListener() {
|
||||
@Override
|
||||
public void distanceCallback(float distance) {
|
||||
@@ -1621,8 +1589,9 @@ public class TaxiModel {
|
||||
return;
|
||||
}
|
||||
TaxiOrPassengerReadyReqBean.Result result = new TaxiOrPassengerReadyReqBean.Result();
|
||||
result.lat = mLatitude;
|
||||
result.lon = mLongitude;
|
||||
MogoLocation gcj02Location = OchLocationManager.getGCJ02Location();
|
||||
result.lat = gcj02Location.getLatitude();
|
||||
result.lon = gcj02Location.getLongitude();
|
||||
TaxiServiceManager.updatePassengerHasBoardedStatus(mContext
|
||||
, mCurrentOCHOrder.orderNo
|
||||
, result
|
||||
@@ -1643,8 +1612,9 @@ public class TaxiModel {
|
||||
if (mCurrentOCHOrder == null) return;
|
||||
|
||||
TaxiOrPassengerReadyReqBean.Result result = new TaxiOrPassengerReadyReqBean.Result();
|
||||
result.lat = mLatitude;
|
||||
result.lon = mLongitude;
|
||||
MogoLocation gcj02Location = OchLocationManager.getGCJ02Location();
|
||||
result.lat = gcj02Location.getLatitude();
|
||||
result.lon = gcj02Location.getLongitude();
|
||||
TaxiServiceManager.startServicePilotDone(mContext
|
||||
, mCurrentOCHOrder.orderNo
|
||||
, result
|
||||
@@ -1663,8 +1633,9 @@ public class TaxiModel {
|
||||
public void arrivedStartPoint() {
|
||||
if (mCurrentOCHOrder == null) return;
|
||||
TaxiOrPassengerReadyReqBean.Result result = new TaxiOrPassengerReadyReqBean.Result();
|
||||
result.lat = mLatitude;
|
||||
result.lon = mLongitude;
|
||||
MogoLocation gcj02Location = OchLocationManager.getGCJ02Location();
|
||||
result.lat = gcj02Location.getLatitude();
|
||||
result.lon = gcj02Location.getLongitude();
|
||||
TaxiServiceManager.arrivedStartPoint(mContext
|
||||
, mCurrentOCHOrder.orderNo
|
||||
, result
|
||||
@@ -1684,8 +1655,9 @@ public class TaxiModel {
|
||||
public void arriveTerminal() {
|
||||
if (mCurrentOCHOrder == null) return;
|
||||
TaxiOrPassengerReadyReqBean.Result result = new TaxiOrPassengerReadyReqBean.Result();
|
||||
result.lat = mLatitude;
|
||||
result.lon = mLongitude;
|
||||
MogoLocation gcj02Location = OchLocationManager.getGCJ02Location();
|
||||
result.lat = gcj02Location.getLatitude();
|
||||
result.lon = gcj02Location.getLongitude();
|
||||
TaxiServiceManager.arriveTerminal(mContext
|
||||
, mCurrentOCHOrder.orderNo
|
||||
, result
|
||||
@@ -1705,8 +1677,9 @@ public class TaxiModel {
|
||||
public void orderCompleted() {
|
||||
if (mCurrentOCHOrder == null) return;
|
||||
TaxiOrPassengerReadyReqBean.Result result = new TaxiOrPassengerReadyReqBean.Result();
|
||||
result.lat = mLatitude;
|
||||
result.lon = mLongitude;
|
||||
MogoLocation gcj02Location = OchLocationManager.getGCJ02Location();
|
||||
result.lat = gcj02Location.getLatitude();
|
||||
result.lon = gcj02Location.getLongitude();
|
||||
TaxiServiceManager.orderCompleted(mContext
|
||||
, mCurrentOCHOrder.orderNo
|
||||
, result
|
||||
@@ -1724,7 +1697,7 @@ public class TaxiModel {
|
||||
|
||||
// 登出
|
||||
public void logout() {
|
||||
LoginStatusManager.loginOut(mLatitude, mLongitude);
|
||||
LoginStatusManager.loginOut();
|
||||
}
|
||||
|
||||
//导航去订单终点目的地
|
||||
|
||||
@@ -9,8 +9,8 @@ import com.mogo.och.taxi.bean.OrderGrabRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderGrabStatusQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryReqBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRouteInfoReqBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.data.taxi.OrderQueryRouteInfoReqBean;
|
||||
import com.mogo.och.data.taxi.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderRouteUpdateReqBean;
|
||||
import com.mogo.och.taxi.bean.OrderStatusUpdateReqBean;
|
||||
import com.mogo.och.taxi.bean.OrdersInServiceQueryRespBean;
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.network.OchCommonSubscribeImpl
|
||||
import com.mogo.och.common.module.network.interceptor.transformTry
|
||||
import com.mogo.och.data.taxi.OrderQueryRouteInfoReqBean
|
||||
import com.mogo.och.data.taxi.OrderQueryRouteInfoRespBean
|
||||
import com.mogo.och.taxi.bean.*
|
||||
import io.reactivex.Observable
|
||||
|
||||
@@ -39,7 +41,7 @@ object TaxiServiceManager {
|
||||
SharedPrefsMgr.getInstance().sn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryOrdersInAndWaitService"))
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryOrdersInAndWaitService",false))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,7 +104,7 @@ object TaxiServiceManager {
|
||||
)
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryOrderGrabStatus"))
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryOrderGrabStatus",false))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -292,7 +294,7 @@ object TaxiServiceManager {
|
||||
)
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "runCarHeartbeat"))
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "runCarHeartbeat",false))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -43,6 +43,7 @@ public class NaviPresenter extends Presenter<TaxiRottingNaviFragment> implements
|
||||
|
||||
@Override
|
||||
public void onDestroy( @NonNull LifecycleOwner owner ) {
|
||||
releaseListeners();
|
||||
super.onDestroy( owner );
|
||||
}
|
||||
|
||||
@@ -54,24 +55,22 @@ public class NaviPresenter extends Presenter<TaxiRottingNaviFragment> implements
|
||||
TaxiModel.getInstance().setMoGoAutopilotPlanningListener(null);
|
||||
}
|
||||
|
||||
private void runOnUIThread( Runnable executor ) {
|
||||
if ( executor == null ) {
|
||||
return;
|
||||
}
|
||||
if ( Looper.myLooper() != Looper.getMainLooper() ) {
|
||||
UiThreadHandler.post( executor );
|
||||
} else {
|
||||
executor.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineMarker(LatLng startStation, LatLng endStation) {
|
||||
runOnUIThread(() -> mView.setLineMarker(startStation,endStation));
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(mView!=null) {
|
||||
mView.setLineMarker(startStation, endStation);
|
||||
}
|
||||
}
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void routeResult(List<LatLng> routeArrivied, List<LatLng> routeArriving, MogoLocation location) {
|
||||
mView.routeResult(routeArrivied,routeArriving,location);
|
||||
if(mView!=null) {
|
||||
mView.routeResult(routeArrivied, routeArriving, location);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,16 +20,18 @@ import com.mogo.och.common.module.biz.login.ILoginCallback;
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusEnum;
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager;
|
||||
import com.mogo.och.common.module.biz.login.OpenOrderStatusEnum;
|
||||
import com.mogo.och.common.module.biz.order.OrderModel;
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.data.taxi.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.taxi.callback.ITaxiADASStatusCallback;
|
||||
import com.mogo.och.taxi.callback.ITaxiControllerStatusCallback;
|
||||
import com.mogo.och.taxi.callback.ITaxiOrderStatusCallback;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.common.module.biz.order.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.model.TaxiModel;
|
||||
import com.mogo.och.taxi.ui.TaxiFragment;
|
||||
|
||||
@@ -284,11 +286,21 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
@RequiresApi(api = Build.VERSION_CODES.P)
|
||||
@Override
|
||||
public void onCurrentOrderStatusChanged(OrderQueryRespBean.Result order) {
|
||||
OchChainLogManager.writeChainLog("订单信息变化",order.toString());
|
||||
OrderModel.INSTANCE.invokeListener(order);
|
||||
CallerLogger.d(M_TAXI + TAG, "order = " + order.toString());
|
||||
LineManager.setLineId(order.lineId);
|
||||
if (TaxiOrderStatusEnum.UserArriveAtStart.getCode() == order.orderStatus) {
|
||||
TaxiModel.getInstance().queryAutopilotStatus(true);
|
||||
TaxiModel.getInstance().setStation();
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(mView!=null) {
|
||||
mView.setGuidShow();
|
||||
}
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
if (TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus) {
|
||||
@@ -300,6 +312,7 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
if(mView!=null) {
|
||||
mView.updateCtvAutopilotStatusTag(true);
|
||||
CallerOrderListenerManager.INSTANCE.invokeOrderStatus(true);
|
||||
mView.setGuidHide();
|
||||
}
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
@@ -372,6 +385,10 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
@Override
|
||||
public void run() {
|
||||
if(mView!=null) {
|
||||
OchChainLogManager.writeChainLog(
|
||||
"到达目的地计算距离和时间",
|
||||
"距离:"+routeInfo.distanceToEnd+" 时间:"+routeInfo.durationToEnd
|
||||
);
|
||||
mView.onCurrentOrderRouteInfoGot(routeInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
@@ -15,6 +16,8 @@ import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
@@ -31,14 +34,20 @@ import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
import com.mogo.eagle.core.function.view.MapBizView;
|
||||
import com.mogo.eagle.core.function.smp.view.SmallMapView;
|
||||
import com.mogo.eagle.core.function.view.MapRoamView;
|
||||
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.listener.IMogoMapListener;
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils;
|
||||
import com.mogo.och.common.module.wigets.map.orderstatus.OrderStatusView;
|
||||
import com.mogo.och.common.module.wigets.map.overmapview.OverMapDialog;
|
||||
import com.mogo.och.common.module.wigets.map.switchvisual.VisualViewDirver;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager;
|
||||
import com.mogo.och.taxi.R;
|
||||
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils;
|
||||
|
||||
|
||||
/**
|
||||
* 网约车基础Fragment,主要负责布局通用界面,处理站点面板和通话面板互斥情况
|
||||
@@ -56,6 +65,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
protected FrameLayout flStationPanelContainer;
|
||||
private FrameLayout flNaviPanelContainer;
|
||||
private MapBizView mapBizView;
|
||||
private MapRoamView mapRoamView;
|
||||
private Group groupTestPanel;
|
||||
private FrameLayout mSpeedView;
|
||||
private ImageView mAutopilotImage;
|
||||
@@ -65,11 +75,15 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
protected DriverMsgBoxButtonView driverMsgBoxButtonView;
|
||||
protected DriverMsgBoxListView viewDriverMsgBoxList;
|
||||
protected DriverMsgBoxBubbleView viewDriverMsgBoxBubble;
|
||||
protected VisualViewDirver visualViewDirver;
|
||||
|
||||
protected TaxiAmapNaviFragment ochAmapNaviFragment = null;
|
||||
protected TaxiRottingNaviFragment taxiRottingNaviFragment = null;
|
||||
|
||||
protected SmallMapView smallMapView;
|
||||
protected AppCompatImageView acivShowGuid;
|
||||
|
||||
private OverMapDialog overMapDialog;
|
||||
|
||||
private final Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
|
||||
@@ -81,6 +95,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mapBizView = findViewById(R.id.mapBizView);
|
||||
mapRoamView = findViewById(R.id.mapRoamView);
|
||||
groupTestPanel = findViewById(R.id.groupTestPanel);
|
||||
ctvAutopilotStatusRL = findViewById(R.id.module_mogo_och_autopilot_status);
|
||||
ctvAutopilotStatusRL.setBackground(getResources().getDrawable(R.drawable.taxi_autopilot_bg_selector));
|
||||
@@ -91,6 +106,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
driverMsgBoxButtonView = findViewById(R.id.viewDriverMsgBoxButton);
|
||||
viewDriverMsgBoxList = findViewById(R.id.viewDriverMsgBoxList);
|
||||
viewDriverMsgBoxBubble = findViewById(R.id.viewDriverMsgBoxBubble);
|
||||
visualViewDirver = findViewById(R.id.vvd_change_angle);
|
||||
|
||||
mSpeedView = findViewById(R.id.taxi_speed_contain);
|
||||
if (mSpeedView != null) {
|
||||
@@ -128,6 +144,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
}
|
||||
return false;
|
||||
});
|
||||
CallerHmiViewControlListenerManager.INSTANCE.invokeMainPageViewVisible(View.VISIBLE);
|
||||
|
||||
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
|
||||
|
||||
@@ -177,13 +194,24 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
});
|
||||
|
||||
smallMapView = findViewById(R.id.smallMapView);
|
||||
|
||||
acivShowGuid = findViewById(R.id.aciv_show_guid);
|
||||
smallMapView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(overMapDialog==null){
|
||||
overMapDialog = new OverMapDialog(getContext());
|
||||
}
|
||||
acivShowGuid.setVisibility(View.GONE);
|
||||
overMapDialog.showDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState) {
|
||||
super.initViews(savedInstanceState);
|
||||
mapBizView.onCreate(savedInstanceState);
|
||||
mapRoamView.onCreate(savedInstanceState);
|
||||
smallMapView.onCreateView(savedInstanceState);
|
||||
}
|
||||
|
||||
@@ -209,21 +237,47 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
mapBizView.onLowMemory();
|
||||
mapRoamView.onLowMemory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
mapBizView.onSaveInstanceState(outState);
|
||||
mapRoamView.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
mapBizView.onDestroy();
|
||||
mapRoamView.onDestroy();
|
||||
if(smallMapView != null){
|
||||
smallMapView.onDestroy();
|
||||
}
|
||||
if(overMapDialog!=null) {
|
||||
overMapDialog.hideDialog();
|
||||
overMapDialog.destory();
|
||||
overMapDialog = null;
|
||||
}
|
||||
super.onDestroyView();
|
||||
ctvAutopilotStatusRL = null;
|
||||
tvOperationStatus = null;
|
||||
mDriverRole = null;
|
||||
flStationPanelContainer = null;
|
||||
flNaviPanelContainer = null;
|
||||
mapBizView = null;
|
||||
mapRoamView = null;
|
||||
groupTestPanel = null;
|
||||
mSpeedView = null;
|
||||
mAutopilotImage = null;
|
||||
mAutopilotTv = null;
|
||||
mCloseNaviIcon = null;
|
||||
driverMsgBoxButtonView = null;
|
||||
viewDriverMsgBoxList = null;
|
||||
viewDriverMsgBoxBubble = null;
|
||||
ochAmapNaviFragment = null;
|
||||
taxiRottingNaviFragment = null;
|
||||
smallMapView = null;
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
@@ -384,7 +438,16 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
flStationPanelContainer.setVisibility(View.GONE);
|
||||
if(flStationPanelContainer!=null) {
|
||||
flStationPanelContainer.setVisibility(View.GONE);
|
||||
ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) visualViewDirver.getLayoutParams();
|
||||
layoutParams.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
|
||||
layoutParams.bottomToTop = R.id.toolsView;
|
||||
if (getContext() != null) {
|
||||
layoutParams.setMarginStart(AutoSizeUtils.dp2px(getContext(), 29));
|
||||
}
|
||||
visualViewDirver.setLayoutParams(layoutParams);
|
||||
}
|
||||
}
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
@@ -393,7 +456,16 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
flStationPanelContainer.setVisibility(View.VISIBLE);
|
||||
if(flStationPanelContainer!=null) {
|
||||
flStationPanelContainer.setVisibility(View.VISIBLE);
|
||||
ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) visualViewDirver.getLayoutParams();
|
||||
layoutParams.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
|
||||
layoutParams.bottomToTop = R.id.toolsView;
|
||||
if (getContext() != null) {
|
||||
layoutParams.setMarginStart(AutoSizeUtils.dp2px(getContext(), 618));
|
||||
}
|
||||
visualViewDirver.setLayoutParams(layoutParams);
|
||||
}
|
||||
}
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
@@ -491,4 +563,11 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
|
||||
|
||||
public abstract void startNaviToEndStation(boolean isShow);
|
||||
|
||||
public void setGuidShow() {
|
||||
acivShowGuid.setVisibility(View.VISIBLE);
|
||||
}
|
||||
public void setGuidHide(){
|
||||
acivShowGuid.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,11 @@ import androidx.annotation.RequiresApi;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.amap.api.navi.model.NaviLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.ItinerarySummaryDialog;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
@@ -29,6 +30,7 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.point.Point;
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager;
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel;
|
||||
import com.mogo.och.common.module.map.ICommonNaviChangedCallback;
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
@@ -39,9 +41,9 @@ import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
import com.mogo.och.common.module.wigets.OCHCommitDialog;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.common.module.biz.order.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.data.taxi.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.taxi.model.TaxiModel;
|
||||
|
||||
import java.util.Calendar;
|
||||
@@ -97,6 +99,9 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
|
||||
private volatile int saveOrderState = -1;
|
||||
|
||||
private ItinerarySummaryDialog dialog;
|
||||
|
||||
|
||||
public static TaxiBeingServerdOrdersFragment newInstance(Activity activity, TaxiFragment taxiFragment) {
|
||||
Bundle args = new Bundle();
|
||||
|
||||
@@ -340,8 +345,9 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
|
||||
private void startNaviToStation(boolean isVoicePlay, double stationLat, double stationLng) {
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi();
|
||||
double mCurLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude();
|
||||
double mCurLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude();
|
||||
MogoLocation gcj02Location = OchLocationManager.getGCJ02Location();
|
||||
double mCurLatitude = gcj02Location.getLatitude();
|
||||
double mCurLongitude =gcj02Location.getLongitude();
|
||||
|
||||
CallerLogger.d(M_TAXI + TAG, "currentLatLng=" + mCurLatitude + " " +mCurLongitude);
|
||||
|
||||
@@ -422,6 +428,7 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
|
||||
dis = NumberFormatUtil.formatLong( (double) distance/ 1000);
|
||||
}
|
||||
dialog.setOrderMileage(distance);
|
||||
|
||||
String strHtml2 = "<font color=\"#CAD6FF\">全程 </font>" + "<b><font color=\"#FFFFFF\">" + dis + "</font></b>" + "<font color=\"#CAD6FF\"> 公里</font>"
|
||||
+ "<font color=\"#CAD6FF\">,总用时 </font>" + "<b><font color=\"#FFFFFF\">" + (int)Math.ceil( (double) duration/ 60) + "</font></b>" + "<font color=\"#CAD6FF\"> 分钟</font>";
|
||||
@@ -498,6 +505,10 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
TaxiOrderStatusEnum ochStatus = TaxiOrderStatusEnum.valueOf(status);
|
||||
switch (ochStatus) {
|
||||
case OnTheWayToStart:
|
||||
if(dialog!=null&&dialog.isShowing()) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
dialog = null;
|
||||
mOrderCancel.setVisibility(View.VISIBLE);
|
||||
VoiceNotice.showNotice(mActivity.getString(R.string.module_och_taxi_new_order));
|
||||
mTtsLessThan200Tip = 0;
|
||||
@@ -509,6 +520,10 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.raw.end_marker);
|
||||
break;
|
||||
case Cancel:
|
||||
if(dialog!=null&&dialog.isShowing()) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
dialog = null;
|
||||
mCurrentOrder = null;
|
||||
mTtsLessThan200Tip = 0;
|
||||
isFirstStartAutopilotDone = true;
|
||||
@@ -520,6 +535,10 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
break;
|
||||
case ArriveAtStart:
|
||||
case UserArriveAtStart:
|
||||
if(dialog!=null&&dialog.isShowing()) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
dialog = null;
|
||||
mTtsLessThan200Tip = 0;
|
||||
isFirstStartAutopilotDone = true;
|
||||
mOrderCancel.setVisibility(View.VISIBLE);
|
||||
@@ -533,6 +552,10 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.raw.end_marker);
|
||||
break;
|
||||
case OnTheWayToEnd:
|
||||
if(dialog!=null&&dialog.isShowing()) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
dialog = null;
|
||||
mOrderCancel.setVisibility(View.VISIBLE);
|
||||
if (mTaxiFragment != null) {
|
||||
showNaviToEndStationFragment(false);
|
||||
@@ -541,6 +564,12 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.raw.end_marker);
|
||||
break;
|
||||
case ArriveAtEnd:
|
||||
if(dialog==null){
|
||||
dialog = new ItinerarySummaryDialog(getContext(),true,R.style.summary_dialog);
|
||||
}
|
||||
if(!dialog.isShowing()) {
|
||||
dialog.show();
|
||||
}
|
||||
mTtsLessThan200Tip = 0;
|
||||
mOrderCancel.setVisibility(View.GONE);
|
||||
//VoiceNotice.showNotice(mActivity.getString(R.string.module_och_taxi_order_auto_arrive_end_tip));
|
||||
@@ -549,6 +578,10 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint,R.raw.end_marker);
|
||||
break;
|
||||
case JourneyCompleted:
|
||||
if(dialog!=null&&dialog.isShowing()) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
dialog = null;
|
||||
mCurrentOrder = null;
|
||||
mTtsLessThan200Tip = 0;
|
||||
isFirstStartAutopilotDone = true;
|
||||
|
||||
@@ -15,7 +15,6 @@ import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.temp.EventLogout;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -23,9 +22,9 @@ import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager;
|
||||
import com.mogo.och.common.module.biz.login.OpenOrderStatusEnum;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.common.module.biz.order.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.data.taxi.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.taxi.model.TaxiModel;
|
||||
import com.mogo.och.taxi.presenter.TaxiPresenter;
|
||||
import com.mogo.och.taxi.utils.TPRouteDataTestUtils;
|
||||
|
||||
@@ -21,9 +21,9 @@ import com.amap.api.maps.model.Polyline
|
||||
import com.amap.api.maps.model.PolylineOptions
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.taxi.R
|
||||
import com.mogo.och.taxi.utils.TaxiMapAssetStyleUtil
|
||||
|
||||
@@ -68,13 +68,13 @@ class TaxiMapDirectionView @JvmOverloads constructor(
|
||||
initAMapView()
|
||||
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, this)
|
||||
OchLocationManager.addGCJ02Listener(TAG, 3, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
OchLocationManager.removeGCJ02Listener(TAG)
|
||||
}
|
||||
|
||||
private fun initAMapView() {
|
||||
|
||||