@@ -24,15 +24,15 @@ import com.mogo.commons.module.status.StatusDescriptor;
import com.mogo.eagle.core.data.BaseData ;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters ;
import com.mogo.eagle.core.data.config.FunctionBuildConfig ;
import com.mogo.eagle.core.data.map.MogoLocation ;
import com.mogo.eagle.core.data.telematic.TelematicConstant ;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener ;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener ;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener ;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager ;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControl Manager ;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager ;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ2 0ListenerManager ;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02 ListenerManager ;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager ;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager ;
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager ;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger ;
import com.mogo.eagle.core.utilcode.util.GsonUtils ;
@@ -154,7 +154,8 @@ public class OrderModel {
mContext = AbsMogoApplication . getApp ( ) ;
loginService = ( LoginService ) ARouter . getInstance ( ) . build ( OchCommonConst . LOGINSERVICE ) . navigation ( ) ;
// 定位监听
CallerChassisLocationGCJ2 0ListenerManager . INSTANCE . addListener ( TAG , mMapLocationListener ) ;
CallerChassisLocationGCJ02 ListenerManager . INSTANCE . addListener ( TAG , mMapLocationListener ) ;
CallerChassisLocationGCJ02ListenerManager . INSTANCE . setListenerHz ( TAG , 5 ) ; //设置5hz, 1s返回一次
MogoStatusManager . getInstance ( ) . registerStatusChangedListener ( TAG , StatusDescriptor . VR_MODE , mMogoStatusChangedListener ) ;
@@ -303,7 +304,7 @@ public class OrderModel {
MogoStatusManager . getInstance ( ) . unregisterStatusChangedListener ( TAG , StatusDescriptor . VR_MODE , mMogoStatusChangedListener ) ;
// 注销定位监听
CallerMap LocationListenerManager . INSTANCE . removeListener ( TAG , false );
CallerChassis LocationGCJ02 ListenerManager . INSTANCE . removeListener ( TAG ) ;
//自动驾驶路线规划接口
CallerPlanningRottingListenerManager . INSTANCE . removeListener ( moGoAutopilotPlanningListener ) ;
@@ -349,24 +350,25 @@ public class OrderModel {
// 自车定位
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener ( ) {
@Override
public void onChassisLocationGCJ02 ( @Nullable MessagePad . GnssInfo gnssInfo ) {
if ( null = = gnssInfo ) return ;
mLongitude = gnssInfo . getLongitude ( ) ;
mLatitude = gnssInfo . getLatitude ( ) ;
public void onChassisLocationGCJ02 ( @Nullable MogoLocation mogoLocation ) {
if ( null = = mogoLocation ) return ;
mLongitude = mogoLocation . getLongitude ( ) ;
mLatitude = mogoLocation . getLatitude ( ) ;
if ( mControllerStatusCallback ! = null ) {
mControllerStatusCallback . onCarLocationChanged ( gnssInfo ) ;
mControllerStatusCallback . onCarLocationChanged ( mogoLocation ) ;
}
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
if ( isGoingToNextStation & & ! isArrivedStation ) {
judgeArrivedStation ( gnssInfo ) ;
judgeArrivedStation ( mogoLocation ) ;
}
}
} ;
//根据围栏判断,是否到达站点
private void judgeArrivedStation ( MessagePad . GnssInfo location ) {
private void judgeArrivedStation ( MogoLocation location ) {
if ( backgroundCurrentStationIndex + 1 > stationList . size ( ) - 1 ) {
CallerLogger . INSTANCE . e ( M_BUS + TAG , " 到站数组越界 " ) ;
@@ -471,7 +473,7 @@ public class OrderModel {
String lineTime = DateTimeUtil . formatLongToString (
busRoutesResult . getTaskTime ( ) ,
DateTimeUtil . TAXI_ HH_mm) ;
DateTimeUtil . HH_mm ) ;
if ( arrivingOrArrivedStationIndex = = 0 | |
arrivingOrArrivedStation . getDrivingStatus ( ) = = STATION_STATUS_STOPPED
@@ -609,7 +611,7 @@ public class OrderModel {
return ;
}
CallerAutoPilotManager . INSTANCE . startAutoPilot ( parameters ) ;
CallerAutoPilotControl Manager . INSTANCE . startAutoPilot ( parameters ) ;
CallerLogger . INSTANCE . d ( M_BUS + TAG , " 行程日志-开启自动驾驶==== " + GsonUtil . jsonFromObject ( parameters )
+ " startLatLon= " + parameters . startName + " , endLatLon=" + parameters . endName +
@@ -788,8 +790,8 @@ public class OrderModel {
public void closeBeautificationMode ( ) {
if ( FunctionBuildConfig . isDemoMode ) { //收车结束美化
FunctionBuildConfig . isIgnoreConditionsDrawAutopilotTrajectoryData = false ; //是否强制绘制引导线
CallerAutoPilotManager . INSTANCE . setIgnoreConditionDraw ( false ) ; // 同步给乘客屏
CallerAutoPilotManager . INSTANCE . setIPCDemoMode ( false ) ; //是否自动启动自驾
CallerAutoPilotControl Manager . INSTANCE . setIgnoreConditionDraw ( false ) ; // 同步给乘客屏
CallerAutoPilotControl Manager . INSTANCE . setIPCDemoMode ( false ) ; //是否自动启动自驾
CallerLogger . INSTANCE . d ( M_BUS + TAG , " 美化模式-ignore: 置为false " ) ;
}
}
@@ -871,7 +873,7 @@ public class OrderModel {
CallerLogger . INSTANCE . d ( M_BUS + TAG , " 美化模式-ignore: 置为true( 每次滑动出发) " ) ;
} else if ( backgroundCurrentStationIndex > 0 & & backgroundCurrentStationIndex < stationList . size ( ) - 1 ) {
//美化模式下 中间站点到站 引导线要一直绘制, 所以此处不出强制绘制不传false
CallerAutoPilotManager . INSTANCE . setIPCDemoMode ( false ) ;
CallerAutoPilotControl Manager . INSTANCE . setIPCDemoMode ( false ) ;
CallerLogger . INSTANCE . d ( M_BUS + TAG , " 美化模式-ignore: false( 到达中间站) " ) ;
clearStartAutopilotTag ( ) ;
} else {
@@ -962,8 +964,8 @@ public class OrderModel {
private void startBeautificationMode ( ) {
FunctionBuildConfig . isIgnoreConditionsDrawAutopilotTrajectoryData = true ;
CallerAutoPilotManager . INSTANCE . setIgnoreConditionDraw ( true ) ;
CallerAutoPilotManager . INSTANCE . setIPCDemoMode ( true ) ;
CallerAutoPilotControl Manager . INSTANCE . setIgnoreConditionDraw ( true ) ;
CallerAutoPilotControl Manager . INSTANCE . setIPCDemoMode ( true ) ;
}
public void clearBusStationDatas ( ) {
@@ -1002,7 +1004,7 @@ public class OrderModel {
return ;
}
CallerLogger . INSTANCE . d ( M_BUS + TAG , " 单程结束==== " ) ;
CallerAutoPilotManager . INSTANCE . cancelAutoPilot ( ) ;
CallerAutoPilotControl Manager . INSTANCE . cancelAutoPilot ( ) ;
endTask ( ) ;
}