Merge branch 'dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0' into 'dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0'

Dev robobus m1 p app module 1.0.0 230112 1.0.0

See merge request zhjt/AndroidApp/MoGoEagleEye!631
This commit is contained in:
wangmingjun
2023-02-28 10:12:17 +00:00
9 changed files with 251 additions and 78 deletions

View File

@@ -28,21 +28,21 @@ class PM2BaseFragment :
override fun initViews() {
//横竖屏
setScreenDirection()
// setScreenDirection()
//隐藏小地图
initFragment()
}
private fun setScreenDirection() {
var ro = Settings.System.getInt(context?.contentResolver,
Settings.System.USER_ROTATION,Surface.ROTATION_270)
if (ro != Surface.ROTATION_270){
ro = Surface.ROTATION_270
}
Settings.System.putInt(context?.contentResolver,
Settings.System.USER_ROTATION,ro)
}
// private fun setScreenDirection() {
// var ro = Settings.System.getInt(context?.contentResolver,
// Settings.System.USER_ROTATION,Surface.ROTATION_270)
// if (ro != Surface.ROTATION_270){
// ro = Surface.ROTATION_270
// }
// Settings.System.putInt(context?.contentResolver,
// Settings.System.USER_ROTATION,ro)
// }
/**
* 初始化行程信息,高静地图,宣传 三个fragment

View File

@@ -105,7 +105,7 @@ class AdvancePagerAdapter(context: Context, viewPager: ViewPager) : PagerAdapter
pause = false
if (viewList.size > 0 && viewList[mViewPager.currentItem] is AdvanceVideoView) {
val videoView = viewList[mViewPager.currentItem] as AdvanceVideoView
videoView.setRestart()
videoView.setResume()
}
}

View File

@@ -184,9 +184,9 @@ class AdvanceVideoView @JvmOverloads constructor(
}
}
fun setRestart() {
fun setResume() {
if (videoViewPlayer !== null) {
videoViewPlayer?.startPlayLogic()
videoViewPlayer?.onVideoResume()
}
}

View File

@@ -117,14 +117,17 @@
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
android:textColor="@color/m2_line_during_tv_color"/>
<androidx.appcompat.widget.AppCompatTextView
<com.mogo.och.common.module.wigets.MarqueeTextView
android:id="@+id/station_name_tv"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textStyle="bold"
android:singleLine="true"
android:ellipsize="marquee"
android:text="@string/m2_p_empty_tv"
android:textSize="@dimen/dp_22"
android:layout_marginTop="@dimen/dp_8"
app:layout_constraintRight_toRightOf="@+id/img_line_location_bg"
app:layout_constraintTop_toBottomOf="@+id/station_name_title_tv"
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
android:textColor="@color/m2_no_line_tv_color"/>
@@ -171,13 +174,17 @@
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
android:textColor="@color/m2_no_line_tv_color"/>
<androidx.appcompat.widget.AppCompatTextView
<com.mogo.och.common.module.wigets.MarqueeTextView
android:id="@+id/line_name_tv"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textStyle="bold"
android:singleLine="true"
android:marqueeRepeatLimit="marquee_forever"
android:ellipsize="marquee"
android:layout_marginTop="@dimen/dp_16"
android:textSize="@dimen/dp_22"
app:layout_constraintRight_toRightOf="@+id/img_line_location_bg"
app:layout_constraintTop_toTopOf="@+id/img_time_bg"
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
android:textColor="@color/m2_line_name_tv_color"/>

View File

@@ -478,22 +478,24 @@ Object readFileToJson(env){
return null
}
def variantName() {
if(gradle.startParameter.taskNames.size()>0) {
def taskName = gradle.startParameter.taskNames[0]
taskName = taskName.replace("Debug","")
taskName = taskName.replace("Release","")
if (taskName.endsWith("Qa")) {
return "qa"
} else if (taskName.endsWith("Online")) {
return "online"
} else if (taskName.endsWith("Demo")) {
return "demo"
} else {
return "qa"
for (String taskName : gradle.startParameter.taskNames) {
if (taskName.startsWith("assemble")) {
taskName = taskName.replace("Debug","")
taskName = taskName.replace("Release","")
if (taskName.endsWith("Qa")) {
return "qa"
} else if (taskName.endsWith("Online")) {
return "online"
} else if (taskName.endsWith("Demo")) {
return "demo"
}
}
}
}else {
return "qa"
}
return "qa"
}

View File

@@ -1129,6 +1129,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
}
}, "1234567");*/
}
options.setUnableLaunchAutopilotGear(BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_TAXI);
AdasManager.getInstance().create(options, this);
AdasManager.getInstance().setOnAdasListener(this);
/*两端数据转发 注释掉

View File

@@ -13,6 +13,8 @@ import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
@@ -41,6 +43,7 @@ import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityMan
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
@@ -64,11 +67,16 @@ public class VersionFragment extends BaseFragment {
private CheckBox unregistered_check_all;
private TextView hint_registered;
private TextView hint_unregistered;
private TextView can;
private TextView gear_influence;
private TextView gear;
private TextView title_gear;
private RadioButton rb_taxi;
private RadioGroup rg;
private ConfigAdapter adapter;
private InterfaceAdapter unregisteredAdapter;
private InterfaceAdapter registeredAdapter;
private Set[] unableGears;
private int role = Constants.TERMINAL_ROLE.DEBUG;//角色 默认调试屏
@@ -134,6 +142,12 @@ public class VersionFragment extends BaseFragment {
Button btn2 = view.findViewById(R.id.btn2);
ipsView = view.findViewById(R.id.ips_view);
recyclerView = view.findViewById(R.id.config_list);
rb_taxi = view.findViewById(R.id.rb_taxi);
can = view.findViewById(R.id.can);
gear_influence = view.findViewById(R.id.gear_influence);
gear = view.findViewById(R.id.gear);
title_gear = view.findViewById(R.id.title_gear);
rg = view.findViewById(R.id.rg);
initFragmentRecyclerView();
CupidLogUtils.w("InfoFragment===>" + title);
tvTitle.setText(title);
@@ -176,7 +190,36 @@ public class VersionFragment extends BaseFragment {
view.findViewById(R.id.line1).setVisibility(View.GONE);
tvTitle.setText("版本");
}
rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
if (checkedId == R.id.rb_taxi) {
AutopilotAbilityManager.getInstance().setUnableLaunchAutopilotGear(BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_TAXI);
gear("TAXI", Arrays.toString(BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_TAXI.toArray()));
} else if (checkedId == R.id.rb_bus) {
AutopilotAbilityManager.getInstance().setUnableLaunchAutopilotGear(BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_BUS);
gear("BUS", Arrays.toString(BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_BUS.toArray()));
} else if (checkedId == R.id.rb_sweeper) {
AutopilotAbilityManager.getInstance().setUnableLaunchAutopilotGear(BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_SWEEPER);
gear("SWEEPER", Arrays.toString(BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_SWEEPER.toArray()));
} else if (checkedId == R.id.rb_m1) {
AutopilotAbilityManager.getInstance().setUnableLaunchAutopilotGear(BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_M1);
gear("M1", "无限制");
} else if (checkedId == R.id.rb_m2) {
AutopilotAbilityManager.getInstance().setUnableLaunchAutopilotGear(BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_M2);
gear("M1", Arrays.toString(BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_M2.toArray()));
} else if (checkedId == R.id.rb_van) {
AutopilotAbilityManager.getInstance().setUnableLaunchAutopilotGear(BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_VAN);
gear("VAN", "无限制");
}
}
});
gear("TAXI", Arrays.toString(BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_TAXI.toArray()));
}
private void gear(String car, String gear) {
title_gear.setText(car + "不能启动自动驾驶的档位:");
this.gear.setText(gear);
}
//根据连接状态更新数据
@@ -218,59 +261,37 @@ public class VersionFragment extends BaseFragment {
list.add(new Config("ADAS LIB版本:", AdasManager.getInstance().getAdasVersion()));
list.add(new Config("APP构建时间:", BuildConfig.BUILD_TIME));
list.add(getAutopilotAbilityConfig(""));
list.add(gear());
adapter.setData(list);
}
private Config gear() {
private String gear() {
StringBuilder builder = new StringBuilder();
Chassis.GearPosition gear = App.INSTANCE.gear;
if (gear != null) {
if (unableGears == null) {
unableGears = new Set[6];
unableGears[0] = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_BUS;
unableGears[1] = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_M1;
unableGears[2] = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_M2;
unableGears[3] = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_SWEEPER;
unableGears[4] = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_TAXI;
unableGears[5] = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_VAN;
}
for (int j = 0; j < unableGears.length; j++) {
String type = "";
if (j == 0) {
type = "BUS";
} else if (j == 1) {
type = "M1";
} else if (j == 2) {
type = "M2";
} else if (j == 3) {
type = "SWEEPER";
} else if (j == 4) {
type = "TAXI";
} else if (j == 5) {
type = "VAN";
}
AutopilotAbilityManager.getInstance().setUnableLaunchAutopilotGear(unableGears[j]);
boolean b = AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear);
builder.append("车型:").append(type);
builder.append(" 当前档位:").append(gear.name());
builder.append(" 是否可以启动自驾:").append(b).append('\n');
}
boolean b = AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear);
builder.append(" 当前档位:").append(gear.name());
builder.append(" 是否可以启动自驾:").append(b);
}
return new Config("档位影响:", builder.toString());
return builder.toString();
}
private Config getAutopilotAbilityConfig(String value) {
return new Config("能否启动自动驾驶:", value);
private String getAutopilotAbilityConfig(String value) {
return value;
}
public void autopilotAbility(boolean isAutopilotAbility, String unableAutopilotReason) {
List<Config> list = adapter.getData();
if (list != null) {
updateRefreshConfig(list, getAutopilotAbilityConfig(isAutopilotAbility + ",原因:" + unableAutopilotReason));
updateRefreshConfig(list, gear());
}
if (getActivity() != null)
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
can.setTextColor(getResources().getColor(RandomColor.randomColor()));
can.setText(getAutopilotAbilityConfig(isAutopilotAbility + ",原因:" + unableAutopilotReason));
gear_influence.setTextColor(getResources().getColor(RandomColor.randomColor()));
gear_influence.setText(gear());
}
});
}
private void updateRefreshConfig(List<Config> list, Config temp) {

View File

@@ -33,12 +33,155 @@
android:layout_margin="20dp"
android:orientation="horizontal">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/config_list"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
android:layout_weight="1">
<LinearLayout
android:id="@+id/layout_gear_influence"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="档位影响:"
android:textStyle="bold" />
<TextView
android:id="@+id/gear_influence"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_gear"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="@id/layout_gear_influence"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/title_gear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="车型档位:"
android:textStyle="bold" />
<TextView
android:id="@+id/gear"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_can"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="@id/layout_gear"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="能否启动自动驾驶:"
android:textStyle="bold" />
<TextView
android:id="@+id/can"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_car"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="@id/layout_can"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/car_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="当前车型:"
android:textStyle="bold" />
<RadioGroup
android:id="@+id/rg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/car_type"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rb_taxi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="TAXI" />
<RadioButton
android:id="@+id/rb_bus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BUS" />
<RadioButton
android:id="@+id/rb_sweeper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SWEEPER" />
<RadioButton
android:id="@+id/rb_m1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="M1" />
<RadioButton
android:id="@+id/rb_m2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="M2" />
<RadioButton
android:id="@+id/rb_van"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="VAN" />
</RadioGroup>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/config_list"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/layout_car"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:id="@+id/line1"

View File

@@ -3,7 +3,6 @@ package com.zhidao.support.adas.high.common.autopilot.ability;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.support.adas.high.OnAdasListener;
@@ -88,7 +87,7 @@ public class AutopilotAbilityManager {
if (version != -1) {
stopTimer();
dockerVersion = version;
Log.i("dddd", "工控机版本=" + dockerVersion);
CupidLogUtils.i(TAG, "工控机版本=" + dockerVersion);
initAutopilotAbility();
}
}