Merge branch 'dev_robotaxi-d-app-module_290_220715_2.9.0' into dev_robotaxi-d-app-module_290_220715_2.9.0_interface_subscribe
This commit is contained in:
@@ -301,17 +301,17 @@ public class BusPassengerModel {
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
int state = autopilotStatusInfo.getState();
|
||||
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "state = %s", state );
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
//2022.7.20 自动驾驶更换成带档位的
|
||||
// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotEnable();
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotDisable();
|
||||
}
|
||||
// if (autopilotStatusInfo == null) return;
|
||||
// int state = autopilotStatusInfo.getState();
|
||||
// CallerLogger.INSTANCE.d( M_BUS_P + TAG, "state = %s", state );
|
||||
// if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
// //2022.7.20 自动驾驶更换成带档位的
|
||||
//// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
// } else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
//// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotEnable();
|
||||
// } else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
//// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotDisable();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -137,7 +137,9 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
|
||||
@Override
|
||||
public void routeResult(List<LatLng> models, int haveArrivedIndex) {
|
||||
runOnUIThread(() -> mView.routeResult(models,haveArrivedIndex));
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "routeResult:" + models.size()
|
||||
+ " haveArrivedIndex = "+haveArrivedIndex);
|
||||
mView.routeResult(models,haveArrivedIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.och.bus.passenger.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -71,6 +70,8 @@ public class BusPassengerMapDirectionView
|
||||
private List<Marker> mLineMarkers = new ArrayList<>();
|
||||
|
||||
private IBusPassengerMapViewCallback mIBusPassengerMapViewCallback;
|
||||
private BitmapDescriptor mArrivedRes;
|
||||
private BitmapDescriptor mUnArrivedRes;
|
||||
|
||||
public BusPassengerMapDirectionView(Context context) {
|
||||
this(context, null);
|
||||
@@ -133,6 +134,9 @@ public class BusPassengerMapDirectionView
|
||||
mEndMarker = mAMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_end_point)));
|
||||
|
||||
mArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrow_arrived);
|
||||
mUnArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrow_un_arrive);
|
||||
|
||||
// 加载自定义样式
|
||||
CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions()
|
||||
.setEnable(true)
|
||||
@@ -182,12 +186,12 @@ public class BusPassengerMapDirectionView
|
||||
if (location == null) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "onCarLocationChanged2 :" + location.getLatitude() + ":" + location.getLongitude());
|
||||
// CallerLogger.INSTANCE.d(M_BUS_P + TAG, "onCarLocationChanged2 :" + location.getLatitude() + ":" + location.getLongitude());
|
||||
LatLng currentLatLng = new LatLng(location.getLatitude(), location.getLongitude());
|
||||
|
||||
//更新车辆位置
|
||||
if (mCarMarker != null) {
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "location.getBearing() = " + location.getBearing());
|
||||
// CallerLogger.INSTANCE.d(M_BUS_P + TAG, "location.getBearing() = " + location.getBearing());
|
||||
mCarMarker.setRotateAngle(360 - location.getBearing());
|
||||
mCarMarker.setPosition(currentLatLng);
|
||||
mCarMarker.setToTop();
|
||||
@@ -202,7 +206,7 @@ public class BusPassengerMapDirectionView
|
||||
}
|
||||
boundsBuilder.include(currentLatLng);
|
||||
//第二个参数为四周留空宽度
|
||||
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(),50,50,50,50));
|
||||
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(),100,100,100,100));
|
||||
|
||||
}else {
|
||||
//设置希望展示的地图缩放级别
|
||||
@@ -221,13 +225,15 @@ public class BusPassengerMapDirectionView
|
||||
}
|
||||
if (mAMap != null) {
|
||||
|
||||
addRouteColorList();
|
||||
|
||||
if (mCoordinatesLatLng.size() > 2) {
|
||||
|
||||
//设置线段纹理
|
||||
PolylineOptions polylineOptions = new PolylineOptions();
|
||||
polylineOptions.addAll(mCoordinatesLatLng);
|
||||
polylineOptions.useGradient(true);
|
||||
polylineOptions.width(10); //线段宽度
|
||||
polylineOptions.width(14); //线段宽度
|
||||
polylineOptions.setUseTexture(true);
|
||||
polylineOptions.lineCapType(PolylineOptions.LineCapType.LineCapRound);
|
||||
polylineOptions.setCustomTextureList(textureList);
|
||||
polylineOptions.setCustomTextureIndex(texIndexList);
|
||||
@@ -249,9 +255,9 @@ public class BusPassengerMapDirectionView
|
||||
texIndexList.clear();
|
||||
for (int i = 0; i < mCoordinatesLatLng.size(); i++){
|
||||
if (i <= mHaveArrivedIndex){
|
||||
textureList.add(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrow_arrived));
|
||||
textureList.add(mArrivedRes);
|
||||
}else {
|
||||
textureList.add(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrow_un_arrive));
|
||||
textureList.add(mUnArrivedRes);
|
||||
}
|
||||
texIndexList.add(i);
|
||||
}
|
||||
@@ -330,7 +336,6 @@ public class BusPassengerMapDirectionView
|
||||
mCoordinatesLatLng.clear();
|
||||
mCoordinatesLatLng.addAll(latLngs);
|
||||
mHaveArrivedIndex = haveArrivedIndex;
|
||||
addRouteColorList();
|
||||
}
|
||||
|
||||
public void clearLineMarkers(){
|
||||
|
||||
@@ -142,7 +142,6 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
|
||||
public void routeResult(List<LatLng> latLngList,int haveArrivedIndex) {
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "routeResult:" + latLngList.size());
|
||||
if (latLngList.size() > 0) {
|
||||
drawablePolyline(latLngList,haveArrivedIndex);
|
||||
} else {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<shape android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="#F2F7FF"
|
||||
android:startColor="#E6ECF9"
|
||||
android:endColor="#F2F6FF"
|
||||
android:startColor="#E1E7F5"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
android:id="@+id/steering_wheel"
|
||||
android:layout_width="@dimen/dp_490"
|
||||
android:layout_height="@dimen/dp_490"
|
||||
android:layout_marginLeft="@dimen/dp_22"
|
||||
android:layout_marginLeft="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_88"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -52,7 +52,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_56"
|
||||
android:layout_marginTop="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:text="@string/bus_p_cur_station_title"
|
||||
android:textColor="@color/bus_p_panel_cur_txt_color"
|
||||
@@ -65,7 +65,7 @@
|
||||
android:id="@+id/bus_p_cur_station_name"
|
||||
android:layout_width="@dimen/bus_p_curent_station_txt_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/edge_view"
|
||||
android:layout_width="716px"
|
||||
android:layout_width="720px"
|
||||
android:layout_height="match_parent"
|
||||
app:shadowColor="@color/bus_p_route_view_left_edge_shadow"
|
||||
app:xOffset="0px"
|
||||
|
||||
@@ -392,10 +392,10 @@ public class BusOrderModel {
|
||||
//根据围栏判断,是否到达起点
|
||||
private void judgeStartStation(Location location) {
|
||||
|
||||
if (backgroundCurrentStationIndex -1 < 0 || backgroundCurrentStationIndex > stationList.size()-1){
|
||||
if (backgroundCurrentStationIndex +1 > stationList.size() - 1 ){
|
||||
return;
|
||||
}
|
||||
BusStationBean upcomingStation = stationList.get( backgroundCurrentStationIndex);
|
||||
BusStationBean upcomingStation = stationList.get( backgroundCurrentStationIndex +1);
|
||||
|
||||
double startLon = upcomingStation.getGcjLon();
|
||||
double startLat = upcomingStation.getGcjLat();
|
||||
|
||||
@@ -165,7 +165,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
int state = autopilotStatusInfo.getState();
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "onStateChange: " + state + "currentAutopilotStatus = " + currentAutopilotStatus);
|
||||
// CallerLogger.INSTANCE.d(M_BUS + TAG, "onStateChange: " + state + "currentAutopilotStatus = " + currentAutopilotStatus);
|
||||
switch (state) {
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE:
|
||||
if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
|
||||
@@ -239,10 +239,10 @@ public class SlidePanelView extends View {
|
||||
}
|
||||
|
||||
private void startBlockBackAnim() {
|
||||
ObjectAnimator animator = ObjectAnimator.ofInt(this, "blockOffset", blockOffset, 0);
|
||||
animator.setInterpolator(new DecelerateInterpolator());
|
||||
animator.setDuration(1000 * blockOffset / getWidth());
|
||||
animator.start();
|
||||
ObjectAnimator blockBackanimator = ObjectAnimator.ofInt(this, "blockOffset", blockOffset, 0);
|
||||
blockBackanimator.setInterpolator(new DecelerateInterpolator());
|
||||
blockBackanimator.setDuration(1000 * blockOffset / getWidth());
|
||||
blockBackanimator.start();
|
||||
lastX = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单轮询
|
||||
* 订单轮询 初始化主Fragment的Presenter init 调用
|
||||
*/
|
||||
public void startOrStopOrderLoop(){
|
||||
if (NetworkUtils.isConnected(mContext)) {
|
||||
@@ -202,6 +202,9 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭订单轮训 页面摧毁时
|
||||
*/
|
||||
public void release() {
|
||||
startOrStopOrderLoop(false);
|
||||
startOrStopQueryOrderRemaining(false);
|
||||
@@ -255,6 +258,11 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
CallLimitingVelocityListenerManager.INSTANCE.removeListener(limitingVelocityListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单轮训
|
||||
* @param start true 开启订单轮训
|
||||
* false 关闭订单轮训
|
||||
*/
|
||||
private void startOrStopOrderLoop(boolean start) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "startOrStopOrderLoop() " + start);
|
||||
if (start) {
|
||||
@@ -505,7 +513,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
int state = autopilotStatusInfo.getState();
|
||||
CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "state = %s", state );
|
||||
// CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "state = %s", state );
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
if (mCurrentOCHOrder != null
|
||||
@@ -671,6 +679,9 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单剩余里程和时间
|
||||
*/
|
||||
public void queryOrderRemaining(){
|
||||
if (mCurrentOCHOrder == null) return;
|
||||
TaxiPassengerServiceManager.getInstance().queryOrderRemaining(mContext, mCurrentOCHOrder.orderNo, new TaxiPassengerServiceCallback<TaxiPassengerOrderQueryRemainingResp>() {
|
||||
|
||||
@@ -126,7 +126,9 @@ public class TaxiPassengerModelLoopManager {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 轮训查下 查询订单剩余里程和时间
|
||||
*/
|
||||
public void startQueryOrderRemainingtLoop() {
|
||||
if (mQueryOrderRemainingDisposable != null && !mQueryOrderRemainingDisposable.isDisposed()) {
|
||||
return;
|
||||
|
||||
@@ -119,7 +119,8 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(Location location) {
|
||||
LeftMenuOpen.INSTANCE.callCallBack(-1,-1,location.getSpeed());
|
||||
// 速度不用展示
|
||||
// LeftMenuOpen.INSTANCE.callCallBack(-1,-1,location.getSpeed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -77,7 +77,9 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
|
||||
@Override
|
||||
public void routeResultByServer(List<LatLng> models, int haveArrivedIndex) {
|
||||
if (models == null) return;
|
||||
runOnUIThread(() -> mView.routeResultByServer(models,haveArrivedIndex));
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "routeResultByServer:" + models.size()
|
||||
+ " haveArrivedIndex = " + haveArrivedIndex);
|
||||
mView.routeResultByServer(models,haveArrivedIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -66,6 +66,9 @@ public class TaxiPassengerMapDirectionView
|
||||
List<BitmapDescriptor> textureList = new ArrayList<>();
|
||||
List<Integer> texIndexList = new ArrayList<>();
|
||||
|
||||
private BitmapDescriptor mArrivedRes;
|
||||
private BitmapDescriptor mUnArrivedRes;
|
||||
|
||||
private ITaxiPassengerMapViewCallback mITaxiPassengerMapViewCallback;
|
||||
|
||||
public TaxiPassengerMapDirectionView(Context context) {
|
||||
@@ -129,6 +132,9 @@ public class TaxiPassengerMapDirectionView
|
||||
mEndMarker = mAMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_view_dir_end)));
|
||||
|
||||
mArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_arrow_arrived);
|
||||
mUnArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_arrow_un_arrive);
|
||||
|
||||
// 加载自定义样式
|
||||
CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions()
|
||||
.setEnable(true)
|
||||
@@ -189,7 +195,7 @@ public class TaxiPassengerMapDirectionView
|
||||
boundsBuilder.include(endLatLng);
|
||||
//第二个参数为四周留空宽度
|
||||
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(), 100,100,100,100));
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "onCarLocationChanged2--moveCamera :" + location.getLatitude()+", "+location.getLongitude());
|
||||
// CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "onCarLocationChanged2--moveCamera :" + location.getLatitude()+", "+location.getLongitude());
|
||||
|
||||
} else {
|
||||
//设置希望展示的地图缩放级别
|
||||
@@ -234,15 +240,13 @@ public class TaxiPassengerMapDirectionView
|
||||
}
|
||||
if (mAMap != null) {
|
||||
|
||||
// addRouteColorList();
|
||||
addRouteColorList();
|
||||
|
||||
if (mCoordinatesLatLng.size() > 2) {
|
||||
//设置线段纹理
|
||||
PolylineOptions polylineOptions = new PolylineOptions();
|
||||
polylineOptions.addAll(mCoordinatesLatLng);
|
||||
//polylineOptions.colorValues(colorList); // 1FC3FF -> 57ABFF
|
||||
//加上这个属性,表示使用渐变线
|
||||
//polylineOptions.useGradient(true);
|
||||
polylineOptions.setUseTexture(true);
|
||||
polylineOptions.width(15);
|
||||
polylineOptions.lineCapType(PolylineOptions.LineCapType.LineCapRound);
|
||||
polylineOptions.setCustomTextureList(textureList);
|
||||
@@ -263,15 +267,10 @@ public class TaxiPassengerMapDirectionView
|
||||
textureList.clear();
|
||||
texIndexList.clear();
|
||||
for (int i = 0; i < mCoordinatesLatLng.size(); i++){
|
||||
// if (i <= mCoordinatesLatLng.size()/2){
|
||||
// colorList.add(Color.argb(255, 31, 195, 255));//start
|
||||
// }else {
|
||||
// colorList.add(Color.argb(255, 87, 171, 255));//end
|
||||
// }
|
||||
if (i <= mHaveArrivedIndex){
|
||||
textureList.add(BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_arrow_arrived));
|
||||
textureList.add(mArrivedRes);
|
||||
}else {
|
||||
textureList.add(BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_arrow_un_arrive));
|
||||
textureList.add(mUnArrivedRes);
|
||||
}
|
||||
texIndexList.add(i);
|
||||
}
|
||||
@@ -360,7 +359,6 @@ public class TaxiPassengerMapDirectionView
|
||||
mCoordinatesLatLng.clear();
|
||||
mCoordinatesLatLng.addAll(latLngs);
|
||||
mHaveArrivedIndex = haveArrivedIndex;
|
||||
addRouteColorList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,7 +22,6 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -229,7 +228,6 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
}
|
||||
|
||||
public void routeResultByServer(List<LatLng> latLngList,int haveArrivedIndex) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "routeResultByServer:" + latLngList.size());
|
||||
if (latLngList.size() > 0) {
|
||||
drawablePolylineByServerRoute(latLngList,haveArrivedIndex);
|
||||
} else {
|
||||
|
||||
@@ -37,8 +37,9 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
private static final long TIMER_START_AUTOPILOT_INTERVAL = 20 * 1000L;
|
||||
private Context mContext;
|
||||
private View view;
|
||||
private FrameSurfaceView svCarStartingFrame;
|
||||
private AnimatorDrawableUtil mAnimationDrawable ;
|
||||
private AnimatorDrawableUtil mCarAnimationDrawable ;
|
||||
private ImageView mCarIv;
|
||||
private Integer[] startingAnimIds = new Integer[]{
|
||||
R.drawable.light_00000,
|
||||
R.drawable.light_00001,
|
||||
@@ -98,6 +99,7 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
mCloseIV.setOnClickListener(this);
|
||||
|
||||
mAutopilotBtnBg = view.findViewById(R.id.taxi_p_autopilot_btn_bg);
|
||||
mCarIv = view.findViewById(R.id.taxi_p_autopilot_starting);
|
||||
|
||||
initBtnAnimatonDrawable();
|
||||
|
||||
@@ -105,9 +107,8 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
}
|
||||
|
||||
private void initCarStartingFrame() {
|
||||
svCarStartingFrame = view.findViewById(R.id.taxi_p_autopilot_starting);
|
||||
svCarStartingFrame.setBitmapIds(Arrays.asList(startingAnimIds));
|
||||
svCarStartingFrame.setDuration(1300);
|
||||
mCarAnimationDrawable = new AnimatorDrawableUtil();
|
||||
mCarAnimationDrawable.setAnimation(mCarIv,Arrays.asList(startingAnimIds));
|
||||
}
|
||||
|
||||
private void initBtnAnimatonDrawable() {
|
||||
@@ -143,8 +144,8 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
public void handleStartAutopilotBtnStatus(boolean isClickable){
|
||||
|
||||
if (svCarStartingFrame != null){
|
||||
svCarStartingFrame.setBackgroundResource(R.drawable.light_00000);
|
||||
if (mCarIv != null){
|
||||
mCarIv.setBackgroundResource(R.drawable.light_00000);
|
||||
}
|
||||
if (mStartAutopilotBtn == null) return;
|
||||
|
||||
@@ -178,7 +179,7 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
|
||||
if (isStart){
|
||||
if (mAnimationDrawable == null){
|
||||
|
||||
initBtnAnimatonDrawable();
|
||||
}
|
||||
if (mAnimationDrawable != null){
|
||||
mAnimationDrawable.start(true, 30, null);
|
||||
@@ -189,17 +190,18 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
}
|
||||
|
||||
private void startingCarBgAnimatorDrawable(boolean isStart){
|
||||
if (isStart && svCarStartingFrame != null){
|
||||
svCarStartingFrame.setRepeatTimes(-1);
|
||||
svCarStartingFrame.setBackground(null);
|
||||
svCarStartingFrame.start();
|
||||
}else {
|
||||
if (svCarStartingFrame != null){
|
||||
svCarStartingFrame.reset();
|
||||
svCarStartingFrame.setBackgroundResource(R.drawable.light_00000);
|
||||
if (isStart){
|
||||
if (mCarAnimationDrawable == null){
|
||||
initCarStartingFrame();
|
||||
}
|
||||
mCarIv.setBackgroundResource(0);
|
||||
mCarAnimationDrawable.start(true,40, null);
|
||||
}else {
|
||||
if (mCarAnimationDrawable != null){
|
||||
mCarAnimationDrawable.stop();
|
||||
}
|
||||
mCarIv.setBackgroundResource(R.drawable.light_00000);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void startOrStopLoadingAnim(boolean start) {
|
||||
@@ -234,10 +236,9 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
}
|
||||
|
||||
public void clearStartingAnimFrame(){
|
||||
if (svCarStartingFrame != null){
|
||||
svCarStartingFrame.destroy();
|
||||
if (mCarAnimationDrawable != null){
|
||||
mCarAnimationDrawable.stop();
|
||||
}
|
||||
svCarStartingFrame = null;
|
||||
}
|
||||
public void onAutopilotStatusSuccess(){
|
||||
startOrStopLoadingAnim(false);
|
||||
|
||||
@@ -17,6 +17,9 @@ import com.mogo.och.taxi.passenger.mulprocess.BinderCursor
|
||||
import com.mogo.och.taxi.passenger.mulprocess.BinderProvider
|
||||
import com.mogo.och.taxi.passenger.mulprocess.ICallback
|
||||
import com.mogo.och.taxi.passenger.mulprocess.ILeftMenuService
|
||||
import rx.Observable
|
||||
import rx.Observer
|
||||
import rx.schedulers.Schedulers
|
||||
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
@@ -38,6 +41,11 @@ object LeftMenuOpen {
|
||||
|
||||
private var icallbacks: RemoteCallbackList<ICallback> = RemoteCallbackList<ICallback>()
|
||||
|
||||
var checkIndex = OverlayLeftViewUtils.LIVE
|
||||
private var lastClickTime = 0L
|
||||
private const val FAST_CLICK_DELAY_TIME = 1000 // 防止事件发送过快
|
||||
|
||||
|
||||
fun setValue(
|
||||
windowView: View,
|
||||
wl: WindowManager.LayoutParams?,
|
||||
@@ -70,7 +78,8 @@ object LeftMenuOpen {
|
||||
val iterator = dragList.iterator()
|
||||
while (iterator.hasNext()) {
|
||||
val next = iterator.next()
|
||||
unRegisterDragView(next)
|
||||
unRegisterDragView(next,false)
|
||||
iterator.remove()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,8 +178,10 @@ object LeftMenuOpen {
|
||||
}
|
||||
}
|
||||
|
||||
fun unRegisterDragView(view: View?) {
|
||||
dragList.remove(view)
|
||||
fun unRegisterDragView(view: View?,remove:Boolean) {
|
||||
if(remove) {
|
||||
dragList.remove(view)
|
||||
}
|
||||
view?.let {
|
||||
it.setOnTouchListener(null)
|
||||
it.setOnClickListener(null)
|
||||
@@ -220,15 +231,29 @@ object LeftMenuOpen {
|
||||
}
|
||||
|
||||
fun callCallBack(meters: Long,timeInSecond: Long,speed:Float){
|
||||
val len = icallbacks.beginBroadcast()
|
||||
for (i in 0 until len) {
|
||||
try {
|
||||
icallbacks.getBroadcastItem(i).onResult(meters,timeInSecond,speed)
|
||||
} catch (e: RemoteException) {
|
||||
e.printStackTrace()
|
||||
if(checkIndex == OverlayLeftViewUtils.CONSULT||checkIndex == OverlayLeftViewUtils.MOVIE) {
|
||||
if (System.currentTimeMillis() - lastClickTime < FAST_CLICK_DELAY_TIME){
|
||||
return
|
||||
}
|
||||
lastClickTime = System.currentTimeMillis()
|
||||
|
||||
Observable.empty<String?>().subscribeOn(Schedulers.io())
|
||||
.subscribe(object : Observer<String?> {
|
||||
override fun onCompleted() {
|
||||
val len = icallbacks.beginBroadcast()
|
||||
for (i in 0 until len) {
|
||||
try {
|
||||
icallbacks.getBroadcastItem(i).onResult(meters, timeInSecond, speed)
|
||||
} catch (e: RemoteException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
icallbacks.finishBroadcast()
|
||||
}
|
||||
override fun onError(e: Throwable?) {}
|
||||
override fun onNext(t: String?) {}
|
||||
})
|
||||
}
|
||||
icallbacks.finishBroadcast()
|
||||
}
|
||||
|
||||
fun invoKeyByEventType(typeID:Int){
|
||||
|
||||
@@ -105,6 +105,7 @@ object OverlayLeftViewUtils {
|
||||
|
||||
val liveSelected = object :ListAdapter.OnTabSelectListener{
|
||||
override fun onSelect(isCurrentProcess:Boolean) {
|
||||
LeftMenuOpen.checkIndex = LIVE
|
||||
if(isCurrentProcess) {
|
||||
close(view, windowManager)
|
||||
}else {
|
||||
@@ -124,6 +125,7 @@ object OverlayLeftViewUtils {
|
||||
|
||||
val overViewSelected = object :ListAdapter.OnTabSelectListener{
|
||||
override fun onSelect(isCurrentProcess:Boolean) {
|
||||
LeftMenuOpen.checkIndex = OVERVIEW
|
||||
if(isCurrentProcess) {
|
||||
close(view, windowManager)
|
||||
}else {
|
||||
@@ -143,6 +145,7 @@ object OverlayLeftViewUtils {
|
||||
|
||||
val consultSelect = object :ListAdapter.OnTabSelectListener{
|
||||
override fun onSelect(isCurrentProcess:Boolean) {
|
||||
LeftMenuOpen.checkIndex = CONSULT
|
||||
if(isCurrentProcess) {
|
||||
close(view, windowManager)
|
||||
//计算订单起点和终点距离
|
||||
@@ -154,6 +157,7 @@ object OverlayLeftViewUtils {
|
||||
|
||||
val entertainmentSelect = object :ListAdapter.OnTabSelectListener{
|
||||
override fun onSelect(isCurrentProcess:Boolean) {
|
||||
LeftMenuOpen.checkIndex = MOVIE
|
||||
if(isCurrentProcess) {
|
||||
close(view, windowManager)
|
||||
val sumDis = SharedPrefsMgr.getInstance(context).getInt(TaxiPassengerConst.SP_KEY_ORDER_SUM_DIS, 0)
|
||||
@@ -178,6 +182,9 @@ object OverlayLeftViewUtils {
|
||||
windowManager!!.addView(overlayView, params)
|
||||
checkProcess()
|
||||
isShowing = true
|
||||
} catch (e: WindowManager.BadTokenException) {
|
||||
isShowing = true;
|
||||
dismissOverlayView(false)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
@@ -260,7 +267,7 @@ object OverlayLeftViewUtils {
|
||||
}
|
||||
|
||||
fun removeDragTarget(view: View?){
|
||||
LeftMenuOpen.unRegisterDragView(view)
|
||||
LeftMenuOpen.unRegisterDragView(view,true)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -365,6 +372,10 @@ object OverlayLeftViewUtils {
|
||||
}
|
||||
}
|
||||
|
||||
fun getStatus():Boolean{
|
||||
return isShowing
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除覆盖View在Activity上面
|
||||
*/
|
||||
@@ -387,7 +398,12 @@ object OverlayLeftViewUtils {
|
||||
try {
|
||||
if (windowManager != null && overlayView != null) {
|
||||
windowManager!!.removeViewImmediate(overlayView)
|
||||
params = null
|
||||
}
|
||||
if(windowManager!=null){
|
||||
windowManager = null
|
||||
}
|
||||
if(params!=null){
|
||||
params = null
|
||||
}
|
||||
if (overlayView!=null) {
|
||||
|
||||
@@ -16,10 +16,10 @@ import com.mogo.och.common.module.utils.NumberFormatUtil
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerVideoPlay
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst
|
||||
import com.mogo.och.taxi.passenger.event.FinishActivity
|
||||
import com.mogo.och.taxi.passenger.mulprocess.ICallback
|
||||
import com.mogo.och.taxi.passenger.ui.leftmenu.LeftMenuOpen
|
||||
import com.mogo.och.taxi.passenger.ui.leftmenu.OverlayLeftViewUtils
|
||||
import com.mogo.och.taxi.passenger.event.FinishActivity
|
||||
import com.mogo.och.taxi.passenger.ui.video.layoutmanage.CarouselLayoutManager
|
||||
import com.mogo.och.taxi.passenger.ui.video.layoutmanage.CarouselZoomPostLayoutListener
|
||||
import com.mogo.och.taxi.passenger.ui.video.layoutmanage.CenterScrollListener
|
||||
@@ -33,7 +33,14 @@ import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import java.util.*
|
||||
import rx.Observable
|
||||
import rx.Observer
|
||||
import rx.Subscription
|
||||
import rx.android.schedulers.AndroidSchedulers
|
||||
import rx.schedulers.Schedulers
|
||||
import java.util.Calendar
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.math.floor
|
||||
|
||||
|
||||
@@ -44,6 +51,7 @@ class VideoActivity : AppCompatActivity() {
|
||||
private lateinit var clContain: ConstraintLayout
|
||||
private lateinit var acivTitleIcon: AppCompatImageView
|
||||
private lateinit var tvTitle: TextView
|
||||
private var subscribe: Subscription?=null
|
||||
|
||||
private val arrayListOf = ArrayList<TaxiPassengerVideoPlay>()
|
||||
|
||||
@@ -297,7 +305,7 @@ class VideoActivity : AppCompatActivity() {
|
||||
acivTitleIcon = findViewById(R.id.aciv_title_icon)
|
||||
tvTitle = findViewById(R.id.tv_mogo_consult)
|
||||
acivTitleIcon.setOnClickListener {
|
||||
finish()
|
||||
//finish()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,7 +352,25 @@ class VideoActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
subscribe = Observable.interval(0, 8, TimeUnit.SECONDS)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(object : Observer<Long> {
|
||||
override fun onCompleted() {}
|
||||
override fun onError(e: Throwable?) {}
|
||||
override fun onNext(t: Long?) {
|
||||
if (!OverlayLeftViewUtils.getStatus()) {
|
||||
when (videotype){
|
||||
VIDEOTYPE_CONSULT -> {
|
||||
OverlayLeftViewUtils.showOverlayView(this@VideoActivity,isOpen = false, checkIndex = OverlayLeftViewUtils.CONSULT)
|
||||
}
|
||||
VIDEOTYPE_MOIES -> {
|
||||
OverlayLeftViewUtils.showOverlayView(this@VideoActivity,isOpen = false, checkIndex = OverlayLeftViewUtils.MOVIE)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
@@ -361,6 +387,11 @@ class VideoActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
subscribe?.let {
|
||||
if(it.isUnsubscribed){
|
||||
it.unsubscribe()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="5px"/>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="5px"/>
|
||||
<solid android:color="@android:color/transparent" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape android:shape="rectangle" >
|
||||
<corners android:radius="7px"/>
|
||||
<gradient android:startColor="@android:color/transparent" android:endColor="#54D7FF" android:angle="0"/>
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="5px"/>
|
||||
<solid android:color="#99D8D8D8" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="5px"/>
|
||||
<solid android:color="#66FFFFFF" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="5px"/>
|
||||
<gradient android:startColor="#303CFF" android:centerColor="#216CFF" android:endColor="#25C1F9" android:angle="0"/>
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -17,7 +17,7 @@
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<shape android:shape="rectangle" >
|
||||
<corners android:radius="7px"/>
|
||||
<gradient android:startColor="@android:color/transparent" android:endColor="#54D7FF"/>
|
||||
</shape>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="5px"/>
|
||||
<gradient android:startColor="#303CFF" android:centerColor="#216CFF" android:endColor="#25C1F9"/>
|
||||
</shape>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
android:background="@drawable/taxi_p_passenger_start_panel_bg"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<com.mogo.och.common.module.wigets.sfv.FrameSurfaceView
|
||||
<ImageView
|
||||
android:id="@+id/taxi_p_autopilot_starting"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -1119,7 +1119,6 @@ public class TaxiModel {
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
int state = autopilotStatusInfo.getState();
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "state = %s", state);
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
if (state != mPrevAPStatus && mADASStatusCallback != null){
|
||||
mADASStatusCallback.onAutopilotRunning();
|
||||
|
||||
@@ -442,7 +442,7 @@ public class TaxiServiceManager {
|
||||
@Override
|
||||
public void onSuccess(T o) {
|
||||
super.onSuccess(o);
|
||||
CallerLogger.INSTANCE.e(M_TAXI + TAG,apiName + ": onSuccess() " + o.msg);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG,apiName + ": onSuccess() " + o.msg);
|
||||
if (callback != null) {
|
||||
callback.onSuccess(o);
|
||||
}
|
||||
|
||||
@@ -508,7 +508,6 @@ class MoGoAutopilotProvider :
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
// 乘客屏才监听
|
||||
AppConfigInfo.plateNumber = carConfigResp.plateNumber
|
||||
// Log.d("liyz", "onAutopilotCarConfig 乘客屏Mac地址为 = ${carConfigResp.macAddress}")
|
||||
CallerBindingcarManager.getBindingcarProvider()
|
||||
.getBindingcarInfo(carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
invokeNettyConnResult("乘客屏车牌号:${carConfigResp.plateNumber},Mac地址为:${carConfigResp.macAddress}")
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_C
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_CAR_STATE
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_OBJECTS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_STATUS_QUERY_RESP
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT
|
||||
@@ -374,14 +375,19 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
}
|
||||
}
|
||||
|
||||
//状态查询应答
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_STATUS_QUERY_RESP,
|
||||
paramIndexes = [0, 1],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
override fun onStatusQueryResp(
|
||||
header: MessagePad.Header?,
|
||||
statusInfo: SystemStatusInfo.StatusInfo?
|
||||
) {
|
||||
//状态查询应答
|
||||
statusInfo?.let {
|
||||
Log.d(TAG, GsonUtil.jsonFromObject(it))
|
||||
}
|
||||
invokeAutopilotStatusRespByQuery(statusInfo)
|
||||
}
|
||||
|
||||
|
||||
@@ -105,9 +105,7 @@ public class MoGoHandAdasMsgManager implements
|
||||
|
||||
@Override
|
||||
public void onAutopilotCarConfig(@NotNull MessagePad.CarConfigResp carConfigResp) {
|
||||
Log.d("liyz", "onAutopilotCarConfig carConfigResp ");
|
||||
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.getMacAddress())) {
|
||||
Log.d("liyz", "carConfigResp.getMacAddress() = " + carConfigResp.getMacAddress());
|
||||
CallerBindingcarManager.getBindingcarProvider().getBindingcarInfo(carConfigResp.getMacAddress(), MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,6 @@ public class UpgradeAppNetWorkManager {
|
||||
@Override
|
||||
public void onNext(@NonNull UpgradeAppInfo info) {
|
||||
if (info != null && info.getData() != null && info.getData().size() > 0) {
|
||||
Log.d("liyz", "UpgradeAppInfo url = " + info.getData().get(0).getApp_url() + "----code = " + info.getData().get(0).getVersion_code());
|
||||
CallerLogger.INSTANCE.d(TAG, "UpgradeAppInfo url = " + info.getData().get(0).getApp_url() + "----code = " + info.getData().get(0).getVersion_code());
|
||||
// if (info.getData().get(0).getVersion_code() > versionCode) {
|
||||
|
||||
@@ -92,7 +91,6 @@ public class UpgradeAppNetWorkManager {
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
CallerLogger.INSTANCE.e(TAG, "UpgradeAppInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
|
||||
// Log.e("liyz", "UpgradeAppInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -95,7 +95,6 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
private void driverScreen(String macAddress, String widevineIDWithMd5) {
|
||||
long currentHour = System.currentTimeMillis() / (1000 * 60);
|
||||
long oldHour = SharedPrefsMgr.getInstance(mContext).getLong("typeDriver", 0);
|
||||
Log.d("liyz", "driverScreen --------> ");
|
||||
//如果2分钟内频繁调,需要拦截,业务导致的会多次请求工控机信息
|
||||
if (HmiBuildConfig.isShowSnBindingView) {
|
||||
if (currentHour - oldHour > 1) {
|
||||
@@ -108,7 +107,6 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
private void passengerScreen(String macAddress, String widevineIDWithMd5) {
|
||||
long currentHour = System.currentTimeMillis() / (1000 * 60);
|
||||
long oldHour = SharedPrefsMgr.getInstance(mContext).getLong("typePassenger", 0);
|
||||
Log.d("liyz", "passengerScreen --------> ");
|
||||
//如果2分钟内频繁调,需要拦截,业务导致的会多次请求工控机信息
|
||||
if (HmiBuildConfig.isShowSnBindingView) {
|
||||
if (currentHour - oldHour > 1) {
|
||||
|
||||
@@ -62,7 +62,6 @@ public class BindingcarNetWorkManager {
|
||||
public void getBindingcarInfo(Context context, String macAddress, String widevineIDWithMd5, int screenType) {
|
||||
// String macAddress = "48:b0:2d:3a:bc:78";
|
||||
// String sn = "X20202203105S688HZ";
|
||||
Log.d("liyz", "macAddress = " + macAddress + "----widevineIDWithMd5 = " + widevineIDWithMd5);
|
||||
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)
|
||||
@@ -77,7 +76,6 @@ 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("liyz", "getBindingcarInfo onNext info.getData() =" + info.getData().toString());
|
||||
if (info.getData().getCompare().equals("0")) {
|
||||
CallerHmiManager.INSTANCE.showBindingcarDialog();
|
||||
} else if (info.getData().getCompare().equals("3")) {
|
||||
@@ -104,7 +102,6 @@ public class BindingcarNetWorkManager {
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
CallerLogger.INSTANCE.e(TAG, "getBindingcarInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
|
||||
Log.e("liyz", "getBindingcarInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneTAG
|
||||
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
import com.zhjt.mogo_core_function_devatools.feedback.FeedbackManager
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchManager
|
||||
import com.zhjt.mogo_core_function_devatools.scene.SceneManager.Companion.sceneManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.*
|
||||
@@ -103,8 +102,8 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
upgradeManager.downLoadPackage(mContext!!, downloadKey,downloadUrl)
|
||||
}
|
||||
|
||||
override fun showStatusBar(ctx: Context) {
|
||||
StatusManager.init(ctx)
|
||||
override fun showStatusBar(ctx: Context, anchor: View) {
|
||||
StatusManager.init(ctx, anchor)
|
||||
StatusManager.show()
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
|
||||
import com.zhidao.loglib.call.LogInfoManagerFactory
|
||||
import com.zhidao.loglib.upload.OnUploadListener
|
||||
import com.zhidao.loglib.upload.UploadManager
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
|
||||
@@ -247,12 +248,16 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
object : OnUploadListener {
|
||||
override fun onUploadSuccess(filePath: String, downloadUrl: String) {
|
||||
CallerLogger.d("$M_DEVA$TAG", "语音文件上传成功:downloadUrl=$downloadUrl")
|
||||
//将语音文件上传Cos监听移除
|
||||
removeUploadListener(singlePath)
|
||||
//上传到服务器
|
||||
upload(downloadUrl)
|
||||
}
|
||||
|
||||
override fun onUploadFail(filePath: String) {
|
||||
TipToast.shortTip("上传语音文件失败")
|
||||
//将语音文件上传Cos监听移除
|
||||
removeUploadListener(singlePath)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
@@ -261,6 +266,19 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将语音文件上传Cos监听移除
|
||||
* @param filePath 文件路径
|
||||
*/
|
||||
private fun removeUploadListener(filePath: String){
|
||||
val pkgInfo: List<String> = filePath.substring(
|
||||
filePath.lastIndexOf("/") + 1,
|
||||
filePath.lastIndexOf(".")
|
||||
).split("_")
|
||||
val pkgName = if (pkgInfo.size == 3) pkgInfo[1] else ""
|
||||
UploadManager.getInstance().removeUploadListener(pkgName)
|
||||
}
|
||||
|
||||
/**
|
||||
* 将记录上传到服务器
|
||||
* @param downloadUrl 语音文件下载地址
|
||||
|
||||
@@ -17,7 +17,6 @@ import com.google.android.flexbox.FlexboxLayout
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
@@ -35,7 +34,7 @@ import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.zhidao.loglib.upload.UploadManager
|
||||
import java.io.File
|
||||
import java.lang.reflect.Field
|
||||
|
||||
@@ -198,12 +197,16 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
object : OnUploadListener {
|
||||
override fun onUploadSuccess(filePath: String, downloadUrl: String) {
|
||||
CallerLogger.d("$M_DEVA$TAG", "语音文件上传成功:downloadUrl=$downloadUrl")
|
||||
//将语音文件上传Cos监听移除
|
||||
removeUploadListener(singlePath)
|
||||
//上传到服务器
|
||||
upload(downloadUrl)
|
||||
}
|
||||
|
||||
override fun onUploadFail(filePath: String) {
|
||||
TipToast.shortTip("上传语音文件失败")
|
||||
//将语音文件上传Cos监听移除
|
||||
removeUploadListener(singlePath)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
@@ -212,6 +215,19 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将语音文件上传Cos监听移除
|
||||
* @param filePath 文件路径
|
||||
*/
|
||||
private fun removeUploadListener(filePath: String){
|
||||
val pkgInfo: List<String> = filePath.substring(
|
||||
filePath.lastIndexOf("/") + 1,
|
||||
filePath.lastIndexOf(".")
|
||||
).split("_")
|
||||
val pkgName = if (pkgInfo.size == 3) pkgInfo[1] else ""
|
||||
UploadManager.getInstance().removeUploadListener(pkgName)
|
||||
}
|
||||
|
||||
/**
|
||||
* 将记录上传到服务器
|
||||
* @param downloadUrl 语音文件下载地址
|
||||
|
||||
@@ -33,9 +33,7 @@ object EnvChangeManager {
|
||||
fun getCityName(): String {
|
||||
val cache = getConfig()
|
||||
return if (cache == null) {
|
||||
val cityCode = CallerMapLocationListenerManager.getCurrentLocation()?.cityCode ?: SharedPrefsMgr.getInstance(Utils.getApp()).getString(SharedPrefsConstants.LOCATION_CITY_CODE) ?: "010"
|
||||
updateCityCode(cityCode)
|
||||
when(cityCode) {
|
||||
when(CallerMapLocationListenerManager.getCurrentLocation()?.cityCode ?: SharedPrefsMgr.getInstance(Utils.getApp()).getString(SharedPrefsConstants.LOCATION_CITY_CODE) ?: "010") {
|
||||
"010" -> "北京"
|
||||
"0734" -> "衡阳"
|
||||
else -> "未知"
|
||||
@@ -51,17 +49,15 @@ object EnvChangeManager {
|
||||
|
||||
fun getNetMode(): String {
|
||||
val cache = getConfig()
|
||||
if (cache == null) {
|
||||
val mode = DebugConfig.getNetMode()
|
||||
updateNetMode(mode)
|
||||
return when(mode) {
|
||||
return if (cache == null) {
|
||||
when(DebugConfig.getNetMode()) {
|
||||
DebugConfig.NET_MODE_RELEASE -> "生产"
|
||||
DebugConfig.NET_MODE_QA -> "测试"
|
||||
DebugConfig.NET_MODE_DEMO -> "演示"
|
||||
else -> "未知"
|
||||
}
|
||||
} else {
|
||||
return when(cache.second) {
|
||||
when(cache.second) {
|
||||
DebugConfig.NET_MODE_RELEASE -> "生产"
|
||||
DebugConfig.NET_MODE_QA -> "测试"
|
||||
DebugConfig.NET_MODE_DEMO -> "演示"
|
||||
|
||||
@@ -144,7 +144,7 @@ fun Context.enqueuePop(content: View, width: Int, height: Int, key: String = "",
|
||||
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
fun Context.normalPop(content: View, width: Int, height: Int, startX: Int = 0, startY: Int = 0, gravity: Int = Gravity.START, onOuterViewClicked:((focus: View) -> Unit)? = null, isFocusable: Boolean = true): () -> Unit {
|
||||
fun Context.normalPop(content: View, width: Int, height: Int, startX: Int = 0, startY: Int = 0, gravity: Int = Gravity.START, onOuterViewClicked:((focus: View) -> Unit)? = null, isFocusable: Boolean = true): PopupWindow? {
|
||||
val activity = (this as? FragmentActivity) ?: throw IllegalStateException("please use Activity to trigger pop show.")
|
||||
val isImmersiveMode = BarUtils.isImmersiveMode(activity)
|
||||
var tempPop: PopupWindow? = null
|
||||
@@ -192,7 +192,7 @@ fun Context.normalPop(content: View, width: Int, height: Int, startX: Int = 0, s
|
||||
it.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
}
|
||||
if (VERSION.SDK_INT >= VERSION_CODES.M) {
|
||||
val transition = Slide(gravity).also {
|
||||
val transition = Slide(if ((gravity and Gravity.START) != 0) Gravity.START else if ((gravity and Gravity.TOP) != 0) Gravity.TOP else if ((gravity and Gravity.END) != 0) Gravity.END else if ((gravity and Gravity.BOTTOM) != 0) Gravity.BOTTOM else throw AssertionError("gravity is not invalid.")).also {
|
||||
it.interpolator = AccelerateDecelerateInterpolator()
|
||||
it.duration = 200
|
||||
}
|
||||
@@ -202,16 +202,14 @@ fun Context.normalPop(content: View, width: Int, height: Int, startX: Int = 0, s
|
||||
pop.contentView = content
|
||||
decorView.doOnAttach {
|
||||
try {
|
||||
pop.showAtLocation(it, gravity, startX, if (isImmersiveMode) 0 else BarUtils.getStatusBarHeight() + startY)
|
||||
pop.showAtLocation(it, gravity, startX, (if (isImmersiveMode) 0 else BarUtils.getStatusBarHeight()) + startY)
|
||||
tempPop = pop
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
tempPop?.takeIf { it.isShowing }?.dismiss()
|
||||
}
|
||||
return tempPop
|
||||
}
|
||||
|
||||
fun isVisibleOnPoint(content: View, x: Int, y: Int): Boolean {
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.Scene.Companion.scene
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_CHAT
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
|
||||
@@ -28,6 +29,7 @@ class SceneManager {
|
||||
companion object {
|
||||
|
||||
private const val ADAS = "ADAS"
|
||||
private const val CALLCHAT = "CALLCHAT"
|
||||
private const val DEVA = "DEVA"
|
||||
private const val HMI = "HMI"
|
||||
private const val OBU = "OBU"
|
||||
@@ -51,6 +53,7 @@ class SceneManager {
|
||||
init {
|
||||
//过滤所需条件
|
||||
sceneModuleTAG.map[ADAS] = SceneModule(true, M_ADAS_IMPL)
|
||||
sceneModuleTAG.map[CALLCHAT] = SceneModule(false, M_CHAT)
|
||||
sceneModuleTAG.map[DEVA] = SceneModule(false, M_DEVA)
|
||||
sceneModuleTAG.map[HMI] = SceneModule(false, M_HMI)
|
||||
sceneModuleTAG.map[OBU] = SceneModule(false, M_OBU)
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.zhjt.mogo_core_function_devatools.status
|
||||
import android.content.*
|
||||
import android.view.*
|
||||
import android.view.WindowManager.LayoutParams
|
||||
import android.widget.*
|
||||
import androidx.core.view.*
|
||||
import androidx.lifecycle.*
|
||||
import androidx.lifecycle.Lifecycle.Event
|
||||
@@ -11,8 +12,7 @@ import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.util.AppStateManager
|
||||
import com.mogo.eagle.core.utilcode.util.IAppStateListener
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.zhjt.mogo_core_function_devatools.ext.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.CanStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.GpsStatus
|
||||
@@ -41,14 +41,19 @@ object StatusManager {
|
||||
|
||||
private lateinit var model: StatusModel
|
||||
|
||||
private var hidePop: (() -> Unit)? = null
|
||||
private var pop: PopupWindow? = null
|
||||
|
||||
private var timer: Job? = null
|
||||
|
||||
private var context: WeakReference<Context>? = null
|
||||
|
||||
private var anchor: WeakReference<View>? = null
|
||||
|
||||
private var hasInit = false
|
||||
|
||||
private var oldX = 0
|
||||
private var oldY = 0
|
||||
|
||||
private val listener = object : IMoGoAutopilotStatusListener {
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
super.onAutopilotGuardian(guardianInfo)
|
||||
@@ -88,7 +93,7 @@ object StatusManager {
|
||||
}
|
||||
}
|
||||
|
||||
fun init(ctx: Context) {
|
||||
fun init(ctx: Context, anchor: View) {
|
||||
if (hasInit) {
|
||||
return
|
||||
}
|
||||
@@ -106,6 +111,25 @@ object StatusManager {
|
||||
}
|
||||
})
|
||||
context = WeakReference(ctx)
|
||||
anchor.viewTreeObserver.addOnGlobalLayoutListener {
|
||||
anchor.getLocationInWindow(IntArray(2).also {
|
||||
val currentX = it[0]
|
||||
val currentY = it[1]
|
||||
var changed = false
|
||||
if (oldX != currentX) {
|
||||
oldX = currentX
|
||||
changed = true
|
||||
}
|
||||
if (oldY != currentY) {
|
||||
changed = true
|
||||
oldY = currentY
|
||||
}
|
||||
if (changed && pop?.isShowing == true) {
|
||||
pop?.update(getOffsetX(currentX), currentY + 130.PX, -1, -1)
|
||||
}
|
||||
})
|
||||
}
|
||||
this.anchor = WeakReference(anchor)
|
||||
}
|
||||
|
||||
private fun onCreate(ctx: Context) {
|
||||
@@ -133,20 +157,29 @@ object StatusManager {
|
||||
}
|
||||
|
||||
fun show() {
|
||||
val anchor = this.anchor?.get() ?: return
|
||||
context?.get()?.also { ctx ->
|
||||
hidePop?.invoke()
|
||||
pop?.takeIf { it.isShowing }?.dismiss()
|
||||
val content = StatusView(model, ctx)
|
||||
content.doOnAttach {
|
||||
for (f in flows) {
|
||||
f.onCreate()
|
||||
}
|
||||
}
|
||||
ctx.normalPop(content, width = 665.PX, height = LayoutParams.WRAP_CONTENT, gravity = Gravity.END, startX = 55.PX, isFocusable = false).also { hidePop = it }
|
||||
val out = IntArray(2)
|
||||
anchor.getLocationInWindow(out)
|
||||
ctx.normalPop(content, width = LayoutParams.WRAP_CONTENT, height = LayoutParams.WRAP_CONTENT, gravity = Gravity.END or Gravity.TOP, startX = getOffsetX(out[0]), startY = out[1] + 130.PX , isFocusable = false)?.also {
|
||||
pop = it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getOffsetX(anchorX: Int): Int {
|
||||
return ScreenUtils.getScreenWidth() - anchorX + 40.PX
|
||||
}
|
||||
|
||||
fun hide() {
|
||||
hidePop?.invoke()
|
||||
pop?.takeIf { it.isShowing }?.dismiss()
|
||||
}
|
||||
|
||||
private fun onDestroy(ctx: Context) {
|
||||
@@ -158,6 +191,6 @@ object StatusManager {
|
||||
it.onDestroy()
|
||||
}
|
||||
flows.clear()
|
||||
hidePop?.invoke()
|
||||
pop?.takeIf { it.isShowing }?.dismiss()
|
||||
}
|
||||
}
|
||||
@@ -59,15 +59,14 @@ internal class StatusView(private val model: StatusModel, ctx: Context): Constra
|
||||
moveDuration = 0
|
||||
removeDuration = 0
|
||||
}
|
||||
itx.layoutManager = GridLayoutManager(context, 3, GridLayoutManager.VERTICAL, false)
|
||||
itx.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
|
||||
itx.background = shape(solid = Color.parseColor("#80000000"), radius = 40.PX)
|
||||
itx.addItemDecoration(
|
||||
CommonDividerItemDecoration.Builder()
|
||||
.horizontalExternalSpace(66.PX)
|
||||
.verticalExternalSpace(60.PX)
|
||||
.spanCountTBCare(false)
|
||||
.verticalInnerSpace(50.PX)
|
||||
.horizontalInnerSpace(116.PX)
|
||||
.horizontalExternalSpace(38.PX)
|
||||
.verticalExternalSpace(30.PX)
|
||||
.spanCountLRCare(false)
|
||||
.horizontalInnerSpace(50.PX)
|
||||
.build()
|
||||
)
|
||||
val adapter = model.status.value?.let { data -> StatusAdapter(context, data.second) }?.also { adapter -> itx.adapter = adapter }
|
||||
@@ -92,7 +91,6 @@ internal class StatusView(private val model: StatusModel, ctx: Context): Constra
|
||||
}
|
||||
|
||||
private fun animate(expand: Boolean) {
|
||||
iv.animate().rotation(if (expand) 0f else -180f).setDuration(200).start()
|
||||
TransitionManager.beginDelayedTransition(this, AutoTransition().setDuration(200))
|
||||
rv.visibility = if (expand) View.VISIBLE else View.INVISIBLE
|
||||
}
|
||||
|
||||
@@ -5,7 +5,10 @@ import android.view.*
|
||||
import android.widget.*
|
||||
import androidx.core.content.*
|
||||
import androidx.recyclerview.widget.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.zhjt.mogo_core_function_devatools.*
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.R.drawable
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.IpcStatus
|
||||
@@ -30,11 +33,10 @@ internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): Rec
|
||||
itemView.findViewById(R.id.iv)
|
||||
}
|
||||
|
||||
private val tv: TextView by lazy {
|
||||
itemView.findViewById(R.id.tv)
|
||||
}
|
||||
|
||||
fun bind(status: Status) {
|
||||
itemView.onClick {
|
||||
ToastUtils.showShort(getText(status))
|
||||
}
|
||||
when(status) {
|
||||
is IpcStatus -> {
|
||||
if (status.enabled) {
|
||||
@@ -42,7 +44,6 @@ internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): Rec
|
||||
} else {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_ipc_disable)
|
||||
}
|
||||
tv.text = "工控机"
|
||||
}
|
||||
is CanStatus -> {
|
||||
if (status.enabled) {
|
||||
@@ -50,15 +51,12 @@ internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): Rec
|
||||
} else {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_can_disable)
|
||||
}
|
||||
tv.text = "CAN"
|
||||
}
|
||||
is NetStatus -> {
|
||||
if (status.enabled) {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_net_enable)
|
||||
tv.text = status.name ?: "WI-FI"
|
||||
} else {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_net_disable)
|
||||
tv.text = "WI-FI"
|
||||
}
|
||||
}
|
||||
is GpsStatus -> {
|
||||
@@ -67,21 +65,17 @@ internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): Rec
|
||||
} else {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_gps_disable)
|
||||
}
|
||||
tv.text = "GPS"
|
||||
}
|
||||
is TracingStatus -> {
|
||||
when(status.state) {
|
||||
ROUTE_FAILED, TRACK_LOAD_FAIL, TRACK_NOT_EXIST, TRACK_FINDED, UNKNOWN -> {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_trace_unkown)
|
||||
tv.text = "未知"
|
||||
}
|
||||
TRACK_LOADED -> {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_track_enable)
|
||||
tv.text = "T"
|
||||
}
|
||||
ROUTE_LOADED -> {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_route_enable)
|
||||
tv.text = "V"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,9 +85,17 @@ internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): Rec
|
||||
} else {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_rtk_disable)
|
||||
}
|
||||
tv.text = status.desc
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getText(status: Status): String = when(status) {
|
||||
is CanStatus -> "CAN:${ if (status.enabled) "状态正常" else "非正常连接" }"
|
||||
is GpsStatus -> "GPS:${ if (status.enabled) "状态正常" else "非正常连接" }"
|
||||
is IpcStatus -> "工控机:${ if (status.enabled) "状态正常" else "非正常连接" }"
|
||||
is NetStatus -> "WIFI:${ if (status.enabled) "${status.name}" else "非正常连接" }"
|
||||
is RTKStatus -> "${status.desc.uppercase()}:${ if (status.enabled) "状态正常" else "非正常连接" }"
|
||||
is TracingStatus -> "轨迹类型:${ if (status.state == TRACK_LOADED) "循迹" else if (status.state == ROUTE_LOADED) "自主算路" else "暂无轨迹" }"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 12 KiB |
@@ -8,22 +8,24 @@
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="468px"
|
||||
app:layout_constraintBottom_toTopOf="@+id/iv"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="156px"
|
||||
android:minWidth="902px"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginEnd="20px"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv"
|
||||
android:layout_width="102px"
|
||||
android:layout_height="102px"
|
||||
android:layout_marginTop="30px"
|
||||
android:layout_width="107px"
|
||||
android:layout_height="107px"
|
||||
android:layout_marginBottom="20px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rv"
|
||||
app:layout_constraintStart_toEndOf="@+id/rv"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:background="@drawable/icon_dev_status_un_fold"/>
|
||||
|
||||
|
||||
@@ -1,22 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="100px"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal">
|
||||
<ImageView
|
||||
android:id="@+id/iv"
|
||||
android:layout_width="96px"
|
||||
android:layout_height="96px" />
|
||||
<TextView
|
||||
android:id="@+id/tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20px"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="24px" />
|
||||
</LinearLayout>
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/iv"
|
||||
android:layout_width="96px"
|
||||
android:layout_height="96px" />
|
||||
@@ -205,11 +205,8 @@ import java.util.*
|
||||
setProxyTrafficLightView(viewTrafficLightVr)
|
||||
setProxyLimitingSpeedView(viewLimitingVelocity)
|
||||
setViewNotificationProvider(this)
|
||||
|
||||
context?.also {
|
||||
if (!AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
CallerDevaToolsManager.showStatusBar(it)
|
||||
}
|
||||
CallerDevaToolsManager.showStatusBar(it, vs_status_bar)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1045,7 +1042,6 @@ import java.util.*
|
||||
*/
|
||||
override fun showTurnLight(light: Int) {
|
||||
if (HmiBuildConfig.isShowTurnLightView) {
|
||||
Log.e("liyz", "showTurnLight light = $light")
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (light == 1) {
|
||||
if (!isLeftLight) {
|
||||
@@ -1085,7 +1081,6 @@ import java.util.*
|
||||
*/
|
||||
override fun showBrakeLight(light: Int) {
|
||||
if (HmiBuildConfig.isShowBrakeLightView) {
|
||||
Log.e("liyz", "showBrakeLight isBrake = $isBrake")
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (light == 1) { //刹车灯亮
|
||||
if (!isBrake) {
|
||||
@@ -1230,7 +1225,7 @@ import java.util.*
|
||||
}
|
||||
|
||||
override fun hideSmallFragment() {
|
||||
context?.let { CallerDevaToolsManager.showStatusBar(it) }
|
||||
context?.let { CallerDevaToolsManager.showStatusBar(it, vs_status_bar) }
|
||||
val fragmentOverview = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW)
|
||||
.navigation() as BaseFragment
|
||||
activity?.supportFragmentManager?.beginTransaction()
|
||||
|
||||
@@ -1065,8 +1065,10 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
val name = map.value.name
|
||||
val log = map.value.log
|
||||
when (name) {
|
||||
////ADAS日志标签
|
||||
//ADAS日志标签
|
||||
SceneConstant.M_ADAS_IMPL -> cbAdasLog.isChecked = log
|
||||
//CALLCHAT日志标签
|
||||
SceneConstant.M_CHAT -> cbCallChatLog.isChecked = log
|
||||
//OBU日志标签
|
||||
SceneConstant.M_OBU -> cbObuLog.isChecked = log
|
||||
//HMI日志标签
|
||||
@@ -1151,6 +1153,12 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
sceneMap[SceneConstant.M_ADAS_IMPL] = adasModule
|
||||
CallerDevaToolsManager.updateModuleTAG(sceneMap)
|
||||
}
|
||||
//CALLCHAT日志标签
|
||||
cbCallChatLog.setOnCheckedChangeListener { _, isChecked ->
|
||||
val callChatModule = SceneModule(isChecked, SceneConstant.M_CHAT)
|
||||
sceneMap[SceneConstant.M_CHAT] = callChatModule
|
||||
CallerDevaToolsManager.updateModuleTAG(sceneMap)
|
||||
}
|
||||
//OBU日志标签
|
||||
cbObuLog.setOnCheckedChangeListener { _, isChecked ->
|
||||
val obuModule = SceneModule(isChecked, SceneConstant.M_OBU)
|
||||
|
||||
@@ -10,6 +10,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper.getDrawable
|
||||
import java.lang.reflect.Field
|
||||
|
||||
/**
|
||||
@@ -72,11 +73,15 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
}
|
||||
//错误列表
|
||||
tvIpcErrorTab.setOnClickListener {
|
||||
tvIpcErrorTab.background = getDrawable(mActivity,R.drawable.ipc_error_tab_normal_bg)
|
||||
tvIpcWarningTab.background = getDrawable(mActivity,R.drawable.ipc_warning_tab_normal_bg)
|
||||
ipcReportAdapter?.setData(ipcErrorReportList)
|
||||
ipcReportAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
//预警列表
|
||||
tvIpcWarningTab.setOnClickListener {
|
||||
tvIpcErrorTab.background = getDrawable(mActivity,R.drawable.ipc_error_tab_select_bg)
|
||||
tvIpcWarningTab.background = getDrawable(mActivity,R.drawable.ipc_warning_tab_select_bg)
|
||||
ipcReportAdapter?.setData(ipcWarningReportList)
|
||||
ipcReportAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
@@ -35,20 +35,21 @@ public class TapPositionView extends ConstraintLayout {
|
||||
|
||||
public TapPositionView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
Log.d(TAG, "2");
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_tap_position, this);
|
||||
tabP = findViewById(R.id.tap_p);
|
||||
tabR = findViewById(R.id.tap_r);
|
||||
tabN = findViewById(R.id.tap_n);
|
||||
tabD = findViewById(R.id.tap_d);
|
||||
typedArray = context.obtainStyledAttributes(attrs, R.styleable.TapPositionView);
|
||||
if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
|
||||
tabP.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateWithGear(@NotNull Chassis.GearPosition gear) {
|
||||
if (tabP != null && tabR != null && tabN != null && tabD != null) {
|
||||
int defaultColor = typedArray.getColor(R.styleable.TapPositionView_defaultColor, -1);
|
||||
int selectColor = typedArray.getColor(R.styleable.TapPositionView_selectColor, -1);
|
||||
Log.d(TAG, "gear:" + gear);
|
||||
switch (gear) {
|
||||
case GEAR_NONE:
|
||||
tabP.setTextColor(defaultColor);
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateList
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -76,7 +77,9 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) {
|
||||
Log.d(TAG, "车辆转向灯:" + lightSwitch.toString());
|
||||
if(lightSwitch != null){
|
||||
CallerLogger.INSTANCE.d(TAG, "车辆转向灯:" + lightSwitch.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +88,7 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotBrakeLightData(boolean brakeLight) {
|
||||
Log.d(TAG, "刹车灯:" + String.valueOf(brakeLight));
|
||||
CallerLogger.INSTANCE.d(TAG, "刹车灯:" + brakeLight);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,18 +97,11 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
Log.d(TAG, "steering原始值====" + String.valueOf(steering));
|
||||
CallerLogger.INSTANCE.d(TAG, "steering原始值====" + steering);
|
||||
if (Math.abs(steering) < 1) {
|
||||
steering = 0;
|
||||
}
|
||||
float steeringValue = steering;
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d(TAG, "steering忽略小数点后====" + String.valueOf((int) steeringValue));
|
||||
}
|
||||
});
|
||||
|
||||
CallerLogger.INSTANCE.d(TAG, "steering忽略小数点后====" + (int) steering);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,16 +110,12 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d(TAG, "司机屏档位" + gear.toString());
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "司机屏档位" + gear.toString());
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,30 +125,36 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
|
||||
@Override
|
||||
public void onAutopilotAcc(float carAcc) {
|
||||
Log.d(TAG, "司机屏加速度:" + carAcc);
|
||||
java.text.DecimalFormat myformat = new java.text.DecimalFormat("0.00");
|
||||
String accStr = myformat.format(carAcc);
|
||||
accTextView.setText("a: " + String.valueOf(accStr));
|
||||
CallerLogger.INSTANCE.d(TAG, "司机屏加速度:" + carAcc);
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
java.text.DecimalFormat mFormat = new java.text.DecimalFormat("0.00");
|
||||
String accStr = mFormat.format(carAcc);
|
||||
accTextView.setText("a: " + accStr);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotBrake(float brake) {
|
||||
Log.d(TAG, "刹车:" + String.valueOf(brake));
|
||||
if (brake > 0){
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_brake);
|
||||
}else {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "刹车:" + brake);
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
if (brake > 0) {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_brake);
|
||||
} else {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotThrottle(float throttle) {
|
||||
Log.d(TAG, "油门:" + String.valueOf(throttle));
|
||||
if (throttle > 0){
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_accelerator);
|
||||
}else {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "油门:" + throttle);
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
if (throttle > 0) {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_accelerator);
|
||||
} else {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:startColor="#3A57C5"
|
||||
android:endColor="#3A57C5"
|
||||
android:angle="0"
|
||||
/>
|
||||
<corners android:topLeftRadius="40px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:startColor="#3A57C5"
|
||||
android:endColor="#3A57C5"
|
||||
android:angle="0"
|
||||
/>
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:startColor="#029DFF"
|
||||
android:endColor="#0056FF"
|
||||
android:angle="0"
|
||||
/>
|
||||
</shape>
|
||||
@@ -112,23 +112,21 @@
|
||||
android:id="@+id/ivBadCaseTools"
|
||||
android:layout_width="120px"
|
||||
android:layout_height="120px"
|
||||
android:src="@drawable/bad_case_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivToolsIcon"
|
||||
android:layout_marginStart="50px"
|
||||
android:layout_marginBottom="40px"
|
||||
/>
|
||||
android:src="@drawable/bad_case_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivToolsIcon" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAiCollectTools"
|
||||
android:layout_width="120px"
|
||||
android:layout_height="120px"
|
||||
android:src="@drawable/ai_collect_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools"
|
||||
android:layout_marginStart="50px"
|
||||
android:layout_marginBottom="40px"
|
||||
/>
|
||||
android:src="@drawable/ai_collect_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools" />
|
||||
|
||||
<View
|
||||
android:id="@+id/viewUpgradeTips"
|
||||
@@ -186,13 +184,18 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VersionNameView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="45px"
|
||||
/>
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/vs_status_bar"
|
||||
android:layout_width="107px"
|
||||
android:layout_height="107px"
|
||||
android:layout_marginEnd="30px"
|
||||
app:layout_constraintEnd_toStartOf="@+id/viewLimitingVelocity"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/viewLimitingVelocity"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
android:textColor="@color/p_default_txt_color"
|
||||
android:textSize="@dimen/dp_46"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tap_r"
|
||||
|
||||
@@ -1845,6 +1845,14 @@
|
||||
android:checked="false"
|
||||
android:text="ADAS日志" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbCallChatLog"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:text="CallChat日志" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbObuLog"
|
||||
style="@style/DebugSettingText"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38px"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/ipc_error_tab_bg"
|
||||
android:background="@drawable/ipc_error_tab_normal_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
android:gravity="center"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/tv_ipc_error_tab"
|
||||
android:background="#3A57C5"
|
||||
android:background="@drawable/ipc_warning_tab_normal_bg"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
|
||||
@@ -68,11 +68,22 @@ class IdentifyOriginDataDrawer : Identify, IMoGoAutopilotStatusListener {
|
||||
val trackId = planningObj.uuid.toString()
|
||||
if (mMarkersCaches.containsKey(trackId)) {
|
||||
val trackObj = mMarkersCaches[trackId]
|
||||
trackObj?.let {
|
||||
colorTrafficData[trackId] = PlanningTrack(
|
||||
"#BCB239FF",
|
||||
CallerAutoPilotStatusListenerManager.getCurWgs84SatelliteTime()
|
||||
)
|
||||
if(planningObj.type == 0){
|
||||
//0是leading障碍物,障碍物车身红色提示
|
||||
trackObj?.let {
|
||||
colorTrafficData[trackId] = PlanningTrack(
|
||||
"#D77F70FF",
|
||||
CallerAutoPilotStatusListenerManager.getCurWgs84SatelliteTime()
|
||||
)
|
||||
}
|
||||
}else if(planningObj.type == 1){
|
||||
//1是避障和择机的障碍物,障碍物车身黄色提示
|
||||
trackObj?.let {
|
||||
colorTrafficData[trackId] = PlanningTrack(
|
||||
"#E4DD94FF",
|
||||
CallerAutoPilotStatusListenerManager.getCurWgs84SatelliteTime()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,14 +116,11 @@ public class TrackObj {
|
||||
lat = matchedPoint[1];
|
||||
s2LatLng = S2LatLng.fromDegrees(cacheData.getLatitude(), cacheData.getLongitude());
|
||||
s2CellId = S2CellId.fromLatLng(s2LatLng).parent(22);
|
||||
// Log.d("hy uuid : " + cacheData.getUuid(), " 更新定位 lon : " + matchedPoint[0] + " , lat : " + matchedPoint[1]);
|
||||
} else {
|
||||
centerLineInfo = null;
|
||||
// Log.d("hy uuid : " + cacheData.getUuid(), "计算结果出现问题 : " + matchedPoint[0] + " , " + matchedPoint[1]);
|
||||
}
|
||||
} else {
|
||||
centerLineInfo = null;
|
||||
// Log.d("hy uuid : " + cacheData.getUuid(), "未获取到道路数据");
|
||||
}
|
||||
}
|
||||
cacheData = cacheData.toBuilder().setLongitude(lon).setLatitude(lat).build();
|
||||
|
||||
@@ -395,7 +395,6 @@ class MogoPrivateObuManager private constructor() {
|
||||
// val currentTime = TimeUtils.getNowMills() % 60000
|
||||
// val delayTime = currentTime - hvTime
|
||||
|
||||
// Log.e("liyz", "onCvxIvpThreatIndInfo ---> currentTime = $currentTime ----- hvTime---> $hvTime ---hvMillTime = $hvMillTime ----hvSecondMillTime = $hvSecondMillTime ---delayTime---> $delayTime")
|
||||
// CallerObuListenerManager.invokeDelayTime(delayTime)
|
||||
// CallerLogger.e(
|
||||
// "$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
@@ -423,7 +422,6 @@ class MogoPrivateObuManager private constructor() {
|
||||
// val currentTime = TimeUtils.getNowMills() % 60000
|
||||
// val delayTime = currentTime - hvTime
|
||||
|
||||
// Log.e("liyz", "onCvxPtcThreatIndInfo ---> currentTime = $currentTime ----- hvTime---> $hvTime ---hvMillTime = $hvMillTime ----hvSecondMillTime = $hvSecondMillTime ---delayTime---> $delayTime")
|
||||
// CallerObuListenerManager.invokeDelayTime(delayTime)
|
||||
// CallerLogger.d(
|
||||
// "$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
|
||||
@@ -42,6 +42,7 @@ class ChainConstant {
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_VEHICLE = "PAD_ADAS_MESSAGE_AUTOPILOT_VEHICLE"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_TRAFFIC_LIGHT = "PAD_ADAS_MESSAGE_AUTOPILOT_TRAFFIC_LIGHT"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_OBJECTS = "CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_OBJECTS"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_STATUS_QUERY_RESP = "CHAIN_ALIAS_CODE_ADAS_STATUS_QUERY_RESP"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_WARN = "PAD_ADAS_MESSAGE_AUTOPILOT_WARN"
|
||||
|
||||
const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL"
|
||||
|
||||
@@ -107,7 +107,7 @@ interface IDevaToolsProvider : IProvider {
|
||||
/**
|
||||
* 展示状态栏
|
||||
*/
|
||||
fun showStatusBar(ctx: Context)
|
||||
fun showStatusBar(ctx: Context, anchor: View)
|
||||
|
||||
/**
|
||||
* 隐藏状态栏
|
||||
|
||||
@@ -2,13 +2,15 @@ package com.mogo.eagle.core.function.call.devatools
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.*
|
||||
import com.mogo.eagle.core.data.config.*
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneTAG
|
||||
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.mogo.*
|
||||
import record_cache.RecordPanelOuterClass
|
||||
|
||||
object CallerDevaToolsManager {
|
||||
@@ -148,14 +150,27 @@ object CallerDevaToolsManager {
|
||||
/**
|
||||
* 展示状态栏
|
||||
*/
|
||||
fun showStatusBar(ctx: Context) {
|
||||
devaToolsProviderApi?.showStatusBar(ctx)
|
||||
fun showStatusBar(ctx: Context, anchor: View) {
|
||||
if (!AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
if (anchor.isLaidOut) {
|
||||
devaToolsProviderApi?.showStatusBar(ctx, anchor)
|
||||
} else {
|
||||
anchor.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
|
||||
override fun onGlobalLayout() {
|
||||
devaToolsProviderApi?.showStatusBar(ctx, anchor)
|
||||
anchor.viewTreeObserver.removeOnGlobalLayoutListener(this)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏状态栏
|
||||
*/
|
||||
fun hideStatusBar() {
|
||||
devaToolsProviderApi?.hideStatusBar()
|
||||
if (!AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
devaToolsProviderApi?.hideStatusBar()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import android.util.ArrayMap
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_CHAT
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
|
||||
@@ -37,6 +38,9 @@ class Scene {
|
||||
//初始化ADAS
|
||||
val adasMap = SceneLogCache(mutableMapOf(), true)
|
||||
sceneCache[M_ADAS_IMPL] = adasMap
|
||||
//初始化CallChat
|
||||
val callChatMap = SceneLogCache(mutableMapOf(), false)
|
||||
sceneCache[M_CHAT] = callChatMap
|
||||
//初始化deva
|
||||
val devaMap = SceneLogCache(mutableMapOf(), false)
|
||||
sceneCache[M_DEVA] = devaMap
|
||||
|
||||
@@ -82,7 +82,7 @@ MOGO_LOCATION_VERSION=1.4.3.8
|
||||
MOGO_TELEMATIC_VERSION=1.4.3.8
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=2.3.1.1
|
||||
MAP_SDK_VERSION=2.4.0.1
|
||||
MAP_SDK_OPERATION_VERSION=1.0.13
|
||||
# websocket
|
||||
WEBSOCKET_VERSION=1.1.7
|
||||
|
||||
@@ -506,7 +506,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public MogoLatLng getWindowCenterLocation() {
|
||||
try {
|
||||
return ObjectUtils.fromAMap(mMapView.getMapAutoViewHelper().getCenter());
|
||||
if (checkAMapView()) {
|
||||
return ObjectUtils.fromAMap(mMapView.getMapAutoViewHelper().getCenter());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -646,8 +648,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
*/
|
||||
@Override
|
||||
public void setCarLightsType(int type, int time) {
|
||||
Log.d("liyz", "AMapViewWrapper setCarLightsType type = " + type + "---time = " + time);
|
||||
mMapView.getMapAutoViewHelper().setTailLightsType(type, time);
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setTailLightsType(type, time);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -811,16 +814,18 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onMapLoaded() {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--onMapLoaded: ");
|
||||
mMapLoaded = true;
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
MogoMapListenerHandler.getInstance().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
|
||||
cameraPosition.getZoom(),
|
||||
cameraPosition.getTilt(),
|
||||
cameraPosition.getBearing());
|
||||
Trace.endSection();
|
||||
initMapView();
|
||||
initMyLocation();
|
||||
loadPreVehicleModel();
|
||||
if (checkAMapView()) {
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
MogoMapListenerHandler.getInstance().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
|
||||
cameraPosition.getZoom(),
|
||||
cameraPosition.getTilt(),
|
||||
cameraPosition.getBearing());
|
||||
Trace.endSection();
|
||||
initMapView();
|
||||
initMyLocation();
|
||||
loadPreVehicleModel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -995,7 +1000,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
bean.setAcceleration(gnssInfo.getAcceleration());
|
||||
bean.setAlt(gnssInfo.getAltitude());
|
||||
bean.setSystemTime(Double.valueOf(gnssInfo.getSystemTime()).longValue());
|
||||
bean.setSatelliteTime(Double.valueOf(gnssInfo.getSatelliteTime()).longValue());
|
||||
bean.setSatelliteTime(Double.valueOf(gnssInfo.getSatelliteTime()*1000).longValue());
|
||||
bean.setLon(gnssInfo.getLongitude());
|
||||
bean.setLat(gnssInfo.getLatitude());
|
||||
bean.setGnss_speed(((float) gnssInfo.getGnssSpeed()));
|
||||
@@ -1037,7 +1042,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void setMapDAngle(float angle) {
|
||||
mMapView.getMapAutoViewHelper().setMapDAngle(angle);
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setMapDAngle(angle);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -257,7 +257,6 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
public void setCarLightsType(int type, int time) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
// Log.d("liyz", "MogoMapUIController type = " + type + "---time = " + time);
|
||||
mDelegate.setCarLightsType(type, time);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +223,6 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public void setCarLightsType(int type, int time) {
|
||||
// Log.d("liyz", "AMapUIController type = " + type + "---time = " + time);
|
||||
if (mClient != null) {
|
||||
mClient.setCarLightsType(type, time);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
String cityCode = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_CITY_CODE);
|
||||
String lat = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LATITUDE);
|
||||
String logt = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LONGITUDE);
|
||||
Log.d("liyz", "cityCode = " + cityCode + " --lat = " +lat + " --logt = " + logt);
|
||||
// Log.d("liyz", "cityCode = " + cityCode + " --lat = " +lat + " --logt = " + logt);
|
||||
//地图版本
|
||||
String mapSDKVersion = AppUtils.getCustomMapSDKVersion(context);
|
||||
map.put("MAP_SDK_VERSION", mapSDKVersion);
|
||||
|
||||
Reference in New Issue
Block a user