增加HMI中红绿灯View代理设置,setProxyTrafficLightView,代理View需要实现IViewTrafficLight抽象类

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2022-03-11 19:04:03 +08:00
parent b1299cf805
commit 839df02f43
7 changed files with 143 additions and 41 deletions

View File

@@ -0,0 +1,39 @@
package com.mogo.eagle.core.function.api.hmi.view
import android.content.Context
import android.util.AttributeSet
import android.widget.LinearLayout
/**
* 定义红绿灯View具备的功能接口
*/
abstract class IViewTrafficLight(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) :
LinearLayout(context, attrs, defStyleAttr) {
/**
* 展示红绿灯预警
*
* @param checkLightId 0-都是默认1-红2-黄3-绿
*/
open fun showWarningTrafficLight(checkLightId: Int) {}
/**
* 关闭红绿灯预警展示,并重制灯态
*/
open fun disableWarningTrafficLight() {}
/**
* @param readNum 红灯倒计时
* @param yellowNum 黄灯倒计时
* @param greenNum 绿灯倒计时
*/
open fun changeCountdownTrafficLightNum(readNum: Int, yellowNum: Int, greenNum: Int) {}
open fun changeCountdownGreen(greenNum: Int) {}
open fun changeCountdownYellow(yellowNum: Int) {}
open fun changeCountdownRed(redNum: Int) {}
}

View File

@@ -4,12 +4,13 @@ import android.view.View
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
/**
* @author xiaoyuzhou
* @date 2021/8/2 7:36 下午
*/
interface IMoGoWaringProvider {
interface IMoGoWaringProvider {
/**
* 隐藏 脉速表
@@ -17,6 +18,12 @@ interface IMoGoWaringProvider {
*/
fun setSpeedChartViewVisibility(visibility: Int)
/**
* 隐藏 红绿灯UI
* @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
*/
fun setTrafficLightVrVisibility(visibility: Int)
/**
* 隐藏 自动驾驶触发 按钮
* @param visibility View.VISIBLE, View.INVISIBLE,View.GONE
@@ -76,7 +83,7 @@ interface IMoGoWaringProvider {
/**
* 红绿灯是否展示
*/
fun isWarningTrafficLightShow():Boolean
fun isWarningTrafficLightShow(): Boolean
/**
* 关闭红绿灯预警
@@ -183,26 +190,31 @@ interface IMoGoWaringProvider {
* @param downloadVersion 下载版本
* @param upgradeStatus 升级状态
*/
fun showAdUpgradeStatus(upgradeMode : Int,downloadStatus : Int,currentProgress : Int,totalProgress : Int
,downloadVersion : String,upgradeStatus : Int)
fun showAdUpgradeStatus(upgradeMode: Int, downloadStatus: Int, currentProgress: Int, totalProgress: Int, downloadVersion: String, upgradeStatus: Int)
/**
* 注册badcase入口展示和隐藏的回调
* 当[onShow]被调用时,调用[showBadCaseEntrance]
* [onHide]回调不用关心,可以不注册
*/
fun registerBadCaseCallback(onShow:() -> View, onHide: (() -> Unit)?)
fun registerBadCaseCallback(onShow: () -> View, onHide: (() -> Unit)?)
/**
*注册工控机升级提示圆点View的回调
* @param 提示圆点View
*/
fun registerUpgradeTipsCallback(tipsView:() -> View)
fun registerUpgradeTipsCallback(tipsView: () -> View)
/**
* 工控机重启返回结果
* @param code
* @param msg
*/
fun showDockerRebootResult(code: Int,msg: String)
fun showDockerRebootResult(code: Int, msg: String)
/**
* 设置红绿灯代理View
* @param view
*/
fun setProxyTrafficLightView(view: IViewTrafficLight)
}