Merge branch 'dev_robotaxi-d-app-module_2100_220816_2.10.0' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_2100_220816_2.10.0

This commit is contained in:
xinfengkun
2022-09-08 18:28:18 +08:00
10 changed files with 38 additions and 45 deletions

View File

@@ -171,6 +171,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
});
}
initListener();
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener(){
@Override
@@ -179,7 +180,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
}
});
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
// 模拟 不可自动驾驶目前场景是刚开机adas还未和工控机连接
findViewById(R.id.btnAutopilotDisable).setOnClickListener(view ->
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE)
@@ -218,11 +218,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
// mBadcaseBtn的visible显示逻辑在showBadcaseEntrance内处理
mBadcaseBtn = findViewById(R.id.module_mogo_och_badcase_rl);
// CallerHmiManager.INSTANCE.registerBadCaseCallback(
// () -> { // onShow()
// return mBadcaseBtn; },
// () -> { // onHide()
// return null; });
if (mBadcaseBtn != null) {
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn);
@@ -317,7 +312,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
*/
public void setArrivedClikable(boolean isClickable){
getActivity().runOnUiThread(() -> {
tvArrived.setClickable(isClickable);
tvArrived.setEnabled(isClickable);
if (isClickable){
tvArrived.setTextColor(getResources().getColor(R.color.bus_white));
}else {
@@ -359,13 +354,13 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_disable_autopilot_icon);
ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setFocusableInTouchMode(true);
ctvAutopilotStatus.setClickable(true);
} else {
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_ic_autopilot);
ctvAutopilotStatus.setFocusableInTouchMode(true);
ctvAutopilotStatus.setClickable(true);
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) {//1可用
ctvAutopilotStatus.setSelected(false);
}else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus){
@@ -381,12 +376,12 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_success_tv));
ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setFocusableInTouchMode(false);
ctvAutopilotStatus.setClickable(false);
}else {
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_wrong_autopilot_icon);
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_failure_tv));
ctvAutopilotStatus.setFocusableInTouchMode(false);
ctvAutopilotStatus.setClickable(false);
ctvAutopilotStatus.setSelected(false);
}
UiThreadHandler.postDelayed(new Runnable() {
@@ -480,7 +475,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_tv));
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setFocusableInTouchMode(true);
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_loading_autopilot_icon);
if (autopilotLoadingAnimator == null) {
autopilotLoadingAnimator = ObjectAnimator.ofFloat(ctvAutopilotStatusIv, "rotation", 0f, 360f);

View File

@@ -76,14 +76,8 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
mSwitchLine.setTag(0);
mLineName = findViewById(R.id.module_och_bus_line_name);
// if (DebugConfig.isDebug()) { //任意模式下都打开调试面板
// mBus.setOnClickListener(view -> {
// ToastUtils.showShort("重置了车站状态");
// mPresenter.queryBusRoutes();
// });
//debug下调用测试面板
mCurrentStationName.setOnLongClickListener(v -> {
//调用测试面板
mCurrentStationName.setOnLongClickListener(v -> {
debugTestBar();
showHideTestBar();
return true;
@@ -92,21 +86,8 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
CallerLogger.INSTANCE.d(M_BUS + TAG, "initView: " + CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
// 初始化的时候设置 UI 按钮状态
switch (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()) {
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE:
hideAutopilotBiz();
break;
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE:
showAutopilotBiz();
onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE);
break;
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
showAutopilotBiz();
onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
break;
default:
break;
}
showAutopilotBiz();
mSwitchLine.setOnClickListener(this);
}

View File

@@ -40,6 +40,13 @@ object TaxiLoginModel{
.registerCarLocationChangedListener(TAG, mCarLocationChangedListener2)
}
fun hasInit():Boolean{
if(mContext==null&& iTaxiLoginCallback==null){
return false;
}
return true
}
// 自车定位
private val mCarLocationChangedListener2 = IMogoCarLocationChangedListener2 { location ->
mLongitude = location.longitude

View File

@@ -1335,9 +1335,9 @@ public class TaxiModel {
private void reportTotalDisAndTime() {
float lastSumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(mRoutePoints);
double lastTime = lastSumLength / TaxiConst.TAXI_AVERAGE_SPEED * 3.6; //秒
if (mOrderStatusCallback != null) {
mOrderStatusCallback.onCurrentOrderDistToEndChanged((long) lastSumLength, (long) lastTime);
}
// if (mOrderStatusCallback != null) {
// mOrderStatusCallback.onCurrentOrderDistToEndChanged((long) lastSumLength, (long) lastTime);
// }
reportOrderRemain((long) lastSumLength, (long) lastTime);
}

View File

@@ -29,15 +29,18 @@ class TaxiLoginPresenter(view: TaxiLoginDialogFragment?) :
private var countDownDisposable: Disposable? = null
init {
TaxiLoginModel.init(AbsMogoApplication.getApp())
initListeners()
}
private fun initListeners() {
TaxiLoginModel.init(AbsMogoApplication.getApp())
TaxiLoginModel.setiTaxiLoginCallback(this)
}
fun getPhoneCode(phone:String){
if(!TaxiLoginModel.hasInit()){
initListeners()
}
if (!RegexUtils.isMobileExact(phone)) {
ToastUtils.showShort(R.string.module_och_taxi_login_phone_error)
mView?.inputPhoneError()
@@ -91,6 +94,9 @@ class TaxiLoginPresenter(view: TaxiLoginDialogFragment?) :
}
fun gotoLogin(phone: String, code: String) {
if(!TaxiLoginModel.hasInit()){
initListeners()
}
if (!RegexUtils.isMobileExact(phone)) {
ToastUtils.showShort(R.string.module_och_taxi_login_phone_error)
mView?.inputPhoneError()

View File

@@ -4,6 +4,7 @@ apply from: "javadoc.gradle"
buildscript {
repositories {
mavenLocal()
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url "https://artifact.bytedance.com/repository/byteX/" }
maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' }
@@ -32,7 +33,7 @@ buildscript {
classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
classpath 'com.volcengine:apm_insight_plugin:1.4.1'
classpath 'com.mogo.thread.opt:plg:2.2.0'
classpath 'com.mogo.thread.opt:plg:2.2.10'
classpath 'com.mogo.cloud:systrace:1.0.1'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
classpath 'com.mogo.sticky:service:1.0.8'
@@ -49,6 +50,7 @@ buildscript {
allprojects {
repositories {
mavenLocal()
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' }

View File

@@ -97,7 +97,7 @@ internal class CanImpl(ctx: Context): IFlow<CanStatus>(ctx), IMoGoAutopilotVehic
private fun timeOutCheck() {
job?.safeCancel()
launch(Dispatchers.Default) {
launch(Dispatchers.Unconfined) {
delay(4000)
send(CanStatus(isCanEnabled()))
}.also { job = it }

View File

@@ -79,7 +79,7 @@ internal class NetsImpl(ctx: Context): IFlow<NetStatus>(ctx) {
private fun checkAndSend() {
loopCheckAndSendJob?.safeCancel()
launch(Dispatchers.Default) {
launch(Dispatchers.Unconfined) {
val connectionInfo = wifiMgr.connectionInfo
val enabled = isNetConnected()
val name =

View File

@@ -44,7 +44,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
return
}
check?.takeIf { it.isActive }?.cancel()
launch {
launch(Dispatchers.Unconfined) {
CallerAutoPilotManager.sendStatusQueryReq()
delay(5000)
isOldVersion.set(true)
@@ -82,7 +82,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
if (isRTKEnabled()) {
send(RTKStatus("RTK", 0))
timeOutCheck?.takeIf { it.isActive }?.cancel()
launch {
launch(Dispatchers.Unconfined) {
delay(4000)
send(RTKStatus("", -1))
}.also {

View File

@@ -728,7 +728,9 @@ import java.util.*
WarningFloat.dismiss(tag)
}
Log.d("$M_HMI$TAG", "--- disableWarningV2X ---")
showingV2XTip?.takeIf { it.isShowing() }?.also { it.hide() }
lifecycleScope.launch {
showingV2XTip?.takeIf { it.isShowing() }?.also { it.hide() }
}
}
/**