Merge remote-tracking branch 'origin/dev_robotaxi-d-app-module_2100_220816_2.10.0' into dev_robotaxi-d-app-module_2100_220816_2.10.0
This commit is contained in:
@@ -5,14 +5,14 @@ import com.mogo.eagle.core.data.BaseData;
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
*
|
||||
* 收车/出车状态查询返回数据结构
|
||||
* 状态查询返回数据结构
|
||||
*/
|
||||
public class DriverStatusQueryRespBean extends BaseData {
|
||||
public Result data;
|
||||
|
||||
public static class Result {
|
||||
public int servingStatus; //0收车,1出车
|
||||
public int driverStatus; //0收车,1出车
|
||||
public int servingStatus; //1接单,1暂停接单
|
||||
public int driverStatus; //1登录,0登出
|
||||
public String orderNo;
|
||||
public int purpose; // 1 运营, 2 测试, 3演示
|
||||
}
|
||||
|
||||
@@ -3,14 +3,12 @@ package com.mogo.och.taxi.bean;
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
*
|
||||
* 收车/出车状态更新请求数据结构
|
||||
* 状态更新请求数据结构
|
||||
*/
|
||||
public class DriverStatusUpdateReqBean {
|
||||
public String sn;
|
||||
public int status; //0收车,1出车
|
||||
|
||||
public DriverStatusUpdateReqBean(String sn, int status) {
|
||||
public DriverStatusUpdateReqBean(String sn) {
|
||||
this.sn = sn;
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.och.taxi.callback;
|
||||
/**
|
||||
* Created on 2021/9/8
|
||||
*
|
||||
* Model->Presenter回调:出车/收车状态变更
|
||||
* Model->Presenter回调:接单车状态变更 登录状态变更
|
||||
*/
|
||||
public interface ITaxiCarStatusCallback {
|
||||
void onCarStatusChanged(boolean inOperation,String role);
|
||||
|
||||
@@ -80,5 +80,7 @@ class TaxiConst {
|
||||
const val TYPE_MARKER_TAXI_ORDER = "TYPE_MARKER_TAXI_ORDER"
|
||||
|
||||
const val TIMER_START_AUTOPILOT_INTERVAL = 20 * 1000L
|
||||
|
||||
const val WAIT_TAKEN = 100046
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public class TaxiModel {
|
||||
private volatile List<OrderQueryRespBean.Result> mWaitServiceList = Collections.emptyList(); //待服务订单
|
||||
|
||||
private ITaxiADASStatusCallback mADASStatusCallback; //Model->Presenter:自动驾驶状态相关
|
||||
private ITaxiCarStatusCallback mCarStatusCallback; //Model->Presenter:出车/收车状态
|
||||
private ITaxiCarStatusCallback mCarStatusCallback; //Model->Presenter:接单状态、登录状态和司机今日接单状态
|
||||
private ITaxiControllerStatusCallback mControllerStatusCallback; //Model->Presenter:VR mode等
|
||||
private ITaxiOrderStatusCallback mOrderStatusCallback; //Model->Presenter:订单变更
|
||||
private Disposable subscribe;
|
||||
@@ -262,7 +262,7 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出车/收车状态
|
||||
* 接单状态和登录状态查询
|
||||
* 1、初始化查下状态
|
||||
* 2、点击更新接单状态 如果是初始化状态就查下状态
|
||||
* 3、点击更新接单状态后 查询状态
|
||||
@@ -311,14 +311,20 @@ public class TaxiModel {
|
||||
@Override
|
||||
public void onFail(int code, String msg) {
|
||||
ToastUtilsOch.showWithCodeMessage(code,msg);
|
||||
if(mCarStatusCallback!=null) {
|
||||
mCarStatusCallback.onCarLoginStatusChange(StatusManager.isLogin());
|
||||
if(code==TaxiConst.WAIT_TAKEN){
|
||||
subscribe = Observable.timer(3, TimeUnit.SECONDS).subscribe(aLong -> {
|
||||
queryCarStatus();
|
||||
});
|
||||
}else {
|
||||
if (mCarStatusCallback != null) {
|
||||
mCarStatusCallback.onCarLoginStatusChange(StatusManager.isLogin());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//更新出车收车状态
|
||||
//更新接单状态
|
||||
public void updateCarStatus() {
|
||||
if(!StatusManager.isLogin()){
|
||||
queryCarStatus();
|
||||
|
||||
@@ -154,28 +154,6 @@ interface TaxiServiceApiNew {
|
||||
Observable<BaseData> updateOrderStatus(@Header ("appId") String appId,@Header("ticket") String ticket
|
||||
,@Body OrderStatusUpdateReqBean data);
|
||||
|
||||
/**
|
||||
* 收车/出车状态更新
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
// @POST( "/autopilot-car-hailing/api/v1/driver/serviceStatus/update" )
|
||||
@POST( "/autopilot-car-hailing/car/v2/driver/taxi/serviceStatus/update" )
|
||||
Observable<BaseData> updateDriverServiceStatus(@Header ("appId") String appId,@Header("ticket") String ticket
|
||||
,@Body DriverStatusUpdateReqBean data);
|
||||
|
||||
/**
|
||||
* 收车/出车状态查询
|
||||
* @param sn
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
// @GET( "/autopilot-car-hailing/api/v1/driver/serviceStatus/query" )
|
||||
@GET( "/autopilot-car-hailing/car/v2/driver/taxi/serviceStatus/query" )
|
||||
Observable<DriverStatusQueryRespBean> queryDriverServiceStatus(@Header ("appId") String appId
|
||||
,@Header("ticket") String ticket,@Query("sn") String sn);
|
||||
|
||||
/**
|
||||
* 车机端上传心跳数据(只在出车状态时上传):包含高德坐标系经纬度
|
||||
* @param data
|
||||
@@ -362,7 +340,7 @@ interface TaxiServiceApiNew {
|
||||
Observable<BaseData> resetOrderServing(@Header ("appId") String appId,@Header("ticket") String ticket
|
||||
,@Body DriverStatusUpdateReqBean data);
|
||||
/**
|
||||
* 收车/出车状态和登录状态查询
|
||||
* 接单状态和登录状态查询
|
||||
* @param sn
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -4,6 +4,7 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAX
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
@@ -237,22 +238,6 @@ public class TaxiServiceManager {
|
||||
.subscribe(getSubscribeImpl(context, callback, "updateOrderStatus"));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 收车/出车状态更新
|
||||
// * @param context
|
||||
// * @param status
|
||||
// * @param callback
|
||||
// */
|
||||
// public void updateDriverServiceStatus(Context context, int status,
|
||||
// TaxiServiceCallback<BaseData> callback) {
|
||||
// mOCHTaxiServiceApi.updateDriverServiceStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
// ,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
// ,new DriverStatusUpdateReqBean(
|
||||
// MoGoAiCloudClientConfig.getInstance().getSn(), status))
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(getSubscribeImpl(context, callback, "updateDriverServiceStatus"));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 暂停接单
|
||||
@@ -266,12 +251,12 @@ public class TaxiServiceManager {
|
||||
baseDataObservable = mOCHTaxiServiceApi.stopOrderServing(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
, MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
, new DriverStatusUpdateReqBean(
|
||||
MoGoAiCloudClientConfig.getInstance().getSn(), 0));
|
||||
MoGoAiCloudClientConfig.getInstance().getSn()));
|
||||
}else {// 没有接单去接单
|
||||
baseDataObservable = mOCHTaxiServiceApi.resetOrderServing(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
, MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
, new DriverStatusUpdateReqBean(
|
||||
MoGoAiCloudClientConfig.getInstance().getSn(), 0));
|
||||
MoGoAiCloudClientConfig.getInstance().getSn()));
|
||||
}
|
||||
baseDataObservable.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@@ -279,12 +264,17 @@ public class TaxiServiceManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* 收车/出车状态查询
|
||||
* 接单状态和登录状态查询
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
public void queryDriverServiceStatus(Context context,
|
||||
TaxiServiceCallback<DriverStatusQueryRespBean> callback) {
|
||||
if(MoGoAiCloudClientConfig.getInstance().getToken().isEmpty()){
|
||||
callback.onFail(TaxiConst.WAIT_TAKEN,"等待令牌中请稍等");
|
||||
MoGoAiCloudClient.getInstance().refreshToken();
|
||||
return;
|
||||
}
|
||||
mOCHTaxiServiceApi.queryDriverServiceStatusAndLoginStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
@@ -466,7 +456,7 @@ public class TaxiServiceManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* 收车/出车状态查询
|
||||
* 获取手机验证码
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
@@ -480,7 +470,7 @@ public class TaxiServiceManager {
|
||||
.subscribe(getSubscribeImpl(context, callback, "getPhoneCode"));
|
||||
}
|
||||
/**
|
||||
* 收车/出车状态查询
|
||||
* 通过验证码登录
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
|
||||
@@ -126,7 +126,7 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
TaxiModel.getInstance().confirmAutopilotConditionByDriver();
|
||||
}
|
||||
|
||||
// 更新出车/收车状态
|
||||
// 更新接单状态
|
||||
public void updateCarStatus() {
|
||||
TaxiModel.getInstance().updateCarStatus();
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
private ImageView mAnimFlowIv;
|
||||
protected TextView tvOperationStatus;
|
||||
protected TextView mDriverRole;
|
||||
public boolean isOperationStatus;//false-收车,true-出车
|
||||
protected FrameLayout flStationPanelContainer;
|
||||
private FrameLayout flNaviPanelContainer;
|
||||
private Group groupTestPanel;
|
||||
|
||||
@@ -176,7 +176,6 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
*/
|
||||
public void updateOperationStatus(boolean inOperation,String role) {
|
||||
CallerLogger.INSTANCE.e(M_TAXI + TAG, "onOperationChanged:" + inOperation);
|
||||
isOperationStatus = inOperation;
|
||||
if (inOperation) {
|
||||
if (!TextUtils.isEmpty(role)){
|
||||
mDriverRole.setVisibility(View.VISIBLE);
|
||||
@@ -190,7 +189,7 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
showPanel();
|
||||
} else {
|
||||
mDriverRole.setVisibility(View.GONE);
|
||||
// AIAssist.getInstance(getContext()).speakTTSVoice("已收车");
|
||||
// AIAssist.getInstance(getContext()).speakTTSVoice("已接单");
|
||||
tvOperationStatus.setText("接单");
|
||||
tvOperationStatus.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.taxi_out_btn), null, null, null);
|
||||
mPersonalBtn.setVisibility(View.GONE);
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
android:gravity="center"
|
||||
android:paddingLeft="46px"
|
||||
android:paddingRight="50px"
|
||||
android:text="出车"
|
||||
android:text="--"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/taxi_autopilot_text_color_selector"
|
||||
android:textSize="20sp"
|
||||
|
||||
@@ -32,7 +32,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.1.0'
|
||||
classpath 'com.mogo.thread.opt:plg:2.1.2'
|
||||
classpath 'com.mogo.cloud:systrace:1.0.1'
|
||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
|
||||
|
||||
|
||||
@@ -433,15 +433,15 @@ class MoGoAutopilotProvider :
|
||||
*/
|
||||
override fun sendOperatorChangeLaneLeft() {
|
||||
// Log.d("liyz", "MoGoAutopilotProvider sendOperatorChangeLaneLeft -------> ")
|
||||
// AdasManager.getInstance().sendOperatorCmdChangeLaneLeft()
|
||||
AdasManager.getInstance().sendOperatorCmdChangeLaneLeft()
|
||||
}
|
||||
|
||||
/**
|
||||
* 向右变道
|
||||
*/
|
||||
override fun sendOperatorChangeLaneRight() {
|
||||
Log.d("liyz", "MoGoAutopilotProvider sendOperatorChangeLaneRight -------> ")
|
||||
// AdasManager.getInstance().sendOperatorCmdChangeLaneRight()
|
||||
// Log.d("liyz", "MoGoAutopilotProvider sendOperatorChangeLaneRight -------> ")
|
||||
AdasManager.getInstance().sendOperatorCmdChangeLaneRight()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -449,7 +449,7 @@ class MoGoAutopilotProvider :
|
||||
*/
|
||||
override fun sendOperatorSetAcceleratedSpeed(cc: Double) {
|
||||
// Log.d("liyz", "MoGoAutopilotProvider sendOperatorSetAcceleratedSpeed cc $cc ")
|
||||
// AdasManager.getInstance().sendOperatorCmdSetAcceleratedSpeed(cc)
|
||||
AdasManager.getInstance().sendOperatorCmdSetAcceleratedSpeed(cc)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -457,7 +457,7 @@ class MoGoAutopilotProvider :
|
||||
*/
|
||||
override fun sendOperatorSetHorn(value: Double) {
|
||||
// Log.d("liyz", "MoGoAutopilotProvider sendOperatorSetHorn value $value ")
|
||||
// AdasManager.getInstance().sendOperatorCmdSetHorn(value)
|
||||
AdasManager.getInstance().sendOperatorCmdSetHorn(value)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -573,6 +573,11 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
//只在司机端设置美化模式开关功能
|
||||
if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)){
|
||||
tbIsDemoMode.visibility = View.GONE
|
||||
}
|
||||
|
||||
// 雨天模式,上一次勾选的数据
|
||||
tbIsRainMode.isChecked = FunctionBuildConfig.isRainMode
|
||||
//雨天模式
|
||||
|
||||
@@ -4,7 +4,6 @@ import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_INIT;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAP;
|
||||
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
@@ -24,10 +23,8 @@ import androidx.annotation.Nullable;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
|
||||
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
@@ -39,7 +36,6 @@ import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.rousetime.android_startup.model.CostTimesModel;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
@@ -75,6 +71,16 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
private BluetoothMonitorReceiver mBluetoothReceiver = null;
|
||||
private BluetoothAdapter mBluetoothAdapter;
|
||||
private List<BluetoothDevice> mAreadlyConnectedList = new ArrayList<>();//已连接设备集合
|
||||
private int numberA = 0;
|
||||
private boolean isLongPressA = false;
|
||||
private int numberB = 0;
|
||||
private boolean isLongPressB = false;
|
||||
private int numberC = 0;
|
||||
private boolean isLongPressC = false;
|
||||
private int numberD = 0;
|
||||
private boolean isLongPressD = false;
|
||||
private int numberE = 0;
|
||||
private boolean isLongPressE = false;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -226,15 +232,127 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Log.e("liyz", "onKeyDown keyCode = " + keyCode + "--action = " + event.getAction() + "---" + event);
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
// Log.d("liyz", "dispatchKeyEvent code = " + event.getKeyCode() + "--action = " + event.getAction() + "----" + event);
|
||||
if (event.getKeyCode() == KeyEvent.KEYCODE_A) { //单击向左变道,长按-1
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
numberA++;
|
||||
if (numberA > 2) {
|
||||
if (!isLongPressA) {
|
||||
// ToastUtils.showShort("方块 长按A -2 ");
|
||||
sendAcc(true, -2);
|
||||
isLongPressA = true;
|
||||
}
|
||||
}
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||
if (numberA == 1) {
|
||||
// ToastUtils.showShort("方块 点击A -1 ");
|
||||
sendAcc(true, -1);
|
||||
}
|
||||
numberA = 0;
|
||||
isLongPressA = false;
|
||||
}
|
||||
return true;
|
||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_B) { //单击向右变道,长按-2
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
numberB++;
|
||||
if (numberB > 2) {
|
||||
if (!isLongPressB) {
|
||||
// ToastUtils.showShort("方块 长按B 无操作 ");
|
||||
isLongPressB = true;
|
||||
}
|
||||
}
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||
if (numberB == 1) {
|
||||
// ToastUtils.showShort("方块 单击B 复原 ");
|
||||
sendAcc(false, 0.0);
|
||||
}
|
||||
numberB = 0;
|
||||
isLongPressB = false;
|
||||
}
|
||||
return true;
|
||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_C) { //单击鸣笛,
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
numberC++;
|
||||
if (numberC > 2) {
|
||||
if (!isLongPressC) {
|
||||
// ToastUtils.showShort("方块 长按C 无操作");
|
||||
isLongPressC = true;
|
||||
}
|
||||
}
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||
if (numberC == 1) {
|
||||
// ToastUtils.showShort("方块 单击C ← 向左变道 ");
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneLeft();
|
||||
}
|
||||
numberC = 0;
|
||||
isLongPressC = false;
|
||||
}
|
||||
return true;
|
||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_D) { //单击开启自动驾驶,
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
numberD++;
|
||||
if (numberD > 2) {
|
||||
if (!isLongPressD) {
|
||||
// ToastUtils.showShort("方块 长按D 无操作");
|
||||
isLongPressD = true;
|
||||
}
|
||||
}
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||
if (numberD == 1) {
|
||||
// ToastUtils.showShort("方块 单击D → 向右变道 ");
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneRight();
|
||||
}
|
||||
numberD = 0;
|
||||
isLongPressD = false;
|
||||
}
|
||||
return true;
|
||||
} else if (event.getKeyCode() == KeyEvent.KEYCODE_E) { //单击复原,
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
numberE++;
|
||||
if (numberE > 2) {
|
||||
if (!isLongPressE) {
|
||||
// ToastUtils.showShort("方块 长按E 鸣笛 ");
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1);
|
||||
if (timerHorn == null) {
|
||||
timerHorn = new Timer();
|
||||
}
|
||||
timerHorn.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(2);
|
||||
timerHorn = null;
|
||||
}
|
||||
}, 500);
|
||||
isLongPressE = true;
|
||||
}
|
||||
}
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||
if (numberE == 1) {
|
||||
// ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
|
||||
CallerAutoPilotManager.INSTANCE.setControlAutopilotCarAuto(true);
|
||||
}
|
||||
numberE = 0;
|
||||
isLongPressE = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.dispatchKeyEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent event) {
|
||||
// Log.d("liyz", "dispatchTouchEvent event.getX() = " + event.getX() + "--event.getY() = " + event.getY() + "--action = " + event.getAction());
|
||||
if (event.getX() == -1469.6875 && event.getY() == 530.0) { //向左变道
|
||||
// ToastUtils.showShort("← 向左变道");
|
||||
// MogoMapUIController.getInstance().setLockMode( true );
|
||||
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneLeft();
|
||||
|
||||
return true;
|
||||
@@ -271,44 +389,8 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
}
|
||||
|
||||
return super.dispatchTouchEvent(event);
|
||||
|
||||
// if (SharedPrefsMgr.getInstance(getContext()).getBoolean("BLUETOOTH", false)) {
|
||||
// return false;
|
||||
// } else {
|
||||
// return super.dispatchTouchEvent(event);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
|
||||
//← x:-1469.6875 y:530.0
|
||||
//↑ x:-1096.25 y:132.5
|
||||
//→ x:-863.4375 y: 690.0
|
||||
//↓ x:-1096.25 y:1099.0
|
||||
//O x:-1096.25 y:690.0
|
||||
// Log.d("liyz", "onTouchEvent event.getX() = " + event.getX() + "--event.getY() = " + event.getY());
|
||||
|
||||
if (event.getX() == -1469.6875 && event.getY() == 530.0) {
|
||||
// ToastUtils.showShort("←");
|
||||
return true;
|
||||
} else if (event.getX() == -1096.25 && event.getY() == 132.5) {
|
||||
// ToastUtils.showShort("↑");
|
||||
return true;
|
||||
} else if (event.getX() == -863.4375 && event.getY() == 690.0) {
|
||||
// ToastUtils.showShort("→");
|
||||
return true;
|
||||
} else if (event.getX() == -1096.25 && event.getY() == 1099.0) {
|
||||
// ToastUtils.showShort("↓");
|
||||
return true;
|
||||
} else if (event.getX() == -1096.25 && event.getY() == 690.0) {
|
||||
// ToastUtils.showShort("O");
|
||||
return true;
|
||||
}
|
||||
return super.onTouchEvent(event);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onSkinModeChange(int skinMode) {
|
||||
if (skinMode == 0) {
|
||||
@@ -372,7 +454,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
boolean isConnected = (boolean) isConnectedMethod.invoke(device, (Object[]) null);
|
||||
// Log.e("liyz", "showBondedDevice Name:" + device.getName() + " Mac:" + device.getAddress() + "---isConnected = " + isConnected);
|
||||
mAreadlyConnectedList.add(device);
|
||||
if (device.getName().equals("JX-05")) {
|
||||
if (device.getName().equals("JX-05")) { //后面魔戒可能不使用了
|
||||
SharedPrefsMgr.getInstance(getContext()).putString("BT_MAC", device.getAddress());
|
||||
}
|
||||
if (!isConnected) {
|
||||
@@ -380,7 +462,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
connectBluetooth(); //主动连接一次
|
||||
}, 4000L);
|
||||
}
|
||||
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
@@ -394,7 +475,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onAutoConnection(ConnectBluetoothEvent event) {
|
||||
connectBluetooth();
|
||||
// connectBluetooth();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -412,6 +493,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
pos = i;
|
||||
}
|
||||
}
|
||||
|
||||
// Log.d("liyz", "connectBluetooth macAddress = " + macAddress + "---pos = " + pos);
|
||||
if (mAreadlyConnectedList.size() > pos && (pos >= 0)) {
|
||||
method.invoke(mAreadlyConnectedList.get(pos));
|
||||
|
||||
@@ -171,7 +171,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
//设置手势是否可以缩放 isCanZoom true 可缩放 false 不可缩放
|
||||
options.setZoomGesturesEnabled(true);
|
||||
options.setScaleVRMode(true);
|
||||
options.setAllGesturesEnabled(false); //禁止全部手势
|
||||
// options.setAllGesturesEnabled(false); //禁止全部手势
|
||||
if (options.getMyLocationStyle() != null) {
|
||||
options.getMyLocationStyle().setDisplayAnimEnable(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user