Merge branch 'dev_robotaxi-d-app-module_2120_221017_2.12.0' into dev_robotaxi-d-app-module_2120_yyk_2.12.0

# Conflicts:
#	OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java
This commit is contained in:
yangyakun
2022-10-24 16:22:32 +08:00
115 changed files with 3139 additions and 769 deletions

View File

@@ -79,6 +79,7 @@ import com.mogo.eagle.core.function.hmi.ui.notice.NoticeNormalBannerView
import com.mogo.eagle.core.function.hmi.ui.setting.DebugSettingView
import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow
import com.mogo.eagle.core.function.hmi.ui.setting.ReportListFloatWindow
import com.mogo.eagle.core.function.hmi.ui.setting.SOPSettingView
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
import com.mogo.eagle.core.function.hmi.ui.tools.AutoPilotAndCheckView
import com.mogo.eagle.core.function.hmi.ui.tools.MaskView
@@ -127,6 +128,9 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
private var mDebugSettingViewFloat: WarningFloat.Builder? = null
private var mDebugSettingView: DebugSettingView? = null
//SOPSettingView
private var mSOPSettingViewFloat: WarningFloat.Builder? = null
private var mSOPSettingView: SOPSettingView? = null
private var mNoticeFloat: WarningFloat.Builder? = null
@@ -447,6 +451,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
dismissToolsFloatView()
CallerDevaToolsManager.showFeedbackView(it)
}
override fun showSOPSettingView() {
toggleSOPView()
}
})
}
toolsViewFloat = WarningFloat.with(it)
@@ -660,6 +668,58 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
}
}
override fun toggleSOPView() {
activity?.let{
if(mSOPSettingViewFloat!= null){
WarningFloat.dismiss(mSOPSettingViewFloat!!.config.floatTag, false)
mSOPSettingViewFloat = null
mSOPSettingView = null
}else{
if (mSOPSettingView == null){
mSOPSettingView = SOPSettingView(it)
}
var side = RIGHT
var gravity = Gravity.RIGHT
//调试窗默认靠右显示Bus的乘客端右端有视图覆盖调试窗靠左显示
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
) {
side = LEFT
gravity = Gravity.LEFT
}
mSOPSettingViewFloat = WarningFloat.with(it)
.setTag("mSOPSettingView")
.setLayout(mSOPSettingView!!)
.setSidePattern(side)
.setGravity(gravity, offsetY = 70)
.setImmersionStatusBar(true)
.setAnimator(object : DefaultAnimator() {
override fun enterAnim(
view: View,
params: LayoutParams,
windowManager: WindowManager,
sidePattern: SidePattern
): Animator? =
super.enterAnim(view, params, windowManager, sidePattern)
?.apply {
interpolator = OvershootInterpolator()
}
override fun exitAnim(
view: View,
params: LayoutParams,
windowManager: WindowManager,
sidePattern: SidePattern
): Animator? =
super.exitAnim(view, params, windowManager, sidePattern)
?.setDuration(200)
})
.show()
}
}
}
/**
* 展示VR下V2X预警
*
@@ -1415,29 +1475,27 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
"EmArrow-1013",
"it code : ${it.code} , state : ${getAutoPilotStatusInfo().state}"
)
if (getAutoPilotStatusInfo().state != STATUS_AUTOPILOT_RUNNING) {
showWarningV2X(
EventTypeEnum.TAKE_OVER_EVENT.poiType,
EventTypeEnum.TAKE_OVER_EVENT.content,
EventTypeEnum.TAKE_OVER_EVENT.tts,
EventTypeEnum.TAKE_OVER_EVENT.poiType,
object : IMoGoWarningStatusListener {
override fun onShow() {
Log.d("EmArrow-1013", "onShow")
takeOver = true
clTakeOverView.visibility = View.VISIBLE
}
showWarningV2X(
EventTypeEnum.TAKE_OVER_EVENT.poiType,
EventTypeEnum.TAKE_OVER_EVENT.content,
EventTypeEnum.TAKE_OVER_EVENT.tts,
EventTypeEnum.TAKE_OVER_EVENT.poiType,
object : IMoGoWarningStatusListener {
override fun onShow() {
Log.d("EmArrow-1013", "onShow")
takeOver = true
clTakeOverView.visibility = View.VISIBLE
}
override fun onDismiss() {
Log.d("EmArrow-1013", "onDismiss")
takeOver = false
clTakeOverView.visibility = View.GONE
}
},
true,
6000L
)
}
override fun onDismiss() {
Log.d("EmArrow-1013", "onDismiss")
takeOver = false
clTakeOverView.visibility = View.GONE
}
},
true,
6000L
)
}
}
}

View File

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

View File

@@ -9,6 +9,7 @@ import android.graphics.Color
import android.os.Build
import android.text.Html
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.annotation.RequiresApi
@@ -1857,7 +1858,6 @@ class DebugSettingView @JvmOverloads constructor(
override fun updateBizData(type: String, state: Boolean, lock: Boolean, data: String?) {
when (type) {
BIZ_BEAUTY_MODE -> {
tbIsDemoMode.isClickable = !lock
if(lock){
tbIsDemoMode.background = resources.getDrawable(R.drawable.radio_button_lock_background)
}else{
@@ -1865,7 +1865,6 @@ class DebugSettingView @JvmOverloads constructor(
}
}
BIZ_RAIN_MODE -> {
tbIsRainMode.isClickable = !lock
if(lock){
tbIsRainMode.background = resources.getDrawable(R.drawable.radio_button_lock_background)
}else{
@@ -1873,7 +1872,6 @@ class DebugSettingView @JvmOverloads constructor(
}
}
BIZ_WARNING_UPLOAD -> {
tbReportWarning.isClickable = !lock
if(lock){
tbReportWarning.background = resources.getDrawable(R.drawable.radio_button_lock_background)
}else{
@@ -1882,20 +1880,16 @@ class DebugSettingView @JvmOverloads constructor(
}
BIZ_BAG_RECORD -> {
if (lock) {
btnRecordBag.isClickable = false
btnRecordBag.background = resources.getDrawable(R.drawable.radio_button_lock_background)
} else {
btnRecordBag.isClickable = true
btnRecordBag.requestFocus()
btnRecordBag.background = null
}
}
BIZ_FULL_LOG -> {
if (lock) {
tbLogCatch.isClickable = false
tbLogCatch.background = resources.getDrawable(R.drawable.radio_button_lock_background)
} else {
tbLogCatch.isClickable = true
tbLogCatch.requestFocus()
tbLogCatch.background = null
}

View File

@@ -0,0 +1,159 @@
package com.mogo.eagle.core.function.hmi.ui.setting
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.obu.CallerOBUManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.module.service.routeoverlay.RouteStrategy
import kotlinx.android.synthetic.main.view_sop_setting.view.*
/**
* SOP设置窗口
*/
class SOPSettingView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr){
init {
LayoutInflater.from(context).inflate(R.layout.view_sop_setting, this, true)
initView()
}
private fun initView() {
//绕障类功能开关
tbObstacleAvoidance.isChecked = FunctionBuildConfig.isDetouring
tbObstacleAvoidance.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotManager.sendDetouring(isChecked)
FunctionBuildConfig.isDetouring = isChecked
}
//危险障碍物颜色标记开关
tbMarkingObstacles.setOnCheckedChangeListener { _, isChecked ->
}
//引导线动态效果
tbRouteDynamicEffect.isChecked =
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) && !AppIdentityModeUtils.isBus(
FunctionBuildConfig.appIdentityMode
)
tbRouteDynamicEffect.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
RouteStrategy.enable(true)
} else {
RouteStrategy.enable(false)
}
}
//红绿灯标识
tbTrafficLight.isChecked = HmiBuildConfig.isShowTrafficLightView
tbTrafficLight.setOnCheckedChangeListener { _, isChecked ->
if(!isChecked){
HmiBuildConfig.isShowTrafficLightView = false
}else{
HmiBuildConfig.isShowTrafficLightView = true
CallerHmiManager.disableWarningTrafficLight()
}
}
//限速标识
tbSpeedLimit.isChecked = HmiBuildConfig.isShowLimitingVelocityView
tbSpeedLimit.setOnCheckedChangeListener { _, isChecked ->
if(isChecked){
HmiBuildConfig.isShowLimitingVelocityView = true
}else{
HmiBuildConfig.isShowLimitingVelocityView = false
CallerHmiManager.disableLimitingVelocity()
}
}
//自车感知到的他车碰撞预警
tbCollisionWarning.setOnCheckedChangeListener { buttonView, isChecked ->
}
// 演示模式,上一次勾选的数据
tbDemoMode.isChecked = FunctionBuildConfig.isDemoMode
// 演示模式
tbDemoMode.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotManager.setDemoMode(isChecked)
if (!isChecked) {
//关闭美化模式时,通知工控机
CallerAutoPilotManager.setIPCDemoMode(isChecked)
}
FunctionBuildConfig.isDemoMode = isChecked
}
//只在司机端设置美化模式开关功能
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
tbDemoMode.visibility = View.GONE
}
// 雨天模式,上一次勾选的数据
tbRainMode.isChecked = FunctionBuildConfig.isRainMode
//雨天模式
tbRainMode.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotManager.setRainMode(isChecked)
FunctionBuildConfig.isRainMode = isChecked
}
//雨天模式按钮只在司机屏生效,乘客屏不显示
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
tbRainMode.visibility = View.GONE
}
//OBU控制总开关
tbObu.isChecked = CallerOBUManager.isConnected()
tbObu.setOnCheckedChangeListener { _, isChecked ->
if(!isChecked){
if(AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
CallerOBUManager.resetObuIpAddress("192.168.1.199")
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
CallerOBUManager.resetObuIpAddress("192.168.8.199")
}
}else{
//断开链接
CallerOBUManager.disConnectObu()
}
}
//变道绕障的目标障碍物速度阈值
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
ivSpeedReduce.setOnClickListener {
if(FunctionBuildConfig.detouringSpeed<=3){
ToastUtils.showShort("阈值小可为3 m/s")
}else{
FunctionBuildConfig.detouringSpeed--
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
}
}
ivSpeedAdd.setOnClickListener {
if(FunctionBuildConfig.detouringSpeed>=7){
ToastUtils.showShort("阈值最大可为7 m/s")
}else{
FunctionBuildConfig.detouringSpeed++
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
}
}
btnSpeedSet.setOnClickListener {
val isSuccess = CallerAutoPilotManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble())
if(isSuccess == true){
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置成功")
}else{
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置失败")
}
}
}
}

View File

@@ -59,15 +59,13 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
companion object {
private var maxAcceleration: Double = 2.0
private var speedLimit: Double = 0.0
private var speedLimit: Int = 0
}
@SuppressLint("ClickableViewAccessibility")
private fun initView() {
background = ColorDrawable(Color.parseColor("#F0151D41"))
if (keyBoardUtil == null) {
keyBoardUtil = KeyBoardUtil(sKeyBoardView, etInputSpeed)
}
keyBoardUtil?.setActionListener { inputContent ->
inputContent.toIntOrNull()?.let { speed ->
when {
@@ -76,10 +74,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
ToastUtils.showShort("超过最大限速值60设置失败")
}
else -> {
llSpeedPosition.background =
resources.getDrawable(R.drawable.pilot_speed_bg)
keyBoardUtil?.hideKeyboard()
etInputSpeed.clearFocus()
// 设置自动驾驶速度
val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speed)
when {
@@ -94,13 +88,15 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
}
}
}
KeyBoardUtil.hideSystemSoftKeyboard(context, etInputSpeed)
ivCloseIcon.setOnClickListener {
clickListener?.onClose(it)
}
rlKillLayout.setOnClickListener {
killApp()
}
sopLayout.setOnClickListener {
clickListener?.showSOPSettingView()
}
viewCheckStatus.setOnClickListener {
clickListener?.go2CheckPage()
}
@@ -110,49 +106,60 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
ivDebugFeedback.onClick {
clickListener?.showFeedbackView()
}
etInputSpeed.setOnFocusChangeListener { v, hasFocus ->
when {
hasFocus -> {
llSpeedPosition.background =
resources.getDrawable(R.drawable.pilot_speed_high_light_bg)
if (keyBoardUtil == null) {
keyBoardUtil = KeyBoardUtil(sKeyBoardView, etInputSpeed)
}
keyBoardUtil?.showKeyboard()
}
else -> llSpeedPosition.background =
resources.getDrawable(R.drawable.pilot_speed_bg)
}
}
etInputSpeed.setOnTouchListener { v, event ->
var curTime = System.currentTimeMillis()
if (curTime - lastTime < 1000) {
return@setOnTouchListener true
}
if (!connectStatus) {
ToastUtils.showShort("设置车速失败,请启动域控制器")
keyBoardUtil?.hideKeyboard()
return@setOnTouchListener true
} else {
return@setOnTouchListener false
}
}
updateSpeedSettingViews()
if (AppConfigInfo.isConnectAutopilot) {
CallerAutoPilotManager.getCarConfig()
}
if (maxAcceleration > 0) {
tvAcceleration.text = "加速度 $maxAcceleration m/s²"
}
// if (maxAcceleration > 0) {
// tvAcceleration.text = "加速度 $maxAcceleration m/s²"
// }
tvAcceleration.text = "每次调整车速±5km/h"
if (speedLimit > 0) {
etInputSpeed.setText((speedLimit * 3.6).toInt().toString())
tvSpeed.text = speedLimit.toString()
}else{
tvSpeed.text = "0"
}
ivSpeedReduce.setOnClickListener {
if(speedLimit>=5){
speedLimit -= 5
//速度显示
val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speedLimit)
when {
isSuccess -> {
//速度显示
tvSpeed.text = speedLimit.toString()
ToastUtils.showShort("车速设置成功,立即生效")
}
else -> {
ToastUtils.showShort("设置车速失败,请启动域控制器")
}
}
}else{
ToastUtils.showShort("车速不能再减了")
}
}
ivSpeedAdd.setOnClickListener {
if(speedLimit<=55){
speedLimit += 5
//速度显示
val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speedLimit)
when {
isSuccess -> {
//速度显示
tvSpeed.text = speedLimit.toString()
ToastUtils.showShort("车速设置成功,立即生效")
}
else -> {
ToastUtils.showShort("设置车速失败,请启动域控制器")
}
}
}else{
ToastUtils.showShort("车速不能再加了")
}
}
initOchView()
// // 比如需要设置默认速度
// val speed = "30"
// etInputSpeed.setText(speed)
// etInputSpeed.setSelection(speed.length)
initOchView()
}
private fun initOchView() {
@@ -189,11 +196,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
this.clickListener = clickListener
}
private fun updateSpeedSettingViews() {
tvSpeedTitle.visibility = View.VISIBLE
llSpeedPosition.visibility = View.VISIBLE
}
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo) {
systemVersionView?.showAdUpgradeStatus(ipcUpgradeStateInfo)
}
@@ -220,16 +222,20 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
fun onClose(v: View)
fun showDebugPanelView()
fun showFeedbackView()
fun showSOPSettingView()
}
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
UiThreadHandler.post {
tvAcceleration?.let {
maxAcceleration = carConfigResp.maxAcceleration
speedLimit = carConfigResp.speedLimit
tvAcceleration.text = "加速度 ${carConfigResp.maxAcceleration} m/s²"
etInputSpeed.setText((carConfigResp.speedLimit * 3.6).toInt().toString())
}
// tvAcceleration?.let {
// maxAcceleration = carConfigResp.maxAcceleration
// speedLimit = carConfigResp.speedLimit
//// tvAcceleration.text = "加速度 ${carConfigResp.maxAcceleration} m/s²"
// tvSpeed.text = (carConfigResp.speedLimit * 3.6).toInt().toString()
// }
maxAcceleration = carConfigResp.maxAcceleration
speedLimit = (carConfigResp.speedLimit * 3.6).toInt()
tvSpeed.text = speedLimit.toString()
}
}
}

View File

@@ -32,18 +32,18 @@ class PerspectiveSwitchView @JvmOverloads constructor(
override fun onClick(v: View?) {
//切换地图的远近视图
if (MogoMapUIController.getInstance().currentMapVisualAngle.isLongSight) {
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
.visibleAllMarkers()
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
// .visibleAllMarkers()
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
textSwitch.setText(R.string.module_map_model_normal)
} else if (MogoMapUIController.getInstance().currentMapVisualAngle.isMediumSight) {
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
.inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS)
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS)
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
textSwitch.setText(R.string.module_map_model_faster)
} else {
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
.visibleAllMarkers()
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
// .visibleAllMarkers()
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
textSwitch.setText(R.string.module_map_model_normal)
}

View File

@@ -7,6 +7,7 @@ import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -49,7 +50,9 @@ class SingleTrafficLightView @JvmOverloads constructor(
override fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) {
super.showWarningTrafficLight(checkLightId,lightSource)
mCurrentLightId = checkLightId
updateTrafficLightIcon(checkLightId,lightSource)
if(!HmiBuildConfig.isShowTrafficLightView){
updateTrafficLightIcon(checkLightId,lightSource)
}
}
/**

View File

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

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -8,7 +8,7 @@
<View
android:id="@+id/viewShowDebugView"
android:layout_width="@dimen/dp_100"
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_100"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -43,6 +43,7 @@
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/tv_check_title"
app:layout_constraintTop_toBottomOf="@+id/v_second_group">
@@ -144,6 +145,32 @@
</LinearLayout>
<RelativeLayout
android:id="@+id/sopLayout"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_216"
android:layout_marginTop="@dimen/dp_90"
app:layout_constraintTop_toBottomOf="@id/checkLayout"
app:layout_constraintLeft_toLeftOf="@id/checkLayout">
<ImageView
android:layout_width="150px"
android:layout_height="150px"
android:layout_centerHorizontal="true"
android:background="@drawable/debug_icon_sop" />
<TextView
android:layout_width="wrap_content"
android:layout_height="42px"
android:text="@string/debug_sop"
android:textColor="@color/color_FFA7B6F0"
android:textSize="32px"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
/>
</RelativeLayout>
<TextView
android:id="@+id/tv_check_title"
android:layout_width="84px"
@@ -164,7 +191,7 @@
android:layout_marginTop="94px"
android:background="@color/color_FF2966EC"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/checkLayout" />
app:layout_constraintTop_toBottomOf="@id/sopLayout" />
<TextView
android:id="@+id/tvSpeedTitle"
@@ -177,45 +204,53 @@
android:textColor="@color/color_FFFFFF"
android:textSize="42px"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/checkLayout" />
app:layout_constraintTop_toBottomOf="@id/sopLayout" />
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/llSpeedPosition"
android:layout_width="390px"
<ImageView
android:id="@+id/ivSpeedReduce"
android:layout_width="105px"
android:layout_height="140px"
android:layout_marginStart="113px"
android:layout_marginTop="40px"
android:background="@drawable/pilot_speed_bg"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="horizontal"
android:src="@drawable/icon_speed_reduce"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSpeedTitle">
app:layout_constraintTop_toBottomOf="@id/tvSpeedTitle"
/>
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etInputSpeed"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="92px"
android:layout_weight="1"
android:background="@null"
android:gravity="center"
android:maxLength="3"
android:maxLines="1"
android:textColor="#FFFFFFFF"
android:textSize="80px"
tools:ignore="SpeakableTextPresentCheck" />
<TextView
android:id="@+id/tvSpeed"
android:layout_width="189px"
android:layout_height="140px"
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
app:layout_constraintLeft_toRightOf="@id/ivSpeedReduce"
android:background="#1E3062"
android:textColor="#FFFFFFFF"
android:textSize="80px"
android:gravity="center"
/>
<TextView
android:layout_width="93px"
android:layout_height="53px"
android:layout_gravity="center_vertical"
android:layout_marginEnd="28px"
android:text="km/h"
android:textColor="@color/color_B3FFFFFF"
android:textSize="38px" />
<ImageView
android:id="@+id/ivSpeedAdd"
android:layout_width="105px"
android:layout_height="140px"
app:layout_constraintTop_toTopOf="@id/tvSpeed"
app:layout_constraintBottom_toBottomOf="@id/tvSpeed"
app:layout_constraintLeft_toRightOf="@id/tvSpeed"
android:src="@drawable/icon_speed_add"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="km/h"
android:textColor="#FFFFFFFF"
android:textSize="38px"
app:layout_constraintTop_toTopOf="@id/ivSpeedAdd"
app:layout_constraintBottom_toBottomOf="@id/ivSpeedAdd"
app:layout_constraintLeft_toRightOf="@id/ivSpeedAdd"
android:layout_marginStart="40px"
/>x`
<TextView
android:id="@+id/tvAcceleration"
@@ -226,7 +261,7 @@
android:textColor="#A7B6F0"
android:textSize="32px"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/llSpeedPosition" />
app:layout_constraintTop_toBottomOf="@id/ivSpeedReduce" />
<View
android:layout_width="14px"

View File

@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_800"
android:layout_height="@dimen/dp_1100"
android:background="#FFFFFF">
<!--绕障类功能-->
<ToggleButton
android:id="@+id/tbObstacleAvoidance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启绕障类功能"
android:textOn="关闭绕障类功能"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toTopOf="parent"
/>
<!--危险障碍物颜色标记-->
<ToggleButton
android:id="@+id/tbMarkingObstacles"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启「危险障碍物颜色标记」"
android:textOn="关闭「危险障碍物颜色标记」"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbObstacleAvoidance"
/>
<!--引导线动态效果-->
<ToggleButton
android:id="@+id/tbRouteDynamicEffect"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启「引导线动态效果」"
android:textOn="关闭「引导线动态效果」"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbMarkingObstacles"
/>
<!--红绿灯标识-->
<ToggleButton
android:id="@+id/tbTrafficLight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="隐藏红绿灯标识"
android:textOn="展示红绿灯标识"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbRouteDynamicEffect"
/>
<!--限速标识-->
<ToggleButton
android:id="@+id/tbSpeedLimit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="展示限速标识"
android:textOn="隐藏限速标识"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbTrafficLight"
/>
<!--自车感知到的他车碰撞预警-->
<ToggleButton
android:id="@+id/tbCollisionWarning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启「自车感知到的他车碰撞预警」"
android:textOn="关闭「自车感知到的他车碰撞预警」"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbSpeedLimit"
/>
<ToggleButton
android:id="@+id/tbDemoMode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启美化模式"
android:textOn="关闭美化模式"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbCollisionWarning"
/>
<ToggleButton
android:id="@+id/tbRainMode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启雨天模式"
android:textOn="关闭雨天模式"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbDemoMode"
/>
<ToggleButton
android:id="@+id/tbObu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="关闭OBU"
android:textOn="开启OBU"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
/>
<TextView
android:id="@+id/tvSpeedThresholdTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tbObu"
android:text="变道速度阈值:"
android:textSize="18sp"
android:textColor="#1A1A1A"
android:layout_margin="10dp"
/>
<ImageView
android:id="@+id/ivSpeedReduce"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@id/tvSpeedThresholdTitle"
app:layout_constraintTop_toTopOf="@id/tvSpeedThresholdTitle"
app:layout_constraintBottom_toBottomOf="@id/tvSpeedThresholdTitle"
android:src="@drawable/icon_reduce"
android:padding="10dp"
/>
<TextView
android:id="@+id/tvSpeed"
android:layout_width="wrap_content"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
app:layout_constraintLeft_toRightOf="@id/ivSpeedReduce"
android:textSize="18sp"
android:gravity="center"
android:background="@drawable/debug_setting_edit_bg"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
/>
<ImageView
android:id="@+id/ivSpeedAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvSpeed"
app:layout_constraintBottom_toBottomOf="@id/tvSpeed"
app:layout_constraintLeft_toRightOf="@id/tvSpeed"
android:src="@drawable/icon_add"
android:padding="10dp"
/>
<Button
android:id="@+id/btnSpeedSet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivSpeedAdd"
app:layout_constraintBottom_toBottomOf="@id/ivSpeedAdd"
app:layout_constraintLeft_toRightOf="@id/ivSpeedAdd"
android:text="设置阈值"
android:layout_marginStart="10dp"
/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#F0F0F0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnSpeedSet"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -22,6 +22,7 @@
<string name="check_vehicle_detection">车辆检测</string>
<string name="debug_panel">调试面板</string>
<string name="debug_panel_fb">录包设置</string>
<string name="debug_sop">运营面板</string>
<string name="check_vehicle_speed_setting">车速设置</string>
<string name="bus_operation_title">账户信息</string>
<string name="check_system_operation">系统运行</string>