[add] 接受事故任务调起自动驾驶
This commit is contained in:
@@ -12,10 +12,12 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo;
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
|
||||
import com.mogo.eagle.core.data.notice.NoticeValue;
|
||||
import com.mogo.eagle.core.function.api.notice.NoticeNetCallBack;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.notice.CallerNoticeManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleSmallVideoPlayer;
|
||||
@@ -51,17 +53,12 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
private TextView refuse;//拒绝
|
||||
private NoticeTrafficAdapter adapter;
|
||||
private ArrayList dataArrayList = new ArrayList();
|
||||
private NoticeTrafficStyleInfo mTrafficStyleInfo;
|
||||
|
||||
public NoticeTrafficDialog(@NonNull Context context, NoticeTrafficStylePushData pushData) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
mPushData = pushData;
|
||||
//图片
|
||||
String image = "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201609%2F26%2F20160926081306_GM2tv.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1638511084&t=92def7498b526dcba3fceda17c43fcb8";
|
||||
String video = "https://vd2.bdstatic.com/mda-mk1347dzxdmcre0y/sc/cae_h264/1635819498112313003/mda-mk1347dzxdmcre0y.mp4?v_from_s=hkapp-haokan-tucheng&auth_key=1635837585-0-0-5295f6658c7711ba7b4d3ef478a7fbaa&bcevod_channel=searchbox_feed&pd=1&pt=3&abtest=";
|
||||
mPushData.setPoiImgUrl(video);
|
||||
mPushData.setType(1);
|
||||
mPushData.setInfoId("905543067497902080");
|
||||
initView();
|
||||
}
|
||||
|
||||
@@ -108,10 +105,27 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
|
||||
/**
|
||||
* @param i 是否接受交通事故任务
|
||||
* 0不接收 1接受
|
||||
* 0不接收 1接受 发起自动驾驶任务,显示引导线
|
||||
*/
|
||||
private void feedBackTraffic(int i) {
|
||||
CallerNoticeManager.getNoticeProvider().feedBackNoticeTraffic(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), 1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶
|
||||
*/
|
||||
private void startAutoPilot() {
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
parameters.isSpeakVoice = false;
|
||||
parameters.vehicleType = 10;
|
||||
AutopilotControlParameters.AutoPilotLonLat startLocation = new AutopilotControlParameters.AutoPilotLonLat
|
||||
(MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon(),
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat());
|
||||
parameters.startLatLon = startLocation;
|
||||
AutopilotControlParameters.AutoPilotLonLat endLocation = new AutopilotControlParameters.AutoPilotLonLat
|
||||
(mTrafficStyleInfo.getLon(), mTrafficStyleInfo.getLat());
|
||||
parameters.endLatLon = endLocation;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,6 +140,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
trafficInfo.setPoiType("交通事故");
|
||||
trafficInfo.setOperaStatus("已处理");
|
||||
trafficInfo.setTroubleReasonName("逆向");
|
||||
mTrafficStyleInfo = trafficInfo;
|
||||
infoRefresh(trafficInfo);
|
||||
}
|
||||
});
|
||||
@@ -191,7 +206,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
private void playerShow() {
|
||||
mVideoPlayer = findViewById(R.id.video_player);
|
||||
thumbnailImage = findViewById(R.id.thumbnail_image);
|
||||
playImageView = this.findViewById(R.id.notice_start);
|
||||
playImageView = this.findViewById(R.id.start);
|
||||
playImageView.setOnClickListener(v -> {
|
||||
startLive();
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:layout_marginLeft="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/dark_clore_close"
|
||||
android:src="@drawable/dark_color_close"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:layout_marginLeft="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/dark_clore_close"
|
||||
android:src="@drawable/dark_color_close"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
@@ -56,7 +56,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/video_player" />
|
||||
<!--播放按钮-->
|
||||
<ImageView
|
||||
android:id="@+id/notice_start"
|
||||
android:id="@+id/start"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:layout_centerInParent="true"
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<dimen name="dp_75">80px</dimen>
|
||||
<dimen name="dp_150">150px</dimen>
|
||||
<dimen name="dp_180">180px</dimen>
|
||||
<dimen name="dp_200">200px</dimen>
|
||||
<dimen name="dp_220">220px</dimen>
|
||||
<dimen name="dp_395">395px</dimen>
|
||||
<dimen name="dp_580">580px</dimen>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<dimen name="dp_75">80px</dimen>
|
||||
<dimen name="dp_150">150px</dimen>
|
||||
<dimen name="dp_180">180px</dimen>
|
||||
<dimen name="dp_200">200px</dimen>
|
||||
<dimen name="dp_220">220px</dimen>
|
||||
<dimen name="dp_395">395px</dimen>
|
||||
<dimen name="dp_580">580px</dimen>
|
||||
|
||||
@@ -35,6 +35,12 @@ class TestNoticeBroadcastReceiver : BroadcastReceiver() {
|
||||
val pushData = NoticeTrafficStylePushData()
|
||||
pushData.msg = "交警测试公告"
|
||||
pushData.content = "交警测试公告内容"
|
||||
//图片
|
||||
val image: String = "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201609%2F26%2F20160926081306_GM2tv.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1638511084&t=92def7498b526dcba3fceda17c43fcb8"
|
||||
//视频
|
||||
pushData.poiImgUrl = "https://vd2.bdstatic.com/mda-mk1347dzxdmcre0y/sc/cae_h264/1635819498112313003/mda-mk1347dzxdmcre0y.mp4?v_from_s=hkapp-haokan-tucheng&auth_key=1635837585-0-0-5295f6658c7711ba7b4d3ef478a7fbaa&bcevod_channel=searchbox_feed&pd=1&pt=3&abtest="
|
||||
pushData.type = 1
|
||||
pushData.infoId = "905543067497902080"
|
||||
CallerHmiManager.showTrafficBanner(pushData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,9 @@ public class NoticeTrafficStyleInfo extends BaseData {
|
||||
private long dataHandleTime;//事故处理时间
|
||||
private String operaStatus;//事故处理状态
|
||||
private String troubleReasonName;//事故原因
|
||||
private String uploadAddress;//事故地点
|
||||
private String uploadAddress;//事故地点名称
|
||||
private double lat;//纬度
|
||||
private double lon;//经度
|
||||
|
||||
public String getInfoId() {
|
||||
return infoId;
|
||||
@@ -74,6 +76,22 @@ public class NoticeTrafficStyleInfo extends BaseData {
|
||||
this.uploadAddress = uploadAddress;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NoticeTrafficStyleInfo{" +
|
||||
@@ -84,6 +102,8 @@ public class NoticeTrafficStyleInfo extends BaseData {
|
||||
", operaStatus='" + operaStatus + '\'' +
|
||||
", troubleReasonName='" + troubleReasonName + '\'' +
|
||||
", uploadAddress='" + uploadAddress + '\'' +
|
||||
", lat=" + lat +
|
||||
", lon=" + lon +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
BIN
core/mogo-core-res/src/main/res/drawable/dark_color_close.png
Normal file
BIN
core/mogo-core-res/src/main/res/drawable/dark_color_close.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
Reference in New Issue
Block a user