Merge branch 'dev_robotaxi-d_250603_8.1.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_250603_8.1.0

This commit is contained in:
xinfengkun
2025-06-16 16:07:21 +08:00
52 changed files with 1161 additions and 189 deletions

View File

@@ -100,15 +100,17 @@
<!--红绿灯-->
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficLightView
android:id="@+id/viewTrafficLightVr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_28"
android:layout_marginEnd="@dimen/dp_40"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_21"
android:visibility="gone"
app:lightUser="passenger"
/>
<!--接管提示-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.TakeOverView

View File

@@ -49,6 +49,10 @@
<color name="common_3B3D44">#3B3D44</color>
<color name="common_2E323A">#2E323A</color>
<color name="common_ffffffff">#ffffffff</color>
<color name="common_10ffffff">#1Affffff</color>
<color name="common_50ffffff">#80000000</color>
<color name="common_2eacff">#2EACFF</color>
<color name="common_d4d4d4">#D4D4D4</color>
<color name="common_ff852e">#FF852E</color>
</resources>

View File

@@ -42,14 +42,6 @@ class RoadCrossRoamViewModel: ViewModel(), IMoGoMapRoadListener {
CallerLogger.d(TAG, "没有路线不做提示")
return
}
// 处于漫游模式下不做处理
if (CallerMapIdentifyManager.roam.second) {
if (CallerMapIdentifyManager.roam.first != TAG) {
ToastUtils.showLong("正在漫游中,不展示路口漫游")
}
CallerLogger.d(TAG, "正在漫游中,不展示路口漫游")
return
}
// 首页被遮挡不做提示
if (!CallerHmiViewControlListenerManager.getMainPageVisible()) {
CallerLogger.d(TAG, "attachView return , mainPageVisible is false")

View File

@@ -24,15 +24,18 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
<!--红绿灯-->
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficLightView
android:id="@+id/bus_p_traffic_light_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_722"
android:layout_marginTop="@dimen/dp_112"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toTopOf="parent"
android:layout_marginLeft="@dimen/dp_703"
android:layout_marginTop="@dimen/dp_98"
android:visibility="gone"
app:lightUser="passenger"
/>
<FrameLayout
android:id="@+id/bus_p_route_panel"

View File

@@ -97,6 +97,18 @@
app:layout_constraintGuide_percent="0.666" />
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficLightView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginStart="@dimen/dp_10"
android:visibility="gone"
app:lightUser="passenger"
/>
<!-- <View-->

View File

@@ -6,12 +6,12 @@ import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.och.unmanned.taxi.R
import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_item_view.view.aciv_open_details
import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_item_view.view.operationDataContent1Tv
import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_item_view.view.operationDataContentTv
import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_item_view.view.operationDataUnit1Tv
import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_item_view.view.operationDataUnitTv
import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_item_view.view.operationalDataTagTv
import kotlinx.android.synthetic.main.unmanned_taxi_operational_data_item_view.view.operationalDataView
/**
* @author: wangmingjun
@@ -30,7 +30,7 @@ class OperationalDataItemView @JvmOverloads constructor(
}
private fun initViewClick() {
operationalDataView.onClick {
aciv_open_details.onClick {
mClickListener?.onClick()
}
}
@@ -52,7 +52,7 @@ class OperationalDataItemView @JvmOverloads constructor(
}
fun setOperationalDataViewClick(isVisible: Int,clickListener: DataViewClickListener?){
operationalDataView.visibility = isVisible
aciv_open_details.visibility = isVisible
mClickListener = clickListener
}

View File

@@ -45,8 +45,7 @@ class TaskListAdapter(val context: Context,
override fun onBindViewHolder(holder: TaskItemViewHolder, position: Int) {
dataList?.also {
val taskInfo = dataList[holder.bindingAdapterPosition]
holder.taskTimeTv.text = "下单时间 " + DateTimeUtil.formatLongToString(taskInfo.startTime,
DateTimeUtil.HH_mm)
holder.taskTimeTv.text = "下单时间 " + DateTimeUtil.formatLongToString(taskInfo.startTime, DateTimeUtil.HH_mm)
holder.taskTypeBt.text = "演练单"
holder.taskStartSiteTv.text = taskInfo.startSiteName
holder.taskEndSiteTv.text = taskInfo.endSiteName
@@ -111,10 +110,8 @@ class OrderListAdapter(val context: Context,
private fun initViewDetailBtn(holder: OrderItemViewHolder) {
dataList?.also {
val orderInfo = it[holder.bindingAdapterPosition]
holder.orderViewDetailBt.text = "详情"
holder.orderViewDetailBt.text = "展开"
holder.orderViewDetailBt.tag = true
holder.orderViewDetailBt.setCompoundDrawablesWithIntrinsicBounds(null,null,
context.getDrawable(R.drawable.view_detail_arrow),null)
when(orderInfo.status){
OperationalOrderStatusEnum.Refunded.code,OperationalOrderStatusEnum.Unpaid.code,
OperationalOrderStatusEnum.JourneyCompleted.code,
@@ -135,14 +132,10 @@ class OrderListAdapter(val context: Context,
if (holder.orderViewDetailBt.tag as Boolean){
holder.orderViewDetailBt.text = "收起"
holder.orderViewDetailBt.tag = false
holder.orderViewDetailBt.setCompoundDrawablesWithIntrinsicBounds(null,null,
ContextCompat.getDrawable(context,R.drawable.close_detail_arrow),null)
clickViewDetailListener?.clickViewOrderDetail(dataList[holder.bindingAdapterPosition].orderNo)
}else{
holder.orderViewDetailBt.text = "详情"
holder.orderViewDetailBt.text = "展开"
holder.orderViewDetailBt.tag = true
holder.orderViewDetailBt.setCompoundDrawablesWithIntrinsicBounds(null,null,
ContextCompat.getDrawable(context,R.drawable.view_detail_arrow),null)
holder.orderTaskStationView.visibility = View.GONE
taskDetailListAdapter = null
mOrderTaskStationList = null
@@ -265,15 +258,15 @@ class OrderTaskDetailListAdapter(val context: Context,
when (taskDetail.stationType){
StationTypeEnum.PathwayStation.code -> {
holder.taskStationTagTv.text = "途经:"
holder.stationCircleIv.setImageResource(R.drawable.waypoint_circle)
holder.stationCircleIv.setImageResource(R.drawable.circle_blue_waypoint)
}
StationTypeEnum.OrderStartStation.code -> {
holder.taskStationTagTv.text = "上车:"
holder.stationCircleIv.setImageResource(R.drawable.taxi_driver_circle_green_big)
holder.stationCircleIv.setImageResource(R.drawable.circle_green_start_station)
}
StationTypeEnum.OrderEndStation.code -> {
holder.taskStationTagTv.text = "下车:"
holder.stationCircleIv.setImageResource(R.drawable.taxi_driver_circle_blue_big)
holder.stationCircleIv.setImageResource(R.drawable.circle_blue_end_station)
}
}
holder.taskStationNameTv.text = taskDetail.stationName

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 895 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

View File

@@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="44dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="44dp">
<path android:fillColor="@android:color/white" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>

View File

@@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:alpha="0.8" android:autoMirrored="true" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M8.59,16.59L13.17,12 8.59,7.41 10,6l6,6 -6,6 -1.41,-1.41z"/>
</vector>

View File

@@ -3,5 +3,5 @@
android:shape="rectangle">
<corners
android:radius="@dimen/dp_20"/>
<solid android:color="#000E2A"/>
<solid android:color="@color/common_10ffffff"/>
</shape>

View File

@@ -2,9 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="24dp" />
<gradient
android:angle="0"
android:startColor="#304378"
android:endColor="#28345E"
android:type="linear" />
<solid android:color="@color/common_10ffffff"/>
</shape>

View File

@@ -9,7 +9,7 @@
android:id="@+id/taskStationTagTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_76"
android:layout_marginLeft="@dimen/dp_73"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:textSize="@dimen/dp_28"
@@ -48,10 +48,10 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/stationCircleIv"
android:layout_width="@dimen/dp_38"
android:layout_height="@dimen/dp_38"
android:layout_width="@dimen/dp_31"
android:layout_height="@dimen/dp_31"
android:scaleType="fitXY"
android:src="@drawable/taxi_driver_circle_blue_big"
android:src="@drawable/circle_blue_end_station"
app:layout_constraintTop_toTopOf="@+id/taskStationNameTv"
app:layout_constraintBottom_toBottomOf="@+id/taskStationNameTv"
app:layout_constraintRight_toLeftOf="@+id/taskStationNameTv"

View File

@@ -2,8 +2,10 @@
<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_224"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/dp_880"
android:layout_height="@dimen/dp_223"
tools:background="@color/common_203555"
android:background="@drawable/taxi_operation_data_item_bg">
<TextView
@@ -15,7 +17,7 @@
android:textSize="@dimen/dp_76"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textColor="#FFFFFF"
android:textColor="@color/common_ffffffff"
android:textStyle="bold"
android:text="0"/>
@@ -26,6 +28,7 @@
android:layout_marginTop="@dimen/dp_20"
android:layout_marginLeft="@dimen/dp_8"
android:textSize="@dimen/dp_76"
tools:text="0"
app:layout_constraintLeft_toRightOf="@+id/operationDataUnitTv"
app:layout_constraintTop_toTopOf="parent"
android:textStyle="bold"
@@ -34,8 +37,9 @@
android:id="@+id/operationDataUnitTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_8"
tools:text="时"
app:layout_constraintBaseline_toBaselineOf="@+id/operationDataContent1Tv"
android:textSize="@dimen/dp_36"
app:layout_constraintLeft_toRightOf="@+id/operationDataContentTv"
app:layout_constraintBottom_toBottomOf="@+id/operationDataContentTv"
@@ -46,8 +50,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:layout_marginBottom="@dimen/dp_12"
app:layout_constraintBaseline_toBaselineOf="@+id/operationDataContent1Tv"
android:textSize="@dimen/dp_36"
tools:text="分"
app:layout_constraintLeft_toRightOf="@+id/operationDataContent1Tv"
app:layout_constraintBottom_toBottomOf="@+id/operationDataContent1Tv"
android:textColor="#FFFFFF"/>
@@ -55,25 +60,20 @@
android:id="@+id/operationalDataTagTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#A7B6F0"
android:textColor="@color/common_cccccc"
android:layout_marginTop="@dimen/dp_10"
android:textSize="@dimen/dp_30"
app:layout_constraintLeft_toLeftOf="@+id/operationDataContentTv"
app:layout_constraintTop_toBottomOf="@+id/operationDataContentTv"
android:text="今日"/>
android:text="今日服务总时长"/>
<TextView
android:id="@+id/operationalDataView"
android:layout_width="@dimen/dp_224"
android:layout_height="@dimen/dp_80"
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_open_details"
android:src="@drawable/order_detail"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="@dimen/dp_40"
android:textSize="@dimen/dp_32"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:gravity="center"
android:text="@string/view_data"
android:background="@drawable/view_data_click_btn_bg"/>
app:layout_constraintEnd_toEndOf="parent"
android:padding="@dimen/dp_30"
android:layout_width="@dimen/dp_75"
android:layout_height="@dimen/dp_87"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -3,20 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F0151D41">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/operationDataTitle"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_86"
android:layout_marginLeft="@dimen/dp_114"
android:layout_marginTop="@dimen/dp_144"
android:gravity="center"
android:text="网约车运营数据"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_42"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:background="@drawable/operation_bg">
<View
android:id="@+id/line"
@@ -24,26 +11,42 @@
android:layout_height="@dimen/dp_50"
android:layout_marginRight="@dimen/dp_20"
android:background="#2966EC"
app:layout_constraintBottom_toBottomOf="@+id/operationDataTitle"
app:layout_constraintRight_toLeftOf="@+id/operationDataTitle"
app:layout_constraintTop_toTopOf="@+id/operationDataTitle" />
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="@dimen/dp_61"
android:layout_marginTop="@dimen/dp_131"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/operationDataTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="网约车运营数据"
app:layout_constraintTop_toTopOf="@+id/line"
app:layout_constraintBottom_toBottomOf="@+id/line"
app:layout_constraintStart_toEndOf="@+id/line"
android:layout_marginStart="@dimen/dp_19"
android:textColor="@color/common_ffffffff"
android:textSize="@dimen/dp_45" />
<ImageView
android:id="@+id/operationalDataCloseIv"
android:layout_width="@dimen/dp_106"
android:layout_height="@dimen/dp_106"
android:layout_marginRight="@dimen/dp_40"
android:src="@drawable/taxi_order_cancel_close1"
app:layout_constraintBottom_toBottomOf="@+id/operationDataTitle"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/operationDataTitle" />
android:src="@drawable/baseline_close_44"
android:layout_marginEnd="@dimen/dp_106"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/line"
app:layout_constraintTop_toTopOf="@+id/line" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/operationalDataView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@+id/line"
app:layout_constraintTop_toBottomOf="@+id/operationDataTitle">
android:layout_marginTop="@dimen/dp_77"
app:layout_constraintTop_toBottomOf="@+id/line"
app:layout_constraintStart_toStartOf="@+id/line">
<com.mogo.och.unmanned.taxi.ui.operational.OperationalDataItemView
android:id="@+id/servingDurationView"
@@ -82,20 +85,22 @@
android:id="@+id/itemDayTv"
android:layout_width="match_parent"
android:layout_height="@dimen/taxi_order_list_item_height"
android:layout_marginTop="@dimen/dp_60"
android:background="#80203076"
android:layout_marginTop="@dimen/dp_69"
android:layout_marginStart="@dimen/dp_60"
android:layout_marginEnd="@dimen/dp_146"
android:background="@color/common_50ffffff"
android:gravity="center"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_32"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/operationDataTitle" />
app:layout_constraintTop_toBottomOf="@+id/line" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/operationItemRecyclerView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/dp_56"
android:layout_marginRight="@dimen/dp_56"
android:layout_marginLeft="@dimen/dp_60"
android:layout_marginRight="@dimen/dp_102"
android:layout_marginBottom="@dimen/dp_10"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"

View File

@@ -4,14 +4,15 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/dp_64">
tools:background="@color/common_cccccc"
android:paddingTop="@dimen/dp_50">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/orderTimeTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="下单时间 9:01"
android:textColor="#8E9DD4"
android:textColor="@color/common_ffffffff"
android:textSize="@dimen/dp_38"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
@@ -20,9 +21,9 @@
android:id="@+id/orderNumTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#8E9DD4"
android:textSize="@dimen/dp_38"
android:layout_marginTop="@dimen/dp_54"
android:textColor="@color/common_d4d4d4"
android:textSize="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_44"
app:layout_constraintTop_toBottomOf="@+id/orderTimeTv"
app:layout_constraintLeft_toLeftOf="@+id/orderTimeTv"
tools:text="订单编号111111" />
@@ -32,7 +33,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_4"
android:textColor="#FFFFFF"
android:textColor="@color/common_ff852e"
android:textSize="@dimen/dp_38"
app:layout_constraintRight_toLeftOf="@+id/orderPriceUnitTv"
app:layout_constraintBottom_toBottomOf="@+id/orderTimeTv"
@@ -45,20 +46,19 @@
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_22"
android:layout_marginBottom="@dimen/dp_8"
app:layout_constraintBaseline_toBaselineOf="@+id/orderPriceTv"
app:layout_constraintBottom_toBottomOf="@+id/orderTimeTv"
app:layout_constraintRight_toRightOf="parent"
android:text="元"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/orderViewDetailBt"
android:layout_width="@dimen/dp_162"
android:layout_height="@dimen/dp_64"
android:background="@drawable/taxi_order_button_status_bg"
android:paddingRight="@dimen/dp_28"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="详情"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_24"
android:text="展开"
android:textColor="@color/common_2eacff"
android:textSize="@dimen/dp_30"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="@+id/orderNumTv"
app:layout_constraintRight_toRightOf="parent"
@@ -96,11 +96,12 @@
android:id="@+id/orderTaskStationView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_50"
android:padding="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_38"
android:paddingTop="@dimen/dp_45"
android:paddingBottom="@dimen/dp_45"
app:layout_constraintLeft_toLeftOf="@+id/orderNumTv"
app:layout_constraintRight_toRightOf="@+id/orderViewDetailBt"
app:layout_constraintTop_toBottomOf="@+id/orderNumTv"
app:layout_constraintTop_toBottomOf="@+id/orderViewDetailBt"
android:background="@drawable/order_task_list_bg"
android:visibility="visible"/>

View File

@@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:background="@color/common_cccccc"
android:paddingTop="@dimen/dp_64"
android:paddingRight="@dimen/dp_54">
@@ -12,7 +13,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="下单时间 9:01"
android:textColor="#8E9DD4"
android:textColor="@color/common_ffffffff"
android:textSize="@dimen/dp_38"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
@@ -57,29 +58,31 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/taskCircleTag1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/taxi_driver_circle_green_big"
android:layout_width="@dimen/dp_31"
android:layout_height="@dimen/dp_31"
android:src="@drawable/circle_green_start_station"
app:layout_constraintLeft_toLeftOf="@+id/taskTimeTv"
app:layout_constraintTop_toTopOf="@+id/taskStartSiteTv"
app:layout_constraintBottom_toBottomOf="@+id/taskStartSiteTv"/>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/taskCircleTag2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/taxi_driver_circle_blue_big"
android:layout_width="@dimen/dp_31"
android:layout_height="@dimen/dp_31"
android:src="@drawable/circle_blue_end_station"
app:layout_constraintLeft_toLeftOf="@+id/taskCircleTag1"
app:layout_constraintRight_toRightOf="@+id/taskCircleTag1"
app:layout_constraintTop_toTopOf="@+id/taskEndSiteTv"
app:layout_constraintBottom_toBottomOf="@+id/taskEndSiteTv"/>
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/taxi_dot_line"
app:layout_constraintTop_toTopOf="@+id/taskStartSiteTv"
app:layout_constraintBottom_toBottomOf="@+id/taskEndSiteTv"
android:layout_width="@dimen/dp_4"
android:layout_height="0dp"
android:src="@drawable/line_start_to_end"
android:layout_marginBottom="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
app:layout_constraintTop_toTopOf="@+id/taskCircleTag1"
app:layout_constraintBottom_toBottomOf="@+id/taskCircleTag2"
app:layout_constraintLeft_toLeftOf="@+id/taskCircleTag1"
app:layout_constraintRight_toRightOf="@+id/taskCircleTag1"/>

View File

@@ -269,7 +269,6 @@ class RoadCrossRoamViewHolder(binding: View) : MessageViewHolder(binding){
outRect.bottom = 24
}
})
mapRoamView.openRoam()
lvRoadCrossRoamTip.adapter = RoadCrossRoamListAdapter(itemView.context, true)
// 创建横向移动的动画
val animator =

View File

@@ -87,30 +87,17 @@
<!-- 红绿灯 -->
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
android:id="@+id/traffic_light_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginEnd="@dimen/dp_40"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:visibility="gone"
app:traffic_light_user="traffic_light_taxi_p" />
<!--融合红绿灯-->
<com.mogo.eagle.core.function.hmi.ui.widget.FusionTrafficLightView
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficLightView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginEnd="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_26"
android:layout_marginEnd="@dimen/dp_21"
android:visibility="gone"
app:fusionLightUser="passenger_bus"
app:lightUser="passenger"
/>
<com.mogo.och.unmanned.passenger.ui.bar.LeftBarView
android:id="@+id/lbv_go2_center"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -41,28 +41,15 @@
android:layout_height="match_parent"/>
<!-- 红绿灯 -->
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
android:id="@+id/traffic_light_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_93"
android:layout_marginEnd="@dimen/dp_40"
android:visibility="gone"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:traffic_light_user="traffic_light_taxi_p" />
<!--融合红绿灯-->
<com.mogo.eagle.core.function.hmi.ui.widget.FusionTrafficLightView
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficLightView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_150"
android:layout_marginTop="@dimen/dp_136"
android:visibility="gone"
app:fusionLightUser="passenger"
app:lightUser="passenger"
/>
<!-- 地图marker点击触发路侧直播 -->

View File

@@ -24,8 +24,10 @@ import com.mogo.eagle.core.data.multidisplay.TelematicConstant
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.api.devatools.INDECloudListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerNDECloudManager
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
@@ -36,6 +38,9 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.skin.utils.SkinResources
import com.zhjt.mogo.adas.common.cloud.AstFuncTlmPhaseStateLightState
import com.zhjt.mogo.adas.data.bean.cloud.info.AstFuncTlmInfo
import com.zhjt.mogo.adas.data.bean.cloud.pojo.AstFuncPojo
import com.zhjt.service.chain.ChainLog
import perception.FusionTrafficLightOuterClass
import kotlin.math.abs
@@ -66,7 +71,7 @@ fun convert(state: FusionTrafficLightOuterClass.FusionLightState): TrafficLightE
* @since: 2022/4/28
*/
class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLightListener,
IMoGoChassisLocationGCJ02Listener {
IMoGoChassisLocationGCJ02Listener, INDECloudListener {
companion object {
const val TAG = "TrafficLightDispatcher"
@@ -93,6 +98,11 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
@Volatile
private var hasFusionLightStatus: Boolean = false
//是否有云控基础平台红绿灯数据
@Volatile
private var hasCloudControlLight: Boolean = false
//红绿灯定时器,超时未更新隐藏红绿灯
@Volatile
private var lightCountDownTimer: CountDownTimer? = null
@@ -110,6 +120,8 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
//注册获取当前车速
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 1, this)
//注册监听云控基础平台数据
CallerNDECloudManager.addListener(TAG,this)
}
/**
@@ -362,7 +374,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
"${SceneConstant.M_D_C}${TAG}",
"resetTrafficLight ------> isReset = $isReset ---hasObuLightStatus = $hasObuLightStatus"
)
if (!hasObuLightStatus && !hasAutopilotPerception && !hasFusionLightStatus) {
if (!hasObuLightStatus && !hasAutopilotPerception && !hasFusionLightStatus && !hasCloudControlLight) {
if (isReset) {
hide("云端重置红绿灯数据", DataSourceType.AICLOUD)
}
@@ -425,6 +437,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
hasObuLightStatus = false
hasAutopilotPerception = false
hasAiLightStatus = false
hasCloudControlLight = false
hasFusionLightStatus = true
CallerTrafficLightListenerManager.showFusionTrafficLight(currentState, currentDuration, nextState, nextDuration,
nextTwoState, nextTwoDuration, lightSource)
@@ -542,6 +555,8 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
//取消注册获取当前车速
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
//取消注册云控基础平台数据
CallerNDECloudManager.removeListener(TAG)
}
/**
@@ -551,4 +566,64 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
currentSpeed = abs(mogoLocation?.gnssSpeed ?: 0f)
}
/**
* NDE下发 信号灯信息
* @param astFuncPojo 云端辅助功能信息
* @param astFuncTlmInfo 云端下发信号灯信息
*/
override fun onNdeCloudAstFuncTlm(astFuncPojo: AstFuncPojo, astFuncTlmInfo: AstFuncTlmInfo) {
super.onNdeCloudAstFuncTlm(astFuncPojo, astFuncTlmInfo)
if(astFuncTlmInfo.phaseState.isNotEmpty()){
if(hasFusionLightStatus){
return
}else{
val currentState = getLightStatus(astFuncTlmInfo.phaseState[0].lightState)
val nextState = getLightStatus(astFuncTlmInfo.phaseState[0].nextLightState)
val currentDuration = astFuncTlmInfo.phaseState[0].timeLeft
val nextDuration = astFuncTlmInfo.phaseState[0].nextLightTime
if(currentState!=TrafficLightEnum.BLACK && nextState != TrafficLightEnum.BLACK
&& currentDuration != 0 && nextDuration != 0){
hasCloudControlLight = true
//展示云控基础平台信号灯信息
CallerTrafficLightListenerManager.showCloudTrafficLight(currentState, currentDuration, nextState, nextDuration)
}
}
}else{
hasCloudControlLight = false
}
}
/**
* 获取云控基础平台灯态
* @param lightState 当前灯态
*/
private fun getLightStatus(lightState: AstFuncTlmPhaseStateLightState): TrafficLightEnum {
return when (lightState) {
//红闪、红灯
AstFuncTlmPhaseStateLightState.RED_FLASH,
AstFuncTlmPhaseStateLightState.RED -> {
TrafficLightEnum.RED
}
//绿灯待行状态、绿灯状态、受保护相位绿灯(箭头灯)
AstFuncTlmPhaseStateLightState.GREEN_WAIT,
AstFuncTlmPhaseStateLightState.GREEN,
AstFuncTlmPhaseStateLightState.GREEN_PROTECTED -> {
TrafficLightEnum.GREEN
}
//黄灯状态、黄闪
AstFuncTlmPhaseStateLightState.YELLOW,
AstFuncTlmPhaseStateLightState.YELLOW_FLASH -> {
TrafficLightEnum.YELLOW
}
//异常、预留、未知状态、信号灯未工作、故障
AstFuncTlmPhaseStateLightState.ERROR,
AstFuncTlmPhaseStateLightState.RESERVED,
AstFuncTlmPhaseStateLightState.UNKNOWN,
AstFuncTlmPhaseStateLightState.OFF,
AstFuncTlmPhaseStateLightState.FAULT -> {
TrafficLightEnum.BLACK
}
}
}
}

View File

@@ -477,6 +477,18 @@ class OperatePanelLayout : LinearLayout {
}else{
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(NDE_EVENT_DATA_TO_PNC)?.also { changeValue(it, false) }//事件数据进PNC应用
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(NDE_PERCEPTION_DATA_TO_PNC)?.also { changeValue(it, false) }//感知数据进PNC应用
//关闭事件数据进PNC应用
CallerAutoPilotControlManager.sendNdeDownEventToPnc(0)
//查询事件数据进PNC应用
UiThreadHandler.postDelayed({
CallerAutoPilotControlManager.sendGetParamReq(AdasConstants.MapSystemParamType.V2N_TO_PNC)
}, 500)
//关闭感知数据进PNC应用
CallerAutoPilotControlManager.sendNdeDownPerceptionToPnc(0)
//查询感知数据进PNC应用
UiThreadHandler.postDelayed({
CallerAutoPilotControlManager.sendGetParamReq(AdasConstants.MapSystemParamType.PERCEPTION_TO_PNC)
}, 500)
}
return true
}
@@ -570,6 +582,15 @@ class OperatePanelLayout : LinearLayout {
CallerAutoPilotControlManager.sendV2iDownPerceptionToPnc(1)
}else{
CallerAutoPilotControlManager.sendV2iDownPerceptionToPnc(0)
//关闭弱势交通参与者
FunctionBuildConfig.v2iWeakTrafficParticipant = false
//关闭感知数据进PNC应用
FunctionBuildConfig.v2iPerceptionDataToPnc = false
CallerAutoPilotControlManager.sendV2iDownPerceptionToPnc(0)
//查询V2I下行感知进PNC开关状态
UiThreadHandler.postDelayed({
CallerAutoPilotControlManager.sendGetParamReq(AdasConstants.MapSystemParamType.V2I_TO_PNC)
}, 500)
}
hmiAction("V2I下行, ", isChecked)
clickEventAnalytics("V2I下行", isChecked)
@@ -632,14 +653,18 @@ class OperatePanelLayout : LinearLayout {
0->{
FunctionBuildConfig.ndeUpwardSwitch = it.enable
FunctionBuildConfig.ndeDownwardSwitch = it.enable
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(NDE_UPWARD_SWITCH)?.also { changeValue(it, FunctionBuildConfig.ndeUpwardSwitch) }
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(NDE_DOWNWARD_SWITCH)?.also { changeValue(it, FunctionBuildConfig.ndeDownwardSwitch) }
}
//上行
1->{
FunctionBuildConfig.ndeUpwardSwitch = it.enable
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(NDE_UPWARD_SWITCH)?.also { changeValue(it, FunctionBuildConfig.ndeUpwardSwitch) }
}
//下行
2->{
FunctionBuildConfig.ndeDownwardSwitch = it.enable
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(NDE_DOWNWARD_SWITCH)?.also { changeValue(it, FunctionBuildConfig.ndeDownwardSwitch) }
}
}
}
@@ -650,14 +675,18 @@ class OperatePanelLayout : LinearLayout {
0->{
FunctionBuildConfig.cloudControlUpward = it.enable
FunctionBuildConfig.cloudControlDownward = it.enable
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(CLOUD_CONTROL_UPWARD)?.also { changeValue(it, FunctionBuildConfig.cloudControlUpward) }
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(CLOUD_CONTROL_DOWNWARD)?.also { changeValue(it, FunctionBuildConfig.cloudControlDownward) }
}
//上行
1->{
FunctionBuildConfig.cloudControlUpward = it.enable
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(CLOUD_CONTROL_UPWARD)?.also { changeValue(it, FunctionBuildConfig.cloudControlUpward) }
}
//下行
2->{
FunctionBuildConfig.cloudControlDownward = it.enable
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(CLOUD_CONTROL_DOWNWARD)?.also { changeValue(it, FunctionBuildConfig.cloudControlDownward) }
}
}
}

View File

@@ -0,0 +1,205 @@
package com.mogo.eagle.core.function.hmi.ui.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.SweepGradient;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.enums.TrafficLightEnum;
import com.mogo.eagle.core.function.hmi.R;
import java.util.ArrayList;
import java.util.List;
import me.jessyan.autosize.utils.AutoSizeUtils;
/**
* 融合红绿灯红、黄、绿时间占比示意View
* 鹰眼6.5.0需求
*/
public class ProportionChartTwoView extends View {
private static final int DEFAULT_RING_WIDTH = 5;
private float mRingWidth = 0;
private Paint mRingPaint;
private RectF mRectF;
//红绿灯绿灯、黄灯、红灯灯色时间
private List<Integer> proportionList = new ArrayList<>();
//红绿灯灯态
private List<TrafficLightEnum> lightStatusList = new ArrayList<>();
//一轮灯态的总时长
private int totalDuration = 0;
int[] greenColorArray = new int[]{Color.parseColor("#45E041"),Color.parseColor("#45E041")};
int[] yellowColorArray = new int[]{Color.parseColor("#FFF000"),Color.parseColor("#FFF000")};
int[] redColorArray = new int[]{Color.parseColor("#FF4E41"),Color.parseColor("#FF4E41")};
public ProportionChartTwoView(Context context) {
super(context);
initSize(context);
init();
}
public ProportionChartTwoView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
initAttr(context, attrs);
initSize(context);
init();
}
/**
* 更新红绿灯时间
* @param durationList 时间列表
* @param colorList 灯态列表
*/
public void updateProportion(List<Integer> durationList, List<TrafficLightEnum> colorList){
if(durationList != null && colorList != null){
this.proportionList = durationList;
totalDuration = 0;
for(int element: proportionList){
totalDuration += element;
}
this.lightStatusList = colorList;
postInvalidate();
}
}
public ProportionChartTwoView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initAttr(context, attrs);
initSize(context);
init();
}
private void initAttr(Context context, AttributeSet attrs){
if (attrs == null) {
return;
}
TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.ProportionChartTwoView);
int n = array.getIndexCount();
for (int i = 0; i < n; i++) {
int attr = array.getIndex(i);
if (attr == R.styleable.ProportionChartTwoView_chartRingWidth) {
mRingWidth = array.getDimension(attr, AutoSizeUtils.dp2px(context, DEFAULT_RING_WIDTH));
}
}
array.recycle();
}
/**
* 初始化Size
* @param context 上下文
*/
private void initSize(Context context){
if (mRingWidth == 0) {
mRingWidth = AutoSizeUtils.dp2px(context, AutoSizeUtils.dp2px(context, DEFAULT_RING_WIDTH));
}
}
/**
* 初始化画笔
*/
private void init(){
mRectF = new RectF();
mRingPaint = new Paint();
//抗锯齿
mRingPaint.setAntiAlias(true);
//防抖动
mRingPaint.setDither(true);
//仅描边(圆环)
mRingPaint.setStyle(Paint.Style.STROKE);
//圆环宽度
mRingPaint.setStrokeWidth(mRingWidth);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int size = Math.max(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.getSize(widthMeasureSpec));
setMeasuredDimension(size, size);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
//宽和高分别去掉padding值取min的一半即圆的半径(这里demo没有用到可自行做一些其他计算使用)
// mRadius = Math.min(w - getPaddingLeft() - getPaddingRight(), h - getPaddingTop() - getPaddingBottom()) / 2f;
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
drawRingView(canvas);
}
/**
* 画Ring
*/
private void drawRingView(Canvas canvas){
float sweepAngle = 0f;
float startAngle = -90f;
//矩形坐标
mRectF.set(getPaddingLeft() + mRingWidth / 2 , getPaddingTop() + mRingWidth / 2 ,
getWidth() - getPaddingRight() - mRingWidth / 2, getHeight() - getPaddingBottom() - mRingWidth / 2 );
for(int i=0;i<proportionList.size();i++){
startAngle += sweepAngle;
sweepAngle = 360f*proportionList.get(i)/totalDuration;
SweepGradient sweepGradient;
//设置渐变颜色
if(lightStatusList.get(i) == TrafficLightEnum.GREEN){
//设置绿灯渐变色
sweepGradient = new SweepGradient(getWidth()/2f,(getPaddingTop() + getHeight() - getPaddingBottom())/2f,
greenColorArray,null);
Matrix rotateMatrix = new Matrix();
if(i == 0){
rotateMatrix.setRotate(270,getWidth()/2f,(getPaddingTop() + getHeight() - getPaddingBottom())/2f);
}else if(i == 1){
rotateMatrix.setRotate(270+(360*proportionList.get(0)),getWidth()/2f,(getPaddingTop() + getHeight() - getPaddingBottom())/2f);
}else{
rotateMatrix.setRotate(270+(360*proportionList.get(0)+proportionList.get(1)),getWidth()/2f,(getPaddingTop() + getHeight() - getPaddingBottom())/2f);
}
sweepGradient.setLocalMatrix(rotateMatrix);
}else if(lightStatusList.get(i) == TrafficLightEnum.YELLOW){
//设置黄灯渐变色
sweepGradient = new SweepGradient(getWidth()/2f,(getPaddingTop() + getHeight() - getPaddingBottom())/2f,
yellowColorArray,null);
Matrix rotateMatrix = new Matrix();
if(i == 0){
rotateMatrix.setRotate(270,getWidth()/2f,(getPaddingTop() + getHeight() - getPaddingBottom())/2f);
}else if(i == 1){
rotateMatrix.setRotate(270+(360*proportionList.get(0)),getWidth()/2f,(getPaddingTop() + getHeight() - getPaddingBottom())/2f);
}else{
rotateMatrix.setRotate(270+(360*proportionList.get(0)+proportionList.get(1)),getWidth()/2f,(getPaddingTop() + getHeight() - getPaddingBottom())/2f);
}
sweepGradient.setLocalMatrix(rotateMatrix);
}else{
//设置红灯渐变色
sweepGradient = new SweepGradient(getWidth()/2f,(getPaddingTop() + getHeight() - getPaddingBottom())/2f,
redColorArray,null);
Matrix rotateMatrix = new Matrix();
if(i == 0){
rotateMatrix.setRotate(270,getWidth()/2f,(getPaddingTop() + getHeight() - getPaddingBottom())/2f);
}else if(i == 1){
rotateMatrix.setRotate(270+(360*proportionList.get(0)),getWidth()/2f,(getPaddingTop() + getHeight() - getPaddingBottom())/2f);
}else{
rotateMatrix.setRotate(270+(360*proportionList.get(0)+proportionList.get(1)),getWidth()/2f,(getPaddingTop() + getHeight() - getPaddingBottom())/2f);
}
sweepGradient.setLocalMatrix(rotateMatrix);
}
mRingPaint.setShader(sweepGradient);
//画圆环
canvas.drawArc(mRectF, startAngle, sweepAngle, false, mRingPaint);
}
}
}

View File

@@ -0,0 +1,530 @@
package com.mogo.eagle.core.function.hmi.ui.widget
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.TrafficLightEnum
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerServicesEventManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
/**
* 8.1.0 信号灯统一方案
*/
class TrafficLightView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoTrafficLightListener {
companion object {
private const val TAG = "TrafficLightView"
}
private var user = 0 //使用方driver:0 passenger 1
private lateinit var ivLightStatus: ImageView //灯态
private lateinit var pcvLightProportion: ProportionChartTwoView //时长占比示意
private lateinit var tvLightRemain: TypefaceTextView //倒计时
private lateinit var tvLightSource: TextView //数据来源
private var totalDuration = 0 //一轮灯态的总时长
private var currentAngle = 0f //指针指向角度
private var currentLightState = TrafficLightEnum.BLACK //当前灯态
private var currentLightDuration = 0 //当前灯态倒计时
private var previousLightStatus = TrafficLightEnum.BLACK //上一帧灯态
private var previousLightDuration = 0 //上一帧灯态倒计时
private var redLightRoundNum = 0 //当前路口红灯出现的轮数
private var greenLightRoundNum = 0 //当前路口绿灯出现的轮数
private var yellowLightRoundNum = 0 //当前路口黄灯出现的轮数
private var isShowLight: Boolean = false
private var currentSource: Int = -1 //0:融合 1:云控基础平台 2:自车感知
init {
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.TrafficLightView)
user = typedArray.getInt(R.styleable.TrafficLightView_lightUser,0)
typedArray.recycle()
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
when(user){
//司机端
0 -> {
LayoutInflater.from(context).inflate(R.layout.hmi_view_traffic_light_driver, this, true)
}
//乘客端
1 -> {
LayoutInflater.from(context).inflate(R.layout.hmi_view_traffic_light_passenger, this, true)
}
}
CallerTrafficLightListenerManager.addListener(TAG, this)
initView()
}
private fun initView(){
ivLightStatus = findViewById(R.id.ivLightStatus)
pcvLightProportion = findViewById(R.id.pcvLightProportion)
tvLightRemain = findViewById(R.id.tvLightRemain)
tvLightSource = findViewById(R.id.tvLightSource)
}
/**
* 关闭红绿灯预警展示,并重制灯态
*/
override fun disableTrafficLight() {
super.disableTrafficLight()
UiThreadHandler.post{
this@TrafficLightView.visibility = GONE
CallerHmiViewControlListenerManager.invokeV2XEvent(View.GONE, TAG)
//将灯态轮归零
returnToZero()
resetLight()
}
}
/**
* 将灯态轮归零
*/
private fun returnToZero(){
redLightRoundNum = 0 //当前路口红灯出现的轮数
greenLightRoundNum = 0 //当前路口绿灯出现的轮数
yellowLightRoundNum = 0 //当前路口黄灯出现的轮数
}
/**
* 重置灯态
*/
private fun resetLight(){
currentLightState = TrafficLightEnum.BLACK
currentLightDuration = 0
previousLightStatus = TrafficLightEnum.BLACK
previousLightDuration = 0
currentSource = -1
}
/**
* 判断是否进入新的一轮灯态
* @param currentState 当前灯态
*/
private fun judgeRoundNum(currentState: TrafficLightEnum): Boolean{
if(currentLightState == currentState){
return false
}else{
currentLightState = currentState
when(currentState){
TrafficLightEnum.RED->{
redLightRoundNum++
return redLightRoundNum > greenLightRoundNum && redLightRoundNum > yellowLightRoundNum
}
TrafficLightEnum.GREEN->{
greenLightRoundNum++
return greenLightRoundNum > redLightRoundNum && greenLightRoundNum > yellowLightRoundNum
}
TrafficLightEnum.YELLOW->{
yellowLightRoundNum++
return yellowLightRoundNum > redLightRoundNum && yellowLightRoundNum > greenLightRoundNum
}
TrafficLightEnum.BLACK->{
return false
}
}
}
}
/**
* 展示红绿灯预警
* @param checkLightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知 3:OBU
*/
override fun showTrafficLight(checkLightId: TrafficLightEnum, lightSource: DataSourceType) {
super.showTrafficLight(checkLightId, lightSource)
UiThreadHandler.post {
CallerLogger.d("$M_HMI$TAG","update checkLightId:$checkLightId, lightSource: $lightSource")
isShowLight = true
// currentLightState = checkLightId
updateTrafficLightIcon(checkLightId, lightSource)
}
}
/**
* @param redNum 红灯倒计时
* @param yellowNum 黄灯倒计时
* @param greenNum 绿灯倒计时
*/
override fun changeCountdownTrafficLightNum(redNum: Int, yellowNum: Int, greenNum: Int) {
super.changeCountdownTrafficLightNum(redNum, yellowNum, greenNum)
UiThreadHandler.post {
when (currentLightState) {
TrafficLightEnum.RED -> changeCountdownRed(redNum)
TrafficLightEnum.YELLOW -> changeCountdownYellow(yellowNum)
TrafficLightEnum.GREEN -> changeCountdownGreen(greenNum)
else ->{}
}
}
}
override fun changeCountdownRed(redNum: Int) {
super.changeCountdownRed(redNum)
UiThreadHandler.post {
if (redNum > 0) {
tvLightRemain.text = redNum.toString()
} else {
disableTrafficLightCountDown()
}
}
}
override fun changeCountdownGreen(greenNum: Int) {
super.changeCountdownGreen(greenNum)
UiThreadHandler.post {
if (greenNum > 0) {
tvLightRemain.text = greenNum.toString()
} else {
disableTrafficLightCountDown()
}
}
}
override fun changeCountdownYellow(yellowNum: Int) {
super.changeCountdownYellow(yellowNum)
UiThreadHandler.post {
if (yellowNum > 0) {
tvLightRemain.text = yellowNum.toString()
} else {
disableTrafficLightCountDown()
}
}
}
/**
* 更新红绿灯icon
*
* @param lightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知; 3:OBU
*/
private fun updateTrafficLightIcon(lightId: TrafficLightEnum, lightSource: DataSourceType) {
if(currentSource == 0 || currentSource == 1){
return
}
if(currentSource == -1){
this@TrafficLightView.visibility = View.VISIBLE
currentSource = 2
}
when (lightId) {
TrafficLightEnum.RED -> {
if(user == 0){
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_red_light_driver))
}else{
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_red_light_passenger))
}
}
TrafficLightEnum.YELLOW -> {
if(user == 0){
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_yellow_light_driver))
}else{
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_yellow_light_passenger))
}
}
TrafficLightEnum.GREEN -> {
if(user == 0){
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_green_light_driver))
}else{
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_green_light_passenger))
}
}
else -> this@TrafficLightView.visibility = GONE
}
when (lightSource) {
DataSourceType.AICLOUD -> {
tvLightSource.text = context.getString(R.string.light_source_ai_cloud)
}
DataSourceType.TELEMATIC_UNION_V2I,
DataSourceType.TELEMATIC_UNION_V2N,
DataSourceType.TELEMATIC -> {
tvLightSource.text = context.getString(R.string.light_source_perception)
}
DataSourceType.OBU -> {
tvLightSource.text = context.getString(R.string.light_source_obu)
}
else -> {
tvLightSource.visibility = GONE
}
}
}
/**
* 展示融合带有下一下二灯态的红绿灯
* @param currentState 当前灯态
* @param currentDuration 当前灯态倒计时
* @param nextState 下一灯态
* @param nextDuration 下一灯态倒计时
* @param nextTwoState 下二灯态
* @param nextTwoDuration 下二灯态倒计时
* @param lightSource 数据来源
*/
override fun showFusionTrafficLight(currentState: TrafficLightEnum, currentDuration: Int, nextState: TrafficLightEnum,
nextDuration: Int, nextTwoState: TrafficLightEnum, nextTwoDuration: Int, lightSource: DataSourceType
) {
super.showFusionTrafficLight(currentState, currentDuration, nextState, nextDuration, nextTwoState, nextTwoDuration, lightSource)
if(currentLightState == currentState && currentLightDuration == currentDuration){
return
}
currentLightDuration = currentDuration
ThreadUtils.runOnUiThread {
//如果初次获取的路口灯态倒计时时长小于1秒则返回不处理灯态进入下一轮灯态开始进行显示
if(this@TrafficLightView.visibility == View.GONE && currentDuration < 1){
return@runOnUiThread
}
//兼容融合异常数据当下一下二灯态时长均大于0时展示
if(this@TrafficLightView.visibility == View.GONE && (nextDuration == 0) || nextTwoDuration == 0){
return@runOnUiThread
}
/**
* 如果红绿灯显示过程中遇到突然灯态发生改变即当前灯态未倒计时完成灯态发生变化
* (正常情况下不会出现此情况,兼容异常状态)
* 重置灯态占比和指针指向
*/
if(previousLightStatus == TrafficLightEnum.BLACK && previousLightDuration == 0
&& currentState != TrafficLightEnum.BLACK && currentDuration != 0){
previousLightStatus = currentState
previousLightDuration = currentDuration
}else{
if((currentState != previousLightStatus && previousLightDuration >1)
|| (currentState == previousLightStatus && previousLightDuration < currentDuration)){
//灯态未倒计时到1灯态发生变化正常情况是倒计时到0考虑到可能存在的异常情况倒计时到1也算正常
returnToZero()
resetLight()
}else{
previousLightStatus = currentState
previousLightDuration = currentDuration
}
}
//如果当前红绿灯视图为隐藏状态则设置为显示状态
if(judgeRoundNum(currentState) || currentSource == 1){
//从云控基础平台信号源切换到融合感知信号源
currentSource = 0
if(this@TrafficLightView.visibility == View.GONE){
this@TrafficLightView.visibility = View.VISIBLE
CallerHmiViewControlListenerManager.invokeV2XEvent(View.VISIBLE, TAG)
CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.LIGHT)
}
val colorList = ArrayList<TrafficLightEnum>()
val durationList = ArrayList<Int>()
colorList.add(currentState)
colorList.add(nextState)
colorList.add(nextTwoState)
if(currentDuration < 3){
durationList.add(3)
totalDuration = 3 + nextDuration + nextTwoDuration
currentAngle = 360f/totalDuration*(3-currentDuration) - 90f
}else{
durationList.add(currentDuration)
totalDuration = currentDuration + nextDuration + nextTwoDuration
currentAngle = -90f
}
durationList.add(nextDuration)
durationList.add(nextTwoDuration)
//没轮灯态绘制一次灯态时长比例
pcvLightProportion.updateProportion(durationList,colorList)
}else{
if(currentAngle < 360f){
currentAngle += 360f/totalDuration
}
}
//根据当前灯态设置转盘、刻度、指针背景
when(currentState){
TrafficLightEnum.GREEN -> {
if(user == 0){
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_green_light_pointer_driver))
}else{
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_green_light_pointer_passenger))
}
}
TrafficLightEnum.YELLOW -> {
if(user == 0){
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_yellow_light_pointer_driver))
}else{
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_yellow_light_pointer_passenger))
}
}
else -> {
if(user == 0){
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_red_light_pointer_driver))
}else{
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_red_light_pointer_passenger))
}
}
}
if(ivLightStatus.visibility != View.VISIBLE){
ivLightStatus.visibility = View.VISIBLE
}
if(pcvLightProportion.visibility != View.VISIBLE){
pcvLightProportion.visibility = View.VISIBLE
}
if(tvLightSource.visibility == View.VISIBLE){
tvLightSource.visibility = View.INVISIBLE
}
if(tvLightRemain.visibility != View.VISIBLE){
tvLightRemain.visibility = View.VISIBLE
}
//更新当前灯态倒计时时间
if(currentDuration>0){
tvLightRemain.text = currentDuration.toString()
}else{
tvLightRemain.text = "0"
}
//更新指针指向
val pointerLayoutParams = ivLightStatus.layoutParams as LayoutParams
pointerLayoutParams.circleAngle = currentAngle
ivLightStatus.rotation = currentAngle
ivLightStatus.layoutParams = pointerLayoutParams
}
}
/**
* 展示云控基础平台数据红绿灯
* @param currentState 当前灯态
* @param currentDuration 当前灯态倒计时
* @param nextState 下一灯态
* @param nextDuration 下一灯态倒计时
*/
override fun showCloudTrafficLight(currentState: TrafficLightEnum, currentDuration: Int,
nextState: TrafficLightEnum, nextDuration: Int) {
super.showCloudTrafficLight(currentState, currentDuration, nextState, nextDuration)
currentSource = 1
if(currentLightState == currentState && currentLightDuration == currentDuration){
return
}
currentLightDuration = currentDuration
ThreadUtils.runOnUiThread{
//如果初次获取的路口灯态倒计时时长小于1秒则返回不处理灯态进入下一轮灯态开始进行显示
if(this@TrafficLightView.visibility == View.GONE && currentDuration < 1){
return@runOnUiThread
}
//如果当前红绿灯视图为隐藏状态则设置为显示状态
if(judgeRoundNum(currentState)){
if(this@TrafficLightView.visibility == View.GONE){
this@TrafficLightView.visibility = View.VISIBLE
CallerHmiViewControlListenerManager.invokeV2XEvent(View.VISIBLE, TAG)
CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.LIGHT)
}
val colorList = ArrayList<TrafficLightEnum>()
val durationList = ArrayList<Int>()
colorList.add(currentState)
colorList.add(nextState)
if(currentDuration < 3){
durationList.add(3)
totalDuration = 3 + nextDuration
currentAngle = 360f/totalDuration*(3-currentDuration) - 90f
}else{
durationList.add(currentDuration)
totalDuration = currentDuration + nextDuration
currentAngle = -90f
}
durationList.add(nextDuration)
//没轮灯态绘制一次灯态时长比例
pcvLightProportion.updateProportion(durationList,colorList)
}else{
if(currentAngle < 360f){
currentAngle += 360f/totalDuration
}
}
//根据当前灯态设置转盘、刻度、指针背景
when(currentState){
TrafficLightEnum.GREEN -> {
if(user == 0){
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_green_light_pointer_driver))
}else{
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_green_light_pointer_passenger))
}
}
TrafficLightEnum.YELLOW -> {
if(user == 0){
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_yellow_light_pointer_driver))
}else{
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_yellow_light_pointer_passenger))
}
}
else -> {
if(user == 0){
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_red_light_pointer_driver))
}else{
ivLightStatus.setImageDrawable(ContextCompat.getDrawable(context,R.drawable.icon_red_light_pointer_passenger))
}
}
}
if(ivLightStatus.visibility != View.VISIBLE){
ivLightStatus.visibility = View.VISIBLE
}
if(pcvLightProportion.visibility != View.VISIBLE){
pcvLightProportion.visibility = View.VISIBLE
}
if(tvLightSource.visibility == View.VISIBLE){
tvLightSource.visibility = View.INVISIBLE
}
if(tvLightRemain.visibility != View.VISIBLE){
tvLightRemain.visibility = View.VISIBLE
}
//更新当前灯态倒计时时间
if(currentDuration>0){
tvLightRemain.text = currentDuration.toString()
}else{
tvLightRemain.text = "0"
}
//更新指针指向
val pointerLayoutParams = ivLightStatus.layoutParams as LayoutParams
pointerLayoutParams.circleAngle = currentAngle
ivLightStatus.rotation = currentAngle
ivLightStatus.layoutParams = pointerLayoutParams
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerTrafficLightListenerManager.removeListener(TAG)
}
override fun onVisibilityChanged(changedView: View, visibility: Int) {
super.onVisibilityChanged(changedView, visibility)
if(visibility == View.VISIBLE && isShowLight){
CallerServicesEventManager.updateServicesNum(CallerServicesEventManager.ServiceType.LIGHT)
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_295"
android:layout_height="@dimen/dp_178"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_traffic_light_driver">
<ImageView
android:id="@+id/ivLightStatus"
android:layout_width="@dimen/dp_140"
android:layout_height="@dimen/dp_140"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:contentDescription="@string/common_traffic_light_status"
/>
<com.mogo.eagle.core.function.hmi.ui.widget.ProportionChartTwoView
android:id="@+id/pcvLightProportion"
android:layout_width="@dimen/dp_125"
android:layout_height="@dimen/dp_125"
app:layout_constraintTop_toTopOf="@id/ivLightStatus"
app:layout_constraintBottom_toBottomOf="@id/ivLightStatus"
app:layout_constraintLeft_toLeftOf="@id/ivLightStatus"
app:layout_constraintRight_toRightOf="@id/ivLightStatus"
/>
<com.mogo.eagle.core.function.hmi.ui.widget.TypefaceTextView
android:id="@+id/tvLightRemain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivLightStatus"
app:layout_constraintBottom_toBottomOf="@id/ivLightStatus"
app:layout_constraintLeft_toRightOf="@id/ivLightStatus"
app:layout_constraintRight_toRightOf="parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_80"
app:textType="DS_DIGIB_2"
android:layout_marginEnd="@dimen/dp_40"
/>
<TextView
android:id="@+id/tvLightSource"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvLightRemain"
app:layout_constraintBottom_toBottomOf="@id/tvLightRemain"
app:layout_constraintLeft_toLeftOf="@id/tvLightRemain"
app:layout_constraintRight_toRightOf="@id/tvLightRemain"
android:textColor="@color/white"
android:textSize="@dimen/sp_40"
android:textStyle="bold"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_192"
android:layout_height="@dimen/dp_122"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_traffic_light_passenger">
<ImageView
android:id="@+id/ivLightStatus"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_90"
android:src="@drawable/icon_green_light_passenger"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_10"
android:contentDescription="@string/common_traffic_light_status"
/>
<com.mogo.eagle.core.function.hmi.ui.widget.ProportionChartTwoView
android:id="@+id/pcvLightProportion"
android:layout_width="@dimen/dp_76"
android:layout_height="@dimen/dp_76"
app:layout_constraintTop_toTopOf="@id/ivLightStatus"
app:layout_constraintBottom_toBottomOf="@id/ivLightStatus"
app:layout_constraintLeft_toLeftOf="@id/ivLightStatus"
app:layout_constraintRight_toRightOf="@id/ivLightStatus"
app:chartRingWidth="@dimen/dp_3"
/>
<com.mogo.eagle.core.function.hmi.ui.widget.TypefaceTextView
android:id="@+id/tvLightRemain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivLightStatus"
app:layout_constraintBottom_toBottomOf="@id/ivLightStatus"
app:layout_constraintLeft_toRightOf="@id/ivLightStatus"
app:layout_constraintRight_toRightOf="parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_50"
app:textType="DS_DIGIB_2"
android:layout_marginEnd="@dimen/dp_40"
/>
<TextView
android:id="@+id/tvLightSource"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvLightRemain"
app:layout_constraintBottom_toBottomOf="@id/tvLightRemain"
app:layout_constraintLeft_toLeftOf="@id/tvLightRemain"
app:layout_constraintRight_toRightOf="@id/tvLightRemain"
android:textColor="@color/white"
android:textSize="@dimen/sp_26"
android:textStyle="bold"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -78,31 +78,18 @@
app:layout_constraintEnd_toStartOf="@+id/visualAngleToggle"
app:layout_goneMarginEnd="@dimen/dp_50" />
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
android:id="@+id/viewTrafficLightVr"
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficLightView
android:id="@+id/tlvDriver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
android:visibility="gone"
app:pressed_enabled="false"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.widget.FusionTrafficLightView
android:id="@+id/viewFusionTrafficLight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"
app:fusionLightUser="driver"
app:lightUser="driver"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
/>
<!--红绿灯提醒-->
<com.mogo.eagle.core.function.hmi.ui.notice.traffic.TrafficLightPromptView
@@ -124,8 +111,8 @@
android:layout_height="@dimen/dp_129"
android:layout_marginTop="@dimen/dp_71"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@+id/viewTrafficLightVr"
app:layout_constraintTop_toBottomOf="@+id/viewTrafficLightVr"
app:layout_constraintEnd_toEndOf="@+id/tlvDriver"
app:layout_constraintTop_toBottomOf="@+id/tlvDriver"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_goneMarginEnd="40dp"

View File

@@ -123,6 +123,10 @@
<attr name="ringWidth" format="reference|dimension"/>
</declare-styleable>
<declare-styleable name="ProportionChartTwoView">
<attr name="chartRingWidth" format="reference|dimension"/>
</declare-styleable>
<declare-styleable name="FusionTrafficLightView">
<attr name="fusionLightUser">
<enum name="driver" value="0"/>
@@ -131,6 +135,13 @@
</attr>
</declare-styleable>
<declare-styleable name="TrafficLightView">
<attr name="lightUser">
<enum name="driver" value="0"/>
<enum name="passenger" value="1"/>
</attr>
</declare-styleable>
<declare-styleable name="TrafficLightPromptView">
<attr name="promptUser">
<enum name="driver" value="0"/>

View File

@@ -107,13 +107,13 @@
<string name="traffic_light_status">红绿灯灯态</string>
<!--红绿灯数据来源-->
<string name="light_source_ai_cloud">云端下发</string>
<string name="light_source_ai_cloud">云端</string>
<string name="light_source_driver_ai_cloud">云\n端</string>
<string name="light_source_perception">自车感知</string>
<string name="light_source_perception">自车</string>
<string name="light_source_driver_perception">自\n车</string>
<string name="light_source_perception_v2i">融合V2I</string>
<string name="light_source_perception_v2n">融合V2N</string>
<string name="light_source_obu">\u2000OBU\u2000</string>
<string name="light_source_obu">OBU</string>
<string name="light_source_driver_obu">O\nB\nU</string>
<string name="parallel_drive">远程代驾</string>
<string name="parallel_drive_requesting">请求中...</string>
@@ -296,4 +296,6 @@
<string name="disk_not_enough_space">剩余空间不足</string>
<string name="date_cannot_copy">所选日期无法拷贝</string>
<string name="common_traffic_light_status">红绿灯灯态背景</string>
</resources>

View File

@@ -88,6 +88,16 @@ interface IMoGoTrafficLightListener {
nextTwoState: TrafficLightEnum, nextTwoDuration: Int,
lightSource: DataSourceType){}
/**
* 云控基础平台红绿灯
* @param currentState 当前灯态
* @param currentDuration 当前灯态倒计时
* @param nextState 下一灯态
* @param nextDuration 下一灯态倒计时
*/
fun showCloudTrafficLight(currentState: TrafficLightEnum, currentDuration: Int,
nextState: TrafficLightEnum, nextDuration: Int){}
/**
* @param redNum 红灯倒计时
* @param yellowNum 黄灯倒计时

View File

@@ -19,14 +19,14 @@ interface INDECloudListener {
* @param astFuncPojo 云端辅助功能信息
* @param astFuncTlmInfo 云端下发信号灯信息
*/
fun onNdeCloudAstFuncTlm(astFuncPojo: AstFuncPojo, astFuncTlmInfo: AstFuncTlmInfo)
fun onNdeCloudAstFuncTlm(astFuncPojo: AstFuncPojo, astFuncTlmInfo: AstFuncTlmInfo){}
/**
* NDE下发 信号灯路口车速引导功能指令
* @param advicePojo 实时决策建议
* @param adviceGlosaInfo 信号灯路口车速引导功能指令
*/
fun onNdeCloudAdviceGlosa(advicePojo: AdvicePojo, adviceGlosaInfo: AdviceGlosaInfo)
fun onNdeCloudAdviceGlosa(advicePojo: AdvicePojo, adviceGlosaInfo: AdviceGlosaInfo){}
/**
* NDE下发 通用 RSI 预警指令
@@ -42,27 +42,27 @@ interface INDECloudListener {
* @param advicePojo 实时决策建议
* @param adviceComRsiInfo 通用RSI预警指令
*/
fun onNdeCloudAdviceComRsi(advicePojo: AdvicePojo, adviceComRsiInfo: AdviceComRsiInfo)
fun onNdeCloudAdviceComRsi(advicePojo: AdvicePojo, adviceComRsiInfo: AdviceComRsiInfo){}
/**
* NDE下发 紧急车辆预警指令
* @param advicePojo 实时决策建议
* @param adviceEvwInfo 紧急车辆预警指令
*/
fun onNdeCloudAdviceEvw(advicePojo: AdvicePojo, adviceEvwInfo: AdviceEvwInfo)
fun onNdeCloudAdviceEvw(advicePojo: AdvicePojo, adviceEvwInfo: AdviceEvwInfo){}
/**
* NDE下发 动态车道级限速指令
* @param advicePojo 实时决策建议
* @param adviceLaneSpdLmtInfo 动态车道级限速指令
*/
fun onNdeCloudAdviceLaneSpdLmt(advicePojo: AdvicePojo, adviceLaneSpdLmtInfo: AdviceLaneSpdLmtInfo)
fun onNdeCloudAdviceLaneSpdLmt(advicePojo: AdvicePojo, adviceLaneSpdLmtInfo: AdviceLaneSpdLmtInfo){}
/**
* NDE下发 异常车辆预警指令
* @param advicePojo 实时决策建议
* @param adviceAvwInfo 异常车辆预警指令
*/
fun onNdeCloudAdviceAvw(advicePojo: AdvicePojo, adviceAvwInfo: AdviceAvwInfo)
fun onNdeCloudAdviceAvw(advicePojo: AdvicePojo, adviceAvwInfo: AdviceAvwInfo){}
}

View File

@@ -106,6 +106,21 @@ object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>
}
}
/**
* 云控基础平台红绿灯信号
* @param currentState 当前灯态
* @param currentDuration 当前灯态倒计时
* @param nextState 下一灯态
* @param nextDuration 下一灯态倒计时
*/
fun showCloudTrafficLight(currentState: TrafficLightEnum,currentDuration: Int,
nextState: TrafficLightEnum, nextDuration: Int){
M_LISTENERS.forEach{
val listener = it.value
listener.showCloudTrafficLight(currentState, currentDuration, nextState, nextDuration)
}
}
fun changeCountdownTrafficLightNum(redNum: Int, yellowNum: Int, greenNum: Int) {
M_LISTENERS.forEach {
val listener = it.value

View File

@@ -93,8 +93,8 @@ WEBSOCKET_VERSION=1.1.7
applicationId=com.mogo.launcer
applicationName=IntelligentPilot
# RoboBus司机端2.5.1RoboTaxi司机端2.5.1RoboTaxi乘客端1.0.0
versionCode=8000000
versionName=8.0.0
versionCode=8001000
versionName=8.1.0
################# 新架构模块Maven版本管理 #################
MOGO_CORE_FUNCTION_HMI_VERSION=0.0.58.10
@@ -152,7 +152,7 @@ MATRIX_VERSION=2.0.8
# 公交模式司机端版本号
DRIVER_VERSION=8.0.0
DRIVER_VERSION=8.1.0
# 公交模式乘客端端版本号
PASSENGER_VERSION=7.0.0
PASSENGER_VERSION=7.1.0