diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java
index 67347b137d..1219ca1f8d 100644
--- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java
@@ -154,12 +154,10 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
}
if ( isArriveEndStation ) {
-// showNotice( "行程结束,请携带好随身物品,注意侧后方来车,感谢体验蘑菇智行自动驾驶车!" );
showSlidePanle( "单程结束" );
} else if ( isArriveAtStartStation ) {
showSlidePanle( "准备出发" );
} else if ( isArriveAtStation ) {
-// showNotice( "行程结束,请携带好随身物品,注意侧后方来车,感谢体验蘑菇智行自动驾驶车!" );
showSlidePanle( "乘客已上车,准备出发" );
}
@@ -191,7 +189,7 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
@Override
public void moveToEnd() {
- mPresenter.autoDriveToNextStation();
+ mPresenter.autoDriveToNextStation(false);
}
public void onAutopilotEnableChange( boolean isEnable ) {
@@ -210,9 +208,9 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
public void changeOperationStatus( boolean launch ) {
if ( launch ) {
- tvOperationStatus.setText( "关闭" );
+ tvOperationStatus.setText( "收车" );
} else {
- tvOperationStatus.setText( "开启" );
+ tvOperationStatus.setText( "出车" );
}
}
}
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusOrderModel.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusOrderModel.java
index 2a54899375..b5826b2631 100644
--- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusOrderModel.java
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusOrderModel.java
@@ -73,21 +73,6 @@ class OchBusOrderModel {
}
};
- /**
- * 小巴达到站点,推送需要下车的乘客列表
- */
- private IMogoOnMessageListener< OchBusArriveAtStationMsg > mOnBusArriveAtStationMsg = new IMogoOnMessageListener< OchBusArriveAtStationMsg >() {
- @Override
- public Class< OchBusArriveAtStationMsg > target() {
- return OchBusArriveAtStationMsg.class;
- }
-
- @Override
- public void onMsgReceived( OchBusArriveAtStationMsg obj ) {
- onArriveAtStation();
- }
- };
-
/**
* 站点信息变更推送
*/
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java
index d5f53226d6..191bd9c882 100644
--- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java
@@ -12,7 +12,6 @@ import com.mogo.commons.mvp.Presenter;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
import com.mogo.commons.voice.AIAssist;
-import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.constants.HostConst;
import com.mogo.och.bus.bean.OchBusLeaveStationRequest;
@@ -45,7 +44,6 @@ import okhttp3.MediaType;
import okhttp3.RequestBody;
import static com.mogo.och.bus.constant.OchBusConst.STATION_STATUS_ARRIVING;
-import static com.mogo.och.bus.constant.OchBusConst.STATION_STATUS_IDLE;
import static com.mogo.och.bus.constant.OchBusConst.STATION_STATUS_LEAVING;
import static com.mogo.och.bus.constant.OchBusConst.STATION_STATUS_STOPPED;
@@ -105,11 +103,10 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
public void queryBusRoutes() {
double lat = 40.1974932972;
double lon = 116.7354579447;
- MogoLocation lastLocation = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient( getContext() ).getLastKnowLocation();
- if ( lastLocation != null ) {
-// lat = lastLocation.getLatitude();
-// lon = lastLocation.getLongitude();
- }
+
+// lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
+// lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
+
OchBusRoutesRequest request = new OchBusRoutesRequest( Utils.getSn(), lat, lon );
RequestBody requestBody = RequestBody.create( MediaType.get( "application/json;charset=UTF-8" ), GsonUtil.jsonFromObject( request ) );
mService.querySiteByCoordinate( requestBody )
@@ -153,6 +150,8 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
* @param site
*/
private void renderBusStationsStatus( List< OchBusStation > site ) {
+ int lastStopStation = getNextStopStation();
+
stationList.clear();
stationList.addAll( site );
for ( int i = 0; i < stationList.size(); i++ ) {
@@ -174,6 +173,29 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
mView.hideSlidePanel();
mView.hideNotice();
}
+
+ resetNextStopStation( lastStopStation );
+
+ }
+
+ /**
+ * 重置下一站
+ *
+ * @param lastStopStation
+ */
+ private void resetNextStopStation( int lastStopStation ) {
+ int nextStopStation = getNextStopStation();
+ if ( nextStopStation < 0 ) {
+ return;
+ }
+ if ( lastStopStation <= nextStopStation || nextStopStation <= currentStationIndex ) {
+ return;
+ }
+ if ( MogoApisHandler.getInstance().getApis().getAdasControllerApi().getAutopilotStatus()
+ == IMogoAdasOCHCallback.STATUS_AUTOPILOT_RUNNING ) {
+ // 自动驾驶中动态设置下一个停靠站点
+ autoDriveToNextStation( true );
+ }
}
/**
@@ -201,7 +223,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
public void restartAutopilot() {
Logger.d( TAG, "重启自动驾驶===" + isGoingToNextStation );
if ( isGoingToNextStation ) {
- autoDriveToNextStation();
+ autoDriveToNextStation( true );
}
}
@@ -247,7 +269,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
/**
* 开启自动驾驶到下一站
*/
- public void autoDriveToNextStation() {
+ public void autoDriveToNextStation( boolean isRestart ) {
if ( currentStationIndex >= stationList.size() - 1 ) {
// 当前站是最后一站,结束当前行程
travelOver();
@@ -262,6 +284,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
nextStation.setIsCurrentSite( STATION_STATUS_ARRIVING );
RemoteControlAutoPilotParameters currentAutopilot = new RemoteControlAutoPilotParameters();
+ currentAutopilot.isSpeakVoice = !isRestart;
currentAutopilot.startLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat( currentStation.getLat(), currentStation.getLon() );
currentAutopilot.endLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat( nextStation.getLat(), nextStation.getLon() );
currentAutopilot.vehicleType = VEHICLE_TYPE;
@@ -385,20 +408,25 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
return;
}
String station = stationList.get( currentStationIndex ).getSiteName();
- String msg = null;
+ StringBuilder builder = new StringBuilder( "已到达" );
+ if ( station.endsWith( "站" ) ) {
+ builder.append( station );
+ }
if ( o == null || o.result == null || o.result.info == null || o.result.info.isEmpty() ) {
- msg = "已到达" + station + "站,请带好随身物品,下车请注意安全";
- return;
- }
-
- for ( QueryLeaveAwayPassengersResponse.LeaveAwayPassenger leaveAwayPassenger : o.result.info ) {
- if ( leaveAwayPassenger == null ) {
- continue;
+ //
+ } else {
+ builder.append( ",请尾号为" );
+ for ( QueryLeaveAwayPassengersResponse.LeaveAwayPassenger leaveAwayPassenger : o.result.info ) {
+ if ( leaveAwayPassenger == null ) {
+ continue;
+ }
+ String tailNum = leaveAwayPassenger.userPhone.substring( leaveAwayPassenger.userPhone.length() - 4 );
+ builder.append( tailNum ).append( "," );
}
- String tailNum = leaveAwayPassenger.userPhone.substring( leaveAwayPassenger.userPhone.length() - 4 );
-
+ builder.append( "的乘客下车" );
}
- AIAssist.getInstance( getContext() ).speakTTSVoice( msg );
+ builder.append( ",带好随身物品,下车请注意安全" );
+ AIAssist.getInstance( getContext() ).speakTTSVoice( builder.toString() );
}
/**
diff --git a/OCH/mogo-och/src/main/res/color/module_mogo_och_autopilot_text_color_selector.xml b/OCH/mogo-och/src/main/res/color/module_mogo_och_autopilot_text_color_selector.xml
index 4cccf36d32..19f43e5bfd 100644
--- a/OCH/mogo-och/src/main/res/color/module_mogo_och_autopilot_text_color_selector.xml
+++ b/OCH/mogo-och/src/main/res/color/module_mogo_och_autopilot_text_color_selector.xml
@@ -1,5 +1,4 @@
-
\ No newline at end of file
diff --git a/OCH/mogo-och/src/main/res/drawable-xhdpi/module_och_bus_ic_autopilot.png b/OCH/mogo-och/src/main/res/drawable-xhdpi/module_och_bus_ic_autopilot.png
new file mode 100644
index 0000000000..be978145dc
Binary files /dev/null and b/OCH/mogo-och/src/main/res/drawable-xhdpi/module_och_bus_ic_autopilot.png differ
diff --git a/OCH/mogo-och/src/main/res/drawable/module_mogo_och_autopilot_status_bg.xml b/OCH/mogo-och/src/main/res/drawable/module_mogo_och_autopilot_status_bg.xml
index 85791d509e..b5596fad13 100644
--- a/OCH/mogo-och/src/main/res/drawable/module_mogo_och_autopilot_status_bg.xml
+++ b/OCH/mogo-och/src/main/res/drawable/module_mogo_och_autopilot_status_bg.xml
@@ -1,14 +1,16 @@
-
-
-
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
-
\ No newline at end of file
diff --git a/OCH/mogo-och/src/main/res/layout/module_mogo_och_base_fragment.xml b/OCH/mogo-och/src/main/res/layout/module_mogo_och_base_fragment.xml
index d628006b1b..a5cf07bc35 100644
--- a/OCH/mogo-och/src/main/res/layout/module_mogo_och_base_fragment.xml
+++ b/OCH/mogo-och/src/main/res/layout/module_mogo_och_base_fragment.xml
@@ -5,8 +5,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@dimen/module_mogo_och_margin_left"
- android:paddingTop="@dimen/module_mogo_och_margin_top"
- android:paddingEnd="@dimen/module_mogo_och_margin_right"
android:paddingBottom="@dimen/module_mogo_och_margin_bottom">
+ tools:visibility="visible" />
- 55px
+ 40px
40px
- 40px
+ 46px
24px
- 400px
+ 351px
492px
24px
diff --git a/modules/mogo-module-common/src/main/res/raw/othercar.n3d b/modules/mogo-module-common/src/main/res/raw/othercar.n3d
index af2a40e6b4..5a3af7e7e3 100644
Binary files a/modules/mogo-module-common/src/main/res/raw/othercar.n3d and b/modules/mogo-module-common/src/main/res/raw/othercar.n3d differ
diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/adas/RemoteControlAutoPilotParameters.java b/services/mogo-service-api/src/main/java/com/mogo/service/adas/RemoteControlAutoPilotParameters.java
index 2abb1b3fe7..66efd70831 100644
--- a/services/mogo-service-api/src/main/java/com/mogo/service/adas/RemoteControlAutoPilotParameters.java
+++ b/services/mogo-service-api/src/main/java/com/mogo/service/adas/RemoteControlAutoPilotParameters.java
@@ -16,6 +16,10 @@ class RemoteControlAutoPilotParameters {
public AutoPilotLonLat endLatLon;
public float speedLimit;
public int vehicleType;// 运营类型
+ /**
+ * 是否播放adas的 开始自动驾驶 语音
+ */
+ public boolean isSpeakVoice = true;
public static class AutoPilotLonLat {
public double lat;