Merge branch 'dev_robotaxi-d-app-module_2120_221017_2.12.0' into dev_robotaxi-d-app-module_2110_220915_2.11.0_gkjpb

This commit is contained in:
lixiaopeng
2022-10-20 19:13:45 +08:00
31 changed files with 208 additions and 122 deletions

View File

@@ -530,7 +530,6 @@ class MoGoAutopilotProvider :
* 向左变道
*/
override fun sendOperatorChangeLaneLeft() {
// Log.d("liyz", "MoGoAutopilotProvider sendOperatorChangeLaneLeft -------> ")
AdasManager.getInstance().sendOperatorCmdChangeLaneLeft()
}
@@ -538,7 +537,6 @@ class MoGoAutopilotProvider :
* 向右变道
*/
override fun sendOperatorChangeLaneRight() {
// Log.d("liyz", "MoGoAutopilotProvider sendOperatorChangeLaneRight -------> ")
AdasManager.getInstance().sendOperatorCmdChangeLaneRight()
}
@@ -546,7 +544,6 @@ class MoGoAutopilotProvider :
* 发送设置加速度 acc>0加速 acc<0减速 acc=0复位
*/
override fun sendOperatorSetAcceleratedSpeed(cc: Double) {
// Log.d("liyz", "MoGoAutopilotProvider sendOperatorSetAcceleratedSpeed cc $cc ")
AdasManager.getInstance().sendOperatorCmdSetAcceleratedSpeed(cc)
}
@@ -554,7 +551,6 @@ class MoGoAutopilotProvider :
* 鸣笛 value 1: honk 2: stop honking
*/
override fun sendOperatorSetHorn(value: Double) {
// Log.d("liyz", "MoGoAutopilotProvider sendOperatorSetHorn value $value ")
AdasManager.getInstance().sendOperatorCmdSetHorn(value)
}

View File

@@ -22,8 +22,8 @@ public interface BindingcarApiService {
* @return {@link BindingcarInfo}
*/
@Headers("Content-Type:application/json;charset=UTF-8")
@POST("pad/selectPadByMac")
Observable<BindingcarInfo> getBindingcarInfo(@Header("access_token") String access_token, @Body RequestBody requestBody);
@POST("eagleEye-mis/cmdbapi/pad/selectPadByMac")
Observable<BindingcarInfo> getBindingcarInfo(/*@Header("access_token") String access_token,*/ @Body RequestBody requestBody);
/**
* 绑定和修改绑定车机
@@ -31,7 +31,7 @@ public interface BindingcarApiService {
* @return {@link ModifyBindingcarInfo}
*/
@Headers("Content-Type:application/json;charset=UTF-8")
@POST("pad/updatePadByMac")
Observable<ModifyBindingcarInfo> modifyBindingcarInfo(@Header("access_token") String access_token, @Body RequestBody requestBody);
@POST("eagleEye-mis/cmdbapi/pad/updatePadByMac")
Observable<ModifyBindingcarInfo> modifyBindingcarInfo(/*@Header("access_token") String access_token,*/ @Body RequestBody requestBody);
}

View File

@@ -6,6 +6,7 @@ import android.util.Log;
import com.mogo.commons.constants.SharedPrefsConstants;
import com.mogo.eagle.core.data.bindingcar.BindingcarInfo;
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo;
import com.mogo.eagle.core.function.BindHostConst;
import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
import com.mogo.eagle.core.function.bindingcar.R;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
@@ -34,11 +35,10 @@ import okhttp3.RequestBody;
public class BindingcarNetWorkManager {
private static volatile BindingcarNetWorkManager requestNoticeManager;
private final BindingcarApiService mBindingcarApiService;
private String token = "c4a2f30cebf64972bcd11577e1c07f86"; //中台做了接口适配需要这个token
private static final String TAG = "BindingcarNetWorkManager";
private static final String TAG = "BindingcarNetManager";
private BindingcarNetWorkManager() {
mBindingcarApiService = MoGoRetrofitFactory.getInstance(HostConst.BINDING_SN_HOST)
mBindingcarApiService = MoGoRetrofitFactory.getInstance(BindHostConst.getBaseUrl())
.create(BindingcarApiService.class);
}
@@ -60,11 +60,13 @@ public class BindingcarNetWorkManager {
* @param macAddress mac地址
*/
public void getBindingcarInfo(Context context, String macAddress, String widevineIDWithMd5, int screenType) {
// String macAddress = "48:b0:2d:3a:bc:78";
// String macAddress1 = "48:b0:2d:3a:bc:78";
// String macAddress1 = "48:b0:2d:4d:b9:63";
// String sn = "X20202203105S688HZ";
BindingcarRequest request = new BindingcarRequest(macAddress, widevineIDWithMd5, screenType);
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
mBindingcarApiService.getBindingcarInfo(token, requestBody)
mBindingcarApiService.getBindingcarInfo(requestBody)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BindingcarInfo>() {
@@ -76,6 +78,7 @@ public class BindingcarNetWorkManager {
public void onNext(@NonNull BindingcarInfo info) {
if (info != null && info.getData() != null) {
CallerLogger.INSTANCE.d(TAG, "getBindingcarInfo onNext info.getData() =" + info.getData().toString());
Log.d(TAG, "getBindingcarInfo onNext info.getData() =" + info.getData().toString());
if (info.getData().getCompare().equals("0")) {
CallerHmiManager.INSTANCE.showBindingcarDialog();
} else if (info.getData().getCompare().equals("3")) {
@@ -84,10 +87,12 @@ public class BindingcarNetWorkManager {
TipToast.shortTip("当前工控机没有入库");
}
//根据车辆类型切换不同的车辆模型
//根据车辆类型切换不同的车辆模型,只针对红旗做处理
// if (info.getData().getVendor().equals("一汽红旗")) { //TODO
// CallerHDMapManager.INSTANCE.changeCurrentIcon(R.raw.xiaobache);
// } else if (info.getData().getVendor().equals("东风")) {
// CallerHDMapManager.INSTANCE.changeCurrentIcon(R.raw.hq_h9);
// }
// else if (info.getData().getVendor().equals("东风汽车集团")) {
// CallerHDMapManager.INSTANCE.changeCurrentIcon(R.raw.chuzuche);
// } else if (info.getData().getVendor().equals("金旅星辰")) {
// CallerHDMapManager.INSTANCE.changeCurrentIcon(R.raw.xiaobache);
@@ -118,7 +123,7 @@ public class BindingcarNetWorkManager {
public void modifyBindingcar(String macAddress, String widevineIDWithMd5, BindingcarCallBack callBack, int screenType) {
BindingcarRequest request = new BindingcarRequest(macAddress, widevineIDWithMd5, screenType);
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
mBindingcarApiService.modifyBindingcarInfo(token, requestBody)
mBindingcarApiService.modifyBindingcarInfo(requestBody)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<ModifyBindingcarInfo>() {
@@ -130,6 +135,7 @@ public class BindingcarNetWorkManager {
public void onNext(@NonNull ModifyBindingcarInfo info) {
if (info != null) {
callBack.callBackResult(info);
Log.d(TAG, "modifyBindingcar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString());
CallerLogger.INSTANCE.d(TAG, "modifyBindingcar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString());
}
}

View File

@@ -20,6 +20,7 @@ import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_LCW
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_LIMIT_SPEED_SET
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_LTA
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_OPT_LINE
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_PNC_ACTIONS
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RAIN_MODE
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RTS
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_SLW
@@ -88,6 +89,7 @@ class FuncConfigConst {
foundationSubList.add(SubBiz(BIZ_LIMIT_SPEED_SET, lock = false, state = true, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_BYPASS, lock = false, state = true, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_AUTOPILOT_LANE_SELECTION, lock = false, state = true, dependNode = "", data = ""))
foundationSubList.add(SubBiz(BIZ_PNC_ACTIONS, lock = false, state = true, dependNode = "", data = ""))
businessList.add(Business(FOUNDATION,foundationSubList))
return FuncConfig(0, AppUtils.getAppVersionCode(), getChannelCode(), getEnv(), businessList)

View File

@@ -49,9 +49,19 @@ internal class GpsImpl(ctx: Context): IFlow<GpsStatus>(ctx) {
false
}
private val onStateListener = object : IAppStateListener {
override fun onAppStateChanged(isForeground: Boolean) {
if (isForeground) {
send(isLocationEnabled(), isGrandFineLocation())
}
}
}
override fun onCreate() {
val isGranted = isGrandFineLocation()
AppStateManager.registerAppStateListener(onStateListener)
send(isLocationEnabled(), isGranted)
if (!isGranted) {
PermissionUtils.requestAccessFineLocation(object : SimpleCallback {
@@ -88,6 +98,7 @@ internal class GpsImpl(ctx: Context): IFlow<GpsStatus>(ctx) {
} catch (t: Throwable) {
t.printStackTrace()
}
AppStateManager.unRegisterAppStateListener(onStateListener)
}
}

View File

@@ -7,6 +7,8 @@ import androidx.appcompat.content.res.AppCompatResources
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.autopilot.pnc.PncActionsHelper
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_PNC_ACTIONS
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATION
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.trafficlight.currentRoadTrafficLight
import com.mogo.eagle.core.data.trafficlight.isRed
@@ -19,6 +21,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningAction
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.zhjt.service_biz.BizConfig
import kotlinx.android.synthetic.main.view_pnc_actions.view.*
import mogo.telematics.pad.MessagePad
@@ -67,6 +70,7 @@ class PncActionsView @JvmOverloads constructor(
}
}
@BizConfig(FOUNDATION, "", BIZ_PNC_ACTIONS)
override fun pncActions(planningActionMsg: MessagePad.PlanningActionMsg) {
mAutoPilotStatusInfo?.let {
if (it.state == STATUS_AUTOPILOT_RUNNING) {

View File

@@ -6,7 +6,6 @@ import android.content.res.TypedArray
import android.graphics.*
import android.util.AttributeSet
import android.util.DisplayMetrics
import android.util.Log
import android.view.View
import android.view.animation.LinearInterpolator
import android.view.animation.OvershootInterpolator
@@ -81,7 +80,6 @@ class CircularProgressView @JvmOverloads constructor(
mRectF = RectF(mRectL.toFloat(), mRectT.toFloat(), (mRectL + mRectLength).toFloat(),
(mRectT + mRectLength).toFloat())
Log.d(TAG, "onMeasure:" + mRectF.toString() + "," + "width:" + measuredWidth.toString() + "," + "PaddingLeft:" + getPaddingLeft().toString())
}
/**
@@ -107,7 +105,6 @@ class CircularProgressView @JvmOverloads constructor(
override fun onDraw(canvas: Canvas?) {
super.onDraw(canvas)
Log.d(TAG, "onDraw")
canvas?.let {
mRectF?.let { it1 -> it.drawArc(it1, 0.0f, 360.0f, false, mBackPaint) }
mRectF?.let { it1 ->
@@ -154,7 +151,6 @@ class CircularProgressView @JvmOverloads constructor(
val animator = ValueAnimator.ofInt(mProgress, progress)
animator.addUpdateListener {
mProgress = it.animatedValue as Int
Log.d(TAG, "setProgress" + mProgress.toString())
invalidate()
}
animator.interpolator = LinearInterpolator()

View File

@@ -6,10 +6,9 @@ import android.view.*
import android.widget.*
import com.mogo.commons.*
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.R.drawable
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.*
import com.mogo.map.*
import com.mogo.map.uicontroller.*
import com.mogo.map.uicontroller.VisualAngleMode.MODE_MEDIUM_SIGHT
import com.mogo.module.common.constants.*
import kotlinx.android.synthetic.main.view_perspective_switch.view.*

View File

@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.hmi.ui.widget;
import android.content.Context;
import android.graphics.BlurMaskFilter;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.RotateAnimation;
@@ -54,12 +53,10 @@ public class SteeringWheelView extends ConstraintLayout {
public SteeringWheelView(@NonNull Context context) {
super(context);
Log.d(TAG, "1");
}
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
Log.d(TAG, "2");
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this);
} else {
@@ -94,12 +91,10 @@ public class SteeringWheelView extends ConstraintLayout {
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
Log.d(TAG, "3");
}
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
Log.d(TAG, "4");
}
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() {
@@ -127,7 +122,6 @@ public class SteeringWheelView extends ConstraintLayout {
int state = autopilotStatusInfo.getState();
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "state = %s", state);
if (autopilotIV != null) {
Log.d(TAG, "autopilotIV != null");
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
// TODO
@@ -151,7 +145,7 @@ public class SteeringWheelView extends ConstraintLayout {
}
}
} else {
Log.d(TAG, "autopilotIV=null");
CallerLogger.INSTANCE.d(TAG, "autopilotIV=null");
}
}
});
@@ -192,7 +186,6 @@ public class SteeringWheelView extends ConstraintLayout {
*/
@Override
public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) {
Log.d(TAG, "车辆转向灯:" + lightSwitch.toString());
}
/**
@@ -201,7 +194,6 @@ public class SteeringWheelView extends ConstraintLayout {
*/
@Override
public void onAutopilotBrakeLightData(boolean brakeLight) {
Log.d(TAG, "刹车灯:" + String.valueOf(brakeLight));
}
/**
@@ -219,7 +211,6 @@ public class SteeringWheelView extends ConstraintLayout {
*/
@Override
public void onAutopilotSteeringData(float steering) {
Log.d(TAG, "steering原始值====" + String.valueOf(steering));
if (Math.abs(steering) < 1) {
steering = 0;
}
@@ -227,7 +218,6 @@ public class SteeringWheelView extends ConstraintLayout {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
Log.d(TAG, "steering忽略小数点后====" + String.valueOf((int) steeringValue));
if (steeringTVL != null && steeringValue > 0) {
steeringTVR.setVisibility(View.INVISIBLE);
steeringTVL.setVisibility(View.VISIBLE);
@@ -237,7 +227,7 @@ public class SteeringWheelView extends ConstraintLayout {
steeringTVR.setVisibility(View.VISIBLE);
steeringTVR.setText(String.valueOf((int) -steeringValue) + "°");
} else {
Log.d(TAG, "onAutopilotSteeringData error");
CallerLogger.INSTANCE.d(TAG, "onAutopilotSteeringData error");
}
animationWithSteeringData(-steeringValue);
if (steeringCircularV != null) {
@@ -260,7 +250,7 @@ public class SteeringWheelView extends ConstraintLayout {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
Log.d(TAG, "乘客屏档位" + gear.toString());
CallerLogger.INSTANCE.d(TAG, "乘客屏档位" + gear.toString());
if (tapPositionView != null) {
tapPositionView.updateWithGear(gear);
}
@@ -288,7 +278,6 @@ public class SteeringWheelView extends ConstraintLayout {
* @param steering
*/
private void animationWithSteeringData(float steering) {
Log.d(TAG, "方向盘转动" + String.valueOf(steering));
rotateAnimation = new RotateAnimation(fromDegrees, steering,
RotateAnimation.RELATIVE_TO_SELF, 0.5f,
RotateAnimation.RELATIVE_TO_SELF, 0.5f);

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.hmi.ui.widget
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.widget.RelativeLayout
@@ -53,7 +52,6 @@ class V2XWarningView @JvmOverloads constructor(
* @param closeTime 倒计时
*/
fun showWarning(direction: WarningDirectionEnum, closeTime: Long) {
Log.d(TAG, "预警红边:预警方向->$direction 预警倒计时->$closeTime")
UiThreadHandler.post {
// 如果传入的不是关闭显示,则设置倒计时,定时关闭红框警示
if (direction != ALERT_WARNING_NON) {

View File

@@ -26,12 +26,17 @@ class VipIdentificationView @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
val lp = this.layoutParams as LayoutParams
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_bus).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_bus).toInt()
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_bus_passenger).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_passenger).toInt()
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_taxi_passenger).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_passenger).toInt()
} else {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_taxi).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_taxi).toInt()
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top).toInt()
}
this.layoutParams = lp
invalidate()

View File

@@ -215,7 +215,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) { //向上长按 开启自动驾驶
long currentTime = System.currentTimeMillis() / (1000);
long oldTime = SharedPrefsMgr.getInstance(getContext()).getLong("old_time_up", 0);
// Log.d("liyz", "time = " + (currentTime - oldTime));
if (currentTime - oldTime > 6) {
SharedPrefsMgr.getInstance(getContext()).putLong("old_time_up", System.currentTimeMillis() / 1000);
// ToastUtils.showShort("长按 ↑↑↑ 开启自动驾驶");
@@ -456,7 +455,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
Method isConnectedMethod = BluetoothDevice.class.getDeclaredMethod("isConnected", (Class[]) null);
isConnectedMethod.setAccessible(true);
boolean isConnected = (boolean) isConnectedMethod.invoke(device, (Object[]) null);
// Log.e("liyz", "showBondedDevice Name:" + device.getName() + " Mac:" + device.getAddress() + "---isConnected = " + isConnected);
mAreadlyConnectedList.add(device);
if (device.getName().equals("JX-05")) { //后面魔戒可能不使用了
SharedPrefsMgr.getInstance(getContext()).putString("BT_MAC", device.getAddress());
@@ -486,7 +484,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
* 主动连接最近的一次连接
*/
private void connectBluetooth() {
// Log.d("liyz", "connectBluetooth ----> size() = " + mAreadlyConnectedList.size());
if (mAreadlyConnectedList.size() > 0) {
try {
Method method = BluetoothDevice.class.getMethod("createBond");
@@ -498,7 +495,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
}
}
// Log.d("liyz", "connectBluetooth macAddress = " + macAddress + "---pos = " + pos);
if (mAreadlyConnectedList.size() > pos && (pos >= 0)) {
method.invoke(mAreadlyConnectedList.get(pos));
}

View File

@@ -45,13 +45,11 @@ public class BluetoothMonitorReceiver extends BroadcastReceiver {
case BluetoothDevice.ACTION_ACL_CONNECTED:
// Toast.makeText(context, "蓝牙设备已连接", Toast.LENGTH_SHORT).show();
// Log.d("liyz", "蓝牙设备已连接 ----> ");
// SharedPrefsMgr.getInstance(context).putBoolean("BLUETOOTH", true);
break;
case BluetoothDevice.ACTION_ACL_DISCONNECTED:
// SharedPrefsMgr.getInstance(context).putBoolean("BLUETOOTH", false);
// Log.d("liyz", "蓝牙设备已断开 ----> ");
// Toast.makeText(context, "蓝牙设备已断开", Toast.LENGTH_SHORT).show();
EventBus.getDefault().post(new ConnectBluetoothEvent());
break;

View File

@@ -93,7 +93,7 @@ object AiRoadMarker {
Logger.d(TAG, "--- consumer --- 3 ---: isTrigger => $isTrigger")
if (isTrigger) {
marker.set(top)
marker(top)
marker(top, true)
} else {
synchronized(markers) {
markers.remove(top)
@@ -187,7 +187,7 @@ object AiRoadMarker {
}
}
fun marker(marker: Marker) {
fun marker(marker: Marker, drawMarker: Boolean) {
val location = carLocation.get() ?: return
//施工中心点前方的自车行驶方向上300米距离
val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), 300f)
@@ -239,7 +239,9 @@ object AiRoadMarker {
return
}
removeLine()
marker.entity?.apply { V2XAiRoadEventMarker.drawMarkers(this) }
if (drawMarker) {
marker.entity?.apply { V2XAiRoadEventMarker.drawMarkers(this) }
}
val evaluator = ArgbEvaluator()
val interceptor = DecelerateInterpolator(1.5f)
val total = points.size
@@ -275,11 +277,39 @@ object AiRoadMarker {
}
fun unMarker(marker: Marker) {
Logger.d(TAG, "--- unMarker ---")
markers -= marker
removeLine()
V2XAiRoadEventMarker.removeMarkers(null)
}
fun clear() {
hideLine()
// V2XAiRoadEventMarker.removeMarkers(null)
}
fun restore() {
showLine()
val marker = marker.get()
if (marker != null) {
marker(marker, false)
}
}
private fun hideLine() {
val old = line.get()
if (old != null && !old.isDestroyed) {
old.isVisible = false
}
}
private fun showLine() {
val old = line.get()
if (old != null && !old.isDestroyed) {
old.isVisible = true
}
}
private fun isOutOfRange(markerLon: Double, markerLat: Double, carLon: Double, carLat: Double, carAngle: Double): Boolean {
return !isFrontOfCar(markerLon, markerLat, carLon, carLat, carAngle)
}
@@ -293,8 +323,8 @@ object AiRoadMarker {
val poi_lat: Double,
val poi_lon: Double,
val poi_angle: Double,
val polygon: List<androidx.core.util.Pair<Double, Double>>?,
var farthestPoint: androidx.core.util.Pair<Double, Double>? = null,
val polygon: List<Pair<Double, Double>>?,
var farthestPoint: Pair<Double, Double>? = null,
var entity: V2XRoadEventEntity? = null
) {

View File

@@ -23,7 +23,7 @@ import java.util.Objects;
public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
private AiRoadMarker.Marker mMarker;
private static AiRoadMarker.Marker mMarker;
@Override
public void drawPOI(V2XRoadEventEntity entity) {
@@ -83,7 +83,7 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
MarkerLocation location = noveltyInfo.getLocation();
AiRoadMarker.Marker m = new AiRoadMarker.Marker(gpsLocation.second, gpsLocation.first, location.getAngle(), polygons, null, entity);
mMarker = m;
AiRoadMarker.INSTANCE.marker(m);
AiRoadMarker.INSTANCE.marker(m, true);
}
}

View File

@@ -120,8 +120,7 @@ class TrafficLightNetWorkModel {
}
loader {
apiCall {
MoGoRetrofitFactory.getInstanceNoCallAdapter("http://dzt-qa-city.zhidaozhixing.com")
.create(TrafficLightApiService::class.java).changeLight(map)
getNetWorkApi().changeLight(map)
}
}
onSuccess {

View File

@@ -245,9 +245,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
v2xType, alertContent, ttsContent, tag,
object : IMoGoWarningStatusListener {
override fun onShow() {}
override fun onDismiss() {
resetConditions()
}
override fun onDismiss() {}
},
true,
5000L