Merge remote-tracking branch 'origin/dev2_aiSdk' into dev2_aiSdk
1
.idea/gradle.xml
generated
@@ -91,7 +91,6 @@
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
2
.idea/misc.xml
generated
@@ -8,7 +8,7 @@
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -75,6 +75,7 @@ class OchBusOrderModel {
|
||||
|
||||
/**
|
||||
* 站点信息变更推送
|
||||
* 新订单、取消订单、到达站点等都会导致停靠站点变更,故都会收到此推送
|
||||
*/
|
||||
private IMogoOnMessageListener< OchBusStationsChangedMsg > mOnBusStationsChangedMsg = new IMogoOnMessageListener< OchBusStationsChangedMsg >() {
|
||||
@Override
|
||||
|
||||
@@ -71,7 +71,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
private IOchBusApiService mService;
|
||||
|
||||
/**
|
||||
* 运营状态
|
||||
* 运营状态、后端更具运营状态来判断车辆是否派单
|
||||
*/
|
||||
private boolean mIsWorking = false;
|
||||
|
||||
@@ -171,7 +171,6 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
|
||||
if ( isGoingToNextStation ) {
|
||||
mView.hideSlidePanel();
|
||||
mView.hideNotice();
|
||||
}
|
||||
|
||||
resetNextStopStation( lastStopStation );
|
||||
@@ -216,10 +215,16 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
return nextStationIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* 延时查询站点信心
|
||||
*/
|
||||
private void queryBusStationDelay() {
|
||||
handler.sendEmptyMessageDelayed( MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY );
|
||||
}
|
||||
|
||||
/**
|
||||
* 在踩刹车、控制方向盘等操作后,会停止自动加水,重启自动驾驶的话相当于重新设置自动驾驶目的地
|
||||
*/
|
||||
public void restartAutopilot() {
|
||||
Logger.d( TAG, "重启自动驾驶===" + isGoingToNextStation );
|
||||
if ( isGoingToNextStation ) {
|
||||
@@ -228,7 +233,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试
|
||||
* 测试、重置站点状态
|
||||
*/
|
||||
public void debugResetStationStatus() {
|
||||
OchBusResetRequest request = new OchBusResetRequest( Utils.getSn(), 1 );
|
||||
@@ -294,7 +299,6 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
if ( mView != null ) {
|
||||
mView.refreshBusStations( stationList, currentStationIndex, nextStationIndex );
|
||||
mView.hideSlidePanel();
|
||||
mView.hideNotice();
|
||||
}
|
||||
|
||||
if ( isGoingToNextStation ) {
|
||||
@@ -403,14 +407,20 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
} );
|
||||
}
|
||||
|
||||
/**
|
||||
* 播报下车乘客信息
|
||||
*
|
||||
* @param o
|
||||
*/
|
||||
private void playLeavePassengersMsg( QueryLeaveAwayPassengersResponse o ) {
|
||||
if ( currentStationIndex > stationList.size() - 1 ) {
|
||||
return;
|
||||
}
|
||||
String station = stationList.get( currentStationIndex ).getSiteName();
|
||||
StringBuilder builder = new StringBuilder( "已到达" );
|
||||
if ( station.endsWith( "站" ) ) {
|
||||
builder.append( station );
|
||||
builder.append( station );
|
||||
if ( !station.endsWith( "站" ) ) {
|
||||
builder.append( "站" );
|
||||
}
|
||||
if ( o == null || o.result == null || o.result.info == null || o.result.info.isEmpty() ) {
|
||||
//
|
||||
|
||||
@@ -84,6 +84,8 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
} else {
|
||||
flatMode();
|
||||
}
|
||||
// 出租车不需要开启按钮
|
||||
tvOperationStatus.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/module_och_taxi_panel_width"
|
||||
android:layout_height="@dimen/module_och_taxi_panel_height"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/module_och_taxi_panel_bkg"
|
||||
android:orientation="vertical">
|
||||
|
||||
@@ -49,18 +50,18 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5px"
|
||||
android:text="后路站"
|
||||
android:textColor="@color/module_och_order_status_textColor"
|
||||
android:textSize="@dimen/module_och_taxi_order_start_station_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@+id/greenDot"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="后路站" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_taxi_order_start_station_anchor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="上车站点"
|
||||
android:text="上车"
|
||||
android:textColor="@color/module_och_taxi_order_start_station_anchor_textColor"
|
||||
android:textSize="@dimen/module_och_taxi_order_start_station_anchor_textSize"
|
||||
android:textStyle="bold"
|
||||
@@ -71,10 +72,11 @@
|
||||
<ImageView
|
||||
android:id="@+id/dotLine"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/module_och_taxi_dot_line"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/greenDot"
|
||||
app:layout_constraintRight_toRightOf="@+id/greenDot"
|
||||
app:layout_constraintBottom_toTopOf="@+id/blueDot"
|
||||
app:layout_constraintTop_toBottomOf="@+id/greenDot" />
|
||||
|
||||
<ImageView
|
||||
@@ -90,20 +92,20 @@
|
||||
android:id="@+id/module_och_taxi_order_end_station"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="后路站1"
|
||||
android:textColor="@color/module_och_order_status_textColor"
|
||||
android:textSize="@dimen/module_och_taxi_order_start_station_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_taxi_order_start_station"
|
||||
app:layout_constraintLeft_toRightOf="@+id/greenDot" />
|
||||
app:layout_constraintLeft_toRightOf="@+id/greenDot"
|
||||
tools:text="后路站1" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_taxi_order_end_station_anchor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="下车站点"
|
||||
android:text="下车"
|
||||
android:textColor="@color/module_och_taxi_order_end_station_anchor_textColor"
|
||||
android:textSize="@dimen/module_och_taxi_order_end_station_anchor_textSize"
|
||||
android:textStyle="bold"
|
||||
|
||||
@@ -2,25 +2,25 @@
|
||||
<resources>
|
||||
<dimen name="module_och_taxi_panel_width">464px</dimen>
|
||||
<dimen name="module_och_taxi_panel_height">310px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_marginLeft">30px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_marginTop">24px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_textSize">24px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_marginLeft">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_marginTop">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_textSize">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_height">1px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_marginLeft">30px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_marginTop">23px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_marginRight">30px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_height">146px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingLeft">30px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingTop">23px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingRight">30px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingBottom">23px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_marginLeft">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_marginTop">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_marginRight">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_height">140px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingLeft">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingTop">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingRight">17px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingBottom">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_start_station_textSize">26px</dimen>
|
||||
<dimen name="module_och_taxi_order_start_station_anchor_textSize">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_end_station_anchor_textSize">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_container_height">80px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_container_height">64px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_container_marginLeft">3px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_anchor_marginLeft">27px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_anchor_marginLeft">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_anchor_textSize">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_textSize">28px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_marginRight">27px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_textSize">24px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_marginRight">17px</dimen>
|
||||
</resources>
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="module_och_order_status_textColor">#FFFFFF</color>
|
||||
<color name="module_och_taxi_order_status_divider_bkgColor">#4D151B37</color>
|
||||
<color name="module_och_taxi_order_status_divider_bkgColor">#707DBE</color>
|
||||
<color name="module_och_taxi_order_start_station_anchor_textColor">#8198E8</color>
|
||||
<color name="module_och_taxi_order_end_station_anchor_textColor">#8198E8</color>
|
||||
<color name="module_och_taxi_order_distance_anchor_textColor">#8198E8</color>
|
||||
<color name="module_och_taxi_order_distance_textColor">#1FA7FF</color>
|
||||
<color name="module_och_taxi_order_distance_textColor">#FFFFFF</color>
|
||||
</resources>
|
||||
@@ -2,25 +2,25 @@
|
||||
<resources>
|
||||
<dimen name="module_och_taxi_panel_width">464px</dimen>
|
||||
<dimen name="module_och_taxi_panel_height">310px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_marginLeft">30px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_marginTop">24px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_textSize">24px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_marginLeft">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_marginTop">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_textSize">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_height">1px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_marginLeft">30px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_marginTop">23px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_marginRight">30px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_height">146px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingLeft">30px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingTop">23px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingRight">30px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingBottom">23px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_marginLeft">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_marginTop">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_divider_marginRight">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_height">140px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingLeft">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingTop">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingRight">17px</dimen>
|
||||
<dimen name="module_och_taxi_order_status_stationInfo_paddingBottom">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_start_station_textSize">26px</dimen>
|
||||
<dimen name="module_och_taxi_order_start_station_anchor_textSize">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_end_station_anchor_textSize">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_container_height">80px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_container_height">64px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_container_marginLeft">3px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_anchor_marginLeft">27px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_anchor_marginLeft">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_anchor_textSize">20px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_textSize">28px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_marginRight">27px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_textSize">24px</dimen>
|
||||
<dimen name="module_och_taxi_order_distance_marginRight">17px</dimen>
|
||||
</resources>
|
||||
@@ -7,9 +7,9 @@
|
||||
<string name="module_och_taxi_order_distance_text_ph">3.2 km</string>
|
||||
<string name="module_och_taxi_order_complete">请携带好随身物品,注意侧后\n方来车,感谢体验蘑菇智行自\n动驾驶车!</string>
|
||||
<string name="module_och_taxi_on_the_way_2_end_station">去往下车地点</string>
|
||||
<string name="module_och_taxi_waiting">已到达上车地点,等待乘客上车</string>
|
||||
<string name="module_och_taxi_new_order">收到新订单,正在前往上车地点</string>
|
||||
<string name="module_och_taxi_arrive_at_end_station2">已到达乘客下车地点</string>
|
||||
<string name="module_och_taxi_waiting">已到达,等待乘客上车</string>
|
||||
<string name="module_och_taxi_new_order">收到新订单,前往上车地点</string>
|
||||
<string name="module_och_taxi_arrive_at_end_station2">已到达下车地点</string>
|
||||
<string name="module_och_taxi_order_completed">订单已完成</string>
|
||||
<string name="module_och_taxi_order_cancel">订单已取消</string>
|
||||
</resources>
|
||||
@@ -32,13 +32,10 @@ public abstract class BaseOchFragment<V extends IView, P extends Presenter<V>> e
|
||||
private static final String TAG = "BaseOchFragment";
|
||||
|
||||
protected SlidePanelView slidePanelView;
|
||||
private View tvNoticeContainer;
|
||||
private TextView tvNotice;
|
||||
private CheckedTextView ctvAutopilotStatus;
|
||||
protected TextView tvOperationStatus;
|
||||
private FrameLayout flStationPanelContainer;
|
||||
|
||||
private FrameAnimImageView fivNoticeHead;
|
||||
|
||||
private final SlidePanelView.OnSlidePanelMoveToEndListener onSlideToEndListener = () -> {
|
||||
// 此处做一个代理,处理一下共有情况
|
||||
@@ -55,17 +52,13 @@ public abstract class BaseOchFragment<V extends IView, P extends Presenter<V>> e
|
||||
@Override
|
||||
protected void initViews() {
|
||||
slidePanelView = findViewById(R.id.module_mogo_och_slide_panel);
|
||||
tvNoticeContainer = findViewById(R.id.module_mogo_och_notice_container);
|
||||
tvNotice = findViewById(R.id.module_mogo_och_notice);
|
||||
ctvAutopilotStatus = findViewById(R.id.module_mogo_och_autopilot_status);
|
||||
flStationPanelContainer = findViewById(R.id.module_mogo_och_station_panel_container);
|
||||
fivNoticeHead = findViewById(R.id.module_mogo_och_notice_head);
|
||||
|
||||
tvOperationStatus = findViewById( R.id.module_mogo_och_operation_status );
|
||||
|
||||
panelView = LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
|
||||
slidePanelView.setOnSlidePanelMoveToEndListener(onSlideToEndListener);
|
||||
fivNoticeHead.setAnimRes(sHappy1);
|
||||
|
||||
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
|
||||
@Override
|
||||
@@ -123,19 +116,7 @@ public abstract class BaseOchFragment<V extends IView, P extends Presenter<V>> e
|
||||
|
||||
public void showNotice(String notice) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
tvNotice.setText(notice);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(notice);
|
||||
tvNoticeContainer.setVisibility(View.VISIBLE);
|
||||
fivNoticeHead.setVisibility(View.VISIBLE);
|
||||
fivNoticeHead.startAnim();
|
||||
});
|
||||
}
|
||||
|
||||
public void hideNotice() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
tvNoticeContainer.setVisibility(View.GONE);
|
||||
fivNoticeHead.setVisibility(View.GONE);
|
||||
fivNoticeHead.stopAnim();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -196,35 +177,5 @@ public abstract class BaseOchFragment<V extends IView, P extends Presenter<V>> e
|
||||
*/
|
||||
public abstract void restartAutopilot();
|
||||
|
||||
private final int[] sHappy1 = {
|
||||
R.drawable.ic_happy1_00000,
|
||||
R.drawable.ic_happy1_00001,
|
||||
R.drawable.ic_happy1_00002,
|
||||
R.drawable.ic_happy1_00003,
|
||||
R.drawable.ic_happy1_00004,
|
||||
R.drawable.ic_happy1_00005,
|
||||
R.drawable.ic_happy1_00006,
|
||||
R.drawable.ic_happy1_00007,
|
||||
R.drawable.ic_happy1_00008,
|
||||
R.drawable.ic_happy1_00009,
|
||||
R.drawable.ic_happy1_00010,
|
||||
R.drawable.ic_happy1_00011,
|
||||
R.drawable.ic_happy1_00012,
|
||||
R.drawable.ic_happy1_00013,
|
||||
R.drawable.ic_happy1_00014,
|
||||
R.drawable.ic_happy1_00015,
|
||||
R.drawable.ic_happy1_00016,
|
||||
R.drawable.ic_happy1_00017,
|
||||
R.drawable.ic_happy1_00018,
|
||||
R.drawable.ic_happy1_00019,
|
||||
R.drawable.ic_happy1_00020,
|
||||
R.drawable.ic_happy1_00021,
|
||||
R.drawable.ic_happy1_00022,
|
||||
R.drawable.ic_happy1_00023,
|
||||
R.drawable.ic_happy1_00024,
|
||||
R.drawable.ic_happy1_00025,
|
||||
R.drawable.ic_happy1_00026,
|
||||
R.drawable.ic_happy1_00027,
|
||||
R.drawable.ic_happy1_00028
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
@@ -57,40 +57,6 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_notice_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/module_mogo_och_base_notice_box_bg"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_mogo_och_notice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:lineSpacingExtra="5px"
|
||||
android:maxWidth="@dimen/module_mogo_och_notice_text_max_width"
|
||||
android:text="请携带好随身物品\n注意侧后方来车\n感谢体验蘑菇智行自动驾驶车!"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/module_mogo_och_notice_text_size"
|
||||
android:textStyle="bold" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<com.mogo.och.view.FrameAnimImageView
|
||||
android:id="@+id/module_mogo_och_notice_head"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="185px"
|
||||
android:src="@drawable/ic_happy1_00000"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="@id/module_mogo_och_notice_container"
|
||||
app:layout_constraintTop_toTopOf="@id/module_mogo_och_notice_container" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotDisable"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -155,19 +155,19 @@ LOGLIB_VERSION = 1.0.4
|
||||
|
||||
######## MogoAiCloudSDK Version
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.0.61
|
||||
MOGO_NETWORK_VERSION=1.0.63
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.0.61
|
||||
MOGO_PASSPORT_VERSION=1.0.63
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.0.61
|
||||
MOGO_SOCKET_VERSION=1.0.63
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.0.61
|
||||
MOGO_REALTIME_VERSION=1.0.63
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.0.61
|
||||
MOGO_TANLU_VERSION=1.0.63
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.0.61
|
||||
MOGO_LIVE_VERSION=1.0.63
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.61
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.63
|
||||
|
||||
######## Foundation MogoAiCloud Moduletruetr
|
||||
# mogoAiCloud apk services
|
||||
|
||||
@@ -197,7 +197,6 @@ public class AMapWrapper implements IMogoMap {
|
||||
@Override
|
||||
public void showIndoorMap(boolean enable) {
|
||||
if (checkAMap()) {
|
||||
// TODO: 2020/5/27 显示室内地图
|
||||
// mAMap.showIndoorMap( enable );
|
||||
}
|
||||
}
|
||||
@@ -212,7 +211,6 @@ public class AMapWrapper implements IMogoMap {
|
||||
@Override
|
||||
public void stopAnimation() {
|
||||
if (checkAMap()) {
|
||||
// TODO: 2020/5/27 停止当前执行的改变地图状态的动画。
|
||||
// mAMap.stopAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +290,6 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
marker.setPosition( cloudRoadData.getWgslat(), cloudRoadData.getWgslon() );
|
||||
}
|
||||
|
||||
// TODO: 2021/3/23 后端算法提供显示颜色
|
||||
marker.setAnchorColor( getModelRenderColor( cloudRoadData.getType(), cloudRoadData.getSpeed(), cloudRoadData.getWgslon(), cloudRoadData.getWgslat(), cloudRoadData.getHeading() ) );
|
||||
|
||||
if ( shouldShowSpeed( cloudRoadData.getType() ) ) {
|
||||
@@ -371,7 +370,6 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
String resIdVal = null;
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
options.set3DMode( true );
|
||||
// TODO: 2021/3/23 后端算法提供显示颜色
|
||||
options.anchorColor( getModelRenderColor( data.getType(), data.getSpeed(), data.getWgslon(), data.getWgslat(), data.getHeading() ) );
|
||||
int resId = getModelRes( data.getType() );
|
||||
resIdVal = resId + "";
|
||||
|
||||
@@ -59,8 +59,6 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
Logger.d(TAG, "%s - %s", descriptor, isTrue);
|
||||
mChangeCarModeStatus = true;
|
||||
|
||||
AdasRecognizedResultDrawer.getInstance().notifyVrModeChanged();
|
||||
}
|
||||
|
||||
public boolean isVrMode() {
|
||||
@@ -85,12 +83,12 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
IMogoMarker marker = drawMarker(markerShowEntity);
|
||||
Log.d("liyz", "renderWarnData marker != null ");
|
||||
marker.addDynamicAnchorPosition(new MogoLatLng(data.getCollisionLat(), data.getCollisionLon()), (float) data.getHeading(), 4000);
|
||||
marker.addDynamicAnchorPosition(new MogoLatLng(data.getCollisionLat(), data.getCollisionLon()), (float) data.getHeading(), 5000);
|
||||
|
||||
//移动完成以后,3s后消失
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
marker.remove();
|
||||
}, 3000 );
|
||||
}, 8000 );
|
||||
|
||||
}, 0);
|
||||
|
||||
@@ -105,7 +103,8 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
||||
options.icon3DRes(getModelRes(2)); //TODO
|
||||
|
||||
options.anchorColor("#FF4040");
|
||||
// options.anchorColor("#FF4040");
|
||||
options.anchorColor("#FF3036"); //红色
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
iMarkerView.setMarker(marker);
|
||||
marker.setToTop();
|
||||
|
||||
@@ -54,6 +54,7 @@ public class V2XWarningEntity implements Serializable {
|
||||
public long satelliteTime;
|
||||
//预警蒙层等展示时长
|
||||
private long showTime;
|
||||
private float roadwidth;
|
||||
|
||||
//自组字段
|
||||
//tts播报
|
||||
@@ -218,6 +219,14 @@ public class V2XWarningEntity implements Serializable {
|
||||
return stopLines;
|
||||
}
|
||||
|
||||
public float getRoadwidth() {
|
||||
return roadwidth;
|
||||
}
|
||||
|
||||
public void setRoadwidth(float roadwidth) {
|
||||
this.roadwidth = roadwidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "V2XWarningEntity{" +
|
||||
@@ -231,6 +240,7 @@ public class V2XWarningEntity implements Serializable {
|
||||
", angle=" + angle +
|
||||
", direction=" + direction +
|
||||
", speed=" + speed +
|
||||
", stopLines=" + stopLines +
|
||||
", stopLineDistance=" + stopLineDistance +
|
||||
", roadId='" + roadId + '\'' +
|
||||
", laneId='" + laneId + '\'' +
|
||||
@@ -241,6 +251,8 @@ public class V2XWarningEntity implements Serializable {
|
||||
", heading=" + heading +
|
||||
", systemTime=" + systemTime +
|
||||
", satelliteTime=" + satelliteTime +
|
||||
", showTime=" + showTime +
|
||||
", roadwidth=" + roadwidth +
|
||||
", tts='" + tts + '\'' +
|
||||
", carLocation=" + carLocation +
|
||||
'}';
|
||||
|
||||
@@ -48,6 +48,7 @@ import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@@ -840,16 +841,22 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
}
|
||||
|
||||
List< ADASRecognizedResult > allList = new ArrayList<>();
|
||||
// List< ADASRecognizedResult > allList = new ArrayList<>();
|
||||
JSONArray jsonArray = new JSONArray( );
|
||||
for ( BufferedReader reader : readers ) {
|
||||
String line = reader.readLine();
|
||||
ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
|
||||
if ( adasRecognizedResult != null ) {
|
||||
allList.add( adasRecognizedResult );
|
||||
}
|
||||
// ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
|
||||
jsonArray.put( line );
|
||||
// if ( adasRecognizedResult != null ) {
|
||||
// allList.add( adasRecognizedResult );
|
||||
// }
|
||||
}
|
||||
|
||||
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( allList );
|
||||
JSONObject object = new JSONObject();
|
||||
object.put( "action", "view" );
|
||||
object.put( "models", jsonArray );
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized( object.toString() );
|
||||
Log.i( "mock-timer-adas", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ public class TanluManager implements IMogoMarkerClickListener,
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 释放资源
|
||||
* 释放资源
|
||||
*/
|
||||
public void releaseAction() {
|
||||
// EventBus.getDefault().unregister(this);
|
||||
|
||||
@@ -141,12 +141,12 @@ public class V2XConst {
|
||||
public static final String V2X_OPTIMAL_SPEED_MARKER = "V2X_OPTIMAL_SPEED_MARKER";
|
||||
|
||||
/*
|
||||
*V2X 车路云前方预警
|
||||
* */
|
||||
*V2X 车路云前方预警-识别物
|
||||
* */
|
||||
public static final String V2X_FRONT_WARNING_MARKER = "V2X_FRONT_WARNING_MARKER";
|
||||
|
||||
/*
|
||||
*V2X 车路云前方预警
|
||||
*V2X 车路云前方预警-线
|
||||
* */
|
||||
public static final String V2X_FRONT_STOP_LINE = "V2X_FRONT_STOP_LINE";
|
||||
/**
|
||||
|
||||
@@ -67,7 +67,7 @@ public class V2XWaringManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 测试数据
|
||||
* 测试数据
|
||||
*/
|
||||
private void testData() {
|
||||
|
||||
@@ -86,7 +86,6 @@ public class V2XWaringManager {
|
||||
// 加载数据源
|
||||
V2XWarningEntity warningEntity = GsonUtil.objectFromJson(baos.toString(), V2XWarningEntity.class);
|
||||
V2XServiceManager.getMoGoV2XCloundDataManager().analysisV2XCloundDataEvent(warningEntity);
|
||||
Logger.d(V2XConst.LOG_NAME_WARN, "testData -----> ");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 当前车辆与道路事件的连接线
|
||||
* 绘制行人和二轮车连线
|
||||
*/
|
||||
@Route(path = MoGoV2XServicePaths.PATH_V2X_PERSON_WARN_POLYLINE_MANAGER)
|
||||
public class MoGoPersonWarnPolylineManager implements IMoGoPersonWarnPolylineManager {
|
||||
@@ -40,23 +40,25 @@ public class MoGoPersonWarnPolylineManager implements IMoGoPersonWarnPolylineMan
|
||||
// 渐变色
|
||||
List<Integer> colors = new ArrayList<>();
|
||||
|
||||
if (info.getType() != null) {
|
||||
if (info.getType().equals("1")) { //预警 TODO
|
||||
colors.add(0xFFFFA31A);
|
||||
colors.add(0xFFFFA31A);
|
||||
} else {
|
||||
colors.add(0xFFE32F46);
|
||||
colors.add(0xFFE32F46);
|
||||
}
|
||||
} else {
|
||||
colors.add(0xFFE32F46);
|
||||
colors.add(0xFFE32F46);
|
||||
}
|
||||
// if (info.getType() != null) {
|
||||
// if (info.getType().equals("1")) { //预警 TODO
|
||||
// colors.add(0xFFFFA31A);
|
||||
// colors.add(0xFFFFA31A);
|
||||
// } else {
|
||||
// colors.add(0xFFE32F46);
|
||||
// colors.add(0xFFE32F46);
|
||||
// }
|
||||
// } else {
|
||||
// colors.add(0xFFE32F46);
|
||||
// colors.add(0xFFE32F46);
|
||||
// }
|
||||
|
||||
colors.add(0xFFE32F46);
|
||||
colors.add(0xFFE32F46);
|
||||
|
||||
// 线条粗细,渐变,渐变色值
|
||||
// Logger.d(V2XConst.LOG_NAME_WARN, "MoGoPersonWarnPolylineManager roadWidth = " + roadWidth);
|
||||
options.width(60).useGradient(true).colorValues(colors);
|
||||
// options.width(info.getWidth()).useGradient(true).colorValues(colors);
|
||||
Log.d(V2XConst.LOG_NAME_WARN, "MoGoPersonWarnPolylineManager width = " + info.getWidth());
|
||||
options.width(info.getWidth()).useGradient(true).transparency(0.1f).colorValues(colors);
|
||||
// 当前车辆位置
|
||||
options.add(info.getStartLocation());
|
||||
// 目标车辆位置
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XCloundDataManager;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -29,24 +30,36 @@ import static com.mogo.module.v2x.V2XServiceManager.getContext;
|
||||
@Route(path = MoGoV2XServicePaths.PATH_V2X_WARN_CLOUND_DATA_MANAGER)
|
||||
public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMogoCarLocationChangedListener2 {
|
||||
private V2XWarningEntity mCloundWarningInfo;
|
||||
private static String TAG = "MoGoV2XCloundDataManager";
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi()
|
||||
.registerCarLocationChangedListener(TAG, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void analysisV2XCloundDataEvent(V2XWarningEntity cloundWarningInfo) {
|
||||
Log.d(V2XConst.LOG_NAME_WARN, "analysisV2XCloundDataEvent -----> ");
|
||||
|
||||
mCloundWarningInfo = cloundWarningInfo;
|
||||
|
||||
//绘制识别物与交汇点连线,并且更新连线数据 TODO VR模式无法获取道路宽度
|
||||
drawOtherObjectLine(cloundWarningInfo);
|
||||
Logger.d(V2XConst.LOG_NAME_WARN, "analysisV2XCloundDataEvent -----> ");
|
||||
//绘制识别物与交汇点连线,并且更新连线数据
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
drawOtherObjectLine(cloundWarningInfo);
|
||||
}, 0);
|
||||
|
||||
//二轮车和行人的渲染和移动
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
|
||||
|
||||
//延迟3秒清理线
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
|
||||
}, 8000 );
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制行人和二轮车连线,并且更新数据
|
||||
* 绘制行人和二轮车连线,并且更新数据 TODO 需要实时给行人当前位置
|
||||
*/
|
||||
private void drawOtherObjectLine(V2XWarningEntity info) {
|
||||
IMogoPolyline polyLine = V2XServiceManager.getMoGoPersonWarnPolylineManager().getMogoPersonWarnPolyline();
|
||||
@@ -56,7 +69,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
polyLine.setPoints(Arrays.asList(new MogoLatLng(info.getLat(), info.getLon()),
|
||||
new MogoLatLng(info.getCollisionLat(), info.getCollisionLon())));
|
||||
} else {
|
||||
Log.d(V2XConst.LOG_NAME_WARN, "polyLine == null");
|
||||
Log.e(V2XConst.LOG_NAME_WARN, "polyLine == null");
|
||||
DrawLineInfo lineInfo = new DrawLineInfo();
|
||||
MogoLatLng startLatlng = new MogoLatLng(info.getLat(), info.getLon());
|
||||
MogoLatLng endLatlng = new MogoLatLng(info.getCollisionLat(), info.getCollisionLon());
|
||||
@@ -64,21 +77,14 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
lineInfo.setEndLocation(endLatlng);
|
||||
lineInfo.setHeading(info.heading);
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
float roadWidth = V2XServiceManager.getMapUIController().getRoadWidth(info.getLon(),
|
||||
info.getLat(), (float) info.heading, true, true);
|
||||
Log.d(V2XConst.LOG_NAME_WARN, "roadWidth = " + roadWidth);
|
||||
float pixel = V2XServiceManager.getMapUIController().getScalePerPixel();
|
||||
float width = roadWidth / pixel;
|
||||
lineInfo.setWidth(width);
|
||||
// float roadWidth = V2XServiceManager.getMapUIController().getRoadWidth(info.getLon(),
|
||||
// info.getLat(), (float) info.heading, true, true);
|
||||
Log.d(V2XConst.LOG_NAME_WARN, "drawOtherObjectLine width = " + info.getRoadwidth());
|
||||
lineInfo.setWidth(info.getRoadwidth());
|
||||
}
|
||||
V2XServiceManager.getMoGoPersonWarnPolylineManager().drawPersonWarnPolyline(getContext(), lineInfo);
|
||||
}
|
||||
|
||||
//延迟3秒清理线
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
|
||||
}, 6000 );
|
||||
|
||||
} else {
|
||||
Log.e(V2XConst.LOG_NAME_WARN, "info == null");
|
||||
V2XServiceManager.getMoGoPersonWarnPolylineManager().clearLine();
|
||||
@@ -91,11 +97,11 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
}
|
||||
|
||||
/**
|
||||
* 自车定位 移动完成需要 3s消失
|
||||
* 自车定位 移动完成需要 3s消失,这里何时清理,应该是没有数据的时候
|
||||
*/
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location latLng) {
|
||||
Log.d(V2XConst.LOG_NAME_WARN, "latLng = " + latLng.getLatitude() + "--" + latLng.getLongitude());
|
||||
Log.d(V2XConst.LOG_NAME_WARN, "onCarLocationChanged2 latLng = " + latLng.getLatitude() + "--" + latLng.getLongitude());
|
||||
//当行人经纬度交点 经纬度不为空,开始画线,否则清理
|
||||
//自车只需要关注移动
|
||||
IMogoPolyline mogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline();
|
||||
@@ -105,21 +111,21 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
new MogoLatLng(mCloundWarningInfo.getCollisionLat(), mCloundWarningInfo.getCollisionLon())));
|
||||
|
||||
} else {
|
||||
Log.e(V2XConst.LOG_NAME_WARN, "mogoPolyline == null");
|
||||
Log.e(V2XConst.LOG_NAME_WARN, "onCarLocationChanged2 mogoPolyline == null width = " + mCloundWarningInfo.getRoadwidth());
|
||||
DrawLineInfo info = new DrawLineInfo(); // 对象
|
||||
MogoLatLng startLatlng = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude());
|
||||
MogoLatLng endLatlng = new MogoLatLng(mCloundWarningInfo.getCollisionLat(), mCloundWarningInfo.getCollisionLon());
|
||||
info.setHeading(latLng.getBearing());
|
||||
info.setStartLocation(startLatlng);
|
||||
info.setEndLocation(endLatlng);
|
||||
info.setWidth(60); //TODO
|
||||
info.setWidth(mCloundWarningInfo.getRoadwidth()); //TODO 还需要转换比例尺
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(getContext(), info);
|
||||
}
|
||||
|
||||
//延迟3秒清理线
|
||||
//延迟3秒清理线 TODO 何时 清理
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
}, 3000 );
|
||||
}, 13000 );
|
||||
|
||||
} else {
|
||||
Log.e(V2XConst.LOG_NAME_WARN, "onCarLocationChanged2 mCloundWarningInfo == null");
|
||||
|
||||
@@ -38,29 +38,30 @@ public class MoGoWarnPolylineManager implements IMoGoWarnPolylineManager {
|
||||
mMogoPolyline.remove();
|
||||
}
|
||||
|
||||
Log.d(V2XConst.LOG_NAME_WARN, "MoGoWarnPolylineManager --------> ");
|
||||
|
||||
// 连接线参数
|
||||
MogoPolylineOptions options = new MogoPolylineOptions();
|
||||
List<Integer> colors = new ArrayList<>();
|
||||
|
||||
if (info.getType() != null) {
|
||||
if (info.getType().equals("1")) { //预警 TODO
|
||||
colors.add(0xFFFFA31A);
|
||||
colors.add(0xFFFFA31A);
|
||||
} else {
|
||||
colors.add(0xFFE32F46);
|
||||
colors.add(0xFFE32F46);
|
||||
}
|
||||
} else {
|
||||
Log.e(V2XConst.LOG_NAME_WARN, "drawWarnPolyline info.getType() == null ");
|
||||
colors.add(0xFFE32F46);
|
||||
colors.add(0xFFE32F46);
|
||||
}
|
||||
// if (info.getType() != null) {
|
||||
// if (info.getType().equals("1")) { //预警 TODO
|
||||
// colors.add(0xFFFFA31A);
|
||||
// colors.add(0xFFFFA31A);
|
||||
// } else {
|
||||
// colors.add(0xFFE32F46);
|
||||
// colors.add(0xFFE32F46);
|
||||
// }
|
||||
// } else {
|
||||
// Log.e(V2XConst.LOG_NAME_WARN, "drawWarnPolyline info.getType() == null ");
|
||||
// colors.add(0xFFE32F46);
|
||||
// colors.add(0xFFE32F46);
|
||||
// }
|
||||
|
||||
// Log.d(V2XConst.LOG_NAME_WARN, "MoGoWarnPolylineManager roadWidth = " + roadWidth);
|
||||
colors.add(0xFFE32F46);
|
||||
colors.add(0xFFE32F46);
|
||||
|
||||
Log.d(V2XConst.LOG_NAME_WARN, "MoGoWarnPolylineManager roadWidth = " + info.getWidth());
|
||||
// 线条粗细,渐变,渐变色值
|
||||
options.width(60).useGradient(true).colorValues(colors);
|
||||
options.width(info.getWidth()).useGradient(true).transparency(0.9f).colorValues(colors);
|
||||
// options.width(info.getWidth()).useGradient(true).colorValues(colors);
|
||||
// 当前车辆位置
|
||||
options.add(info.getStartLocation());
|
||||
|
||||
@@ -3,8 +3,11 @@ package com.mogo.module.v2x.scenario.scene.livecar;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.cloud.live.manager.LiveStreamManagerImpl;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.cloud.trafficlive.api.ITrafficIntersectionLiveCallBack;
|
||||
import com.mogo.cloud.trafficlive.api.MoGoAiCloudTrafficLive;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
@@ -100,6 +103,8 @@ public class V2XVoiceCallLiveBiz {
|
||||
* 查看前方车辆直播,同方向角 200米范围
|
||||
*/
|
||||
public void getFrontCarLive() {
|
||||
LiveStreamManagerImpl.getInstance(AbsMogoApplication.getApp(),
|
||||
MoGoAiCloudClientConfig.getInstance().getThirdPartyDeviceId());
|
||||
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity = buildCallLiveParams(null, null);
|
||||
mV2XVoiceCallLiveScenario = new V2XVoiceCallLiveScenario();
|
||||
mV2XVoiceCallLiveScenario.setV2XWindow(new V2XVoiceCallLiveCarWindow());
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.module.v2x.scenario.scene.livecar;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -64,7 +64,11 @@ public class V2XVoiceCallLiveScenario extends AbsV2XScenario<V2XPushMessageEntit
|
||||
R.dimen.module_v2x_event_window_width_vr : R.dimen.module_v2x_event_window_width);
|
||||
int height = (int) V2XUtils.getApp().getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ?
|
||||
R.dimen.module_v2x_event_see_live_window_height_vr : R.dimen.module_v2x_event_see_live_window_height);
|
||||
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(width, height);
|
||||
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(width, height);
|
||||
layoutParams.topMargin = (int) V2XUtils.getApp().getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ?
|
||||
R.dimen.module_v2x_event_window_top_margin_vr : R.dimen.module_v2x_event_window_top_margin);
|
||||
layoutParams.rightMargin = (int) V2XUtils.getApp().getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ?
|
||||
R.dimen.module_v2x_event_window_right_margin_vr : R.dimen.module_v2x_event_window_right_margin);
|
||||
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
|
||||
V2XServiceManager
|
||||
.getMogoTopViewManager()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.v2x.scenario.scene.warning;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
@@ -28,6 +29,7 @@ import java.util.List;
|
||||
* @since: 2021/3/30
|
||||
*/
|
||||
public class V2XWarningMarker implements IV2XMarker {
|
||||
private static final String TAG = "V2XWarningMarker";
|
||||
private V2XWarningEntity mMarkerEntity;
|
||||
private MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
private Context mContext = V2XServiceManager.getContext();
|
||||
@@ -65,13 +67,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
clearPOI();
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
//自车位置
|
||||
MogoLatLng car = mMarkerEntity.getCarLocation();
|
||||
if (car == null) {
|
||||
double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
|
||||
double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
|
||||
car = new MogoLatLng(lat, lon);
|
||||
car = new MogoLatLng(39.977709,116.417703);
|
||||
}
|
||||
MogoLatLng car = V2XServiceManager.getNavi().getCarLocation();
|
||||
if (car != null) {
|
||||
//根据到停止线的距离和方向角获取经纬度
|
||||
MogoLatLng
|
||||
@@ -79,6 +75,8 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
if (mMarkerEntity.getCollisionLat() > 0 && mMarkerEntity.getCollisionLon() > 0) {
|
||||
drawLine(car, stopLineLo);
|
||||
}
|
||||
} else {
|
||||
Log.d(TAG, "自车位置没有拿到");
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
@@ -105,7 +103,7 @@ public class V2XWarningMarker implements IV2XMarker {
|
||||
fillPoints.add(y);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ import android.widget.TextView;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.mogo.cloud.live.manager.LiveStreamManagerImpl;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.cloud.trafficlive.api.ITrafficCarLiveCallBack;
|
||||
import com.mogo.cloud.trafficlive.api.MoGoAiCloudTrafficLive;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
|
||||
@@ -25,5 +25,6 @@
|
||||
"stopLineLon": 116.417634,
|
||||
"warningContent": "小心行人",
|
||||
"heading": 30,
|
||||
"showTime": 3000
|
||||
"showTime": 3000,
|
||||
"roadwidth": 65.0
|
||||
}
|
||||
@@ -6,6 +6,10 @@
|
||||
<dimen name="module_v2x_operation_panel_share_goneMarginRight">32px</dimen>
|
||||
<dimen name="module_v2x_event_window_width">1060px</dimen>
|
||||
<dimen name="module_v2x_event_window_width_vr">583px</dimen>
|
||||
<dimen name="module_v2x_event_window_top_margin_vr">160px</dimen>
|
||||
<dimen name="module_v2x_event_window_top_margin">0px</dimen>
|
||||
<dimen name="module_v2x_event_window_right_margin_vr">32px</dimen>
|
||||
<dimen name="module_v2x_event_window_right_margin">0px</dimen>
|
||||
<dimen name="module_v2x_push_img_height">390px</dimen>
|
||||
<dimen name="module_v2x_push_img_container_height">410px</dimen>
|
||||
|
||||
|
||||
@@ -113,12 +113,11 @@ public interface IMogoADASController extends IProvider {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ADASRecognizedResult> getLastADASRecognizedResult();
|
||||
List< ADASRecognizedResult > getLastADASRecognizedResult();
|
||||
|
||||
/**
|
||||
* 添加adas识别物体回调
|
||||
*
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
void addAdasRecognizedDataCallback( IMogoAdasRecognizedDataCallback callback );
|
||||
@@ -139,6 +138,7 @@ public interface IMogoADASController extends IProvider {
|
||||
|
||||
/**
|
||||
* 自动驾驶状态通知
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
void addAdasOCHCallback( IMogoAdasOCHCallback callback );
|
||||
@@ -152,6 +152,7 @@ public interface IMogoADASController extends IProvider {
|
||||
|
||||
/**
|
||||
* 获取车辆自动驾驶状态
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
int getAutopilotStatus();
|
||||
@@ -160,18 +161,21 @@ public interface IMogoADASController extends IProvider {
|
||||
|
||||
/**
|
||||
* 获取车身的定位纬度
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
double getLastLat();
|
||||
|
||||
/**
|
||||
* 获取车身定位经度
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
double getLastLon();
|
||||
|
||||
/**
|
||||
* 获取车身定位经度
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
double getLastSpeed();
|
||||
@@ -181,5 +185,9 @@ public interface IMogoADASController extends IProvider {
|
||||
*/
|
||||
void cancelAutopilot();
|
||||
|
||||
void mockAdasLoc(String json);
|
||||
void mockAdasLoc( String json );
|
||||
|
||||
void mockAdasRecognized( List< ADASRecognizedResult > recognizedResults );
|
||||
|
||||
void mockAdasRecognized( String json );
|
||||
}
|
||||
|
||||
@@ -185,6 +185,8 @@ public class MogoADASController implements IMogoADASController {
|
||||
model.setDataAccuracy( bean.getDataAccuracy() );
|
||||
model.setDistance( bean.getDistance() );
|
||||
data.add( model );
|
||||
|
||||
Logger.d( TAG, "识别距离:x = %s, y = %s", model.getDistance_x(), model.getDistance_y() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -819,4 +821,21 @@ public class MogoADASController implements IMogoADASController {
|
||||
mMogoAdasCarDataCallback.onAdasCarDataCallback( stateInf );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mockAdasRecognized( List< ADASRecognizedResult > recognizedResults ) {
|
||||
if ( !mMogoAdasRecognizedDataCallbacks.isEmpty() ) {
|
||||
for ( IMogoAdasRecognizedDataCallback callback : mMogoAdasRecognizedDataCallbacks ) {
|
||||
if ( callback == null ) {
|
||||
continue;
|
||||
}
|
||||
callback.onAdasDataCallback( recognizedResults );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mockAdasRecognized( String json ) {
|
||||
mAutopolitDataCallBack.cameraEyeDetectResult( json );
|
||||
}
|
||||
}
|
||||
|
||||