[6.1.0] B1乘客屏自动驾驶按钮美化模式
This commit is contained in:
@@ -113,6 +113,9 @@ object BusPassengerModel{
|
||||
false
|
||||
})
|
||||
|
||||
@Volatile
|
||||
private var isGoingToNextStation = false
|
||||
|
||||
fun init(context: Context) {
|
||||
mContext = context.applicationContext
|
||||
initListeners()
|
||||
@@ -227,6 +230,7 @@ object BusPassengerModel{
|
||||
val station = stations[i]
|
||||
if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED && station.isLeaving && i + 1 < stations.size) { //离站
|
||||
Logger.d(M_BUS_P + TAG, "order = station= leave")
|
||||
isGoingToNextStation = true
|
||||
mRouteLineInfoCallback!!.updateStationsInfo(stations, i + 1, false)
|
||||
if (mNextStationIndex != i + 1) {
|
||||
mTwoStationsRouts.clear()
|
||||
@@ -241,6 +245,9 @@ object BusPassengerModel{
|
||||
if (i == stations.size - 1) {
|
||||
cleanStation("updatePassengerRouteInfo最后一个站点")
|
||||
}
|
||||
|
||||
isGoingToNextStation = false
|
||||
|
||||
suspendCalculate()
|
||||
|
||||
Logger.d(M_BUS_P + TAG, "order = station= arrive")
|
||||
@@ -487,15 +494,24 @@ object BusPassengerModel{
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
if (mADASStatusCallback != null) mADASStatusCallback!!.onAutopilotRunning()
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
mTwoStationsRouts.clear()
|
||||
if (mADASStatusCallback != null) mADASStatusCallback!!.onAutopilotEnable()
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
mTwoStationsRouts.clear()
|
||||
if (mADASStatusCallback != null) mADASStatusCallback!!.onAutopilotDisable()
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) {
|
||||
mTwoStationsRouts.clear()
|
||||
if (mADASStatusCallback != null) mADASStatusCallback!!.onAutopilotRunning()
|
||||
} else {
|
||||
if (FunctionBuildConfig.isDemoMode &&
|
||||
mNextStationIndex>= 0 && mNextStationIndex <= mStations.size - 1
|
||||
&& isGoingToNextStation){
|
||||
d(M_BUS_P + TAG, "FunctionBuildConfig.isDemoMode is true")
|
||||
return
|
||||
}
|
||||
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
mTwoStationsRouts.clear()
|
||||
if (mADASStatusCallback != null) mADASStatusCallback!!.onAutopilotEnable()
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
mTwoStationsRouts.clear()
|
||||
if (mADASStatusCallback != null) mADASStatusCallback!!.onAutopilotDisable()
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) {
|
||||
mTwoStationsRouts.clear()
|
||||
if (mADASStatusCallback != null) mADASStatusCallback!!.onAutopilotRunning()
|
||||
}
|
||||
}
|
||||
}
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivalNotification?) {
|
||||
|
||||
@@ -453,8 +453,6 @@ public class BusPassengerRouteFragment extends
|
||||
public void AutopilotStatusChanged(int status) {
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
|
||||
mAutopilotIv.setImageResource(R.drawable.auto_open);
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status){
|
||||
mAutopilotIv.setImageResource(R.drawable.auto_close);
|
||||
} else {
|
||||
mAutopilotIv.setImageResource(R.drawable.auto_close);
|
||||
}
|
||||
|
||||
@@ -119,6 +119,9 @@ public class BusPassengerModel {
|
||||
private int mPreRouteIndex = 0;
|
||||
private int mWipePreIndex = 0;
|
||||
|
||||
@Volatile
|
||||
private var isGoingToNextStation = false
|
||||
|
||||
private static final int MSG_QUERY_BUS_P_STATION = 1001;
|
||||
private final Handler handler = new Handler(new Handler.Callback() {
|
||||
@Override
|
||||
@@ -291,6 +294,8 @@ public class BusPassengerModel {
|
||||
for (int i = 0; i< stations.size(); i++){
|
||||
BusStationBean station = stations.get(i);
|
||||
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving() && i+1 < stations.size()){
|
||||
Logger.d(M_BUS_P + TAG, "order = station= leave")
|
||||
isGoingToNextStation = true
|
||||
mRouteLineInfoCallback.updateStationsInfo(stations,i+1,false);
|
||||
if(mNextStationIndex != i+1){
|
||||
mTwoStationsRouts.clear();
|
||||
@@ -302,6 +307,9 @@ public class BusPassengerModel {
|
||||
if (i == 0){
|
||||
startOrStopRouteAndWipe(false);
|
||||
}
|
||||
|
||||
isGoingToNextStation = false
|
||||
Logger.d(M_BUS_P + TAG, "order = station= arrive")
|
||||
mPreRouteIndex = 0;
|
||||
startOrStopCalculateRouteInfo(false);
|
||||
mRouteLineInfoCallback.updateStationsInfo(stations,i,true);
|
||||
@@ -452,8 +460,6 @@ public class BusPassengerModel {
|
||||
}
|
||||
};
|
||||
|
||||
private volatile int mPreAutoStatus = -1;
|
||||
|
||||
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener(){
|
||||
@Override
|
||||
public void onSystemStatus(@NonNull SsmInfo.SsmStatusInf statusInf) {
|
||||
@@ -492,27 +498,29 @@ public class BusPassengerModel {
|
||||
int state = autopilotStatusInfo.getState();
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
//2022.7.20 自动驾驶更换成带档位的
|
||||
if(state != mPreAutoStatus && null != routesResult){
|
||||
if(null != routesResult){
|
||||
CallerAutoPilotControlManager.INSTANCE.getGlobalPath();
|
||||
}
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
if(state != mPreAutoStatus){
|
||||
mTwoStationsRouts.clear();
|
||||
} else{
|
||||
if (FunctionBuildConfig.isDemoMode &&
|
||||
mNextStationIndex>= 0 && mNextStationIndex <= mStations.size - 1
|
||||
&& isGoingToNextStation){
|
||||
d(M_BUS_P + TAG, "FunctionBuildConfig.isDemoMode is true")
|
||||
return
|
||||
}
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotEnable();
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
if(state != mPreAutoStatus){
|
||||
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
mTwoStationsRouts.clear();
|
||||
}
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotDisable();
|
||||
}else if (state == IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING){
|
||||
if(state != mPreAutoStatus){
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotEnable();
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
mTwoStationsRouts.clear();
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotDisable();
|
||||
}else if (state == IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING){
|
||||
mTwoStationsRouts.clear();
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
}
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
}
|
||||
mPreAutoStatus = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -389,8 +389,6 @@ public class BusPassengerRouteFragment extends
|
||||
public void AutopilotStatusChanged(int status) {
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
|
||||
mAutopilotIv.setImageResource(R.drawable.auto_open);
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status){
|
||||
mAutopilotIv.setImageResource(R.drawable.auto_close);
|
||||
} else {
|
||||
mAutopilotIv.setImageResource(R.drawable.auto_close);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user