fix bug of class name of interface
This commit is contained in:
@@ -57,6 +57,7 @@ import io.reactivex.exceptions.UndeliverableException;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -788,7 +789,7 @@ public class OchBusOrderModel {
|
||||
* 到站
|
||||
* @param data
|
||||
*/
|
||||
public void onArriveAt( AutopilotStationInfo data){
|
||||
public void onArriveAt( MessagePad.ArrivalNotification data){
|
||||
if ( currentStationIndex > stationList.size() - 1 ) {
|
||||
Logger.e( TAG, "到站异常,取消后续操作结束" );
|
||||
return;
|
||||
|
||||
@@ -4,11 +4,10 @@ package com.mogo.och.taxi.passenger.callback;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/11/1
|
||||
*/
|
||||
interface IOCHTaxiAutopilotPlanningCallback {
|
||||
public interface IOCHTaxiPassengerAutopilotPlanningCallback {
|
||||
void routeResult(List<MessagePad.Location> models);
|
||||
}
|
||||
@@ -57,6 +57,9 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
*
|
||||
@@ -472,6 +475,11 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
|
||||
private IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener(){
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo) {
|
||||
|
||||
}
|
||||
|
||||
private boolean arriveAtEnd = false; //乘客app专用字段
|
||||
|
||||
@Override
|
||||
@@ -525,18 +533,13 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(@Nullable AutopilotGuardianStatusInfo autopilotGuardianStatusInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(@Nullable AutopilotStationInfo data) {
|
||||
public void onAutopilotArriveAtStation(@Nullable MessagePad.ArrivalNotification arrivalNotification) {
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
arriveAtEnd = true;
|
||||
}
|
||||
|
||||
if (data == null || !checkCurrentOCHOrder()
|
||||
if (arrivalNotification == null || !checkCurrentOCHOrder()
|
||||
|| (getCurOrderStatus() == TaxiPassengerOrderStatusEnum.ArriveAtEndStation)) {
|
||||
return;
|
||||
}
|
||||
@@ -544,28 +547,29 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
// TipToast.shortTip("到达目的地");
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener(){
|
||||
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener(){
|
||||
|
||||
@Override
|
||||
public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp routeList) {
|
||||
if (null != routeList && routeList.getWayPointsList().size() > 0){
|
||||
mAutopilotPlanningCallback.routeResult(routeList.getWayPointsList());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRotting(AutopilotRouteInfo routeList) {
|
||||
if (null != routeList && routeList.getModels() != null){
|
||||
mAutopilotPlanningCallback.routeResult(routeList.getModels());
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 限速监听
|
||||
*/
|
||||
private LimitingVelocityListener limitingVelocityListener = new LimitingVelocityListener(){
|
||||
private final LimitingVelocityListener limitingVelocityListener = new LimitingVelocityListener(){
|
||||
|
||||
@Override
|
||||
public void onLimitingVelocityChange(int limitingVelocity) {
|
||||
@@ -597,7 +601,4 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* END
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import androidx.annotation.RequiresApi;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryRespBean;
|
||||
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerAutopilotPlanningCallback;
|
||||
@@ -21,6 +20,8 @@ import com.mogo.och.taxi.passenger.ui.TaxiPassengerServingOrderFragment;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/3/14
|
||||
@@ -59,11 +60,11 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
|
||||
}
|
||||
|
||||
@Override
|
||||
public void routeResult(List<AutopilotRouteInfo.RouteModels> models) {
|
||||
public void routeResult(List<MessagePad.Location> models) {
|
||||
if (models == null) return;
|
||||
List<MogoLatLng> latLngList = new ArrayList<>();
|
||||
for (AutopilotRouteInfo.RouteModels routeModel : models) {
|
||||
latLngList.add(new MogoLatLng(routeModel.getLat(), routeModel.getLon()));
|
||||
for (MessagePad.Location routeModel : models) {
|
||||
latLngList.add(new MogoLatLng(routeModel.getLatitude(), routeModel.getLongitude()));
|
||||
}
|
||||
mView.routeResult(latLngList);
|
||||
}
|
||||
@@ -106,4 +107,5 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
|
||||
super.onDestroy(owner);
|
||||
releaseListener();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.mogo.commons.mvp.BaseFragment;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
@@ -24,11 +23,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.taxi.passenger.R;
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryRespBean;
|
||||
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerAutopilotPlanningCallback;
|
||||
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerControllerStatusCallback;
|
||||
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerOrderStatusCallback;
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerMapViewCallback;
|
||||
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerVeloctityCallback;
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerOrderStatusEnum;
|
||||
import com.mogo.och.taxi.passenger.model.TaxiPassengerModel;
|
||||
import com.mogo.och.taxi.passenger.model.TaxiPassengerNaviToDestinationModel;
|
||||
@@ -40,6 +35,8 @@ import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/3/8
|
||||
@@ -91,7 +88,7 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
protected void initViews() {
|
||||
|
||||
mTPSpeedTv = findViewById(R.id.taxi_p_speed_tv);
|
||||
mTPSpeedTv.setText(getSpeedTextStyle("0",true));
|
||||
mTPSpeedTv.setText(getSpeedTextStyle("0", true));
|
||||
|
||||
mTPOrderStatus = findViewById(R.id.taxi_p_order_status_tv);
|
||||
mTPOrderStartStation = findViewById(R.id.taxi_p_order_status_start_station_tv);
|
||||
@@ -106,17 +103,18 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
mTPOrderStatus.setOnLongClickListener(new View.OnLongClickListener() { //测试用
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
List<AutopilotRouteInfo.RouteModels> list = new ArrayList<>();
|
||||
for (int i = 0; i < 200 ; i++){
|
||||
List<MessagePad.Location> list = new ArrayList<>();
|
||||
for (int i = 0; i < 200; i++) {
|
||||
MessagePad.Location.Builder builder = MessagePad.Location.newBuilder();
|
||||
AutopilotRouteInfo.RouteModels routeModels = new AutopilotRouteInfo.RouteModels();
|
||||
if (i <= 100){
|
||||
routeModels.setLat(40.199248903658166);
|
||||
routeModels.setLon(116.73435586102245 + i * 0.0001);
|
||||
}else {
|
||||
routeModels.setLat(40.199248903658166 + i * 0.0001);
|
||||
routeModels.setLon(116.73435586102245 + 100 * 0.0001);
|
||||
if (i <= 100) {
|
||||
builder.setLatitude(40.199248903658166);
|
||||
builder.setLongitude(116.73435586102245 + i * 0.0001);
|
||||
} else {
|
||||
builder.setLatitude(40.199248903658166 + i * 0.0001);
|
||||
builder.setLongitude(116.73435586102245 + 100 * 0.0001);
|
||||
}
|
||||
list.add(routeModels);
|
||||
list.add(builder.build());
|
||||
}
|
||||
mPresenter.routeResult(list);
|
||||
return true;
|
||||
@@ -142,10 +140,10 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
/**
|
||||
* 设置进度条最大值为 起点终点首次规划出的值
|
||||
*/
|
||||
private void setSeekBarMax(){
|
||||
private void setSeekBarMax() {
|
||||
//计算订单起点和终点距离
|
||||
int maxInt = TaxiPassengerModel.getInstance().calculateOrderDistanceSum();
|
||||
Logger.d(TAG,"maxInt = "+maxInt);
|
||||
Logger.d(TAG, "maxInt = " + maxInt);
|
||||
mProgressSeekBar.setMax(maxInt);
|
||||
}
|
||||
|
||||
@@ -153,7 +151,7 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
* 行驶进度值更新
|
||||
*/
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
private void updateDriveProcessLoading(int progressLoading){
|
||||
private void updateDriveProcessLoading(int progressLoading) {
|
||||
mProgressSeekBar.setProgress(
|
||||
TaxiPassengerModel.getInstance().calculateOrderDistanceSum() - progressLoading
|
||||
, true);
|
||||
@@ -198,6 +196,7 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
|
||||
/**
|
||||
* 绘制
|
||||
*
|
||||
* @param coordinates
|
||||
*/
|
||||
private void drawablePolyline(List<MogoLatLng> coordinates) {
|
||||
@@ -212,7 +211,7 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
}
|
||||
}
|
||||
|
||||
private void clearPolyline(){
|
||||
private void clearPolyline() {
|
||||
if (mMapDirectionView != null) {
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
@@ -227,13 +226,13 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
mTPOrderStartStation.setText(order.startSiteAddr);
|
||||
mTPOrderEndStation.setText(order.endSiteAddr);
|
||||
|
||||
if (TaxiPassengerOrderStatusEnum.ArriveAtStartStation.getCode() == order.orderStatus){
|
||||
if (TaxiPassengerOrderStatusEnum.ArriveAtStartStation.getCode() == order.orderStatus) {
|
||||
mTPOrderStatus.setText(getString(R.string.taxi_p_arrive_to_start));
|
||||
setSeekBarMax();
|
||||
return;
|
||||
}
|
||||
|
||||
if (TaxiPassengerOrderStatusEnum.OnTheWayToEndStation.getCode() == order.orderStatus){
|
||||
if (TaxiPassengerOrderStatusEnum.OnTheWayToEndStation.getCode() == order.orderStatus) {
|
||||
mTPOrderStatus.setText(R.string.taxi_p_start_to_end);
|
||||
return;
|
||||
}
|
||||
@@ -246,7 +245,7 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
DecimalFormat fnum = new DecimalFormat("##0.00");
|
||||
String remainDis = fnum.format((float) meters / 1000);
|
||||
int remainTime = (int) timeInSecond / 60;
|
||||
updateOrderDisAndTimeView(remainDis,remainTime,arriveTime);
|
||||
updateOrderDisAndTimeView(remainDis, remainTime, arriveTime);
|
||||
updateDriveProcessLoading(meters);
|
||||
}
|
||||
|
||||
@@ -266,39 +265,41 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
|
||||
/**
|
||||
* 更新速度
|
||||
*
|
||||
* @param newSpeed
|
||||
*/
|
||||
private void updateSpeedView(float newSpeed) {
|
||||
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
|
||||
if (speed < mLimitingVelocity ){
|
||||
mTPSpeedTv.setText(getSpeedTextStyle(String.valueOf(speed),true));
|
||||
}else {
|
||||
if (speed < mLimitingVelocity) {
|
||||
mTPSpeedTv.setText(getSpeedTextStyle(String.valueOf(speed), true));
|
||||
} else {
|
||||
mTPSpeedTv.setText(getSpeedTextStyle(String.valueOf(speed), false));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置速度的颜色
|
||||
*
|
||||
* @param content
|
||||
* @param isNormal 正常状态 true, 超速状态
|
||||
* @return
|
||||
*/
|
||||
private SpannableStringBuilder getSpeedTextStyle(String content,boolean isNormal){
|
||||
if (isNormal){
|
||||
private SpannableStringBuilder getSpeedTextStyle(String content, boolean isNormal) {
|
||||
if (isNormal) {
|
||||
return TaxiPassengerUtils.getGradientFontSpan(content
|
||||
, 0xFFCEEEFF ,0xFFA1DAFF);
|
||||
}else {//超速
|
||||
, 0xFFCEEEFF, 0xFFA1DAFF);
|
||||
} else {//超速
|
||||
return TaxiPassengerUtils.getGradientFontSpan(content
|
||||
,0xFFFE2505 ,0xFFFF6F62);
|
||||
, 0xFFFE2505, 0xFFFF6F62);
|
||||
}
|
||||
}
|
||||
|
||||
private void runOnUIThread( Runnable executor ) {
|
||||
if ( executor == null ) {
|
||||
private void runOnUIThread(Runnable executor) {
|
||||
if (executor == null) {
|
||||
return;
|
||||
}
|
||||
if ( Looper.myLooper() != Looper.getMainLooper() ) {
|
||||
UiThreadHandler.post( executor );
|
||||
if (Looper.myLooper() != Looper.getMainLooper()) {
|
||||
UiThreadHandler.post(executor);
|
||||
} else {
|
||||
executor.run();
|
||||
}
|
||||
@@ -311,6 +312,7 @@ public class TaxiPassengerServingOrderFragment extends
|
||||
|
||||
/**
|
||||
* 设置指南针旋转
|
||||
*
|
||||
* @param bearing
|
||||
*/
|
||||
private void startIvCompass(float bearing) {
|
||||
|
||||
@@ -6,25 +6,25 @@ object CallerLogger {
|
||||
|
||||
fun i(tag: String, message: Any? = null) {
|
||||
if (scene.check(tag)) {
|
||||
Logger.i(tag, message.toString(), null)
|
||||
Logger.i(tag, message.toString())
|
||||
}
|
||||
}
|
||||
|
||||
fun d(tag: String, message: Any? = null) {
|
||||
if (scene.check(tag)) {
|
||||
Logger.d(tag, message.toString(), null)
|
||||
Logger.d(tag, message.toString())
|
||||
}
|
||||
}
|
||||
|
||||
fun w(tag: String, message: Any? = null) {
|
||||
if (scene.check(tag)) {
|
||||
Logger.w(tag, message.toString(), null)
|
||||
Logger.w(tag, message.toString())
|
||||
}
|
||||
}
|
||||
|
||||
fun e(tag: String, message: Any? = null) {
|
||||
if (scene.check(tag)) {
|
||||
Logger.e(tag, message.toString(), null)
|
||||
Logger.e(tag, message.toString())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,43 +15,59 @@ public final class Logger {
|
||||
return sPrinter.init(logLevel);
|
||||
}
|
||||
|
||||
public static void d( String tag, String message, Object... args) {
|
||||
if(isLoggable(LogLevel.DEBUG)) sPrinter.d(tag, message, args);
|
||||
public static void d(String tag, String message) {
|
||||
d(tag, message, (Object) null);
|
||||
}
|
||||
|
||||
public static void e( String tag, String message, Object... args) {
|
||||
if(isLoggable(LogLevel.ERROR)) sPrinter.e(tag, null, message, args);
|
||||
public static void d(String tag, String message, Object... args) {
|
||||
if (isLoggable(LogLevel.DEBUG)) sPrinter.d(tag, message, args);
|
||||
}
|
||||
|
||||
public static void e( String tag, Throwable throwable, String message, Object... args) {
|
||||
if(isLoggable(LogLevel.ERROR)) sPrinter.e(tag, throwable, message, args);
|
||||
public static void e(String tag, String message){
|
||||
e(tag,message, (Object) null);
|
||||
}
|
||||
|
||||
public static void i( String tag, String message, Object... args) {
|
||||
if(isLoggable(LogLevel.INFO)) sPrinter.i(tag, message, args);
|
||||
public static void e(String tag, String message, Object... args) {
|
||||
if (isLoggable(LogLevel.ERROR)) sPrinter.e(tag, null, message, args);
|
||||
}
|
||||
|
||||
public static void v( String tag, String message, Object... args) {
|
||||
if(isLoggable(LogLevel.VERBOSE)) sPrinter.v(tag, message, args);
|
||||
public static void e(String tag, Throwable throwable, String message, Object... args) {
|
||||
if (isLoggable(LogLevel.ERROR)) sPrinter.e(tag, throwable, message, args);
|
||||
}
|
||||
|
||||
public static void w( String tag, String message, Object... args) {
|
||||
if(isLoggable(LogLevel.WARN)) sPrinter.w(tag, message, args);
|
||||
public static void i(String tag, String message) {
|
||||
i(tag, message, (Object) null);
|
||||
}
|
||||
|
||||
public static void easyLog( String tag, String message) {
|
||||
if(isLoggable(LogLevel.DEBUG)) sPrinter.d(tag, message);
|
||||
public static void i(String tag, String message, Object... args) {
|
||||
if (isLoggable(LogLevel.INFO)) sPrinter.i(tag, message, args);
|
||||
}
|
||||
|
||||
public static void json( String tag, String json) {
|
||||
if(isLoggable(LogLevel.DEBUG)) sPrinter.json(tag, json);
|
||||
public static void v(String tag, String message, Object... args) {
|
||||
if (isLoggable(LogLevel.VERBOSE)) sPrinter.v(tag, message, args);
|
||||
}
|
||||
|
||||
public static void xml( String tag, String xml) {
|
||||
if(isLoggable(LogLevel.DEBUG)) sPrinter.xml(tag, xml);
|
||||
public static void w(String tag, String message){
|
||||
w(tag,message, (Object) null);
|
||||
}
|
||||
|
||||
private static boolean isLoggable(LogLevel logLevel){
|
||||
public static void w(String tag, String message, Object... args) {
|
||||
if (isLoggable(LogLevel.WARN)) sPrinter.w(tag, message, args);
|
||||
}
|
||||
|
||||
public static void easyLog(String tag, String message) {
|
||||
if (isLoggable(LogLevel.DEBUG)) sPrinter.d(tag, message);
|
||||
}
|
||||
|
||||
public static void json(String tag, String json) {
|
||||
if (isLoggable(LogLevel.DEBUG)) sPrinter.json(tag, json);
|
||||
}
|
||||
|
||||
public static void xml(String tag, String xml) {
|
||||
if (isLoggable(LogLevel.DEBUG)) sPrinter.xml(tag, xml);
|
||||
}
|
||||
|
||||
private static boolean isLoggable(LogLevel logLevel) {
|
||||
return sPrinter.getSettings().getLogLevel().level <= logLevel.level;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user