This commit is contained in:
zhongchao
2021-06-23 16:05:06 +08:00
12 changed files with 74 additions and 38 deletions

View File

@@ -200,6 +200,7 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
* 设置自动驾驶可用状态
*/
public void onAutopilotEnableChange( boolean isEnable ) {
onAutopilotStatusChanged(isEnable);
if ( isEnable ) {
showAutopilotBiz();
} else {

View File

@@ -29,6 +29,7 @@ import com.mogo.utils.network.utils.GsonUtil;
import com.mogo.utils.storage.SharedPrefsMgr;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
@@ -314,6 +315,9 @@ class MogoOCHTaxiModel {
* @param data
*/
private void convertCurrentOrder( OCHTaxiOrderResponse2 data ) {
if (data.data == null){
return;
}
if ( mCurrentOCHOrder == null ) {
mCurrentOCHOrder = new OCHTaxiOrderResponse();
}
@@ -325,18 +329,23 @@ class MogoOCHTaxiModel {
mCurrentOCHOrder.orderType = data.data.orderType;
mCurrentOCHOrder.drivingRoutes = new ArrayList<>();
OCHTaxiOrderResponse.OCHTaxiStation startStation = new OCHTaxiOrderResponse.OCHTaxiStation();
startStation.lon = data.data.startStationCoordinate.get( 0 );
startStation.lat = data.data.startStationCoordinate.get( 1 );
startStation.siteId = data.data.startStationId;
startStation.siteName = data.data.startStation;
mCurrentOCHOrder.drivingRoutes.add( startStation );
List< Double > startStationCoordinate = data.data.startStationCoordinate;
if (startStationCoordinate != null && startStationCoordinate.size()>1){
startStation.lon = startStationCoordinate.get( 0 );
startStation.lat = startStationCoordinate.get( 1 );
startStation.siteId = data.data.startStationId;
startStation.siteName = data.data.startStation;
mCurrentOCHOrder.drivingRoutes.add( startStation );
}
OCHTaxiOrderResponse.OCHTaxiStation endStation = new OCHTaxiOrderResponse.OCHTaxiStation();
endStation.lon = data.data.endStationCoordinate.get( 0 );
endStation.lat = data.data.endStationCoordinate.get( 1 );
endStation.siteId = data.data.endStationId;
endStation.siteName = data.data.endStation;
mCurrentOCHOrder.drivingRoutes.add( endStation );
List< Double > endStationCoordinate = data.data.endStationCoordinate;
if (endStationCoordinate != null && endStationCoordinate.size()>1){
endStation.lon = endStationCoordinate.get( 0 );
endStation.lat = endStationCoordinate.get( 1 );
endStation.siteId = data.data.endStationId;
endStation.siteName = data.data.endStation;
mCurrentOCHOrder.drivingRoutes.add( endStation );
}
cacheOrderInfo2Native( mCurrentOCHOrder );
}

View File

@@ -17,6 +17,8 @@ import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.view.OnPreventFastClickListener;
import com.mogo.och.view.SlidePanelView;
import com.mogo.service.adas.IMogoAdasOCHCallback;
import com.mogo.service.adas.RemoteControlAutoPilotParameters;
import com.mogo.utils.logger.Logger;
/**
* 网约车基础Fragment主要负责布局通用界面处理站点面板和通话面板互斥情况
@@ -32,7 +34,7 @@ public abstract class BaseOchFragment<V extends IView, P extends Presenter<V>> e
protected SlidePanelView slidePanelView;
private CheckedTextView ctvAutopilotStatus;
protected TextView tvOperationStatus;
public boolean isOperationStatus;//false-收车true-出车
public boolean isOperationStatus;//false-收车true-出车
private FrameLayout flStationPanelContainer;
private Group groupTestPanel;
@@ -109,12 +111,28 @@ public abstract class BaseOchFragment<V extends IView, P extends Presenter<V>> e
.mockOchStatus(IMogoAdasOCHCallback.STATUS_AUTOPILOT_RUNNING, "Running")
);
// 模拟 自动驾驶网约车回调数据
// 模拟 自动驾驶
findViewById(R.id.btnAutopilotArrive).setOnClickListener(view ->
MogoApisHandler.getInstance().getApis()
.getAdasControllerApi().mockOchStatus(-1, "Arrived")
);
// 模拟 站点下发工控
findViewById(R.id.btnAutopilotControl).setOnClickListener(view ->
{
RemoteControlAutoPilotParameters currentAutopilot = new RemoteControlAutoPilotParameters();
currentAutopilot.isSpeakVoice = true;
// 万集东门站
currentAutopilot.startLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat(116.74157277,40.19885549);
// 市政府前街18号
currentAutopilot.endLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat(116.729134342,40.1953113732);
// 订单运营类型 9出租车10小巴
currentAutopilot.vehicleType = 10;
Logger.d(TAG, "模拟 订单站点下发:" + currentAutopilot);
MogoApisHandler.getInstance().getApis().getAdasControllerApi().aiCloudToAdasData(currentAutopilot);
}
);
tvOperationStatus.setOnClickListener(view -> {
onChangeOperationStatus();
});
@@ -185,14 +203,14 @@ public abstract class BaseOchFragment<V extends IView, P extends Presenter<V>> e
});
}
public void hidPanel(){
getActivity().runOnUiThread(()->{
public void hidPanel() {
getActivity().runOnUiThread(() -> {
flStationPanelContainer.setVisibility(View.GONE);
});
}
public void showPanel(){
getActivity().runOnUiThread(()->{
public void showPanel() {
getActivity().runOnUiThread(() -> {
flStationPanelContainer.setVisibility(View.VISIBLE);
});
}

View File

@@ -50,6 +50,7 @@ public class SlidePanelView extends View {
NORMAL_TEXT_MARGIN_RIGHT = (int) mTypedArray.getDimension(R.styleable.SlidePanelView_NORMAL_TEXT_MARGIN_RIGHT, NORMAL_TEXT_MARGIN_RIGHT);
SHORT_TEXT_MARGIN_LEFT = (int) mTypedArray.getDimension(R.styleable.SlidePanelView_SHORT_TEXT_MARGIN_LEFT, SHORT_TEXT_MARGIN_LEFT);
SHORT_TEXT_MARGIN_RIGHT = (int) mTypedArray.getDimension(R.styleable.SlidePanelView_SHORT_TEXT_MARGIN_RIGHT, SHORT_TEXT_MARGIN_RIGHT);
SLIDEPANELVIEW_VIEW_HIGH = (int) mTypedArray.getDimension(R.styleable.SlidePanelView_SLIDEPANELVIEW_VIEW_HIGH, SLIDEPANELVIEW_VIEW_HIGH);
init();
}
@@ -64,6 +65,7 @@ public class SlidePanelView extends View {
private static int NORMAL_TEXT_MARGIN_RIGHT = 60;
private static int SHORT_TEXT_MARGIN_LEFT = 60;
private static int SHORT_TEXT_MARGIN_RIGHT = 70;
private static int SLIDEPANELVIEW_VIEW_HIGH = 160;
private int textMarginLeft = NORMAL_TEXT_MARGIN_LEFT;
private int textMarginRight = NORMAL_TEXT_MARGIN_RIGHT;
@@ -148,7 +150,8 @@ public class SlidePanelView extends View {
// 高度根据图片大小和上下间隔确定
textPaint.getTextBounds(blockText, 0, blockText.length(), textRect);
widthSize = BLOCK_START_X * 2 + bmBlock.getWidth() + textMarginLeft + textMarginRight + textRect.width();
heightSize = BLOCK_START_Y * 2 + bmBlock.getHeight();
// heightSize = BLOCK_START_Y * 2 + bmBlock.getHeight();
heightSize = SLIDEPANELVIEW_VIEW_HIGH;
widthMeasureSpec = MeasureSpec.makeMeasureSpec(widthSize, widthMode);
heightMeasureSpec = MeasureSpec.makeMeasureSpec(heightSize, heightMode);
}
@@ -245,7 +248,7 @@ public class SlidePanelView extends View {
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// 画背景
canvas.drawRoundRect(bgRectF, (float) getHeight() / 2, (float) getHeight() / 2, bgPaint);
canvas.drawRoundRect(bgRectF, (float) getHeight() / 2, SLIDEPANELVIEW_VIEW_HIGH / 2, bgPaint);
// 画文字
gradientMatrix.setTranslate(matrixTranslate, 0);
textGradient.setLocalMatrix(gradientMatrix);

View File

@@ -76,9 +76,8 @@
android:id="@+id/btnAutopilotDisable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#f00"
android:text="Disable"
android:textSize="30sp"
android:text="模拟 不可自动驾驶"
android:textSize="20sp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -86,9 +85,8 @@
android:id="@+id/btnAutopilotEnable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#0f0"
android:text="Enable"
android:textSize="30sp"
android:text="模拟 中途人工干预"
android:textSize="20sp"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotDisable" />
@@ -96,9 +94,8 @@
android:id="@+id/btnAutopilotRunning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00f"
android:text="Running"
android:textSize="30sp"
android:text="模拟 自动驾驶途中"
android:textSize="20sp"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotEnable" />
@@ -106,18 +103,26 @@
android:id="@+id/btnAutopilotArrive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#f00"
android:text="Arrived"
android:textSize="30sp"
android:text="模拟 自动驾驶到站"
android:textSize="20sp"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotRunning" />
<Button
android:id="@+id/btnAutopilotControl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="模拟 站点下发工控"
android:textSize="20sp"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotArrive" />
<androidx.constraintlayout.widget.Group
android:id="@+id/groupTestPanel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="btnAutopilotArrive,btnAutopilotDisable,btnAutopilotEnable,btnAutopilotRunning"
app:constraint_referenced_ids="btnAutopilotArrive,btnAutopilotDisable,btnAutopilotEnable,btnAutopilotRunning,btnAutopilotControl"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -6,6 +6,7 @@
<attr name="NORMAL_TEXT_MARGIN_RIGHT" format="dimension" />
<attr name="SHORT_TEXT_MARGIN_LEFT" format="dimension" />
<attr name="SHORT_TEXT_MARGIN_RIGHT" format="dimension" />
<attr name="SLIDEPANELVIEW_VIEW_HIGH" format="dimension" />
<attr name="BLOCK_START_X" format="dimension" />
<attr name="BLOCK_START_Y" format="dimension" />
</declare-styleable>

View File

@@ -148,7 +148,7 @@ MOGO_OCH_TAXI_VERSION=1.0.0
######## 外部依赖引用
# 车聊聊
CARCHATTING_VERSION=2.2.327
CARCHATTING_VERSION=2.2.330
# 车聊聊接口
CARCHATTINGPROVIDER_VERSION=1.1.11
# websocket
@@ -187,4 +187,4 @@ applicationId=com.mogo.launcer
applicationName=IntelligentPilot
versionCode=80007
versionName=8.0.7
MAP_SDK_VERSION=1.0.0-vr-8.5.51
MAP_SDK_VERSION=1.0.0-vr-8.5.52

View File

@@ -285,7 +285,7 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
tvEvent.setText(EventTypeUtils.getPoiTypeStrVr(mNoveltyInfo.getPoiType()));
if (V2XPoiTypeEnum.FOURS_FOG.equals(mNoveltyInfo.getPoiType())) {
V2XServiceManager.getDisplayEffectsManager().displayEffects(V2XPoiTypeEnum.FOURS_FOG);
// MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(ALERT_THE_FRONT_CRASH_WARNING_TOP, MogoReceiver.ACTION_V2X_FRONT_WARNING);
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(ALERT_THE_FRONT_CRASH_WARNING_TOP, MogoReceiver.ACTION_V2X_FRONT_WARNING);
}
tvEventAddress.setText(mNoveltyInfo.getAddr());
tvEventDistance.setText("距离 " + (int) mNoveltyInfo.getDistance() + "");

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#000000" />
<solid android:color="#88000000" />
<corners android:radius="@dimen/module_v2x_road_event_bg_radius" />
</shape>

View File

@@ -5,7 +5,6 @@
android:layout_width="@dimen/module_v2x_fault_help_width"
android:layout_height="@dimen/module_v2x_fault_help_height"
android:layout_marginTop="@dimen/dp_8"
android:alpha="0.7"
android:background="@drawable/bg_v2x_event_bg"
tools:layout_height="wrap_content">

View File

@@ -8,7 +8,6 @@
android:layout_width="@dimen/module_v2x_car_for_help_width"
android:layout_height="@dimen/module_v2x_car_for_help_height"
android:layout_marginTop="@dimen/dp_8"
android:alpha="0.7"
android:background="@drawable/bg_v2x_event_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@@ -329,6 +329,7 @@ public class MogoADASController implements IMogoADASController {
return;
}
}
// TODO 以前这里是考虑ADAS独立应用现在集成ADAS-SDK到程序内了这个判断不需要了
// if (SingletonsHolder.get(IMogoStatusManager.class).isVrMode()) {
// return;
// }