增加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

@@ -6,6 +6,7 @@ import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
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
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
@@ -19,7 +20,7 @@ import com.mogo.eagle.core.function.call.base.CallerBase
object CallerHmiManager : CallerBase() {
private val waringProviderApi
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI)
.navigation() as? IMoGoWaringProvider;
.navigation() as? IMoGoWaringProvider;
/**
* 隐藏 脉速表
@@ -63,14 +64,14 @@ object CallerHmiManager : CallerBase() {
/**
* 控制刹车功能
*/
fun setBrakeLightFunction (isOpen: Boolean) {
fun setBrakeLightFunction(isOpen: Boolean) {
waringProviderApi?.setBrakeLightFunction(isOpen)
}
/**
* 开关DebugView
*/
fun toggleDebugView(){
fun toggleDebugView() {
waringProviderApi?.toggleDebugView()
}
@@ -259,9 +260,8 @@ object CallerHmiManager : CallerBase() {
* @param downloadVersion 下载版本
* @param upgradeStatus 升级状态
*/
fun showAdUpgradeStatus(upgradeMode : Int, downloadStatus : Int,currentProgress : Int,totalProgress : Int
,downloadVersion : String,upgradeStatus : Int){
waringProviderApi?.showAdUpgradeStatus(upgradeMode,downloadStatus, currentProgress, totalProgress, downloadVersion, upgradeStatus)
fun showAdUpgradeStatus(upgradeMode: Int, downloadStatus: Int, currentProgress: Int, totalProgress: Int, downloadVersion: String, upgradeStatus: Int) {
waringProviderApi?.showAdUpgradeStatus(upgradeMode, downloadStatus, currentProgress, totalProgress, downloadVersion, upgradeStatus)
}
/**
@@ -269,7 +269,7 @@ object CallerHmiManager : CallerBase() {
* 当[onShow]被调用时, 表示达到展示条件,返回展示的入口控件
* [onHide]回调不用关心,可以不注册
*/
fun registerBadCaseCallback(onShow:() -> View, onHide: (() -> Unit)?) {
fun registerBadCaseCallback(onShow: () -> View, onHide: (() -> Unit)?) {
waringProviderApi?.registerBadCaseCallback(onShow, onHide)
}
@@ -277,7 +277,7 @@ object CallerHmiManager : CallerBase() {
*注册工控机升级提示圆点View的回调
* @param 提示圆点View
*/
fun registerUpgradeTipsCallback(tipsView:() -> View){
fun registerUpgradeTipsCallback(tipsView: () -> View) {
waringProviderApi?.registerUpgradeTipsCallback(tipsView)
}
@@ -286,8 +286,16 @@ object CallerHmiManager : CallerBase() {
* @param code
* @param msg
*/
fun showDockerRebootResult(code: Int,msg: String){
fun showDockerRebootResult(code: Int, msg: String) {
waringProviderApi?.showDockerRebootResult(code, msg)
}
/**
* 设置红绿灯代理View
* @param view
*/
fun setProxyTrafficLightView(view: IViewTrafficLight) {
waringProviderApi?.setProxyTrafficLightView(view)
}
}