This commit is contained in:
wangcongtao
2020-10-25 15:51:28 +08:00
40 changed files with 946 additions and 92 deletions

View File

@@ -79,6 +79,7 @@ import java.util.Random;
import static com.mogo.module.common.utils.SPConst.getSPGuideRecord;
import static com.mogo.module.common.utils.SPConst.getSpGuide;
import static com.mogo.module.extensions.ExtensionsModuleConst.TYPE_ENTRANCE;
import static com.mogo.module.share.constant.ShareConstants.KEY_CLICK_SHARE_BUTTON;
import static com.mogo.module.share.constant.ShareConstants.KEY_CLICK_SHARE_TIME;
import static com.mogo.module.share.constant.ShareConstants.KEY_SERVER_SHOW_DAY_COUNT;
@@ -170,6 +171,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
private boolean toggle = false;
private View mOnlineCarEntrance;
private TextView tvEnterVrMode;
private TextView tvExitVrMode;
private Runnable mLockCarRunnable = new Runnable() {
@Override
@@ -387,6 +390,17 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track( "APP_Find_Mogoer", properties );
}
} );
tvEnterVrMode = findViewById(R.id.module_ext_enter_vr_mode);
tvEnterVrMode.setOnClickListener((v)->{
// 进入vr模式
enterVrMode();
});
tvExitVrMode = findViewById(R.id.module_ext_exit_vr_mode);
tvExitVrMode.setOnClickListener((v)->{
// 退出vr模式
exitVrMode();
});
dealWeatherContainer();
@@ -394,6 +408,28 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
debugCrashWarn();
}
private void enterVrMode(){
mApis.getStatusManagerApi().setVrMode(TYPE_ENTRANCE, true);
tvEnterVrMode.setVisibility(View.GONE);
mMove2CurrentLocation.setVisibility(View.GONE);
mUploadRoadCondition.setVisibility(View.GONE);
mWeatherContainer.setVisibility(View.GONE);
mMsgContainer.setVisibility(View.GONE);
tvExitVrMode.setVisibility(View.VISIBLE);
}
private void exitVrMode(){
mApis.getStatusManagerApi().setVrMode(TYPE_ENTRANCE, false);
tvEnterVrMode.setVisibility(View.VISIBLE);
mMove2CurrentLocation.setVisibility(View.VISIBLE);
mUploadRoadCondition.setVisibility(View.VISIBLE);
// mWeatherContainer.setVisibility(View.VISIBLE);
// mMsgContainer.setVisibility(View.VISIBLE);
tvExitVrMode.setVisibility(View.GONE);
}
private void debugCrashWarn(){
thresholdSetContainer = findViewById(R.id.thresholdSetContainer);
topEditC = findViewById(R.id.etTopC);
@@ -649,8 +685,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mMogoNavi = mService.getNavi(getContext());
mAnalytics = mApis.getAnalyticsApi();
mMogoRegisterCenter.registerMogoNaviListener(ExtensionsModuleConst.TYPE_ENTRANCE, this);
mMogoRegisterCenter.registerMogoMapListener(ExtensionsModuleConst.TYPE_ENTRANCE, this);
mMogoRegisterCenter.registerMogoNaviListener(TYPE_ENTRANCE, this);
mMogoRegisterCenter.registerMogoMapListener(TYPE_ENTRANCE, this);
mMogoRegisterCenter.registerMogoAimlessModeListener(TAG, this);
mMogoMarkerManager = mService.getMarkerManager(getContext());
@@ -817,6 +853,9 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
@Override
public void renderWeatherInfo(String temp, String desc, int iconId) {
if(mApis.getStatusManagerApi().isVrMode()){
return;
}
boolean hidden = false;
if (iconId != 0) {
mWeatherIcon.setImageResource(iconId);
@@ -833,6 +872,9 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
@Override
public void renderMsgInfo(boolean hasMsg, int amount) {
if (mApis.getStatusManagerApi().isVrMode()) {
return;
}
mMsgContainer.setVisibility(hasMsg ? View.VISIBLE : View.GONE);
mMsgCounter.setText(amount > MAX_DISPLAY_MSG_AMOUNT ?
getString(R.string.module_ext_str_dots) : String.valueOf(amount));
@@ -954,8 +996,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
public void onDestroy() {
super.onDestroy();
if (mMogoRegisterCenter != null) {
mMogoRegisterCenter.unregisterMogoNaviListener(ExtensionsModuleConst.TYPE_ENTRANCE);
mMogoRegisterCenter.unregisterMogoMapListener(ExtensionsModuleConst.TYPE_ENTRANCE);
mMogoRegisterCenter.unregisterMogoNaviListener(TYPE_ENTRANCE);
mMogoRegisterCenter.unregisterMogoMapListener(TYPE_ENTRANCE);
mMogoRegisterCenter.unregisterMogoAimlessModeListener(TAG);
}
if (mStatusManager != null) {

View File

@@ -1,5 +1,6 @@
package com.mogo.module.extensions.utils;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
@@ -90,6 +91,7 @@ public class EntranceViewHolder {
View v = wrapper.getView();
v.setLayoutParams(params);
rootViewGroup.addView(v, 0);
// rootViewGroup.setBackgroundColor(Color.WHITE);
}
public void removeBottomLayerView(View view) {

View File

@@ -5,7 +5,7 @@
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<View
android:id="@+id/module_map_id_navi_bg"
android:layout_width="match_parent"
android:layout_width="@dimen/module_ext_navi_info_panel_width"
android:layout_height="@dimen/module_ext_navi_info_panel_height"
android:background="@drawable/module_ext_dw_navi_info_panel_bkg"
android:focusable="true"

View File

@@ -31,7 +31,7 @@
android:textSize="@dimen/module_ext_north_textSize"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintRight_toRightOf="@+id/module_entrance_id_upload_road_condition"
app:layout_constraintRight_toRightOf="@+id/module_entrance_id_move2_current_location"
app:layout_constraintTop_toBottomOf="@+id/module_map_id_navi_bg"
app:layout_goneMarginTop="@dimen/module_ext_north_goneMarginTop"
tools:visibility="visible" />
@@ -61,13 +61,12 @@
<com.mogo.module.extensions.navi.TopView
android:id="@+id/module_entrance_id_top_container"
android:layout_width="match_parent"
android:layout_width="@dimen/module_ext_top_view_width"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
app:layout_constraintLeft_toLeftOf="parent" />
<LinearLayout
android:id="@+id/module_ext_id_display_overview"
@@ -101,6 +100,20 @@
android:textStyle="bold" />
</LinearLayout>
<TextView
android:id="@+id/module_ext_enter_vr_mode"
android:layout_marginRight="@dimen/module_common_shadow_width_pos"
android:layout_width="@dimen/module_ext_operation_panel_share_width"
android:layout_height="@dimen/module_ext_operation_panel_share_height"
android:background="@drawable/module_ext_dw_upload_road_condition_bkg"
android:text="VR"
android:textSize="@dimen/module_ext_enter_vr_mode_text_size"
android:textColor="#fff"
app:layout_constraintRight_toRightOf="@+id/module_entrance_id_move2_current_location"
app:layout_constraintBottom_toTopOf="@+id/module_entrance_id_move2_current_location"
android:layout_marginBottom="@dimen/module_ext_enter_vr_mode_margin_bottom"
android:gravity="center"/>
<ImageButton
android:id="@+id/module_entrance_id_move2_current_location"
android:layout_width="@dimen/module_ext_operation_panel_width"
@@ -111,40 +124,19 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<FrameLayout
android:id="@+id/module_entrance_id_upload_road_condition"
android:layout_width="@dimen/module_ext_operation_panel_share_width"
android:layout_height="@dimen/module_ext_operation_panel_share_height"
android:layout_marginBottom="@dimen/module_ext_operation_panel_share_marginBottom"
android:layout_marginEnd="@dimen/module_common_shadow_width_pos"
android:background="@drawable/module_ext_dw_upload_road_condition_bkg"
app:layout_constraintBottom_toTopOf="@+id/module_entrance_id_move2_current_location"
app:layout_constraintRight_toRightOf="@+id/module_entrance_id_move2_current_location"
app:layout_goneMarginBottom="@dimen/module_ext_operation_panel_share_goneMarginBottom">
<TextView
android:id="@+id/module_ext_exit_vr_mode"
android:layout_width="@dimen/module_ext_operation_panel_width"
android:layout_height="@dimen/module_ext_operation_panel_move2_height"
android:text="退出"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:visibility="gone"
android:background="@drawable/module_ext_shadow_bkg"
android:textSize="@dimen/module_ext_exit_vr_mode_text_size"
android:textColor="#fff"
android:gravity="center" />
<TextView
android:id="@+id/module_entrance_id_upload"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/module_map_str_upload_road_condition"
android:textColor="#FFFFFF"
android:textSize="@dimen/module_ext_operation_panel_share_textSize"
android:textStyle="bold"
tools:visibility="gone" />
<ImageView
android:id="@+id/module_entrance_id_uploading"
android:layout_width="@dimen/module_entrance_id_uploading_width"
android:layout_height="@dimen/module_entrance_id_uploading_height"
android:layout_gravity="center"
android:gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/module_ext_ic_uploading_00010"
android:textColor="#FFFFFF"
android:visibility="gone"
tools:visibility="visible" />
</FrameLayout>
<LinearLayout
android:id="@+id/module_entrance_id_buttons_container"
@@ -196,6 +188,36 @@
android:textStyle="bold"
android:visibility="gone"
tools:visibility="visible" />
<FrameLayout
android:id="@+id/module_entrance_id_upload_road_condition"
android:layout_marginTop="@dimen/module_entrance_id_button_marginTop"
android:layout_width="@dimen/module_ext_operation_panel_share_width"
android:layout_height="@dimen/module_ext_operation_panel_share_height"
android:background="@drawable/module_ext_dw_upload_road_condition_bkg">
<TextView
android:id="@+id/module_entrance_id_upload"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/module_map_str_upload_road_condition"
android:textColor="#FFFFFF"
android:textSize="@dimen/module_ext_operation_panel_share_textSize"
android:textStyle="bold"
tools:visibility="gone" />
<ImageView
android:id="@+id/module_entrance_id_uploading"
android:layout_width="@dimen/module_entrance_id_uploading_width"
android:layout_height="@dimen/module_entrance_id_uploading_height"
android:layout_gravity="center"
android:gravity="center"
android:scaleType="fitCenter"
android:src="@drawable/module_ext_ic_uploading_00010"
android:textColor="#FFFFFF"
android:visibility="gone"
tools:visibility="visible" />
</FrameLayout>
</LinearLayout>
@@ -268,6 +290,7 @@
android:visibility="gone"
app:constraint_referenced_ids="btnShowDrawableTipNoSize,btnShowDrawableTip,btnShowTextTip,btnDebugCtrlNaviView,btnDebugCtrlSubView,btnDebugCtrlTopView,btnDebugAddBottomLayerView" />
<include layout="@layout/module_ext_layout_crash_threshold_set" />
<include layout="@layout/module_ext_layout_crash_threshold_set"
android:visibility="gone"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -78,7 +78,8 @@
<dimen name="module_ext_user_img_height">103px</dimen>
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_navi_info_panel_width">1058px</dimen>
<dimen name="module_ext_top_view_width">1058px</dimen>
<dimen name="module_ext_navi_info_panel_width">1038px</dimen>
<dimen name="module_ext_navi_info_panel_height">210px</dimen>
<dimen name="module_ext_navi_info_panel_small_height">144px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_width">159px</dimen>
@@ -145,7 +146,7 @@
<dimen name="module_ext_display_overview_icon_marginTop">20px</dimen>
<dimen name="module_ext_top_over_navi_height">34px</dimen>
<dimen name="module_ext_notice_margin_start">161px</dimen>
<dimen name="module_ext_notice_margin_start">10px</dimen>
<dimen name="module_ext_weather_margin_start">10px</dimen>
<dimen name="module_ext_msg_counter_margin">45px</dimen>
<dimen name="module_ext_user_avator_size">120px</dimen>

View File

@@ -83,6 +83,7 @@
<dimen name="module_ext_user_img_height">56px</dimen>
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_top_view_width">1058px</dimen>
<dimen name="module_ext_navi_info_panel_width">544px</dimen>
<dimen name="module_ext_navi_info_panel_height">117px</dimen>
<dimen name="module_ext_navi_info_panel_small_height">80px</dimen>
@@ -162,4 +163,8 @@
<dimen name="module_ext_destination_online_car_paddingRight">14px</dimen>
<dimen name="module_common_shadow_width_pos">8px</dimen>
<dimen name="module_ext_enter_vr_mode_text_size">44px</dimen>
<dimen name="module_ext_exit_vr_mode_text_size">30px</dimen>
<dimen name="module_ext_exit_vr_mode_width">120px</dimen>
<dimen name="module_ext_enter_vr_mode_margin_bottom">170px</dimen>
</resources>

View File

@@ -26,6 +26,6 @@
<dimen name="module_main_entrance_fragment_container_padding_top">16px</dimen>
<dimen name="module_main_entrance_fragment_container_width">658px</dimen>
<dimen name="module_event_fragment_container_padding">8px</dimen>
<dimen name="module_main_apps_fragment_container_paddingTop">2px</dimen>
<dimen name="module_main_apps_fragment_container_paddingTop">8px</dimen>
</resources>

View File

@@ -9,6 +9,7 @@ import android.widget.SeekBar.OnSeekBarChangeListener
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.voice.AIAssist
import com.mogo.map.uicontroller.EnumMapUI
import com.mogo.module.common.MogoApisHandler
import com.mogo.module.navi.R
import com.mogo.module.navi.bean.SearchPoi
import com.mogo.module.navi.constants.DataConstants
@@ -232,7 +233,11 @@ class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
tb_custom_map.isChecked = DebugConfig.isUseCustomMap()
tb_custom_map.setOnCheckedChangeListener{ _, isChecked ->
TipToast.shortTip("设置完成,下次启动生效")
SharedPrefsMgr.getInstance(context!!).putBoolean("useCustomMap", isChecked)
if (isChecked) {
MogoApisHandler.getInstance().apis.mapFrameControllerApi.changeToVRMode()
} else {
MogoApisHandler.getInstance().apis.mapFrameControllerApi.changeTo2dMode()
}
}
tb_navi.isChecked = SettingManager.isMonitor()
tb_gps.isChecked = SettingManager.isGpsSimulator()

View File

@@ -6,7 +6,6 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.location.Location;
import android.net.ConnectivityManager;
import android.net.wifi.WifiManager;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -20,6 +19,7 @@ import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.ParamsProvider;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.storage.SpStorage;
import com.mogo.commons.utils.MortonCode;
import com.mogo.commons.voice.AIAssist;
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
import com.mogo.map.IDestroyable;
@@ -53,9 +53,9 @@ import com.mogo.module.service.refresh.AutoRefreshStrategy;
import com.mogo.module.service.refresh.CustomRefreshStrategy;
import com.mogo.module.service.refresh.RefreshObject;
import com.mogo.module.service.strategy.CarIconDisplayStrategy;
import com.mogo.module.service.websocket.LocationResult;
import com.mogo.service.adas.IMogoADASController;
import com.mogo.service.cardmanager.IMogoCardManager;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
import com.mogo.service.intent.IMogoIntentListener;
@@ -105,6 +105,7 @@ public class MogoServices implements IMogoMapListener,
IDestroyable {
private boolean mInternalUnWakeupRegisterStatus = false;
private Location mLastCarLocation;
private MogoServices() {
// private constructor
@@ -426,6 +427,8 @@ public class MogoServices implements IMogoMapListener,
}
AutoPilotRemoteController.getInstance().start();
mThreadHandler.sendEmptyMessageDelayed( ServiceConst.MSG_SEND_CAR_LOCATION_AND_ADAS_RECOGNIZED_RESULT_2_SERVER, 0 );
}
private void initLocationServiceProcess( Context context ) {
@@ -440,6 +443,23 @@ public class MogoServices implements IMogoMapListener,
}
}
private void startSendCarLocationAndAdasRecognizedResult2Server() {
Location lastCarLocation = mLastCarLocation;
if ( lastCarLocation != null ) {
LocationResult locationResult = new LocationResult();
locationResult.alt = lastCarLocation.getAltitude();
locationResult.heading = lastCarLocation.getBearing();
locationResult.lat = lastCarLocation.getLatitude();
locationResult.lon = lastCarLocation.getLongitude();
locationResult.satelliteTime = lastCarLocation.getTime();
locationResult.systemTime = System.currentTimeMillis();
locationResult.speed = lastCarLocation.getSpeed();
locationResult.mortonCode = MortonCode.wrapEncodeMorton( locationResult.lon, locationResult.lat );
}
List< ADASRecognizedResult > recognizedResults = MarkerServiceHandler.getADASController().getLastADASRecognizedResult();
}
private void initWorkThread() {
mThreadHandler = new Handler( WorkThreadHandler.getInstance().getLooper() ) {
@Override
@@ -473,6 +493,9 @@ public class MogoServices implements IMogoMapListener,
}
mStatusManager.setUserInteractionStatus( TAG, true, false );
mUiController.recoverLockMode();
} else if ( msg.what == ServiceConst.MSG_SEND_CAR_LOCATION_AND_ADAS_RECOGNIZED_RESULT_2_SERVER ) {
startSendCarLocationAndAdasRecognizedResult2Server();
mThreadHandler.sendEmptyMessageDelayed( ServiceConst.MSG_SEND_CAR_LOCATION_AND_ADAS_RECOGNIZED_RESULT_2_SERVER, ServiceConst.INTERVAL_SEND_CAR_LOCATION_AND_ADAS_RECOGNIZED_RESULT_2_SERVER );
}
}
};
@@ -748,6 +771,7 @@ public class MogoServices implements IMogoMapListener,
if ( latLng == null ) {
return;
}
mLastCarLocation = latLng;
// poi 定位无法获取时,使用该定位
if ( mLastAutoRefreshLocation == null ) {
MogoLatLng point = new MogoLatLng( latLng.getLatitude(), latLng.getLongitude() );

View File

@@ -218,4 +218,14 @@ public class ServiceConst {
*/
public static final long INTERVAL_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH = 60 * 1_000L;
/**
* 发送自车位置和adas识别结果给服务端
*/
public static final int MSG_SEND_CAR_LOCATION_AND_ADAS_RECOGNIZED_RESULT_2_SERVER = 0x401;
/**
* 间隔 1s 发送一次
*/
public static final long INTERVAL_SEND_CAR_LOCATION_AND_ADAS_RECOGNIZED_RESULT_2_SERVER = 1 * 1_000L;
}

View File

@@ -0,0 +1,139 @@
package com.mogo.module.service.utils;
import java.util.Arrays;
/**
* 莫顿编码
*
* @author linyang
* @since 2020.07.09
*/
public class MortonCode {
/**
* morton 转 经纬度 时的中间常量
*/
private static final long NDS_180_DEGREES = 0x7fffffff;
/**
* morton 转 经纬度 时的中间常量
*/
private static final long NDS_360_DEGREES = 4294967295L;
/**
* morton 转 经纬度 时的中间常量
*/
private static final long NDS_90_DEGREES = 0x3fffffff;
/**
* 经纬度转 morton 时的中间常量
*/
private static final double RULE_MORTON = Math.pow( 2, 32 ) / 360;
/**
* morton 转 经纬度 时的中间常量
*/
private static final double RULE_MORTON_TO_LONLAT = 360.0 / Math.pow( 2, 32 );
/**
* 编码 morton code
*
* @param lon
* @param lat
* @return
*/
public static long encodeMorton( Double lon, Double lat ) {
Long bit = 1L;
long mortonCode = 0L;
long x = ( long ) ( lon * RULE_MORTON );
long y = ( long ) ( lat * RULE_MORTON );
if ( y < 0 ) {
y += 0x7FFFFFFF;
}
y = y << 1;
for ( int i = 0; i < 32; i++ ) {
// x-part
mortonCode = mortonCode | ( x & bit );
x = x << 1;
bit = bit << 1;
// y-part
mortonCode = mortonCode | ( y & bit );
y = y << 1;
bit = bit << 1;
}
return mortonCode;
}
/**
* 将莫顿码解码为坐标
*
* @param mortonCode
* @return
*/
public static double[] decodeMorton( long mortonCode ) {
long[] midPoint = mortonCodeToCoord( mortonCode );
normalizeCoord( midPoint );
double[] point = new double[2];
// 将经纬度长整数转化为 浮点类型
point[0] = midPoint[0] * RULE_MORTON_TO_LONLAT;
point[1] = midPoint[1] * RULE_MORTON_TO_LONLAT;
return point;
}
/**
* 莫顿码分别拆解为 编码后的经纬度长整数
*
* @param mortonCode
* @return
*/
private static long[] mortonCodeToCoord( long mortonCode ) {
long bit = 1L;
long[] longPoint = new long[2];
for ( int i = 0; i < 32; i++ ) {
longPoint[0] |= mortonCode & bit;
mortonCode >>= 1;
longPoint[1] |= mortonCode & bit;
bit <<= 1;
}
return longPoint;
}
/**
* 对编码后的经纬度长整数进行解码
*
* @param midPoint
*/
private static void normalizeCoord( long[] midPoint ) {
// if x > 180 degrees, then subtract 360 degrees
if ( midPoint[0] > NDS_180_DEGREES ) {
midPoint[0] -=
NDS_360_DEGREES + 1; // add 1 because 0 must be counted as well
} else if ( midPoint[0] < -NDS_180_DEGREES ) // if x < 180 , x += 360
{
midPoint[0] +=
NDS_360_DEGREES + 1; // add 1 because 0 must be counted as well
}
// if y > 90 degrees, then subtract 180 degrees
if ( midPoint[1] > NDS_90_DEGREES ) {
midPoint[1] -=
NDS_180_DEGREES + 1; // add 1 because 0 must be counted as well
} else if ( midPoint[1] < -NDS_90_DEGREES ) // if y < 90, y += 180
{
midPoint[1] +=
NDS_180_DEGREES + 1; // add 1 because 0 must be counted as well
}
return;
}
public static void main( String[] args ) {
System.out.println( encodeMorton( 116.39584, 39.98152 ) );
System.out.println( Arrays.toString( decodeMorton( 1415388919630379091L ) ) );
}
}

View File

@@ -0,0 +1,21 @@
package com.mogo.module.service.websocket;
public
/**
* @author congtaowang
* @since 2020/10/25
*
* 自车定位信息
*/
class LocationResult {
public String sn;
public double lat;
public double lon;
public double heading;
public long systemTime;
public long satelliteTime;
public double alt;
public double speed;
public long mortonCode;
}

View File

@@ -0,0 +1,18 @@
package com.mogo.module.service.websocket;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import java.util.List;
public
/**
* @author congtaowang
* @since 2020/10/25
*
* 一秒一次的上行数据
*/
class OnePerSecondSendContent {
public LocationResult self;
public List< ADASRecognizedResult > adas;
}

View File

@@ -106,6 +106,7 @@ import com.mogo.utils.TipToast;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
import com.shuyu.gsyvideoplayer.GSYVideoManager;
import com.shuyu.gsyvideoplayer.utils.GSYVideoType;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@@ -128,6 +129,7 @@ import static com.mogo.module.tanlu.constant.TanluConstants.PLAY_VIDEO_AWAKEN;
import static com.mogo.module.tanlu.constant.TanluConstants.SPECIFIEDROAD_SEARCH;
import static com.mogo.module.tanlu.constant.TanluConstants.TXZ_SPECIFIEDROAD_SEARCH;
import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
import static com.shuyu.gsyvideoplayer.utils.GSYVideoType.SCREEN_MATCH_FULL;
/**
* @author lixiaopeng
@@ -205,6 +207,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
protected void initViews() {
LayoutInflater.from(mContext).inflate(R.layout.tanlu_main_media_recycler_new, this);
initVideo();
GSYVideoType.setShowType(SCREEN_MATCH_FULL);
mLoopRecyclerView = findViewById(R.id.tanlu_rloop_recycleview);
mLoopRecyclerView.setHasFixedSize(true);
mLoopRecyclerView.setOverScrollMode(OVER_SCROLL_NEVER);

View File

@@ -10,7 +10,9 @@ import androidx.constraintlayout.widget.ConstraintLayout
import androidx.fragment.app.Fragment
import androidx.viewpager2.widget.ViewPager2
import com.google.android.material.tabs.TabLayoutMediator
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.mvp.MvpFragment
import com.mogo.module.common.MogoApisHandler
import com.mogo.module.v2x.R
import com.mogo.module.v2x.V2XConst.MODULE_NAME
import com.mogo.module.v2x.V2XServiceManager
@@ -21,6 +23,8 @@ import com.mogo.module.v2x.view.V2XEventPanelHistoryCountView
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener
import com.mogo.module.v2x.voice.V2XVoiceConstants
import com.mogo.module.v2x.voice.V2XVoiceManager
import com.mogo.service.statusmanager.IMogoStatusChangedListener
import com.mogo.service.statusmanager.StatusDescriptor
import com.mogo.utils.logger.Logger
@@ -29,7 +33,7 @@ import com.mogo.utils.logger.Logger
*
* @author tongchenfei
*/
class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPresenter>() {
class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPresenter>(),IMogoStatusChangedListener {
private val TAG = "EventPanelFragment"
@@ -177,15 +181,32 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
}
}
}
val x = resources.getDimensionPixelSize(if (DebugConfig.isLauncher()) {
R.dimen.module_v2x_event_panel_in_launcher_btn_x
} else {
R.dimen.module_v2x_event_panel_btn_x
})
val y = resources.getDimensionPixelSize(R.dimen.module_v2x_event_panel_btn_y)
V2XServiceManager.getMogoEntranceButtonController()
.addBottomLayerView(mV2XEventPanelHistoryCountView)
.addBottomLayerView(mV2XEventPanelHistoryCountView, x, y)
mV2XEventPanelHistoryCountView?.visibility = if (MogoApisHandler.getInstance().apis.statusManagerApi.isVrMode) {
View.GONE
}else{
View.VISIBLE
}
changeEventCount()
MogoApisHandler.getInstance().apis.statusManagerApi.registerStatusChangedListener(MODULE_NAME, StatusDescriptor.VR_MODE, this)
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun onDestroyView() {
MogoApisHandler.getInstance().apis.statusManagerApi.unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.VR_MODE, this)
mediator?.detach()
// 避免内存泄漏
fragment = null
@@ -239,4 +260,13 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
// mV2XEventPanelHistoryCountView?.changeMsgCount(0)
// }
}
override fun onStatusChanged(descriptor: StatusDescriptor?, isTrue: Boolean) {
if (isTrue) {
// 在vr模式
mV2XEventPanelHistoryCountView?.visibility = View.GONE
}else{
mV2XEventPanelHistoryCountView?.visibility = View.VISIBLE
}
}
}

View File

@@ -22,10 +22,12 @@ import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.alarm.V2XAlarmServer;
import com.mogo.module.v2x.network.V2XRefreshCallback;
import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
import com.mogo.module.v2x.scenario.scene.obu.V2XObuEventScenario;
import com.mogo.module.v2x.utils.ADASUtils;
import com.mogo.module.v2x.utils.DrivingDirectionUtils;
import com.mogo.module.v2x.utils.LocationUtils;
import com.mogo.module.v2x.utils.MarkerUtils;
import com.mogo.module.v2x.utils.ObuConfig;
import com.mogo.module.v2x.utils.TrackUtils;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
@@ -165,6 +167,10 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList
v2XMessageEntity.setShowState(true);
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity);
}
if (!ObuConfig.useObuLocation) {
// 绿波车速引导刷新划线
V2XObuEventScenario.getInstance().updateLocation(location);
}
}
public MogoLocation getLastCarLocation() {

View File

@@ -99,4 +99,7 @@
<dimen name="module_v2x_event_parking_text_size">19px</dimen>
<!--适配 V2X 弹窗 UI-->
<dimen name="module_v2x_event_panel_btn_x">572px</dimen>
<dimen name="module_v2x_event_panel_in_launcher_btn_x">480px</dimen>
<dimen name="module_v2x_event_panel_btn_y">384px</dimen>
</resources>

View File

@@ -100,4 +100,8 @@
<dimen name="module_v2x_event_parking_text_size">19px</dimen>
<!--适配 V2X 弹窗 UI-->
<dimen name="module_v2x_event_panel_btn_x">574px</dimen>
<dimen name="module_v2x_event_panel_in_launcher_btn_x">480px</dimen>
<dimen name="module_v2x_event_panel_btn_y">384px</dimen>
</resources>

View File

@@ -82,4 +82,6 @@
<dimen name="module_v2x_event_parking_text_size">34px</dimen>
<!--适配 V2X 弹窗 UI-->
<dimen name="module_v2x_event_panel_btn_x">940px</dimen>
<dimen name="module_v2x_event_panel_btn_y">701px</dimen>
</resources>

View File

@@ -98,4 +98,8 @@
<dimen name="module_v2x_event_parking_text_size">34px</dimen>
<!--适配 V2X 弹窗 UI-->
<dimen name="module_v2x_event_panel_btn_x">940px</dimen>
<dimen name="module_v2x_event_panel_in_launcher_btn_x">940px</dimen>
<dimen name="module_v2x_event_panel_btn_y">701px</dimen>
</resources>

View File

@@ -91,4 +91,7 @@
<dimen name="module_v2x_event_parking_text_size">34px</dimen>
<!--适配 V2X 弹窗 UI-->
<dimen name="module_v2x_event_panel_btn_x">574px</dimen>
<dimen name="module_v2x_event_panel_in_launcher_btn_x">480px</dimen>
<dimen name="module_v2x_event_panel_btn_y">384px</dimen>
</resources>