opt
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
/**
|
||||
* 通过AI云下发的红绿灯状态
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class AITrafficLightEntity {
|
||||
private int type;
|
||||
|
||||
private double lat;
|
||||
private double lon;
|
||||
private long systemTime;
|
||||
/**红绿灯状态 1红 2绿 3黄*/
|
||||
private Integer lightStatus;//
|
||||
/**红绿灯剩余时间 读秒*/
|
||||
private Integer lightLeftTime;
|
||||
private double distance ;//距离
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public long getSystemTime() {
|
||||
return systemTime;
|
||||
}
|
||||
|
||||
public void setSystemTime(long systemTime) {
|
||||
this.systemTime = systemTime;
|
||||
}
|
||||
|
||||
public Integer getLightStatus() {
|
||||
return lightStatus;
|
||||
}
|
||||
|
||||
public void setLightStatus(Integer lightStatus) {
|
||||
this.lightStatus = lightStatus;
|
||||
}
|
||||
|
||||
public Integer getLightLeftTime() {
|
||||
return lightLeftTime;
|
||||
}
|
||||
|
||||
public void setLightLeftTime(Integer lightLeftTime) {
|
||||
this.lightLeftTime = lightLeftTime;
|
||||
}
|
||||
|
||||
public double getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance(double distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
}
|
||||
@@ -6,18 +6,19 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.entity.AITrafficLightEntity;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.service.adas.IMogoAdasWarnMessageCallback;
|
||||
import com.mogo.service.adas.MogoADASWarnType;
|
||||
import com.mogo.service.adas.entity.ADASWarnMessage;
|
||||
import com.mogo.service.connection.IMogoOnWebSocketMessageListener;
|
||||
import com.mogo.service.connection.WebSocketMsgType;
|
||||
import com.mogo.service.entrance.IMogoEntranceButtonController;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -29,7 +30,7 @@ import org.json.JSONObject;
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLocationListener,
|
||||
Handler.Callback {
|
||||
Handler.Callback , IMogoOnWebSocketMessageListener {
|
||||
private static final String TAG = "AdasNoticeHelper";
|
||||
|
||||
private static final int MSG_HIDE_TRAFFIC_LIGHT_BY_OBU = 1001;
|
||||
@@ -66,6 +67,7 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
context.registerReceiver(adasReceiver, filter);
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().addAdasWarnMessageCallback(this);
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerMogoLocationListener(TAG, this);
|
||||
MogoApisHandler.getInstance().getApis().getWebSocketManagerApi(context).registerOnWebSocketMessageListener(this);
|
||||
|
||||
// debug code
|
||||
tvSelfSpeed.setVisibility(View.VISIBLE);
|
||||
@@ -74,14 +76,16 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
}
|
||||
|
||||
public void exitVrMode() {
|
||||
isVrMode = false;
|
||||
tvSelfSpeed.setVisibility(View.GONE);
|
||||
tvTrafficLight.setVisibility(View.GONE);
|
||||
tvLimitSpeed.setVisibility(View.GONE);
|
||||
if(isVrMode) {
|
||||
isVrMode = false;
|
||||
tvSelfSpeed.setVisibility(View.GONE);
|
||||
tvTrafficLight.setVisibility(View.GONE);
|
||||
tvLimitSpeed.setVisibility(View.GONE);
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().removeAdasWarnMessageCallback(this);
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().unregisterMogoLocationListener(TAG);
|
||||
|
||||
context.unregisterReceiver(adasReceiver);
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().removeAdasWarnMessageCallback(this);
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().unregisterMogoLocationListener(TAG);
|
||||
context.unregisterReceiver(adasReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -200,7 +204,7 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
}
|
||||
}
|
||||
|
||||
private void handleCloudTrafficLight(){
|
||||
private void handleCloudTrafficLight(AITrafficLightEntity trafficLightEntity){
|
||||
if (tvTrafficLight != null && !handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU)) {
|
||||
handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD);
|
||||
// todo drawTrafficLight
|
||||
@@ -230,4 +234,9 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
Logger.d(TAG, "展示红绿灯信息: " + lightStatus + " time: " + surplusTime);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public WebSocketMsgType getDownLinkType() {
|
||||
return WebSocketMsgType.MSG_TYPE_DOWNLINK_CAR_DATA;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,6 @@
|
||||
android:width="65px"
|
||||
android:height="65px" />
|
||||
|
||||
<padding
|
||||
android:bottom="12px"
|
||||
android:top="12px"
|
||||
android:left="14px"
|
||||
android:right="14px" />
|
||||
|
||||
<solid android:color="#7f000000" />
|
||||
|
||||
|
||||
@@ -5,12 +5,6 @@
|
||||
android:width="65px"
|
||||
android:height="65px" />
|
||||
|
||||
<padding
|
||||
android:bottom="12px"
|
||||
android:top="12px"
|
||||
android:left="14px"
|
||||
android:right="14px" />
|
||||
|
||||
<solid android:color="#7f000000" />
|
||||
|
||||
<stroke
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<size android:height="65px" />
|
||||
|
||||
<padding
|
||||
android:bottom="12px"
|
||||
android:left="30px"
|
||||
android:right="30px"
|
||||
android:top="12px" />
|
||||
android:right="30px"/>
|
||||
|
||||
<corners android:radius="32.5px" />
|
||||
|
||||
|
||||
@@ -232,12 +232,13 @@
|
||||
android:id="@+id/tvSelfSpeed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/module_ext_vr_mode_self_speed_margin_end"
|
||||
android:background="@drawable/module_ext_vr_mode_speed_red_bg"
|
||||
android:text="72"
|
||||
android:textColor="@color/module_ext_vr_mode_left_traffic_light_red"
|
||||
android:textSize="@dimen/module_ext_vr_mode_traffic_light_text_size"
|
||||
android:visibility="gone"
|
||||
android:gravity="center"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -247,9 +248,12 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/module_ext_vr_mode_traffic_light_green_bg"
|
||||
android:text="26S"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="@dimen/module_ext_vr_mode_self_speed_margin_end"
|
||||
android:textColor="@color/module_ext_vr_mode_left_traffic_light_green"
|
||||
android:textSize="@dimen/module_ext_vr_mode_traffic_light_text_size"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tvSelfSpeed"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvSelfSpeed" />
|
||||
|
||||
@@ -260,6 +264,8 @@
|
||||
android:layout_marginStart="@dimen/module_ext_vr_mode_self_speed_margin_end"
|
||||
android:background="@drawable/module_ext_vr_mode_speed_white_bg"
|
||||
android:text="160"
|
||||
tools:visibility="visible"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/module_ext_vr_mode_left_traffic_light_white"
|
||||
android:textSize="@dimen/module_ext_vr_mode_traffic_light_text_size"
|
||||
android:visibility="gone"
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
<dimen name="module_ext_vr_mode_left_notice_content_padding_left">40px</dimen>
|
||||
<dimen name="module_ext_vr_mode_left_feature_margin_left">50px</dimen>
|
||||
|
||||
<dimen name="module_ext_vr_mode_traffic_light_text_size">36px</dimen>
|
||||
<dimen name="module_ext_vr_mode_traffic_light_text_size">32px</dimen>
|
||||
<dimen name="module_ext_vr_mode_self_speed_margin_end">15px</dimen>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user