cherry-pick 小鹏 adbd5804d

This commit is contained in:
lixiaopeng
2022-07-15 11:40:05 +08:00
committed by liujing
parent 76d9f1c141
commit d0924ab4d8
2 changed files with 22 additions and 4 deletions

View File

@@ -7,7 +7,9 @@ import com.mogo.commons.constants.SharedPrefsConstants;
import com.mogo.eagle.core.data.bindingcar.BindingcarInfo;
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo;
import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
import com.mogo.eagle.core.function.bindingcar.R;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
import com.mogo.eagle.core.network.utils.GsonUtil;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
@@ -60,7 +62,7 @@ public class BindingcarNetWorkManager {
public void getBindingcarInfo(Context context, String macAddress, String widevineIDWithMd5, int screenType) {
// String macAddress = "48:b0:2d:3a:bc:78";
// String sn = "X20202203105S688HZ";
Log.d("liyz", "macAddress = " + macAddress + "----widevineIDWithMd5 = " + widevineIDWithMd5);
BindingcarRequest request = new BindingcarRequest(macAddress, widevineIDWithMd5, screenType);
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
mBindingcarApiService.getBindingcarInfo(token, requestBody)
@@ -75,6 +77,7 @@ public class BindingcarNetWorkManager {
public void onNext(@NonNull BindingcarInfo info) {
if (info != null && info.getData() != null) {
CallerLogger.INSTANCE.d(TAG, "getBindingcarInfo onNext info.getData() =" + info.getData().toString());
Log.d("liyz", "getBindingcarInfo onNext info.getData() =" + info.getData().toString());
if (info.getData().getCompare().equals("0")) {
CallerHmiManager.INSTANCE.showBindingcarDialog();
} else if (info.getData().getCompare().equals("3")) {
@@ -83,6 +86,17 @@ public class BindingcarNetWorkManager {
TipToast.shortTip("当前工控机没有入库");
}
//根据车辆类型切换不同的车辆模型
if (info.getData().getVendor().equals("一汽红旗")) { //TODO
CallerHDMapManager.INSTANCE.changeCurrentIcon(R.raw.chuzuche);
} else if (info.getData().getVendor().equals("东风")) {
CallerHDMapManager.INSTANCE.changeCurrentIcon(R.raw.chuzuche);
} else if (info.getData().getVendor().equals("金旅星辰")) {
CallerHDMapManager.INSTANCE.changeCurrentIcon(R.raw.xiaobache);
} else {
CallerHDMapManager.INSTANCE.changeCurrentIcon(R.raw.chuzuche);
}
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, GsonUtils.toJson(info.getData()));
}
}
@@ -90,7 +104,7 @@ public class BindingcarNetWorkManager {
@Override
public void onError(@NonNull Throwable e) {
CallerLogger.INSTANCE.e(TAG, "getBindingcarInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
// Log.e("liyz", "getBindingcarInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
Log.e("liyz", "getBindingcarInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
}
@Override

View File

@@ -999,6 +999,7 @@ import java.util.*
*/
override fun showTurnLight(light: Int) {
if (HmiBuildConfig.isShowTurnLightView) {
Log.e("liyz", "showTurnLight light = $light")
ThreadUtils.runOnUiThread {
if (light == 1) {
if (!isLeftLight) {
@@ -1038,6 +1039,7 @@ import java.util.*
*/
override fun showBrakeLight(light: Int) {
if (HmiBuildConfig.isShowBrakeLightView) {
Log.e("liyz", "showBrakeLight isBrake = $isBrake")
ThreadUtils.runOnUiThread {
if (light == 1) { //刹车灯亮
if (!isBrake) {
@@ -1045,8 +1047,10 @@ import java.util.*
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(0, 500)
}
} else {
isBrake = false
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
if (isBrake) {
isBrake = false
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
}
}
// brakeView?.let {