[1.0.2]
[startbar、速度小于0.01时可以开关门]
This commit is contained in:
yangyakun
2023-02-17 17:41:33 +08:00
parent 5c05bb96b5
commit f6e7069657
5 changed files with 30 additions and 44 deletions

View File

@@ -77,6 +77,7 @@ dependencies {
compileOnly project(":libraries:mogo-map")
compileOnly project(':libraries:mogo-adas')
implementation project(':core:mogo-core-res')
testImplementation 'junit:junit:4.12'
}

View File

@@ -99,7 +99,7 @@ class BusPassengerFunctionDevicePresenter(view: BusPassengerFunctionDeviceFragme
}
private fun canOpenOrCloseDoor():String?{
if(gnssSpeed==0.0){
if(gnssSpeed<0.01){
return null
}else{
return "速度:${gnssSpeed}车辆正在运行、请稍后再试"

View File

@@ -52,6 +52,9 @@ class BusPassengerRouteFragment :
v_debug.setOnLongClickListener {
ToggleDebugView.toggleDebugView.toggle(requireContext())
true
}
viewBusPM1MsgBoxButton.onClick {
}
viewBusPM1MsgBoxButton.setClickListener(object : MMsgBoxButtonView.ClickListener {
override fun showMsgBoxList(show: Boolean) {
@@ -70,28 +73,22 @@ class BusPassengerRouteFragment :
}
private fun openSettingPage(tab: String) {
CallerHmiManager.hideToolsView()
val fragmentByTag: Fragment? =
childFragmentManager.findFragmentByTag(BusPassengerFunctionFragment.TAG)
val fragmentByTag: Fragment? = childFragmentManager.findFragmentByTag(BusPassengerFunctionFragment.TAG)
if (fragmentByTag is DialogFragment) {
if (fragmentByTag.dialog != null && fragmentByTag.dialog!!.isShowing) {
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "正在展示")
return
}
if (fragmentByTag.dialog != null && fragmentByTag.isAdded) {
if (AppStateManager.currentActivity() == null) { // 没有在当前应用内 在启动页面关闭应用
CallerLogger.d(
SceneConstant.M_TAXI + LoginServiceImpl.TAG,
"showLoginDialogFragment 权限验证"
)
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "权限验证")
return
}
}
}
if (bpFunctionGroupDialogFragment?.get() == null) {
bpFunctionGroupDialogFragment =
WeakReference(BusPassengerFunctionFragment.newInstance())
bpFunctionGroupDialogFragment = WeakReference(BusPassengerFunctionFragment.newInstance())
}
val bpFunctionGroup = bpFunctionGroupDialogFragment?.get()
bpFunctionGroup?.arguments?.putString(BusPassengerFunctionFragment.SELECTTAB, tab)
@@ -104,15 +101,11 @@ class BusPassengerRouteFragment :
.commitAllowingStateLoss()
}
if (ClickUtils.isFastClick()) {
bpFunctionGroup.show(parentFragmentManager, LoginServiceImpl.TAG)
CallerLogger.d(
SceneConstant.M_TAXI + LoginServiceImpl.TAG,
"showLoginDialogFragment 展示登录界面"
)
bpFunctionGroup.show(parentFragmentManager, TAG)
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "展示$tab")
} else {
CallerLogger.d(
SceneConstant.M_TAXI + LoginServiceImpl.TAG,
"showLoginDialogFragment 展示登录界面 1s内执行一次"
SceneConstant.M_BUS_P + TAG, "dialog 1s内执行一次"
)
}
}

View File

@@ -21,6 +21,7 @@ import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.och.bus.passenger.R
import kotlinx.android.synthetic.m1.bus_p_m1_view_status_bar.view.*
import me.jessyan.autosize.utils.AutoSizeUtils
import kotlin.math.roundToInt
class StatusBarView @JvmOverloads constructor(
context: Context,
@@ -82,15 +83,8 @@ class StatusBarView @JvmOverloads constructor(
override fun onBatteryManagementSystemStates(states: ChassisStatesOuterClass.BMSSystemStates) {
val bmsSoc = states.bmsSoc
if(bmsSoc >1){
progress.progress = bmsSoc.toInt()
tv_power_cos.text = "${bmsSoc.toInt()}%"
}else{
val currenPower = (bmsSoc * 100).toInt()
progress.progress = currenPower
tv_power_cos.text = "$currenPower%"
}
progress.progress = bmsSoc.toInt()
tv_power_cos.text = "${bmsSoc.roundToInt()}%"
}
}

View File

@@ -1,17 +1,15 @@
//package com.mogo.och.bus.passenger;
//
//import org.junit.Test;
//
//import static org.junit.Assert.*;
//
///**
// * Example local unit test, which will execute on the development machine (host).
// *
// * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
// */
//public class ExampleUnitTest {
// @Test
// public void addition_isCorrect() {
// assertEquals(4, 2 + 2);
// }
//}
package com.mogo.och.bus.passenger;
import org.junit.Test;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
}
}