Merge branch 'dev_robotaxi-d-app-module_290_220715_2.9.0' into dev_robotaxi-d-app-module-videoprocess
# Conflicts: # OCH/mogo-och-taxi-passenger/src/main/res/values/strings.xml
@@ -52,6 +52,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
|
||||
@@ -337,6 +338,10 @@ public class BusPassengerModel {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener(){
|
||||
|
||||
@@ -9,5 +9,5 @@ import java.util.List;
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
public interface IRefreshBusStationsCallback {
|
||||
void refreshBusStations(List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived);
|
||||
void refreshBusStations(String lineName,List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived);
|
||||
}
|
||||
|
||||
@@ -71,6 +71,6 @@ class BusConst {
|
||||
*/
|
||||
const val TYPE_MARKER_BUS_ORDER = "TYPE_MARKER_BUS_ORDER"
|
||||
|
||||
const val TIMER_START_AUTOPILOT_INTERVAL = 10 * 1000L
|
||||
const val TIMER_START_AUTOPILOT_INTERVAL = 20 * 1000L
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
|
||||
@@ -49,6 +50,7 @@ import com.mogo.och.bus.util.BDRouteDataTestUtils;
|
||||
import com.mogo.och.bus.view.BusArcView;
|
||||
import com.mogo.och.bus.view.SlidePanelView;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
/**
|
||||
@@ -69,6 +71,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
protected TextView tvOperationStatus;
|
||||
protected RelativeLayout mSettingBtn;
|
||||
protected ImageView mBadcaseBtn;
|
||||
protected ImageView mAISelectBtn;
|
||||
public boolean isOperationStatus;//false-收车,true-出车
|
||||
private FrameLayout flStationPanelContainer;
|
||||
private Group groupTestPanel;
|
||||
@@ -211,14 +214,11 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
// return null; });
|
||||
|
||||
if (mBadcaseBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn, null, null);
|
||||
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn);
|
||||
if (!HmiBuildConfig.isShowBadCaseView) {
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
}
|
||||
//设置升级小红点提示 默认隐藏
|
||||
mUpgradeTipIv = findViewById(R.id.module_och_bus_upgrade_red_tip);
|
||||
CallerHmiManager.INSTANCE.registerUpgradeTipsCallback(() -> mUpgradeTipIv);
|
||||
}
|
||||
|
||||
private void updateSwitchMapIcon(){
|
||||
@@ -251,6 +251,10 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 测试到站
|
||||
|
||||
@@ -42,11 +42,11 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
private static final String TAG = "BusFragment";
|
||||
|
||||
private TextView mCurrentStationName;
|
||||
private TextView mStartStationFlag;
|
||||
private TextView mNextStationName;
|
||||
private TextView mEndStationFlag;
|
||||
// private TextView mDebugArrive;
|
||||
private TextView mCurrentTag;
|
||||
private TextView mNextTag;
|
||||
private TextView mSwitchLine; //切换路线
|
||||
private TextView mLineName;
|
||||
private int mCurrentStation = 0;
|
||||
|
||||
private View mBus;
|
||||
@@ -64,11 +64,11 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
super.initViews();
|
||||
mBus = findViewById(R.id.module_och_bus_tag);
|
||||
mCurrentStationName = findViewById(R.id.module_och_bus_current_station);
|
||||
mStartStationFlag = findViewById(R.id.module_och_bus_start_station_tag);
|
||||
mCurrentTag = findViewById(R.id.module_och_bus_current_station_anchor);
|
||||
mNextStationName = findViewById(R.id.module_och_bus_order_end_station);
|
||||
mEndStationFlag = findViewById(R.id.module_och_bus_end_station_tag);
|
||||
mNextTag = findViewById(R.id.module_och_bus_next_station_anchor);
|
||||
mSwitchLine = findViewById(R.id.switch_line_btn);
|
||||
// mDebugArrive = findViewById(R.id.module_och_bus_arrive_station);
|
||||
mLineName = findViewById(R.id.module_och_bus_line_name);
|
||||
|
||||
if (DebugConfig.isDebug()) {
|
||||
mBus.setOnClickListener(view -> {
|
||||
@@ -76,10 +76,6 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
mPresenter.queryBusRoutes();
|
||||
});
|
||||
|
||||
// mBus.setOnLongClickListener(view -> {
|
||||
// getActivity().finish();
|
||||
// return true;
|
||||
// });
|
||||
//debug下调用测试面板
|
||||
mCurrentStationName.setOnLongClickListener(v -> {
|
||||
debugTestBar();
|
||||
@@ -132,7 +128,8 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
* @param nextStation 下个站点
|
||||
* @param isArrived 是否都站
|
||||
*/
|
||||
public void refreshBusStations(List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived) {
|
||||
public void refreshBusStations(String lineName,List<BusStationBean> stationList
|
||||
, int currentStation, int nextStation, boolean isArrived) {
|
||||
mCurrentStation = currentStation;
|
||||
if (getActivity() == null) {
|
||||
return;
|
||||
@@ -144,25 +141,25 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
}
|
||||
|
||||
// 渲染小巴路线数据
|
||||
renderCurrentStationStatus(stationList, currentStation, nextStation, isArrived);
|
||||
renderCurrentStationStatus(lineName,stationList, currentStation, nextStation, isArrived);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新刷新站点信息 isArrived 是否到站
|
||||
*/
|
||||
private void renderCurrentStationStatus(List<BusStationBean> stationList, int currentStation
|
||||
private void renderCurrentStationStatus(String lineName,List<BusStationBean> stationList, int currentStation
|
||||
, int nextStation, boolean isArrived) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + "MapMaker ", "currentStation=" + currentStation + ",nextStation=" + nextStation + "isArrived=" + isArrived);
|
||||
String currentStationName = null;
|
||||
String nextStationName = null;
|
||||
int startStationFlagVisibility = View.INVISIBLE;
|
||||
int endStationFlagVisibility = View.INVISIBLE;
|
||||
|
||||
boolean isArriveEndStation = false;
|
||||
boolean isArriveAtStation = false;
|
||||
boolean isArriveAtStartStation = false;
|
||||
|
||||
mLineName.setText(lineName);
|
||||
|
||||
// 获取当前站点的名称
|
||||
currentStationName = stationList.get(currentStation).getName();
|
||||
|
||||
@@ -171,9 +168,8 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
|
||||
// 是否到达起点
|
||||
if (currentStation == 0) {
|
||||
startStationFlagVisibility = View.VISIBLE;
|
||||
isArriveAtStartStation = true;
|
||||
mStartStationFlag.setText(getResources().getString(R.string.bus_arrive_to_end_start));
|
||||
mCurrentTag.setText(getResources().getString(R.string.bus_arrive_to_end_start));
|
||||
|
||||
setOrRemoveMapMaker(true, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
@@ -181,6 +177,8 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
, endStation.getLon(),R.raw.end_marker);
|
||||
} else if (currentStation > 0 && currentStation < stationList.size() - 1) {// 是否到达站点
|
||||
isArriveAtStation = true;
|
||||
mCurrentTag.setText(getResources().getString(R.string.bus_arrive_to_current_tag));
|
||||
mNextTag.setText(getResources().getString(R.string.bus_arrive_to_next_tag));
|
||||
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
@@ -189,9 +187,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
} else if (currentStation == stationList.size() - 1) {// 是否到达终点
|
||||
isArriveEndStation = true;
|
||||
nextStationName = "--";
|
||||
mStartStationFlag.setText(getResources().getString(R.string.bus_arrive_to_end_end));
|
||||
startStationFlagVisibility = View.VISIBLE;
|
||||
endStationFlagVisibility = View.INVISIBLE;
|
||||
mNextTag.setText(getResources().getString(R.string.bus_arrive_to_end_end));
|
||||
|
||||
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
|
||||
, startStation.getLon(),R.raw.star_marker);
|
||||
@@ -211,8 +207,16 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
}
|
||||
|
||||
// 是否到达终点
|
||||
if (nextStation == stationList.size() - 1) {
|
||||
endStationFlagVisibility = View.VISIBLE;
|
||||
if ( nextStation == stationList.size() - 1 || nextStation == -1) {
|
||||
mNextTag.setText(getResources().getString(R.string.bus_arrive_to_end_end));
|
||||
}else {
|
||||
mNextTag.setText(getResources().getString(R.string.bus_arrive_to_next_tag));
|
||||
}
|
||||
|
||||
if (currentStation == 0 && isArrived){
|
||||
showOrHideSwitchLineBtn(true);
|
||||
}else {
|
||||
showOrHideSwitchLineBtn(false);
|
||||
}
|
||||
|
||||
// 重置滑动按钮文字
|
||||
@@ -226,12 +230,17 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
|
||||
mCurrentStationName.setText(currentStationName);
|
||||
mNextStationName.setText(nextStationName);
|
||||
mStartStationFlag.setVisibility(startStationFlagVisibility);
|
||||
mEndStationFlag.setVisibility(endStationFlagVisibility);
|
||||
|
||||
updateBusTestBarInfo();
|
||||
}
|
||||
|
||||
private void showOrHideSwitchLineBtn(boolean isShow) {
|
||||
if (isShow){
|
||||
mSwitchLine.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
mSwitchLine.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
public void hideOchBus() {
|
||||
// tvNotice.setVisibility(View.GONE);
|
||||
}
|
||||
@@ -374,5 +383,4 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.location.Location;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -79,7 +80,6 @@ import mogo.telematics.pad.MessagePad;
|
||||
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站点索引
|
||||
/**
|
||||
* 运营状态、后端更具运营状态来判断车辆是否派单
|
||||
@@ -246,12 +246,12 @@ public class BusOrderModel {
|
||||
* 上报订单全路径规划数据
|
||||
*/
|
||||
public void updateOrderRoute() {
|
||||
if (!isGoingToNextStation || currentStationIndex >= stationList.size() || currentStationIndex-1 < 0 || points.size() == 0){
|
||||
if (!isGoingToNextStation || backgroundCurrentStationIndex+1 >= stationList.size() || points.size() == 0){
|
||||
return;
|
||||
}
|
||||
|
||||
BusStationBean currentStation = stationList.get( currentStationIndex -1);
|
||||
BusStationBean nextStation = stationList.get( currentStationIndex);
|
||||
BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1);
|
||||
|
||||
BusServiceManager.getInstance().updateOrderRoute(mContext, currentLineId, currentStation.getSiteId()
|
||||
, nextStation.getSiteId(), points, new IBusServiceCallback<BaseData>() {
|
||||
@@ -446,11 +446,10 @@ public class BusOrderModel {
|
||||
if (!isOneWayOver){
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "自动驾驶开启开往下一站====" );
|
||||
//需要更改当前站和下一站的状态 然后渲染
|
||||
RenderLeaveStationSuccess(o.getResult(),isRestart);
|
||||
leaveStationSuccess(o.getResult(),isRestart);
|
||||
}else {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "单程真的结束了====" );
|
||||
isGoingToNextStation = false;
|
||||
currentStationIndex = 0;
|
||||
backgroundCurrentStationIndex = 0;
|
||||
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
|
||||
queryBusRoutes();
|
||||
@@ -480,7 +479,7 @@ public class BusOrderModel {
|
||||
paramIndexes = {0},
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
private void RenderLeaveStationSuccess(BusRoutesResult result, boolean isRestart) {
|
||||
private void leaveStationSuccess(BusRoutesResult result, boolean isRestart) {
|
||||
renderBusStationsStatus(result);
|
||||
if (slidePannelHideCallback != null) {
|
||||
slidePannelHideCallback.hideSlidePanel();
|
||||
@@ -500,8 +499,8 @@ public class BusOrderModel {
|
||||
* @param isRestart
|
||||
*/
|
||||
private void startAutopilot(boolean isRestart) {
|
||||
BusStationBean currentStation = stationList.get( currentStationIndex -1);
|
||||
BusStationBean nextStation = stationList.get( currentStationIndex);
|
||||
BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex + 1);
|
||||
|
||||
// if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE
|
||||
// == CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()) {
|
||||
@@ -540,9 +539,14 @@ public class BusOrderModel {
|
||||
* 到站后重置站点状态
|
||||
*/
|
||||
private void arriveSiteStation(boolean isRestart) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation-currentStationIndex = "+currentStationIndex);
|
||||
int arrivedStationIndex = 0;
|
||||
if (!isRestart){
|
||||
arrivedStationIndex = backgroundCurrentStationIndex + 1;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation-currentStationIndex = "+ arrivedStationIndex);
|
||||
|
||||
BusServiceManager.getInstance().arriveSiteStation(mContext
|
||||
, stationList.get(currentStationIndex).getSeq(), stationList.get(currentStationIndex).getSiteId()
|
||||
, stationList.get(arrivedStationIndex).getSeq(), stationList.get(arrivedStationIndex).getSiteId()
|
||||
, new IBusServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
@@ -567,9 +571,9 @@ public class BusOrderModel {
|
||||
private void renderArriveBusStation() {
|
||||
List<BusStationBean> site = busRoutesResult.getSites();
|
||||
if (site != null && site.size() > 0){
|
||||
backgroundCurrentStationIndex = currentStationIndex;
|
||||
backgroundCurrentStationIndex ++;
|
||||
if (refreshBusStationsCallback != null){
|
||||
refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex
|
||||
refreshBusStationsCallback.refreshBusStations(busRoutesResult.getName(),stationList, backgroundCurrentStationIndex
|
||||
, getNextStopStation(),true);
|
||||
}
|
||||
}
|
||||
@@ -582,7 +586,7 @@ public class BusOrderModel {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "查询到站下车乘客");
|
||||
|
||||
BusServiceManager.getInstance().queryStationLeaveAwayPassengers(mContext
|
||||
, stationList.get(currentStationIndex).getSeq(), stationList.get(currentStationIndex).getSiteId()
|
||||
, stationList.get(backgroundCurrentStationIndex +1).getSeq(), stationList.get(backgroundCurrentStationIndex+1).getSiteId()
|
||||
, new IBusServiceCallback<QueryLeaveAwayPassengersResponse>() {
|
||||
@Override
|
||||
public void onSuccess(QueryLeaveAwayPassengersResponse o) {
|
||||
@@ -608,6 +612,7 @@ public class BusOrderModel {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
mIsWorking = !mIsWorking;
|
||||
closeBeautificationMode();
|
||||
carOperationStatusCallback.changeOperationStatus(isWorking());
|
||||
startOrStopOrderLoop(mIsWorking);
|
||||
BusTrajectoryManager.getInstance().stopTrajReqLoop();
|
||||
@@ -623,6 +628,17 @@ public class BusOrderModel {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭美化模式
|
||||
*/
|
||||
private void closeBeautificationMode() {
|
||||
if (FunctionBuildConfig.isDemoMode) {//收车结束美化
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
CallerAutoPilotManager.INSTANCE.setDemoMode(false);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为false(收车)");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 出车
|
||||
*/
|
||||
@@ -634,7 +650,7 @@ public class BusOrderModel {
|
||||
startOrStopOrderLoop(mIsWorking);
|
||||
if ( stationList != null && stationList.size() > 0 ) {
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "车辆已整备完毕,请前往"
|
||||
+ stationList.get( currentStationIndex ).getName() + "站点" );
|
||||
+ stationList.get( backgroundCurrentStationIndex ).getName() + "站点" );
|
||||
}
|
||||
carOperationStatusCallback.changeOperationStatus(isWorking());
|
||||
queryBusRoutes();
|
||||
@@ -693,7 +709,7 @@ public class BusOrderModel {
|
||||
/**
|
||||
* 渲染站点信息
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理current index,不能直接渲染
|
||||
* 车机端展示 离开站为当前站点,前往站为下一站, 下一站到站后在置为当前站
|
||||
* @param result
|
||||
*/
|
||||
private void renderBusStationsStatus(BusRoutesResult result) {
|
||||
@@ -705,42 +721,47 @@ public class BusOrderModel {
|
||||
stationList.addAll( site );
|
||||
for ( int i = 0; i < stationList.size(); i++ ) {
|
||||
BusStationBean s = stationList.get( i );
|
||||
|
||||
CallerLogger.INSTANCE.d( M_BUS + "renderBusStationsStatus--",
|
||||
"Index="+ i+" ,name = "+s.getName()+" ,"+s.isLeaving()+","+s.getDrivingStatus());
|
||||
|
||||
// 是否正在开往下一站
|
||||
if ( s.isLeaving()) {
|
||||
isGoingToNextStation = true;
|
||||
}
|
||||
// 当前站点信息
|
||||
if (s.getDrivingStatus() == STATION_STATUS_STOPPED ) {
|
||||
currentStationIndex = i;
|
||||
backgroundCurrentStationIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
backgroundCurrentStationIndex = currentStationIndex;
|
||||
BusStationBean currentStation = stationList.get(currentStationIndex);
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "渲染站点信息服务端currentStationIndex="+currentStationIndex
|
||||
|
||||
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG,
|
||||
"渲染站点信息服务端currentStationIndex="+backgroundCurrentStationIndex
|
||||
+" isLeaving()="+currentStation.isLeaving());
|
||||
|
||||
//当前站点是始发站,告诉服务端到达始发站。 如果没有这个节点, 服务器不知道始发站到达状态
|
||||
// ,订单开始站下在始发站的状态流转有问题
|
||||
if (currentStationIndex == 0 && !currentStation.isLeaving()){
|
||||
if (backgroundCurrentStationIndex == 0 && !currentStation.isLeaving()){
|
||||
arriveSiteStation(true);
|
||||
}
|
||||
|
||||
// 美化是否开始
|
||||
if (FunctionBuildConfig.isDemoMode && ((currentStationIndex > 0
|
||||
&& currentStationIndex < stationList.size()-1)
|
||||
|| (stationList.get(0).isLeaving() || stationList.get(stationList.size() -1).isLeaving()))){//行驶过程中设置美化
|
||||
if (FunctionBuildConfig.isDemoMode && (backgroundCurrentStationIndex >= 0
|
||||
&& backgroundCurrentStationIndex <= stationList.size()-1)
|
||||
&& stationList.get(backgroundCurrentStationIndex).isLeaving()){//行驶过程中设置美化
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
|
||||
CallerAutoPilotManager.INSTANCE.setDemoMode(true);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)");
|
||||
}
|
||||
|
||||
if (refreshBusStationsCallback != null){
|
||||
if (currentStation.isLeaving()){//如果服务端的当前站是leaving状态,展示当前站需要+1
|
||||
currentStationIndex ++;
|
||||
refreshBusStationsCallback.refreshBusStations(stationList
|
||||
, currentStationIndex, getNextStopStation(),false);
|
||||
}else{
|
||||
refreshBusStationsCallback.refreshBusStations(stationList
|
||||
, currentStationIndex, getNextStopStation(),true);
|
||||
}
|
||||
refreshBusStationsCallback.refreshBusStations(result.getName(),stationList
|
||||
, backgroundCurrentStationIndex, getNextStopStation(),!currentStation.isLeaving());
|
||||
}
|
||||
|
||||
if ( currentStation.isLeaving() && slidePannelHideCallback != null) {
|
||||
slidePannelHideCallback.hideSlidePanel();
|
||||
}
|
||||
@@ -755,10 +776,10 @@ public class BusOrderModel {
|
||||
* @return -1 当前已是最后一个站点
|
||||
*/
|
||||
private int getNextStopStation() {
|
||||
if ( currentStationIndex >= stationList.size() - 1 ) {
|
||||
if ( backgroundCurrentStationIndex >= stationList.size() - 1 ) {
|
||||
return -1;
|
||||
}
|
||||
int nextStationIndex = currentStationIndex + 1;
|
||||
int nextStationIndex = backgroundCurrentStationIndex + 1;
|
||||
for ( ; nextStationIndex < stationList.size() - 1; nextStationIndex++ ) {
|
||||
if ( stationList.get( nextStationIndex ).getIfStop() == 1 ) {
|
||||
break;
|
||||
@@ -789,12 +810,13 @@ public class BusOrderModel {
|
||||
* @param awayPassengersResponse
|
||||
*/
|
||||
private void playLeavePassengersMsg( QueryLeaveAwayPassengersResponse awayPassengersResponse ) {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "播报下车乘客信息currentStationIndex="+currentStationIndex);
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "播报下车乘客信息currentStationIndex="
|
||||
+ String.valueOf(backgroundCurrentStationIndex + 1));
|
||||
|
||||
if ( currentStationIndex > stationList.size() - 1 ) {
|
||||
if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) {
|
||||
return;
|
||||
}
|
||||
String station = stationList.get( currentStationIndex ).getName();
|
||||
String station = stationList.get( backgroundCurrentStationIndex+1 ).getName();
|
||||
StringBuilder builder = new StringBuilder( "已到达" );
|
||||
builder.append( station );
|
||||
if ( !station.endsWith( "站" ) ) {
|
||||
@@ -841,9 +863,8 @@ public class BusOrderModel {
|
||||
* 行程结束
|
||||
*/
|
||||
private void travelOver() {
|
||||
// CallerLogger.INSTANCE.d( M_BUS + TAG, "行程结束");
|
||||
|
||||
if ( currentStationIndex >= stationList.size() ) {
|
||||
if ( backgroundCurrentStationIndex >= stationList.size() ) {
|
||||
CallerLogger.INSTANCE.e( M_BUS + TAG, "travel over index out of station list" );
|
||||
return;
|
||||
}
|
||||
@@ -862,18 +883,18 @@ public class BusOrderModel {
|
||||
* @param data
|
||||
*/
|
||||
public void onArriveAt( MessagePad.ArrivalNotification data){
|
||||
if ( currentStationIndex > stationList.size() - 1 ) {
|
||||
if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) {
|
||||
CallerLogger.INSTANCE.e( M_BUS + TAG, "到站异常,取消后续操作结束" );
|
||||
return;
|
||||
}
|
||||
if (FunctionBuildConfig.isDemoMode && currentStationIndex == stationList.size() - 1) {//到达最后一站结束美化
|
||||
if (FunctionBuildConfig.isDemoMode && backgroundCurrentStationIndex <= stationList.size() - 1) {//到达一站结束美化
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
CallerAutoPilotManager.INSTANCE.setDemoMode(false);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为false(到最后一站)");
|
||||
}
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "到站====currentStationIndex=" + currentStationIndex);
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "到站====currentStationIndex=" + backgroundCurrentStationIndex);
|
||||
isGoingToNextStation = false;
|
||||
// 到达站点后,更新站点状态
|
||||
// currentStationIndex = getNextStopStation();
|
||||
|
||||
queryStationLeaveAwayPassengers();
|
||||
UiThreadHandler.postDelayed(new Runnable() {// 先查询下车乘客,再上报到站,便于后台筛查下车订单
|
||||
@Override
|
||||
@@ -916,11 +937,11 @@ public class BusOrderModel {
|
||||
}
|
||||
|
||||
public void triggerStartServiceEvent(boolean isRestart, boolean send) {
|
||||
if (stationList == null || currentStationIndex >= stationList.size() || currentStationIndex == 0) {
|
||||
if (stationList == null || backgroundCurrentStationIndex >= stationList.size() || backgroundCurrentStationIndex == 0) {
|
||||
return;
|
||||
}
|
||||
BusStationBean currentStation = stationList.get( currentStationIndex -1);
|
||||
BusStationBean nextStation = stationList.get( currentStationIndex);
|
||||
BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
|
||||
BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1);
|
||||
BusAnalyticsManager.getInstance().triggerStartAutopilotEvent(isRestart, send,
|
||||
currentStation.getName(), nextStation.getName(), currentLineId);
|
||||
}
|
||||
@@ -930,6 +951,6 @@ public class BusOrderModel {
|
||||
}
|
||||
|
||||
public int getCurrentStationIndex() {
|
||||
return currentStationIndex;
|
||||
return backgroundCurrentStationIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
/**
|
||||
* 网约车小巴
|
||||
@@ -47,6 +48,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
private int currentAutopilotStatus = -1;
|
||||
private List<BusStationBean> mStationList = new ArrayList<>();
|
||||
private int mCurrentStation = 0;
|
||||
private boolean isRestartAutopilot = false;
|
||||
|
||||
public BusPresenter(BusFragment view) {
|
||||
super(view);
|
||||
@@ -84,14 +86,6 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
BusOrderModel.getInstance().setControllerStatusCallback(null);
|
||||
}
|
||||
|
||||
// public void setIsAnimateRunning(boolean isAnimateRunning){
|
||||
// this.isAnimateRunning = isAnimateRunning;
|
||||
// }
|
||||
|
||||
// public boolean getIsAnimateRunning(){
|
||||
// return isAnimateRunning;
|
||||
// }
|
||||
|
||||
public void queryBusRoutes() {
|
||||
BusOrderModel.getInstance().queryBusRoutes();
|
||||
}
|
||||
@@ -103,12 +97,14 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
public void autoDriveToNextStation(boolean isRestart) {
|
||||
currentAutopilotStatus = -1;
|
||||
BusOrderModel.getInstance().autoDriveToNextStation(isRestart);
|
||||
isRestartAutopilot = false;
|
||||
}
|
||||
|
||||
public void restartAutopilot() {
|
||||
if (BusOrderModel.getInstance().isGoingToNextStation()){
|
||||
currentAutopilotStatus = -1;
|
||||
BusOrderModel.getInstance().restartAutopilot();
|
||||
isRestartAutopilot = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,14 +120,15 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshBusStations(List<BusStationBean> stationList, int currentStation, int nextStation, boolean isArrived) {
|
||||
public void refreshBusStations(String lineName,List<BusStationBean> stationList
|
||||
, int currentStation, int nextStation, boolean isArrived) {
|
||||
mStationList.clear();
|
||||
mStationList.addAll(stationList);
|
||||
mCurrentStation = currentStation;
|
||||
// functionDemoModeChange();
|
||||
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel =", " mCurrentStation =" + mCurrentStation);
|
||||
if (mView != null) {
|
||||
runOnUIThread(() -> mView.refreshBusStations(
|
||||
runOnUIThread(() -> mView.refreshBusStations(lineName,
|
||||
stationList, currentStation, nextStation, isArrived));
|
||||
}
|
||||
}
|
||||
@@ -203,7 +200,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
// 改变UI自动驾驶状态
|
||||
runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus));
|
||||
BusOrderModel.getInstance().triggerStartServiceEvent(
|
||||
BusOrderModel.getInstance().isGoingToNextStation(), true);
|
||||
isRestartAutopilot, true);
|
||||
}
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE:
|
||||
@@ -283,4 +280,9 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
@Override
|
||||
public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,27 +71,27 @@ public class BusTrajectoryManager {
|
||||
if ("ISYS_INIT_TRAJECTORY_START".equals(guardianInfo.getCode())) {
|
||||
// 1. 轨迹管理_轨迹开始下载(本地已有对应轨迹也触发)
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹开始下载");
|
||||
ToastUtils.showShort("轨迹开始下载");
|
||||
// ToastUtils.showShort("轨迹开始下载");
|
||||
stopTrajReqLoop();
|
||||
} else if ("ISYS_INIT_TRAJECTORY_SUCCESS".equals(guardianInfo.getCode())) {
|
||||
// 2. 轨迹管理_轨迹下载成功(本地已有对应轨迹也触发)
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹下载成功");
|
||||
ToastUtils.showShort("轨迹下载成功");
|
||||
// ToastUtils.showShort("轨迹下载成功");
|
||||
stopTrajReqLoop();
|
||||
} else if ("ISYS_INIT_TRAJECTORY_FAILURE".equals(guardianInfo.getCode())) {
|
||||
// 3. 轨迹管理_轨迹下载失败,本地无对应轨迹
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "onAutopilotGuardian() " +
|
||||
"轨迹下载失败,本地无对应轨迹");
|
||||
ToastUtils.showShort("轨迹下载失败,本地无对应轨迹");
|
||||
// ToastUtils.showShort("轨迹下载失败,本地无对应轨迹");
|
||||
} else if ("ISYS_INIT_TRAJECTORY_WARNING".equals(guardianInfo.getCode())) {
|
||||
// 4. 轨迹管理_轨迹下载失败,本地有对应轨迹,认为成功
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "onAutopilotGuardian() " +
|
||||
"轨迹下载失败,本地有对应轨迹,认为成功");
|
||||
ToastUtils.showShort("轨迹下载失败,本地有对应轨迹,认为成功");
|
||||
// ToastUtils.showShort("轨迹下载失败,本地有对应轨迹,认为成功");
|
||||
} else if ("ISYS_INIT_TRAJECTORY_TIMEOUT".equals(guardianInfo.getCode())) {
|
||||
// 5. 轨迹管理_轨迹下载超时
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹下载超时");
|
||||
ToastUtils.showShort("轨迹下载超时");
|
||||
// ToastUtils.showShort("轨迹下载超时");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/bus_line_panel_bg.png
Executable file
|
After Width: | Height: | Size: 53 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/bus_line_panel_bg_1.png
Executable file
|
After Width: | Height: | Size: 47 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/icon_ai_normal.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/icon_ai_select.png
Executable file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/icon_bad_case_normal.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/icon_bad_case_select.png
Executable file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/press_start_status.png
Executable file
|
After Width: | Height: | Size: 15 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/start_failure.png
Executable file
|
After Width: | Height: | Size: 18 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/start_success.png
Executable file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 10 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/bus_line_panel_bg.png
Executable file
|
After Width: | Height: | Size: 53 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/bus_line_panel_bg_1.png
Executable file
|
After Width: | Height: | Size: 47 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_ai_normal.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_ai_select.png
Executable file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_bad_case_normal.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/icon_bad_case_select.png
Executable file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/press_start_status.png
Executable file
|
After Width: | Height: | Size: 15 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/start_failure.png
Executable file
|
After Width: | Height: | Size: 18 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/start_success.png
Executable file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 10 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/bus_line_panel_bg.png
Executable file
|
After Width: | Height: | Size: 53 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/bus_line_panel_bg_1.png
Executable file
|
After Width: | Height: | Size: 47 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_ai_normal.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_ai_select.png
Executable file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_bad_case_normal.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/icon_bad_case_select.png
Executable file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/press_start_status.png
Executable file
|
After Width: | Height: | Size: 15 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/start_failure.png
Executable file
|
After Width: | Height: | Size: 18 KiB |
BIN
OCH/mogo-och-bus/src/main/res/drawable-xhdpi/start_success.png
Executable file
|
After Width: | Height: | Size: 21 KiB |
8
OCH/mogo-och-bus/src/main/res/drawable/ai_collect_selector.xml
Executable file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/icon_ai_select" android:state_focused="true" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/icon_ai_select" android:state_focused="false" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/icon_ai_select" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/icon_ai_select" android:state_focused="true" />
|
||||
<item android:drawable="@drawable/icon_ai_normal" />
|
||||
</selector>
|
||||
8
OCH/mogo-och-bus/src/main/res/drawable/bad_case_selector.xml
Executable file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/icon_bad_case_select" android:state_focused="true" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/icon_bad_case_select" android:state_focused="false" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/icon_bad_case_select" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/icon_bad_case_select" android:state_focused="true" />
|
||||
<item android:drawable="@drawable/icon_bad_case_normal" />
|
||||
</selector>
|
||||
@@ -1,46 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
|
||||
<gradient android:angle="315" android:endColor="#293159" android:startColor="#293159" />
|
||||
</shape>
|
||||
<item android:state_pressed="true" android:drawable="@drawable/press_start_status">
|
||||
</item>
|
||||
<!-- <item android:state_pressed="false">-->
|
||||
<!-- <shape android:shape="rectangle">-->
|
||||
<!-- <corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />-->
|
||||
<!-- <gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />-->
|
||||
<!-- </shape>-->
|
||||
<!-- </item>-->
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
|
||||
<gradient android:angle="315" android:endColor="#2B6EFF" android:startColor="#2B6EFF" />
|
||||
</shape>
|
||||
|
||||
<item android:state_selected="true" android:drawable="@drawable/start_success">
|
||||
</item>
|
||||
<item android:state_selected="false">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
|
||||
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
|
||||
</shape>
|
||||
<item android:state_selected="false" android:drawable="@drawable/start_failure">
|
||||
</item>
|
||||
<item android:state_focused="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
|
||||
<gradient android:angle="315" android:endColor="#293159" android:startColor="#293159" />
|
||||
</shape>
|
||||
<item android:state_focused="true" android:drawable="@drawable/press_start_status">
|
||||
</item>
|
||||
<item android:state_focused="false">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
|
||||
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
|
||||
</shape>
|
||||
<item android:state_focused="false" android:drawable="@drawable/start_failure">
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
|
||||
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
|
||||
</shape>
|
||||
<item android:drawable="@drawable/start_failure">
|
||||
</item>
|
||||
</selector>
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:angle="180" android:endColor="#000B4B" android:startColor="#001C83" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:angle="180" android:endColor="#0027FF" android:startColor="#4267FF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -3,10 +3,9 @@
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<corners android:bottomLeftRadius="27px"
|
||||
android:bottomRightRadius="27px"/>
|
||||
|
||||
<solid android:color="#2A67EF"></solid>
|
||||
<corners android:bottomLeftRadius="40px"
|
||||
android:bottomRightRadius="40px"/>
|
||||
<gradient android:angle="180" android:endColor="#004DFF" android:startColor="#20AAFF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -29,9 +29,7 @@
|
||||
android:id="@+id/module_mogo_och_autopilot_status"
|
||||
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_autopilot_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
|
||||
android:layout_marginTop="@dimen/bus_ext_arcView_top"
|
||||
android:background="@drawable/bus_autopilot_status_bg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:gravity="center"
|
||||
@@ -39,33 +37,30 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_autopilot_btn_iv"
|
||||
android:layout_width="56px"
|
||||
android:layout_height="56px"
|
||||
android:layout_width="73px"
|
||||
android:layout_height="73px"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/bus_ic_autopilot" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_autopolot_btn_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="自动驾驶"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="28px"
|
||||
android:layout_toRightOf="@+id/bus_autopilot_btn_iv"
|
||||
android:text="自动驾驶"
|
||||
android:textColor="@color/bus_autopilot_text_color_normal"
|
||||
android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"
|
||||
android:layout_centerVertical="true"
|
||||
android:textStyle="bold"/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_station_panel_container"
|
||||
android:layout_width="@dimen/module_mogo_och_autopilot_order_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_autopilot_order_bg_height"
|
||||
android:layout_marginTop="@dimen/module_mogo_och_autopilot_order_m_t"
|
||||
android:background="@drawable/bus_panel_bkg"
|
||||
android:elevation="@dimen/bus_dp_10"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_mogo_och_autopilot_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
|
||||
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call"
|
||||
tools:visibility="visible" />
|
||||
@@ -127,20 +122,10 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/bus_switch_model_layout">
|
||||
<ImageView
|
||||
android:id="@+id/module_och_bus_upgrade_red_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_gravity="right"
|
||||
android:visibility="gone"
|
||||
android:elevation="8px"
|
||||
android:background="@drawable/bus_setting_tip_red_cir_bg" />
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/bus_setting_btn_bg" />
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -150,11 +135,20 @@
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:src="@drawable/bus_badcase_btn_bg"
|
||||
android:src="@drawable/bad_case_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout"/>
|
||||
<ImageView
|
||||
android:id="@+id/module_mogo_och_ai_collet_iv"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:src="@drawable/ai_collect_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_iv"/>
|
||||
|
||||
<com.mogo.och.bus.view.SlidePanelView
|
||||
android:id="@+id/module_mogo_och_slide_panel"
|
||||
@@ -232,13 +226,4 @@
|
||||
,btnAutopilotRunning,btnAutopilotRoute"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!-- <com.mogo.och.bus.ui.BusTrafficLightView-->
|
||||
<!-- android:id="@+id/bus_traffic_light_view"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- android:layout_marginRight="@dimen/bus_traffic_light_layout_margin_right"-->
|
||||
<!-- android:layout_marginTop="@dimen/bus_traffic_light_layout_margin_top"-->
|
||||
<!-- android:visibility="gone"/>-->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -2,188 +2,171 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/module_och_bus_order_status_stationInfo"
|
||||
android:layout_width="@dimen/module_mogo_och_autopilot_order_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_autopilot_order_bg_height"
|
||||
android:background="@drawable/bus_panel_bkg">
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bus_line_panel_bg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/module_och_bus_arrive_to_end_title"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_32"-->
|
||||
<!-- android:layout_marginLeft="@dimen/dp_27"-->
|
||||
<!-- android:text="@string/bus_arrive_to_end_title"-->
|
||||
<!-- android:textColor="#FFF"-->
|
||||
<!-- android:textSize="@dimen/dp_27"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- android:textStyle="bold" />-->
|
||||
|
||||
<!-- <View-->
|
||||
<!-- android:id="@+id/module_och_bus_arrive_to_end_deviler_line"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="@dimen/dp_1"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_23"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_arrive_to_end_title"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/module_och_bus_arrive_to_end_title"-->
|
||||
<!-- android:background="#707DBE">-->
|
||||
|
||||
<!-- </View>-->
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_line_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_68"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_64"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="--"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="38px"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintRight_toLeftOf="@+id/module_och_bus_tag"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/dp_109"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginTop="@dimen/module_mogo_och_autopilot_order_tag_m_t"
|
||||
android:layout_marginRight="@dimen/module_mogo_och_autopilot_order_tag_m_r"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginRight="@dimen/dp_60"
|
||||
android:background="@drawable/bus_panel_anchor_bkg"
|
||||
android:paddingLeft="@dimen/module_mogo_och_autopilot_order_tag_p_r"
|
||||
android:paddingTop="2px"
|
||||
android:paddingRight="@dimen/module_mogo_och_autopilot_order_tag_p_r"
|
||||
android:paddingBottom="2px"
|
||||
android:gravity="center"
|
||||
android:text="小巴车"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/module_mogo_och_autopilot_order_tag_height"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"/>
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_bus_line_name"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/module_och_bus_line_name" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/module_och_bus_order_status_stationInfo"
|
||||
<View
|
||||
android:id="@+id/line1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_marginRight="@dimen/dp_30"
|
||||
android:background="@drawable/bus_line_dividing_line1_selector"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_tag" />
|
||||
|
||||
<View
|
||||
android:id="@+id/line2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_4"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_marginRight="@dimen/dp_30"
|
||||
android:background="@drawable/bus_line_dividing_line2_selector"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/line1"
|
||||
app:layout_constraintRight_toRightOf="@+id/line1"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_current_station_anchor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/module_och_bus_order_status_stationInfo_paddingLeft"
|
||||
android:paddingTop="8px"
|
||||
android:paddingRight="@dimen/module_och_bus_order_status_stationInfo_paddingRight"
|
||||
android:paddingBottom="@dimen/module_och_bus_order_status_stationInfo_paddingBottom"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_tag"
|
||||
app:layout_constraintLeft_toLeftOf="parent">
|
||||
android:layout_marginLeft="14px"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:text="当前站点:"
|
||||
android:textColor="#CAD6FF"
|
||||
android:textSize="@dimen/module_och_bus_order_start_station_anchor_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@+id/greenDot"
|
||||
app:layout_constraintTop_toBottomOf="@+id/line2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_current_station_anchor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="14px"
|
||||
android:text="当前站点:"
|
||||
android:textColor="#8E9DD4"
|
||||
android:textSize="@dimen/module_och_bus_order_start_station_anchor_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@+id/greenDot"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_current_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6px"
|
||||
android:layout_marginRight="@dimen/dp_60"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="--"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/module_mogo_och_bus_station_name_text_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_current_station_anchor"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_current_station_anchor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_current_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6px"
|
||||
android:text="--"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/module_mogo_och_bus_station_name_text_size"
|
||||
android:textStyle="bold"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
app:layout_constraintRight_toLeftOf="@+id/module_och_bus_start_station_tag"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_current_station_anchor"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_current_station_anchor"
|
||||
tools:text="后路站" />
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_next_station_anchor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_och_bus_order_distance_anchor_marginTop"
|
||||
android:text="下一站:"
|
||||
android:textColor="#CAD6FF"
|
||||
android:textSize="@dimen/module_och_bus_order_start_station_anchor_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_current_station"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_current_station" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_start_station_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="始"
|
||||
android:textColor="#8E9DD4"
|
||||
android:textSize="@dimen/module_mogo_och_bus_station_notice_text_size"
|
||||
android:textStyle="bold"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_bus_current_station"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_och_bus_current_station"
|
||||
tools:visibility="visible" />
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_order_end_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/dp_60"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="--"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/module_mogo_och_bus_station_name_text_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_next_station_anchor"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_next_station_anchor"
|
||||
tools:text="后路站1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_next_station_anchor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_och_bus_order_distance_anchor_marginTop"
|
||||
android:text="下一站:"
|
||||
android:textColor="#8E9DD4"
|
||||
android:textSize="@dimen/module_och_bus_order_start_station_anchor_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_current_station"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_current_station" />
|
||||
<ImageView
|
||||
android:id="@+id/greenDot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14px"
|
||||
android:src="@drawable/bus_icon_arrived_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_bus_current_station"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_line_name"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_och_bus_current_station" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_order_end_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="@dimen/module_mogo_och_bus_station_name_text_size"
|
||||
android:textStyle="bold"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
app:layout_constraintRight_toLeftOf="@+id/module_och_bus_end_station_tag"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_next_station_anchor"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_next_station_anchor"
|
||||
tools:text="后路站1" />
|
||||
<ImageView
|
||||
android:id="@+id/dotLine"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/bus_dot_line"
|
||||
app:layout_constraintBottom_toTopOf="@+id/blueDot"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/greenDot"
|
||||
app:layout_constraintRight_toRightOf="@+id/greenDot"
|
||||
app:layout_constraintTop_toBottomOf="@+id/greenDot" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_bus_end_station_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="终"
|
||||
android:textColor="#8E9DD4"
|
||||
android:textSize="@dimen/module_mogo_och_bus_station_notice_text_size"
|
||||
android:textStyle="bold"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_bus_order_end_station"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_och_bus_order_end_station"
|
||||
tools:visibility="visible" />
|
||||
<ImageView
|
||||
android:id="@+id/blueDot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/bus_icon_arriving_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_bus_order_end_station"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/greenDot"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_och_bus_order_end_station" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/greenDot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14px"
|
||||
android:src="@drawable/bus_icon_arrived_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_bus_current_station"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_och_bus_current_station" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dotLine"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/bus_dot_line"
|
||||
app:layout_constraintBottom_toTopOf="@+id/blueDot"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/greenDot"
|
||||
app:layout_constraintRight_toRightOf="@+id/greenDot"
|
||||
app:layout_constraintTop_toBottomOf="@+id/greenDot" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/blueDot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/bus_icon_arriving_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_och_bus_order_end_station"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/greenDot"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_och_bus_order_end_station" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<TextView
|
||||
android:id="@+id/switch_line_btn"
|
||||
android:layout_width="@dimen/module_mogo_och_autopilot_order_bg_width"
|
||||
android:layout_height="@dimen/bus_switch_line_btn"
|
||||
android:text="@string/bus_switch_line_btn"
|
||||
android:layout_width="@dimen/bus_switch_line_btn_width_1"
|
||||
android:layout_height="@dimen/bus_switch_line_btn_height_1"
|
||||
android:layout_marginLeft="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:background="@drawable/bus_switch_line_btn"
|
||||
android:gravity="center"
|
||||
android:text="@string/bus_switch_line_btn"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/module_mogo_och_bus_station_notice_text_size"
|
||||
android:background="@drawable/bus_switch_line_btn"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_order_end_station"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
<dimen name="module_mogo_och_bus_current_station_name_text_size">32px</dimen>
|
||||
<dimen name="module_mogo_och_bus_current_station_notice_text_size">20px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_name_text_size">42px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_notice_text_size">32px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_name_text_size">40px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_notice_text_size">42px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_bus_station_name_margin_left">15px</dimen>
|
||||
|
||||
@@ -44,20 +44,20 @@
|
||||
<dimen name="module_och_bus_order_status_stationInfo_paddingRight">30px</dimen>
|
||||
<dimen name="module_och_bus_order_status_stationInfo_paddingBottom">23px</dimen>
|
||||
<dimen name="module_och_bus_order_start_station_textSize">26px</dimen>
|
||||
<dimen name="module_och_bus_order_start_station_anchor_textSize">32px</dimen>
|
||||
<dimen name="module_och_bus_order_start_station_anchor_textSize">34px</dimen>
|
||||
<dimen name="module_och_bus_order_end_station_anchor_textSize">20px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_container_height">80px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_container_marginLeft">3px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_anchor_marginTop">44.5px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_anchor_marginTop">34px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_anchor_textSize">20px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_textSize">28px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_marginRight">27px</dimen>
|
||||
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_height">25.6px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_height">28px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_m_t">20px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_m_r">20px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_p_r">16px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_p_r">64px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_p_l">16px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_margin_left">40px</dimen>
|
||||
@@ -77,8 +77,8 @@
|
||||
<dimen name="module_mogo_och_slide_panel_textSize">70px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_corner">24px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_width">460px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_height">140px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_width">616px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_height">180px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_operation_status_bg_width">112px</dimen>
|
||||
<dimen name="module_mogo_och_operation_status_bg_height">112px</dimen>
|
||||
@@ -86,11 +86,11 @@
|
||||
<dimen name="module_mogo_och_operation_status_padding">92px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_order_m_t">30px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_width">466px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_height">446px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_width">616px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_height">754px</dimen>
|
||||
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_status_text_size">36px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_size">40px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_padding_top">13px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_drawable_padding">12px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_m_l">350px</dimen>
|
||||
@@ -120,7 +120,8 @@
|
||||
<dimen name="bus_switch_line_title">46px</dimen>
|
||||
<dimen name="bus_switch_line_btn_width">700px</dimen>
|
||||
<dimen name="bus_switch_line_btn_height">120px</dimen>
|
||||
<dimen name="bus_switch_line_btn">86px</dimen>
|
||||
<dimen name="bus_switch_line_btn_width_1">560px</dimen>
|
||||
<dimen name="bus_switch_line_btn_height_1">116px</dimen>
|
||||
|
||||
<dimen name="bus_switch_line_btn_margin_b">20px</dimen>
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
<dimen name="module_mogo_och_bus_current_station_name_text_size">32px</dimen>
|
||||
<dimen name="module_mogo_och_bus_current_station_notice_text_size">20px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_name_text_size">42px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_notice_text_size">32px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_name_text_size">40px</dimen>
|
||||
<dimen name="module_mogo_och_bus_station_notice_text_size">42px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_bus_station_name_margin_left">15px</dimen>
|
||||
|
||||
@@ -44,11 +44,11 @@
|
||||
<dimen name="module_och_bus_order_status_stationInfo_paddingRight">30px</dimen>
|
||||
<dimen name="module_och_bus_order_status_stationInfo_paddingBottom">23px</dimen>
|
||||
<dimen name="module_och_bus_order_start_station_textSize">26px</dimen>
|
||||
<dimen name="module_och_bus_order_start_station_anchor_textSize">32px</dimen>
|
||||
<dimen name="module_och_bus_order_start_station_anchor_textSize">34px</dimen>
|
||||
<dimen name="module_och_bus_order_end_station_anchor_textSize">20px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_container_height">80px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_container_marginLeft">3px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_anchor_marginTop">44.5px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_anchor_marginTop">34px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_anchor_textSize">20px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_textSize">28px</dimen>
|
||||
<dimen name="module_och_bus_order_distance_marginRight">27px</dimen>
|
||||
@@ -57,7 +57,7 @@
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_height">25.6px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_m_t">20px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_m_r">20px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_p_r">16px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_p_r">64px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_tag_p_l">16px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_margin_left">40px</dimen>
|
||||
@@ -77,8 +77,8 @@
|
||||
<dimen name="module_mogo_och_slide_panel_textSize">70px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_corner">24px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_width">460px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_height">140px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_width">616px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_height">180px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_operation_status_bg_width">112px</dimen>
|
||||
<dimen name="module_mogo_och_operation_status_bg_height">112px</dimen>
|
||||
@@ -86,11 +86,11 @@
|
||||
<dimen name="module_mogo_och_operation_status_padding">92px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_order_m_t">30px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_width">466px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_height">446px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_width">616px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_height">754px</dimen>
|
||||
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_status_text_size">36px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_size">40px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_padding_top">13px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_drawable_padding">12px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_m_l">350px</dimen>
|
||||
@@ -119,7 +119,8 @@
|
||||
<dimen name="bus_switch_line_title">46px</dimen>
|
||||
<dimen name="bus_switch_line_btn_width">700px</dimen>
|
||||
<dimen name="bus_switch_line_btn_height">120px</dimen>
|
||||
<dimen name="bus_switch_line_btn">86px</dimen>
|
||||
<dimen name="bus_switch_line_btn_width_1">560px</dimen>
|
||||
<dimen name="bus_switch_line_btn_height_1">116px</dimen>
|
||||
<dimen name="bus_switch_line_btn_margin_b">50px</dimen>
|
||||
|
||||
<dimen name="bus_traffic_light_layout_width">225px</dimen>
|
||||
|
||||
@@ -135,7 +135,8 @@
|
||||
<dimen name="bus_switch_line_title">30px</dimen>
|
||||
<dimen name="bus_switch_line_btn_width">450px</dimen>
|
||||
<dimen name="bus_switch_line_btn_height">72px</dimen>
|
||||
<dimen name="bus_switch_line_btn">52px</dimen>
|
||||
<dimen name="bus_switch_line_btn_width_1">280px</dimen>
|
||||
<dimen name="bus_switch_line_btn_height_1">58px</dimen>
|
||||
<dimen name="bus_switch_line_btn_margin_b">20px</dimen>
|
||||
|
||||
<dimen name="bus_traffic_light_layout_width">225px</dimen>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
<string name="bus_change_line_commit_tip_s">更换路线成功</string>
|
||||
<string name="bus_change_line_commit_tip_f">更换路线失败</string>
|
||||
<!-- <string name="bus_arrive_to_end_title">去往下车地点</string>-->
|
||||
<string name="bus_arrive_to_end_start">始</string>
|
||||
<!-- <string name="bus_arrive_to_end_start1">上车</string>-->
|
||||
<string name="bus_arrive_to_end_end">终</string>
|
||||
<!-- <string name="bus_arrive_to_end_end1">下车</string>-->
|
||||
<string name="bus_arrive_to_end_start">起点:</string>
|
||||
<string name="bus_arrive_to_end_end">终点:</string>
|
||||
<string name="bus_arrive_to_current_tag">当前站点:</string>
|
||||
<string name="bus_arrive_to_next_tag">下一站:</string>
|
||||
<string name="bus_auto_disable_tip">自动驾驶状态为0不可用</string>
|
||||
</resources>
|
||||
|
||||
@@ -73,6 +73,7 @@ import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
|
||||
|
||||
@@ -510,6 +511,10 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
if (mCurrentOCHOrder != null
|
||||
&& getCurOrderStatus() == TaxiPassengerOrderStatusEnum.UserArriveAtStart
|
||||
&& state != mPrevAPStatus) {
|
||||
|
||||
TaxiPassengerAnalyticsManager.getInstance().triggerStartAutopilotEvent(false, true,
|
||||
mCurrentOCHOrder.startSiteAddr, mCurrentOCHOrder.endSiteAddr, mCurrentOCHOrder.orderNo);
|
||||
|
||||
// 当高频返回autopilot 2时,不重复调用订单状态变更
|
||||
mPrevAPStatus = state; // 每个状态单独赋值,解决无订单时已经是2的状态导致的新订单来时无法进入此逻辑更新状态
|
||||
startServicePilotDone();
|
||||
@@ -566,6 +571,10 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener(){
|
||||
|
||||
@@ -12,6 +12,8 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy;
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewNotification;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
|
||||
@@ -41,7 +43,7 @@ import java.lang.ref.WeakReference;
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFragment, BaseTaxiPassengerPresenter>
|
||||
implements IMogoMapListener, TaxiPassengerTaxiView, ITPClickStartAutopilotCallback {
|
||||
implements IMogoMapListener, TaxiPassengerTaxiView, ITPClickStartAutopilotCallback, IMoGoHmiViewProxy.IViewNotificationProvider {
|
||||
|
||||
static final String TAG = "TaxiPassengerBaseFragment";
|
||||
|
||||
@@ -49,7 +51,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
private ImageView mAutopilotImage;
|
||||
private ImageView mMapswitchBtn;
|
||||
private TaxiPassengerTrafficLightView mTrafficLightView;
|
||||
private TaxiPassengerV2XNotificationView mV2XNotificationView;
|
||||
|
||||
private WeakReference<TaxiPassengerArrivedView> mArrivedEndView;
|
||||
private WeakReference<TaxiPassengerCheckView> mArrivedCheckView;
|
||||
@@ -82,8 +83,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
mTrafficLightView = findViewById(R.id.traffic_light_view);
|
||||
CallerHmiManager.INSTANCE.setProxyTrafficLightView(mTrafficLightView);
|
||||
|
||||
mV2XNotificationView = new TaxiPassengerV2XNotificationView(getContext());
|
||||
CallerHmiManager.INSTANCE.setProxyNotificationView(mV2XNotificationView);
|
||||
CallerHmiManager.INSTANCE.setNotificationViewProvider(this);
|
||||
|
||||
mMapswitchBtn = findViewById(R.id.module_och_taxi_swich_map_iv);
|
||||
vOpenLeft = findViewById(R.id.v_open_left);
|
||||
@@ -101,6 +101,12 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
EmptyService.Companion.startService(getContext());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public IViewNotification getNotificationView() {
|
||||
return new TaxiPassengerV2XNotificationView(getContext());
|
||||
}
|
||||
|
||||
private void updateSwitchMapIcon(){
|
||||
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
|
||||
mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_long);
|
||||
@@ -301,6 +307,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
|
||||
}
|
||||
mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(null);
|
||||
mStartAutopilotView.get().closeAllAnimsAndView();
|
||||
mStartAutopilotView = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
private ITPClickStartAutopilotCallback mClickCallback;
|
||||
public boolean isStarting = false;
|
||||
private AnimationDrawable mAnimationBtnDrawable;
|
||||
private static final long TIMER_START_AUTOPILOT_INTERVAL = 10 * 1000L;
|
||||
private static final long TIMER_START_AUTOPILOT_INTERVAL = 20 * 1000L;
|
||||
private Context mContext;
|
||||
private View view;
|
||||
private FrameSurfaceView svCarStartingFrame;
|
||||
@@ -106,7 +106,7 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
mClickCallback.onClickCallback();
|
||||
}
|
||||
}else if (v.getId() == R.id.starting_autopilot_view_close){
|
||||
OverlayViewUtils.dismissOverlayView(this);
|
||||
closeAllAnimsAndView();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P+TAG,"mAnimationBtnDrawable.isRunning() = true");
|
||||
return;
|
||||
}
|
||||
mAnimationBtnDrawable.selectDrawable(0);
|
||||
mAnimationBtnDrawable.selectDrawable(-1);
|
||||
mAnimationBtnDrawable.start();
|
||||
}else {
|
||||
clearBgAnimDrawable();
|
||||
@@ -201,12 +201,11 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
}
|
||||
|
||||
public void closeAllAnimsAndView(){
|
||||
clearStartingAnimFrame();
|
||||
if (mAnimationBtnDrawable != null) {
|
||||
mAnimationBtnDrawable.stop();
|
||||
}
|
||||
isStarting = false;
|
||||
clearStartingAnimFrame();
|
||||
clearBgAnimDrawable();
|
||||
OverlayViewUtils.dismissOverlayView(this);
|
||||
mContext = null;
|
||||
}
|
||||
|
||||
public void clearStartingAnimFrame(){
|
||||
@@ -222,7 +221,7 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
private void startingAutopilotCountDown() {
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() { //未启动成功10s后做处理
|
||||
public void run() { //未启动成功20s后做处理
|
||||
if (isStarting){ //判断动画是否在进行
|
||||
ToastUtils.showLong(R.string.taxi_p_start_autopilot_fail_10s_tip);
|
||||
// startOrStopLoadingAnim(false);
|
||||
@@ -239,4 +238,13 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
mStartAutopilotBtn.setText(
|
||||
mContext.getResources().getString(R.string.taxi_p_start_autopilot_txt));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
isStarting = false;
|
||||
clearStartingAnimFrame();
|
||||
clearBgAnimDrawable();
|
||||
mContext = null;
|
||||
super.onDetachedFromWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,10 +50,13 @@ public class TaxiPassengerV2XNotificationView extends IViewNotification {
|
||||
setSidePattern(SidePattern.LEFT);
|
||||
setLayoutGravity(Gravity.LEFT);
|
||||
// 设置View的停留位置:相对屏幕左上角的位置
|
||||
setOffsetX(getResources().
|
||||
getDimensionPixelSize(R.dimen.taxi_p_v2x_notification_view_margin_left));
|
||||
setOffsetY(getResources().
|
||||
getDimensionPixelSize(R.dimen.taxi_p_v2x_notification_view_margin_top));
|
||||
// setOffsetX(getResources().
|
||||
// getDimensionPixelSize(R.dimen.taxi_p_v2x_notification_view_margin_left));
|
||||
// setOffsetY(getResources().
|
||||
// getDimensionPixelSize(R.dimen.taxi_p_v2x_notification_view_margin_top));
|
||||
setPadding(getResources().
|
||||
getDimensionPixelSize(R.dimen.taxi_p_v2x_notification_view_margin_left), getResources().
|
||||
getDimensionPixelSize(R.dimen.taxi_p_v2x_notification_view_margin_top), 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -63,13 +63,13 @@ public class TaxiPassengerAnalyticsManager {
|
||||
mStartAutopilotParams.put(TaxiPassengerConst.EVENT_PARAM_ORDER_NUMBER, orderNo);
|
||||
|
||||
if (send) {
|
||||
// 开启成功,上报埋点
|
||||
// 开启成功,取消失败定时任务
|
||||
if (startAutopilotRunnable != null &&
|
||||
UiThreadHandler.getsUiHandler().hasCallbacks(startAutopilotRunnable)) {
|
||||
UiThreadHandler.removeCallbacks(startAutopilotRunnable);
|
||||
}
|
||||
mStartAutopilotParams.put(TaxiPassengerConst.EVENT_PARAM_START_RESULT, true);
|
||||
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
// AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
|
||||
} else {
|
||||
UiThreadHandler.postDelayed(startAutopilotRunnable, TaxiPassengerConst.LOOP_PERIOD_15S);
|
||||
}
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
|
||||
<string name="taxi_p_check_hello_small_text">欢迎体验MOGO自动驾驶出租车</string>
|
||||
<string name="taxi_p_check_hello_text">Hello,您好</string>
|
||||
<string name="taxi_p_check_input_phone_tail_title">请输出手机号后4位:</string>
|
||||
<string name="taxi_p_check_input_phone_tail_title">请输入手机号后4位:</string>
|
||||
<string name="taxi_p_check_small_mogo">小蘑菇</string>
|
||||
<string name="tv_delete">删除</string>
|
||||
|
||||
<string name="taxi_p_start_autopilot_txt">点击开始</string>
|
||||
|
||||
<string name="taxi_p_start_autopilot_txt">点击开启</string>
|
||||
<string name="taxi_p_start_autopilot_loading">启动中...</string>
|
||||
<string name="taxi_p_start_autopilot_fail_10s_tip">自动驾驶启动失败,请与司机确认车辆状态</string>
|
||||
<string name="taxi_p_start_autopilot_un_click_tip">车辆尚未完成准备,不能启动自动驾驶</string>
|
||||
|
||||
@@ -79,6 +79,6 @@ class TaxiConst {
|
||||
*/
|
||||
const val TYPE_MARKER_TAXI_ORDER = "TYPE_MARKER_TAXI_ORDER"
|
||||
|
||||
const val TIMER_START_AUTOPILOT_INTERVAL = 10 * 1000L
|
||||
const val TIMER_START_AUTOPILOT_INTERVAL = 20 * 1000L
|
||||
}
|
||||
}
|
||||
@@ -82,6 +82,7 @@ import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
@@ -829,6 +830,7 @@ public class TaxiModel {
|
||||
&& mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToEnd.getCode()) {
|
||||
// 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
|
||||
CallerAutoPilotManager.INSTANCE.setDemoMode(true);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为true(更新本地order信息)");
|
||||
}
|
||||
}
|
||||
@@ -841,6 +843,7 @@ public class TaxiModel {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 取消或订单已完成时,置false
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
CallerAutoPilotManager.INSTANCE.setDemoMode(false);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为false(已完成or清除当前订单)");
|
||||
}
|
||||
}
|
||||
@@ -1090,6 +1093,7 @@ public class TaxiModel {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
|
||||
CallerAutoPilotManager.INSTANCE.setDemoMode(true);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为true(到达出发点且已开启自动驾驶)");
|
||||
}
|
||||
} else if (mCurrentOCHOrder != null
|
||||
@@ -1141,9 +1145,14 @@ public class TaxiModel {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 到达目的地,置false
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
CallerAutoPilotManager.INSTANCE.setDemoMode(false);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为false(到达目的地)");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
|
||||
}
|
||||
};
|
||||
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener() {
|
||||
|
||||
|
||||
@@ -211,6 +211,7 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
|
||||
if (TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus){
|
||||
TaxiModel.getInstance().startDynamicCalculateRouteInfo();
|
||||
runOnUIThread(() -> mView.updateCtvAutopilotStatusTag(true));
|
||||
}
|
||||
|
||||
if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus ||
|
||||
|
||||
@@ -15,6 +15,7 @@ import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
@@ -44,6 +45,7 @@ import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
|
||||
@@ -73,6 +75,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
protected LinearLayout mPersonalBtn;
|
||||
protected RelativeLayout mSettingBtn;
|
||||
protected ImageView mBadcaseBtn;
|
||||
protected ImageView mAICollectBtn;
|
||||
protected ImageView mUpgradeTipIv;
|
||||
protected TaxiNaviFragment ochNaviFragment = null;
|
||||
// protected TaxiTrafficLightView mTrafficLightView;
|
||||
@@ -91,7 +94,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
groupTestPanel = findViewById(R.id.groupTestPanel);
|
||||
ctvAutopilotStatus = findViewById(R.id.module_mogo_och_autopilot_status);
|
||||
ctvAutopilotStatus.setBackground(getResources().getDrawable(R.drawable.taxi_autopilot_bg_selector));
|
||||
ctvAutopilotStatus.setTag(false);
|
||||
updateCtvAutopilotStatusTag(false);
|
||||
mAutopilotImage = findViewById(R.id.module_och_autopilot_iv);
|
||||
mAutopilotTv = findViewById(R.id.module_och_autopilot_tv);
|
||||
flStationPanelContainer = findViewById(R.id.module_mogo_och_station_panel_container);
|
||||
@@ -156,15 +159,16 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
// mBadcaseBtn的visible显示逻辑在showBadcaseEntrance内处理
|
||||
mBadcaseBtn = findViewById(R.id.module_och_taxi_badcase_iv);
|
||||
if (mBadcaseBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn, null, null);
|
||||
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn);
|
||||
if (!HmiBuildConfig.isShowBadCaseView) {
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
}
|
||||
|
||||
//设置升级小红点提示 默认隐藏
|
||||
mUpgradeTipIv = findViewById(R.id.module_och_taxi_upgrade_red_tip);
|
||||
CallerHmiManager.INSTANCE.registerUpgradeTipsCallback(() -> mUpgradeTipIv);
|
||||
mAICollectBtn = findViewById(R.id.module_och_taxi_ai_collect_iv);
|
||||
if (mAICollectBtn != null){
|
||||
CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn);
|
||||
}
|
||||
|
||||
panelView = LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
|
||||
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
|
||||
@@ -255,6 +259,10 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) {
|
||||
}
|
||||
|
||||
public void showNotice(String notice) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(notice);
|
||||
@@ -296,8 +304,12 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
});
|
||||
}
|
||||
|
||||
public void updateCtvAutopilotStatusTag(boolean tag){
|
||||
ctvAutopilotStatus.setTag(tag);
|
||||
}
|
||||
|
||||
public void onCheckPilotConditionSafe(boolean isSafe){
|
||||
ctvAutopilotStatus.setTag(isSafe);
|
||||
updateCtvAutopilotStatusTag(isSafe);
|
||||
if (isSafe){
|
||||
ToastUtils.showLong(getResources().getString(
|
||||
R.string.module_och_taxi_order_choose_start_autopilot_tip));
|
||||
|
||||
@@ -75,27 +75,27 @@ public class TaxiTrajectoryManager {
|
||||
if ("ISYS_INIT_TRAJECTORY_START".equals(guardianInfo.getCode())) {
|
||||
// 1. 轨迹管理_轨迹开始下载(本地已有对应轨迹也触发)
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "onAutopilotGuardian() 轨迹开始下载");
|
||||
ToastUtils.showShort("轨迹开始下载");
|
||||
// ToastUtils.showShort("轨迹开始下载");
|
||||
stopTrajReqLoop();
|
||||
} else if ("ISYS_INIT_TRAJECTORY_SUCCESS".equals(guardianInfo.getCode())) {
|
||||
// 2. 轨迹管理_轨迹下载成功(本地已有对应轨迹也触发)
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "onAutopilotGuardian() 轨迹下载成功");
|
||||
ToastUtils.showShort("轨迹下载成功");
|
||||
// ToastUtils.showShort("轨迹下载成功");
|
||||
stopTrajReqLoop();
|
||||
} else if ("ISYS_INIT_TRAJECTORY_FAILURE".equals(guardianInfo.getCode())) {
|
||||
// 3. 轨迹管理_轨迹下载失败,本地无对应轨迹
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "onAutopilotGuardian() " +
|
||||
"轨迹下载失败,本地无对应轨迹");
|
||||
ToastUtils.showShort("轨迹下载失败,本地无对应轨迹");
|
||||
// ToastUtils.showShort("轨迹下载失败,本地无对应轨迹");
|
||||
} else if ("ISYS_INIT_TRAJECTORY_WARNING".equals(guardianInfo.getCode())) {
|
||||
// 4. 轨迹管理_轨迹下载失败,本地有对应轨迹,认为成功
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "onAutopilotGuardian() " +
|
||||
"轨迹下载失败,本地有对应轨迹,认为成功");
|
||||
ToastUtils.showShort("轨迹下载失败,本地有对应轨迹,认为成功");
|
||||
// ToastUtils.showShort("轨迹下载失败,本地有对应轨迹,认为成功");
|
||||
} else if ("ISYS_INIT_TRAJECTORY_TIMEOUT".equals(guardianInfo.getCode())) {
|
||||
// 5. 轨迹管理_轨迹下载超时
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "onAutopilotGuardian() 轨迹下载超时");
|
||||
ToastUtils.showShort("轨迹下载超时");
|
||||
// ToastUtils.showShort("轨迹下载超时");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/icon_ai_normal.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/icon_ai_select.png
Executable file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/icon_bad_case_normal.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1440/icon_bad_case_select.png
Executable file
|
After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 10 KiB |
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/icon_ai_normal.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/icon_ai_select.png
Executable file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/icon_bad_case_normal.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi-2560x1600/icon_bad_case_select.png
Executable file
|
After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 10 KiB |
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/icon_ai_normal.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/icon_ai_select.png
Executable file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/icon_bad_case_normal.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
OCH/mogo-och-taxi/src/main/res/drawable-xhdpi/icon_bad_case_select.png
Executable file
|
After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 10 KiB |
8
OCH/mogo-och-taxi/src/main/res/drawable/ai_collect_selector.xml
Executable file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/icon_ai_select" android:state_focused="true" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/icon_ai_select" android:state_focused="false" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/icon_ai_select" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/icon_ai_select" android:state_focused="true" />
|
||||
<item android:drawable="@drawable/icon_ai_normal" />
|
||||
</selector>
|
||||
8
OCH/mogo-och-taxi/src/main/res/drawable/bad_case_selector.xml
Executable file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/icon_bad_case_select" android:state_focused="true" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/icon_bad_case_select" android:state_focused="false" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/icon_bad_case_select" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/icon_bad_case_select" android:state_focused="true" />
|
||||
<item android:drawable="@drawable/icon_bad_case_normal" />
|
||||
</selector>
|
||||
@@ -145,17 +145,6 @@
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_och_taxi_personal_layout">
|
||||
<ImageView
|
||||
android:id="@+id/module_och_taxi_upgrade_red_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_gravity="right"
|
||||
android:visibility="gone"
|
||||
android:elevation="8px"
|
||||
android:background="@drawable/taxi_setting_tip_red_cir_bg" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -189,11 +178,20 @@
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="40px"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:src="@drawable/taxi_badcase_btn_bg"
|
||||
android:src="@drawable/bad_case_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_och_taxi_swich_map_layout"/>
|
||||
<ImageView
|
||||
android:id="@+id/module_och_taxi_ai_collect_iv"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="40px"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:src="@drawable/ai_collect_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_och_taxi_badcase_iv"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotDisable"
|
||||
@@ -251,13 +249,4 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:src="@drawable/taxi_close_navi_icon"/>
|
||||
|
||||
<!-- <com.mogo.och.taxi.ui.TaxiTrafficLightView-->
|
||||
<!-- android:id="@+id/taxi_traffic_light_view"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- android:layout_marginRight="@dimen/taxi_traffic_light_layout_margin_right"-->
|
||||
<!-- android:layout_marginTop="@dimen/taxi_traffic_light_layout_margin_top"-->
|
||||
<!-- android:visibility="gone"/>-->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -23,7 +23,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="56px"
|
||||
android:layout_marginLeft="40px"
|
||||
android:layout_marginTop="52px"
|
||||
android:layout_marginTop="42px"
|
||||
android:gravity="center_vertical"
|
||||
android:text="前往乘客上车点"
|
||||
android:textColor="@color/taxi_order_status_textColor"
|
||||
@@ -56,7 +56,7 @@
|
||||
android:id="@+id/module_och_taxi_order_station_title_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="200px"
|
||||
android:layout_marginTop="210px"
|
||||
android:textColor="#CAD6FF"
|
||||
android:textSize="17sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
@@ -82,7 +82,7 @@
|
||||
android:id="@+id/module_och_taxi_order_distance_anchor_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="278px"
|
||||
android:layout_marginBottom="264px"
|
||||
android:inputType="textMultiLine"
|
||||
android:lineSpacingExtra="16px"
|
||||
android:text="距离 - - 公里,用时 - - 分"
|
||||
@@ -108,7 +108,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="130px">
|
||||
android:layout_marginTop="@dimen/dp_110">
|
||||
<TextView
|
||||
android:id="@+id/taxi_passenger_num"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -134,7 +134,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/taxi_passenger_phone"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/taxi_passenger_num"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:background="@color/taxi_passenger_line_color"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -171,8 +171,8 @@
|
||||
android:id="@+id/module_och_taxi_order_start_station_31"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8px"
|
||||
android:layout_marginRight="68px"
|
||||
android:layout_marginTop="10px"
|
||||
android:layout_marginRight="40px"
|
||||
android:maxLines="2"
|
||||
android:textStyle="bold"
|
||||
android:ellipsize="end"
|
||||
@@ -183,7 +183,7 @@
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8px"
|
||||
android:layout_marginTop="16px"
|
||||
android:layout_gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
@@ -217,7 +217,7 @@
|
||||
android:id="@+id/arrive_station_32"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="56px"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:inputType="textMultiLine"
|
||||
android:lineSpacingExtra="16px"
|
||||
android:textColor="#CAD6FF"
|
||||
@@ -241,12 +241,12 @@
|
||||
android:id="@+id/module_och_taxi_order_other_content_3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="260px"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:inputType="textMultiLine"
|
||||
android:lineSpacingExtra="16px"
|
||||
android:textColor="#CAD6FF"
|
||||
android:textSize="30px"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_och_taxi_order_go_ahead_station_31"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_och_taxi_order_arrive_station_32"
|
||||
tools:text="乘客将于 - - 用车" />
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ import com.mogo.eagle.core.data.app.AppConfigInfo.workingBranchName
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.launcher.BuildConfig
|
||||
import com.mogo.launcher.R
|
||||
import com.mogo.test.crashreport.CrashReportConstants
|
||||
import com.rousetime.android_startup.AndroidStartup
|
||||
import com.zhjt.mogo_core_function_devatools.env.*
|
||||
|
||||
class ConfigStartUp : AndroidStartup<Boolean>() {
|
||||
|
||||
@@ -44,7 +44,12 @@ class ConfigStartUp : AndroidStartup<Boolean>() {
|
||||
}
|
||||
|
||||
private fun initDebugConfig(context: Context) {
|
||||
DebugConfig.setNetMode(BuildConfig.NET_ENV)
|
||||
var mode = BuildConfig.NET_ENV
|
||||
val envConfig = EnvChangeManager.getEnvConfig()
|
||||
if (envConfig != null) {
|
||||
mode = envConfig.netMode
|
||||
}
|
||||
DebugConfig.setNetMode(mode)
|
||||
DebugConfig.setDebug(BuildConfig.DEBUG)
|
||||
DebugConfig.setLaunchLocationService(BuildConfig.LAUNCH_LOCATION_SERVICE)
|
||||
DebugConfig.setLauncher(BuildConfig.IS_LAUNCHER)
|
||||
|
||||
@@ -38,6 +38,8 @@ import com.mogo.eagle.core.utilcode.util.ThreadPoolService
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.module.common.constants.HostConst
|
||||
import com.rousetime.android_startup.AndroidStartup
|
||||
import com.zhjt.mogo_core_function_devatools.env.*
|
||||
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager.EnvConfig
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
|
||||
|
||||
@@ -113,6 +115,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
}
|
||||
// 设置AI云平台分配给三方应用的签名密钥,需要从AI云平台申请
|
||||
// 设置车机设备的唯一标识(这些表识必须是通过后台录入的设备)
|
||||
// TODO 现在这块逻辑因为网约车业务那后台的限制,还没有更换,条件成熟后替换为 DeviceIdUtils.getWidevineIDWithMd5(context)
|
||||
clientConfig.thirdPartyDeviceId = Utils.getDevicesId()
|
||||
// 设置循环检测间隔时间(每隔2小时loop一次httpDnsConfig)
|
||||
clientConfig.loopCheckDelay = (60 * 60 * 2 * 1000).toLong()
|
||||
@@ -123,6 +126,10 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
// clientConfig.setUseOriginSocket(true);
|
||||
clientConfig.iHttpDnsCurrentLocation = object : IHttpDnsCurrentLocation {
|
||||
override fun getCurrentLocation(): HttpDnsSimpleLocation? {
|
||||
val envConfig = EnvChangeManager.getEnvConfig()
|
||||
if (envConfig != null) {
|
||||
return HttpDnsSimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon)
|
||||
}
|
||||
var mogoLocation: MogoLocation? = null
|
||||
val locationClient =
|
||||
CallerMapUIServiceManager.getSingletonLocationClient(AbsMogoApplication.getApp())
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.zhidao.adas.client.bean.OriginalPointCloudData;
|
||||
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
|
||||
import com.zhidao.adas.client.bean.PlanningObjects;
|
||||
import com.zhidao.adas.client.bean.PredictionObstacleTrajectory;
|
||||
import com.zhidao.adas.client.bean.RecordDataConfig;
|
||||
import com.zhidao.adas.client.bean.RecordPanel;
|
||||
import com.zhidao.adas.client.bean.StatusInfo;
|
||||
import com.zhidao.adas.client.bean.TrackedObjects;
|
||||
@@ -111,6 +112,7 @@ public class DataDistribution {
|
||||
public final List<String> listWarn = new ArrayList<>();
|
||||
public final List<String> listArrivalNotification = new ArrayList<>();
|
||||
public final List<String> listStatusInfo = new ArrayList<>();
|
||||
public final List<String> listRecordDataConfig = new ArrayList<>();
|
||||
public final List<String> listErrorData = new ArrayList<>();
|
||||
public final List<String> listPointCloud = new ArrayList<>();
|
||||
public final List<String> listOriginalPointCloud = new ArrayList<>();
|
||||
@@ -150,7 +152,7 @@ public class DataDistribution {
|
||||
if (listener != null && Constants.TITLE.RECEIVE_POINT_CLOUD.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof OriginalPointCloudData) {
|
||||
} else if (data instanceof OriginalPointCloudData) {
|
||||
listOriginalPointCloud.add(0, time + str);
|
||||
if (listOriginalPointCloud.size() > LIST_SIZE) {
|
||||
listOriginalPointCloud.remove(listOriginalPointCloud.size() - 1);
|
||||
@@ -260,6 +262,14 @@ public class DataDistribution {
|
||||
if (listener != null && Constants.TITLE.RECEIVE_STATUS_QUERY_RESP.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof RecordDataConfig) {
|
||||
listRecordDataConfig.add(0, time + str);
|
||||
if (listRecordDataConfig.size() > LIST_SIZE) {
|
||||
listRecordDataConfig.remove(listRecordDataConfig.size() - 1);
|
||||
}
|
||||
if (listener != null && Constants.TITLE.RECEIVE_RECORD_DATA_CONFIG_RESP.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof ErrorData) {
|
||||
listErrorData.add(0, time + str);
|
||||
if (listErrorData.size() > 100) {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.zhidao.adas.client.bean;
|
||||
|
||||
import com.google.protobuf.TextFormat;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
public class RecordDataConfig extends BaseInfo {
|
||||
public final MessagePad.RecordDataConfig bean;
|
||||
|
||||
public RecordDataConfig(MessagePad.Header header, MessagePad.RecordDataConfig bean, SimpleDateFormat sdf) {
|
||||
super("接收", bean.getSerializedSize(), header, sdf);
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
|
||||
}
|
||||
}
|
||||
@@ -115,8 +115,10 @@ public class InfoFragment extends BaseFragment {
|
||||
adapter.setData(DataDistribution.getInstance().listTrajectory);
|
||||
} else if (Constants.TITLE.RECEIVE_ARRIVAL_NOTIFICATION.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listArrivalNotification);
|
||||
} else if (Constants.TITLE.RECEIVE_STATUS_QUERY_RESP.equals(title)){
|
||||
} else if (Constants.TITLE.RECEIVE_STATUS_QUERY_RESP.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listStatusInfo);
|
||||
} else if (Constants.TITLE.RECEIVE_RECORD_DATA_CONFIG_RESP.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listRecordDataConfig);
|
||||
} else if (Constants.TITLE.RECEIVE_GLOBAL_PATH_RESP.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listGlobalPathResp);
|
||||
} else if (Constants.TITLE.RECEIVE_RECORD_RESULT.equals(title)) {
|
||||
@@ -129,11 +131,11 @@ public class InfoFragment extends BaseFragment {
|
||||
adapter.setData(DataDistribution.getInstance().listPredictionObstacleTrajectory);
|
||||
} else if (Constants.TITLE.RECEIVE_POINT_CLOUD.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listPointCloud);
|
||||
}else if (Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL.equals(title)) {
|
||||
} else if (Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listOriginalPointCloud);
|
||||
} else if (Constants.TITLE.RECEIVE_PLANNING_OBJECTS.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listPlanningObjects);
|
||||
}else{
|
||||
} else {
|
||||
adapter.setData(DataDistribution.getInstance().listErrorData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ import com.zhidao.adas.client.bean.OriginalPointCloudData;
|
||||
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
|
||||
import com.zhidao.adas.client.bean.PlanningObjects;
|
||||
import com.zhidao.adas.client.bean.PredictionObstacleTrajectory;
|
||||
import com.zhidao.adas.client.bean.RecordDataConfig;
|
||||
import com.zhidao.adas.client.bean.RecordPanel;
|
||||
import com.zhidao.adas.client.bean.StatusInfo;
|
||||
import com.zhidao.adas.client.bean.TrackedObjects;
|
||||
@@ -623,6 +624,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_PLANNING_OBJECTS);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_CAR_CONFIG_RESP);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_RECORD_DATA_CONFIG_RESP);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_RECORD_RESULT);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_GLOBAL_PATH_RESP);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_ARRIVAL_NOTIFICATION);
|
||||
@@ -635,6 +637,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
titleBtnData.add(Constants.TITLE.SEND_GLOBAL_PATH_REQ);
|
||||
titleBtnData.add(Constants.TITLE.SEND_STATUS_QUERY_REQ);
|
||||
titleBtnData.add(Constants.TITLE.SEND_BASIC_INFO_RESP);
|
||||
titleBtnData.add(Constants.TITLE.SEND_RECORD_DATA_CONFIG_RESP);
|
||||
titleBtnData.add(Constants.TITLE.SEND_RECORD_DATA_5);
|
||||
titleBtnData.add(Constants.TITLE.SEND_RECORD_DATA_START);
|
||||
titleBtnData.add(Constants.TITLE.SEND_RECORD_DATA_END);
|
||||
@@ -844,15 +847,15 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onPointCloud(MessagePad.Header header, MogoPointCloudOuterClass.MogoPointCloud pointCloud) {
|
||||
MyPointCloud base = new MyPointCloud(header, pointCloud, sdf);
|
||||
DataDistribution.getInstance().addData(base);
|
||||
// String data = PointCloudDecoder.decode(header, pointCloud);
|
||||
// Log.i("dddd", "data==" + data.length());
|
||||
// Log.i("dddd", "data==" + data);
|
||||
// LogSave.getInstance().saveLog("转换数据=" + data);
|
||||
}
|
||||
// @Override
|
||||
// public void onPointCloud(MessagePad.Header header, MogoPointCloudOuterClass.MogoPointCloud pointCloud) {
|
||||
// MyPointCloud base = new MyPointCloud(header, pointCloud, sdf);
|
||||
// DataDistribution.getInstance().addData(base);
|
||||
//// String data = PointCloudDecoder.decode(header, pointCloud);
|
||||
//// Log.i("dddd", "data==" + data.length());
|
||||
//// Log.i("dddd", "data==" + data);
|
||||
//// LogSave.getInstance().saveLog("转换数据=" + data);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onPointCloud(byte[] pointCloud) {
|
||||
@@ -918,6 +921,12 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecordDataConfigResp(MessagePad.Header header, MessagePad.RecordDataConfig config) {
|
||||
RecordDataConfig base = new RecordDataConfig(header, config, sdf);
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
|
||||
private void initAdas() {
|
||||
CupidLogUtils.e(TAG, "--->初始化");
|
||||
@@ -1141,7 +1150,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
break;
|
||||
case Constants.TITLE.SEND_RECORD_DATA_5:
|
||||
//数据采集5秒
|
||||
boolean b = AdasManager.getInstance().startRecordPackage(1, 5, 1);
|
||||
boolean b = AdasManager.getInstance().startRecordPackage(1, 5, 1, 2);
|
||||
CupidLogUtils.w(TAG, "AutopilotRecord===>send:" + b);
|
||||
break;
|
||||
case Constants.TITLE.SEND_RECORD_DATA_START:
|
||||
@@ -1230,6 +1239,10 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
//关闭雨天模式
|
||||
AdasManager.getInstance().sendRainModeReq(0);
|
||||
break;
|
||||
case Constants.TITLE.SEND_RECORD_DATA_CONFIG_RESP:
|
||||
//关闭雨天模式
|
||||
AdasManager.getInstance().sendRecordDataConfigReq();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -165,6 +165,7 @@ public class Constants {
|
||||
String TITLE_CAR_CONFIG_RESP = "工控机版本\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t固定IP配置";
|
||||
String RECEIVE_CAR_CONFIG_RESP = "信息与配置";
|
||||
String RECEIVE_RECORD_RESULT = MessageType.TYPE_RECEIVE_RECORD_RESULT.desc;
|
||||
String RECEIVE_RECORD_DATA_CONFIG_RESP = MessageType.TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP.desc;
|
||||
String RECEIVE_GLOBAL_PATH_RESP = MessageType.TYPE_RECEIVE_GLOBAL_PATH_RESP.desc;
|
||||
String RECEIVE_WARN = MessageType.TYPE_RECEIVE_WARN.desc;
|
||||
String RECEIVE_ARRIVAL_NOTIFICATION = MessageType.TYPE_RECEIVE_ARRIVAL_NOTIFICATION.desc;
|
||||
@@ -172,22 +173,22 @@ public class Constants {
|
||||
String RECEIVE_ERROR = "错误数据";
|
||||
|
||||
|
||||
|
||||
String SEND_SET_AUTOPILOT_MODE_REQ="自动驾驶模式";
|
||||
String SEND_GLOBAL_PATH_REQ="自动驾驶路径查询";
|
||||
String SEND_STATUS_QUERY_REQ="状态查询";
|
||||
String SEND_BASIC_INFO_RESP="下发SN";
|
||||
String SEND_RECORD_DATA_5="数据采集5秒";
|
||||
String SEND_RECORD_DATA_START="数据采集Start";
|
||||
String SEND_RECORD_DATA_END="数据采集End";
|
||||
String SEND_TRAFFIC_LIGHT_DATA="发送信号灯";
|
||||
String SEND_SET_AUTOPILOT_SPEED_REQ="自动驾驶限速";
|
||||
String SEND_SYSTEM_CMD_REQ_REBOOT="重启所有节点";
|
||||
String SEND_RECORD_CAUSE="采集类型";
|
||||
String SEND_SET_DEMO_MODE_REQ_OPEN="打开演示模式";
|
||||
String SEND_SET_DEMO_MODE_REQ_CLOSE="关闭演示模式";
|
||||
String SEND_SET_RAIN_MODE_REQ_OPEN="打开雨天模式";
|
||||
String SEND_SET_RAIN_MODE_REQ_CLOSE="关闭雨天模式";
|
||||
String SEND_SET_AUTOPILOT_MODE_REQ = "自动驾驶模式";
|
||||
String SEND_GLOBAL_PATH_REQ = "自动驾驶路径查询";
|
||||
String SEND_STATUS_QUERY_REQ = "状态查询";
|
||||
String SEND_BASIC_INFO_RESP = "下发SN";
|
||||
String SEND_RECORD_DATA_5 = "数据采集5秒";
|
||||
String SEND_RECORD_DATA_START = "数据采集Start";
|
||||
String SEND_RECORD_DATA_END = "数据采集End";
|
||||
String SEND_TRAFFIC_LIGHT_DATA = "发送信号灯";
|
||||
String SEND_SET_AUTOPILOT_SPEED_REQ = "自动驾驶限速";
|
||||
String SEND_SYSTEM_CMD_REQ_REBOOT = "重启所有节点";
|
||||
String SEND_RECORD_CAUSE = "采集类型";
|
||||
String SEND_SET_DEMO_MODE_REQ_OPEN = "打开演示模式";
|
||||
String SEND_SET_DEMO_MODE_REQ_CLOSE = "关闭演示模式";
|
||||
String SEND_SET_RAIN_MODE_REQ_OPEN = "打开雨天模式";
|
||||
String SEND_SET_RAIN_MODE_REQ_CLOSE = "关闭雨天模式";
|
||||
String SEND_RECORD_DATA_CONFIG_RESP = "数据采集配置";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -113,8 +113,8 @@ ext {
|
||||
|
||||
// obu sdk
|
||||
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
|
||||
mogoobu : 'com.zhidao.support.obu:mogoobu:1.0.0.25',
|
||||
mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.16',
|
||||
mogoobu : 'com.zhidao.support.obu:mogoobu:1.0.0.32',
|
||||
mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.23',
|
||||
|
||||
// google
|
||||
googlezxing : "com.google.zxing:core:3.3.3",
|
||||
|
||||
@@ -315,6 +315,10 @@ class MoGoAutopilotProvider :
|
||||
return AdasManager.getInstance().startRecordPackage(id, duration, type)
|
||||
}
|
||||
|
||||
override fun recordPackage(type: Int, id: Int, duration: Int, bduration: Int): Boolean {
|
||||
return AdasManager.getInstance().startRecordPackage(id,duration, type, bduration)
|
||||
}
|
||||
|
||||
override fun stopRecord(type: Int, id: Int): Boolean {
|
||||
return AdasManager.getInstance().stopRecordPackage(id, type)
|
||||
}
|
||||
@@ -353,17 +357,14 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 演示模式(美化模式)
|
||||
* 演示模式(美化模式)设置只限定于鹰眼
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
*/
|
||||
override fun setDemoMode(isEnable: Boolean) {
|
||||
if (isEnable) {
|
||||
AdasManager.getInstance().sendDemoModeReq(1)
|
||||
} else {
|
||||
AdasManager.getInstance().sendDemoModeReq(0)
|
||||
}
|
||||
// 同步给乘客端
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
var byteArray = if (isEnable) byteArrayOf(1) else byteArrayOf(0)
|
||||
@@ -382,6 +383,19 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置工控机演示模式(美化模式)开启、关闭
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
*/
|
||||
override fun setIPCDemoMode(isEnable: Boolean) {
|
||||
if (isEnable) {
|
||||
AdasManager.getInstance().sendDemoModeReq(1)
|
||||
} else {
|
||||
AdasManager.getInstance().sendDemoModeReq(0)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 雨天模式
|
||||
* isEnable = true 开启
|
||||
@@ -395,6 +409,13 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
*/
|
||||
override fun getBadCaseConfig() {
|
||||
AdasManager.getInstance().sendRecordDataConfigReq()
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送工控机所有节点重启命令
|
||||
*/
|
||||
@@ -508,4 +529,9 @@ class MoGoAutopilotProvider :
|
||||
override fun getTeleTimeStamp(): Long {
|
||||
return msgHandler.getTeleTimeStamp()
|
||||
}
|
||||
|
||||
override fun sendStatusQueryReq() {
|
||||
Log.d(TAG, "---- sendStatusQueryReq ----")
|
||||
AdasManager.getInstance().sendStatusQueryReq()
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotGuardian
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotSNRequest
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotStatusRespByQuery
|
||||
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
|
||||
@@ -43,6 +44,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPointCloudList
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.network.utils.*
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
import com.zhidao.support.adas.high.OnAdasListener
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus
|
||||
@@ -244,10 +246,11 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
//他车轨迹预测
|
||||
}
|
||||
|
||||
override fun onPointCloud(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?) {
|
||||
//点云数据透传
|
||||
//Logger.d("pointCloud","pointCloud"+pointCloud);
|
||||
}
|
||||
// override fun onPointCloud(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?) {
|
||||
// //点云数据透传
|
||||
// //Logger.d("pointCloud","pointCloud"+pointCloud);
|
||||
// CallerAutopilotPointCloudListenerManager.invokeAutopilotPointCloudDataUpdate(header, pointCloud)
|
||||
// }
|
||||
|
||||
override fun onPointCloud(pointCloud: ByteArray?) {
|
||||
//点云数据透传
|
||||
@@ -369,6 +372,20 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
statusInfo: SystemStatusInfo.StatusInfo?
|
||||
) {
|
||||
//状态查询应答
|
||||
statusInfo?.let {
|
||||
Log.d(TAG, GsonUtil.jsonFromObject(it))
|
||||
}
|
||||
invokeAutopilotStatusRespByQuery(statusInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据采集配置应答
|
||||
*/
|
||||
override fun onRecordDataConfigResp(
|
||||
header: MessagePad.Header?,
|
||||
config: MessagePad.RecordDataConfig?
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -54,6 +54,10 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
updateDriveStatusTask()
|
||||
//每次工控机连接成功后,需同步当前设置的美化模式状态
|
||||
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
//当连接状态是关闭美化模式时,同步给工控机
|
||||
if(!FunctionBuildConfig.isDemoMode){
|
||||
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
}
|
||||
//每次工控机连接成功后,需同步当前设置的雨天模式状态
|
||||
CallerAutoPilotManager.setRainMode(FunctionBuildConfig.isRainMode)
|
||||
} else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.DISCONNECTED) {
|
||||
|
||||
@@ -90,6 +90,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_api
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_res
|
||||
}else {
|
||||
implementation project(':services:mogo-service-api')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
@@ -98,6 +99,7 @@ dependencies {
|
||||
implementation project(':core:mogo-core-function-api')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-res')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,8 +78,12 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
sceneManager.updateSceneTAG(sceneTag)
|
||||
}
|
||||
|
||||
override fun initBadCase(view: View, onShow: (() -> Unit)?, onHide: (() -> Unit)?) {
|
||||
BadCaseManager.init(view, onShow, onHide)
|
||||
override fun initBadCase(view: View) {
|
||||
BadCaseManager.initBadCase(view)
|
||||
}
|
||||
|
||||
override fun initAiCollect(view: View) {
|
||||
BadCaseManager.initAiCollect(view)
|
||||
}
|
||||
|
||||
override fun onReceiveBadCaseRecord(record: RecordPanelOuterClass.RecordPanel) {
|
||||
@@ -87,7 +91,7 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
}
|
||||
|
||||
override fun showFeedbackWindow(ctx: Context) {
|
||||
FeedbackManager.showFeedbackWindow(ctx)
|
||||
BadCaseManager.showBadCaseConfigWindow(ctx)
|
||||
}
|
||||
|
||||
override fun getUpgradeVersionUrls(versionName: String) {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase
|
||||
|
||||
import android.transition.AutoTransition
|
||||
import android.transition.TransitionManager
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.lifecycle.Lifecycle.Event
|
||||
@@ -15,24 +14,24 @@ import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.kotlin.PX
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
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.reminder.Reminder
|
||||
import com.mogo.eagle.core.utilcode.reminder.api.IReminder
|
||||
import com.mogo.eagle.core.utilcode.reminder.api.IReminder.IGlobalStateChangeListener
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.BadCaseResponse.Reason
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.BadCasePresenter
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.BadCaseView
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.*
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.db.entity.AutoPilotRecord
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.BadCaseResponse.Reason
|
||||
import com.zhjt.mogo_core_function_devatools.ext.enqueuePop
|
||||
import com.zhjt.mogo_core_function_devatools.ext.toast
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import record_cache.RecordPanelOuterClass
|
||||
import java.lang.IllegalStateException
|
||||
import java.lang.ref.WeakReference
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
@@ -46,9 +45,6 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
|
||||
private val CASE_EXPIRE_DURATION: Long = TimeUnit.HOURS.toMillis(4)/* TimeUnit.SECONDS.toMillis(10) */
|
||||
|
||||
private var onShow: (() -> Unit)? = null
|
||||
private var onHide: (() -> Unit)? = null
|
||||
|
||||
private var hideFloat: (() -> Unit)? = null
|
||||
|
||||
@Volatile
|
||||
@@ -85,19 +81,69 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
field
|
||||
}
|
||||
|
||||
fun init(view: View, onShow: (() -> Unit)?, onHide: (() -> Unit)?) {
|
||||
this.viewHolder = WeakReference(view)
|
||||
view.lifecycleOwner.lifecycle.addObserver(this)
|
||||
this.onShow = onShow
|
||||
this.onHide = onHide
|
||||
register()
|
||||
recoverBadCase()
|
||||
/**
|
||||
* 展示BadCase配置页面
|
||||
*/
|
||||
fun showBadCaseConfigWindow(context: Context){
|
||||
val badCaseConfigView = BadCaseConfigView(context)
|
||||
badCaseConfigView.setClickListener(object: BadCaseConfigView.ClickListener{
|
||||
override fun onClose() {
|
||||
hideFloat?.invoke()
|
||||
hideFloat = null
|
||||
}
|
||||
})
|
||||
context.enqueuePop(badCaseConfigView,960.PX, WindowManager.LayoutParams.MATCH_PARENT, key = "BadCaseConfigView").also {
|
||||
hideFloat = it
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 主动采集BadCase
|
||||
*/
|
||||
fun initBadCase(view: View){
|
||||
val activity = view.context as? FragmentActivity ?: throw IllegalStateException("please ensure context is FragmentActivity.")
|
||||
view.setOnClickListener {
|
||||
if(ClickUtils.isFastClick()){
|
||||
val initiativeBadCaseWindow = InitiativeBadCaseWindow(activity)
|
||||
initiativeBadCaseWindow.setClickListener(object: InitiativeBadCaseWindow.ClickListener{
|
||||
override fun closeWindow() {
|
||||
initiativeBadCaseWindow.hideFloatWindow()
|
||||
}
|
||||
|
||||
})
|
||||
initiativeBadCaseWindow.showFloatWindow()
|
||||
}else{
|
||||
ToastUtils.showShort("请勿连续点击,稍后再试")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* AI数据采集
|
||||
*/
|
||||
fun initAiCollect(view: View){
|
||||
val activity = view.context as? FragmentActivity ?: throw IllegalStateException("please ensure context is FragmentActivity.")
|
||||
view.setOnClickListener {
|
||||
if(ClickUtils.isFastClick()){
|
||||
val aiDataCollectWindow = AIDataCollectWindow(activity)
|
||||
aiDataCollectWindow.setClickListener(object: AIDataCollectWindow.ClickListener{
|
||||
override fun closeWindow() {
|
||||
aiDataCollectWindow.hideFloatWindow()
|
||||
}
|
||||
})
|
||||
aiDataCollectWindow.showFloatWindow()
|
||||
}else{
|
||||
ToastUtils.showShort("请勿连续点击,稍后再试")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
private fun register() {
|
||||
scope?.launch(Dispatchers.Default) {
|
||||
while (true) {
|
||||
showBadCaseInternal(AutoPilotRecord())
|
||||
CallerLogger.d("$M_DEVA$TAG", "---- 开始监听BadCase事件 ----")
|
||||
val old = record
|
||||
if (old == null || old.consumed) {
|
||||
@@ -131,12 +177,6 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
showBadCaseInternal(it)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
CallerLogger.d("$M_DEVA$TAG", "record: [$old] hasn't been consumed~~~~")
|
||||
withContext(Dispatchers.Main) {
|
||||
showEntry()
|
||||
}
|
||||
delay(1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -195,7 +235,7 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
private fun CoroutineScope.showBadCaseInternal(record: AutoPilotRecord) = launch {
|
||||
viewHolder?.get()?.also { itx ->
|
||||
presenter.updateLastModified(CallerAutopilotVehicleStateListenerManager.getAutopilotTimeStamp())
|
||||
showEntry()
|
||||
|
||||
itx.onClick {
|
||||
showBadCaseFloat(
|
||||
onDismiss = {
|
||||
@@ -221,7 +261,7 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
withContext(Dispatchers.IO) {
|
||||
presenter.deleteRecord(record)
|
||||
}
|
||||
hideEntry()
|
||||
|
||||
hideFloat?.invoke()
|
||||
hideFloat = null
|
||||
}
|
||||
@@ -235,7 +275,6 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
dismissJob?.takeIf { it.isActive }?.cancel()
|
||||
return scope?.launch {
|
||||
delay(CASE_EXPIRE_DURATION)
|
||||
hideEntry()
|
||||
record?.also {
|
||||
it.consumed = true
|
||||
withContext(Dispatchers.IO) {
|
||||
@@ -245,20 +284,6 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
}
|
||||
}
|
||||
|
||||
private fun showEntry() {
|
||||
viewHolder?.get()?.takeIf { it.visibility != View.VISIBLE }?.also {
|
||||
it.toggle(true)
|
||||
onShow?.invoke()
|
||||
}
|
||||
}
|
||||
|
||||
private fun hideEntry() {
|
||||
viewHolder?.get()?.takeIf { it.visibility == View.VISIBLE }?.also {
|
||||
it.toggle(false)
|
||||
onHide?.invoke()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showBadCaseFloat(onDismiss: () -> Unit, onSelect:suspend (reason: Reason) -> Unit) {
|
||||
val activity = viewHolder?.get()?.context as? FragmentActivity ?: throw IllegalStateException("please ensure context is FragmentActivity.")
|
||||
BadCaseView(activity).also { itx ->
|
||||
@@ -291,21 +316,12 @@ internal object BadCaseManager : LifecycleEventObserver {
|
||||
if (event == ON_DESTROY) {
|
||||
Reminder.unRegisterGlobalStateChangeListener(listener)
|
||||
dismissJob?.takeIf { it.isActive }?.cancel()
|
||||
onHide = null
|
||||
onShow = null
|
||||
hideFloat = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun <T : View> T.toggle(show: Boolean) {
|
||||
val group = (parent as? ViewGroup) ?: return
|
||||
val target = if (show) View.VISIBLE else View.GONE
|
||||
takeIf { it.visibility != target }?.also {
|
||||
TransitionManager.beginDelayedTransition(group, AutoTransition())
|
||||
it.visibility = target
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal fun RecordPanelOuterClass.RecordPanel.toRecord(): AutoPilotRecord =
|
||||
AutoPilotRecord().also {
|
||||
|
||||
@@ -0,0 +1,348 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.graphics.PixelFormat
|
||||
import android.os.SystemClock
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.*
|
||||
import android.widget.RadioButton
|
||||
import android.widget.TextView
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
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
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.toRecord
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import record_cache.RecordPanelOuterClass
|
||||
import java.lang.reflect.Field
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description AI数据采集弹窗
|
||||
* @since: 2022/7/12
|
||||
*/
|
||||
class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
IMoGoAutopilotRecordListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "AIDataCollectWindow"
|
||||
}
|
||||
|
||||
private var mActivity: Activity = activity
|
||||
private var mWindowParams: WindowManager.LayoutParams? = null
|
||||
private var mWindowManager: WindowManager? = null
|
||||
|
||||
private lateinit var tvCollectNum: TextView //采集弹窗数量
|
||||
private lateinit var tvCollectTime: TextView //采集时间
|
||||
|
||||
private lateinit var rbLargeCar: RadioButton //大型车
|
||||
private lateinit var rbTrafficLight: RadioButton //交通灯
|
||||
private lateinit var rbWater: RadioButton //积水
|
||||
private lateinit var rbConstruction: RadioButton //施工
|
||||
private lateinit var rbAccident: RadioButton //车祸路段
|
||||
private lateinit var rbRain: RadioButton //中雨交通流
|
||||
private lateinit var rbNightTraffic: RadioButton //夜间交通流
|
||||
|
||||
private lateinit var tvCollectReport: TextView //上报按钮
|
||||
private lateinit var tvCollectCancel: TextView //取消按钮
|
||||
|
||||
private var collectReason: String = "大型车:大货、大巴、特种车辆"
|
||||
|
||||
private lateinit var mFloatLayout: View
|
||||
private var mInViewX = 0f
|
||||
private var mInViewY = 0f
|
||||
private var mDownInScreenX = 0f
|
||||
private var mDownInScreenY = 0f
|
||||
private var mInScreenX = 0f
|
||||
private var mInScreenY = 0f
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
init {
|
||||
initFloatWindow();
|
||||
}
|
||||
|
||||
private val presenter by lazy {
|
||||
BadCasePresenter()
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initFloatWindow(){
|
||||
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_ai_data_collect, null) as View
|
||||
mFloatLayout.setOnTouchListener(this)
|
||||
tvCollectNum = mFloatLayout.findViewById(R.id.tvCollectNum)
|
||||
tvCollectTime = mFloatLayout.findViewById(R.id.tvCollectTime)
|
||||
|
||||
rbLargeCar = mFloatLayout.findViewById(R.id.rbLargeCar)
|
||||
rbTrafficLight = mFloatLayout.findViewById(R.id.rbTrafficLight)
|
||||
rbWater = mFloatLayout.findViewById(R.id.rbWater)
|
||||
rbConstruction = mFloatLayout.findViewById(R.id.rbConstruction)
|
||||
rbAccident = mFloatLayout.findViewById(R.id.rbAccident)
|
||||
rbRain = mFloatLayout.findViewById(R.id.rbRain)
|
||||
rbNightTraffic = mFloatLayout.findViewById(R.id.rbNightTraffic)
|
||||
|
||||
tvCollectReport = mFloatLayout.findViewById(R.id.tvCollectReport)
|
||||
tvCollectCancel = mFloatLayout.findViewById(R.id.tvCollectCancel)
|
||||
|
||||
tvCollectNum.text = BadCaseConfig.windowNum.toString()
|
||||
BadCaseConfig.windowNum++
|
||||
tvCollectTime.text ="时间:${millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat())}"
|
||||
|
||||
CallerAutoPilotManager.recordPackage(
|
||||
99,
|
||||
Random(SystemClock.elapsedRealtime()).nextInt(),
|
||||
20,
|
||||
12
|
||||
)
|
||||
|
||||
//大型车
|
||||
rbLargeCar.setOnClickListener{
|
||||
setRadioButtonStatus(
|
||||
largeCarStatus = true,
|
||||
trafficLightStatus = false,
|
||||
waterStatus = false,
|
||||
constructionStatus = false,
|
||||
accidentStatus = false,
|
||||
rainStatus = false,
|
||||
nightTrafficStatus = false
|
||||
)
|
||||
collectReason = "大型车:大货、大巴、特种车辆"
|
||||
}
|
||||
//交通灯
|
||||
rbTrafficLight.setOnClickListener {
|
||||
setRadioButtonStatus(
|
||||
largeCarStatus = false,
|
||||
trafficLightStatus = true,
|
||||
waterStatus = false,
|
||||
constructionStatus = false,
|
||||
accidentStatus = false,
|
||||
rainStatus = false,
|
||||
nightTrafficStatus = false
|
||||
)
|
||||
collectReason = "交通灯:水平、箭头、雨天交通灯"
|
||||
}
|
||||
//积水
|
||||
rbWater.setOnClickListener {
|
||||
setRadioButtonStatus(
|
||||
largeCarStatus = false,
|
||||
trafficLightStatus = false,
|
||||
waterStatus = true,
|
||||
constructionStatus = false,
|
||||
accidentStatus = false,
|
||||
rainStatus = false,
|
||||
nightTrafficStatus = false
|
||||
)
|
||||
collectReason = "积水:距离10米内,面积大于1平米"
|
||||
}
|
||||
//施工
|
||||
rbConstruction.setOnClickListener {
|
||||
setRadioButtonStatus(
|
||||
largeCarStatus = false,
|
||||
trafficLightStatus = false,
|
||||
waterStatus = false,
|
||||
constructionStatus = true,
|
||||
accidentStatus = false,
|
||||
rainStatus = false,
|
||||
nightTrafficStatus = false
|
||||
)
|
||||
collectReason = "施工:锥桶、路障"
|
||||
}
|
||||
//车祸路段
|
||||
rbAccident.setOnClickListener {
|
||||
setRadioButtonStatus(
|
||||
largeCarStatus = false,
|
||||
trafficLightStatus = false,
|
||||
waterStatus = false,
|
||||
constructionStatus = false,
|
||||
accidentStatus = true,
|
||||
rainStatus = false,
|
||||
nightTrafficStatus = false
|
||||
)
|
||||
collectReason = "车祸路段:有三角板"
|
||||
}
|
||||
//中雨交通流
|
||||
rbRain.setOnClickListener {
|
||||
setRadioButtonStatus(
|
||||
largeCarStatus = false,
|
||||
trafficLightStatus = false,
|
||||
waterStatus = false,
|
||||
constructionStatus = false,
|
||||
accidentStatus = false,
|
||||
rainStatus = true,
|
||||
nightTrafficStatus = false
|
||||
)
|
||||
collectReason = "中雨交通流"
|
||||
}
|
||||
//夜间交通流
|
||||
rbNightTraffic.setOnClickListener {
|
||||
setRadioButtonStatus(
|
||||
largeCarStatus = false,
|
||||
trafficLightStatus = false,
|
||||
waterStatus = false,
|
||||
constructionStatus = false,
|
||||
accidentStatus = false,
|
||||
rainStatus = false,
|
||||
nightTrafficStatus = true
|
||||
)
|
||||
collectReason = "夜间交通流"
|
||||
}
|
||||
|
||||
//上报
|
||||
tvCollectReport.setOnClickListener {
|
||||
GlobalScope.launch{
|
||||
val uploadResult = presenter.upload(mutableMapOf<String, String>().also { itx ->
|
||||
itx["carLicense"] = "DFD02313"
|
||||
itx["filename"] = "/home/mogo/data/bags/badcase/20220706145143/20220706145143-265939904-rosmaster-XXXX000000.bag"
|
||||
itx["filesize"] = "0"
|
||||
itx["key"] = "265939904"
|
||||
itx["reason"] = collectReason
|
||||
itx["duration"] = "16"
|
||||
itx["startTime"] = "20220706145203"
|
||||
itx["channel"] = "AI"
|
||||
itx["carSn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
itx["userRole"] = "安全员"
|
||||
itx["audioUrl"] = "http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/CarPad/mogopadlog/deviceId/2022-07-07/AUDIO_myTest.wav"
|
||||
itx["mapVersion"] = "MAP-taxi-hq_RoboTaxi_hq_H9_2.3.0.5_20220410"
|
||||
itx["eyeVersion"] = "2.8.0"
|
||||
itx["coordinate"] = ""
|
||||
|
||||
})
|
||||
if (uploadResult == null || uploadResult.code != 200) {
|
||||
TipToast.shortTip("上报失败")
|
||||
} else {
|
||||
TipToast.shortTip("上报成功")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//取消
|
||||
tvCollectCancel.setOnClickListener {
|
||||
BadCaseConfig.windowNum--
|
||||
clickListener?.closeWindow()
|
||||
}
|
||||
|
||||
|
||||
mWindowParams = WindowManager.LayoutParams()
|
||||
mWindowManager = mActivity.windowManager
|
||||
mWindowParams?.let {
|
||||
it.format = PixelFormat.RGBA_8888
|
||||
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
it.gravity = Gravity.START or Gravity.TOP
|
||||
it.width = 924
|
||||
it.height = 668
|
||||
it.alpha = 0.9f
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||
CallerLogger.d("${M_DEVA}${TAG}", "-- 收到工控机录制任务回调 -- $recordPanel")
|
||||
when(recordPanel.toRecord().stat){
|
||||
100, 101 ->{
|
||||
//成功结束录制
|
||||
TipToast.shortTip("bag录制成功")
|
||||
|
||||
}
|
||||
300 ->{
|
||||
//开始录制
|
||||
|
||||
}
|
||||
200 ->{
|
||||
//录制失败
|
||||
TipToast.shortTip("bag录制失败")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setRadioButtonStatus(largeCarStatus: Boolean,trafficLightStatus: Boolean,waterStatus: Boolean,
|
||||
constructionStatus: Boolean,accidentStatus: Boolean,rainStatus: Boolean,nightTrafficStatus: Boolean){
|
||||
rbLargeCar.isChecked = largeCarStatus
|
||||
rbTrafficLight.isChecked = trafficLightStatus
|
||||
rbWater.isChecked = waterStatus
|
||||
rbConstruction.isChecked = constructionStatus
|
||||
rbAccident.isChecked = accidentStatus
|
||||
rbRain.isChecked = rainStatus
|
||||
rbNightTraffic.isChecked = nightTrafficStatus
|
||||
}
|
||||
|
||||
override fun onTouch(v: View?, motionEvent: MotionEvent?): Boolean {
|
||||
when (motionEvent?.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
// 获取相对View的坐标,即以此View左上角为原点
|
||||
mInViewX = motionEvent.x
|
||||
mInViewY = motionEvent.y
|
||||
// 获取相对屏幕的坐标,即以屏幕左上角为原点
|
||||
mDownInScreenX = motionEvent.rawX
|
||||
mDownInScreenY = motionEvent.rawY - getSysBarHeight(mActivity)
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY - getSysBarHeight(mActivity)
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY - getSysBarHeight(mActivity)
|
||||
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
|
||||
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
mWindowManager!!.updateViewLayout(mFloatLayout, mWindowParams)
|
||||
}
|
||||
// MotionEvent.ACTION_UP -> // 如果手指离开屏幕时,xDownInScreen和xInScreen相等,且yDownInScreen和yInScreen相等,则视为触发了单击事件。
|
||||
// if (mDownInScreenX === mInScreenX && mDownInScreenY === mInScreenY) {
|
||||
// }
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
fun showFloatWindow() {
|
||||
if (mFloatLayout.parent == null) {
|
||||
val metrics = DisplayMetrics()
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels
|
||||
mWindowParams!!.y = metrics.heightPixels / 2 - getSysBarHeight(mActivity)
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
}
|
||||
}
|
||||
|
||||
fun hideFloatWindow() {
|
||||
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
|
||||
// 获取系统状态栏高度
|
||||
private fun getSysBarHeight(activity: Activity): Int {
|
||||
val c: Class<*>
|
||||
val obj: Any
|
||||
val field: Field
|
||||
val x: Int
|
||||
var sbar = 0
|
||||
try {
|
||||
c = Class.forName("com.android.internal.R\$dimen")
|
||||
obj = c.newInstance()
|
||||
field = c.getField("status_bar_height")
|
||||
x = field.get(obj).toString().toInt()
|
||||
sbar = activity.resources.getDimensionPixelSize(x)
|
||||
} catch (e1: Exception) {
|
||||
e1.printStackTrace()
|
||||
}
|
||||
return sbar
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener {
|
||||
fun closeWindow()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.RadioButton
|
||||
import android.widget.RadioGroup
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
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.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.SizeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import kotlinx.android.synthetic.main.layout_badcase_config.view.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.lang.Exception
|
||||
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description BadCase上报信息配置页面
|
||||
* @since: 2022/7/5
|
||||
*/
|
||||
internal class BadCaseConfigView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotRecordListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "BadCaseConfigView"
|
||||
}
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
private var mIdentity = "安全员"
|
||||
private var mPreviousDuration = 12
|
||||
private var mBackDuration = 8
|
||||
private var mType = 1
|
||||
|
||||
init{
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_badcase_config, this, true)
|
||||
background = ColorDrawable(Color.parseColor("#F0151D41"))
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
//关闭BadCase配置窗口
|
||||
ivConfigClose.setOnClickListener {
|
||||
clickListener?.onClose()
|
||||
}
|
||||
//安全员选项
|
||||
rbSafetyOfficer.setOnClickListener {
|
||||
mIdentity = "安全员"
|
||||
rbDeveloper.isChecked = false
|
||||
rbProduct.isChecked = false
|
||||
}
|
||||
//QA、研发选项
|
||||
rbDeveloper.setOnClickListener {
|
||||
mIdentity = "QA、研发"
|
||||
rbSafetyOfficer.isChecked = false
|
||||
rbProduct.isChecked = false
|
||||
}
|
||||
//产品、运营、演示选项
|
||||
rbProduct.setOnClickListener {
|
||||
mIdentity = "产品、运营、演示"
|
||||
rbSafetyOfficer.isChecked = false
|
||||
rbDeveloper.isChecked = false
|
||||
}
|
||||
|
||||
//保存配置按钮
|
||||
tvConfigSave.setOnClickListener {
|
||||
//判断、保存录制时间信息
|
||||
val preTimeStr=etInitiativePreTime.text.toString()
|
||||
val afterTimeStr=etInitiativeAfterTime.text.toString()
|
||||
|
||||
try {
|
||||
if(preTimeStr.isEmpty()){
|
||||
mPreviousDuration = 12
|
||||
}else{
|
||||
mPreviousDuration = preTimeStr.toInt()
|
||||
}
|
||||
if(afterTimeStr.isEmpty()){
|
||||
mBackDuration = 8
|
||||
}else{
|
||||
mBackDuration = afterTimeStr.toInt()
|
||||
}
|
||||
|
||||
if(mPreviousDuration<0 || mPreviousDuration>300){
|
||||
ToastUtils.showLong("采集时长最长300S")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(mBackDuration<0 || mBackDuration>300){
|
||||
ToastUtils.showLong("采集时长最长300S")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if((mPreviousDuration+mBackDuration)<5){
|
||||
ToastUtils.showLong("采集时长最短5S")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if((mPreviousDuration+mBackDuration)>300){
|
||||
ToastUtils.showLong("采集时长最长300S")
|
||||
return@setOnClickListener
|
||||
}
|
||||
BadCaseConfig.previousDuration = mPreviousDuration
|
||||
BadCaseConfig.backDuration = mBackDuration
|
||||
BadCaseConfig.totalDuration = BadCaseConfig.previousDuration + BadCaseConfig.backDuration
|
||||
}catch (e: Exception){
|
||||
ToastUtils.showLong("输入时间格式不合法,请重新输入")
|
||||
etInitiativePreTime.text = null
|
||||
etInitiativeAfterTime.text = null
|
||||
return@setOnClickListener
|
||||
}
|
||||
//保存身份信息
|
||||
BadCaseConfig.identity = mIdentity
|
||||
//保存录制模板采集类型
|
||||
BadCaseConfig.type = mType
|
||||
//吐司提示保存成功
|
||||
ToastUtils.showLong("保存成功")
|
||||
//关闭配置窗口
|
||||
clickListener?.onClose()
|
||||
}
|
||||
|
||||
// val test1 = TestBean(1,"人工接管自动录制")
|
||||
// val test2 = TestBean(2,"地图采集")
|
||||
// val test3 = TestBean(3,"画龙问题排查")
|
||||
// val test4 = TestBean(4,"误识别问题排查")
|
||||
// val test5 = TestBean(5,"lidar+planning")
|
||||
// val test6 = TestBean(6,"camera+planning")
|
||||
// val test7 = TestBean(7,"bus lidar+planning")
|
||||
// val test8 = TestBean(8,"bus camera+planning")
|
||||
// val test99 = TestBean(99,"ai data")
|
||||
//
|
||||
// val list = ArrayList<TestBean>()
|
||||
// list.add(test1)
|
||||
// list.add(test2)
|
||||
// list.add(test3)
|
||||
// list.add(test4)
|
||||
// list.add(test5)
|
||||
// list.add(test6)
|
||||
// list.add(test7)
|
||||
// list.add(test8)
|
||||
// list.add(test99)
|
||||
// list.iterator().forEach {
|
||||
// if(it.id!=99){
|
||||
// val radioButton = RadioButton(context)
|
||||
// val lp = RadioGroup.LayoutParams(
|
||||
// RadioGroup.LayoutParams.WRAP_CONTENT,
|
||||
// RadioGroup.LayoutParams.WRAP_CONTENT
|
||||
// )
|
||||
// //设置RadioButton边距 (int left, int top, int right, int bottom)
|
||||
// lp.setMargins(
|
||||
// SizeUtils.dp2px(0f),
|
||||
// SizeUtils.dp2px(8f),
|
||||
// SizeUtils.dp2px(10f),
|
||||
// SizeUtils.dp2px(8f)
|
||||
// )
|
||||
// //设置RadioButton背景
|
||||
// radioButton.setTextColor(Color.WHITE)
|
||||
//
|
||||
// radioButton.buttonDrawable = resources.getDrawable(R.drawable.badcase_radio_button_style)
|
||||
// //设置文字距离四周的距离
|
||||
// radioButton.setPadding(
|
||||
// SizeUtils.dp2px(12f),
|
||||
// SizeUtils.dp2px(5f),
|
||||
// SizeUtils.dp2px(10f),
|
||||
// SizeUtils.dp2px(5f)
|
||||
// )
|
||||
// radioButton.textSize = SizeUtils.sp2px(9f).toFloat()
|
||||
// radioButton.id = it.id
|
||||
// radioButton.isChecked = it.id == 1
|
||||
// //设置文字
|
||||
// radioButton.text = it.src
|
||||
// //将radioButton添加到radioGroup中
|
||||
// rgRecordConfig.addView(radioButton, lp)
|
||||
// rgRecordConfig.setOnCheckedChangeListener { _, checkedId ->
|
||||
// mType = checkedId
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
override fun onAutopilotRecordConfig(config: MessagePad.RecordDataConfig) {
|
||||
super.onAutopilotRecordConfig(config)
|
||||
ThreadUtils.runOnUiThread{
|
||||
config.recordTypesList.iterator().forEach {
|
||||
if(it.id!=99){
|
||||
val radioButton = RadioButton(context)
|
||||
val lp = RadioGroup.LayoutParams(
|
||||
RadioGroup.LayoutParams.WRAP_CONTENT,
|
||||
RadioGroup.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
//设置RadioButton边距 (int left, int top, int right, int bottom)
|
||||
lp.setMargins(
|
||||
SizeUtils.dp2px(0f),
|
||||
SizeUtils.dp2px(8f),
|
||||
SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(8f)
|
||||
)
|
||||
//设置RadioButton背景
|
||||
radioButton.setTextColor(Color.WHITE)
|
||||
|
||||
radioButton.buttonDrawable = resources.getDrawable(R.drawable.badcase_radio_button_style)
|
||||
//设置文字距离四周的距离
|
||||
radioButton.setPadding(
|
||||
SizeUtils.dp2px(12f),
|
||||
SizeUtils.dp2px(5f),
|
||||
SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(5f)
|
||||
)
|
||||
radioButton.textSize = SizeUtils.sp2px(9f).toFloat()
|
||||
radioButton.id = it.id
|
||||
radioButton.isChecked = it.id == 1
|
||||
//设置文字
|
||||
radioButton.text = it.desc
|
||||
//将radioButton添加到radioGroup中
|
||||
rgRecordConfig.addView(radioButton, lp)
|
||||
rgRecordConfig.setOnCheckedChangeListener { _, checkedId ->
|
||||
mType = checkedId
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
//获取数据采集录制模式配置列表
|
||||
CallerAutoPilotManager.getBadCaseConfig()
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutopilotRecordListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
fun onClose()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.graphics.PixelFormat
|
||||
import android.os.SystemClock
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.*
|
||||
import android.widget.TextView
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
|
||||
import java.lang.reflect.Field
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description BadCase主动录包
|
||||
* @since: 2022/7/13
|
||||
*/
|
||||
class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
|
||||
private var mActivity: Activity = activity
|
||||
private var mWindowParams: WindowManager.LayoutParams? = null
|
||||
private var mWindowManager: WindowManager? = null
|
||||
|
||||
private lateinit var mFloatLayout: View
|
||||
|
||||
private lateinit var tvInitiativeNum: TextView
|
||||
private lateinit var tvInitiativeTime: TextView
|
||||
private lateinit var tvInitiativeIdentity: TextView
|
||||
|
||||
private lateinit var viewAudioButton: View
|
||||
|
||||
private lateinit var tvInitiativeReport: TextView
|
||||
private lateinit var tvInitiativeCancel: TextView
|
||||
|
||||
private var audioStatus = false
|
||||
|
||||
private var mInViewX = 0f
|
||||
private var mInViewY = 0f
|
||||
private var mDownInScreenX = 0f
|
||||
private var mDownInScreenY = 0f
|
||||
private var mInScreenX = 0f
|
||||
private var mInScreenY = 0f
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
init {
|
||||
initFloatWindow();
|
||||
}
|
||||
|
||||
private val presenter by lazy {
|
||||
BadCasePresenter()
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initFloatWindow(){
|
||||
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_initiative_bad_case, null) as View
|
||||
mFloatLayout.setOnTouchListener(this)
|
||||
|
||||
tvInitiativeNum = mFloatLayout.findViewById(R.id.tvInitiativeNum)
|
||||
tvInitiativeTime = mFloatLayout.findViewById(R.id.tvInitiativeTime)
|
||||
tvInitiativeIdentity = mFloatLayout.findViewById(R.id.tvInitiativeIdentity)
|
||||
|
||||
viewAudioButton = mFloatLayout.findViewById(R.id.viewAudioButton)
|
||||
|
||||
tvInitiativeReport = mFloatLayout.findViewById(R.id.tvInitiativeReport)
|
||||
tvInitiativeCancel = mFloatLayout.findViewById(R.id.tvInitiativeCancel)
|
||||
|
||||
tvInitiativeNum.text = BadCaseConfig.windowNum.toString()
|
||||
BadCaseConfig.windowNum++
|
||||
tvInitiativeTime.text = "时间:${millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat())}"
|
||||
tvInitiativeIdentity.text = "身份:${BadCaseConfig.identity}"
|
||||
|
||||
viewAudioButton.setOnClickListener {
|
||||
audioStatus = !audioStatus
|
||||
if(audioStatus){
|
||||
viewAudioButton.background = mActivity.getDrawable(R.drawable.bad_case_audio_select)
|
||||
//开始录音
|
||||
RecordManager.getInstance().start("audio_test")
|
||||
}else{
|
||||
viewAudioButton.background = mActivity.getDrawable(R.drawable.bad_case_audio_normal)
|
||||
//结束录音
|
||||
RecordManager.getInstance().stop()
|
||||
}
|
||||
}
|
||||
|
||||
tvInitiativeReport.setOnClickListener {
|
||||
CallerAutoPilotManager.recordPackage(BadCaseConfig.type,
|
||||
Random(SystemClock.elapsedRealtime()).nextInt(),
|
||||
BadCaseConfig.totalDuration,
|
||||
BadCaseConfig.previousDuration
|
||||
)
|
||||
}
|
||||
tvInitiativeCancel.setOnClickListener {
|
||||
BadCaseConfig.windowNum--
|
||||
clickListener?.closeWindow()
|
||||
}
|
||||
|
||||
|
||||
mWindowParams = WindowManager.LayoutParams()
|
||||
mWindowManager = mActivity.windowManager
|
||||
mWindowParams?.let {
|
||||
it.format = PixelFormat.RGBA_8888
|
||||
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
it.gravity = Gravity.START or Gravity.TOP
|
||||
it.width = 924
|
||||
it.height = 668
|
||||
it.alpha = 0.9f
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTouch(v: View?, motionEvent: MotionEvent?): Boolean {
|
||||
when (motionEvent?.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
// 获取相对View的坐标,即以此View左上角为原点
|
||||
mInViewX = motionEvent.x
|
||||
mInViewY = motionEvent.y
|
||||
// 获取相对屏幕的坐标,即以屏幕左上角为原点
|
||||
mDownInScreenX = motionEvent.rawX
|
||||
mDownInScreenY = motionEvent.rawY - getSysBarHeight(mActivity)
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY - getSysBarHeight(mActivity)
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY - getSysBarHeight(mActivity)
|
||||
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
|
||||
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
mWindowManager!!.updateViewLayout(mFloatLayout, mWindowParams)
|
||||
}
|
||||
// MotionEvent.ACTION_UP -> // 如果手指离开屏幕时,xDownInScreen和xInScreen相等,且yDownInScreen和yInScreen相等,则视为触发了单击事件。
|
||||
// if (mDownInScreenX === mInScreenX && mDownInScreenY === mInScreenY) {
|
||||
// }
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
fun showFloatWindow() {
|
||||
if (mFloatLayout.parent == null) {
|
||||
val metrics = DisplayMetrics()
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels
|
||||
mWindowParams!!.y = metrics.heightPixels / 2 - getSysBarHeight(mActivity)
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
}
|
||||
}
|
||||
|
||||
fun hideFloatWindow() {
|
||||
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
|
||||
// 获取系统状态栏高度
|
||||
private fun getSysBarHeight(activity: Activity): Int {
|
||||
val c: Class<*>
|
||||
val obj: Any
|
||||
val field: Field
|
||||
val x: Int
|
||||
var sbar = 0
|
||||
try {
|
||||
c = Class.forName("com.android.internal.R\$dimen")
|
||||
obj = c.newInstance()
|
||||
field = c.getField("status_bar_height")
|
||||
x = field.get(obj).toString().toInt()
|
||||
sbar = activity.resources.getDimensionPixelSize(x)
|
||||
} catch (e1: Exception) {
|
||||
e1.printStackTrace()
|
||||
}
|
||||
return sbar
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener {
|
||||
fun closeWindow()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz
|
||||
|
||||
/**
|
||||
* @author xuxinchao
|
||||
* @description
|
||||
* @since: 2022/7/11
|
||||
*/
|
||||
data class TestBean(
|
||||
var id: Int,
|
||||
var src: String
|
||||
) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.consts
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 录包配置参数
|
||||
* @since: 2022/7/11
|
||||
*/
|
||||
object BadCaseConfig {
|
||||
//身份:安全员;QA、研发;产品、运营、演示,默认身份是:安全员
|
||||
@JvmField
|
||||
var identity: String = "安全员"
|
||||
//录制前溯时长
|
||||
@JvmField
|
||||
var previousDuration: Int = 12
|
||||
//录制后溯时长
|
||||
@JvmField
|
||||
var backDuration: Int = 8
|
||||
//BadCase录制时长,默认时长为20秒,时长区间为大于等于5秒,小于等于300秒
|
||||
@JvmField
|
||||
var totalDuration: Int = 20
|
||||
//采集类型
|
||||
@JvmField
|
||||
var type: Int = 1
|
||||
//BadCase采集和AI数据采集弹窗数量
|
||||
@JvmField
|
||||
var windowNum = 1
|
||||
|
||||
}
|
||||
@@ -4,5 +4,17 @@ import com.mogo.commons.debug.DebugConfig
|
||||
|
||||
internal object BadCaseHost {
|
||||
|
||||
fun getHost(): String = "http://dzt.zhidaozhixing.com"/*if (DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE) "http://dzt.zhidaozhixing.com" else "http://front.zdjs-private-test.myghost.zhidaoauto.com"*/
|
||||
private const val HOST_DEV = "http://dzt.zhidaozhixing.com/"
|
||||
private const val HOST_RELEASE = "https://dzt-test.zhidaozhixing.com/"
|
||||
|
||||
fun getHost(): String{
|
||||
return when (DebugConfig.getNetMode()) {
|
||||
DebugConfig.NET_MODE_DEV -> HOST_DEV
|
||||
DebugConfig.NET_MODE_QA -> HOST_DEV
|
||||
DebugConfig.NET_MODE_DEMO -> HOST_RELEASE
|
||||
DebugConfig.NET_MODE_RELEASE -> HOST_RELEASE
|
||||
else -> HOST_RELEASE
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.record;
|
||||
|
||||
import android.media.AudioFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Locale;
|
||||
|
||||
|
||||
public class RecordConfig implements Serializable {
|
||||
/**
|
||||
* 录音格式 默认WAV格式
|
||||
*/
|
||||
private RecordFormat format = RecordFormat.WAV;
|
||||
/**
|
||||
* 通道数:默认双通道
|
||||
*/
|
||||
private int channelConfig = AudioFormat.CHANNEL_IN_STEREO;
|
||||
|
||||
/**
|
||||
* 位宽
|
||||
*/
|
||||
private int encodingConfig = AudioFormat.ENCODING_PCM_16BIT;
|
||||
|
||||
/**
|
||||
* 采样率
|
||||
*/
|
||||
private int sampleRate = 16000;
|
||||
|
||||
|
||||
|
||||
public RecordConfig() {
|
||||
}
|
||||
|
||||
public RecordConfig(RecordFormat format) {
|
||||
this.format = format;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param format 录音文件的格式
|
||||
* @param channelConfig 声道配置
|
||||
* 单声道:See {@link AudioFormat#CHANNEL_IN_MONO}
|
||||
* 双声道:See {@link AudioFormat#CHANNEL_IN_STEREO}
|
||||
* @param encodingConfig 位宽配置
|
||||
* 8Bit: See {@link AudioFormat#ENCODING_PCM_8BIT}
|
||||
* 16Bit: See {@link AudioFormat#ENCODING_PCM_16BIT},
|
||||
* @param sampleRate 采样率 hz: 8000/16000/44100
|
||||
*/
|
||||
public RecordConfig(RecordFormat format, int channelConfig, int encodingConfig, int sampleRate) {
|
||||
this.format = format;
|
||||
this.channelConfig = channelConfig;
|
||||
this.encodingConfig = encodingConfig;
|
||||
this.sampleRate = sampleRate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前录音的采样位宽 单位bit
|
||||
*
|
||||
* @return 采样位宽 0: error
|
||||
*/
|
||||
public int getEncoding() {
|
||||
if (format == RecordFormat.MP3) {//mp3后期转换
|
||||
return 16;
|
||||
}
|
||||
|
||||
if (encodingConfig == AudioFormat.ENCODING_PCM_8BIT) {
|
||||
return 8;
|
||||
} else if (encodingConfig == AudioFormat.ENCODING_PCM_16BIT) {
|
||||
return 16;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前录音的采样位宽 单位bit
|
||||
*
|
||||
* @return 采样位宽 0: error
|
||||
*/
|
||||
public int getRealEncoding() {
|
||||
if (encodingConfig == AudioFormat.ENCODING_PCM_8BIT) {
|
||||
return 8;
|
||||
} else if (encodingConfig == AudioFormat.ENCODING_PCM_16BIT) {
|
||||
return 16;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前的声道数
|
||||
*
|
||||
* @return 声道数: 0:error
|
||||
*/
|
||||
public int getChannelCount() {
|
||||
if (channelConfig == AudioFormat.CHANNEL_IN_MONO) {
|
||||
return 1;
|
||||
} else if (channelConfig == AudioFormat.CHANNEL_IN_STEREO) {
|
||||
return 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//get&set
|
||||
|
||||
public RecordFormat getFormat() {
|
||||
return format;
|
||||
}
|
||||
|
||||
public RecordConfig setFormat(RecordFormat format) {
|
||||
this.format = format;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getChannelConfig() {
|
||||
return channelConfig;
|
||||
}
|
||||
|
||||
public RecordConfig setChannelConfig(int channelConfig) {
|
||||
this.channelConfig = channelConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getEncodingConfig() {
|
||||
if (format == RecordFormat.MP3) {//mp3后期转换
|
||||
return AudioFormat.ENCODING_PCM_16BIT;
|
||||
}
|
||||
return encodingConfig;
|
||||
}
|
||||
|
||||
public RecordConfig setEncodingConfig(int encodingConfig) {
|
||||
this.encodingConfig = encodingConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getSampleRate() {
|
||||
return sampleRate;
|
||||
}
|
||||
|
||||
public RecordConfig setSampleRate(int sampleRate) {
|
||||
this.sampleRate = sampleRate;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(Locale.getDefault(), "录制格式: %s,采样率:%sHz,位宽:%s bit,声道数:%s", format, sampleRate, getEncoding(), getChannelCount());
|
||||
}
|
||||
|
||||
public enum RecordFormat {
|
||||
/**
|
||||
* mp3格式
|
||||
*/
|
||||
MP3(".mp3"),
|
||||
/**
|
||||
* wav格式
|
||||
*/
|
||||
WAV(".wav"),
|
||||
/**
|
||||
* pcm格式
|
||||
*/
|
||||
PCM(".pcm");
|
||||
|
||||
private String extension;
|
||||
|
||||
public String getExtension() {
|
||||
return extension;
|
||||
}
|
||||
|
||||
RecordFormat(String extension) {
|
||||
this.extension = extension;
|
||||
}
|
||||
}
|
||||
}
|
||||