Merge branch 'dev_robotaxi-d-app-module_265_220329_2.6.5' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_265_220329_2.6.5
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
# 网约车(Online Car Hailing)
|
||||
|
||||
## 小巴
|
||||
|
||||
## 出租车
|
||||
|
||||
## 无实现
|
||||
1. mogo-och-bus:Bus司机端(Bus)
|
||||
2. mogo-och-bus-passenger:Bus乘客端(BusPassenger)
|
||||
3. mogo-och-taxi:Taxi司机端(Taxi)
|
||||
4. mogo-och-taxi-passenger:Taxi乘客端(TaxiPassenger)
|
||||
5. mogo-och-noop:空实现,用于独立鹰眼打包
|
||||
@@ -5,12 +5,12 @@ import android.content.Intent;
|
||||
import android.location.Location;
|
||||
import android.net.ConnectivityManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
|
||||
@@ -32,6 +32,7 @@ import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@@ -243,6 +244,11 @@ public class BusPassengerModel {
|
||||
|
||||
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener(){
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp routeList) {
|
||||
if (null != routeList && routeList.getWayPointsList().size() > 0){
|
||||
@@ -251,10 +257,6 @@ public class BusPassengerModel {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<application>
|
||||
<!--这里是为了测试增加的广播-->
|
||||
<receiver android:name=".receiver.TestOchBusBroadcastReceiver">
|
||||
<receiver android:name=".receiver.TestBusBroadcastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.bus.test_control" />
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.bus.constant.OchBusConst;
|
||||
import com.mogo.och.bus.fragment.OchBusFragment;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.fragment.BusFragment;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
@@ -25,12 +25,12 @@ import org.jetbrains.annotations.Nullable;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
@Route(path = OchBusConst.PATH)
|
||||
public class OchBusProvider implements IMogoOCH {
|
||||
@Route(path = BusConst.PATH)
|
||||
public class BusProvider implements IMogoOCH {
|
||||
|
||||
private static final String TAG = "OchBusProvider";
|
||||
private static final String TAG = "BusProvider";
|
||||
|
||||
private OchBusFragment busFragment;
|
||||
private BusFragment busFragment;
|
||||
private int containerId;
|
||||
private FragmentActivity activity;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class OchBusProvider implements IMogoOCH {
|
||||
private void showFragment() {
|
||||
if (busFragment == null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "准备add fragment======");
|
||||
busFragment = new OchBusFragment();
|
||||
busFragment = new BusFragment();
|
||||
activity.getSupportFragmentManager().beginTransaction().add(containerId, busFragment).commitAllowingStateLoss();
|
||||
return;
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
package com.mogo.och.bus.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.OchBusStation;
|
||||
import com.mogo.och.bus.constant.OchBusConst;
|
||||
import com.mogo.och.bus.view.VerticalDashLineView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Station Panel 中的车站列表adapter
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class OchBusStationAdapter extends RecyclerView.Adapter<OchBusStationAdapter.ViewHolder> {
|
||||
private final Context context;
|
||||
private final List<OchBusStation> stationList = new ArrayList<>();
|
||||
private int currentStation;
|
||||
|
||||
public OchBusStationAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void refreshStationList(List<OchBusStation> stationList) {
|
||||
this.stationList.clear();
|
||||
this.stationList.addAll(stationList);
|
||||
for (int i = 0; i < stationList.size(); i++) {
|
||||
OchBusStation station = stationList.get(i);
|
||||
if (station.getDrivingStatus() == OchBusConst.STATION_STATUS_ARRIVING || station.getDrivingStatus() == OchBusConst.STATION_STATUS_STOPPED ) {
|
||||
currentStation = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new ViewHolder(LayoutInflater.from(context).inflate(R.layout.item_och_bus_station, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
// CallerLogger.INSTANCE.d(M_BUS + "OchBusStationAdapter", "position: " + position + " currPos: " + currentStation + " station: " + stationList.get(position));
|
||||
holder.tvStationName.setText(stationList.get(position).getName());
|
||||
if (position == currentStation) {
|
||||
if (currentStation == 0) {
|
||||
// 在起始点
|
||||
holder.tvStationName.setTextColor(context.getResources().getColor(R.color.bus_arrived_station_name_text_color));
|
||||
holder.ivIcon.setImageResource(R.drawable.bus_icon_arrived_station);
|
||||
holder.vDashBottom.setColor(context.getResources().getColor(R.color.bus_not_arrive_dash_color));
|
||||
} else {
|
||||
holder.tvStationName.setTextColor(context.getResources().getColor(R.color.bus_current_station_name_text_color));
|
||||
holder.ivIcon.setImageResource(R.drawable.bus_icon_arriving_station);
|
||||
holder.vDashTop.setGradient(context.getResources().getColor(R.color.bus_arriving_start_dash_color), context.getResources().getColor(R.color.bus_arriving_end_dash_color));
|
||||
holder.vDashBottom.setColor(context.getResources().getColor(R.color.bus_not_arrive_dash_color));
|
||||
}
|
||||
} else if (position < currentStation) {
|
||||
// 驶过
|
||||
holder.tvStationName.setTextColor(context.getResources().getColor(R.color.bus_arrived_station_name_text_color));
|
||||
holder.ivIcon.setImageResource(R.drawable.bus_icon_arrived_station);
|
||||
if (position == currentStation - 1) {
|
||||
holder.vDashBottom.setGradient(context.getResources().getColor(R.color.bus_leaving_start_dash_color), context.getResources().getColor(R.color.bus_leaving_end_dash_color));
|
||||
holder.vDashTop.setColor(context.getResources().getColor(R.color.bus_arrived_dash_color));
|
||||
} else {
|
||||
holder.vDashTop.setColor(context.getResources().getColor(R.color.bus_arrived_dash_color));
|
||||
holder.vDashBottom.setColor(context.getResources().getColor(R.color.bus_arrived_dash_color));
|
||||
}
|
||||
} else {
|
||||
holder.tvStationName.setTextColor(context.getResources().getColor(R.color.bus_not_arrive_station_name_text_color));
|
||||
holder.ivIcon.setImageResource(R.drawable.bus_icon_not_arrive_station);
|
||||
holder.vDashTop.setColor(context.getResources().getColor(R.color.bus_not_arrive_dash_color));
|
||||
holder.vDashBottom.setColor(context.getResources().getColor(R.color.bus_not_arrive_dash_color));
|
||||
}
|
||||
|
||||
if (position == 0) {
|
||||
holder.tvStationNotice.setText("起点");
|
||||
holder.tvStationNotice.setVisibility(View.VISIBLE);
|
||||
holder.vDashTop.setVisibility(View.GONE);
|
||||
holder.vDashBottom.setVisibility(View.VISIBLE);
|
||||
} else if (position == getItemCount() - 1) {
|
||||
holder.tvStationNotice.setText("终点");
|
||||
holder.tvStationNotice.setVisibility(View.VISIBLE);
|
||||
holder.vDashTop.setVisibility(View.VISIBLE);
|
||||
holder.vDashBottom.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.tvStationNotice.setVisibility(View.GONE);
|
||||
holder.vDashTop.setVisibility(View.VISIBLE);
|
||||
holder.vDashBottom.setVisibility(View.VISIBLE);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return stationList.size();
|
||||
}
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView ivIcon;
|
||||
TextView tvStationName;
|
||||
TextView tvStationNotice;
|
||||
VerticalDashLineView vDashBottom, vDashTop;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
ivIcon = itemView.findViewById(R.id.module_mogo_och_bus_station_icon);
|
||||
tvStationName = itemView.findViewById(R.id.module_mogo_och_bus_station_name);
|
||||
tvStationNotice = itemView.findViewById(R.id.module_mogo_och_bus_station_notice);
|
||||
vDashTop = itemView.findViewById(R.id.module_mogo_och_bus_station_top_dash);
|
||||
vDashBottom = itemView.findViewById(R.id.module_mogo_och_bus_station_bottom_dash);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,12 @@ public
|
||||
*
|
||||
* 小巴车运营状态请求参数
|
||||
*/
|
||||
class OchBusOperationStatusRequest {
|
||||
class BusOperationStatusRequest {
|
||||
|
||||
private String sn;
|
||||
private double lat;
|
||||
private double lon;
|
||||
public OchBusOperationStatusRequest(double lon, double lat) {
|
||||
public BusOperationStatusRequest(double lon, double lat) {
|
||||
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
@@ -8,7 +8,7 @@ import com.mogo.eagle.core.data.BaseData;
|
||||
*
|
||||
* 小巴车运营状态返回参数
|
||||
*/
|
||||
public class OchBusOperationStatusResponse extends BaseData {
|
||||
public class BusOperationStatusResponse extends BaseData {
|
||||
|
||||
public Result data;
|
||||
|
||||
@@ -6,7 +6,7 @@ package com.mogo.och.bus.bean;
|
||||
* <p>
|
||||
* 小巴订单
|
||||
*/
|
||||
public class OchBusOrder {
|
||||
public class BusOrderBean {
|
||||
|
||||
/**
|
||||
* orderNo number
|
||||
@@ -74,7 +74,7 @@ public class OchBusOrder {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OchBusOrder{" +
|
||||
return "BusOrderBean{" +
|
||||
"orderNo=" + orderNo +
|
||||
", passengerPhone='" + passengerPhone + '\'' +
|
||||
", startStationId=" + startStationId +
|
||||
@@ -8,15 +8,15 @@ import java.util.List;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/19
|
||||
*/
|
||||
public class OchBusOrdersResponse extends BaseData {
|
||||
public class BusOrdersResponse extends BaseData {
|
||||
public Result data;
|
||||
public static class Result{
|
||||
public List<OchBusOrder> orders;
|
||||
public List<BusOrderBean> orders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OchBusOrdersResponse{" +
|
||||
return "BusOrdersResponse{" +
|
||||
"data=" + data +
|
||||
'}';
|
||||
}
|
||||
@@ -9,7 +9,7 @@ public
|
||||
*
|
||||
* 根据车机行驶线路站点信息
|
||||
*/
|
||||
class OchBusQueryLineStationsRequest {
|
||||
class BusQueryLineStationsRequest {
|
||||
|
||||
private String sn;
|
||||
private double lat;
|
||||
@@ -17,7 +17,7 @@ class OchBusQueryLineStationsRequest {
|
||||
private boolean markDrivingStatus; // 默认false;true:是否需要返回站点的行驶状态,对应返回的drivingStatus
|
||||
// 0 - 关闭、1 - 启动
|
||||
// public String status;
|
||||
public OchBusQueryLineStationsRequest(double lon, double lat,boolean markDrivingStatus) {
|
||||
public BusQueryLineStationsRequest(double lon, double lat, boolean markDrivingStatus) {
|
||||
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
@@ -51,12 +51,12 @@ class OchBusQueryLineStationsRequest {
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
// public OchBusOperationStatusRequest shutdown() {
|
||||
// public BusOperationStatusRequest shutdown() {
|
||||
// status = "0";
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public OchBusOperationStatusRequest launch() {
|
||||
// public BusOperationStatusRequest launch() {
|
||||
// status = "1";
|
||||
// return this;
|
||||
// }
|
||||
@@ -7,11 +7,11 @@ import com.mogo.commons.network.Utils;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/18
|
||||
*/
|
||||
public class OchBusResetDrivingLineRequest {
|
||||
public class BusResetDrivingLineRequest {
|
||||
public String sn;
|
||||
public int lineId; //切换到的线路id
|
||||
|
||||
public OchBusResetDrivingLineRequest(int lineId) {
|
||||
public BusResetDrivingLineRequest(int lineId) {
|
||||
sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
this.lineId = lineId;
|
||||
}
|
||||
@@ -7,20 +7,20 @@ import com.mogo.eagle.core.data.BaseData;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class OchBusRoutesResponse extends BaseData {
|
||||
private OchBusRoutesResult data;
|
||||
public class BusRoutesResponse extends BaseData {
|
||||
private BusRoutesResult data;
|
||||
|
||||
public OchBusRoutesResult getResult() {
|
||||
public BusRoutesResult getResult() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setResult(OchBusRoutesResult data) {
|
||||
public void setResult(BusRoutesResult data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OchBusRoutesResponse{" +
|
||||
return "BusRoutesResponse{" +
|
||||
"data=" + data +
|
||||
'}';
|
||||
}
|
||||
@@ -7,8 +7,8 @@ import java.util.List;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class OchBusRoutesResult {
|
||||
private List<OchBusStation> sites;
|
||||
public class BusRoutesResult {
|
||||
private List<BusStationBean> sites;
|
||||
private int lineId;
|
||||
private String name;
|
||||
private int lineType; //线路类型,0:环形
|
||||
@@ -23,17 +23,17 @@ public class OchBusRoutesResult {
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<OchBusStation> getSites() {
|
||||
public List<BusStationBean> getSites() {
|
||||
return sites;
|
||||
}
|
||||
|
||||
public void setSite(List<OchBusStation> site) {
|
||||
public void setSite(List<BusStationBean> site) {
|
||||
this.sites = sites;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OchBusRoutesResult{" +
|
||||
return "BusRoutesResult{" +
|
||||
"sites=" + sites +
|
||||
", lineId=" + lineId +
|
||||
", name='" + name + '\'' +
|
||||
@@ -5,7 +5,7 @@ package com.mogo.och.bus.bean;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class OchBusStation {
|
||||
public class BusStationBean {
|
||||
// private int lineId;
|
||||
// private int siteId;
|
||||
// private String siteName;
|
||||
@@ -134,7 +134,7 @@ public class OchBusStation {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OchBusStation{" +
|
||||
return "BusStationBean{" +
|
||||
"name='" + name + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", cityCode='" + cityCode + '\'' +
|
||||
@@ -9,7 +9,7 @@ import com.mogo.commons.network.Utils;
|
||||
*
|
||||
* 小巴车运营状态请求参数
|
||||
*/
|
||||
public class OchBusUpdateSiteStatusRequest {
|
||||
public class BusUpdateSiteStatusRequest {
|
||||
|
||||
public String sn;
|
||||
public int seq;//站点序号
|
||||
@@ -17,7 +17,7 @@ public class OchBusUpdateSiteStatusRequest {
|
||||
public double lon;
|
||||
public double lat;
|
||||
|
||||
public OchBusUpdateSiteStatusRequest(int seq, int siteId, double lon, double lat) {
|
||||
public BusUpdateSiteStatusRequest(int seq, int siteId, double lon, double lat) {
|
||||
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
this.seq = seq;
|
||||
this.siteId = siteId;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.och.bus.constant.OchBusConst;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -21,6 +21,6 @@ public class CarHeartbeatReqBean {
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
this.msgId = UUID.randomUUID().toString();
|
||||
this.interval = (int) (OchBusConst.LOOP_PERIOD_60S / 1000);
|
||||
this.interval = (int) (BusConst.LOOP_PERIOD_60S / 1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.network.Utils;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/22
|
||||
*
|
||||
* 小巴车运营状态请求参数
|
||||
*/
|
||||
class QueryOchBusOperationStatusRequest {
|
||||
|
||||
public String sn;
|
||||
|
||||
|
||||
public QueryOchBusOperationStatusRequest() {
|
||||
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import android.location.Location;
|
||||
*
|
||||
* Model->Presenter回调:状态控制器监听(accOn、adas ui show、voice ui show、push ui show、v2x ui show等等)
|
||||
*/
|
||||
public interface IOCHBusControllerStatusCallback {
|
||||
public interface IBusControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
@@ -6,7 +6,7 @@ import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/2/9
|
||||
*/
|
||||
public interface BusLinesCallback {
|
||||
public interface IBusLinesCallback {
|
||||
void onBusLinesChange(BusQueryLinesResponse lines);
|
||||
void onChangeLineIdSuccess();
|
||||
}
|
||||
@@ -4,6 +4,6 @@ package com.mogo.och.bus.callback;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
public interface CarOperationStatusCallback {
|
||||
public interface ICarOperationStatusCallback {
|
||||
void changeOperationStatus(boolean changeStatus);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.mogo.och.bus.callback;
|
||||
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
public interface IRefreshBusStationsCallback {
|
||||
void refreshBusStations(List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived);
|
||||
}
|
||||
@@ -4,6 +4,6 @@ package com.mogo.och.bus.callback;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
public interface SlidePannelHideCallback {
|
||||
public interface ISlidePannelHideCallback {
|
||||
void hideSlidePanel();
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.mogo.och.bus.callback;
|
||||
|
||||
import com.mogo.och.bus.bean.OchBusStation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
public interface RefreshBusStationsCallback {
|
||||
void refreshBusStations(List<OchBusStation> stationList, int currentStation, int nextStation,boolean isArrived);
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import com.mogo.commons.debug.DebugConfig
|
||||
/**
|
||||
* Created on 2021/12/6
|
||||
*/
|
||||
class OchBusConst {
|
||||
class BusConst {
|
||||
companion object {
|
||||
|
||||
private const val BASE_URL_OCH_DEV = "http://tech-dev.zhidaohulian.com"
|
||||
@@ -24,9 +24,10 @@ import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -53,7 +54,7 @@ import record_cache.RecordPanelOuterClass;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public abstract class BaseOchBusTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener, IMoGoAutopilotIdentifyListener {
|
||||
public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener, IMoGoAutopilotRecordListener {
|
||||
|
||||
private static final String TAG = "BaseOchFragment";
|
||||
|
||||
@@ -218,7 +219,7 @@ public abstract class BaseOchBusTabFragment<V extends IView, P extends Presenter
|
||||
if (mBadcaseBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn, null, null);
|
||||
if (!HmiBuildConfig.isShowBadCaseView) {
|
||||
CallerAutopilotIdentifyListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
}
|
||||
//设置升级小红点提示 默认隐藏
|
||||
@@ -230,7 +231,7 @@ public abstract class BaseOchBusTabFragment<V extends IView, P extends Presenter
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
if (!HmiBuildConfig.isShowBadCaseView) {
|
||||
CallerAutopilotIdentifyListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,9 +243,6 @@ public abstract class BaseOchBusTabFragment<V extends IView, P extends Presenter
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotWarnMessage(MessagePad.Warn warn) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试到站
|
||||
@@ -20,9 +20,9 @@ import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.OchBusStation;
|
||||
import com.mogo.och.bus.constant.OchBusConst;
|
||||
import com.mogo.och.bus.presenter.OchBusPresenter;
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.presenter.BusPresenter;
|
||||
import com.mogo.och.bus.ui.BusSwitchLineActivity;
|
||||
import com.mogo.och.bus.view.SlidePanelView;
|
||||
|
||||
@@ -36,9 +36,9 @@ import mogo.telematics.pad.MessagePad;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class OchBusFragment extends BaseOchBusTabFragment<OchBusFragment, OchBusPresenter>
|
||||
public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
implements SlidePanelView.OnSlidePanelMoveToEndListener, View.OnClickListener {
|
||||
private static final String TAG = "OchBusFragment";
|
||||
private static final String TAG = "BusFragment";
|
||||
|
||||
private TextView mCurrentStationName;
|
||||
private TextView mStartStationFlag;
|
||||
@@ -50,12 +50,12 @@ public class OchBusFragment extends BaseOchBusTabFragment<OchBusFragment, OchBus
|
||||
|
||||
private View mBus;
|
||||
|
||||
private OchBusStation startStation = null;
|
||||
private OchBusStation endStation = null;
|
||||
private BusStationBean startStation = null;
|
||||
private BusStationBean endStation = null;
|
||||
|
||||
@Override
|
||||
public String getTagName() {
|
||||
return "OchBusFragment";
|
||||
return "BusFragment";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -113,8 +113,8 @@ public class OchBusFragment extends BaseOchBusTabFragment<OchBusFragment, OchBus
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected OchBusPresenter createPresenter() {
|
||||
return new OchBusPresenter(this);
|
||||
protected BusPresenter createPresenter() {
|
||||
return new BusPresenter(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,7 +130,7 @@ public class OchBusFragment extends BaseOchBusTabFragment<OchBusFragment, OchBus
|
||||
* @param nextStation 下个站点
|
||||
* @param isArrived 是否都站
|
||||
*/
|
||||
public void refreshBusStations(List<OchBusStation> stationList, int currentStation, int nextStation, boolean isArrived) {
|
||||
public void refreshBusStations(List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived) {
|
||||
mCurrentStation = currentStation;
|
||||
if (getActivity() == null) {
|
||||
return;
|
||||
@@ -149,7 +149,7 @@ public class OchBusFragment extends BaseOchBusTabFragment<OchBusFragment, OchBus
|
||||
/**
|
||||
* 重新刷新站点信息 isArrived 是否到站
|
||||
*/
|
||||
private void renderCurrentStationStatus(List<OchBusStation> stationList, int currentStation
|
||||
private void renderCurrentStationStatus(List<BusStationBean> stationList, int currentStation
|
||||
, int nextStation, boolean isArrived) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + "MapMaker ", "currentStation=" + currentStation + ",nextStation=" + nextStation + "isArrived=" + isArrived);
|
||||
String currentStationName = null;
|
||||
@@ -173,16 +173,16 @@ public class OchBusFragment extends BaseOchBusTabFragment<OchBusFragment, OchBus
|
||||
isArriveAtStartStation = true;
|
||||
mStartStationFlag.setText(getResources().getString(R.string.bus_arrive_to_end_start));
|
||||
|
||||
setOrRemoveMapMaker(true, OchBusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon());
|
||||
setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon());
|
||||
} else if (currentStation > 0 && currentStation < stationList.size() - 1) {// 是否到达站点
|
||||
isArriveAtStation = true;
|
||||
|
||||
setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon());
|
||||
setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon());
|
||||
} else if (currentStation == stationList.size() - 1) {// 是否到达终点
|
||||
isArriveEndStation = true;
|
||||
@@ -191,14 +191,14 @@ public class OchBusFragment extends BaseOchBusTabFragment<OchBusFragment, OchBus
|
||||
startStationFlagVisibility = View.VISIBLE;
|
||||
endStationFlagVisibility = View.INVISIBLE;
|
||||
|
||||
setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon());
|
||||
|
||||
if (isArrived) {
|
||||
setOrRemoveMapMaker(false, OchBusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon());
|
||||
} else {
|
||||
setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon());
|
||||
}
|
||||
}
|
||||
@@ -291,11 +291,11 @@ public class OchBusFragment extends BaseOchBusTabFragment<OchBusFragment, OchBus
|
||||
|
||||
//移除起点终点
|
||||
if (null != startStation) {
|
||||
setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon());
|
||||
}
|
||||
if (null != endStation) {
|
||||
setOrRemoveMapMaker(false, OchBusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
|
||||
, endStation.getLon());
|
||||
}
|
||||
}
|
||||
@@ -323,7 +323,7 @@ public class OchBusFragment extends BaseOchBusTabFragment<OchBusFragment, OchBus
|
||||
CallerLogger.INSTANCE.d("setMapMaker= ", uuid + "=latitude=" + lat + ",longitude=" + longi);
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(OchBusConst.TYPE_MARKER_BUS_ORDER)
|
||||
.owner(BusConst.TYPE_MARKER_BUS_ORDER)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.gps(true)
|
||||
@@ -342,6 +342,7 @@ public class OchBusFragment extends BaseOchBusTabFragment<OchBusFragment, OchBus
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debugAutoPilotStatus(int status) {
|
||||
mPresenter.debugAutoPilotStatus(status);
|
||||
}
|
||||
@@ -364,8 +365,4 @@ public class OchBusFragment extends BaseOchBusTabFragment<OchBusFragment, OchBus
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotIdentifyDataUpdate(List<MessagePad.TrackedObject> trafficData) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,18 +11,18 @@ import com.mogo.eagle.core.network.RequestOptions;
|
||||
import com.mogo.eagle.core.network.SubscribeImpl;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
|
||||
import com.mogo.och.bus.bean.OchBusOperationStatusRequest;
|
||||
import com.mogo.och.bus.bean.OchBusOperationStatusResponse;
|
||||
import com.mogo.och.bus.bean.OchBusOrdersResponse;
|
||||
import com.mogo.och.bus.bean.OchBusQueryLineStationsRequest;
|
||||
import com.mogo.och.bus.bean.OchBusResetDrivingLineRequest;
|
||||
import com.mogo.och.bus.bean.OchBusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.OchBusUpdateSiteStatusRequest;
|
||||
import com.mogo.och.bus.bean.BusOperationStatusRequest;
|
||||
import com.mogo.och.bus.bean.BusOperationStatusResponse;
|
||||
import com.mogo.och.bus.bean.BusOrdersResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryLineStationsRequest;
|
||||
import com.mogo.och.bus.bean.BusResetDrivingLineRequest;
|
||||
import com.mogo.och.bus.bean.BusUpdateSiteStatusRequest;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersRequest;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersResponse;
|
||||
import com.mogo.och.bus.constant.OchBusConst;
|
||||
import com.mogo.och.bus.presenter.OchBusOrderModel;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.presenter.BusOrderModel;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
@@ -31,22 +31,22 @@ import io.reactivex.schedulers.Schedulers;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/20
|
||||
*/
|
||||
public class OCHBusServiceManager {
|
||||
public class BusServiceManager {
|
||||
|
||||
private static final String TAG = OCHBusServiceManager.class.getSimpleName();
|
||||
private static final String TAG = BusServiceManager.class.getSimpleName();
|
||||
|
||||
private final IOchBusApiService mService;
|
||||
private final IBusApiService mService;
|
||||
|
||||
private static final class SingletonHolder {
|
||||
private static final OCHBusServiceManager INSTANCE = new OCHBusServiceManager();
|
||||
private static final BusServiceManager INSTANCE = new BusServiceManager();
|
||||
}
|
||||
|
||||
public static OCHBusServiceManager getInstance(){
|
||||
public static BusServiceManager getInstance(){
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private OCHBusServiceManager(){
|
||||
mService = MoGoRetrofitFactory.getInstance(OchBusConst.getBaseUrl()).create(IOchBusApiService.class);
|
||||
private BusServiceManager(){
|
||||
mService = MoGoRetrofitFactory.getInstance(BusConst.getBaseUrl()).create(IBusApiService.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,13 +54,13 @@ public class OCHBusServiceManager {
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
public void queryBusRoutes(Context context,OCHServiceCallback<OchBusRoutesResponse> callback) {
|
||||
public void queryBusRoutes(Context context, IBusServiceCallback<BusRoutesResponse> callback) {
|
||||
//获取当前高德坐标
|
||||
|
||||
mService.querySiteByCoordinate(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
, new OchBusQueryLineStationsRequest(OchBusOrderModel.getInstance().mLongitude
|
||||
,OchBusOrderModel.getInstance().mLatitude,true))
|
||||
, new BusQueryLineStationsRequest(BusOrderModel.getInstance().mLongitude
|
||||
, BusOrderModel.getInstance().mLatitude,true))
|
||||
.subscribeOn( Schedulers.io() ).observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe( getSubscribeImpl(context,callback,"querySiteByCoordinate"));
|
||||
}
|
||||
@@ -71,9 +71,9 @@ public class OCHBusServiceManager {
|
||||
* @param lineId
|
||||
* @param callback
|
||||
*/
|
||||
public void resetStationStatus(Context context, int lineId, OCHServiceCallback<OchBusRoutesResponse> callback){
|
||||
public void resetStationStatus(Context context, int lineId, IBusServiceCallback<BusRoutesResponse> callback){
|
||||
mService.resetStationStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken(),new OchBusResetDrivingLineRequest(lineId))
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken(),new BusResetDrivingLineRequest(lineId))
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context,callback,"debugResetStationStatus"));
|
||||
}
|
||||
@@ -85,11 +85,11 @@ public class OCHBusServiceManager {
|
||||
* @param siteId
|
||||
* @param callback
|
||||
*/
|
||||
public void leaveStation(Context context,int seq,int siteId,OCHServiceCallback<OchBusRoutesResponse> callback){
|
||||
public void leaveStation(Context context, int seq, int siteId, IBusServiceCallback<BusRoutesResponse> callback){
|
||||
mService.leaveStation(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new OchBusUpdateSiteStatusRequest(seq,siteId,OchBusOrderModel.getInstance().mLongitude
|
||||
,OchBusOrderModel.getInstance().mLatitude))
|
||||
,new BusUpdateSiteStatusRequest(seq,siteId, BusOrderModel.getInstance().mLongitude
|
||||
, BusOrderModel.getInstance().mLatitude))
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe(getSubscribeImpl(context,callback,"leaveStation"));
|
||||
@@ -102,11 +102,11 @@ public class OCHBusServiceManager {
|
||||
* @param siteId
|
||||
* @param callback
|
||||
*/
|
||||
public void arriveSiteStation(Context context,int seq,int siteId,OCHServiceCallback<BaseData> callback){
|
||||
public void arriveSiteStation(Context context, int seq, int siteId, IBusServiceCallback<BaseData> callback){
|
||||
mService.arriveSiteStation(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new OchBusUpdateSiteStatusRequest(seq,siteId
|
||||
,OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude))
|
||||
,new BusUpdateSiteStatusRequest(seq,siteId
|
||||
, BusOrderModel.getInstance().mLongitude, BusOrderModel.getInstance().mLatitude))
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe(getSubscribeImpl(context,callback,"leaveStation"));
|
||||
@@ -119,8 +119,8 @@ public class OCHBusServiceManager {
|
||||
* @param siteId
|
||||
* @param callback
|
||||
*/
|
||||
public void queryStationLeaveAwayPassengers(Context context,int seq,int siteId
|
||||
,OCHServiceCallback<QueryLeaveAwayPassengersResponse> callback){
|
||||
public void queryStationLeaveAwayPassengers(Context context, int seq, int siteId
|
||||
, IBusServiceCallback<QueryLeaveAwayPassengersResponse> callback){
|
||||
mService.queryStationLeaveAwayPassengers( MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken(),new QueryLeaveAwayPassengersRequest(seq,siteId))
|
||||
.subscribeOn( Schedulers.io() )
|
||||
@@ -133,11 +133,11 @@ public class OCHBusServiceManager {
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
public void stopTakeOrder(Context context,OCHServiceCallback<BaseData> callback){
|
||||
public void stopTakeOrder(Context context, IBusServiceCallback<BaseData> callback){
|
||||
mService.stopTakeOrder(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new OchBusOperationStatusRequest(OchBusOrderModel.getInstance().mLongitude
|
||||
,OchBusOrderModel.getInstance().mLatitude))
|
||||
,new BusOperationStatusRequest(BusOrderModel.getInstance().mLongitude
|
||||
, BusOrderModel.getInstance().mLatitude))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context,callback,"stopTakeOrder"));
|
||||
@@ -148,11 +148,11 @@ public class OCHBusServiceManager {
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
public void startTakeOrder(Context context,OCHServiceCallback<BaseData> callback){
|
||||
public void startTakeOrder(Context context, IBusServiceCallback<BaseData> callback){
|
||||
mService.startTakeOrder(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new OchBusOperationStatusRequest(OchBusOrderModel.getInstance().mLongitude
|
||||
,OchBusOrderModel.getInstance().mLatitude))
|
||||
,new BusOperationStatusRequest(BusOrderModel.getInstance().mLongitude
|
||||
, BusOrderModel.getInstance().mLatitude))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context,callback,"startTakeOrder"));
|
||||
@@ -163,7 +163,7 @@ public class OCHBusServiceManager {
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
public void queryOperationStatus(Context context,OCHServiceCallback<OchBusOperationStatusResponse> callback){
|
||||
public void queryOperationStatus(Context context, IBusServiceCallback<BusOperationStatusResponse> callback){
|
||||
mService.queryOperationStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken(),MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
.subscribeOn( Schedulers.io() )
|
||||
@@ -176,7 +176,7 @@ public class OCHBusServiceManager {
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
public void queryBusOrders(Context context, OCHServiceCallback<OchBusOrdersResponse> callback){
|
||||
public void queryBusOrders(Context context, IBusServiceCallback<BusOrdersResponse> callback){
|
||||
mService.queryBusOrders(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken(),MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -184,7 +184,7 @@ public class OCHBusServiceManager {
|
||||
.subscribe(getSubscribeImpl(context,callback,"queryBusOrders"));
|
||||
}
|
||||
|
||||
public void queryBusLines(Context context, OCHServiceCallback<BusQueryLinesResponse> callback){
|
||||
public void queryBusLines(Context context, IBusServiceCallback<BusQueryLinesResponse> callback){
|
||||
mService.queryBusLines(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken(),MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -200,7 +200,7 @@ public class OCHBusServiceManager {
|
||||
* @param callback
|
||||
*/
|
||||
public void runCarHeartbeat(Context context, double lon, double lat,
|
||||
OCHServiceCallback<BaseData> callback) {
|
||||
IBusServiceCallback<BaseData> callback) {
|
||||
mService.runCarHeartbeat(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken(),new CarHeartbeatReqBean(
|
||||
MoGoAiCloudClientConfig.getInstance().getSn(), lon, lat))
|
||||
@@ -209,7 +209,7 @@ public class OCHBusServiceManager {
|
||||
.subscribe(getSubscribeImpl(context, callback, "runCarHeartbeat"));
|
||||
}
|
||||
|
||||
private <T extends BaseData> SubscribeImpl getSubscribeImpl(Context context, OCHServiceCallback<T> callback, String apiName){
|
||||
private <T extends BaseData> SubscribeImpl getSubscribeImpl(Context context, IBusServiceCallback<T> callback, String apiName){
|
||||
return new SubscribeImpl<T>(RequestOptions.create(context)){
|
||||
@Override
|
||||
public void onSuccess(T o) {
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.mogo.och.bus.net;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.bus.bean.BusOperationStatusRequest;
|
||||
import com.mogo.och.bus.bean.BusOrdersResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
|
||||
import com.mogo.och.bus.bean.OchBusOperationStatusRequest;
|
||||
import com.mogo.och.bus.bean.OchBusQueryLineStationsRequest;
|
||||
import com.mogo.och.bus.bean.OchBusOperationStatusResponse;
|
||||
import com.mogo.och.bus.bean.OchBusOrdersResponse;
|
||||
import com.mogo.och.bus.bean.OchBusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryLineStationsRequest;
|
||||
import com.mogo.och.bus.bean.BusOperationStatusResponse;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersRequest;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersResponse;
|
||||
import com.mogo.och.bus.bean.OchBusResetDrivingLineRequest;
|
||||
import com.mogo.och.bus.bean.OchBusUpdateSiteStatusRequest;
|
||||
import com.mogo.och.bus.bean.BusResetDrivingLineRequest;
|
||||
import com.mogo.och.bus.bean.BusUpdateSiteStatusRequest;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
@@ -27,7 +27,7 @@ import retrofit2.http.Query;
|
||||
* <p>
|
||||
* wiki: http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=48970072
|
||||
*/
|
||||
public interface IOchBusApiService {
|
||||
public interface IBusApiService {
|
||||
/**
|
||||
* 根据车机坐标获取所在区域全部站点信息
|
||||
*
|
||||
@@ -38,7 +38,7 @@ public interface IOchBusApiService {
|
||||
// @POST( "/autopilot-car-hailing/line/v2/lineDataWithDriver/query" )
|
||||
@POST( "/autopilot-car-hailing/line/v2/driver/bus/lineDataWithDriver/query" )
|
||||
// @POST( "/mock/268/autopilot-car-hailing/bus/api/lineDataWithDriver/query" )
|
||||
Observable< OchBusRoutesResponse > querySiteByCoordinate(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusQueryLineStationsRequest request);
|
||||
Observable<BusRoutesResponse> querySiteByCoordinate(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusQueryLineStationsRequest request);
|
||||
|
||||
/**
|
||||
* 重置巴士路线: 点击小巴车tab 或者出车后会使用
|
||||
@@ -50,7 +50,7 @@ public interface IOchBusApiService {
|
||||
// @POST( "/autopilot-car-hailing/car/v2/bus/drivingLine/reset" )
|
||||
@POST( "/autopilot-car-hailing/car/v2/driver/bus/drivingLine/reset" )
|
||||
// @POST( "/mock/268/autopilot-car-hailing/bus/api/drivingLine/reset" )
|
||||
Observable< OchBusRoutesResponse > resetStationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Body OchBusResetDrivingLineRequest request);
|
||||
Observable<BusRoutesResponse> resetStationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusResetDrivingLineRequest request);
|
||||
|
||||
/**
|
||||
* 离站,通知服务器
|
||||
@@ -61,7 +61,7 @@ public interface IOchBusApiService {
|
||||
// @POST("/autopilot-car-hailing/car/v2/bus/driving/away")
|
||||
@POST("/autopilot-car-hailing/car/v2/driver/bus/driving/away")
|
||||
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/away")
|
||||
Observable< OchBusRoutesResponse > leaveStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusUpdateSiteStatusRequest request);
|
||||
Observable<BusRoutesResponse> leaveStation(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusUpdateSiteStatusRequest request);
|
||||
|
||||
/**
|
||||
* 到站 更新到站信息
|
||||
@@ -72,7 +72,7 @@ public interface IOchBusApiService {
|
||||
// @POST("/autopilot-car-hailing/order/v2/bus/driving/attachSite")
|
||||
@POST("/autopilot-car-hailing/order/v2/driver/bus/driving/attachSite")
|
||||
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/attachSite")
|
||||
Observable< BaseData > arriveSiteStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusUpdateSiteStatusRequest request);
|
||||
Observable< BaseData > arriveSiteStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body BusUpdateSiteStatusRequest request);
|
||||
|
||||
|
||||
/**
|
||||
@@ -95,7 +95,7 @@ public interface IOchBusApiService {
|
||||
// @POST("/autopilot-car-hailing/car/v2/bus/startTakeOrder")
|
||||
@POST("/autopilot-car-hailing/car/v2/driver/bus/startTakeOrder")
|
||||
// @POST("/mock/268/autopilot-car-hailing/bus/api/startTakeOrder")
|
||||
Observable<BaseData> startTakeOrder(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusOperationStatusRequest request);
|
||||
Observable<BaseData> startTakeOrder(@Header ("appId") String appId,@Header("ticket") String ticket,@Body BusOperationStatusRequest request);
|
||||
|
||||
/**
|
||||
* 收车
|
||||
@@ -106,7 +106,7 @@ public interface IOchBusApiService {
|
||||
// @POST("/autopilot-car-hailing/car/v2/bus/stopTakeOrder")
|
||||
@POST("/autopilot-car-hailing/car/v2/driver/bus/stopTakeOrder")
|
||||
// @POST("/mock/268/autopilot-car-hailing/bus/api/stopTakeOrder")
|
||||
Observable<BaseData> stopTakeOrder(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusOperationStatusRequest request);
|
||||
Observable<BaseData> stopTakeOrder(@Header ("appId") String appId,@Header("ticket") String ticket,@Body BusOperationStatusRequest request);
|
||||
|
||||
/**
|
||||
* 查询小巴出车/收车状态
|
||||
@@ -117,13 +117,13 @@ public interface IOchBusApiService {
|
||||
// @GET("/autopilot-car-hailing/car/v2/bus/takeOrderStatus/query")
|
||||
@GET("/autopilot-car-hailing/car/v2/driver/bus/takeOrderStatus/query")
|
||||
// @GET("/mock/268/autopilot-car-hailing/bus/api/takeOrderStatus/query")
|
||||
Observable<OchBusOperationStatusResponse> queryOperationStatus(@Header ("appId") String appId,@Header("ticket") String ticket,@Query("sn") String sn);
|
||||
Observable<BusOperationStatusResponse> queryOperationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
// @GET("/autopilot-car-hailing/order/v2/bus/servicingOrders/query")
|
||||
@GET("/autopilot-car-hailing/order/v2/driver/bus/servicingOrders/query")
|
||||
// @GET("/mock/268/autopilot-car-hailing/bus/api/servicingOrders/query")
|
||||
Observable<OchBusOrdersResponse> queryBusOrders(@Header ("appId") String appId,@Header("ticket") String ticket,@Query("sn") String sn);
|
||||
Observable<BusOrdersResponse> queryBusOrders(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
/**
|
||||
* 车机端上传心跳数据(只在出车状态时上传):包含高德坐标系经纬度
|
||||
@@ -4,7 +4,7 @@ package com.mogo.och.bus.net;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/20
|
||||
*/
|
||||
public interface OCHServiceCallback< T >{
|
||||
public interface IBusServiceCallback< T >{
|
||||
void onSuccess(T o);
|
||||
|
||||
void onFail(String failMsg);
|
||||
@@ -5,40 +5,40 @@ import android.content.Context;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.bean.OchBusRoutesResponse;
|
||||
import com.mogo.och.bus.callback.BusLinesCallback;
|
||||
import com.mogo.och.bus.net.OCHBusServiceManager;
|
||||
import com.mogo.och.bus.net.OCHServiceCallback;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
import com.mogo.och.bus.callback.IBusLinesCallback;
|
||||
import com.mogo.och.bus.net.BusServiceManager;
|
||||
import com.mogo.och.bus.net.IBusServiceCallback;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/2/9
|
||||
*/
|
||||
public class OchBusLineModel {
|
||||
private static volatile OchBusLineModel sInstance;
|
||||
public class BusLineModel {
|
||||
private static volatile BusLineModel sInstance;
|
||||
private Context mContext;
|
||||
private BusLinesCallback mBusLinesCallback;
|
||||
public static OchBusLineModel getInstance() {
|
||||
private IBusLinesCallback mBusLinesCallback;
|
||||
public static BusLineModel getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( OchBusLineModel.class ) {
|
||||
synchronized ( BusLineModel.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new OchBusLineModel();
|
||||
sInstance = new BusLineModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
private OchBusLineModel() {
|
||||
private BusLineModel() {
|
||||
|
||||
}
|
||||
public void init() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
}
|
||||
public void setBusLinesCallback(BusLinesCallback callback){
|
||||
public void setBusLinesCallback(IBusLinesCallback callback){
|
||||
mBusLinesCallback = callback;
|
||||
}
|
||||
public void queryBusLines(){
|
||||
OCHBusServiceManager.getInstance().queryBusLines(mContext, new OCHServiceCallback<BusQueryLinesResponse>() {
|
||||
BusServiceManager.getInstance().queryBusLines(mContext, new IBusServiceCallback<BusQueryLinesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(BusQueryLinesResponse data) {
|
||||
if (null == data && mBusLinesCallback != null) {
|
||||
@@ -59,9 +59,9 @@ public class OchBusLineModel {
|
||||
}
|
||||
|
||||
public void commitSwitchLineId(int lineId){
|
||||
OCHBusServiceManager.getInstance().resetStationStatus(mContext,lineId, new OCHServiceCallback<OchBusRoutesResponse>() {
|
||||
BusServiceManager.getInstance().resetStationStatus(mContext,lineId, new IBusServiceCallback<BusRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(OchBusRoutesResponse o) {
|
||||
public void onSuccess(BusRoutesResponse o) {
|
||||
if (mBusLinesCallback != null){
|
||||
mBusLinesCallback.onChangeLineIdSuccess();
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.mogo.och.bus.presenter;
|
||||
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.callback.IBusLinesCallback;
|
||||
import com.mogo.och.bus.ui.BusSwitchLineView;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/2/9
|
||||
*/
|
||||
public class BusLinePresenter extends Presenter<BusSwitchLineView> implements IBusLinesCallback {
|
||||
|
||||
public BusLinePresenter(BusSwitchLineView view) {
|
||||
super(view);
|
||||
BusLineModel.getInstance().init();
|
||||
BusOrderModel.getInstance().init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@NonNull LifecycleOwner owner) {
|
||||
super.onCreate(owner);
|
||||
initListener();
|
||||
}
|
||||
|
||||
private void initListener() {
|
||||
BusLineModel.getInstance().setBusLinesCallback(this);
|
||||
}
|
||||
|
||||
private void runOnUIThread( Runnable executor ) {
|
||||
if ( executor == null ) {
|
||||
return;
|
||||
}
|
||||
if ( Looper.myLooper() != Looper.getMainLooper() ) {
|
||||
UiThreadHandler.post( executor );
|
||||
} else {
|
||||
executor.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBusLinesChange(BusQueryLinesResponse lines) {
|
||||
runOnUIThread(() -> mView.onBusLinesChange(lines));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeLineIdSuccess() {
|
||||
runOnUIThread(() -> mView.onChangeLineIdSuccess());
|
||||
}
|
||||
|
||||
public void queryBusLines(){
|
||||
BusLineModel.getInstance().queryBusLines();
|
||||
}
|
||||
|
||||
public void commitSwitchLineId(int lineId){
|
||||
BusLineModel.getInstance().commitSwitchLineId(lineId);
|
||||
}
|
||||
|
||||
public void queryBusRoutes(){
|
||||
BusOrderModel.getInstance().queryBusRoutes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(@NonNull LifecycleOwner owner) {
|
||||
super.onDestroy(owner);
|
||||
BusLineModel.getInstance().setBusLinesCallback(null);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package com.mogo.och.bus.presenter;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.constant.OchBusConst;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -17,15 +17,15 @@ import io.reactivex.schedulers.Schedulers;
|
||||
*
|
||||
* 管理轮询逻辑(订单轮询、新单轮询、新单抢单结果轮询等等)
|
||||
*/
|
||||
public class OchBusModelLoopManager {
|
||||
public class BusModelLoopManager {
|
||||
|
||||
private static final String TAG = OchBusModelLoopManager.class.getSimpleName();
|
||||
private static final String TAG = BusModelLoopManager.class.getSimpleName();
|
||||
|
||||
private static final class SingletonHolder {
|
||||
private static final OchBusModelLoopManager INSTANCE = new OchBusModelLoopManager();
|
||||
private static final BusModelLoopManager INSTANCE = new BusModelLoopManager();
|
||||
}
|
||||
|
||||
public static OchBusModelLoopManager getInstance() {
|
||||
public static BusModelLoopManager getInstance() {
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
@@ -36,12 +36,12 @@ public class OchBusModelLoopManager {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_BUS + TAG, "startHeartbeatLoop()");
|
||||
mHeartbeatDisposable = Observable.interval(OchBusConst.LOOP_DELAY,
|
||||
OchBusConst.LOOP_PERIOD_60S, TimeUnit.MILLISECONDS)
|
||||
mHeartbeatDisposable = Observable.interval(BusConst.LOOP_DELAY,
|
||||
BusConst.LOOP_PERIOD_60S, TimeUnit.MILLISECONDS)
|
||||
.map((aLong -> aLong + 1))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> OchBusOrderModel.getInstance().runCarHeartbeat());
|
||||
.subscribe(aLong -> BusOrderModel.getInstance().runCarHeartbeat());
|
||||
}
|
||||
|
||||
public void stopHeartbeatLoop() {
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.och.bus.presenter;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
import static com.mogo.och.bus.constant.OchBusConst.STATION_STATUS_STOPPED;
|
||||
import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_STOPPED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.location.Location;
|
||||
@@ -24,21 +24,21 @@ import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.bus.bean.OchBusOperationStatusResponse;
|
||||
import com.mogo.och.bus.bean.OchBusOrder;
|
||||
import com.mogo.och.bus.bean.OchBusOrdersResponse;
|
||||
import com.mogo.och.bus.bean.OchBusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.OchBusRoutesResult;
|
||||
import com.mogo.och.bus.bean.OchBusStation;
|
||||
import com.mogo.och.bus.bean.BusOperationStatusResponse;
|
||||
import com.mogo.och.bus.bean.BusOrderBean;
|
||||
import com.mogo.och.bus.bean.BusOrdersResponse;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.BusRoutesResult;
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersResponse;
|
||||
import com.mogo.och.bus.callback.CarOperationStatusCallback;
|
||||
import com.mogo.och.bus.callback.IOCHBusControllerStatusCallback;
|
||||
import com.mogo.och.bus.callback.RefreshBusStationsCallback;
|
||||
import com.mogo.och.bus.callback.SlidePannelHideCallback;
|
||||
import com.mogo.och.bus.constant.OchBusConst;
|
||||
import com.mogo.och.bus.net.OCHBusServiceManager;
|
||||
import com.mogo.och.bus.net.OCHServiceCallback;
|
||||
import com.mogo.och.bus.util.OchBusAnalyticsUtil;
|
||||
import com.mogo.och.bus.callback.ICarOperationStatusCallback;
|
||||
import com.mogo.och.bus.callback.IBusControllerStatusCallback;
|
||||
import com.mogo.och.bus.callback.IRefreshBusStationsCallback;
|
||||
import com.mogo.och.bus.callback.ISlidePannelHideCallback;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.net.BusServiceManager;
|
||||
import com.mogo.och.bus.net.IBusServiceCallback;
|
||||
import com.mogo.och.bus.util.BusAnalyticsUtil;
|
||||
import com.mogo.och.bus.util.PinYinUtil;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
@@ -63,8 +63,8 @@ import mogo.telematics.pad.MessagePad;
|
||||
*
|
||||
* 小巴订单管理
|
||||
*/
|
||||
public class OchBusOrderModel {
|
||||
private final String TAG = OchBusOrderModel.class.getSimpleName();
|
||||
public class BusOrderModel {
|
||||
private final String TAG = BusOrderModel.class.getSimpleName();
|
||||
private int currentLineId = -1;
|
||||
private int currentStationIndex = 0; //因为服务端和前台对于当前站不一致,所以设置两个current index, 一个用于前台展示, 一个用于服务端接口请求
|
||||
private int backgroundCurrentStationIndex = 0;//A->B 此处值是A站点索引
|
||||
@@ -72,14 +72,14 @@ public class OchBusOrderModel {
|
||||
* 运营状态、后端更具运营状态来判断车辆是否派单
|
||||
*/
|
||||
private boolean mIsWorking = false;
|
||||
private static volatile OchBusOrderModel sInstance;
|
||||
private static volatile BusOrderModel sInstance;
|
||||
public double mLongitude = 0;
|
||||
public double mLatitude = 0;
|
||||
private Context mContext;
|
||||
private Disposable mBusOrdersDisposable; //定时轮询小巴车订单
|
||||
private List<String> prevBusOrderNos = new ArrayList<>();
|
||||
private final List< OchBusStation > stationList = new ArrayList<>();
|
||||
private OchBusRoutesResult ochBusRoutesResult = null;
|
||||
private final List<BusStationBean> stationList = new ArrayList<>();
|
||||
private BusRoutesResult busRoutesResult = null;
|
||||
/**
|
||||
* 用来表示是否正在开往下一站
|
||||
*/
|
||||
@@ -89,10 +89,10 @@ public class OchBusOrderModel {
|
||||
private static final int MSG_QUERY_BUS_STATION = 1001;
|
||||
private static final long QUERY_BUS_STATION_DELAY = 5000;
|
||||
|
||||
private CarOperationStatusCallback carOperationStatusCallback;
|
||||
private RefreshBusStationsCallback refreshBusStationsCallback;
|
||||
private SlidePannelHideCallback slidePannelHideCallback;
|
||||
private IOCHBusControllerStatusCallback mControllerStatusCallback; //Model->Presenter:VR mode等
|
||||
private ICarOperationStatusCallback carOperationStatusCallback;
|
||||
private IRefreshBusStationsCallback refreshBusStationsCallback;
|
||||
private ISlidePannelHideCallback slidePannelHideCallback;
|
||||
private IBusControllerStatusCallback mControllerStatusCallback; //Model->Presenter:VR mode等
|
||||
|
||||
private boolean hadQueryLeaveAwayPassager = false;
|
||||
|
||||
@@ -100,25 +100,25 @@ public class OchBusOrderModel {
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
if ( msg.what == MSG_QUERY_BUS_STATION ) {
|
||||
OchBusOrderModel.getInstance().queryBusRoutes();
|
||||
BusOrderModel.getInstance().queryBusRoutes();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
public static OchBusOrderModel getInstance() {
|
||||
public static BusOrderModel getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( OchBusOrderModel.class ) {
|
||||
synchronized ( BusOrderModel.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new OchBusOrderModel();
|
||||
sInstance = new BusOrderModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private OchBusOrderModel() {
|
||||
private BusOrderModel() {
|
||||
|
||||
}
|
||||
|
||||
@@ -178,19 +178,19 @@ public class OchBusOrderModel {
|
||||
startLoopBusOrders();
|
||||
}
|
||||
|
||||
public void setCarOperationStatusCallback(CarOperationStatusCallback callback){
|
||||
public void setCarOperationStatusCallback(ICarOperationStatusCallback callback){
|
||||
this.carOperationStatusCallback = callback;
|
||||
}
|
||||
|
||||
public void setRefreshBusStationsCallback(RefreshBusStationsCallback callback){
|
||||
public void setRefreshBusStationsCallback(IRefreshBusStationsCallback callback){
|
||||
this.refreshBusStationsCallback = callback;
|
||||
}
|
||||
|
||||
public void setSlidePannelHideCallback(SlidePannelHideCallback callback){
|
||||
public void setSlidePannelHideCallback(ISlidePannelHideCallback callback){
|
||||
this.slidePannelHideCallback = callback;
|
||||
}
|
||||
|
||||
public void setControllerStatusCallback(IOCHBusControllerStatusCallback callback) {
|
||||
public void setControllerStatusCallback(IBusControllerStatusCallback callback) {
|
||||
this.mControllerStatusCallback = callback;
|
||||
}
|
||||
|
||||
@@ -201,8 +201,8 @@ public class OchBusOrderModel {
|
||||
if (mBusOrdersDisposable != null && !mBusOrdersDisposable.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
mBusOrdersDisposable = Observable.interval(OchBusConst.LOOP_DELAY,
|
||||
OchBusConst.LOOP_PERIOD_1S, TimeUnit.MILLISECONDS)
|
||||
mBusOrdersDisposable = Observable.interval(BusConst.LOOP_DELAY,
|
||||
BusConst.LOOP_PERIOD_1S, TimeUnit.MILLISECONDS)
|
||||
.map((aLong -> aLong + 1))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@@ -210,14 +210,14 @@ public class OchBusOrderModel {
|
||||
}
|
||||
|
||||
private void queryBusOrders() {
|
||||
OCHBusServiceManager.getInstance().queryBusOrders(mContext, new OCHServiceCallback<OchBusOrdersResponse>() {
|
||||
BusServiceManager.getInstance().queryBusOrders(mContext, new IBusServiceCallback<BusOrdersResponse>() {
|
||||
@Override
|
||||
public void onSuccess(OchBusOrdersResponse o) {
|
||||
public void onSuccess(BusOrdersResponse o) {
|
||||
if (o.data != null && o.data.orders != null && o.data.orders.size() > 0) {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "获取到bus订单数据: " + o.data.orders.toString() );
|
||||
List<OchBusOrder> busOrders = o.data.orders;
|
||||
List<BusOrderBean> busOrders = o.data.orders;
|
||||
for (int i = 0; i < busOrders.size(); i++) {
|
||||
OchBusOrder order = busOrders.get(i);
|
||||
BusOrderBean order = busOrders.get(i);
|
||||
if (order == null) return;
|
||||
if (TextUtils.isEmpty(order.getPassengerPhone())) return;
|
||||
if (prevBusOrderNos.contains(order.getOrderNo())) continue;
|
||||
@@ -300,9 +300,9 @@ public class OchBusOrderModel {
|
||||
*/
|
||||
public void queryBusRoutes() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "查询小巴路线");
|
||||
OCHBusServiceManager.getInstance().queryBusRoutes(mContext, new OCHServiceCallback<OchBusRoutesResponse>() {
|
||||
BusServiceManager.getInstance().queryBusRoutes(mContext, new IBusServiceCallback<BusRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(OchBusRoutesResponse data) {
|
||||
public void onSuccess(BusRoutesResponse data) {
|
||||
if ( data == null
|
||||
|| data.getResult() == null
|
||||
|| data.getResult().getSites() == null
|
||||
@@ -326,10 +326,10 @@ public class OchBusOrderModel {
|
||||
*/
|
||||
public void debugResetStationStatus() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "测试、重置站点状态");
|
||||
OCHBusServiceManager.getInstance().resetStationStatus(mContext, currentLineId
|
||||
, new OCHServiceCallback<OchBusRoutesResponse>() {
|
||||
BusServiceManager.getInstance().resetStationStatus(mContext, currentLineId
|
||||
, new IBusServiceCallback<BusRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(OchBusRoutesResponse o) {
|
||||
public void onSuccess(BusRoutesResponse o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + o);
|
||||
isGoingToNextStation = false;
|
||||
if (o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty()) {
|
||||
@@ -352,10 +352,10 @@ public class OchBusOrderModel {
|
||||
*/
|
||||
public void leaveStation(boolean isOneWayOver,boolean isRestart){
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"leaveStation-backgroundCurrentStationIndex = "+backgroundCurrentStationIndex);
|
||||
OCHBusServiceManager.getInstance().leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq()
|
||||
, stationList.get(backgroundCurrentStationIndex).getSiteId(), new OCHServiceCallback<OchBusRoutesResponse>() {
|
||||
BusServiceManager.getInstance().leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq()
|
||||
, stationList.get(backgroundCurrentStationIndex).getSiteId(), new IBusServiceCallback<BusRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(OchBusRoutesResponse o) {
|
||||
public void onSuccess(BusRoutesResponse o) {
|
||||
if ( o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
@@ -386,7 +386,7 @@ public class OchBusOrderModel {
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染
|
||||
*/
|
||||
private void RenderLeaveStationSuccess(OchBusRoutesResult result,boolean isRestart) {
|
||||
private void RenderLeaveStationSuccess(BusRoutesResult result, boolean isRestart) {
|
||||
renderBusStationsStatus(result);
|
||||
if (slidePannelHideCallback != null) {
|
||||
slidePannelHideCallback.hideSlidePanel();
|
||||
@@ -406,8 +406,8 @@ public class OchBusOrderModel {
|
||||
* @param isRestart
|
||||
*/
|
||||
private void startAutopilot(boolean isRestart) {
|
||||
OchBusStation currentStation = stationList.get( currentStationIndex -1);
|
||||
OchBusStation nextStation = stationList.get( currentStationIndex);
|
||||
BusStationBean currentStation = stationList.get( currentStationIndex -1);
|
||||
BusStationBean nextStation = stationList.get( currentStationIndex);
|
||||
|
||||
// if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE
|
||||
// == CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()) {
|
||||
@@ -438,9 +438,9 @@ public class OchBusOrderModel {
|
||||
*/
|
||||
private void arriveSiteStation(boolean isRestart) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation-currentStationIndex = "+currentStationIndex);
|
||||
OCHBusServiceManager.getInstance().arriveSiteStation(mContext
|
||||
BusServiceManager.getInstance().arriveSiteStation(mContext
|
||||
, stationList.get(currentStationIndex).getSeq(), stationList.get(currentStationIndex).getSiteId()
|
||||
, new OCHServiceCallback<BaseData>() {
|
||||
, new IBusServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation success");
|
||||
@@ -459,7 +459,7 @@ public class OchBusOrderModel {
|
||||
}
|
||||
|
||||
private void renderArriveBusStation() {
|
||||
List< OchBusStation > site = ochBusRoutesResult.getSites();
|
||||
List<BusStationBean> site = busRoutesResult.getSites();
|
||||
if (site != null && site.size() > 0){
|
||||
backgroundCurrentStationIndex = currentStationIndex;
|
||||
if (refreshBusStationsCallback != null){
|
||||
@@ -475,9 +475,9 @@ public class OchBusOrderModel {
|
||||
private void queryStationLeaveAwayPassengers() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "查询到站下车乘客");
|
||||
|
||||
OCHBusServiceManager.getInstance().queryStationLeaveAwayPassengers(mContext
|
||||
BusServiceManager.getInstance().queryStationLeaveAwayPassengers(mContext
|
||||
, stationList.get(currentStationIndex).getSeq(), stationList.get(currentStationIndex).getSiteId()
|
||||
, new OCHServiceCallback<QueryLeaveAwayPassengersResponse>() {
|
||||
, new IBusServiceCallback<QueryLeaveAwayPassengersResponse>() {
|
||||
@Override
|
||||
public void onSuccess(QueryLeaveAwayPassengersResponse o) {
|
||||
hadQueryLeaveAwayPassager = true;
|
||||
@@ -498,7 +498,7 @@ public class OchBusOrderModel {
|
||||
* 收车
|
||||
*/
|
||||
public void stopTakeOrder(){
|
||||
OCHBusServiceManager.getInstance().stopTakeOrder(mContext, new OCHServiceCallback<BaseData>() {
|
||||
BusServiceManager.getInstance().stopTakeOrder(mContext, new IBusServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
mIsWorking = !mIsWorking;
|
||||
@@ -520,7 +520,7 @@ public class OchBusOrderModel {
|
||||
* 出车
|
||||
*/
|
||||
public void startTakeOrder(){
|
||||
OCHBusServiceManager.getInstance().startTakeOrder(mContext, new OCHServiceCallback<BaseData>() {
|
||||
BusServiceManager.getInstance().startTakeOrder(mContext, new IBusServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
mIsWorking = !mIsWorking;
|
||||
@@ -548,10 +548,10 @@ public class OchBusOrderModel {
|
||||
*/
|
||||
public void queryOperationStatus() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "查询运营状态");
|
||||
OCHBusServiceManager.getInstance().queryOperationStatus(mContext
|
||||
, new OCHServiceCallback<OchBusOperationStatusResponse>() {
|
||||
BusServiceManager.getInstance().queryOperationStatus(mContext
|
||||
, new IBusServiceCallback<BusOperationStatusResponse>() {
|
||||
@Override
|
||||
public void onSuccess(OchBusOperationStatusResponse o) {
|
||||
public void onSuccess(BusOperationStatusResponse o) {
|
||||
if ( o.data != null ) {
|
||||
mIsWorking = o.data.serviceStatus == 1;
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "查询运营状态 result.status: " + o.data.serviceStatus);
|
||||
@@ -586,15 +586,15 @@ public class OchBusOrderModel {
|
||||
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理current index,不能直接渲染
|
||||
* @param result
|
||||
*/
|
||||
private void renderBusStationsStatus(OchBusRoutesResult result) {
|
||||
private void renderBusStationsStatus(BusRoutesResult result) {
|
||||
if (result == null) return;
|
||||
ochBusRoutesResult = result;
|
||||
List< OchBusStation > site = result.getSites();
|
||||
busRoutesResult = result;
|
||||
List<BusStationBean> site = result.getSites();
|
||||
currentLineId = result.getLineId();
|
||||
stationList.clear();
|
||||
stationList.addAll( site );
|
||||
for ( int i = 0; i < stationList.size(); i++ ) {
|
||||
OchBusStation s = stationList.get( i );
|
||||
BusStationBean s = stationList.get( i );
|
||||
// 是否正在开往下一站
|
||||
if ( s.isLeaving()) {
|
||||
isGoingToNextStation = true;
|
||||
@@ -606,7 +606,7 @@ public class OchBusOrderModel {
|
||||
}
|
||||
}
|
||||
backgroundCurrentStationIndex = currentStationIndex;
|
||||
OchBusStation currentStation = stationList.get(currentStationIndex);
|
||||
BusStationBean currentStation = stationList.get(currentStationIndex);
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "渲染站点信息服务端currentStationIndex="+currentStationIndex
|
||||
+" isLeaving()="+currentStation.isLeaving());
|
||||
//当前站点是始发站,告诉服务端到达始发站。 如果没有这个节点, 服务器不知道始发站到达状态
|
||||
@@ -802,8 +802,8 @@ public class OchBusOrderModel {
|
||||
|
||||
// 车机端上传心跳数据(只在出车状态时上传)
|
||||
public void runCarHeartbeat() {
|
||||
OCHBusServiceManager.getInstance().runCarHeartbeat(mContext, mLongitude, mLatitude,
|
||||
new OCHServiceCallback<BaseData>() {
|
||||
BusServiceManager.getInstance().runCarHeartbeat(mContext, mLongitude, mLatitude,
|
||||
new IBusServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData data) {
|
||||
|
||||
@@ -819,9 +819,9 @@ public class OchBusOrderModel {
|
||||
private void startOrStopOrderLoop(boolean start) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "startOrStopOrderLoop() " + start);
|
||||
if (start) {
|
||||
OchBusModelLoopManager.getInstance().startHeartbeatLoop();
|
||||
BusModelLoopManager.getInstance().startHeartbeatLoop();
|
||||
} else {
|
||||
OchBusModelLoopManager.getInstance().stopHeartbeatLoop();
|
||||
BusModelLoopManager.getInstance().stopHeartbeatLoop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -829,9 +829,9 @@ public class OchBusOrderModel {
|
||||
if (stationList == null || currentStationIndex >= stationList.size()) {
|
||||
return;
|
||||
}
|
||||
OchBusStation currentStation = stationList.get( currentStationIndex -1);
|
||||
OchBusStation nextStation = stationList.get( currentStationIndex);
|
||||
OchBusAnalyticsUtil.triggerStartServiceEvent(send,
|
||||
BusStationBean currentStation = stationList.get( currentStationIndex -1);
|
||||
BusStationBean nextStation = stationList.get( currentStationIndex);
|
||||
BusAnalyticsUtil.triggerStartServiceEvent(send,
|
||||
currentStation.getName(), nextStation.getName(), currentLineId);
|
||||
}
|
||||
}
|
||||
@@ -15,12 +15,12 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.bus.bean.OchBusStation;
|
||||
import com.mogo.och.bus.callback.CarOperationStatusCallback;
|
||||
import com.mogo.och.bus.callback.IOCHBusControllerStatusCallback;
|
||||
import com.mogo.och.bus.callback.RefreshBusStationsCallback;
|
||||
import com.mogo.och.bus.callback.SlidePannelHideCallback;
|
||||
import com.mogo.och.bus.fragment.OchBusFragment;
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
import com.mogo.och.bus.callback.ICarOperationStatusCallback;
|
||||
import com.mogo.och.bus.callback.IBusControllerStatusCallback;
|
||||
import com.mogo.och.bus.callback.IRefreshBusStationsCallback;
|
||||
import com.mogo.och.bus.callback.ISlidePannelHideCallback;
|
||||
import com.mogo.och.bus.fragment.BusFragment;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -35,119 +35,116 @@ import mogo_msg.MogoReportMsg;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class OchBusPresenter extends Presenter<OchBusFragment>
|
||||
implements CarOperationStatusCallback, RefreshBusStationsCallback, SlidePannelHideCallback
|
||||
, IMoGoAutopilotStatusListener, IOCHBusControllerStatusCallback {
|
||||
public class BusPresenter extends Presenter<BusFragment>
|
||||
implements ICarOperationStatusCallback, IRefreshBusStationsCallback, ISlidePannelHideCallback
|
||||
, IMoGoAutopilotStatusListener, IBusControllerStatusCallback {
|
||||
|
||||
private static final String TAG = "OchBusPresenter";
|
||||
private static final String TAG = "BusPresenter";
|
||||
|
||||
private int currentAutopilotStatus = -1;
|
||||
private boolean isAnimateRunning = false;
|
||||
private List<OchBusStation> mStationList = new ArrayList<>();
|
||||
private List<BusStationBean> mStationList = new ArrayList<>();
|
||||
private int mCurrentStation = 0;
|
||||
|
||||
public OchBusPresenter(OchBusFragment view) {
|
||||
public BusPresenter(BusFragment view) {
|
||||
super(view);
|
||||
//2021.11.1 鹰眼架构整合,由IMoGoAutopilotStatusListener逐步替代IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
|
||||
OchBusOrderModel.getInstance().init();
|
||||
BusOrderModel.getInstance().init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@NonNull LifecycleOwner owner) {
|
||||
super.onCreate(owner);
|
||||
OchBusOrderModel.getInstance().queryOperationStatus();
|
||||
OchBusOrderModel.getInstance().queryBusRoutes();
|
||||
BusOrderModel.getInstance().queryOperationStatus();
|
||||
BusOrderModel.getInstance().queryBusRoutes();
|
||||
initModelListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(@NonNull LifecycleOwner owner) {
|
||||
super.onDestroy(owner);
|
||||
OchBusOrderModel.getInstance().release();
|
||||
BusOrderModel.getInstance().release();
|
||||
releaseListener();
|
||||
}
|
||||
|
||||
public void initModelListener() {
|
||||
OchBusOrderModel.getInstance().setCarOperationStatusCallback(this);
|
||||
OchBusOrderModel.getInstance().setRefreshBusStationsCallback(this);
|
||||
OchBusOrderModel.getInstance().setSlidePannelHideCallback(this);
|
||||
OchBusOrderModel.getInstance().setControllerStatusCallback(this);
|
||||
BusOrderModel.getInstance().setCarOperationStatusCallback(this);
|
||||
BusOrderModel.getInstance().setRefreshBusStationsCallback(this);
|
||||
BusOrderModel.getInstance().setSlidePannelHideCallback(this);
|
||||
BusOrderModel.getInstance().setControllerStatusCallback(this);
|
||||
}
|
||||
|
||||
public void releaseListener() {
|
||||
OchBusOrderModel.getInstance().setCarOperationStatusCallback(null);
|
||||
OchBusOrderModel.getInstance().setRefreshBusStationsCallback(null);
|
||||
OchBusOrderModel.getInstance().setSlidePannelHideCallback(null);
|
||||
OchBusOrderModel.getInstance().setControllerStatusCallback(null);
|
||||
BusOrderModel.getInstance().setCarOperationStatusCallback(null);
|
||||
BusOrderModel.getInstance().setRefreshBusStationsCallback(null);
|
||||
BusOrderModel.getInstance().setSlidePannelHideCallback(null);
|
||||
BusOrderModel.getInstance().setControllerStatusCallback(null);
|
||||
}
|
||||
|
||||
public void queryBusRoutes() {
|
||||
OchBusOrderModel.getInstance().queryBusRoutes();
|
||||
BusOrderModel.getInstance().queryBusRoutes();
|
||||
}
|
||||
|
||||
public void debugResetStationStatus() {
|
||||
OchBusOrderModel.getInstance().debugResetStationStatus();
|
||||
BusOrderModel.getInstance().debugResetStationStatus();
|
||||
}
|
||||
|
||||
public void autoDriveToNextStation(boolean isRestart) {
|
||||
currentAutopilotStatus = -1;
|
||||
OchBusOrderModel.getInstance().autoDriveToNextStation(isRestart);
|
||||
BusOrderModel.getInstance().autoDriveToNextStation(isRestart);
|
||||
}
|
||||
|
||||
public void restartAutopilot() {
|
||||
currentAutopilotStatus = -1;
|
||||
OchBusOrderModel.getInstance().restartAutopilot();
|
||||
BusOrderModel.getInstance().restartAutopilot();
|
||||
}
|
||||
|
||||
public void onChangeOperationStatus() {
|
||||
OchBusOrderModel.getInstance().onChangeOperationStatus();
|
||||
BusOrderModel.getInstance().onChangeOperationStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeOperationStatus(boolean changeStatus) {
|
||||
if (mView != null) {
|
||||
mView.changeOperationStatus(changeStatus);
|
||||
runOnUIThread(() -> mView.changeOperationStatus(changeStatus));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshBusStations(List<OchBusStation> stationList, int currentStation, int nextStation, boolean isArrived) {
|
||||
public void refreshBusStations(List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived) {
|
||||
mStationList.clear();
|
||||
mStationList.addAll(stationList);
|
||||
mCurrentStation = currentStation;
|
||||
functionDemoModeChange();
|
||||
CallerLogger.INSTANCE.d(M_BUS + "OchBusOrderModel =", " mCurrentStation =" + mCurrentStation);
|
||||
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel =", " mCurrentStation =" + mCurrentStation);
|
||||
if (mView != null) {
|
||||
mView.refreshBusStations(stationList, currentStation, nextStation, isArrived);
|
||||
runOnUIThread(() -> mView.refreshBusStations(
|
||||
stationList, currentStation, nextStation, isArrived));
|
||||
}
|
||||
}
|
||||
|
||||
private void functionDemoModeChange() {
|
||||
// CallerLogger.INSTANCE.d(M_BUS + "OchBusOrderModel ="," functionDemoModeChange ="+mCurrentStation);
|
||||
// CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel ="," functionDemoModeChange ="+mCurrentStation);
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& (
|
||||
(mCurrentStation > 0 && mCurrentStation < mStationList.size() - 1)
|
||||
|| (
|
||||
(mCurrentStation == 0 || mCurrentStation == mStationList.size() - 1)
|
||||
&& OchBusOrderModel.getInstance().isGoingToNextStation()
|
||||
)
|
||||
)
|
||||
) {
|
||||
mView.onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING, false);
|
||||
&& ((mCurrentStation > 0 && mCurrentStation < mStationList.size() - 1)
|
||||
|| ((mCurrentStation == 0 || mCurrentStation == mStationList.size() - 1)
|
||||
&& BusOrderModel.getInstance().isGoingToNextStation()))) {
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING, false));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideSlidePanel() {
|
||||
if (mView != null) {
|
||||
mView.hideSlidePanel();
|
||||
runOnUIThread(() -> mView.hideSlidePanel());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(MessagePad.ArrivalNotification arrivalNotification) {
|
||||
OchBusOrderModel.getInstance().onArriveAt(arrivalNotification);
|
||||
BusOrderModel.getInstance().onArriveAt(arrivalNotification);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -168,24 +165,24 @@ public class OchBusPresenter extends Presenter<OchBusFragment>
|
||||
}
|
||||
currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE;
|
||||
// 设置UI【自动驾驶】按钮是否展示
|
||||
mView.onAutopilotEnableChange(true);
|
||||
if (OchBusOrderModel.getInstance().isGoingToNextStation()) {
|
||||
mView.hideSlidePanel();
|
||||
runOnUIThread(() -> mView.onAutopilotEnableChange(true));
|
||||
if (BusOrderModel.getInstance().isGoingToNextStation()) {
|
||||
runOnUIThread(() -> mView.hideSlidePanel());
|
||||
}
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& (
|
||||
(mCurrentStation > 0 && mCurrentStation < mStationList.size() - 1)
|
||||
|| (
|
||||
(mCurrentStation == 0 || mCurrentStation == mStationList.size() - 1)
|
||||
&& OchBusOrderModel.getInstance().isGoingToNextStation()
|
||||
&& BusOrderModel.getInstance().isGoingToNextStation()
|
||||
)
|
||||
)
|
||||
) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + "OchBusOrderModel=", "有美化功能");
|
||||
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能");
|
||||
return;
|
||||
}
|
||||
// 改变UI自动驾驶状态
|
||||
mView.onAutopilotStatusChanged(currentAutopilotStatus, isAnimateRunning);
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus, isAnimateRunning));
|
||||
}
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
|
||||
@@ -193,8 +190,8 @@ public class OchBusPresenter extends Presenter<OchBusFragment>
|
||||
if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
|
||||
// 改变UI自动驾驶状态
|
||||
mView.onAutopilotStatusChanged(currentAutopilotStatus, isAnimateRunning);
|
||||
OchBusOrderModel.getInstance().triggerStartServiceEvent(true);
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus, isAnimateRunning));
|
||||
BusOrderModel.getInstance().triggerStartServiceEvent(true);
|
||||
}
|
||||
isAnimateRunning = false;
|
||||
break;
|
||||
@@ -209,20 +206,22 @@ public class OchBusPresenter extends Presenter<OchBusFragment>
|
||||
(mCurrentStation > 0 && mCurrentStation < mStationList.size() - 1)
|
||||
|| (
|
||||
(mCurrentStation == 0 || mCurrentStation == mStationList.size() - 1)
|
||||
&& OchBusOrderModel.getInstance().isGoingToNextStation()
|
||||
&& BusOrderModel.getInstance().isGoingToNextStation()
|
||||
)
|
||||
)
|
||||
) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + "OchBusOrderModel=", "有美化功能");
|
||||
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能");
|
||||
return;
|
||||
}
|
||||
mView.onAutopilotEnableChange(false);
|
||||
mView.onAutopilotStatusChanged(currentAutopilotStatus, isAnimateRunning);
|
||||
runOnUIThread(() -> {
|
||||
mView.onAutopilotEnableChange(false);
|
||||
mView.onAutopilotStatusChanged(currentAutopilotStatus, isAnimateRunning);
|
||||
});
|
||||
}
|
||||
isAnimateRunning = false;
|
||||
break;
|
||||
default:
|
||||
mView.onAutopilotEnableChange(false);
|
||||
runOnUIThread(() -> mView.onAutopilotEnableChange(false));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.mogo.och.bus.presenter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.callback.BusLinesCallback;
|
||||
import com.mogo.och.bus.ui.BusSwitchLineActivity;
|
||||
import com.mogo.och.bus.ui.BusSwitchLineView;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/2/9
|
||||
*/
|
||||
public class OchBusLinePresenter extends Presenter<BusSwitchLineView> implements BusLinesCallback {
|
||||
|
||||
public OchBusLinePresenter(BusSwitchLineView view) {
|
||||
super(view);
|
||||
OchBusLineModel.getInstance().init();
|
||||
OchBusOrderModel.getInstance().init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@NonNull LifecycleOwner owner) {
|
||||
super.onCreate(owner);
|
||||
initListener();
|
||||
}
|
||||
|
||||
private void initListener() {
|
||||
OchBusLineModel.getInstance().setBusLinesCallback(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBusLinesChange(BusQueryLinesResponse lines) {
|
||||
mView.onBusLinesChange(lines);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeLineIdSuccess() {
|
||||
mView.onChangeLineIdSuccess();
|
||||
}
|
||||
|
||||
public void queryBusLines(){
|
||||
OchBusLineModel.getInstance().queryBusLines();
|
||||
}
|
||||
|
||||
public void commitSwitchLineId(int lineId){
|
||||
OchBusLineModel.getInstance().commitSwitchLineId(lineId);
|
||||
}
|
||||
|
||||
public void queryBusRoutes(){
|
||||
OchBusOrderModel.getInstance().queryBusRoutes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(@NonNull LifecycleOwner owner) {
|
||||
super.onDestroy(owner);
|
||||
OchBusLineModel.getInstance().setBusLinesCallback(null);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.constant.OchBusConst;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
|
||||
/**
|
||||
* 测试小巴车的场景
|
||||
@@ -15,8 +15,8 @@ import com.mogo.och.bus.constant.OchBusConst;
|
||||
* @author donghongyu
|
||||
* @date 4/26/21 12:08 PM
|
||||
*/
|
||||
public class TestOchBusBroadcastReceiver extends BroadcastReceiver {
|
||||
private static final String TAG = "TestOchBusBroadcastReceiver";
|
||||
public class TestBusBroadcastReceiver extends BroadcastReceiver {
|
||||
private static final String TAG = "TestBusBroadcastReceiver";
|
||||
|
||||
private Context mContext;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class TestOchBusBroadcastReceiver extends BroadcastReceiver {
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
try {
|
||||
this.mContext = context;
|
||||
int sceneType = intent.getIntExtra(OchBusConst.BROADCAST_TEST_BUS_CONTROL_TYPE_EXTRA_KEY, 0);
|
||||
int sceneType = intent.getIntExtra(BusConst.BROADCAST_TEST_BUS_CONTROL_TYPE_EXTRA_KEY, 0);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "sceneType:" + sceneType);
|
||||
|
||||
// 分发场景
|
||||
@@ -23,7 +23,7 @@ import com.mogo.commons.mvp.MvpActivity;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.presenter.OchBusLinePresenter;
|
||||
import com.mogo.och.bus.presenter.BusLinePresenter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/2/8
|
||||
*/
|
||||
public class BusSwitchLineActivity extends MvpActivity<BusSwitchLineView, OchBusLinePresenter>
|
||||
public class BusSwitchLineActivity extends MvpActivity<BusSwitchLineView, BusLinePresenter>
|
||||
implements View.OnClickListener, BusSwitchLineView {
|
||||
|
||||
private ImageView mClose;
|
||||
@@ -50,8 +50,8 @@ public class BusSwitchLineActivity extends MvpActivity<BusSwitchLineView, OchBus
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected OchBusLinePresenter createPresenter() {
|
||||
return new OchBusLinePresenter(this);
|
||||
protected BusLinePresenter createPresenter() {
|
||||
return new BusLinePresenter(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.mogo.eagle.core.data.app.AppConfigInfo;
|
||||
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.bus.constant.OchBusConst;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -18,7 +18,7 @@ import java.util.Map;
|
||||
*
|
||||
* Created on 2022/3/24
|
||||
*/
|
||||
public class OchBusAnalyticsUtil {
|
||||
public class BusAnalyticsUtil {
|
||||
|
||||
/**
|
||||
* 触发'滑动出发'埋点流程:
|
||||
@@ -34,19 +34,19 @@ public class OchBusAnalyticsUtil {
|
||||
System.currentTimeMillis(), DateTimeUtils.yyyy_MM_dd_HH_mm_ss);
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put(OchBusConst.EVENT_PARAM_SN, sn);
|
||||
params.put(OchBusConst.EVENT_PARAM_PLATE_NUM, TextUtils.isEmpty(plateNum) ? "" : plateNum);
|
||||
params.put(OchBusConst.EVENT_PARAM_ENV_ONLINE,
|
||||
params.put(BusConst.EVENT_PARAM_SN, sn);
|
||||
params.put(BusConst.EVENT_PARAM_PLATE_NUM, TextUtils.isEmpty(plateNum) ? "" : plateNum);
|
||||
params.put(BusConst.EVENT_PARAM_ENV_ONLINE,
|
||||
DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE ? true : false);
|
||||
params.put(OchBusConst.EVENT_PARAM_TIME, dateTime);
|
||||
params.put(OchBusConst.EVENT_PARAM_START_NAME, startName);
|
||||
params.put(OchBusConst.EVENT_PARAM_END_NAME, endName);
|
||||
params.put(OchBusConst.EVENT_PARAM_LINE_ID, lineId);
|
||||
params.put(BusConst.EVENT_PARAM_TIME, dateTime);
|
||||
params.put(BusConst.EVENT_PARAM_START_NAME, startName);
|
||||
params.put(BusConst.EVENT_PARAM_END_NAME, endName);
|
||||
params.put(BusConst.EVENT_PARAM_LINE_ID, lineId);
|
||||
|
||||
Runnable runnable = () -> {
|
||||
// 15s内未开启,上报失败埋点
|
||||
params.put(OchBusConst.EVENT_PARAM_START_RESULT, false);
|
||||
AnalyticsManager.INSTANCE.track(OchBusConst.EVENT_KEY_START_SERVICE, params);
|
||||
params.put(BusConst.EVENT_PARAM_START_RESULT, false);
|
||||
AnalyticsManager.INSTANCE.track(BusConst.EVENT_KEY_START_SERVICE, params);
|
||||
};
|
||||
|
||||
if (send) {
|
||||
@@ -54,10 +54,10 @@ public class OchBusAnalyticsUtil {
|
||||
if (runnable != null && UiThreadHandler.getsUiHandler().hasCallbacks(runnable)) {
|
||||
UiThreadHandler.removeCallbacks(runnable);
|
||||
}
|
||||
params.put(OchBusConst.EVENT_PARAM_START_RESULT, true);
|
||||
AnalyticsManager.INSTANCE.track(OchBusConst.EVENT_KEY_START_SERVICE, params);
|
||||
params.put(BusConst.EVENT_PARAM_START_RESULT, true);
|
||||
AnalyticsManager.INSTANCE.track(BusConst.EVENT_KEY_START_SERVICE, params);
|
||||
} else {
|
||||
UiThreadHandler.postDelayed(runnable, OchBusConst.LOOP_PERIOD_15S);
|
||||
UiThreadHandler.postDelayed(runnable, BusConst.LOOP_PERIOD_15S);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import android.location.Location;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
@@ -14,7 +15,6 @@ import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
|
||||
@@ -556,6 +556,11 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
|
||||
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener(){
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp routeList) {
|
||||
if (null != routeList && routeList.getWayPointsList().size() > 0){
|
||||
@@ -564,11 +569,6 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -94,17 +94,20 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
|
||||
@Override
|
||||
public void onAutopilotEnable() {
|
||||
mView.onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE);
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotDisable() {
|
||||
mView.onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE);
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRunning() {
|
||||
mView.onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -141,25 +144,29 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
private void updateOrderView(TaxiPassengerOrderQueryRespBean.Result order) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P+TAG,"updateOrderView = "+order.orderStatus);
|
||||
if (TaxiPassengerOrderStatusEnum.Cancel.getCode() == order.orderStatus){
|
||||
mView.showOrHideServingOrderFragment(false);
|
||||
runOnUIThread(() -> mView.showOrHideServingOrderFragment(false));
|
||||
TaxiPassengerModel.getInstance().recoverNaviInfo();
|
||||
return;
|
||||
}
|
||||
if (TaxiPassengerOrderStatusEnum.ArriveAtStart.getCode() == order.orderStatus
|
||||
|| TaxiPassengerOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus){
|
||||
mView.showOrHideServingOrderFragment(true);
|
||||
runOnUIThread(() -> mView.showOrHideServingOrderFragment(true));
|
||||
return;
|
||||
}
|
||||
if (TaxiPassengerOrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus){
|
||||
TaxiPassengerModel.getInstance().recoverNaviInfo();
|
||||
TaxiPassengerNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi();
|
||||
mView.showOrHideServingOrderFragment(false);
|
||||
mView.showOrHideArrivedEndLayout(true,order.endSiteAddr);
|
||||
runOnUIThread(() -> {
|
||||
mView.showOrHideServingOrderFragment(false);
|
||||
mView.showOrHideArrivedEndLayout(true, order.endSiteAddr);
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (TaxiPassengerOrderStatusEnum.JourneyCompleted.getCode() == order.orderStatus){
|
||||
mView.showOrHideServingOrderFragment(false);
|
||||
mView.showOrHideArrivedEndLayout(false,"");
|
||||
runOnUIThread(() -> {
|
||||
mView.showOrHideServingOrderFragment(false);
|
||||
mView.showOrHideArrivedEndLayout(false, "");
|
||||
});
|
||||
mCurrentPassengerOrder = null;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public class TaxiPassengerMapDirectionView
|
||||
//更新车辆位置
|
||||
if (mCarMarker != null) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "location.getBearing() = " + location.getBearing());
|
||||
mCarMarker.setRotateAngle(location.getBearing());
|
||||
mCarMarker.setRotateAngle(360 - location.getBearing());
|
||||
mCarMarker.setPosition(currentLatLng);
|
||||
mCarMarker.setToTop();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class OCHTaxiOverlayManager {
|
||||
public class TaxiOverlayManager {
|
||||
|
||||
|
||||
private IMogoPolyline mMoGoPolyline;
|
||||
@@ -26,7 +26,7 @@ public class OCHTaxiOverlayManager {
|
||||
private List<Integer> mPolylineColors;
|
||||
private Context mContext;
|
||||
IMogoOverlayManager mogoOverlayManager;
|
||||
public OCHTaxiOverlayManager(Context context) {
|
||||
public TaxiOverlayManager(Context context) {
|
||||
mPolylineOptions = new MogoPolylineOptions();
|
||||
// 绘制路径集合
|
||||
mPolylinePointList = new ArrayList<>();
|
||||
@@ -12,8 +12,8 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.taxi.constant.OCHTaxiConst;
|
||||
import com.mogo.och.taxi.ui.OCHTaxiFragment;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
import com.mogo.och.taxi.ui.TaxiFragment;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
@@ -27,11 +27,11 @@ public
|
||||
* <p>
|
||||
* 网约车-出租车
|
||||
*/
|
||||
@Route( path = OCHTaxiConst.PATH )
|
||||
class MogoOCHTaxi implements IMogoOCH , IMogoStatusChangedListener {
|
||||
@Route( path = TaxiConst.PATH )
|
||||
class TaxiProvider implements IMogoOCH , IMogoStatusChangedListener {
|
||||
|
||||
private static final String TAG = "MogoOCHTaxi";
|
||||
private OCHTaxiFragment ochTaxiFragment;
|
||||
private static final String TAG = "TaxiProvider";
|
||||
private TaxiFragment ochTaxiFragment;
|
||||
private FragmentActivity mActivity;
|
||||
private int mContainerId;
|
||||
@Override
|
||||
@@ -52,7 +52,7 @@ class MogoOCHTaxi implements IMogoOCH , IMogoStatusChangedListener {
|
||||
private void showFragment() {
|
||||
if (ochTaxiFragment == null) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "准备add fragment======");
|
||||
ochTaxiFragment = new OCHTaxiFragment();
|
||||
ochTaxiFragment = new TaxiFragment();
|
||||
mActivity.getSupportFragmentManager().beginTransaction().add(mContainerId, ochTaxiFragment).commitAllowingStateLoss();
|
||||
return;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.taxi.bean;
|
||||
|
||||
import com.mogo.och.taxi.constant.OCHTaxiConst;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -21,6 +21,6 @@ public class CarHeartbeatReqBean {
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
this.msgId = UUID.randomUUID().toString();
|
||||
this.interval = (int) (OCHTaxiConst.LOOP_PERIOD_60S / 1000);
|
||||
this.interval = (int) (TaxiConst.LOOP_PERIOD_60S / 1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,36 +6,36 @@ import androidx.annotation.ColorRes
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/1/21
|
||||
*/
|
||||
interface Shadow {
|
||||
interface IShadow {
|
||||
//设置阴影半径
|
||||
fun setShadowRadius(radius:Float):Shadow
|
||||
fun setShadowRadius(radius:Float):IShadow
|
||||
|
||||
//添加单位设置
|
||||
fun setShadowRadius(unit:Int,radius: Float):Shadow
|
||||
fun setShadowRadius(unit:Int,radius: Float):IShadow
|
||||
|
||||
//设置应用颜色
|
||||
fun setShadowColor(color:Int):Shadow
|
||||
fun setShadowColor(color:Int):IShadow
|
||||
|
||||
//设置阴影颜色资源文件id
|
||||
fun setShadowColorRes(@ColorRes color: Int):Shadow
|
||||
fun setShadowColorRes(@ColorRes color: Int):IShadow
|
||||
/**
|
||||
* 设置模糊半径
|
||||
* @param radius
|
||||
*/
|
||||
fun setBlurRadius(radius:Float):Shadow
|
||||
fun setBlurRadius(radius:Float):IShadow
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unit @{@link android.util.TypedValue#TYPE_DIMENSION}
|
||||
* @param radius 模糊半径
|
||||
*/
|
||||
fun setBlurRadius(unit:Int,radius:Float):Shadow
|
||||
fun setBlurRadius(unit:Int,radius:Float):IShadow
|
||||
|
||||
/**
|
||||
* 设置水平方向的偏移量
|
||||
* @param offset x轴偏移
|
||||
*/
|
||||
fun setXOffset(offset:Float):Shadow
|
||||
fun setXOffset(offset:Float):IShadow
|
||||
|
||||
|
||||
/**
|
||||
@@ -43,20 +43,20 @@ interface Shadow {
|
||||
* @param unit @{@link android.util.TypedValue#TYPE_DIMENSION}
|
||||
* @param offset x轴偏移
|
||||
*/
|
||||
fun setXOffset(unit:Int,offset:Float):Shadow
|
||||
fun setXOffset(unit:Int,offset:Float):IShadow
|
||||
|
||||
/**
|
||||
* 设置竖直方向的偏移量
|
||||
* @param offset y轴偏移
|
||||
*/
|
||||
fun setYOffset(offset:Float):Shadow
|
||||
fun setYOffset(offset:Float):IShadow
|
||||
|
||||
/**
|
||||
* 设置竖直方向的偏移量,带单位
|
||||
* @param unit @{@link android.util.TypedValue#TYPE_DIMENSION}
|
||||
* @param offset y轴偏移
|
||||
*/
|
||||
fun setYOffset(unit:Int,offset:Float):Shadow
|
||||
fun setYOffset(unit:Int,offset:Float):IShadow
|
||||
|
||||
/**
|
||||
* 更新绘制
|
||||
@@ -5,7 +5,7 @@ package com.mogo.och.taxi.callback;
|
||||
*
|
||||
* Model->Presenter回调:ADAS相关(自动驾驶状态回调,到达终点等等)
|
||||
*/
|
||||
public interface IOCHTaxiADASStatusCallback {
|
||||
public interface ITaxiADASStatusCallback {
|
||||
// 自动驾驶触发的已到达目的地:暂未用到
|
||||
void onAutopilotArriveEnd();
|
||||
|
||||
@@ -9,6 +9,6 @@ import mogo.telematics.pad.MessagePad;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/11/1
|
||||
*/
|
||||
public interface IOCHTaxiAutopilotPlanningCallback {
|
||||
public interface ITaxiAutopilotPlanningCallback {
|
||||
void routeResult(List<MessagePad.Location> models);
|
||||
}
|
||||
@@ -5,7 +5,7 @@ package com.mogo.och.taxi.callback;
|
||||
*
|
||||
* Model->Presenter回调:出车/收车状态变更
|
||||
*/
|
||||
public interface IOCHTaxiCarStatusCallback {
|
||||
public interface ITaxiCarStatusCallback {
|
||||
void onCarStatusChanged(boolean inOperation,String role);
|
||||
|
||||
void onServiceDataUpdate(long dailyTimeDuration, long dailyOrderNum);
|
||||
@@ -7,7 +7,7 @@ import android.location.Location;
|
||||
*
|
||||
* Model->Presenter回调:状态控制器监听(accOn、adas ui show、voice ui show、push ui show、v2x ui show等等)
|
||||
*/
|
||||
public interface IOCHTaxiControllerStatusCallback {
|
||||
public interface ITaxiControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
@@ -4,7 +4,7 @@ package com.mogo.och.taxi.callback;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/12/3
|
||||
*/
|
||||
public interface IOCHTaxiNaviChangedCallback {
|
||||
public interface ITaxiNaviChangedCallback {
|
||||
// 当前位置距离上车点的距离(米)、预估时间(秒)
|
||||
void onCurrentNaviDistAndTimeChanged(int meters, long timeInSecond);
|
||||
void reInitNaviAmap(boolean isPlay,boolean isRestart);
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
*
|
||||
* Model->Presenter回调:订单相关(进行中/待服务单变更,当前进行单状态变更,新到预约单,抢单,抢单结果状态等等)
|
||||
*/
|
||||
public interface IOCHTaxiOrderStatusCallback {
|
||||
public interface ITaxiOrderStatusCallback {
|
||||
// 进行中单变更:暂未用到
|
||||
void onOrdersInServiceChanged(@NonNull List<OrderQueryRespBean.Result> inServiceList);
|
||||
// 待服务单变更
|
||||
@@ -5,7 +5,7 @@ import com.mogo.commons.debug.DebugConfig
|
||||
/**
|
||||
* Created on 2021/12/6
|
||||
*/
|
||||
class OCHTaxiConst {
|
||||
class TaxiConst {
|
||||
companion object {
|
||||
|
||||
private const val BASE_URL_OCH_DEV = "http://tech-dev.zhidaohulian.com"
|
||||
@@ -4,7 +4,7 @@ package com.mogo.och.taxi.constant
|
||||
* Created on 2021/12/7
|
||||
* 1 运营, 2 测试, 3演示
|
||||
*/
|
||||
enum class DriverRoleEnum(val code: Int) {
|
||||
enum class TaxiDriverRoleEnum(val code: Int) {
|
||||
OPERATION( 1),
|
||||
TEST( 2),
|
||||
DEMO( 3);
|
||||
@@ -20,7 +20,7 @@ package com.mogo.och.taxi.constant
|
||||
* 2003 车电量不足
|
||||
* 2004 其他
|
||||
*/
|
||||
enum class OrderCancelReasons(val type: Int, val msg: String) {
|
||||
enum class TaxiOrderCancelReasons(val type: Int, val msg: String) {
|
||||
CarBroken(1000, "车况异常"),
|
||||
DeviceBroken(1001, "设备异常"),
|
||||
BatteryLow(1002, "电量不足"),
|
||||
@@ -23,7 +23,7 @@ package com.mogo.och.taxi.constant
|
||||
* 60 已完成,
|
||||
* 70 已取消
|
||||
*/
|
||||
enum class OrderStatusEnum(val code: Int) {
|
||||
enum class TaxiOrderStatusEnum(val code: Int) {
|
||||
None( 0 ),
|
||||
OnTheWayToStart( 10),
|
||||
ArriveAtStart( 20),
|
||||
@@ -35,7 +35,7 @@ enum class OrderStatusEnum(val code: Int) {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun valueOf(code: Int): OrderStatusEnum? {
|
||||
fun valueOf(code: Int): TaxiOrderStatusEnum? {
|
||||
for (value in values()) {
|
||||
if (value.code == code) {
|
||||
return value
|
||||
@@ -5,7 +5,7 @@ package com.mogo.och.taxi.constant
|
||||
*
|
||||
* Created on 2021/12/6
|
||||
*/
|
||||
enum class OrderTypeEnum(val type: Int) {
|
||||
enum class TaxiOrderTypeEnum(val type: Int) {
|
||||
Instant(1), // 即时单
|
||||
Reserved(2) // 预约单
|
||||
}
|
||||
@@ -27,7 +27,7 @@ import com.autonavi.tbt.TrafficFacilityInfo;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.och.taxi.callback.IOCHTaxiNaviChangedCallback;
|
||||
import com.mogo.och.taxi.callback.ITaxiNaviChangedCallback;
|
||||
import com.mogo.och.taxi.utils.PermissionUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -44,7 +44,7 @@ public class NaviToDestinationModel implements AMapNaviListener {
|
||||
protected final List<NaviLatLng> sList = new ArrayList<NaviLatLng>();
|
||||
protected final List<NaviLatLng> eList = new ArrayList<NaviLatLng>();
|
||||
protected List<NaviLatLng> mWayPointList = new ArrayList<NaviLatLng>();
|
||||
private IOCHTaxiNaviChangedCallback mNaviChangedCallback;
|
||||
private ITaxiNaviChangedCallback mNaviChangedCallback;
|
||||
private AtomicInteger errorCount = new AtomicInteger(0);
|
||||
private boolean isPlay;
|
||||
public static NaviToDestinationModel getInstance(Context context) {
|
||||
@@ -92,7 +92,7 @@ public class NaviToDestinationModel implements AMapNaviListener {
|
||||
}
|
||||
}
|
||||
|
||||
public void setOCHTaciNaviChangedCallback(IOCHTaxiNaviChangedCallback callback){
|
||||
public void setOCHTaciNaviChangedCallback(ITaxiNaviChangedCallback callback){
|
||||
this.mNaviChangedCallback = callback;
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.content.Intent;
|
||||
import android.location.Location;
|
||||
import android.net.ConnectivityManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
@@ -15,7 +16,6 @@ import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
@@ -42,18 +42,18 @@ import com.mogo.och.taxi.bean.OrdersInServiceQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrdersListQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrdersNewBookingQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.QueryOrderRouteResp;
|
||||
import com.mogo.och.taxi.callback.IOCHTaxiADASStatusCallback;
|
||||
import com.mogo.och.taxi.callback.IOCHTaxiCarStatusCallback;
|
||||
import com.mogo.och.taxi.callback.IOCHTaxiControllerStatusCallback;
|
||||
import com.mogo.och.taxi.callback.IOCHTaxiOrderStatusCallback;
|
||||
import com.mogo.och.taxi.constant.DriverRoleEnum;
|
||||
import com.mogo.och.taxi.constant.OCHTaxiConst;
|
||||
import com.mogo.och.taxi.constant.OrderStatusEnum;
|
||||
import com.mogo.och.taxi.constant.OrderTypeEnum;
|
||||
import com.mogo.och.taxi.network.OCHTaxiServiceCallback;
|
||||
import com.mogo.och.taxi.network.OCHTaxiServiceManagerNew;
|
||||
import com.mogo.och.taxi.callback.ITaxiADASStatusCallback;
|
||||
import com.mogo.och.taxi.callback.ITaxiCarStatusCallback;
|
||||
import com.mogo.och.taxi.callback.ITaxiControllerStatusCallback;
|
||||
import com.mogo.och.taxi.callback.ITaxiOrderStatusCallback;
|
||||
import com.mogo.och.taxi.constant.TaxiDriverRoleEnum;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderTypeEnum;
|
||||
import com.mogo.och.taxi.network.TaxiServiceCallback;
|
||||
import com.mogo.och.taxi.network.TaxiServiceManager;
|
||||
import com.mogo.och.taxi.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.taxi.utils.OchTaxiAnalyticsUtil;
|
||||
import com.mogo.och.taxi.utils.TaxiAnalyticsUtil;
|
||||
import com.mogo.och.taxi.utils.OrderUtil;
|
||||
import com.mogo.och.taxi.utils.PinYinUtil;
|
||||
import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
|
||||
@@ -79,15 +79,15 @@ import mogo_msg.MogoReportMsg;
|
||||
* <p>
|
||||
* 网约车 - 出租车业务逻辑处理
|
||||
*/
|
||||
public class MogoOCHTaxiModelNew {
|
||||
public class TaxiModel {
|
||||
|
||||
private static final String TAG = MogoOCHTaxiModelNew.class.getSimpleName();
|
||||
private static final String TAG = TaxiModel.class.getSimpleName();
|
||||
|
||||
private static final class SingletonHolder {
|
||||
private static final MogoOCHTaxiModelNew INSTANCE = new MogoOCHTaxiModelNew();
|
||||
private static final TaxiModel INSTANCE = new TaxiModel();
|
||||
}
|
||||
|
||||
public static MogoOCHTaxiModelNew getInstance() {
|
||||
public static TaxiModel getInstance() {
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
@@ -100,31 +100,31 @@ public class MogoOCHTaxiModelNew {
|
||||
private volatile List<OrderQueryRespBean.Result> mInServiceList = Collections.emptyList(); //进行中订单
|
||||
private volatile List<OrderQueryRespBean.Result> mWaitServiceList = Collections.emptyList(); //待服务订单
|
||||
|
||||
private IOCHTaxiADASStatusCallback mADASStatusCallback; //Model->Presenter:自动驾驶状态相关
|
||||
private IOCHTaxiCarStatusCallback mCarStatusCallback; //Model->Presenter:出车/收车状态
|
||||
private IOCHTaxiControllerStatusCallback mControllerStatusCallback; //Model->Presenter:VR mode等
|
||||
private IOCHTaxiOrderStatusCallback mOrderStatusCallback; //Model->Presenter:订单变更
|
||||
private ITaxiADASStatusCallback mADASStatusCallback; //Model->Presenter:自动驾驶状态相关
|
||||
private ITaxiCarStatusCallback mCarStatusCallback; //Model->Presenter:出车/收车状态
|
||||
private ITaxiControllerStatusCallback mControllerStatusCallback; //Model->Presenter:VR mode等
|
||||
private ITaxiOrderStatusCallback mOrderStatusCallback; //Model->Presenter:订单变更
|
||||
|
||||
private List<LatLng> mRoutePoints = new ArrayList<>();
|
||||
|
||||
private double mLongitude, mLatitude;
|
||||
|
||||
private MogoOCHTaxiModelNew() {
|
||||
private TaxiModel() {
|
||||
}
|
||||
|
||||
public void setADASStatusCallback(IOCHTaxiADASStatusCallback callback) {
|
||||
public void setADASStatusCallback(ITaxiADASStatusCallback callback) {
|
||||
this.mADASStatusCallback = callback;
|
||||
}
|
||||
|
||||
public void setCarStatusCallback(IOCHTaxiCarStatusCallback callback) {
|
||||
public void setCarStatusCallback(ITaxiCarStatusCallback callback) {
|
||||
this.mCarStatusCallback = callback;
|
||||
}
|
||||
|
||||
public void setControllerStatusCallback(IOCHTaxiControllerStatusCallback callback) {
|
||||
public void setControllerStatusCallback(ITaxiControllerStatusCallback callback) {
|
||||
this.mControllerStatusCallback = callback;
|
||||
}
|
||||
|
||||
public void setOrderStatusCallback(IOCHTaxiOrderStatusCallback callback) {
|
||||
public void setOrderStatusCallback(ITaxiOrderStatusCallback callback) {
|
||||
this.mOrderStatusCallback = callback;
|
||||
}
|
||||
|
||||
@@ -240,20 +240,20 @@ public class MogoOCHTaxiModelNew {
|
||||
private void startOrStopOrderLoop(boolean start) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "startOrStopOrderLoop() " + start);
|
||||
if (start) {
|
||||
OCHTaxiModelLoopManager.getInstance().startInAndWaitOrdersLoop();
|
||||
OCHTaxiModelLoopManager.getInstance().startNewBookingOrderLoop();
|
||||
OCHTaxiModelLoopManager.getInstance().startHeartbeatLoop();
|
||||
TaxiModelLoopManager.getInstance().startInAndWaitOrdersLoop();
|
||||
TaxiModelLoopManager.getInstance().startNewBookingOrderLoop();
|
||||
TaxiModelLoopManager.getInstance().startHeartbeatLoop();
|
||||
} else {
|
||||
OCHTaxiModelLoopManager.getInstance().stopInAndWaitOrdersLoop();
|
||||
OCHTaxiModelLoopManager.getInstance().stopNewBookingOrderLoop();
|
||||
OCHTaxiModelLoopManager.getInstance().stopHeartbeatLoop();
|
||||
TaxiModelLoopManager.getInstance().stopInAndWaitOrdersLoop();
|
||||
TaxiModelLoopManager.getInstance().stopNewBookingOrderLoop();
|
||||
TaxiModelLoopManager.getInstance().stopHeartbeatLoop();
|
||||
}
|
||||
}
|
||||
|
||||
//查询出车/收车状态
|
||||
public void queryCarStatus() {
|
||||
OCHTaxiServiceManagerNew.getInstance().queryDriverServiceStatus(mContext,
|
||||
new OCHTaxiServiceCallback<DriverStatusQueryRespBean>() {
|
||||
TaxiServiceManager.getInstance().queryDriverServiceStatus(mContext,
|
||||
new TaxiServiceCallback<DriverStatusQueryRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(DriverStatusQueryRespBean data) {
|
||||
if (null != data && 0 == data.code) {
|
||||
@@ -262,10 +262,10 @@ public class MogoOCHTaxiModelNew {
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "changeCarStatus:" + mOCHCarStatus);
|
||||
// startOrStopOrderLoop(mOCHCarStatus == 1); todo 只从一个入口开始订单轮询
|
||||
String role = "";
|
||||
if (DriverRoleEnum.DEMO.getCode() == data.data.purpose){
|
||||
role = OCHTaxiConst.DEMO_USER;
|
||||
}else if (DriverRoleEnum.TEST.getCode() == data.data.purpose){
|
||||
role = OCHTaxiConst.TEST_USER;
|
||||
if (TaxiDriverRoleEnum.DEMO.getCode() == data.data.purpose){
|
||||
role = TaxiConst.DEMO_USER;
|
||||
}else if (TaxiDriverRoleEnum.TEST.getCode() == data.data.purpose){
|
||||
role = TaxiConst.TEST_USER;
|
||||
}
|
||||
if (mCarStatusCallback != null) {
|
||||
mCarStatusCallback.onCarStatusChanged(mOCHCarStatus == 1 , role);
|
||||
@@ -294,8 +294,8 @@ public class MogoOCHTaxiModelNew {
|
||||
return;
|
||||
}
|
||||
final int status = mOCHCarStatus == 1 ? 0 : 1;
|
||||
OCHTaxiServiceManagerNew.getInstance().updateDriverServiceStatus(mContext, status,
|
||||
new OCHTaxiServiceCallback<BaseData>() {
|
||||
TaxiServiceManager.getInstance().updateDriverServiceStatus(mContext, status,
|
||||
new TaxiServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData data) {
|
||||
if (null != data && 0 == data.code) {
|
||||
@@ -325,8 +325,8 @@ public class MogoOCHTaxiModelNew {
|
||||
* 才更新最新进行中单到本地
|
||||
*/
|
||||
public void queryInAndWaitOrders() {
|
||||
OCHTaxiServiceManagerNew.getInstance().queryOrdersInAndWaitService(mContext,
|
||||
new OCHTaxiServiceCallback<OrdersInServiceQueryRespBean>() {
|
||||
TaxiServiceManager.getInstance().queryOrdersInAndWaitService(mContext,
|
||||
new TaxiServiceCallback<OrdersInServiceQueryRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(OrdersInServiceQueryRespBean data) {
|
||||
if (data == null || data.data == null) {
|
||||
@@ -399,15 +399,15 @@ public class MogoOCHTaxiModelNew {
|
||||
return;
|
||||
}
|
||||
final String orderNo = mCurrentOCHOrder.orderNo;
|
||||
OCHTaxiServiceManagerNew.getInstance().queryOrderById(mContext, orderNo,
|
||||
new OCHTaxiServiceCallback<OrderQueryRespBean>() {
|
||||
TaxiServiceManager.getInstance().queryOrderById(mContext, orderNo,
|
||||
new TaxiServiceCallback<OrderQueryRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(OrderQueryRespBean data) {
|
||||
if (data != null && data.data != null
|
||||
&& mCurrentOCHOrder != null && mCurrentOCHOrder.orderNo.equals(data.data.orderNo)) {
|
||||
if (data.data.orderStatus == OrderStatusEnum.Cancel.getCode()
|
||||
|| data.data.orderStatus == OrderStatusEnum.JourneyCompleted.getCode()
|
||||
|| data.data.orderStatus == OrderStatusEnum.None.getCode()) {
|
||||
if (data.data.orderStatus == TaxiOrderStatusEnum.Cancel.getCode()
|
||||
|| data.data.orderStatus == TaxiOrderStatusEnum.JourneyCompleted.getCode()
|
||||
|| data.data.orderStatus == TaxiOrderStatusEnum.None.getCode()) {
|
||||
clearCurrentOCHOrder();
|
||||
cancelAutopilot();
|
||||
} else {
|
||||
@@ -427,13 +427,13 @@ public class MogoOCHTaxiModelNew {
|
||||
}
|
||||
|
||||
//更新当前订单状态
|
||||
public void updateOCHOrderStatus(final OrderStatusEnum orderStatus) {
|
||||
public void updateOCHOrderStatus(final TaxiOrderStatusEnum orderStatus) {
|
||||
if (mCurrentOCHOrder == null) {
|
||||
return;
|
||||
}
|
||||
final String orderNo = mCurrentOCHOrder.orderNo;
|
||||
OCHTaxiServiceManagerNew.getInstance().updateOrderStatus(mContext, orderNo,
|
||||
orderStatus.getCode(), new OCHTaxiServiceCallback<BaseData>() {
|
||||
TaxiServiceManager.getInstance().updateOrderStatus(mContext, orderNo,
|
||||
orderStatus.getCode(), new TaxiServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData data) {
|
||||
if (null != data && 0 == data.code
|
||||
@@ -466,8 +466,8 @@ public class MogoOCHTaxiModelNew {
|
||||
return;
|
||||
}
|
||||
final String orderNo = mCurrentOCHOrder.orderNo;
|
||||
OCHTaxiServiceManagerNew.getInstance().cancelOrder(mContext, orderNo, reasonType, reason,
|
||||
new OCHTaxiServiceCallback<BaseData>() {
|
||||
TaxiServiceManager.getInstance().cancelOrder(mContext, orderNo, reasonType, reason,
|
||||
new TaxiServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData data) {
|
||||
if (null != data && 0 == data.code
|
||||
@@ -489,8 +489,8 @@ public class MogoOCHTaxiModelNew {
|
||||
|
||||
// 取消待服务中订单
|
||||
public void cancelOrderById(final String orderNo, int reasonType, String reason) {
|
||||
OCHTaxiServiceManagerNew.getInstance().cancelOrder(mContext, orderNo, reasonType, reason,
|
||||
new OCHTaxiServiceCallback<BaseData>() {
|
||||
TaxiServiceManager.getInstance().cancelOrder(mContext, orderNo, reasonType, reason,
|
||||
new TaxiServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData data) {
|
||||
if (null != data && 0 == data.code) {
|
||||
@@ -513,8 +513,8 @@ public class MogoOCHTaxiModelNew {
|
||||
return;
|
||||
}
|
||||
final String orderNo = mCurrentOCHOrder.orderNo;
|
||||
OCHTaxiServiceManagerNew.getInstance().queryOrderRouteInfo(mContext, orderNo,
|
||||
new OCHTaxiServiceCallback<OrderQueryRouteInfoRespBean>() {
|
||||
TaxiServiceManager.getInstance().queryOrderRouteInfo(mContext, orderNo,
|
||||
new TaxiServiceCallback<OrderQueryRouteInfoRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(OrderQueryRouteInfoRespBean data) {
|
||||
if (null != data && 0 == data.code
|
||||
@@ -534,8 +534,8 @@ public class MogoOCHTaxiModelNew {
|
||||
|
||||
// 获取全部订单列表
|
||||
public void queryOrdersList(int page, int size) {
|
||||
OCHTaxiServiceManagerNew.getInstance().queryOrdersList(mContext, page, size,
|
||||
new OCHTaxiServiceCallback<OrdersListQueryRespBean>() {
|
||||
TaxiServiceManager.getInstance().queryOrdersList(mContext, page, size,
|
||||
new TaxiServiceCallback<OrdersListQueryRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(OrdersListQueryRespBean data) {
|
||||
if (null != data && 0 == data.code) {
|
||||
@@ -558,8 +558,8 @@ public class MogoOCHTaxiModelNew {
|
||||
* 注:只有在本地缓存mNewBookingOrder为null时(执行完抢单or司机关闭改单),才更新新到待抢单
|
||||
*/
|
||||
public void queryNewBookingOrder() {
|
||||
OCHTaxiServiceManagerNew.getInstance().queryNewBookingOrder(mContext,
|
||||
new OCHTaxiServiceCallback<OrdersNewBookingQueryRespBean>() {
|
||||
TaxiServiceManager.getInstance().queryNewBookingOrder(mContext,
|
||||
new TaxiServiceCallback<OrdersNewBookingQueryRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(OrdersNewBookingQueryRespBean data) {
|
||||
if (data != null && data.code == 0
|
||||
@@ -585,13 +585,13 @@ public class MogoOCHTaxiModelNew {
|
||||
|
||||
// 仅限于获取到新待抢单且需要展示时查询该单信息:(queryOrderById接口可以查询属于该车的单、未派的单)
|
||||
private void queryNewBookingContent(final String orderNo) {
|
||||
OCHTaxiServiceManagerNew.getInstance().queryOrderById(mContext, orderNo,
|
||||
new OCHTaxiServiceCallback<OrderQueryRespBean>() {
|
||||
TaxiServiceManager.getInstance().queryOrderById(mContext, orderNo,
|
||||
new TaxiServiceCallback<OrderQueryRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(OrderQueryRespBean data) {
|
||||
if (data != null && data.code == 0
|
||||
&& data.data != null && data.data.orderNo.equals(orderNo)
|
||||
&& data.data.orderType == OrderTypeEnum.Reserved.getType()) {
|
||||
&& data.data.orderType == TaxiOrderTypeEnum.Reserved.getType()) {
|
||||
mNewBookingOrder = data.data;
|
||||
mPrevOrderNo = data.data.orderNo;
|
||||
if (mOrderStatusCallback != null) {
|
||||
@@ -616,15 +616,15 @@ public class MogoOCHTaxiModelNew {
|
||||
return;
|
||||
}
|
||||
final String orderNo = mNewBookingOrder.orderNo;
|
||||
OCHTaxiServiceManagerNew.getInstance().grabOrder(mContext, orderNo,
|
||||
new OCHTaxiServiceCallback<OrderGrabRespBean>() {
|
||||
TaxiServiceManager.getInstance().grabOrder(mContext, orderNo,
|
||||
new TaxiServiceCallback<OrderGrabRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(OrderGrabRespBean data) {
|
||||
if (data != null && data.code == 0
|
||||
&& mNewBookingOrder != null && mNewBookingOrder.orderNo.equals(orderNo)) {
|
||||
if (mOrderStatusCallback != null) {
|
||||
mOrderStatusCallback.onGrabOrderExecuteDone();
|
||||
OCHTaxiModelLoopManager.getInstance().startGrabResultLoop();
|
||||
TaxiModelLoopManager.getInstance().startGrabResultLoop();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -639,18 +639,18 @@ public class MogoOCHTaxiModelNew {
|
||||
// 查询抢单结果
|
||||
public void queryOrderGrabStatus() {
|
||||
if (mNewBookingOrder == null) {
|
||||
OCHTaxiModelLoopManager.getInstance().stopGrabResultLoop();
|
||||
TaxiModelLoopManager.getInstance().stopGrabResultLoop();
|
||||
if (mOrderStatusCallback != null) {
|
||||
mOrderStatusCallback.onGrabOrderFailed(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
final String orderNo = mNewBookingOrder.orderNo;
|
||||
OCHTaxiServiceManagerNew.getInstance().queryOrderGrabStatus(mContext, orderNo,
|
||||
new OCHTaxiServiceCallback<OrderGrabStatusQueryRespBean>() {
|
||||
TaxiServiceManager.getInstance().queryOrderGrabStatus(mContext, orderNo,
|
||||
new TaxiServiceCallback<OrderGrabStatusQueryRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(OrderGrabStatusQueryRespBean data) {
|
||||
//OCHTaxiModelLoopManager.getInstance().stopGrabResultLoop();
|
||||
//TaxiModelLoopManager.getInstance().stopGrabResultLoop();
|
||||
if (data != null && data.code == 0
|
||||
&& mNewBookingOrder != null && mNewBookingOrder.orderNo.equals(orderNo)) {
|
||||
if (data.data.grabStatus == 0) {
|
||||
@@ -672,7 +672,7 @@ public class MogoOCHTaxiModelNew {
|
||||
mOrderStatusCallback.onGrabOrderFailed(null);
|
||||
}
|
||||
}
|
||||
OCHTaxiModelLoopManager.getInstance().stopGrabResultLoop();
|
||||
TaxiModelLoopManager.getInstance().stopGrabResultLoop();
|
||||
cancelNewBookingOrder();
|
||||
}
|
||||
|
||||
@@ -685,8 +685,8 @@ public class MogoOCHTaxiModelNew {
|
||||
|
||||
// 车机端上传心跳数据(只在出车状态时上传)
|
||||
public void runCarHeartbeat() {
|
||||
OCHTaxiServiceManagerNew.getInstance().runCarHeartbeat(mContext, mLongitude, mLatitude,
|
||||
new OCHTaxiServiceCallback<BaseData>() {
|
||||
TaxiServiceManager.getInstance().runCarHeartbeat(mContext, mLongitude, mLatitude,
|
||||
new TaxiServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData data) {
|
||||
|
||||
@@ -701,8 +701,8 @@ public class MogoOCHTaxiModelNew {
|
||||
|
||||
// 查询司机服务数据
|
||||
public void queryDriverServiceData() {
|
||||
OCHTaxiServiceManagerNew.getInstance().queryDriverServiceData(mContext,
|
||||
new OCHTaxiServiceCallback<DriverServiceDataRespBean>() {
|
||||
TaxiServiceManager.getInstance().queryDriverServiceData(mContext,
|
||||
new TaxiServiceCallback<DriverServiceDataRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(DriverServiceDataRespBean data) {
|
||||
if (data != null && data.code == 0
|
||||
@@ -732,12 +732,12 @@ public class MogoOCHTaxiModelNew {
|
||||
}
|
||||
|
||||
// 获取当前订单状态
|
||||
public OrderStatusEnum getCurOrderStatus() {
|
||||
OrderQueryRespBean.Result order = MogoOCHTaxiModelNew.getInstance().getCurrentOCHOrder();
|
||||
public TaxiOrderStatusEnum getCurOrderStatus() {
|
||||
OrderQueryRespBean.Result order = TaxiModel.getInstance().getCurrentOCHOrder();
|
||||
if (order == null) {
|
||||
return OrderStatusEnum.None;
|
||||
return TaxiOrderStatusEnum.None;
|
||||
}
|
||||
return OrderStatusEnum.valueOf(order.orderStatus);
|
||||
return TaxiOrderStatusEnum.valueOf(order.orderStatus);
|
||||
}
|
||||
|
||||
//更新本地currentOrder信息,并保存订单到本地避免车机重启丢失数据
|
||||
@@ -746,10 +746,10 @@ public class MogoOCHTaxiModelNew {
|
||||
return;
|
||||
}
|
||||
mCurrentOCHOrder = data;
|
||||
SharedPrefsMgr.getInstance(mContext).putString(OCHTaxiConst.SP_KEY_OCH_TAXI_ORDER,
|
||||
SharedPrefsMgr.getInstance(mContext).putString(TaxiConst.SP_KEY_OCH_TAXI_ORDER,
|
||||
GsonUtil.jsonFromObject(data));
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& mCurrentOCHOrder.orderStatus == OrderStatusEnum.OnTheWayToEnd.getCode()) {
|
||||
&& mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToEnd.getCode()) {
|
||||
// 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为true(更新本地order信息)");
|
||||
@@ -759,7 +759,7 @@ public class MogoOCHTaxiModelNew {
|
||||
//清除订单信息
|
||||
public void clearCurrentOCHOrder() {
|
||||
mCurrentOCHOrder = null;
|
||||
SharedPrefsMgr.getInstance(mContext).remove(OCHTaxiConst.SP_KEY_OCH_TAXI_ORDER);
|
||||
SharedPrefsMgr.getInstance(mContext).remove(TaxiConst.SP_KEY_OCH_TAXI_ORDER);
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 取消或订单已完成时,置false
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
@@ -807,7 +807,7 @@ public class MogoOCHTaxiModelNew {
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "start autopilot with parameter: %s", GsonUtil.jsonFromObject(parameters)
|
||||
+ " ,startSiteName=" + mCurrentOCHOrder.startSiteAddr + " ,endSiteName=" + mCurrentOCHOrder.endSiteAddr);
|
||||
|
||||
OchTaxiAnalyticsUtil.triggerStartServiceEvent(false,
|
||||
TaxiAnalyticsUtil.triggerStartServiceEvent(false,
|
||||
mCurrentOCHOrder.startSiteAddr, mCurrentOCHOrder.endSiteAddr, mCurrentOCHOrder.orderNo);
|
||||
|
||||
if (DebugConfig.isDebug()) {
|
||||
@@ -840,7 +840,7 @@ public class MogoOCHTaxiModelNew {
|
||||
startLon, startLat,
|
||||
location.getLongitude(), location.getLatitude());
|
||||
|
||||
if (DebugConfig.isDebug() && mCurrentOCHOrder.orderStatus == OrderStatusEnum.OnTheWayToStart.getCode()) {
|
||||
if (DebugConfig.isDebug() && mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) {
|
||||
// TipToast.shortTip("距离上车点:" + Double.valueOf(distance).intValue());
|
||||
}
|
||||
|
||||
@@ -849,14 +849,14 @@ public class MogoOCHTaxiModelNew {
|
||||
// mOrderStatusCallback.onCurrentOrderDistToStartChanged((long) distance, 0);
|
||||
// }
|
||||
|
||||
if (distance > OCHTaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
|
||||
if (distance > TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
|
||||
distance = CoordinateUtils.calculateLineDistance(startLon, startLat,
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(),
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat());
|
||||
}
|
||||
|
||||
if (distance <= OCHTaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
|
||||
updateOCHOrderStatus(OrderStatusEnum.ArriveAtStart);
|
||||
if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
|
||||
updateOCHOrderStatus(TaxiOrderStatusEnum.ArriveAtStart);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -926,7 +926,7 @@ public class MogoOCHTaxiModelNew {
|
||||
public void onCarLocationChanged2(Location location) {
|
||||
//位置变化时,通过围栏判断是否到达x点
|
||||
if (location != null && checkCurrentOCHOrder()) {
|
||||
if (getCurOrderStatus() == OrderStatusEnum.OnTheWayToStart) {
|
||||
if (getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToStart) {
|
||||
judgeStartStation(location);
|
||||
}
|
||||
// else if (getCurOrderStatus() == OrderStatusEnum.OnTheWayToEndStation) {
|
||||
@@ -946,20 +946,20 @@ public class MogoOCHTaxiModelNew {
|
||||
*/
|
||||
public void setArriveAtStartStation() {
|
||||
if (mCurrentOCHOrder == null
|
||||
|| mCurrentOCHOrder.orderStatus != OrderStatusEnum.OnTheWayToStart.getCode()) {
|
||||
|| mCurrentOCHOrder.orderStatus != TaxiOrderStatusEnum.OnTheWayToStart.getCode()) {
|
||||
TipToast.shortTip("订单状态不匹配该操作!");
|
||||
return;
|
||||
}
|
||||
updateOCHOrderStatus(OrderStatusEnum.ArriveAtStart);
|
||||
updateOCHOrderStatus(TaxiOrderStatusEnum.ArriveAtStart);
|
||||
}
|
||||
|
||||
public void setArriveAtEndStation() {
|
||||
if (mCurrentOCHOrder == null
|
||||
|| mCurrentOCHOrder.orderStatus != OrderStatusEnum.OnTheWayToEnd.getCode()) {
|
||||
|| mCurrentOCHOrder.orderStatus != TaxiOrderStatusEnum.OnTheWayToEnd.getCode()) {
|
||||
TipToast.shortTip("订单状态不匹配该操作!");
|
||||
return;
|
||||
}
|
||||
updateOCHOrderStatus(OrderStatusEnum.ArriveAtEnd);
|
||||
updateOCHOrderStatus(TaxiOrderStatusEnum.ArriveAtEnd);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -968,10 +968,10 @@ public class MogoOCHTaxiModelNew {
|
||||
public void setOnTheWayToEndStation() {
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
if (mCurrentOCHOrder == null
|
||||
|| mCurrentOCHOrder.orderStatus != OrderStatusEnum.ArriveAtStart.getCode()) {
|
||||
|| mCurrentOCHOrder.orderStatus != TaxiOrderStatusEnum.ArriveAtStart.getCode()) {
|
||||
TipToast.shortTip("订单状态不匹配该操作!");
|
||||
}
|
||||
updateOCHOrderStatus(OrderStatusEnum.OnTheWayToEnd);
|
||||
updateOCHOrderStatus(TaxiOrderStatusEnum.OnTheWayToEnd);
|
||||
}
|
||||
|
||||
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() {
|
||||
@@ -989,13 +989,13 @@ public class MogoOCHTaxiModelNew {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
if (mCurrentOCHOrder != null
|
||||
&& getCurOrderStatus() == OrderStatusEnum.ArriveAtStart
|
||||
&& getCurOrderStatus() == TaxiOrderStatusEnum.ArriveAtStart
|
||||
&& state != mPrevAPStatus) {
|
||||
// 当高频返回autopilot 2时,不重复调用订单状态变更
|
||||
mPrevAPStatus = state; // 每个状态单独赋值,解决无订单时已经是2的状态导致的新订单来时无法进入此逻辑更新状态
|
||||
updateOCHOrderStatus(OrderStatusEnum.OnTheWayToEnd);
|
||||
updateOCHOrderStatus(TaxiOrderStatusEnum.OnTheWayToEnd);
|
||||
|
||||
OchTaxiAnalyticsUtil.triggerStartServiceEvent(true,
|
||||
TaxiAnalyticsUtil.triggerStartServiceEvent(true,
|
||||
mCurrentOCHOrder.startSiteAddr, mCurrentOCHOrder.endSiteAddr, mCurrentOCHOrder.orderNo);
|
||||
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
@@ -1008,7 +1008,7 @@ public class MogoOCHTaxiModelNew {
|
||||
mPrevAPStatus = state;
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& checkCurrentOCHOrder()
|
||||
&& getCurOrderStatus() == OrderStatusEnum.OnTheWayToEnd) {
|
||||
&& getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToEnd) {
|
||||
// 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态
|
||||
return;
|
||||
}
|
||||
@@ -1017,7 +1017,7 @@ public class MogoOCHTaxiModelNew {
|
||||
mPrevAPStatus = state;
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& checkCurrentOCHOrder()
|
||||
&& getCurOrderStatus() == OrderStatusEnum.OnTheWayToEnd) {
|
||||
&& getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToEnd) {
|
||||
// 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态
|
||||
return;
|
||||
}
|
||||
@@ -1035,17 +1035,22 @@ public class MogoOCHTaxiModelNew {
|
||||
CallerLogger.INSTANCE.i(M_TAXI + TAG, "onAutopilotArriveAtStation = " + data.toString());
|
||||
|
||||
if (data == null || !checkCurrentOCHOrder()
|
||||
|| (getCurOrderStatus() == OrderStatusEnum.ArriveAtEnd)) {
|
||||
|| (getCurOrderStatus() == TaxiOrderStatusEnum.ArriveAtEnd)) {
|
||||
return;
|
||||
}
|
||||
if (DebugConfig.isDebug()) {
|
||||
// TipToast.shortTip("到达目的地");
|
||||
}
|
||||
updateOCHOrderStatus(OrderStatusEnum.ArriveAtEnd);
|
||||
updateOCHOrderStatus(TaxiOrderStatusEnum.ArriveAtEnd);
|
||||
}
|
||||
};
|
||||
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener() {
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRotting(MessagePad.GlobalPathResp routeList) {
|
||||
if (null != routeList && routeList.getWayPointsList().size() > 0){
|
||||
@@ -1054,11 +1059,6 @@ public class MogoOCHTaxiModelNew {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1069,8 +1069,8 @@ public class MogoOCHTaxiModelNew {
|
||||
if (null == mCurrentOCHOrder) return;
|
||||
List<OrderRouteUpdateReqBean.Result> points =
|
||||
CoordinateCalculateRouteUtil.coordinateConverterWgsToGcjList(mContext,models);
|
||||
OCHTaxiServiceManagerNew.getInstance().updateOrderRoute(mContext, mCurrentOCHOrder.orderNo
|
||||
, points, new OCHTaxiServiceCallback<BaseData>() {
|
||||
TaxiServiceManager.getInstance().updateOrderRoute(mContext, mCurrentOCHOrder.orderNo
|
||||
, points, new TaxiServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData data) {
|
||||
|
||||
@@ -1125,7 +1125,7 @@ public class MogoOCHTaxiModelNew {
|
||||
lastSumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(lastPoints);
|
||||
}
|
||||
|
||||
double lastTime = lastSumLength / OCHTaxiConst.TAXI_AVERAGE_SPEED * 3.6 ; //秒
|
||||
double lastTime = lastSumLength / TaxiConst.TAXI_AVERAGE_SPEED * 3.6 ; //秒
|
||||
Logger.d(M_TAXI + "dynamicCalculateRouteInfo"
|
||||
, "---lastSumLength: "+lastSumLength+"----lastTime : "+lastTime);
|
||||
|
||||
@@ -1142,8 +1142,8 @@ public class MogoOCHTaxiModelNew {
|
||||
*/
|
||||
private void queryOrderRouteList(String orderNo) {
|
||||
if (mCurrentOCHOrder != null){
|
||||
OCHTaxiServiceManagerNew.getInstance().queryOrderRoute(mContext, orderNo,
|
||||
new OCHTaxiServiceCallback<QueryOrderRouteResp>() {
|
||||
TaxiServiceManager.getInstance().queryOrderRoute(mContext, orderNo,
|
||||
new TaxiServiceCallback<QueryOrderRouteResp>() {
|
||||
@Override
|
||||
public void onSuccess(QueryOrderRouteResp data) {
|
||||
if (data != null && data.data != null){
|
||||
@@ -1167,10 +1167,10 @@ public class MogoOCHTaxiModelNew {
|
||||
public void startOrStopCalculateRouteInfo(boolean isStart) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "startOrStopOrderLoop() " + isStart);
|
||||
if (isStart) {
|
||||
OCHTaxiModelLoopManager.getInstance().startCalculateRouteInfoLoop();
|
||||
TaxiModelLoopManager.getInstance().startCalculateRouteInfoLoop();
|
||||
} else {
|
||||
mRoutePoints.clear();
|
||||
OCHTaxiModelLoopManager.getInstance().stopCalculateRouteInfLoop();
|
||||
TaxiModelLoopManager.getInstance().stopCalculateRouteInfLoop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1181,8 +1181,8 @@ public class MogoOCHTaxiModelNew {
|
||||
*/
|
||||
private void reportOrderRemain(long lastSumLength, long duration) {// 米/分钟
|
||||
if (mCurrentOCHOrder == null) return;
|
||||
OCHTaxiServiceManagerNew.getInstance().reportOrderRemain(mContext, mCurrentOCHOrder.orderNo
|
||||
, lastSumLength, duration, new OCHTaxiServiceCallback<BaseData>() {
|
||||
TaxiServiceManager.getInstance().reportOrderRemain(mContext, mCurrentOCHOrder.orderNo
|
||||
, lastSumLength, duration, new TaxiServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData data) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAX
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.taxi.constant.OCHTaxiConst;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -18,15 +18,15 @@ import io.reactivex.schedulers.Schedulers;
|
||||
*
|
||||
* 管理轮询逻辑(订单轮询、新单轮询、新单抢单结果轮询等等)
|
||||
*/
|
||||
public class OCHTaxiModelLoopManager {
|
||||
public class TaxiModelLoopManager {
|
||||
|
||||
private static final String TAG = OCHTaxiModelLoopManager.class.getSimpleName();
|
||||
private static final String TAG = TaxiModelLoopManager.class.getSimpleName();
|
||||
|
||||
private static final class SingletonHolder {
|
||||
private static final OCHTaxiModelLoopManager INSTANCE = new OCHTaxiModelLoopManager();
|
||||
private static final TaxiModelLoopManager INSTANCE = new TaxiModelLoopManager();
|
||||
}
|
||||
|
||||
public static OCHTaxiModelLoopManager getInstance() {
|
||||
public static TaxiModelLoopManager getInstance() {
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
@@ -41,12 +41,12 @@ public class OCHTaxiModelLoopManager {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_TAXI + TAG, "startInAndWaitOrdersLoop()");
|
||||
mInAndWaitServiceDisposable = Observable.interval(OCHTaxiConst.LOOP_DELAY,
|
||||
OCHTaxiConst.LOOP_PERIOD_2S, TimeUnit.MILLISECONDS)
|
||||
mInAndWaitServiceDisposable = Observable.interval(TaxiConst.LOOP_DELAY,
|
||||
TaxiConst.LOOP_PERIOD_2S, TimeUnit.MILLISECONDS)
|
||||
.map((aLong -> aLong + 1))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> MogoOCHTaxiModelNew.getInstance().queryInAndWaitOrders());
|
||||
.subscribe(aLong -> TaxiModel.getInstance().queryInAndWaitOrders());
|
||||
}
|
||||
|
||||
public void stopInAndWaitOrdersLoop() {
|
||||
@@ -62,12 +62,12 @@ public class OCHTaxiModelLoopManager {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_TAXI + TAG, "startNewBookingOrderLoop()");
|
||||
mNewBookingOrderDisposable = Observable.interval(OCHTaxiConst.LOOP_DELAY,
|
||||
OCHTaxiConst.LOOP_PERIOD_1S, TimeUnit.MILLISECONDS)
|
||||
mNewBookingOrderDisposable = Observable.interval(TaxiConst.LOOP_DELAY,
|
||||
TaxiConst.LOOP_PERIOD_1S, TimeUnit.MILLISECONDS)
|
||||
.map((aLong -> aLong + 1))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> MogoOCHTaxiModelNew.getInstance().queryNewBookingOrder());
|
||||
.subscribe(aLong -> TaxiModel.getInstance().queryNewBookingOrder());
|
||||
}
|
||||
|
||||
public void stopNewBookingOrderLoop() {
|
||||
@@ -83,12 +83,12 @@ public class OCHTaxiModelLoopManager {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_TAXI + TAG, "startGrabResultLoop()");
|
||||
mGrabResultDisposable = Observable.interval(OCHTaxiConst.LOOP_DELAY,
|
||||
OCHTaxiConst.LOOP_PERIOD_1S, TimeUnit.MILLISECONDS)
|
||||
mGrabResultDisposable = Observable.interval(TaxiConst.LOOP_DELAY,
|
||||
TaxiConst.LOOP_PERIOD_1S, TimeUnit.MILLISECONDS)
|
||||
.map((aLong -> aLong + 1))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> MogoOCHTaxiModelNew.getInstance().queryOrderGrabStatus());
|
||||
.subscribe(aLong -> TaxiModel.getInstance().queryOrderGrabStatus());
|
||||
}
|
||||
|
||||
public void stopGrabResultLoop() {
|
||||
@@ -104,12 +104,12 @@ public class OCHTaxiModelLoopManager {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_TAXI + TAG, "startHeartbeatLoop()");
|
||||
mHeartbeatDisposable = Observable.interval(OCHTaxiConst.LOOP_DELAY,
|
||||
OCHTaxiConst.LOOP_PERIOD_60S, TimeUnit.MILLISECONDS)
|
||||
mHeartbeatDisposable = Observable.interval(TaxiConst.LOOP_DELAY,
|
||||
TaxiConst.LOOP_PERIOD_60S, TimeUnit.MILLISECONDS)
|
||||
.map((aLong -> aLong + 1))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> MogoOCHTaxiModelNew.getInstance().runCarHeartbeat());
|
||||
.subscribe(aLong -> TaxiModel.getInstance().runCarHeartbeat());
|
||||
}
|
||||
|
||||
public void stopHeartbeatLoop() {
|
||||
@@ -125,12 +125,12 @@ public class OCHTaxiModelLoopManager {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_TAXI_P + TAG, "startCalculateRouteInfoLoop()");
|
||||
mCalculateRouteDisposable = Observable.interval(OCHTaxiConst.LOOP_DELAY,
|
||||
OCHTaxiConst.LOOP_CALCULATEROUTE_2S, TimeUnit.MILLISECONDS)
|
||||
mCalculateRouteDisposable = Observable.interval(TaxiConst.LOOP_DELAY,
|
||||
TaxiConst.LOOP_CALCULATEROUTE_2S, TimeUnit.MILLISECONDS)
|
||||
.map((aLong -> aLong + 1))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> MogoOCHTaxiModelNew.getInstance().dynamicCalculateRouteInfo());
|
||||
.subscribe(aLong -> TaxiModel.getInstance().dynamicCalculateRouteInfo());
|
||||
}
|
||||
|
||||
public void stopCalculateRouteInfLoop() {
|
||||
@@ -34,7 +34,7 @@ import retrofit2.http.Query;
|
||||
*
|
||||
* 网约车-出租车接口定义
|
||||
*/
|
||||
interface OCHTaxiServiceApiNew {
|
||||
interface TaxiServiceApiNew {
|
||||
|
||||
/**
|
||||
* 查询全部服务中/待服务订单(没有的时候返回code 0,空列表)
|
||||
@@ -6,7 +6,7 @@ package com.mogo.och.taxi.network;
|
||||
*
|
||||
* 修改订单状态回调接口
|
||||
*/
|
||||
public interface OCHTaxiServiceCallback< T > {
|
||||
public interface TaxiServiceCallback< T > {
|
||||
|
||||
void onSuccess(T data);
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.mogo.och.taxi.bean.OrdersListQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrdersNewBookingQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.QueryOrderRouteResp;
|
||||
import com.mogo.och.taxi.bean.UpdateOrderDisAndTimeReqBean;
|
||||
import com.mogo.och.taxi.constant.OCHTaxiConst;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -40,22 +40,22 @@ import io.reactivex.schedulers.Schedulers;
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
*/
|
||||
public class OCHTaxiServiceManagerNew {
|
||||
private static final String TAG = OCHTaxiServiceManagerNew.class.getSimpleName();
|
||||
public class TaxiServiceManager {
|
||||
private static final String TAG = TaxiServiceManager.class.getSimpleName();
|
||||
|
||||
private static final class SingletonHolder {
|
||||
private static final OCHTaxiServiceManagerNew INSTANCE = new OCHTaxiServiceManagerNew();
|
||||
private static final TaxiServiceManager INSTANCE = new TaxiServiceManager();
|
||||
}
|
||||
|
||||
public static OCHTaxiServiceManagerNew getInstance() {
|
||||
public static TaxiServiceManager getInstance() {
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private OCHTaxiServiceApiNew mOCHTaxiServiceApi;
|
||||
private TaxiServiceApiNew mOCHTaxiServiceApi;
|
||||
|
||||
private OCHTaxiServiceManagerNew() {
|
||||
private TaxiServiceManager() {
|
||||
if (mOCHTaxiServiceApi == null){
|
||||
mOCHTaxiServiceApi = MoGoRetrofitFactory.getInstance(OCHTaxiConst.getBaseUrl()).create(OCHTaxiServiceApiNew.class);
|
||||
mOCHTaxiServiceApi = MoGoRetrofitFactory.getInstance(TaxiConst.getBaseUrl()).create(TaxiServiceApiNew.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param callback
|
||||
*/
|
||||
public void queryOrdersInAndWaitService(Context context,
|
||||
OCHTaxiServiceCallback<OrdersInServiceQueryRespBean> callback) {
|
||||
TaxiServiceCallback<OrdersInServiceQueryRespBean> callback) {
|
||||
mOCHTaxiServiceApi.queryOrdersInAndWaitService(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
@@ -80,7 +80,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param callback
|
||||
*/
|
||||
public void queryNewBookingOrder(Context context,
|
||||
OCHTaxiServiceCallback<OrdersNewBookingQueryRespBean> callback) {
|
||||
TaxiServiceCallback<OrdersNewBookingQueryRespBean> callback) {
|
||||
mOCHTaxiServiceApi.queryNewBookingOrder(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
@@ -96,7 +96,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param callback
|
||||
*/
|
||||
public void grabOrder(Context context, String orderNo,
|
||||
OCHTaxiServiceCallback<OrderGrabRespBean> callback) {
|
||||
TaxiServiceCallback<OrderGrabRespBean> callback) {
|
||||
mOCHTaxiServiceApi.grabOrder(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new OrderGrabReqBean(
|
||||
@@ -113,7 +113,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param callback
|
||||
*/
|
||||
public void queryOrderGrabStatus(Context context, String orderNo,
|
||||
OCHTaxiServiceCallback<OrderGrabStatusQueryRespBean> callback) {
|
||||
TaxiServiceCallback<OrderGrabStatusQueryRespBean> callback) {
|
||||
mOCHTaxiServiceApi.queryOrderGrabStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new OrderGrabReqBean(
|
||||
@@ -130,7 +130,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param callback
|
||||
*/
|
||||
public void queryOrderRouteInfo(Context context, String orderNo,
|
||||
OCHTaxiServiceCallback<OrderQueryRouteInfoRespBean> callback) {
|
||||
TaxiServiceCallback<OrderQueryRouteInfoRespBean> callback) {
|
||||
mOCHTaxiServiceApi.queryOrderRouteInfo(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new OrderQueryRouteInfoReqBean(
|
||||
@@ -148,7 +148,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @deprecated v2.1_0930需求中暂不再使用此接口
|
||||
*/
|
||||
public void queryOrderById(Context context, String orderNo,
|
||||
OCHTaxiServiceCallback<OrderQueryRespBean> callback) {
|
||||
TaxiServiceCallback<OrderQueryRespBean> callback) {
|
||||
mOCHTaxiServiceApi.queryOrderById(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new OrderQueryReqBean(
|
||||
@@ -166,7 +166,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @deprecated v2.1_0930需求中暂不再使用此接口
|
||||
*/
|
||||
public void queryOrderInService(Context context,
|
||||
OCHTaxiServiceCallback<OrderQueryRespBean> callback) {
|
||||
TaxiServiceCallback<OrderQueryRespBean> callback) {
|
||||
mOCHTaxiServiceApi.queryOrderInService(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
@@ -178,13 +178,13 @@ public class OCHTaxiServiceManagerNew {
|
||||
/**
|
||||
* 司机取消订单
|
||||
* @param context
|
||||
* @param orderId
|
||||
* @param orderNo
|
||||
* @param cancelType
|
||||
* @param cancelReason
|
||||
* @param callback
|
||||
*/
|
||||
public void cancelOrder(Context context, String orderNo, int cancelType, String cancelReason,
|
||||
OCHTaxiServiceCallback<BaseData> callback) {
|
||||
TaxiServiceCallback<BaseData> callback) {
|
||||
mOCHTaxiServiceApi.cancelOrder(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new OrderCancelReqBean(
|
||||
@@ -202,7 +202,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param callback
|
||||
*/
|
||||
public void queryOrdersList(Context context, int page, int size,
|
||||
OCHTaxiServiceCallback<OrdersListQueryRespBean> callback) {
|
||||
TaxiServiceCallback<OrdersListQueryRespBean> callback) {
|
||||
mOCHTaxiServiceApi.queryOrdersList(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new OrdersListQueryReqBean(
|
||||
@@ -220,7 +220,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param callback
|
||||
*/
|
||||
public void updateOrderStatus(Context context, String orderNo, int orderStatus,
|
||||
OCHTaxiServiceCallback<BaseData> callback) {
|
||||
TaxiServiceCallback<BaseData> callback) {
|
||||
mOCHTaxiServiceApi.updateOrderStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new OrderStatusUpdateReqBean(
|
||||
@@ -237,7 +237,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param callback
|
||||
*/
|
||||
public void updateDriverServiceStatus(Context context, int status,
|
||||
OCHTaxiServiceCallback<BaseData> callback) {
|
||||
TaxiServiceCallback<BaseData> callback) {
|
||||
mOCHTaxiServiceApi.updateDriverServiceStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new DriverStatusUpdateReqBean(
|
||||
@@ -253,7 +253,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param callback
|
||||
*/
|
||||
public void queryDriverServiceStatus(Context context,
|
||||
OCHTaxiServiceCallback<DriverStatusQueryRespBean> callback) {
|
||||
TaxiServiceCallback<DriverStatusQueryRespBean> callback) {
|
||||
mOCHTaxiServiceApi.queryDriverServiceStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
@@ -270,7 +270,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param callback
|
||||
*/
|
||||
public void runCarHeartbeat(Context context, double lon, double lat,
|
||||
OCHTaxiServiceCallback<BaseData> callback) {
|
||||
TaxiServiceCallback<BaseData> callback) {
|
||||
mOCHTaxiServiceApi.runCarHeartbeat(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new CarHeartbeatReqBean(
|
||||
@@ -286,7 +286,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param callback
|
||||
*/
|
||||
public void queryDriverServiceData(Context context,
|
||||
OCHTaxiServiceCallback<DriverServiceDataRespBean> callback) {
|
||||
TaxiServiceCallback<DriverServiceDataRespBean> callback) {
|
||||
mOCHTaxiServiceApi.queryServiceData(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
@@ -302,7 +302,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param callback
|
||||
*/
|
||||
public void updateOrderRoute(Context context, String orderNo, List<OrderRouteUpdateReqBean.Result> points,
|
||||
OCHTaxiServiceCallback<BaseData> callback){
|
||||
TaxiServiceCallback<BaseData> callback){
|
||||
mOCHTaxiServiceApi.updateOrderRoute(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new OrderRouteUpdateReqBean(orderNo,points))
|
||||
@@ -319,8 +319,8 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param duration
|
||||
* @param callback
|
||||
*/
|
||||
public void reportOrderRemain(Context context, String orderNo,long distance, long duration
|
||||
,OCHTaxiServiceCallback<BaseData> callback){
|
||||
public void reportOrderRemain(Context context, String orderNo, long distance, long duration
|
||||
, TaxiServiceCallback<BaseData> callback){
|
||||
|
||||
mOCHTaxiServiceApi.reportOrderRemain(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
@@ -336,7 +336,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
* @param orderNo
|
||||
* @param callback
|
||||
*/
|
||||
public void queryOrderRoute(Context context, String orderNo,OCHTaxiServiceCallback<QueryOrderRouteResp> callback) {
|
||||
public void queryOrderRoute(Context context, String orderNo, TaxiServiceCallback<QueryOrderRouteResp> callback) {
|
||||
mOCHTaxiServiceApi.queryOrderRoute(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,orderNo)
|
||||
@@ -346,7 +346,7 @@ public class OCHTaxiServiceManagerNew {
|
||||
}
|
||||
|
||||
private <T extends BaseData> SubscribeImpl getSubscribeImpl(
|
||||
Context context, OCHTaxiServiceCallback<T> callback, String apiName) {
|
||||
Context context, TaxiServiceCallback<T> callback, String apiName) {
|
||||
return new SubscribeImpl<T>(RequestOptions.create(context)) {
|
||||
@Override
|
||||
public void onSuccess(T o) {
|
||||
@@ -15,15 +15,15 @@ import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.taxi.constant.OrderStatusEnum;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.taxi.callback.IOCHTaxiADASStatusCallback;
|
||||
import com.mogo.och.taxi.callback.IOCHTaxiCarStatusCallback;
|
||||
import com.mogo.och.taxi.callback.IOCHTaxiControllerStatusCallback;
|
||||
import com.mogo.och.taxi.callback.IOCHTaxiOrderStatusCallback;
|
||||
import com.mogo.och.taxi.model.MogoOCHTaxiModelNew;
|
||||
import com.mogo.och.taxi.ui.OCHTaxiFragment;
|
||||
import com.mogo.och.taxi.callback.ITaxiADASStatusCallback;
|
||||
import com.mogo.och.taxi.callback.ITaxiCarStatusCallback;
|
||||
import com.mogo.och.taxi.callback.ITaxiControllerStatusCallback;
|
||||
import com.mogo.och.taxi.callback.ITaxiOrderStatusCallback;
|
||||
import com.mogo.och.taxi.model.TaxiModel;
|
||||
import com.mogo.och.taxi.ui.TaxiFragment;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -35,14 +35,14 @@ import java.util.List;
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
public class OCHTaxiPresenter extends Presenter<OCHTaxiFragment> implements IOCHTaxiADASStatusCallback,
|
||||
IOCHTaxiCarStatusCallback, IOCHTaxiOrderStatusCallback, IOCHTaxiControllerStatusCallback {
|
||||
public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASStatusCallback,
|
||||
ITaxiCarStatusCallback, ITaxiOrderStatusCallback, ITaxiControllerStatusCallback {
|
||||
|
||||
private static final String TAG = OCHTaxiPresenter.class.getSimpleName();
|
||||
private static final String TAG = TaxiPresenter.class.getSimpleName();
|
||||
|
||||
public OCHTaxiPresenter(OCHTaxiFragment view) {
|
||||
public TaxiPresenter(TaxiFragment view) {
|
||||
super(view);
|
||||
MogoOCHTaxiModelNew.getInstance().init(AbsMogoApplication.getApp());
|
||||
TaxiModel.getInstance().init(AbsMogoApplication.getApp());
|
||||
initListeners();
|
||||
}
|
||||
|
||||
@@ -57,23 +57,23 @@ public class OCHTaxiPresenter extends Presenter<OCHTaxiFragment> implements IOCH
|
||||
super.onDestroy( owner );
|
||||
|
||||
releaseListeners();
|
||||
MogoOCHTaxiModelNew.getInstance().release();
|
||||
TaxiModel.getInstance().release();
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
MogoOCHTaxiModelNew.getInstance().setADASStatusCallback(this);
|
||||
MogoOCHTaxiModelNew.getInstance().setCarStatusCallback(this);
|
||||
MogoOCHTaxiModelNew.getInstance().setControllerStatusCallback(this);
|
||||
MogoOCHTaxiModelNew.getInstance().setOrderStatusCallback(this);
|
||||
// MogoOCHTaxiModelNew.getInstance().setMoGoAutopilotPlanningListener(this);
|
||||
TaxiModel.getInstance().setADASStatusCallback(this);
|
||||
TaxiModel.getInstance().setCarStatusCallback(this);
|
||||
TaxiModel.getInstance().setControllerStatusCallback(this);
|
||||
TaxiModel.getInstance().setOrderStatusCallback(this);
|
||||
// TaxiModel.getInstance().setMoGoAutopilotPlanningListener(this);
|
||||
}
|
||||
|
||||
private void releaseListeners() {
|
||||
MogoOCHTaxiModelNew.getInstance().setADASStatusCallback(null);
|
||||
MogoOCHTaxiModelNew.getInstance().setCarStatusCallback(null);
|
||||
MogoOCHTaxiModelNew.getInstance().setControllerStatusCallback(null);
|
||||
MogoOCHTaxiModelNew.getInstance().setOrderStatusCallback(null);
|
||||
// MogoOCHTaxiModelNew.getInstance().setMoGoAutopilotPlanningListener(null);
|
||||
TaxiModel.getInstance().setADASStatusCallback(null);
|
||||
TaxiModel.getInstance().setCarStatusCallback(null);
|
||||
TaxiModel.getInstance().setControllerStatusCallback(null);
|
||||
TaxiModel.getInstance().setOrderStatusCallback(null);
|
||||
// TaxiModel.getInstance().setMoGoAutopilotPlanningListener(null);
|
||||
}
|
||||
|
||||
private void runOnUIThread( Runnable executor ) {
|
||||
@@ -89,57 +89,57 @@ public class OCHTaxiPresenter extends Presenter<OCHTaxiFragment> implements IOCH
|
||||
|
||||
// 开启自动驾驶
|
||||
public void startAutoPilot() {
|
||||
MogoOCHTaxiModelNew.getInstance().startAutoPilot();
|
||||
TaxiModel.getInstance().startAutoPilot();
|
||||
}
|
||||
|
||||
// 更新出车/收车状态
|
||||
public void updateCarStatus() {
|
||||
MogoOCHTaxiModelNew.getInstance().updateCarStatus();
|
||||
TaxiModel.getInstance().updateCarStatus();
|
||||
}
|
||||
|
||||
// 更新当前订单状态(当前订单状态流转)
|
||||
public void updateCurOrderStatus(OrderStatusEnum status) {
|
||||
MogoOCHTaxiModelNew.getInstance().updateOCHOrderStatus(status);
|
||||
public void updateCurOrderStatus(TaxiOrderStatusEnum status) {
|
||||
TaxiModel.getInstance().updateOCHOrderStatus(status);
|
||||
}
|
||||
|
||||
// 获取当前订单状态
|
||||
public OrderStatusEnum getCurOrderStatus() {
|
||||
return MogoOCHTaxiModelNew.getInstance().getCurOrderStatus();
|
||||
public TaxiOrderStatusEnum getCurOrderStatus() {
|
||||
return TaxiModel.getInstance().getCurOrderStatus();
|
||||
}
|
||||
|
||||
// 取消当前订单
|
||||
public void cancelCurOrder(int reasonType, String reason) {
|
||||
MogoOCHTaxiModelNew.getInstance().cancelCurrentOrder(reasonType, reason);
|
||||
TaxiModel.getInstance().cancelCurrentOrder(reasonType, reason);
|
||||
}
|
||||
|
||||
// 取消待服务中订单
|
||||
public void cancelOrderById(String orderNo, int reasonType, String reason) {
|
||||
MogoOCHTaxiModelNew.getInstance().cancelOrderById(orderNo, reasonType, reason);
|
||||
TaxiModel.getInstance().cancelOrderById(orderNo, reasonType, reason);
|
||||
}
|
||||
|
||||
// 查询当前订单route信息:预估时间、里程等
|
||||
public void queryCurOrderRouteInfo() {
|
||||
MogoOCHTaxiModelNew.getInstance().queryCurOrderRouteInfo();
|
||||
TaxiModel.getInstance().queryCurOrderRouteInfo();
|
||||
}
|
||||
|
||||
// 获取全部订单列表
|
||||
public void queryOrdersList(int page, int size) {
|
||||
MogoOCHTaxiModelNew.getInstance().queryOrdersList(page, size);
|
||||
TaxiModel.getInstance().queryOrdersList(page, size);
|
||||
}
|
||||
|
||||
// 执行抢单动作
|
||||
public void grabOrder() {
|
||||
MogoOCHTaxiModelNew.getInstance().grabOrder();
|
||||
TaxiModel.getInstance().grabOrder();
|
||||
}
|
||||
|
||||
// 关闭新到预约单
|
||||
public void cancelNewBookingOrder() {
|
||||
MogoOCHTaxiModelNew.getInstance().cancelNewBookingOrder();
|
||||
TaxiModel.getInstance().cancelNewBookingOrder();
|
||||
}
|
||||
|
||||
// 查询司机服务数据
|
||||
public void queryDriverServiceData() {
|
||||
MogoOCHTaxiModelNew.getInstance().queryDriverServiceData();
|
||||
TaxiModel.getInstance().queryDriverServiceData();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -149,27 +149,30 @@ public class OCHTaxiPresenter extends Presenter<OCHTaxiFragment> implements IOCH
|
||||
|
||||
@Override
|
||||
public void onAutopilotEnable() {
|
||||
mView.updateAutopilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE);
|
||||
runOnUIThread(() -> mView.updateAutopilotStatus(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotDisable() {
|
||||
mView.updateAutopilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE);
|
||||
runOnUIThread(() -> mView.updateAutopilotStatus(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRunning() {
|
||||
mView.updateAutopilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
|
||||
runOnUIThread(() -> mView.updateAutopilotStatus(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarStatusChanged(boolean inOperation, String role) {
|
||||
mView.updateOperationStatus(inOperation,role);
|
||||
runOnUIThread(() -> mView.updateOperationStatus(inOperation,role));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDataUpdate(long dailyTimeDuration, long dailyOrderNum) {
|
||||
mView.onServiceDataUpdate(dailyTimeDuration,dailyOrderNum);
|
||||
runOnUIThread(() -> mView.onServiceDataUpdate(dailyTimeDuration,dailyOrderNum));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -179,72 +182,72 @@ public class OCHTaxiPresenter extends Presenter<OCHTaxiFragment> implements IOCH
|
||||
|
||||
@Override
|
||||
public void onOrdersWaitServiceChanged(@NonNull @NotNull List<OrderQueryRespBean.Result> waitServiceList) {
|
||||
mView.onOrdersWaitServiceChanged(waitServiceList);
|
||||
runOnUIThread(() -> mView.onOrdersWaitServiceChanged(waitServiceList));
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.P)
|
||||
@Override
|
||||
public void onCurrentOrderStatusChanged(OrderQueryRespBean.Result order) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG,"order = "+order.toString());
|
||||
if (OrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus){
|
||||
MogoOCHTaxiModelNew.getInstance().startDynamicCalculateRouteInfo();
|
||||
if (TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus){
|
||||
TaxiModel.getInstance().startDynamicCalculateRouteInfo();
|
||||
}
|
||||
if (OrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus ||
|
||||
OrderStatusEnum.Cancel.getCode() == order.orderStatus ||
|
||||
OrderStatusEnum.JourneyCompleted.getCode() == order.orderStatus){
|
||||
MogoOCHTaxiModelNew.getInstance().startOrStopCalculateRouteInfo(false);
|
||||
if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus ||
|
||||
TaxiOrderStatusEnum.Cancel.getCode() == order.orderStatus ||
|
||||
TaxiOrderStatusEnum.JourneyCompleted.getCode() == order.orderStatus){
|
||||
TaxiModel.getInstance().startOrStopCalculateRouteInfo(false);
|
||||
}
|
||||
mView.updateCurrentOrderStatusChanged(order);
|
||||
runOnUIThread(() -> mView.updateCurrentOrderStatusChanged(order));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCurrentOrderCancelDone() {
|
||||
mView.onCurrentOrderCancelDone();
|
||||
runOnUIThread(() -> mView.onCurrentOrderCancelDone());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOrderCancelDone(String orderNo) {
|
||||
mView.onOrderCancelDone(orderNo);
|
||||
runOnUIThread(() -> mView.onOrderCancelDone(orderNo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCurrentOrderRouteInfoGot(OrderQueryRouteInfoRespBean.Result routeInfo) {
|
||||
mView.onCurrentOrderRouteInfoGot(routeInfo);
|
||||
runOnUIThread(() -> mView.onCurrentOrderRouteInfoGot(routeInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCurrentOrderDistToStartChanged(long meters, long timeInSecond) {
|
||||
mView.onCurrentOrderDistToStartChanged(meters,timeInSecond);
|
||||
runOnUIThread(() -> mView.onCurrentOrderDistToStartChanged(meters,timeInSecond));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCurrentOrderDistToEndChanged(long meters, long timeInSecond) {
|
||||
mView.onCurrentOrderDistToEndChanged(meters,timeInSecond);
|
||||
runOnUIThread(() -> mView.onCurrentOrderDistToEndChanged(meters,timeInSecond));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOrdersListPageRefresh(List<OrderQueryRespBean.Result> ordersList) {
|
||||
mView.onOrdersListPageRefresh(ordersList);
|
||||
runOnUIThread(() -> mView.onOrdersListPageRefresh(ordersList));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewBookingOrderGot(OrderQueryRespBean.Result order) {
|
||||
mView.onNewBookingOrderGot(order);
|
||||
runOnUIThread(() -> mView.onNewBookingOrderGot(order));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGrabOrderExecuteDone() {
|
||||
mView.onGrabOrderExecuteDone();
|
||||
runOnUIThread(() -> mView.onGrabOrderExecuteDone());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGrabOrderSuccess(OrderQueryRespBean.Result order) {
|
||||
mView.onGrabOrderSuccess(order);
|
||||
runOnUIThread(() -> mView.onGrabOrderSuccess(order));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGrabOrderFailed(OrderQueryRespBean.Result order) {
|
||||
mView.onGrabOrderFailed(order);
|
||||
runOnUIThread(() -> mView.onGrabOrderFailed(order));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -255,8 +258,10 @@ public class OCHTaxiPresenter extends Presenter<OCHTaxiFragment> implements IOCH
|
||||
@Override
|
||||
public void onCarLocationChanged(Location location) {
|
||||
if (null != location){
|
||||
runOnUIThread(() -> mView.updateSpeedView(location.getSpeed()));
|
||||
mView.updateLocation(location.getLatitude(),location.getLongitude());
|
||||
runOnUIThread(() -> {
|
||||
mView.updateSpeedView(location.getSpeed());
|
||||
mView.updateLocation(location.getLatitude(),location.getLongitude());
|
||||
});
|
||||
}
|
||||
}
|
||||
// @Override
|
||||
@@ -28,11 +28,11 @@ import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||
@@ -46,7 +46,6 @@ import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.och.taxi.R;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
|
||||
@@ -57,7 +56,7 @@ import record_cache.RecordPanelOuterClass;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public abstract class BaseOchTaxiTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener, IMoGoAutopilotIdentifyListener {
|
||||
public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener, IMoGoAutopilotRecordListener {
|
||||
|
||||
private static final String TAG = "BaseOchFragment";
|
||||
private LinearLayout ctvAutopilotStatus;
|
||||
@@ -76,7 +75,7 @@ public abstract class BaseOchTaxiTabFragment<V extends IView, P extends Presente
|
||||
protected RelativeLayout mSettingBtn;
|
||||
protected ImageView mBadcaseBtn;
|
||||
protected ImageView mUpgradeTipIv;
|
||||
protected OCHNaviFragment ochNaviFragment = null;
|
||||
protected TaxiNaviFragment ochNaviFragment = null;
|
||||
// protected TaxiTrafficLightView mTrafficLightView;
|
||||
|
||||
private Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
@@ -160,7 +159,7 @@ public abstract class BaseOchTaxiTabFragment<V extends IView, P extends Presente
|
||||
if (mBadcaseBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn, null, null);
|
||||
if (!HmiBuildConfig.isShowBadCaseView) {
|
||||
CallerAutopilotIdentifyListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
}
|
||||
//设置升级小红点提示 默认隐藏
|
||||
@@ -270,7 +269,7 @@ public abstract class BaseOchTaxiTabFragment<V extends IView, P extends Presente
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
if (!HmiBuildConfig.isShowBadCaseView) {
|
||||
CallerAutopilotIdentifyListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,10 +280,6 @@ public abstract class BaseOchTaxiTabFragment<V extends IView, P extends Presente
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotWarnMessage(MessagePad.Warn warn) {
|
||||
}
|
||||
|
||||
public void showNotice(String notice) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(notice);
|
||||
@@ -472,7 +467,9 @@ public abstract class BaseOchTaxiTabFragment<V extends IView, P extends Presente
|
||||
|
||||
public void changeOperationViewVisible(int visible) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (tvOperationStatus == null) return;
|
||||
if (tvOperationStatus == null) {
|
||||
return;
|
||||
}
|
||||
tvOperationStatus.setVisibility(visible);
|
||||
});
|
||||
}
|
||||
@@ -501,7 +498,7 @@ public abstract class BaseOchTaxiTabFragment<V extends IView, P extends Presente
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
if (isShow) {
|
||||
// if (ochNaviFragment == null){
|
||||
ochNaviFragment = OCHNaviFragment.newInstance();
|
||||
ochNaviFragment = TaxiNaviFragment.newInstance();
|
||||
// }
|
||||
if (ochNaviFragment.isAdded()) {
|
||||
return;
|
||||
@@ -13,7 +13,7 @@ import android.util.TypedValue;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.callback.Shadow;
|
||||
import com.mogo.och.taxi.callback.IShadow;
|
||||
import com.mogo.och.taxi.utils.DimenUtil;
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ public class BorderShadowLayout extends LinearLayout {
|
||||
int left =0 ,right =0,top = 0,bottom = 0 ;
|
||||
|
||||
//代理方式
|
||||
private Shadow shadow = new BorderShadowLayout.ShadowConfig(this);
|
||||
private IShadow shadow = new BorderShadowLayout.ShadowConfig(this);
|
||||
|
||||
private float mWidthMode;
|
||||
private float mHeightMode;
|
||||
@@ -153,7 +153,7 @@ public class BorderShadowLayout extends LinearLayout {
|
||||
* 获取阴影设置
|
||||
* @return 返回阴影设置配置
|
||||
*/
|
||||
public Shadow getShadowConfig(){
|
||||
public IShadow getShadowConfig(){
|
||||
return shadow;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ public class BorderShadowLayout extends LinearLayout {
|
||||
/**
|
||||
* 阴影配置
|
||||
*/
|
||||
class ShadowConfig implements Shadow{
|
||||
class ShadowConfig implements IShadow {
|
||||
|
||||
//代理
|
||||
private BorderShadowLayout shadow;
|
||||
@@ -254,12 +254,12 @@ public class BorderShadowLayout extends LinearLayout {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shadow setShadowRadius(float radius) {
|
||||
public IShadow setShadowRadius(float radius) {
|
||||
return setShadowRadius(TypedValue.COMPLEX_UNIT_DIP,radius);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shadow setShadowRadius(int unit, float radius) {
|
||||
public IShadow setShadowRadius(int unit, float radius) {
|
||||
Context c = getContext();
|
||||
Resources r;
|
||||
|
||||
@@ -273,24 +273,24 @@ public class BorderShadowLayout extends LinearLayout {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shadow setShadowColor(int color) {
|
||||
public IShadow setShadowColor(int color) {
|
||||
shadow.shadowColor = color;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shadow setShadowColorRes(int colorRes) {
|
||||
public IShadow setShadowColorRes(int colorRes) {
|
||||
shadow.shadowColor = shadow.getResources().getColor(colorRes);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shadow setBlurRadius(float radius) {
|
||||
public IShadow setBlurRadius(float radius) {
|
||||
return setBlurRadius(TypedValue.COMPLEX_UNIT_DIP,radius);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shadow setBlurRadius(int unit, float radius) {
|
||||
public IShadow setBlurRadius(int unit, float radius) {
|
||||
Context c = getContext();
|
||||
Resources r;
|
||||
if (c == null) {
|
||||
@@ -303,12 +303,12 @@ public class BorderShadowLayout extends LinearLayout {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shadow setXOffset(float offset) {
|
||||
public IShadow setXOffset(float offset) {
|
||||
return setXOffset(TypedValue.COMPLEX_UNIT_DIP,offset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shadow setXOffset(int unit, float offset) {
|
||||
public IShadow setXOffset(int unit, float offset) {
|
||||
Context c = getContext();
|
||||
Resources r;
|
||||
if (c == null) {
|
||||
@@ -326,12 +326,12 @@ public class BorderShadowLayout extends LinearLayout {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shadow setYOffset(float offset) {
|
||||
public IShadow setYOffset(float offset) {
|
||||
return setYOffset(TypedValue.COMPLEX_UNIT_DIP,offset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shadow setYOffset(int unit, float offset) {
|
||||
public IShadow setYOffset(int unit, float offset) {
|
||||
Context c = getContext();
|
||||
Resources r;
|
||||
if (c == null) {
|
||||
|
||||
@@ -9,5 +9,5 @@ public
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
interface OCHTaxiView extends IView {
|
||||
interface ITaxiView extends IView {
|
||||
}
|
||||
@@ -28,15 +28,15 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.och.taxi.callback.IOCHTaxiNaviChangedCallback;
|
||||
import com.mogo.och.taxi.constant.OCHTaxiConst;
|
||||
import com.mogo.och.taxi.constant.OrderStatusEnum;
|
||||
import com.mogo.och.taxi.callback.ITaxiNaviChangedCallback;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.taxi.model.MogoOCHTaxiModelNew;
|
||||
import com.mogo.och.taxi.model.TaxiModel;
|
||||
import com.mogo.och.taxi.model.NaviToDestinationModel;
|
||||
import com.mogo.och.taxi.utils.OchTaxiUtils;
|
||||
import com.mogo.och.taxi.utils.TaxiDateTimeUtil;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
@@ -46,23 +46,23 @@ import java.util.List;
|
||||
* @since 2021/1/18
|
||||
* 正在进行中订单
|
||||
*/
|
||||
public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implements View.OnClickListener, IOCHTaxiNaviChangedCallback {
|
||||
public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implements View.OnClickListener, ITaxiNaviChangedCallback {
|
||||
|
||||
public static final String TAG = "OCHTaxiBeingServerd";
|
||||
private static Activity mActivity;
|
||||
private static OCHTaxiFragment mTaxiFragment;
|
||||
private static TaxiFragment mTaxiFragment;
|
||||
private String mOrderNo;
|
||||
private double mOrderStartStationLat = 0;
|
||||
private double mOrderStartStationLng = 0;
|
||||
private volatile int mTtsLessThan200Tip = 0;//离终点200米提示播报
|
||||
private OrderQueryRespBean.Result mCurrentOrder = null;
|
||||
|
||||
public static OCHTaxiBeingServerdOrdersFragment newInstance(Activity activity, OCHTaxiFragment taxiFragment) {
|
||||
public static TaxiBeingServerdOrdersFragment newInstance(Activity activity, TaxiFragment taxiFragment) {
|
||||
mActivity = activity;
|
||||
mTaxiFragment = taxiFragment;
|
||||
Bundle args = new Bundle();
|
||||
|
||||
OCHTaxiBeingServerdOrdersFragment fragment = new OCHTaxiBeingServerdOrdersFragment();
|
||||
TaxiBeingServerdOrdersFragment fragment = new TaxiBeingServerdOrdersFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
MogoOCHTaxiModelNew.getInstance().startOrStopOrderLoop();
|
||||
TaxiModel.getInstance().startOrStopOrderLoop();
|
||||
}
|
||||
|
||||
private void initNaviView(View view) {
|
||||
@@ -152,14 +152,14 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
@RequiresApi(api = Build.VERSION_CODES.P)
|
||||
public void updateCurrentOrderStatusChanged(OrderQueryRespBean.Result order) {
|
||||
if (order == null) return;
|
||||
if (order.orderStatus == OrderStatusEnum.JourneyCompleted.getCode()) {
|
||||
if (order.orderStatus == TaxiOrderStatusEnum.JourneyCompleted.getCode()) {
|
||||
mCurrentOrder = null;
|
||||
isHaveBeingOrder(false);
|
||||
return;
|
||||
}
|
||||
mOrderNo = order.orderNo;
|
||||
onOrderStatusChanged(order);
|
||||
if (OrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus) {
|
||||
if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus) {
|
||||
mTaxiFragment.queryCurOrderRouteInfo();
|
||||
mContentModule3.setVisibility(View.GONE);
|
||||
mContentModule2.setVisibility(View.VISIBLE);
|
||||
@@ -177,7 +177,7 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
// String strHtml2 = "<font color=\"#CAD6FF\">距离 </font>" + "<b><font color=\"#FFFFFF\">- -</font></b>" + "<font color=\"#CAD6FF\"> 公里,</font>"
|
||||
// + "<font color=\"#CAD6FF\">用时 </font>" + "<b><font color=\"#FFFFFF\">- -</font></b>" + "<font color=\"#CAD6FF\"> 分钟</font>";
|
||||
// mDistanceAndTime.setText(Html.fromHtml(strHtml2));
|
||||
} else if (OrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus) {
|
||||
} else if (TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "已经去往终点");
|
||||
mContentModule3.setVisibility(View.GONE);
|
||||
mContentModule2.setVisibility(View.VISIBLE);
|
||||
@@ -190,7 +190,7 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
|
||||
mTitleTV2.setText("送乘客至");
|
||||
mStationTv2.setText(order.endSiteAddr);
|
||||
} else if (OrderStatusEnum.ArriveAtStart.getCode() == order.orderStatus) {
|
||||
} else if (TaxiOrderStatusEnum.ArriveAtStart.getCode() == order.orderStatus) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "已经达到起点");
|
||||
mContentModule2.setVisibility(View.GONE);
|
||||
mContentModule3.setVisibility(View.VISIBLE);
|
||||
@@ -205,8 +205,8 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
mOrderServerStatus.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
mOrderServerStatus.setClickable(true);
|
||||
Calendar currentCale = DateTimeUtils.getCurrentDateTime();
|
||||
String currentHM = OchTaxiUtils.formatCalendarToString(currentCale, OchTaxiUtils.TAXI_HH_mm);
|
||||
String currentDay = OchTaxiUtils.formatCalendarToString(currentCale, OchTaxiUtils.TAXI_yyyy_MM_dd);
|
||||
String currentHM = TaxiDateTimeUtil.formatCalendarToString(currentCale, TaxiDateTimeUtil.TAXI_HH_mm);
|
||||
String currentDay = TaxiDateTimeUtil.formatCalendarToString(currentCale, TaxiDateTimeUtil.TAXI_yyyy_MM_dd);
|
||||
String strHtml11 = "<font color=\"#CAD6FF\">已于</font><br>"
|
||||
+ "<b><font color=\"#FFFFFF\"><big><big>" + currentHM + "</big></big></font></b>"
|
||||
+ "<font color=\"#CAD6FF\">" + " " + "到达乘客上车地点</font>";
|
||||
@@ -218,16 +218,16 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
mStationTv32.setText(order.endSiteAddr);
|
||||
currentCale.add(Calendar.MINUTE, 10);
|
||||
String strHtml13 = "";
|
||||
if (currentDay.equals(OchTaxiUtils.formatCalendarToString(currentCale, OchTaxiUtils.TAXI_yyyy_MM_dd))) {
|
||||
if (currentDay.equals(TaxiDateTimeUtil.formatCalendarToString(currentCale, TaxiDateTimeUtil.TAXI_yyyy_MM_dd))) {
|
||||
strHtml13 = "<font color=\"#CAD6FF\">免费等待至 </font>"
|
||||
+ "<b><font color=\"#FFFFFF\"><big>" + OchTaxiUtils.formatCalendarToString(currentCale, OchTaxiUtils.TAXI_HH_mm) + "</big></b></font>";
|
||||
+ "<b><font color=\"#FFFFFF\"><big>" + TaxiDateTimeUtil.formatCalendarToString(currentCale, TaxiDateTimeUtil.TAXI_HH_mm) + "</big></b></font>";
|
||||
|
||||
} else {
|
||||
strHtml13 = "<font color=\"#CAD6FF\">免费等待至</font>"
|
||||
+ "<font color=\"#FFFFFF\"><big>" + OchTaxiUtils.formatCalendarToString(currentCale, OchTaxiUtils.TAXI_MM_dd_HH_mm) + "</big></font>";
|
||||
+ "<font color=\"#FFFFFF\"><big>" + TaxiDateTimeUtil.formatCalendarToString(currentCale, TaxiDateTimeUtil.TAXI_MM_dd_HH_mm) + "</big></font>";
|
||||
}
|
||||
mDistanceAndTime3.setText(Html.fromHtml(strHtml13));
|
||||
} else if (MogoOCHTaxiModelNew.getInstance().checkCurrentOCHOrder()) {
|
||||
} else if (TaxiModel.getInstance().checkCurrentOCHOrder()) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "前往乘客上车地点");
|
||||
mContentModule2.setVisibility(View.GONE);
|
||||
mContentModule3.setVisibility(View.VISIBLE);
|
||||
@@ -249,17 +249,17 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
// + "<font color=\"#CAD6FF\">接乘客</font>";
|
||||
mStationTv31.setText(order.startSiteAddr);
|
||||
Calendar currentCale = DateTimeUtils.getCurrentDateTime();
|
||||
Calendar startCale = OchTaxiUtils.formatLongToCalendar(order.bookingTime);
|
||||
String currentDay = OchTaxiUtils.formatCalendarToString(currentCale, OchTaxiUtils.TAXI_yyyy_MM_dd);
|
||||
String startDay = OchTaxiUtils.formatCalendarToString(startCale, OchTaxiUtils.TAXI_yyyy_MM_dd);
|
||||
Calendar startCale = TaxiDateTimeUtil.formatLongToCalendar(order.bookingTime);
|
||||
String currentDay = TaxiDateTimeUtil.formatCalendarToString(currentCale, TaxiDateTimeUtil.TAXI_yyyy_MM_dd);
|
||||
String startDay = TaxiDateTimeUtil.formatCalendarToString(startCale, TaxiDateTimeUtil.TAXI_yyyy_MM_dd);
|
||||
String strHtml1 = "";
|
||||
if (currentDay.equals(startDay)) {
|
||||
strHtml1 = "<font color=\"#CAD6FF\">乘客将于</font><br>"
|
||||
+ "<b><font color=\"#FFFFFF\"><big><big>" + OchTaxiUtils.formatCalendarToString(startCale, OchTaxiUtils.TAXI_HH_mm) + "</big></big></font></b>"
|
||||
+ "<b><font color=\"#FFFFFF\"><big><big>" + TaxiDateTimeUtil.formatCalendarToString(startCale, TaxiDateTimeUtil.TAXI_HH_mm) + "</big></big></font></b>"
|
||||
+ "<font color=\"#CAD6FF\"> 用车</font>";
|
||||
} else {
|
||||
strHtml1 = "<font color=\"#CAD6FF\">乘客将于</font><br>"
|
||||
+ "<b><font color=\"#FFFFFF\"><big><big>" + OchTaxiUtils.formatCalendarToString(startCale, OchTaxiUtils.TAXI_MM_dd_HH_mm) + "</big></big></font></b>"
|
||||
+ "<b><font color=\"#FFFFFF\"><big><big>" + TaxiDateTimeUtil.formatCalendarToString(startCale, TaxiDateTimeUtil.TAXI_MM_dd_HH_mm) + "</big></big></font></b>"
|
||||
+ "<font color=\"#CAD6FF\"> 用车</font>";
|
||||
}
|
||||
mOrderOtherContent3.setText(Html.fromHtml(strHtml1));
|
||||
@@ -301,7 +301,7 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
dis = String.valueOf(Math.round(meters));
|
||||
}else {
|
||||
disUnit = "公里";
|
||||
dis = OchTaxiUtils.formatLong((double)meters / 1000);
|
||||
dis = TaxiDateTimeUtil.formatLong((double)meters / 1000);
|
||||
}
|
||||
}
|
||||
String strHtml2 = "<font color=\"#CAD6FF\">里程 </font>" + "<b><font color=\"#FFFFFF\">" + dis + "</font></b>" + "<font color=\"#CAD6FF\"> "+disUnit+"</font>"
|
||||
@@ -334,7 +334,7 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
|
||||
if (routeInfo.distanceToEnd > 0){
|
||||
|
||||
dis = OchTaxiUtils.formatLong( (double) distance/ 1000);
|
||||
dis = TaxiDateTimeUtil.formatLong( (double) distance/ 1000);
|
||||
}
|
||||
|
||||
String strHtml2 = "<font color=\"#CAD6FF\">距离 </font>" + "<b><font color=\"#FFFFFF\">" + dis + "</font></b>" + "<font color=\"#CAD6FF\"> 公里</font>"
|
||||
@@ -355,7 +355,7 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
private void startOrEndService(String step) {
|
||||
if (step.equals(getResources().getString(R.string.module_och_taxi_order_server_end))) {//点击了完成服务,结束订单并更新订单信息
|
||||
// isHaveBeingOrder(false);
|
||||
mTaxiFragment.completeOrderService(OrderStatusEnum.JourneyCompleted);
|
||||
mTaxiFragment.completeOrderService(TaxiOrderStatusEnum.JourneyCompleted);
|
||||
showNotice(getResources().getString(R.string.module_och_taxi_order_server_completed_tip));
|
||||
return;
|
||||
} else if (step.equals(getResources().getString(R.string.module_och_taxi_order_server_start))) {//点击服务,开启自动驾驶
|
||||
@@ -369,14 +369,14 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "status==" + status);
|
||||
mCurrentOrder = order;
|
||||
mActivity.runOnUiThread(() -> {
|
||||
if (status == OrderStatusEnum.None.getCode() || status == OrderStatusEnum.Cancel.getCode() || status == OrderStatusEnum.JourneyCompleted.getCode()) {
|
||||
if (status == TaxiOrderStatusEnum.None.getCode() || status == TaxiOrderStatusEnum.Cancel.getCode() || status == TaxiOrderStatusEnum.JourneyCompleted.getCode()) {
|
||||
isHaveBeingOrder(false);
|
||||
mCurrentOrder = null;
|
||||
} else {
|
||||
isHaveBeingOrder(true);
|
||||
}
|
||||
if (status != saveOrderState) {
|
||||
OrderStatusEnum ochStatus = OrderStatusEnum.valueOf(status);
|
||||
TaxiOrderStatusEnum ochStatus = TaxiOrderStatusEnum.valueOf(status);
|
||||
switch (ochStatus) {
|
||||
case OnTheWayToStart:
|
||||
mOrderCancel.setVisibility(View.VISIBLE);
|
||||
@@ -384,8 +384,8 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
mTtsLessThan200Tip = 0;
|
||||
startNaviToStartStation(false, mOrderStartStationLat, mOrderStartStationLng);
|
||||
showOrHideNavi(true);
|
||||
setOrRemoveMapMaker(true, OCHTaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(true,OCHTaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
break;
|
||||
case Cancel:
|
||||
mCurrentOrder = null;
|
||||
@@ -393,23 +393,23 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
mOrderCancel.setVisibility(View.VISIBLE);
|
||||
showNotice(mActivity.getString(R.string.module_och_taxi_order_cancel));
|
||||
showOrHideNavi(false);
|
||||
setOrRemoveMapMaker(false, OCHTaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(false,OCHTaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
break;
|
||||
case ArriveAtStart:
|
||||
mTtsLessThan200Tip = 0;
|
||||
mOrderCancel.setVisibility(View.VISIBLE);
|
||||
showNotice(mActivity.getString(R.string.module_och_taxi_order_status_ph_text));
|
||||
showOrHideNavi(false);
|
||||
setOrRemoveMapMaker(true, OCHTaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(true,OCHTaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
break;
|
||||
case OnTheWayToEnd:
|
||||
// showNotice("欢迎使用蘑菇智行");
|
||||
mOrderCancel.setVisibility(View.VISIBLE);
|
||||
showOrHideNavi(false);
|
||||
setOrRemoveMapMaker(false, OCHTaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(true,OCHTaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(true, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
break;
|
||||
case ArriveAtEnd:
|
||||
mCurrentOrder = null;
|
||||
@@ -417,8 +417,8 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
mOrderCancel.setVisibility(View.GONE);
|
||||
showNotice(mActivity.getString(R.string.module_och_taxi_order_auto_arrive_end_tip));
|
||||
showOrHideNavi(false);
|
||||
setOrRemoveMapMaker(false, OCHTaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(false,OCHTaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,order.startSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_END_MAP_MAKER,order.endSitePoint);
|
||||
break;
|
||||
case JourneyCompleted:
|
||||
mCurrentOrder = null;
|
||||
@@ -463,7 +463,7 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
break;
|
||||
}
|
||||
} else if (v.getId() == R.id.module_och_taxi_order_cancel_iv) {
|
||||
new OCHTaxiOrderCancelDialog(mTaxiFragment, mActivity, mOrderNo, saveOrderState).show();
|
||||
new TaxiOrderCancelDialog(mTaxiFragment, mActivity, mOrderNo, saveOrderState).show();
|
||||
} else if (v.getId() == R.id.module_och_taxi_navi_iv) {
|
||||
// TODO: 2021/11/30 打开去往乘客上车点的导航页面
|
||||
if (mTaxiFragment != null) {
|
||||
@@ -486,8 +486,8 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
public void onCurrentOrderCancelDone() {
|
||||
//去除起终点
|
||||
if (mCurrentOrder != null){
|
||||
setOrRemoveMapMaker(false, OCHTaxiConst.TAXI_START_MAP_MAKER,mCurrentOrder.startSitePoint);
|
||||
setOrRemoveMapMaker(false,OCHTaxiConst.TAXI_END_MAP_MAKER,mCurrentOrder.endSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,mCurrentOrder.startSitePoint);
|
||||
setOrRemoveMapMaker(false, TaxiConst.TAXI_END_MAP_MAKER,mCurrentOrder.endSitePoint);
|
||||
}
|
||||
//提交取消订单后的回调
|
||||
TipToast.tip("订单取消成功");
|
||||
@@ -528,7 +528,7 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (saveOrderState == OrderStatusEnum.OnTheWayToStart.getCode()) {
|
||||
if (saveOrderState == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) {
|
||||
startNaviToStartStation(false, mOrderStartStationLat, mOrderStartStationLng);
|
||||
}
|
||||
}
|
||||
@@ -536,7 +536,7 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (saveOrderState == OrderStatusEnum.OnTheWayToStart.getCode()) {
|
||||
if (saveOrderState == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) {
|
||||
if (mNaviIcon.getVisibility() == View.GONE) {
|
||||
mNaviIcon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
@@ -558,7 +558,7 @@ public class OCHTaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implem
|
||||
+station.get(1)+",longitude="+station.get(0));
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(OCHTaxiConst.TYPE_MARKER_TAXI_ORDER)
|
||||
.owner(TaxiConst.TYPE_MARKER_TAXI_ORDER)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.gps(true)
|
||||
@@ -16,11 +16,11 @@ import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.constant.OrderStatusEnum;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
|
||||
import com.mogo.och.taxi.model.MogoOCHTaxiModelNew;
|
||||
import com.mogo.och.taxi.presenter.OCHTaxiPresenter;
|
||||
import com.mogo.och.taxi.model.TaxiModel;
|
||||
import com.mogo.och.taxi.presenter.TaxiPresenter;
|
||||
import com.mogo.och.taxi.utils.PinYinUtil;
|
||||
|
||||
import org.json.JSONArray;
|
||||
@@ -39,22 +39,22 @@ import mogo.telematics.pad.MessagePad;
|
||||
*
|
||||
* 网约车-出租车UI
|
||||
*/
|
||||
public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCHTaxiPresenter> implements OCHTaxiView {
|
||||
public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresenter> implements ITaxiView {
|
||||
|
||||
public static final String TAG = "OCHTaxiFragment";
|
||||
public static final String TAG = "TaxiFragment";
|
||||
|
||||
public static OCHTaxiFragment newInstance() {
|
||||
public static TaxiFragment newInstance() {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
|
||||
OCHTaxiFragment fragment = new OCHTaxiFragment();
|
||||
TaxiFragment fragment = new TaxiFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
private OCHTaxiGrabOrderFragment grabOrderFragment;
|
||||
private OCHTaxiServerOrdersFragment serverOrdersFragment;
|
||||
private WeakReference<OCHTaxiPersonalDialogFragment> personalDialogFragment = null;
|
||||
private TaxiGrabOrderFragment grabOrderFragment;
|
||||
private TaxiServerOrdersFragment serverOrdersFragment;
|
||||
private WeakReference<TaxiPersonalDialogFragment> personalDialogFragment = null;
|
||||
protected double mCurLatitude = 0.0;
|
||||
protected double mCurLongitude = 0.0;
|
||||
|
||||
@@ -66,7 +66,7 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
@Override
|
||||
public void restartAutopilot() {
|
||||
// 在自动驾驶中,才会有重新开启自动驾驶的操作
|
||||
if (mPresenter.getCurOrderStatus() == OrderStatusEnum.OnTheWayToEnd) {
|
||||
if (mPresenter.getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToEnd) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "restartAutopilot");
|
||||
mPresenter.startAutoPilot();
|
||||
startOrStopLoadingAnim(true);
|
||||
@@ -75,7 +75,7 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
|
||||
@Override
|
||||
public String getTagName() {
|
||||
return "OCHTaxiFragment";
|
||||
return "TaxiFragment";
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@@ -103,8 +103,8 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
}
|
||||
|
||||
private void initFragment() {
|
||||
serverOrdersFragment = OCHTaxiServerOrdersFragment.newInstance();
|
||||
grabOrderFragment = OCHTaxiGrabOrderFragment.newInstance();
|
||||
serverOrdersFragment = TaxiServerOrdersFragment.newInstance();
|
||||
grabOrderFragment = TaxiGrabOrderFragment.newInstance();
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
//默认显示OCHTaxiServerOrdersFragment
|
||||
transaction.add(R.id.fragment_container, serverOrdersFragment).show(serverOrdersFragment);
|
||||
@@ -115,7 +115,7 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
private void showGrabFragmentAndUpdate() {
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
if (grabOrderFragment == null) {
|
||||
grabOrderFragment = OCHTaxiGrabOrderFragment.newInstance();
|
||||
grabOrderFragment = TaxiGrabOrderFragment.newInstance();
|
||||
transaction.add(R.id.fragment_container, grabOrderFragment).show(grabOrderFragment).commitAllowingStateLoss();
|
||||
} else {
|
||||
transaction.show(grabOrderFragment).hide(serverOrdersFragment).commitAllowingStateLoss();
|
||||
@@ -125,7 +125,7 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
public void showServerFragmentAndUpdate() {
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
if (serverOrdersFragment == null) {
|
||||
serverOrdersFragment = OCHTaxiServerOrdersFragment.newInstance();
|
||||
serverOrdersFragment = TaxiServerOrdersFragment.newInstance();
|
||||
transaction.add(R.id.fragment_container, serverOrdersFragment).show(serverOrdersFragment);
|
||||
} else {
|
||||
transaction.show(serverOrdersFragment).hide(grabOrderFragment).commitAllowingStateLoss();
|
||||
@@ -134,8 +134,8 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected OCHTaxiPresenter createPresenter() {
|
||||
return new OCHTaxiPresenter(this);
|
||||
protected TaxiPresenter createPresenter() {
|
||||
return new TaxiPresenter(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -181,7 +181,7 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
|
||||
@Override
|
||||
protected void onGoToTaxiOrders() {
|
||||
personalDialogFragment = new WeakReference<>(new OCHTaxiPersonalDialogFragment(this));
|
||||
personalDialogFragment = new WeakReference<>(new TaxiPersonalDialogFragment(this));
|
||||
personalDialogFragment.get().show(getActivity().getSupportFragmentManager(), "service_data");
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
// CallerLogger.INSTANCE.d(M_TAXI + "lianglihui","routeResult:"+routeList.size());
|
||||
// //adas回调导航路径 绘制引导线
|
||||
// if ( ochTaxiOverlayManager == null){
|
||||
// ochTaxiOverlayManager = new OCHTaxiOverlayManager(this.getContext());
|
||||
// ochTaxiOverlayManager = new TaxiOverlayManager(this.getContext());
|
||||
// }
|
||||
// ochTaxiOverlayManager.draw(mogoLocation,routeList);
|
||||
// }
|
||||
@@ -214,7 +214,7 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
* 收到自动驾驶通知的成功状态之后,设置本地状态及服务端状态
|
||||
*/
|
||||
private void resetOCHTaxiOrderAutopilotStatus() {
|
||||
mPresenter.updateCurOrderStatus(OrderStatusEnum.OnTheWayToEnd);
|
||||
mPresenter.updateCurOrderStatus(TaxiOrderStatusEnum.OnTheWayToEnd);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.P)
|
||||
@@ -229,7 +229,7 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
startOrStopLoadingAnim(true);
|
||||
}
|
||||
|
||||
public void completeOrderService(OrderStatusEnum status) {
|
||||
public void completeOrderService(TaxiOrderStatusEnum status) {
|
||||
mPresenter.updateCurOrderStatus(status);
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
|
||||
public void onOrdersListPageRefresh(List<OrderQueryRespBean.Result> ordersList) {
|
||||
if (null == personalDialogFragment)
|
||||
personalDialogFragment = new WeakReference<>(new OCHTaxiPersonalDialogFragment(this));
|
||||
personalDialogFragment = new WeakReference<>(new TaxiPersonalDialogFragment(this));
|
||||
personalDialogFragment.get().onOrdersListPageRefresh(ordersList);
|
||||
}
|
||||
|
||||
@@ -346,14 +346,14 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
*/
|
||||
public void initOrderTestBar() {
|
||||
findViewById(R.id.test_bar_to_start).setOnClickListener(v -> {
|
||||
MogoOCHTaxiModelNew.getInstance().setArriveAtStartStation();
|
||||
TaxiModel.getInstance().setArriveAtStartStation();
|
||||
});
|
||||
findViewById(R.id.test_bar_to_end).setOnClickListener(v -> {
|
||||
MogoOCHTaxiModelNew.getInstance().setArriveAtEndStation();
|
||||
TaxiModel.getInstance().setArriveAtEndStation();
|
||||
});
|
||||
findViewById(R.id.test_bar_on_the_way_to_end).setOnClickListener(v -> {
|
||||
showNotice("自动驾驶已启动,请系好安全带");
|
||||
MogoOCHTaxiModelNew.getInstance().setOnTheWayToEndStation();
|
||||
TaxiModel.getInstance().setOnTheWayToEndStation();
|
||||
testRouteInfoUpload();
|
||||
});
|
||||
}
|
||||
@@ -548,8 +548,8 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
builder.setLongitude(s.getDouble("lon"));
|
||||
list.add(builder.build());
|
||||
}
|
||||
MogoOCHTaxiModelNew.getInstance().updateOrderRoute(list);
|
||||
MogoOCHTaxiModelNew.getInstance().updateOrderRouteInfo(list);
|
||||
TaxiModel.getInstance().updateOrderRoute(list);
|
||||
TaxiModel.getInstance().updateOrderRouteInfo(list);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -563,7 +563,7 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
TextView testCurOrderId = findViewById(R.id.test_bar_current_order_id);
|
||||
TextView testCurStartName = findViewById(R.id.test_bar_current_start_name);
|
||||
TextView testCurEndName = findViewById(R.id.test_bar_current_end_name);
|
||||
OrderQueryRespBean.Result order = MogoOCHTaxiModelNew.getInstance().getCurrentOCHOrder();
|
||||
OrderQueryRespBean.Result order = TaxiModel.getInstance().getCurrentOCHOrder();
|
||||
|
||||
testCurOrderId.setText(order == null ? "" : String.valueOf(order.orderNo));
|
||||
testCurStartName.setText(order == null ? "" : PinYinUtil.getPinYinHeadChar(order.startSiteAddr));
|
||||
@@ -573,8 +573,4 @@ public class OCHTaxiFragment extends BaseOchTaxiTabFragment<OCHTaxiFragment, OCH
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotIdentifyDataUpdate(List<MessagePad.TrackedObject> trafficData) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.utils.OchTaxiUtils;
|
||||
import com.mogo.och.taxi.utils.TaxiDateTimeUtil;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.Calendar;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/9/9
|
||||
*/
|
||||
public class OCHTaxiGrabOrderFragment extends BaseTaxiUIFragment implements View.OnClickListener {
|
||||
public class TaxiGrabOrderFragment extends BaseTaxiUIFragment implements View.OnClickListener {
|
||||
|
||||
private TextView mOrderReserverTime;
|
||||
private TextView mOrderGrabBt;
|
||||
@@ -35,11 +35,11 @@ public class OCHTaxiGrabOrderFragment extends BaseTaxiUIFragment implements View
|
||||
private AnimationDrawable mGrabFailureAnim;
|
||||
private CountDownTimer countDownTimer = null;
|
||||
|
||||
public static OCHTaxiGrabOrderFragment newInstance() {
|
||||
public static TaxiGrabOrderFragment newInstance() {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
|
||||
OCHTaxiGrabOrderFragment fragment = new OCHTaxiGrabOrderFragment();
|
||||
TaxiGrabOrderFragment fragment = new TaxiGrabOrderFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
@@ -85,19 +85,19 @@ public class OCHTaxiGrabOrderFragment extends BaseTaxiUIFragment implements View
|
||||
}
|
||||
}
|
||||
}
|
||||
private OCHTaxiFragment getOchTaxiFragment(){
|
||||
return (OCHTaxiFragment)getParentFragment();
|
||||
private TaxiFragment getOchTaxiFragment(){
|
||||
return (TaxiFragment)getParentFragment();
|
||||
}
|
||||
public void updateGrabOrder(OrderQueryRespBean.Result order){
|
||||
mGrabResultAnimView.setVisibility(View.GONE);
|
||||
Calendar calendar = OchTaxiUtils.formatLongToCalendar(order.bookingTime);
|
||||
if (OchTaxiUtils.compareDateIsCurrentDay(calendar)){
|
||||
mOrderReserverTime.setText("用车时间:今天 "+OchTaxiUtils.formatCalendarToString(calendar,OchTaxiUtils.TAXI_HH_mm));
|
||||
getOchTaxiFragment().showNotice("预约单,今天"+OchTaxiUtils.formatCalendarToString(calendar,OchTaxiUtils.TAXI_HH_mm)+"从"
|
||||
Calendar calendar = TaxiDateTimeUtil.formatLongToCalendar(order.bookingTime);
|
||||
if (TaxiDateTimeUtil.compareDateIsCurrentDay(calendar)){
|
||||
mOrderReserverTime.setText("用车时间:今天 "+ TaxiDateTimeUtil.formatCalendarToString(calendar, TaxiDateTimeUtil.TAXI_HH_mm));
|
||||
getOchTaxiFragment().showNotice("预约单,今天"+ TaxiDateTimeUtil.formatCalendarToString(calendar, TaxiDateTimeUtil.TAXI_HH_mm)+"从"
|
||||
+order.startSiteAddr+"到"+order.endSiteAddr);
|
||||
}else {
|
||||
mOrderReserverTime.setText("用车时间:"+OchTaxiUtils.formatCalendarToString(calendar,OchTaxiUtils.TAXI_MM_dd_HH_mm));
|
||||
getOchTaxiFragment().showNotice("预约单,"+OchTaxiUtils.formatCalendarToString(calendar,OchTaxiUtils.TAXI_MM_dd)+"从"
|
||||
mOrderReserverTime.setText("用车时间:"+ TaxiDateTimeUtil.formatCalendarToString(calendar, TaxiDateTimeUtil.TAXI_MM_dd_HH_mm));
|
||||
getOchTaxiFragment().showNotice("预约单,"+ TaxiDateTimeUtil.formatCalendarToString(calendar, TaxiDateTimeUtil.TAXI_MM_dd)+"从"
|
||||
+order.startSiteAddr+"到"+order.endSiteAddr);
|
||||
}
|
||||
mOrderStartStation.setText(order.startSiteAddr);
|
||||
@@ -15,25 +15,25 @@ import com.amap.api.navi.model.RouteOverlayOptions;
|
||||
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.callback.IOCHTaxiNaviChangedCallback;
|
||||
import com.mogo.och.taxi.callback.ITaxiNaviChangedCallback;
|
||||
import com.mogo.och.taxi.model.NaviToDestinationModel;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/11/30
|
||||
*/
|
||||
public class OCHNaviFragment extends BaseTaxiUIFragment implements AMapNaviViewListener, View.OnClickListener {
|
||||
public class TaxiNaviFragment extends BaseTaxiUIFragment implements AMapNaviViewListener, View.OnClickListener {
|
||||
|
||||
private AMapNaviView mAMapNaviView;
|
||||
// private OverviewButtonView mOverviewButtonView;
|
||||
// private NextTurnTipView mNextTurnTipView;
|
||||
private AMap aMap;
|
||||
private IOCHTaxiNaviChangedCallback mNaviToStartInfoCallback; // 前往乘客上车点
|
||||
public static OCHNaviFragment newInstance() {
|
||||
private ITaxiNaviChangedCallback mNaviToStartInfoCallback; // 前往乘客上车点
|
||||
public static TaxiNaviFragment newInstance() {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
|
||||
OCHNaviFragment fragment = new OCHNaviFragment();
|
||||
TaxiNaviFragment fragment = new TaxiNaviFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.utils.OchTaxiUtils;
|
||||
import com.mogo.och.taxi.utils.TaxiDateTimeUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -23,7 +23,7 @@ import java.util.List;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/9/10
|
||||
*/
|
||||
public class OCHTaxiOperationDatasFragment extends BaseTaxiUIFragment {
|
||||
public class TaxiOperationDatasFragment extends BaseTaxiUIFragment {
|
||||
|
||||
private RecyclerView mRecyclerView;
|
||||
private static Context mContext;
|
||||
@@ -33,11 +33,11 @@ public class OCHTaxiOperationDatasFragment extends BaseTaxiUIFragment {
|
||||
private static int mType = 0;//0: 运营时长 1:运营单数
|
||||
private OperationDataAdapter mAdapter;
|
||||
|
||||
public static OCHTaxiOperationDatasFragment newInstance(Context context, int type) {
|
||||
public static TaxiOperationDatasFragment newInstance(Context context, int type) {
|
||||
mContext = context;
|
||||
mType = type;
|
||||
Bundle args = new Bundle();
|
||||
OCHTaxiOperationDatasFragment fragment = new OCHTaxiOperationDatasFragment();
|
||||
TaxiOperationDatasFragment fragment = new TaxiOperationDatasFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
@@ -98,8 +98,8 @@ public class OCHTaxiOperationDatasFragment extends BaseTaxiUIFragment {
|
||||
if (holder instanceof OperationDataViewHolder) {
|
||||
OperationDataViewHolder viewHolder = (OperationDataViewHolder) holder;
|
||||
if (0 == mType){
|
||||
String hourData = TextUtils.isEmpty(OchTaxiUtils.secondsToHourStr(datas.get(position))) ? "0": OchTaxiUtils.secondsToHourStr(datas.get(position));
|
||||
String minuteData = OchTaxiUtils.secondsToMinuteStr(datas.get(position));
|
||||
String hourData = TextUtils.isEmpty(TaxiDateTimeUtil.secondsToHourStr(datas.get(position))) ? "0": TaxiDateTimeUtil.secondsToHourStr(datas.get(position));
|
||||
String minuteData = TaxiDateTimeUtil.secondsToMinuteStr(datas.get(position));
|
||||
String data = "<font><b><big><big><big>" + hourData + "</big></big></big></b> 时 </font>" + "<font><b><big><big><big>" + minuteData + "</big></big></big></b> 分</font>";
|
||||
viewHolder.operationDataTv.setText(Html.fromHtml(data));
|
||||
viewHolder.operationDataTitle.setText("今日在线时长");
|
||||
@@ -22,16 +22,16 @@ import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.och.taxi.constant.OrderStatusEnum;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.constant.OrderCancelReasons;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderCancelReasons;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/8/18
|
||||
*/
|
||||
public class OCHTaxiOrderCancelDialog extends AlertDialog implements View.OnClickListener,AdapterView.OnItemClickListener {
|
||||
public class TaxiOrderCancelDialog extends AlertDialog implements View.OnClickListener,AdapterView.OnItemClickListener {
|
||||
|
||||
private static final String TAG = "OCHTaxiOrderCancelDial";
|
||||
protected WeakReference<Context> contextWeakReference;
|
||||
@@ -42,10 +42,10 @@ public class OCHTaxiOrderCancelDialog extends AlertDialog implements View.OnClic
|
||||
private ContentAdapter mContentAdapter;
|
||||
private int mOrderStatus;//1:预约单,其他为即时单的状态, 主要是控制乘客上车 乘客下车这几个选项的显示
|
||||
private String[] mContentArrays;
|
||||
private WeakReference<OCHTaxiFragment> mOchTaxiFragmentWeak;
|
||||
private WeakReference<TaxiFragment> mOchTaxiFragmentWeak;
|
||||
private String mOrderNo;
|
||||
|
||||
protected OCHTaxiOrderCancelDialog(OCHTaxiFragment fragment, Context context, String orderNo, int orderStatus) {
|
||||
protected TaxiOrderCancelDialog(TaxiFragment fragment, Context context, String orderNo, int orderStatus) {
|
||||
super(context,R.style.OrderCancelDialog);
|
||||
mOrderNo = orderNo;
|
||||
mOchTaxiFragmentWeak = new WeakReference<>(fragment);
|
||||
@@ -56,41 +56,41 @@ public class OCHTaxiOrderCancelDialog extends AlertDialog implements View.OnClic
|
||||
|
||||
private void initReasonArray() {
|
||||
if (1 == mOrderStatus) {
|
||||
mContentArrays = new String[]{OrderCancelReasons.BookPassengerCancel.getMsg(), OrderCancelReasons.CarBroken.getMsg(),
|
||||
OrderCancelReasons.BookJourneyConflict.getMsg(), OrderCancelReasons.BatteryLow.getMsg(),
|
||||
OrderCancelReasons.BookOther.getMsg()};
|
||||
mContentArrays = new String[]{TaxiOrderCancelReasons.BookPassengerCancel.getMsg(), TaxiOrderCancelReasons.CarBroken.getMsg(),
|
||||
TaxiOrderCancelReasons.BookJourneyConflict.getMsg(), TaxiOrderCancelReasons.BatteryLow.getMsg(),
|
||||
TaxiOrderCancelReasons.BookOther.getMsg()};
|
||||
return;
|
||||
}
|
||||
OrderStatusEnum ochStatus = OrderStatusEnum.valueOf(mOrderStatus);
|
||||
TaxiOrderStatusEnum ochStatus = TaxiOrderStatusEnum.valueOf(mOrderStatus);
|
||||
switch (ochStatus) {
|
||||
case OnTheWayToStart:
|
||||
mContentArrays = new String[]{OrderCancelReasons.CarBroken.getMsg(), OrderCancelReasons.DeviceBroken.getMsg(),
|
||||
OrderCancelReasons.BatteryLow.getMsg(), OrderCancelReasons.DriverIsIll.getMsg()};
|
||||
mContentArrays = new String[]{TaxiOrderCancelReasons.CarBroken.getMsg(), TaxiOrderCancelReasons.DeviceBroken.getMsg(),
|
||||
TaxiOrderCancelReasons.BatteryLow.getMsg(), TaxiOrderCancelReasons.DriverIsIll.getMsg()};
|
||||
break;
|
||||
case ArriveAtStart:
|
||||
mContentArrays = new String[]{OrderCancelReasons.CarBroken.getMsg(), OrderCancelReasons.DeviceBroken.getMsg(),
|
||||
OrderCancelReasons.BatteryLow.getMsg(), OrderCancelReasons.DriverIsIll.getMsg(),
|
||||
OrderCancelReasons.PassengerNotArrive.getMsg()};
|
||||
mContentArrays = new String[]{TaxiOrderCancelReasons.CarBroken.getMsg(), TaxiOrderCancelReasons.DeviceBroken.getMsg(),
|
||||
TaxiOrderCancelReasons.BatteryLow.getMsg(), TaxiOrderCancelReasons.DriverIsIll.getMsg(),
|
||||
TaxiOrderCancelReasons.PassengerNotArrive.getMsg()};
|
||||
break;
|
||||
case OnTheWayToEnd:
|
||||
case ArriveAtEnd:
|
||||
mContentArrays = new String[]{OrderCancelReasons.CarBroken.getMsg(), OrderCancelReasons.DeviceBroken.getMsg(),
|
||||
OrderCancelReasons.BatteryLow.getMsg(), OrderCancelReasons.DriverIsIll.getMsg(), OrderCancelReasons.PassengerStopOver.getMsg()};
|
||||
mContentArrays = new String[]{TaxiOrderCancelReasons.CarBroken.getMsg(), TaxiOrderCancelReasons.DeviceBroken.getMsg(),
|
||||
TaxiOrderCancelReasons.BatteryLow.getMsg(), TaxiOrderCancelReasons.DriverIsIll.getMsg(), TaxiOrderCancelReasons.PassengerStopOver.getMsg()};
|
||||
break;
|
||||
default:
|
||||
mContentArrays = new String[]{OrderCancelReasons.CarBroken.getMsg(), OrderCancelReasons.DeviceBroken.getMsg(),
|
||||
OrderCancelReasons.BatteryLow.getMsg(), OrderCancelReasons.DriverIsIll.getMsg(),
|
||||
OrderCancelReasons.PassengerNotArrive.getMsg(), OrderCancelReasons.PassengerStopOver.getMsg()};
|
||||
mContentArrays = new String[]{TaxiOrderCancelReasons.CarBroken.getMsg(), TaxiOrderCancelReasons.DeviceBroken.getMsg(),
|
||||
TaxiOrderCancelReasons.BatteryLow.getMsg(), TaxiOrderCancelReasons.DriverIsIll.getMsg(),
|
||||
TaxiOrderCancelReasons.PassengerNotArrive.getMsg(), TaxiOrderCancelReasons.PassengerStopOver.getMsg()};
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected OCHTaxiOrderCancelDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
|
||||
protected TaxiOrderCancelDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
|
||||
super(context, cancelable, cancelListener);
|
||||
}
|
||||
|
||||
protected OCHTaxiOrderCancelDialog(Context context, int themeResId) {
|
||||
protected TaxiOrderCancelDialog(Context context, int themeResId) {
|
||||
super(context, themeResId);
|
||||
}
|
||||
|
||||
@@ -128,11 +128,11 @@ public class OCHTaxiOrderCancelDialog extends AlertDialog implements View.OnClic
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.order_cancel_commit_tv) {//bt commit
|
||||
if (!TextUtils.isEmpty(mCurrentReason) && OrderCancelReasons.getType(mCurrentReason) != 0) {
|
||||
if (!TextUtils.isEmpty(mCurrentReason) && TaxiOrderCancelReasons.getType(mCurrentReason) != 0) {
|
||||
if (1 == mOrderStatus){//预约单
|
||||
mOchTaxiFragmentWeak.get().cancelOrderById(mOrderNo,OrderCancelReasons.getType(mCurrentReason),mCurrentReason);
|
||||
mOchTaxiFragmentWeak.get().cancelOrderById(mOrderNo, TaxiOrderCancelReasons.getType(mCurrentReason),mCurrentReason);
|
||||
}else {//即时单
|
||||
mOchTaxiFragmentWeak.get().cancelCurOrder(OrderCancelReasons.getType(mCurrentReason),mCurrentReason);
|
||||
mOchTaxiFragmentWeak.get().cancelCurOrder(TaxiOrderCancelReasons.getType(mCurrentReason),mCurrentReason);
|
||||
}
|
||||
dismiss();
|
||||
}else {
|
||||
@@ -31,11 +31,11 @@ import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.taxi.constant.OrderStatusEnum;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.constant.OrderTypeEnum;
|
||||
import com.mogo.och.taxi.utils.OchTaxiUtils;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderTypeEnum;
|
||||
import com.mogo.och.taxi.utils.TaxiDateTimeUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
@@ -48,7 +48,7 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAX
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/8/18
|
||||
*/
|
||||
public class OCHTaxiPersonalDialogFragment extends DialogFragment implements View.OnClickListener {
|
||||
public class TaxiPersonalDialogFragment extends DialogFragment implements View.OnClickListener {
|
||||
|
||||
private final static String TAG = "OCHTaxiOrdersDialog";
|
||||
|
||||
@@ -62,16 +62,16 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
private ConstraintLayout mNoDatas;
|
||||
private List<OrderQueryRespBean.Result> orders = new ArrayList<>();
|
||||
private String[] mTabTitles = {"在线时长","订单完成数"};
|
||||
private List<OCHTaxiOperationDatasFragment> fragments = new ArrayList<>();
|
||||
private List<TaxiOperationDatasFragment> fragments = new ArrayList<>();
|
||||
private int mNextPage = 0;
|
||||
private int mPerPageSize = 10;
|
||||
private static OCHTaxiFragment mTaxiFragment;
|
||||
private static TaxiFragment mTaxiFragment;
|
||||
private static boolean serverHadNoData = false;
|
||||
|
||||
public OCHTaxiPersonalDialogFragment(){
|
||||
public TaxiPersonalDialogFragment(){
|
||||
}
|
||||
|
||||
public OCHTaxiPersonalDialogFragment(OCHTaxiFragment taxiFragment){
|
||||
public TaxiPersonalDialogFragment(TaxiFragment taxiFragment){
|
||||
mTaxiFragment = taxiFragment;
|
||||
}
|
||||
@Nullable
|
||||
@@ -141,11 +141,11 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
if (0 == i){
|
||||
mOperationTab.addTab(tab,true);
|
||||
changeOperationTabLayoutTabUI(tab,true);
|
||||
fragments.add(OCHTaxiOperationDatasFragment.newInstance(getActivity(),0));
|
||||
fragments.add(TaxiOperationDatasFragment.newInstance(getActivity(),0));
|
||||
}else if (1 == i){
|
||||
mOperationTab.addTab(tab);
|
||||
changeOperationTabLayoutTabUI(tab,false);
|
||||
fragments.add(OCHTaxiOperationDatasFragment.newInstance(getActivity(),1));
|
||||
fragments.add(TaxiOperationDatasFragment.newInstance(getActivity(),1));
|
||||
}
|
||||
}
|
||||
mOperationTab.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@@ -302,7 +302,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
if (null == queryRespBean) return;
|
||||
if (holder instanceof DayGroupViewHolder){
|
||||
DayGroupViewHolder groupViewHolder = (DayGroupViewHolder)holder;
|
||||
groupViewHolder.dayGroupTv.setText(OchTaxiUtils.getYMDTime(queryRespBean.createTime));
|
||||
groupViewHolder.dayGroupTv.setText(TaxiDateTimeUtil.getYMDTime(queryRespBean.createTime));
|
||||
bindOrderDetailData(queryRespBean,groupViewHolder.orderTimeTv,groupViewHolder.startStationTv,groupViewHolder.endStationTv,
|
||||
groupViewHolder.orderStatusBt,groupViewHolder.orderTypeBt,groupViewHolder.orderNumTv);
|
||||
if (isNoLineItem(position)){
|
||||
@@ -343,9 +343,9 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
if (position == 0){
|
||||
return DAY_GROUP_ITEM;
|
||||
}
|
||||
String currentDate = OchTaxiUtils.getYMDTime(orders.get(position).createTime);//获取当前订单时间
|
||||
String currentDate = TaxiDateTimeUtil.getYMDTime(orders.get(position).createTime);//获取当前订单时间
|
||||
int prevIndex = position - 1;
|
||||
String preDate = OchTaxiUtils.getYMDTime(orders.get(prevIndex).createTime);
|
||||
String preDate = TaxiDateTimeUtil.getYMDTime(orders.get(prevIndex).createTime);
|
||||
boolean isDifferent = !preDate.equals(currentDate);//前一个订单的日期跟第二个订单的日期是否一致
|
||||
return isDifferent ? DAY_GROUP_ITEM : ORDER_DETAIL_ITEM;//一样订单详情, 不一样新添加分组
|
||||
}
|
||||
@@ -354,9 +354,9 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
if (position == orders.size() -1){
|
||||
return false;
|
||||
}else {
|
||||
String currentDate = OchTaxiUtils.getYMDTime(orders.get(position).createTime);//获取当前订单时间
|
||||
String currentDate = TaxiDateTimeUtil.getYMDTime(orders.get(position).createTime);//获取当前订单时间
|
||||
int nextIndex = position + 1;
|
||||
String preDate = OchTaxiUtils.getYMDTime(orders.get(nextIndex).createTime);
|
||||
String preDate = TaxiDateTimeUtil.getYMDTime(orders.get(nextIndex).createTime);
|
||||
boolean isDifferent = preDate.equals(currentDate);//订单跟后一个订单是否是同一天
|
||||
return isDifferent;//一样有划分线, 不一样没有划分线
|
||||
}
|
||||
@@ -372,7 +372,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
Button orderStatusBt, Button orderTypeBt, TextView orderNumTv){
|
||||
Calendar calendar= Calendar.getInstance();
|
||||
calendar.setTimeInMillis(queryRespBean.createTime);
|
||||
orderTimeTv.setText(OchTaxiUtils.formatCalendarToString(calendar,OchTaxiUtils.TAXI_HH_mm));
|
||||
orderTimeTv.setText(TaxiDateTimeUtil.formatCalendarToString(calendar, TaxiDateTimeUtil.TAXI_HH_mm));
|
||||
startStationTv.setText(queryRespBean.startSiteAddr);
|
||||
endStationTv.setText(queryRespBean.endSiteAddr);
|
||||
orderStatusBt.setText(getOrderStatus(queryRespBean.orderStatus,orderStatusBt));
|
||||
@@ -382,7 +382,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private String getOrderStatus(int status, Button button){
|
||||
OrderStatusEnum orderStatus = OrderStatusEnum.valueOf(status);
|
||||
TaxiOrderStatusEnum orderStatus = TaxiOrderStatusEnum.valueOf(status);
|
||||
switch (orderStatus){
|
||||
case JourneyCompleted:
|
||||
button.setBackground(context.getDrawable(R.drawable.taxi_order_button_status_canceled_bg));
|
||||
@@ -398,7 +398,7 @@ public class OCHTaxiPersonalDialogFragment extends DialogFragment implements Vie
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private String getOrderType(int type, Button button){
|
||||
if (type == OrderTypeEnum.Reserved.getType()){
|
||||
if (type == TaxiOrderTypeEnum.Reserved.getType()){
|
||||
button.setBackground(context.getDrawable(R.drawable.taxi_order_button_type_reserver_bg));
|
||||
return "预约单";
|
||||
}else{
|
||||
@@ -16,7 +16,7 @@ import com.mogo.och.taxi.R;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/9/29
|
||||
*/
|
||||
public class OCHTaxiRadiuImageView extends AppCompatImageView {
|
||||
public class TaxiRadiusImageView extends AppCompatImageView {
|
||||
private float width, height;
|
||||
private int defaultRadius = 0;
|
||||
private int radius;
|
||||
@@ -26,17 +26,17 @@ public class OCHTaxiRadiuImageView extends AppCompatImageView {
|
||||
private int leftBottomRadius;
|
||||
|
||||
|
||||
public OCHTaxiRadiuImageView(Context context) {
|
||||
public TaxiRadiusImageView(Context context) {
|
||||
this(context, null);
|
||||
init(context, null);
|
||||
}
|
||||
|
||||
public OCHTaxiRadiuImageView(Context context, AttributeSet attrs) {
|
||||
public TaxiRadiusImageView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
init(context, attrs);
|
||||
}
|
||||
|
||||
public OCHTaxiRadiuImageView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
public TaxiRadiusImageView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init(context, attrs);
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.bean.OrderQueryRespBean;
|
||||
import com.mogo.och.taxi.utils.OchTaxiUtils;
|
||||
import com.mogo.och.taxi.utils.TaxiDateTimeUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
@@ -30,7 +30,7 @@ import static androidx.recyclerview.widget.RecyclerView.SCROLL_STATE_IDLE;
|
||||
* @date: 2021/9/2
|
||||
* 待服务订单列表
|
||||
*/
|
||||
public class OCHTaxiReserveOrdersFragment extends BaseTaxiUIFragment {
|
||||
public class TaxiReserveOrdersFragment extends BaseTaxiUIFragment {
|
||||
|
||||
private RecyclerView mRecyclerView;
|
||||
private TextView mNodataTv;
|
||||
@@ -38,15 +38,15 @@ public class OCHTaxiReserveOrdersFragment extends BaseTaxiUIFragment {
|
||||
private View mBootRefreshNoDataView;
|
||||
private List<OrderQueryRespBean.Result> mDatas = new ArrayList<>();
|
||||
private ToBeServedOrdersAdapter mAdapter;
|
||||
private static OCHTaxiFragment mTaxiFragment;
|
||||
private static TaxiFragment mTaxiFragment;
|
||||
private static Activity mActivity;
|
||||
private boolean isUpwardSliding = false;
|
||||
|
||||
public static OCHTaxiReserveOrdersFragment newInstance(Activity activity, OCHTaxiFragment taxiFragment){
|
||||
public static TaxiReserveOrdersFragment newInstance(Activity activity, TaxiFragment taxiFragment){
|
||||
mActivity = activity;
|
||||
mTaxiFragment = taxiFragment;
|
||||
Bundle args = new Bundle();
|
||||
OCHTaxiReserveOrdersFragment fragment = new OCHTaxiReserveOrdersFragment();
|
||||
TaxiReserveOrdersFragment fragment = new TaxiReserveOrdersFragment();
|
||||
fragment.setArguments( args );
|
||||
return fragment;
|
||||
}
|
||||
@@ -129,16 +129,16 @@ public class OCHTaxiReserveOrdersFragment extends BaseTaxiUIFragment {
|
||||
if (datas != null && datas.size() >0 ){
|
||||
ToBeServedOrdersViewHolder viewHolder = (ToBeServedOrdersViewHolder)holder;
|
||||
OrderQueryRespBean.Result order = datas.get(position);
|
||||
Calendar calendar = OchTaxiUtils.formatLongToCalendar(order.bookingTime);
|
||||
if (OchTaxiUtils.compareDateIsCurrentDay(calendar)){
|
||||
viewHolder.orderTime.setText("用车时间:今天"+OchTaxiUtils.formatCalendarToString(calendar,OchTaxiUtils.TAXI_HH_mm));
|
||||
Calendar calendar = TaxiDateTimeUtil.formatLongToCalendar(order.bookingTime);
|
||||
if (TaxiDateTimeUtil.compareDateIsCurrentDay(calendar)){
|
||||
viewHolder.orderTime.setText("用车时间:今天"+ TaxiDateTimeUtil.formatCalendarToString(calendar, TaxiDateTimeUtil.TAXI_HH_mm));
|
||||
}else {
|
||||
viewHolder.orderTime.setText("用车时间:"+OchTaxiUtils.formatCalendarToString(calendar,OchTaxiUtils.TAXI_MM_dd_HH_mm));
|
||||
viewHolder.orderTime.setText("用车时间:"+ TaxiDateTimeUtil.formatCalendarToString(calendar, TaxiDateTimeUtil.TAXI_MM_dd_HH_mm));
|
||||
}
|
||||
viewHolder.orderCancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
new OCHTaxiOrderCancelDialog(mTaxiFragment,context,order.orderNo,1).show();
|
||||
new TaxiOrderCancelDialog(mTaxiFragment,context,order.orderNo,1).show();
|
||||
}
|
||||
});
|
||||
viewHolder.startStation.setText(order.startSiteAddr);
|
||||
@@ -33,15 +33,15 @@ import java.util.List;
|
||||
*
|
||||
* 网约车-出租车UI
|
||||
*/
|
||||
public class OCHTaxiServerOrdersFragment extends BaseTaxiUIFragment {
|
||||
public class TaxiServerOrdersFragment extends BaseTaxiUIFragment {
|
||||
|
||||
public static final String TAG = "OCHTaxiFragment";
|
||||
public static final String TAG = "TaxiFragment";
|
||||
|
||||
public static OCHTaxiServerOrdersFragment newInstance() {
|
||||
public static TaxiServerOrdersFragment newInstance() {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
|
||||
OCHTaxiServerOrdersFragment fragment = new OCHTaxiServerOrdersFragment();
|
||||
TaxiServerOrdersFragment fragment = new TaxiServerOrdersFragment();
|
||||
fragment.setArguments( args );
|
||||
return fragment;
|
||||
}
|
||||
@@ -51,8 +51,8 @@ public class OCHTaxiServerOrdersFragment extends BaseTaxiUIFragment {
|
||||
private ViewPager mTaxiOrderPager;
|
||||
private String[] mTabTitles = {"进行中","待服务"};
|
||||
private List<Fragment> fragments = new ArrayList<>();
|
||||
private OCHTaxiBeingServerdOrdersFragment beingServerdOrdersFragment = null;
|
||||
private OCHTaxiReserveOrdersFragment reserveOrdersFragment = null;
|
||||
private TaxiBeingServerdOrdersFragment beingServerdOrdersFragment = null;
|
||||
private TaxiReserveOrdersFragment reserveOrdersFragment = null;
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
@@ -82,12 +82,12 @@ public class OCHTaxiServerOrdersFragment extends BaseTaxiUIFragment {
|
||||
if (0 == i){
|
||||
mTaxiOrderTab.addTab(tab,true);
|
||||
changeTabLayoutTabUI(tab,true);
|
||||
beingServerdOrdersFragment = OCHTaxiBeingServerdOrdersFragment.newInstance(getActivity(),(OCHTaxiFragment) getParentFragment());
|
||||
beingServerdOrdersFragment = TaxiBeingServerdOrdersFragment.newInstance(getActivity(),(TaxiFragment) getParentFragment());
|
||||
fragments.add(beingServerdOrdersFragment);
|
||||
}else if (1 == i){
|
||||
mTaxiOrderTab.addTab(tab);
|
||||
changeTabLayoutTabUI(tab,false);
|
||||
reserveOrdersFragment = OCHTaxiReserveOrdersFragment.newInstance(getActivity(),(OCHTaxiFragment) getParentFragment());
|
||||
reserveOrdersFragment = TaxiReserveOrdersFragment.newInstance(getActivity(),(TaxiFragment) getParentFragment());
|
||||
fragments.add(reserveOrdersFragment);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.mogo.eagle.core.data.app.AppConfigInfo;
|
||||
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.taxi.constant.OCHTaxiConst;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -18,7 +18,7 @@ import java.util.Map;
|
||||
*
|
||||
* Created on 2022/3/24
|
||||
*/
|
||||
public class OchTaxiAnalyticsUtil {
|
||||
public class TaxiAnalyticsUtil {
|
||||
|
||||
/**
|
||||
* 触发'开始服务'埋点流程:
|
||||
@@ -34,19 +34,19 @@ public class OchTaxiAnalyticsUtil {
|
||||
System.currentTimeMillis(), DateTimeUtils.yyyy_MM_dd_HH_mm_ss);
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put(OCHTaxiConst.EVENT_PARAM_SN, sn);
|
||||
params.put(OCHTaxiConst.EVENT_PARAM_PLATE_NUM, TextUtils.isEmpty(plateNum) ? "" : plateNum);
|
||||
params.put(OCHTaxiConst.EVENT_PARAM_ENV_ONLINE,
|
||||
params.put(TaxiConst.EVENT_PARAM_SN, sn);
|
||||
params.put(TaxiConst.EVENT_PARAM_PLATE_NUM, TextUtils.isEmpty(plateNum) ? "" : plateNum);
|
||||
params.put(TaxiConst.EVENT_PARAM_ENV_ONLINE,
|
||||
DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE ? true : false);
|
||||
params.put(OCHTaxiConst.EVENT_PARAM_TIME, dateTime);
|
||||
params.put(OCHTaxiConst.EVENT_PARAM_START_NAME, startName);
|
||||
params.put(OCHTaxiConst.EVENT_PARAM_END_NAME, endName);
|
||||
params.put(OCHTaxiConst.EVENT_PARAM_ORDER_NUMBER, orderNo);
|
||||
params.put(TaxiConst.EVENT_PARAM_TIME, dateTime);
|
||||
params.put(TaxiConst.EVENT_PARAM_START_NAME, startName);
|
||||
params.put(TaxiConst.EVENT_PARAM_END_NAME, endName);
|
||||
params.put(TaxiConst.EVENT_PARAM_ORDER_NUMBER, orderNo);
|
||||
|
||||
Runnable runnable = () -> {
|
||||
// 15s内未开启,上报失败埋点
|
||||
params.put(OCHTaxiConst.EVENT_PARAM_START_RESULT, false);
|
||||
AnalyticsManager.INSTANCE.track(OCHTaxiConst.EVENT_KEY_START_SERVICE, params);
|
||||
params.put(TaxiConst.EVENT_PARAM_START_RESULT, false);
|
||||
AnalyticsManager.INSTANCE.track(TaxiConst.EVENT_KEY_START_SERVICE, params);
|
||||
};
|
||||
|
||||
if (send) {
|
||||
@@ -54,10 +54,10 @@ public class OchTaxiAnalyticsUtil {
|
||||
if (runnable != null && UiThreadHandler.getsUiHandler().hasCallbacks(runnable)) {
|
||||
UiThreadHandler.removeCallbacks(runnable);
|
||||
}
|
||||
params.put(OCHTaxiConst.EVENT_PARAM_START_RESULT, true);
|
||||
AnalyticsManager.INSTANCE.track(OCHTaxiConst.EVENT_KEY_START_SERVICE, params);
|
||||
params.put(TaxiConst.EVENT_PARAM_START_RESULT, true);
|
||||
AnalyticsManager.INSTANCE.track(TaxiConst.EVENT_KEY_START_SERVICE, params);
|
||||
} else {
|
||||
UiThreadHandler.postDelayed(runnable, OCHTaxiConst.LOOP_PERIOD_15S);
|
||||
UiThreadHandler.postDelayed(runnable, TaxiConst.LOOP_PERIOD_15S);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import java.util.Calendar;
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/8/20
|
||||
*/
|
||||
public class OchTaxiUtils {
|
||||
public class TaxiDateTimeUtil {
|
||||
|
||||
public static final String TAXI_HH_mm = "HH:mm";
|
||||
public static final String TAXI_MM_dd = "MM-dd";
|
||||
@@ -32,8 +32,8 @@ public class OchTaxiUtils {
|
||||
|
||||
public static boolean compareDateIsCurrentDay(Calendar targetCalendar){
|
||||
Calendar currentCale = DateTimeUtils.getCurrentDateTime();
|
||||
String currentDay = formatCalendarToString(currentCale,OchTaxiUtils.TAXI_yyyy_MM_dd);
|
||||
if (currentDay.equals(formatCalendarToString(targetCalendar,OchTaxiUtils.TAXI_yyyy_MM_dd))){
|
||||
String currentDay = formatCalendarToString(currentCale, TaxiDateTimeUtil.TAXI_yyyy_MM_dd);
|
||||
if (currentDay.equals(formatCalendarToString(targetCalendar, TaxiDateTimeUtil.TAXI_yyyy_MM_dd))){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
@@ -155,7 +155,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<com.mogo.och.taxi.ui.OCHTaxiRadiuImageView
|
||||
<com.mogo.och.taxi.ui.TaxiRadiusImageView
|
||||
android:id="@+id/grab_result_anim"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -29,7 +29,7 @@ project.android.productFlavors {
|
||||
// 构建的应用身份类型,司机|乘客
|
||||
buildConfigField 'int', 'APP_IDENTITY_MODE', "0x00"
|
||||
// 连接的工控机IP地址
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "192.168.1.102"
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.8.102\""
|
||||
// 构建的是否是演示(美化)模式
|
||||
buildConfigField 'boolean', 'IS_DEMO_MODE', 'true'
|
||||
}
|
||||
|
||||
@@ -57,5 +57,5 @@ dependencies {
|
||||
// api "com.zhidao.support.adas:high:1.2.1.2_bate21"
|
||||
implementation 'org.greenrobot:eventbus:3.2.0'
|
||||
implementation 'com.android.support:multidex:1.0.3'
|
||||
implementation 'com.mogo.cloud:telematic:1.3.50'
|
||||
implementation 'com.mogo.cloud:telematic:1.3.52'
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context
|
||||
import androidx.annotation.RequiresPermission
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.toRouteInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
@@ -19,19 +20,22 @@ import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasListenerImpl
|
||||
import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl
|
||||
import com.mogo.eagle.core.function.autopilot.adapter.MoGoHandAdasMsgManager
|
||||
import com.mogo.eagle.core.function.autopilot.server.AsyncDataToAutopilotServer
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.telematic.MogoProtocolMsg
|
||||
import com.mogo.telematic.MogoProtocolMsg.NORMAL_DATA
|
||||
import com.mogo.telematic.MogoProtocolMsg.SYNC_MODE_STATUS
|
||||
import com.mogo.telematic.MogoProtocolMsg.*
|
||||
import com.mogo.telematic.NSDNettyManager
|
||||
import com.mogo.telematic.client.listener.MessageStateListener
|
||||
import com.mogo.telematic.client.listener.NettyClientListener
|
||||
import com.mogo.telematic.client.status.ConnectState
|
||||
import com.mogo.telematic.server.netty.NettyServerListener
|
||||
import com.mogo.telematic.server.netty.NettyTcpServer
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
import com.zhidao.support.adas.high.AdasOptions
|
||||
import com.zhidao.support.adas.high.bean.IPCUpgradeInfo
|
||||
@@ -77,7 +81,26 @@ class MoGoAutopilotProvider :
|
||||
NSDNettyManager.getInstance().startNSDNettyServerWithSN(context, object :
|
||||
NettyServerListener<MogoProtocolMsg> {
|
||||
override fun onMessageResponseServer(msg: MogoProtocolMsg?, channel: Channel?) {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "Receive client data is:${msg?.toString()}")
|
||||
msg?.let {
|
||||
when (it.protocolType) {
|
||||
REQ_CAR_NUMBER -> {
|
||||
if (!AppConfigInfo.plateNumber.isNullOrEmpty()) {
|
||||
val platNumberArray = AppConfigInfo.plateNumber!!.toByteArray()
|
||||
NSDNettyManager.getInstance().sendMsgToSpecifiedClient(
|
||||
MogoProtocolMsg(
|
||||
REQ_CAR_NUMBER,
|
||||
platNumberArray.size, platNumberArray
|
||||
), channel
|
||||
) {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "司机端发送车牌号到乘客端是否成功:${it.isSuccess}")
|
||||
}
|
||||
} else {
|
||||
CallerAutoPilotManager.getCarConfig()
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStartServer() {
|
||||
@@ -91,8 +114,15 @@ class MoGoAutopilotProvider :
|
||||
override fun onChannelConnect(channel: Channel?) {
|
||||
val socketAddress = channel?.remoteAddress().toString()
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "Client ip is:${socketAddress}")
|
||||
val byteArray = if(FunctionBuildConfig.isDemoMode) byteArrayOf(1) else byteArrayOf(0)
|
||||
NSDNettyManager.getInstance().sendMsgToSpecifiedClient(MogoProtocolMsg(SYNC_MODE_STATUS, byteArray.size, byteArray), channel) {
|
||||
val byteArray =
|
||||
if (FunctionBuildConfig.isDemoMode) byteArrayOf(1) else byteArrayOf(0)
|
||||
NSDNettyManager.getInstance().sendMsgToSpecifiedClient(
|
||||
MogoProtocolMsg(
|
||||
SYNC_MODE_STATUS,
|
||||
byteArray.size,
|
||||
byteArray
|
||||
), channel
|
||||
) {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "同步美化模式状态是否成功:${it.isSuccess}")
|
||||
}
|
||||
}
|
||||
@@ -114,41 +144,21 @@ class MoGoAutopilotProvider :
|
||||
NSDNettyManager.getInstance()
|
||||
.searchAndConnectServer(context, MoGoAiCloudClientConfig.getInstance().sn, object :
|
||||
NettyClientListener<MogoProtocolMsg> {
|
||||
override fun onMessageResponseClient(msg: MogoProtocolMsg?, sign: String?) {
|
||||
override fun onMessageResponseClient(
|
||||
msg: MogoProtocolMsg?,
|
||||
sign: String?,
|
||||
channel: Channel
|
||||
) {
|
||||
// 乘客端收到adas数据直接解析,后续分发解析后的数据流程同司机端
|
||||
try {
|
||||
msg?.let {
|
||||
when(it.protocolType) {
|
||||
NORMAL_DATA -> AdasManager.getInstance().parseIPCData(it.body)
|
||||
3 -> {
|
||||
FunctionBuildConfig.isDemoMode = when(it.body[0].toInt()) {
|
||||
1 -> true
|
||||
else -> false
|
||||
}
|
||||
setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
CallerLogger.e("$M_ADAS_IMPL$TAG", "乘客屏解析数据流程中出现异常:${e.message}")
|
||||
}
|
||||
handleMsgFromServer(msg, channel)
|
||||
}
|
||||
|
||||
override fun onClientStatusConnectChanged(statusCode: Int, sign: String?) {
|
||||
when (statusCode) {
|
||||
ConnectState.STATUS_CONNECT_SUCCESS -> {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "乘客端连接司机端服务成功! sign is:${sign}")
|
||||
}
|
||||
else -> {
|
||||
ToastUtils.showLong("和司机端连接异常!")
|
||||
CallerLogger.d(
|
||||
"$M_ADAS_IMPL$TAG",
|
||||
"client statusCode is:${statusCode}"
|
||||
)
|
||||
}
|
||||
}
|
||||
override fun onClientStatusConnectChanged(
|
||||
statusCode: Int,
|
||||
sign: String?,
|
||||
channel: Channel
|
||||
) {
|
||||
handleConnStatusWithServer(statusCode, sign)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -157,7 +167,7 @@ class MoGoAutopilotProvider :
|
||||
// 监听ADAS-SDK获取到的工控机数据(乘客也需注册)
|
||||
AdasManager.getInstance().setOnAdasListener(MoGoAdasListenerImpl())
|
||||
// 司机端监听
|
||||
if (FunctionBuildConfig.appIdentityMode == 0) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
AdasManager.getInstance().setOnMultiDeviceListener { bytes ->
|
||||
// 发送数据给乘客端
|
||||
if (NSDNettyManager.getInstance().isServerStart) {
|
||||
@@ -284,7 +294,7 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
|
||||
override fun setAutoPilotSpeed(speed: Int): Boolean {
|
||||
return AdasManager.getInstance().sendAutopilotSpeedReq(speed/3.6)
|
||||
return AdasManager.getInstance().sendAutopilotSpeedReq(speed / 3.6)
|
||||
}
|
||||
|
||||
override fun setIPCShutDown() {
|
||||
@@ -328,11 +338,17 @@ class MoGoAutopilotProvider :
|
||||
AdasManager.getInstance().sendDemoModeReq(0)
|
||||
}
|
||||
// 同步给乘客端
|
||||
if (FunctionBuildConfig.appIdentityMode == 0) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
var byteArray = if (isEnable) byteArrayOf(1) else byteArrayOf(0)
|
||||
if (NSDNettyManager.getInstance().isServerStart) {
|
||||
NSDNettyManager.getInstance()
|
||||
.sendMsgToAllClients(MogoProtocolMsg(SYNC_MODE_STATUS, byteArray.size, byteArray))
|
||||
.sendMsgToAllClients(
|
||||
MogoProtocolMsg(
|
||||
SYNC_MODE_STATUS,
|
||||
byteArray.size,
|
||||
byteArray
|
||||
)
|
||||
)
|
||||
} else {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "同步美化模式状态时司机端Server未启动!")
|
||||
}
|
||||
@@ -380,5 +396,76 @@ class MoGoAutopilotProvider :
|
||||
return AdasManager.getInstance().protocolVersion
|
||||
}
|
||||
|
||||
override fun connectSpecifiedServer(ip: String) {
|
||||
NSDNettyManager.getInstance().connectSpecifiedServer(
|
||||
ip,
|
||||
NettyTcpServer.SERVER_PORT,
|
||||
MoGoAiCloudClientConfig.getInstance().sn,
|
||||
object : NettyClientListener<MogoProtocolMsg> {
|
||||
override fun onMessageResponseClient(
|
||||
msg: MogoProtocolMsg?,
|
||||
sign: String?,
|
||||
channel: Channel
|
||||
) {
|
||||
handleMsgFromServer(msg, channel)
|
||||
}
|
||||
|
||||
override fun onClientStatusConnectChanged(
|
||||
statusCode: Int,
|
||||
sign: String?,
|
||||
channel: Channel
|
||||
) {
|
||||
handleConnStatusWithServer(statusCode, sign)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun handleMsgFromServer(msg: MogoProtocolMsg?, channel: Channel) {
|
||||
try {
|
||||
msg?.let {
|
||||
when (it.protocolType) {
|
||||
NORMAL_DATA -> AdasManager.getInstance().parseIPCData(it.body)
|
||||
SYNC_MODE_STATUS -> {
|
||||
FunctionBuildConfig.isDemoMode = when (it.body[0].toInt()) {
|
||||
1 -> true
|
||||
else -> false
|
||||
}
|
||||
setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
}
|
||||
REQ_CAR_NUMBER -> {
|
||||
AppConfigInfo.plateNumber = String(msg.body)
|
||||
ToastUtils.showShort(AppConfigInfo.plateNumber)
|
||||
// TODO:("获取到车牌号")
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
CallerLogger.e("$M_ADAS_IMPL$TAG", "乘客屏解析数据流程中出现异常:${e.message}")
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleConnStatusWithServer(statusCode: Int, sign: String?) {
|
||||
when (statusCode) {
|
||||
ConnectState.STATUS_CONNECT_SUCCESS -> {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "乘客端连接司机端服务成功! sign is:${sign}")
|
||||
if (AppConfigInfo.plateNumber.isNullOrEmpty()) {
|
||||
var byteArray = byteArrayOf(0)
|
||||
NSDNettyManager.getInstance().sendMogoProtocolMsgToServer(
|
||||
MogoProtocolMsg(REQ_CAR_NUMBER, byteArray.size, byteArray)
|
||||
) {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "请求车牌号数据发送是否成功:${it}")
|
||||
}
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
ToastUtils.showLong("和司机端连接异常!")
|
||||
CallerLogger.d(
|
||||
"$M_ADAS_IMPL$TAG",
|
||||
"client statusCode is:${statusCode}"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.autopilot.adapter
|
||||
|
||||
import chassis.VehicleStateOuterClass
|
||||
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_ARRIVE
|
||||
@@ -19,7 +18,6 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LO
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_TRAJECTORY
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeArriveAtStation
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus
|
||||
@@ -28,7 +26,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager.invokeAutopilotCarConfigData
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager.invokeAutopilotCarStateData
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotRecordResult
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotWarnMessage
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotRotting
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotTrajectory
|
||||
@@ -37,6 +35,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showAdUpgradeStatu
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showDockerRebootResult
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
import com.zhidao.support.adas.high.OnAdasListener
|
||||
import com.zhidao.support.adas.high.bean.IPCUpgradeStateInfo
|
||||
@@ -49,7 +48,6 @@ import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo_msg.MogoReportMsg
|
||||
import perception.TrafficLightOuterClass
|
||||
import record_cache.RecordPanelOuterClass
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author emArrow
|
||||
@@ -75,23 +73,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
)
|
||||
override fun onTrajectory(header: MessagePad.Header, trajectory: MessagePad.Trajectory?) {
|
||||
if (HdMapBuildConfig.isMapLoaded) {
|
||||
val trajectoryInfoArrayList = ArrayList<ADASTrajectoryInfo>()
|
||||
if (trajectory != null && trajectory.pointsList.size > 0) {
|
||||
for (trajectory in trajectory.pointsList) {
|
||||
val adasTrajectoryInfo = ADASTrajectoryInfo()
|
||||
adasTrajectoryInfo.lat = trajectory.latitude
|
||||
adasTrajectoryInfo.lon = trajectory.longitude
|
||||
adasTrajectoryInfo.acceleration = trajectory.acceleration
|
||||
adasTrajectoryInfo.accumulatedDis = trajectory.accumulatedDis
|
||||
adasTrajectoryInfo.time = trajectory.time
|
||||
adasTrajectoryInfo.velocity = trajectory.velocity
|
||||
adasTrajectoryInfo.alt = trajectory.altitude
|
||||
adasTrajectoryInfo.kappa = trajectory.kappa
|
||||
adasTrajectoryInfo.theta = trajectory.theta
|
||||
trajectoryInfoArrayList.add(adasTrajectoryInfo)
|
||||
}
|
||||
invokeAutopilotTrajectory(trajectory.pointsList)
|
||||
}
|
||||
invokeAutopilotTrajectory(trajectoryInfoArrayList)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +113,11 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
// 同步给MAP地图
|
||||
CallerMapUIServiceManager.getMapUIController()?.syncLocation2Map(gnssInfo)
|
||||
// 同步更新经纬度和系统时间至 AutoPilotStatusListener
|
||||
CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon(gnssInfo.satelliteTime.toLong(),gnssInfo.longitude, gnssInfo.latitude)
|
||||
CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon(
|
||||
gnssInfo.satelliteTime.toLong(),
|
||||
gnssInfo.longitude,
|
||||
gnssInfo.latitude
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,6 +175,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
if (autopilotStatusInfo.connectIP == null) {
|
||||
autopilotStatusInfo.connectIP = AdasManager.getInstance().ipcConnectedIp
|
||||
}
|
||||
if(autopilotStatusInfo.connectPort == null){
|
||||
autopilotStatusInfo.connectPort = AdasManager.getInstance().ipcConnectedPort
|
||||
}
|
||||
if (autopilotStatusInfo.dockVersion == null) {
|
||||
AdasManager.getInstance().carConfig?.let {
|
||||
autopilotStatusInfo.dockVersion = it.dockVersion
|
||||
@@ -214,6 +205,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
invokeAutopilotGuardian(mogoReportMessage)
|
||||
}
|
||||
}
|
||||
|
||||
//感知红绿灯
|
||||
override fun onPerceptionTrafficLight(
|
||||
header: MessagePad.Header?,
|
||||
|
||||
@@ -4,11 +4,11 @@ import android.annotation.SuppressLint
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.autopilot.network.AdasServiceModel
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
import com.zhidao.support.adas.high.OnAdasConnectStatusListener
|
||||
@@ -32,13 +32,17 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
//自动驾驶车速度
|
||||
private var mCurrentAutopilotSpeed = 0f
|
||||
|
||||
private var connectStatus = false
|
||||
|
||||
override fun onConnectionIPCStatus(ipcConnectionStatus: Int, reason: String?) {
|
||||
if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 连接成功")
|
||||
connectStatus = true
|
||||
// 初始化自动驾驶状态信息
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectIP =
|
||||
AdasManager.getInstance().ipcConnectedIp
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectPort =
|
||||
AdasManager.getInstance().ipcConnectedPort
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatus = true
|
||||
CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus()
|
||||
|
||||
@@ -49,12 +53,16 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
|
||||
} else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.DISCONNECTED) {
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 连接失败 reason:$reason")
|
||||
// TODO 需要修改断开提示
|
||||
// reason?.let {
|
||||
// TipToast.shortTip("工控机连接断开,原因:$it , 等待重连")
|
||||
// }
|
||||
if (connectStatus) {
|
||||
reason?.let {
|
||||
TipToast.shortTip("工控机连接断开,原因:$it , 等待重连")
|
||||
}
|
||||
connectStatus = false
|
||||
}
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectIP =
|
||||
AdasManager.getInstance().ipcConnectedIp
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectPort =
|
||||
AdasManager.getInstance().ipcConnectedPort
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatus = false
|
||||
//与工控机断开连接,需要重置自动驾驶状态(包括上传至云平台缓存信息),等待连接成功后同步状态信息
|
||||
mCurrentAutopilotStatus = 0
|
||||
|
||||
@@ -10,28 +10,21 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.module.common.drawer.IdentifyDataDrawer;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import chassis.Chassis;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
public class MoGoHandAdasMsgManager implements
|
||||
IMoGoAutopilotIdentifyListener,
|
||||
IMoGoAutopilotVehicleStateListener,
|
||||
IMoGoAutopilotCarConfigListener,
|
||||
IMoGoAutopilotCarStateListener {
|
||||
@@ -42,7 +35,6 @@ public class MoGoHandAdasMsgManager implements
|
||||
private Context mContext;
|
||||
|
||||
private MoGoHandAdasMsgManager(Context context) {
|
||||
CallerAutopilotIdentifyListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerAutopilotCarConfigListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerAutopilotCarStatusListenerManager.INSTANCE.addListener(TAG, this);
|
||||
@@ -91,15 +83,17 @@ public class MoGoHandAdasMsgManager implements
|
||||
@Override
|
||||
public void onAutopilotLightSwitchData(Chassis.LightSwitch lightSwitch) {
|
||||
//can数据转发 转向灯状态 0是正常 1是左转 2是右转
|
||||
if (lightSwitch != null) {
|
||||
int state = setTurnLightState(lightSwitch.getNumber());
|
||||
if (state == 1 || state == 2) {
|
||||
isShowTurnLight = true;
|
||||
CallerHmiManager.INSTANCE.showBrakeLight(0);
|
||||
} else {
|
||||
isShowTurnLight = false;
|
||||
if (!AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { //小巴不展示
|
||||
if (lightSwitch != null) {
|
||||
int state = setTurnLightState(lightSwitch.getNumber());
|
||||
if (state == 1 || state == 2) {
|
||||
isShowTurnLight = true;
|
||||
CallerHmiManager.INSTANCE.showBrakeLight(0);
|
||||
} else {
|
||||
isShowTurnLight = false;
|
||||
}
|
||||
CallerHmiManager.INSTANCE.showTurnLight(state);
|
||||
}
|
||||
CallerHmiManager.INSTANCE.showTurnLight(state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,30 +101,7 @@ public class MoGoHandAdasMsgManager implements
|
||||
public void onAutopilotBrakeLightData(boolean brakeLight) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotIdentifyDataUpdate(List<MessagePad.TrackedObject> trafficData) {
|
||||
try {
|
||||
if (FunctionBuildConfig.isDrawIdentifyData) {
|
||||
ThreadUtils.getSinglePool().execute(() ->
|
||||
IdentifyDataDrawer.getInstance().renderAdasRecognizedResult(trafficData)
|
||||
);
|
||||
} else {
|
||||
IdentifyDataDrawer.getInstance().clearOldMarker();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotWarnMessage(MessagePad.Warn warn) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRecordResult(RecordPanelOuterClass.RecordPanel recordPanel) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotCarConfig(@NotNull MessagePad.CarConfigResp carConfigResp) {
|
||||
@@ -143,15 +114,17 @@ public class MoGoHandAdasMsgManager implements
|
||||
@Override
|
||||
public void onAutopilotCarStateData(@Nullable MessagePad.GnssInfo gnssInfo) {
|
||||
//根据加速度判断 是否刹车
|
||||
if (gnssInfo != null) {
|
||||
//设置刹车信息
|
||||
if (gnssInfo.getAcceleration() < SharedPrefsMgr.getInstance(mContext).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,-2.5F)) {
|
||||
brakeLight = 1;
|
||||
} else {
|
||||
brakeLight = 0;
|
||||
}
|
||||
if (!isShowTurnLight) {
|
||||
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
|
||||
if (!AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { //小巴不展示
|
||||
if (gnssInfo != null) {
|
||||
//设置刹车信息
|
||||
if (gnssInfo.getAcceleration() < SharedPrefsMgr.getInstance(mContext).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,-2.5F)) {
|
||||
brakeLight = 1;
|
||||
} else {
|
||||
brakeLight = 0;
|
||||
}
|
||||
if (!isShowTurnLight) {
|
||||
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,9 @@ class ChatHttp {
|
||||
|
||||
fun getBaseUrl(): String {
|
||||
return when (DebugConfig.getNetMode()) {
|
||||
DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_QA, DebugConfig.NET_MODE_DEMO -> DEV_BASE_URL_OWNER
|
||||
DebugConfig.NET_MODE_DEV, DebugConfig.NET_MODE_QA -> DEV_CONFIG_URL
|
||||
DebugConfig.NET_MODE_RELEASE -> RELEASE_BASE_URL_OWNER
|
||||
DebugConfig.NET_MODE_DEMO -> DEV_BASE_URL_OWNER
|
||||
else -> RELEASE_BASE_URL_OWNER
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,11 @@ import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.chat.UserInfo
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
|
||||
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
|
||||
import com.mogo.eagle.core.function.chat.facade.consts.ChatHttp
|
||||
import com.mogo.eagle.core.function.chat.facade.consts.ChatHttp.Companion.getConfig
|
||||
import com.mogo.eagle.core.function.chat.facade.net.bean.*
|
||||
import com.mogo.eagle.core.function.chat.facade.utils.log
|
||||
import com.mogo.map.MogoLocationClient
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import retrofit2.http.*
|
||||
|
||||
|
||||
@@ -44,6 +44,14 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
MogoLogCatchManager.stopCatchLog(logPrefixName)
|
||||
}
|
||||
|
||||
override fun getTraceLogStatus(): Boolean {
|
||||
return traceManager.getTraceLogStatus()
|
||||
}
|
||||
|
||||
override fun setTraceLogEnable(enable: Boolean) {
|
||||
traceManager.setTraceLogEnable(enable)
|
||||
}
|
||||
|
||||
override fun getTraceInfo(): HashMap<Int, ChainLogParam> {
|
||||
return traceManager.getTraceInfo()
|
||||
}
|
||||
|
||||
@@ -8,11 +8,14 @@ import android.view.WindowManager
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.PX
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onDetach
|
||||
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
|
||||
import com.mogo.eagle.core.utilcode.kotlin.scope
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
@@ -31,7 +34,6 @@ import com.zhjt.mogo_core_function_devatools.feedback.callback.IFeedbackCallback
|
||||
import kotlinx.coroutines.*
|
||||
import record_cache.RecordPanelOuterClass
|
||||
import java.io.File
|
||||
import java.lang.IllegalStateException
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import kotlin.Result.Companion
|
||||
@@ -77,7 +79,7 @@ internal object FeedbackManager {
|
||||
|
||||
record.scope.launch {
|
||||
val taskId = presenter.getBadCaseTaskId()
|
||||
val listener = object : IMoGoAutopilotIdentifyListener {
|
||||
val listener = object : IMoGoAutopilotRecordListener {
|
||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||
super.onAutopilotRecordResult(recordPanel)
|
||||
record.scope.launch {
|
||||
@@ -109,9 +111,9 @@ internal object FeedbackManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
CallerAutopilotIdentifyListenerManager.addListener("Feedback", listener)
|
||||
CallerAutopilotRecordListenerManager.addListener("Feedback", listener)
|
||||
record.onDetach {
|
||||
CallerAutopilotIdentifyListenerManager.removeListener("Feedback")
|
||||
CallerAutopilotRecordListenerManager.removeListener("Feedback")
|
||||
hideFloat = null
|
||||
}
|
||||
record.text = "结束录制"
|
||||
|
||||
@@ -156,6 +156,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
MoGoAiCloudClientConfig.getInstance().sn,
|
||||
AppConfigInfo.toString(),
|
||||
logPrefixName?.replace("_", "-"),
|
||||
mutableListOf(),
|
||||
content,
|
||||
this
|
||||
)
|
||||
|
||||
@@ -58,6 +58,14 @@ class TraceManager {
|
||||
.init(context, MoGoAiCloudClientConfig.getInstance().sn, pkgName, fwBuildMap)
|
||||
}
|
||||
|
||||
fun setTraceLogEnable(enable:Boolean){
|
||||
FileWriteManager.getInstance().logger = enable
|
||||
}
|
||||
|
||||
fun getTraceLogStatus():Boolean{
|
||||
return FileWriteManager.getInstance().logger
|
||||
}
|
||||
|
||||
fun getTraceInfo(): HashMap<Int, ChainLogParam> {
|
||||
return traceInfoCache
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import android.os.Message;
|
||||
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
@@ -275,7 +274,7 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener<Dispatch
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
|
||||
public void onAutopilotTrajectory(List<MessagePad.TrajectoryPoint> trajectoryInfos) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
|
||||
|
||||
@@ -20,14 +20,14 @@ import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewNotification
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.check.CallerCheckManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
@@ -64,7 +64,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
IMoGoWaringProvider,
|
||||
IMoGoHmiViewProxy,
|
||||
MoGoWarningContract.View,
|
||||
IMoGoAutopilotIdentifyListener {
|
||||
IMoGoAutopilotRecordListener {
|
||||
private val TAG = "MoGoHmiFragment"
|
||||
|
||||
// DebugSettingView
|
||||
@@ -136,7 +136,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
|
||||
/*// TODO 这里后面需要改成独立进程通讯后台获取YUV
|
||||
view.postDelayed({
|
||||
@@ -167,7 +167,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||
CallerAutopilotRecordListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
|
||||
@@ -839,7 +839,9 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
*/
|
||||
override fun showTurnLight(light: Int) {
|
||||
if (HmiBuildConfig.isShowTurnLightView) {
|
||||
turnLightView.setTurnLight(light)
|
||||
ThreadUtils.runOnUiThread {
|
||||
turnLightView.setTurnLight(light)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -848,7 +850,9 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
*/
|
||||
override fun showBrakeLight(light: Int) {
|
||||
if (HmiBuildConfig.isShowBrakeLightView) {
|
||||
brakeView.setBrakeLight(light)
|
||||
ThreadUtils.runOnUiThread {
|
||||
brakeView.setBrakeLight(light)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -565,8 +565,18 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
tbChangeAutoPilotStatus.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
CallerAutoPilotManager.setControlAutopilotCarAuto(isChecked)
|
||||
}
|
||||
|
||||
|
||||
when {
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> {
|
||||
brakeThresholdDivider.visibility = View.GONE
|
||||
btnConnectServerIp.visibility = View.GONE
|
||||
etConnectServerIp.visibility = View.GONE
|
||||
}
|
||||
else -> {
|
||||
brakeThresholdDivider.visibility = View.VISIBLE
|
||||
btnConnectServerIp.visibility = View.VISIBLE
|
||||
etConnectServerIp.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -600,8 +610,10 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
//设置连接司机屏IP
|
||||
btnConnectServerIp.setOnClickListener {
|
||||
//TODO 连接设置 输入框:etConnectServerIp
|
||||
|
||||
val ip = etConnectServerIp.text.toString()
|
||||
if (!ip.isNullOrEmpty()) {
|
||||
CallerAutoPilotManager.connectSpecifiedServer(ip)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -615,7 +627,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
SharedPrefsMgr.getInstance(context)
|
||||
.getString(MoGoConfig.AUTOPILOT_IP, FunctionBuildConfig.adasConnectIP)
|
||||
|
||||
etAutopilotIP.setText(autoPilotIpAddress)
|
||||
etAutopilotIP.setText("192.168.1.103:4110")
|
||||
etAutopilotIP.text?.let { etAutopilotIP.setSelection(it.length) }
|
||||
//设置工控机IP
|
||||
btnSetAutopilotIP.setOnClickListener {
|
||||
@@ -994,7 +1006,11 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cbTraceLog.isChecked = CallerDevaToolsManager.getTraceLogStatus()
|
||||
//链路Log输出日志
|
||||
cbTraceLog.setOnCheckedChangeListener { _, isChecked ->
|
||||
CallerDevaToolsManager.setTraceLogEnable(isChecked)
|
||||
}
|
||||
//ADAS日志标签
|
||||
cbAdasLog.setOnCheckedChangeListener { _, isChecked ->
|
||||
val adasModule = SceneModule(isChecked, SceneConstant.M_ADAS_IMPL)
|
||||
@@ -1329,16 +1345,17 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
AppConfigInfo.isConnectNet = NetworkUtils.isConnected(context)
|
||||
AppConfigInfo.isConnectSocket = DebugConfig.isDownloadSnapshot()
|
||||
|
||||
when (FunctionBuildConfig.appIdentityMode) {
|
||||
0x00 -> {// 司机端
|
||||
when {
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> {// 司机端
|
||||
AppConfigInfo.isDriver = true
|
||||
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getServerStarted()
|
||||
}
|
||||
else -> {
|
||||
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) -> {
|
||||
AppConfigInfo.isDriver = false
|
||||
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getClientConnStatus()
|
||||
AppConfigInfo.serverIp = CallerTelematicManager.getServerIp()
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1550,7 +1567,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotTrajectory(trajectoryInfos: ArrayList<ADASTrajectoryInfo>) {
|
||||
override fun onAutopilotTrajectory(trajectoryInfos: MutableList<MessagePad.TrajectoryPoint>) {
|
||||
mTrajectoryInfoSize = trajectoryInfos.size
|
||||
}
|
||||
|
||||
|
||||
@@ -613,7 +613,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="@drawable/debug_setting_edit_bg"
|
||||
android:gravity="center"
|
||||
android:text="192.168.8.102"
|
||||
android:text="192.168.8.103:4110"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/btnSetAutopilotIP"
|
||||
@@ -1427,6 +1427,14 @@
|
||||
app:justifyContent="flex_start"
|
||||
tools:visibility="visible">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbTraceLog"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="链路日志" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbAdasLog"
|
||||
style="@style/DebugSettingText"
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLimitingVelocity"
|
||||
android:layout_width="130px"
|
||||
android:layout_height="130px"
|
||||
android:layout_width="120px"
|
||||
android:layout_height="120px"
|
||||
android:background="@drawable/bg_waring_limiting_velocity"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.common.drawer;
|
||||
package com.mogo.eagle.core.function.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -6,41 +6,39 @@ import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.map.IMogoMapFrameController;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/23
|
||||
*
|
||||
* 描述
|
||||
* <p>
|
||||
* 地图控制交互层
|
||||
*/
|
||||
|
||||
@Route( path = MogoServicePaths.PATH_MAP_FRAME_CONTROLLER )
|
||||
class MapFrameController implements IMogoMapFrameController {
|
||||
@Route(path = MogoServicePaths.PATH_MAP_FRAME_CONTROLLER)
|
||||
public class MapFrameController implements IMogoMapFrameController {
|
||||
|
||||
private IMogoMapFrameController mController;
|
||||
|
||||
@Override
|
||||
public void initDelegate( IMogoMapFrameController controller ) {
|
||||
public void initDelegate(IMogoMapFrameController controller) {
|
||||
mController = controller;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeTo2dMode() {
|
||||
if ( mController != null ) {
|
||||
if (mController != null) {
|
||||
mController.changeTo2dMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeToVRMode() {
|
||||
if ( mController != null ) {
|
||||
if (mController != null) {
|
||||
mController.changeToVRMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
|
||||
public void init(Context context) {
|
||||
MapIdentifySubscriber.Companion.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.mogo.eagle.core.function.map
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoSubscriber
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
|
||||
/**
|
||||
* 订阅感知数据的订阅者
|
||||
* 数据来源:工控机、OBU、云端下发
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
class MapIdentifySubscriber private constructor() : IMoGoSubscriber, IMoGoAutopilotIdentifyListener {
|
||||
|
||||
private val TAG = "MapIdentifySubscriber"
|
||||
|
||||
init {
|
||||
onCrate()
|
||||
}
|
||||
|
||||
companion object {
|
||||
val instance: MapIdentifySubscriber by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
MapIdentifySubscriber()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCrate() {
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?) {
|
||||
try {
|
||||
if (FunctionBuildConfig.isDrawIdentifyData) {
|
||||
ThreadUtils.getSinglePool().execute { IdentifyDataDrawer.getInstance().renderAdasRecognizedResult(trafficData) }
|
||||
} else {
|
||||
IdentifyDataDrawer.getInstance().clearOldMarker()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotWarnMessage(warn: MessagePad.Warn?) {
|
||||
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user