Merge branch 'dev_robotaxi-d-app-module_2110_220915_2.11.0' into dev_robotaxi-d-app-module_2110_yangyakun_2.11.0
This commit is contained in:
@@ -167,6 +167,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
}
|
||||
|
||||
showStationsPanel();
|
||||
showOrHideSwitchLineBtn(false);
|
||||
|
||||
mLineName.setText(lineName);
|
||||
mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime);
|
||||
@@ -184,16 +185,12 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
|
||||
if (arrivingOrArrivedIndex == stationList.size() - 1 && isArrived){
|
||||
//切换路线和结束路线按钮切换
|
||||
showOrHideSwitchLineBtn(false);
|
||||
|
||||
showSlidePanel("单程结束");
|
||||
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
}else if (arrivingOrArrivedIndex == 0 && isArrived){
|
||||
|
||||
showOrHideSwitchLineBtn(true);
|
||||
|
||||
showSlidePanel("滑动出发");
|
||||
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_START_MAP_MAKER,
|
||||
@@ -206,8 +203,6 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
showSlidePanel("滑动出发");
|
||||
}
|
||||
|
||||
showOrHideSwitchLineBtn(false);
|
||||
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
|
||||
@@ -54,6 +54,7 @@ import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants
|
||||
import io.netty.channel.Channel
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.util.*
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
|
||||
@@ -69,6 +70,7 @@ class MoGoAutopilotProvider :
|
||||
private val TAG = "MoGoAutoPilotProvider"
|
||||
private var mContext: Context? = null
|
||||
private lateinit var msgHandler: IMsgHandler
|
||||
private var timer: Timer? = null
|
||||
|
||||
override val functionName: String
|
||||
get() = TAG
|
||||
@@ -80,7 +82,6 @@ class MoGoAutopilotProvider :
|
||||
// 初始化ADAS 域控制器
|
||||
CupidLogUtils.setEnableLog(false)
|
||||
msgHandler = TeleMsgHandler()
|
||||
// TODO 临时方案,根据不同的身份标识,连接不同的工控机IP
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {// 司机
|
||||
// 注册地图采集功能
|
||||
CallerMapDataCollectorManager.registerOnMapCollectTaskListener(this)
|
||||
@@ -95,11 +96,11 @@ class MoGoAutopilotProvider :
|
||||
|
||||
// "192.168.1.102"
|
||||
val options = AdasOptions.Builder()
|
||||
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
|
||||
.setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext))
|
||||
.setClient(false)
|
||||
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
|
||||
.setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext))
|
||||
.setClient(false)
|
||||
// .setSubscribeInterfaceOptions(subscribeInterfaceOptions)//
|
||||
.build()
|
||||
.build()
|
||||
|
||||
AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
NSDNettyManager.getInstance().startNSDNettyServerWithSN(context, object :
|
||||
@@ -110,11 +111,25 @@ class MoGoAutopilotProvider :
|
||||
|
||||
override fun onStartServer() {
|
||||
ToastUtils.showShort("司机端服务启动成功!")
|
||||
if (timer == null) {
|
||||
timer = Timer()
|
||||
}
|
||||
// 10s同步一次数据到乘客屏
|
||||
timer!!.schedule(object : TimerTask() {
|
||||
override fun run() {
|
||||
// 同步是否开启美化模式
|
||||
setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
setIgnoreConditionDraw(FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData)
|
||||
msgHandler.synMsgToAllClients()
|
||||
}
|
||||
}, 1000, 10000)
|
||||
invokeNettyConnResult("司机端服务启动成功!")
|
||||
}
|
||||
|
||||
override fun onStopServer() {
|
||||
ToastUtils.showLong("司机端服务停止!")
|
||||
timer?.cancel()
|
||||
timer = null
|
||||
invokeNettyConnResult("司机端服务停止!")
|
||||
}
|
||||
|
||||
@@ -130,36 +145,34 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
}, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
} else {
|
||||
// 乘客端默认接收绘制全局路径+引导线
|
||||
//FunctionBuildConfig.isDemoMode = true
|
||||
//FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true
|
||||
// "192.168.1.103"
|
||||
val options = AdasOptions
|
||||
.Builder()
|
||||
.setClient(true)
|
||||
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
|
||||
.setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext))
|
||||
.setClient(false)// 乘客端直连工控机改为false
|
||||
.build()
|
||||
AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
NSDNettyManager.getInstance()
|
||||
.searchAndConnectServer(context, MoGoAiCloudClientConfig.getInstance().sn,
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode),
|
||||
object : NettyClientListener<MogoProtocolMsg> {
|
||||
override fun onMessageResponseClient(
|
||||
msg: MogoProtocolMsg?,
|
||||
sign: String?,
|
||||
channel: Channel
|
||||
) {
|
||||
// 乘客端收到adas数据直接解析,后续分发解析后的数据流程同司机端
|
||||
msgHandler.handleMsgFromServer(msg, channel)
|
||||
}
|
||||
.searchAndConnectServer(context, MoGoAiCloudClientConfig.getInstance().sn,
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode),
|
||||
object : NettyClientListener<MogoProtocolMsg> {
|
||||
override fun onMessageResponseClient(
|
||||
msg: MogoProtocolMsg?,
|
||||
sign: String?,
|
||||
channel: Channel
|
||||
) {
|
||||
// 乘客端收到adas数据直接解析,后续分发解析后的数据流程同司机端
|
||||
msgHandler.handleMsgFromServer(msg, channel)
|
||||
}
|
||||
|
||||
override fun onClientStatusConnectChanged(
|
||||
statusCode: Int,
|
||||
sign: String?,
|
||||
channel: Channel
|
||||
) {
|
||||
msgHandler.handleClientConnStatus(statusCode, sign, channel)
|
||||
}
|
||||
})
|
||||
override fun onClientStatusConnectChanged(
|
||||
statusCode: Int,
|
||||
sign: String?,
|
||||
channel: Channel
|
||||
) {
|
||||
msgHandler.handleClientConnStatus(statusCode, sign, channel)
|
||||
}
|
||||
})
|
||||
}
|
||||
//////////////////////////////////注意先后顺序,AdasManager.getInstance().create后才可以设置监听/////////////////////////////////////////////
|
||||
|
||||
@@ -169,38 +182,9 @@ class MoGoAutopilotProvider :
|
||||
if (!AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
||||
}
|
||||
AdasManager.getInstance().setOnMultiDeviceListener(object : OnMultiDeviceListener {
|
||||
override fun onForwardingDriverIPCMessage(bytes: ByteArray?) {
|
||||
if (bytes == null)
|
||||
return
|
||||
// 发送数据给乘客端
|
||||
if (NSDNettyManager.getInstance().isServerStart) {
|
||||
msgHandler.synWriteTime()
|
||||
NSDNettyManager.getInstance()
|
||||
.sendMsgToAllClients(MogoProtocolMsg(NORMAL_DATA, bytes.size, bytes))
|
||||
} else {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "司机端Server未启动!")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onForwardingPassengerIPCMessage(bytes: ByteArray?) {
|
||||
if (bytes == null)
|
||||
return
|
||||
NSDNettyManager.getInstance()
|
||||
.sendMogoProtocolMsgToServer(
|
||||
MogoProtocolMsg(NORMAL_DATA, bytes.size, bytes),
|
||||
null
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
CallerLogger.i("$M_ADAS_IMPL$TAG", "initServer……")
|
||||
// 同步数据给工控机的服务
|
||||
AsyncDataToAutopilotServer.INSTANCE.initServer()
|
||||
// 同步是否开启美化模式
|
||||
setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
// 同步是否开启雨天模式
|
||||
setRainMode(FunctionBuildConfig.isRainMode)
|
||||
}
|
||||
@@ -324,7 +308,7 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
|
||||
override fun recordPackage(type: Int, id: Int, duration: Int, bduration: Int): Boolean {
|
||||
return AdasManager.getInstance().startRecordPackage(id,duration, type, bduration)
|
||||
return AdasManager.getInstance().startRecordPackage(id, duration, type, bduration)
|
||||
}
|
||||
|
||||
override fun stopRecord(type: Int, id: Int): Boolean {
|
||||
@@ -366,7 +350,6 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 演示模式(美化模式)设置只限定于鹰眼
|
||||
* isEnable = true 开启
|
||||
@@ -375,7 +358,12 @@ class MoGoAutopilotProvider :
|
||||
override fun setDemoMode(isEnable: Boolean) {
|
||||
// 同步给乘客端
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
val byteArray = if (isEnable) byteArrayOf(1) else byteArrayOf(0)
|
||||
val byteArray = if (isEnable) {
|
||||
"1;${System.currentTimeMillis()}".toByteArray()
|
||||
} else {
|
||||
"0;${System.currentTimeMillis()}".toByteArray()
|
||||
}
|
||||
// val byteArray = if (isEnable) byteArrayOf(1) else byteArrayOf(0)
|
||||
if (NSDNettyManager.getInstance().isServerStart) {
|
||||
NSDNettyManager.getInstance()
|
||||
.sendMsgToAllClients(
|
||||
@@ -394,7 +382,11 @@ class MoGoAutopilotProvider :
|
||||
override fun setIgnoreConditionDraw(isIgnore: Boolean) {
|
||||
// 同步给乘客端
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
val byteArray = if (isIgnore) byteArrayOf(1) else byteArrayOf(0)
|
||||
val byteArray = if (isIgnore) {
|
||||
"1;${System.currentTimeMillis()}".toByteArray()
|
||||
} else {
|
||||
"0;${System.currentTimeMillis()}".toByteArray()
|
||||
}
|
||||
if (NSDNettyManager.getInstance().isServerStart) {
|
||||
NSDNettyManager.getInstance()
|
||||
.sendMsgToAllClients(
|
||||
@@ -492,7 +484,10 @@ class MoGoAutopilotProvider :
|
||||
if (isEnable) {
|
||||
AdasManager.getInstance().sendAutoPilotModeReq(1, 0, null)
|
||||
} else {
|
||||
AdasManager.getInstance().sendAutoPilotModeReq(0, 0, null)
|
||||
// 司机屏才可关闭自动驾驶
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
AdasManager.getInstance().sendAutoPilotModeReq(0, 0, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,4 +17,6 @@ interface IMsgHandler {
|
||||
fun synWriteTime()
|
||||
|
||||
fun getTeleTimeStamp(): Long
|
||||
|
||||
fun synMsgToAllClients()
|
||||
}
|
||||
@@ -41,6 +41,12 @@ class TeleMsgHandler : IMsgHandler {
|
||||
@Volatile
|
||||
private var isReceiveSN = false
|
||||
|
||||
@Volatile
|
||||
private var demoModeTime = 0L
|
||||
|
||||
@Volatile
|
||||
private var timestamp = 0L
|
||||
|
||||
override fun handleMsgFromServer(msg: MogoProtocolMsg?, channel: Channel?) {
|
||||
msg?.let {
|
||||
when (it.protocolType) {
|
||||
@@ -57,11 +63,23 @@ class TeleMsgHandler : IMsgHandler {
|
||||
}
|
||||
}
|
||||
MogoProtocolMsg.SYNC_MODE_STATUS -> {
|
||||
FunctionBuildConfig.isDemoMode = when (it.body[0].toInt()) {
|
||||
1 -> true
|
||||
else -> false
|
||||
val content = String(it.body)
|
||||
if (content.contains(";")) {
|
||||
val strArr = content.split(";")
|
||||
if (strArr.size == 2) {
|
||||
val currTime = strArr[1].toLong()
|
||||
if (currTime > demoModeTime) {
|
||||
FunctionBuildConfig.isDemoMode = when (strArr[0]) {
|
||||
"1" -> true
|
||||
else -> false
|
||||
}
|
||||
demoModeTime = currTime
|
||||
invokeNettyConnResult("乘客屏收到的美化模式DemoMode为:${FunctionBuildConfig.isDemoMode}")
|
||||
} else {
|
||||
invokeNettyConnResult("乘客屏收到过时的美化模式DemoMode为:${FunctionBuildConfig.isDemoMode}")
|
||||
}
|
||||
}
|
||||
}
|
||||
invokeNettyConnResult("乘客屏收到的美化模式DemoMode为:${FunctionBuildConfig.isDemoMode}")
|
||||
}
|
||||
MogoProtocolMsg.REQ_MAC_ADDRESS -> {
|
||||
val carConfig = MessagePad.CarConfigResp.parseFrom(msg.body)
|
||||
@@ -86,11 +104,24 @@ class TeleMsgHandler : IMsgHandler {
|
||||
}
|
||||
// 美化模式是否忽略条件直接绘制
|
||||
11 -> {
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = when (it.body[0].toInt()) {
|
||||
1 -> true
|
||||
else -> false
|
||||
val content = String(it.body)
|
||||
if (content.contains(";")) {
|
||||
val strArr = content.split(";")
|
||||
if (strArr.size == 2) {
|
||||
val currTime = strArr[1].toLong()
|
||||
if (currTime > timestamp) {
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData =
|
||||
when (strArr[0]) {
|
||||
"1" -> true
|
||||
else -> false
|
||||
}
|
||||
timestamp = currTime
|
||||
invokeNettyConnResult("乘客屏收到的美化模式isIgnore为:${FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData}")
|
||||
} else {
|
||||
invokeNettyConnResult("乘客屏收到过时的美化模式isIgnore为:${FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData}")
|
||||
}
|
||||
}
|
||||
}
|
||||
invokeNettyConnResult("乘客屏收到的美化模式isIgnore为:${FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData}")
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
@@ -243,4 +274,20 @@ class TeleMsgHandler : IMsgHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun synMsgToAllClients() {
|
||||
if (NSDNettyManager.getInstance().isServerStart) {
|
||||
val carConfig = AdasManager.getInstance().carConfig
|
||||
if (carConfig != null) {
|
||||
val configArray = carConfig.toByteArray()
|
||||
|
||||
NSDNettyManager.getInstance().sendMsgToAllClients(
|
||||
MogoProtocolMsg(
|
||||
MogoProtocolMsg.REQ_MAC_ADDRESS,
|
||||
configArray.size, configArray
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.bindingcar;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
@@ -57,6 +58,7 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
*/
|
||||
@Override
|
||||
public void getBindingcarInfo(String macAddress, String widevineIDWithMd5) {
|
||||
Log.d("Upgrade", "getBindingcarInfo macAddress = " + macAddress + "--widevineIDWithMd5 = " + widevineIDWithMd5);
|
||||
mAddress = macAddress;
|
||||
mWidevineIDWithMd5 = widevineIDWithMd5;
|
||||
if (getScreenType() == 1) { //司机屏
|
||||
|
||||
@@ -61,7 +61,8 @@ class TraceManager : IMoGoCloudListener {
|
||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_PLANNING_ACTIONS)
|
||||
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_NATIVE_LEAK] =
|
||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_RECORD_NATIVE_LEAK)
|
||||
|
||||
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_CLOUD_V2N] =
|
||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_CLOUD_WEB_SOCKET_V2N)
|
||||
|
||||
|
||||
traceInfoCache[ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS] =
|
||||
@@ -84,6 +85,8 @@ class TraceManager : IMoGoCloudListener {
|
||||
ChainLogParam(true, "ADAS PLANNING 决策行为")
|
||||
traceInfoCache[ChainConstant.CHAIN_LINK_LOG_NATIVE_LEAK] =
|
||||
ChainLogParam(true, "Native Leak Record")
|
||||
traceInfoCache[ChainConstant.CHAIN_LINK_LOG_CLOUD_V2N] =
|
||||
ChainLogParam(true, "Cloud WebSocket V2N")
|
||||
|
||||
FileWriteManager.getInstance()
|
||||
.init(context, MoGoAiCloudClientConfig.getInstance().sn, pkgName, fwBuildMap)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.mogo.eagle.core.function.main
|
||||
|
||||
import android.app.Application
|
||||
import android.os.Build
|
||||
import com.kwai.koom.base.CommonConfig
|
||||
import com.kwai.koom.base.InitTask
|
||||
import com.kwai.koom.base.MonitorManager
|
||||
|
||||
object KoomInitTask : InitTask {
|
||||
override fun init(application: Application) {
|
||||
val config = CommonConfig.Builder()
|
||||
.setApplication(application) // Set application
|
||||
.setDebugMode(false)
|
||||
.setVersionNameInvoker { "1.0.0" } // Set version name, java leak feature use it
|
||||
.setSdkVersionMatch(
|
||||
Build.VERSION.SDK_INT <= 31 && Build.VERSION.SDK_INT
|
||||
>= Build.VERSION_CODES.LOLLIPOP
|
||||
) // Set if current sdk version is supported
|
||||
.build()
|
||||
|
||||
MonitorManager.initCommonConfig(config)
|
||||
.apply { onApplicationCreate() }
|
||||
}
|
||||
}
|
||||
@@ -304,7 +304,8 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
.setLoopInterval(50000)
|
||||
.setMonitorThreshold(16)
|
||||
.setNativeHeapAllocatedThreshold(0)
|
||||
.setEnableLocalSymbolic(true)
|
||||
.setIgnoredSoList(new String[]{"libart", "libc"})
|
||||
.setEnableLocalSymbolic(BuildConfig.DEBUG)
|
||||
.setLeakListener(leaks -> {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (!leaks.isEmpty()) {
|
||||
|
||||
@@ -84,7 +84,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
MoGoHandAdasMsgManager.getInstance(getBaseContext()).getConfig();
|
||||
}
|
||||
}
|
||||
},8000);
|
||||
},7000);
|
||||
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
@@ -107,7 +107,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
}
|
||||
|
||||
private void initKoom() {
|
||||
DefaultInitTask.INSTANCE.init(this);
|
||||
KoomInitTask.INSTANCE.init(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/notice_check_dialog_bg_color"
|
||||
android:minWidth="777px"
|
||||
android:minHeight="485px"
|
||||
android:minWidth="882px"
|
||||
android:minHeight="550px"
|
||||
app:roundLayoutRadius="30px">
|
||||
|
||||
<TextView
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvCameraList"
|
||||
android:layout_width="778px"
|
||||
android:layout_width="882px"
|
||||
android:layout_height="664px"
|
||||
android:layout_marginTop="24px"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -59,8 +59,8 @@
|
||||
|
||||
<com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
|
||||
android:id="@+id/svpPlayer"
|
||||
android:layout_width="778px"
|
||||
android:layout_height="487px"
|
||||
android:layout_width="882px"
|
||||
android:layout_height="550px"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -68,8 +68,8 @@
|
||||
<!--摄像头数据需要两种播放方式-->
|
||||
<TextureView
|
||||
android:id="@+id/textureView"
|
||||
android:layout_width="778px"
|
||||
android:layout_height="487px"
|
||||
android:layout_width="882px"
|
||||
android:layout_height="550px"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/shadowView"
|
||||
android:layout_width="778px"
|
||||
android:layout_width="882px"
|
||||
android:layout_height="120px"
|
||||
android:background="@drawable/camera_gradient_shadow_bg"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.commons.mvp.BaseFragment;
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.function.overview.InfStructureManager;
|
||||
@@ -89,6 +90,8 @@ public class OverviewMapFragment extends BaseFragment
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
// 主动查一次全局路径规划的数据
|
||||
CallerAutoPilotManager.INSTANCE.getGlobalPath();
|
||||
// queryInfStructure();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,10 @@ import com.mogo.cloud.passport.IMoGoTokenCallback
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.network.ParamsUtil
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_V2N
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD_SHOW
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CLOUD_V2N
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.data.map.*
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
@@ -76,6 +80,8 @@ import com.shuyu.gsyvideoplayer.model.VideoOptionModel
|
||||
import com.shuyu.gsyvideoplayer.player.IjkPlayerManager
|
||||
import com.shuyu.gsyvideoplayer.player.PlayerFactory
|
||||
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.android.asCoroutineDispatcher
|
||||
import roadwork.Road.RW_PB
|
||||
@@ -433,6 +439,14 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
|
||||
/**
|
||||
* V2XEvent事件回调
|
||||
*/
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_CLOUD_V2N,
|
||||
linkCode = CHAIN_LINK_CLOUD_SHOW,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_CLOUD_V2N,
|
||||
paramIndexes = [0],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
override fun onAck(event: V2XEvent) {
|
||||
Log.d("$M_V2X$TAG", "OK->: $event")
|
||||
when (event) {
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.mogo.eagle.core.function.v2x.redlightwarning;
|
||||
|
||||
public class LocationUtils {
|
||||
/**
|
||||
* 地球半径
|
||||
*/
|
||||
private static double EARTH_RADIUS = 6378.137;
|
||||
|
||||
private static double rad( double d ) {
|
||||
return d * Math.PI / 180.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两点间距离( 单位:米 )
|
||||
* @param lat1
|
||||
* @param lng1
|
||||
* @param lat2
|
||||
* @param lng2
|
||||
* @return
|
||||
*/
|
||||
public static double getDistance( double lat1, double lng1, double lat2, double lng2 ) {
|
||||
double radLat1 = rad( lat1 );
|
||||
double radLat2 = rad(lat2);
|
||||
double a = radLat1 - radLat2;
|
||||
double b = rad(lng1) - rad(lng2);
|
||||
double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2)
|
||||
+ Math.cos(radLat1) * Math.cos(radLat2)
|
||||
* Math.pow(Math.sin(b / 2), 2)));
|
||||
s = s * EARTH_RADIUS;
|
||||
s = Math.round(s * 10000d) / 10000d;
|
||||
s = s * 1000;
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 点到直线的最短距离的判断 点(x0,y0) 到由两点组成的线段(x1,y1) ,( x2,y2 ) <br>
|
||||
* ( 单位:米 )
|
||||
* @param x1
|
||||
* @param y1
|
||||
* @param x2
|
||||
* @param y2
|
||||
* @param x0
|
||||
* @param y0
|
||||
* @return
|
||||
*/
|
||||
public static double pointToLine( double x1, double y1, double x2, double y2, double x0, double y0 ) {
|
||||
double space;
|
||||
double a, b, c;
|
||||
a = getDistance(y1, x1, y2, x2);// 线段的长度
|
||||
b = getDistance(y1, x1, y0, x0);// (x1,y1)到点的距离
|
||||
c = getDistance(y2, x2, y0, x0);// (x2,y2)到点的距离
|
||||
if (c <= 0.000001 || b <= 0.000001) {
|
||||
space = 0;
|
||||
return space;
|
||||
}
|
||||
if (a <= 0.000001) {
|
||||
space = b;
|
||||
return space;
|
||||
}
|
||||
if (c * c >= a * a + b * b) {
|
||||
space = b;
|
||||
return space;
|
||||
}
|
||||
if (b * b >= a * a + c * c) {
|
||||
space = c;
|
||||
return space;
|
||||
}
|
||||
double p = (a + b + c) / 2;// 半周长
|
||||
double s = Math.sqrt(p * (p - a) * (p - b) * (p - c));// 海伦公式求面积
|
||||
space = 2 * s / a;// 返回点到线的距离(利用三角形面积公式求高)
|
||||
return space;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
@@ -23,6 +24,7 @@ import com.zhjt.service_biz.BizConfig
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.ceil
|
||||
import kotlin.math.floor
|
||||
import kotlin.math.min
|
||||
|
||||
|
||||
class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
@@ -98,10 +100,15 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
CallerLogger.d("$M_V2X$TAG", "speed is:$speed")
|
||||
if (speed <= 2.5f) return// 小于等于9km/h不处理
|
||||
// 由于到路口100m时回调不准,手动计算直线距离
|
||||
val distance = CallerMapUIServiceManager.getMapUIController()?.calculateLineDistance(
|
||||
MogoLatLng(it.latitude, it.longitude),
|
||||
MogoLatLng(trafficLightResult.lat, trafficLightResult.lon)
|
||||
) ?: 0f
|
||||
val roadResult = MogoTrafficLightManager.INSTANCE.getRoadResult()
|
||||
val distance = if (roadResult != null && roadResult.rectLatLngs.size >= 2) {
|
||||
getMinDistance(roadResult.rectLatLngs, it.latitude, it.longitude)
|
||||
} else {
|
||||
CallerMapUIServiceManager.getMapUIController()?.calculateLineDistance(
|
||||
MogoLatLng(it.latitude, it.longitude),
|
||||
MogoLatLng(trafficLightResult.lat, trafficLightResult.lon)
|
||||
) ?: 0f
|
||||
}
|
||||
CallerLogger.d(
|
||||
"$M_V2X$TAG",
|
||||
"路口经度为:${trafficLightResult.lon},纬度为:${trafficLightResult.lat};车的经度为:${it.longitude},纬度为:${it.latitude};两点距离为:${distance}"
|
||||
@@ -163,6 +170,19 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
}
|
||||
}
|
||||
|
||||
private fun getMinDistance(points: List<MogoLatLng>, lat: Double, lon: Double): Float {
|
||||
// 到路口100m时才计算,赋值一个较大值
|
||||
var minValue = 9999.9
|
||||
val size = points.size
|
||||
for (i in 0..size step 2) {
|
||||
if (i < size) {
|
||||
// 自车到0-1、2-3、4-5、6-7组成的线段的最小距离
|
||||
minValue = min(minValue, LocationUtils.pointToLine(points[i].lon, points[i].lat, points[i+1].lon, points[i+1].lat, lon, lat))
|
||||
}
|
||||
}
|
||||
return if (minValue > 9999) 0f else minValue.toFloat()
|
||||
}
|
||||
|
||||
/**
|
||||
* 闯红灯预警
|
||||
*/
|
||||
|
||||
@@ -151,6 +151,10 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
|
||||
return null
|
||||
}
|
||||
|
||||
fun getRoadResult(): RoadIDResult? {
|
||||
return roadIDResult
|
||||
}
|
||||
|
||||
fun turnLightToGreen(
|
||||
lightId: Int,
|
||||
crossingNo: String,
|
||||
|
||||
@@ -23,6 +23,7 @@ class ChainConstant {
|
||||
const val CHAIN_LINK_LOG_WEB_SOCKET_PLANNING_OBJECTS = 7
|
||||
const val CHAIN_LINK_LOG_WEB_SOCKET_PLANNING_ACTIONS = 8
|
||||
const val CHAIN_LINK_LOG_NATIVE_LEAK = 100
|
||||
const val CHAIN_LINK_LOG_CLOUD_V2N = 200
|
||||
|
||||
const val CHAIN_LINK_LOG_ADAS_INIT = "-eagleInitStatus"
|
||||
const val CHAIN_LINK_LOG_ADAS_GNSS = "-adasWsGnssInfo"
|
||||
@@ -34,6 +35,7 @@ class ChainConstant {
|
||||
const val CHAIN_LINK_LOG_ADAS_PLANNING_OBJECTS = "-adasWsPlanningObj"
|
||||
const val CHAIN_LINK_LOG_ADAS_PLANNING_ACTIONS = "-adasWsPlanningActions"
|
||||
const val CHAIN_LINK_LOG_RECORD_NATIVE_LEAK = "-eagleRecordNativeLeak"
|
||||
const val CHAIN_LINK_LOG_CLOUD_WEB_SOCKET_V2N = "-eagleCloudWSV2N"
|
||||
|
||||
const val CHAIN_ALIAS_CODE_MULTI_CONNECT = "CHAIN_ALIAS_CODE_MULTI_CONNECT"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_CAR_CONFIG = "CHAIN_ALIAS_CODE_CAR_CONFIG"
|
||||
@@ -60,6 +62,7 @@ class ChainConstant {
|
||||
const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_ERROR = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_ERROR"
|
||||
const val CHAIN_ALIAS_CODE_HTTP_DNS_CHANGED = "CHAIN_ALIAS_CODE_HTTP_DNS_CHANGED"
|
||||
const val CHAIN_ALIAS_CODE_FUNC_CONFIG_CHANGED = "CHAIN_ALIAS_CODE_FUNC_CONFIG_CHANGED"
|
||||
const val CHAIN_ALIAS_CODE_CLOUD_V2N = "CHAIN_ALIAS_CODE_CLOUD_V2N"
|
||||
|
||||
const val CHAIN_ALIAS_CODE_INIT_ON_MAP_LOADED = "CHAIN_ALIAS_CODE_INIT_ON_MAP_LOADED"
|
||||
const val CHAIN_ALIAS_CODE_INIT_ON_MAP_INIT = "CHAIN_ALIAS_CODE_INIT_ON_MAP_INIT"
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import android.os.SystemClock
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT
|
||||
@@ -10,6 +11,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LO
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants
|
||||
import kotlin.random.Random
|
||||
@@ -40,7 +42,7 @@ object CallerAutoPilotManager {
|
||||
/**
|
||||
* 断开与工控机的连接
|
||||
*/
|
||||
fun disconnectIpc(){
|
||||
fun disconnectIpc() {
|
||||
providerApi?.disconnectIpc()
|
||||
}
|
||||
|
||||
@@ -69,51 +71,70 @@ object CallerAutoPilotManager {
|
||||
* 发送红绿灯数据至工控机
|
||||
*/
|
||||
fun sendTrafficLightData(trafficLightResult: TrafficLightResult) {
|
||||
providerApi?.sendTrafficLightData(trafficLightResult)
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.sendTrafficLightData(trafficLightResult)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 轨迹下载请求
|
||||
*/
|
||||
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) {
|
||||
providerApi?.sendTrajectoryDownloadReq(autoPilotLine)
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.sendTrajectoryDownloadReq(autoPilotLine)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束自动驾驶
|
||||
*/
|
||||
fun cancelAutoPilot() {
|
||||
providerApi?.cancelAutoPilot()
|
||||
// 司机屏才能取消自动驾驶
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.cancelAutoPilot()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启域控制器录制bag包
|
||||
*/
|
||||
fun recordPackage() {
|
||||
providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt())
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt())
|
||||
}
|
||||
}
|
||||
|
||||
fun recordPackage(duration: Int){
|
||||
providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt(),duration)
|
||||
fun recordPackage(duration: Int) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt(), duration)
|
||||
}
|
||||
}
|
||||
|
||||
fun recordPackage(type: Int, id: Int) {
|
||||
providerApi?.recordPackage(type, id)
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.recordPackage(type, id)
|
||||
}
|
||||
}
|
||||
|
||||
fun recordPackage(type: Int, id: Int, duration: Int) {
|
||||
providerApi?.recordPackage(type, id, duration)
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.recordPackage(type, id, duration)
|
||||
}
|
||||
}
|
||||
|
||||
fun recordPackage(type: Int, id: Int, duration: Int,bduration: Int){
|
||||
providerApi?.recordPackage(type, id, duration, bduration)
|
||||
fun recordPackage(type: Int, id: Int, duration: Int, bduration: Int) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.recordPackage(type, id, duration, bduration)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止录制bag包
|
||||
*/
|
||||
fun stopRecord(type: Int, id: Int) {
|
||||
providerApi?.stopRecord(type, id)
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.stopRecord(type, id)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,8 +148,8 @@ object CallerAutoPilotManager {
|
||||
/**
|
||||
* ADAS日志开启状态
|
||||
*/
|
||||
fun isEnableLog(): Boolean{
|
||||
return providerApi?.isEnableLog()?:false
|
||||
fun isEnableLog(): Boolean {
|
||||
return providerApi?.isEnableLog() ?: false
|
||||
}
|
||||
|
||||
|
||||
@@ -136,11 +157,19 @@ object CallerAutoPilotManager {
|
||||
* speed单位:km/h
|
||||
*/
|
||||
fun setAutoPilotSpeed(speed: Int): Boolean {
|
||||
return providerApi?.setAutoPilotSpeed(speed) ?: false
|
||||
// 司机屏才可以设置最大速度
|
||||
return if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.setAutoPilotSpeed(speed) ?: false
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
fun recordCause(key: String?, name: String?, id: String?, reason: String?) {
|
||||
providerApi?.recordCause(key, name, id, reason)
|
||||
// 乘客屏不需要记录人工接管原因
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.recordCause(key, name, id, reason)
|
||||
}
|
||||
}
|
||||
|
||||
fun setIPCShutDown() {
|
||||
@@ -157,7 +186,9 @@ object CallerAutoPilotManager {
|
||||
* isEnable = false 关闭
|
||||
*/
|
||||
fun setDemoMode(isEnable: Boolean) {
|
||||
providerApi?.setDemoMode(isEnable)
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.setDemoMode(isEnable)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,8 +204,11 @@ object CallerAutoPilotManager {
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
*/
|
||||
fun setIPCDemoMode(isEnable: Boolean){
|
||||
providerApi?.setIPCDemoMode(isEnable)
|
||||
fun setIPCDemoMode(isEnable: Boolean) {
|
||||
// 司机屏才能控制美化模式(状态是在客户端维护、管理的)
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.setIPCDemoMode(isEnable)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,15 +216,18 @@ object CallerAutoPilotManager {
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
*/
|
||||
fun setRainMode(isEnable: Boolean){
|
||||
fun setRainMode(isEnable: Boolean) {
|
||||
providerApi?.setRainMode(isEnable)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
*/
|
||||
fun getBadCaseConfig(){
|
||||
providerApi?.getBadCaseConfig()
|
||||
fun getBadCaseConfig() {
|
||||
// 司机屏才能查询数据采集的配置
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.getBadCaseConfig()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -224,8 +261,10 @@ object CallerAutoPilotManager {
|
||||
/**
|
||||
* 发送工控机所有节点重启命令
|
||||
*/
|
||||
fun sendIpcReboot(){
|
||||
providerApi?.sendIpcReboot()
|
||||
fun sendIpcReboot() {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.sendIpcReboot()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -247,22 +286,22 @@ object CallerAutoPilotManager {
|
||||
/**
|
||||
* 查询工控机基础配置信息
|
||||
*/
|
||||
fun getCarConfig(){
|
||||
fun getCarConfig() {
|
||||
providerApi?.getCarConfig()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全局路径
|
||||
*/
|
||||
fun getGlobalPath(){
|
||||
fun getGlobalPath() {
|
||||
providerApi?.getGlobalPath()
|
||||
}
|
||||
|
||||
/**
|
||||
*获取协议版本
|
||||
*/
|
||||
fun getProtocolVersion(): Int{
|
||||
return providerApi?.getProtocolVersion() ?:0
|
||||
fun getProtocolVersion(): Int {
|
||||
return providerApi?.getProtocolVersion() ?: 0
|
||||
}
|
||||
|
||||
fun connectSpecifiedServer(ip: String) {
|
||||
|
||||
@@ -146,7 +146,9 @@ object CallerDevaToolsManager {
|
||||
*/
|
||||
fun downLoadPackage(downloadKey: String, downloadUrl: String) {
|
||||
devaToolsProviderApi?.downLoadPackage(downloadKey, downloadUrl)
|
||||
// Log.d("Update", "downloadKey = $downloadKey --- downloadUrl = $downloadUrl")
|
||||
// devaToolsProviderApi?.downLoadPackage("IntelligentPilot_v2.9.0.1002_20220725_[fPadLenovoOchBus-launcher-qa]_debug.apk", "https://scm-1255510688.cos.ap-beijing.myqcloud.com/test/com.mogo.launcher.f/2.9.0.1002/IntelligentPilot_v2.9.0.1002_20220725_[fPadLenovoOchBus-launcher-qa]_debug.apk")
|
||||
// devaToolsProviderApi?.downLoadPackage("IntelligentPilot_v2.10.0_20220921_[fPadLenovoOchBus-launcher-qa]_debug.apk", "http://datacollect-1255510688.cos.ap-beijing.myqcloud.com/eagle_eye_apk/a657ca047711d61fe43c5f54a2e3e2dd/IntelligentPilot_v2.10.0_20220921_%5BfPadLenovoOchBus-launcher-qa%5D_debug.apk?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDvGBZgjPVm09B7sjyTPL7najBQMB7baBb%26q-sign-time%3D1663916659%3B1666508659%26q-key-time%3D1663916659%3B1666508659%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3Dd2f97c31465c161ae3960166564affeca5464fbf&filename=/IntelligentPilot_v2.10.0_20220921_[fPadLenovoOchBus-launcher-qa]_debug.apk")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -147,6 +147,7 @@ public class DownloadService implements InitThread.InitCallBack, DownloadCallBac
|
||||
@Override
|
||||
public void progressCallBack(String url, int length) {
|
||||
IDownload iDownload = callBacks.get(url);
|
||||
Log.d(DOWN_LOAD_TAG, "iDownload progressCallBack = " + iDownload);
|
||||
if (iDownload != null) {
|
||||
iDownload.onProgress(url, length);
|
||||
}
|
||||
@@ -155,7 +156,7 @@ public class DownloadService implements InitThread.InitCallBack, DownloadCallBac
|
||||
@Override
|
||||
public void threadDownLoadFinished(String url, ThreadBean threadBean) {
|
||||
IDownload iDownload = callBacks.get(url);
|
||||
Log.d(DOWN_LOAD_TAG, "iDownload = " + iDownload);
|
||||
Log.d(DOWN_LOAD_TAG, "iDownload threadDownLoadFinished = " + iDownload);
|
||||
if (iDownload != null) {
|
||||
iDownload.onFinished(url, threadBean);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.mogo.eagle.core.utilcode.breakpoint.thread;
|
||||
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.breakpoint.Config.DOWN_LOAD_TAG;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.Config;
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.bean.FileBean;
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.bean.ThreadBean;
|
||||
@@ -51,6 +55,7 @@ public class DownloadThread extends Thread {
|
||||
raf = new RandomAccessFile(file,"rwd");
|
||||
raf.seek(start);
|
||||
//开始下载
|
||||
Log.d(DOWN_LOAD_TAG, "DownloadThread connection.getResponseCode() = " + connection.getResponseCode() + "---threadBean.getUrl() =" + threadBean.getUrl());
|
||||
if(connection.getResponseCode() == HttpURLConnection.HTTP_PARTIAL){
|
||||
inputStream = connection.getInputStream();
|
||||
byte[] bytes = new byte[1024];
|
||||
|
||||
Reference in New Issue
Block a user