lizhanwei
2020-03-09 936802527687876e44eae026465152680f34881d
加入路考部分东西;加入失败项目语音提示;加入进出某场地语音提示
6个文件已修改
1个文件已添加
142 ■■■■■ 已修改文件
app/src/main/assets/criteria_I.json 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/Constant.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/app.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/bean/ExamPlatformData.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/layout_net_train_iii_item.xml 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/values/strings.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/assets/criteria_I.json
@@ -149,7 +149,7 @@
  {
    "item_id":22,
    "item_content": "侧方停车",
    "deducting_reason": "项目完成时间超过90s",
    "deducting_reason": "项目完成时间超过90秒",
    "score_deducting":100,
    "required_precision":""
  },
@@ -177,7 +177,7 @@
  {
    "item_id":26,
    "item_content": "侧方停车",
    "deducting_reason": "中途停车时间超过2s",
    "deducting_reason": "中途停车时间超过2秒",
    "score_deducting":5,
    "required_precision":""
  },
@@ -191,7 +191,7 @@
  {
    "item_id":28,
    "item_content": "曲线行驶",
    "deducting_reason": "中途停车时间超过2s",
    "deducting_reason": "中途停车时间超过2秒",
    "score_deducting":100,
    "required_precision":""
  },
@@ -212,7 +212,7 @@
  {
    "item_id":31,
    "item_content": "直角转弯",
    "deducting_reason": "中途停车时间超过2s",
    "deducting_reason": "中途停车时间超过2秒",
    "score_deducting":5,
    "required_precision":""
  }
app/src/main/java/safeluck/drive/evaluation/Constant.java
@@ -82,5 +82,6 @@
    public static final int READ_PHYSICAL_ID = 0x8011;//4.    读取IC卡
    public static final String BIND_MCUINFO_TOPIC = "bind_mcu_info_topic";
    public static final String BIND_RTK_SPEED_TOPIC = "BIND_RTK_SPEED_TOPIC";
    public static final int EXIT_CURRENT_ITEM = 0;//退出某场地
    public static String exam_enter_exitdata="exam_enter_exitdata";
}
app/src/main/java/safeluck/drive/evaluation/app.java
@@ -246,6 +246,17 @@
                WorkManager.getInstance(getApplicationContext()).enqueue(gpsinfoWorkRequest);
                break;
            case Constant.ENTER_OR_EXIT_ITEM:
                int type = 0;
                int enter_status = -1;
                try {
                    JSONObject rtkConfigUpdtea = new JSONObject(json);
                    type = rtkConfigUpdtea.getInt("type");
                    enter_status = rtkConfigUpdtea.getInt("enter");
                    String itemstr=ExamPlatformData.getInstance().getItemStatusStr(type);
                    ExamPlatformData.getInstance().getTTS().speak(itemstr+(enter_status==Constant.EXIT_CURRENT_ITEM?"结束":"开始"));
                } catch (JSONException e) {
                    e.printStackTrace();
                }
                Data exam_enter_exitdata = new Data.Builder().putString(Constant.exam_enter_exitdata,json).build();
                OneTimeWorkRequest examStatusWorker = new OneTimeWorkRequest.Builder(ExamStatusWoker.class).setInputData(exam_enter_exitdata).build();
                WorkManager.getInstance(getApplicationContext()).enqueue(examStatusWorker);
app/src/main/java/safeluck/drive/evaluation/bean/ExamPlatformData.java
@@ -34,6 +34,7 @@
    public static final int DEV_NOT_LOGIN = 5;
    public static final int DEV_LOGIN = 6;
    private static HashMap<Integer,String> examPlatformStrs = new HashMap<>();
    private static HashMap<Integer,String> enter_exit_item_tts = new HashMap<>();
    static {
        examPlatformStrs.put(TCP_DISCONNECT,"未连接");
        examPlatformStrs.put(TCP_CONNECTED,"已连接");
@@ -41,6 +42,18 @@
        examPlatformStrs.put(DEV_REGISTERED,"已注册");
        examPlatformStrs.put(DEV_NOT_LOGIN,"未登录");
        examPlatformStrs.put(DEV_LOGIN,"已登录");
/*侧方位停车 type = 3
 倒车入库 type = 1
 上坡起步  type = 2
 zhijiao  type = 5*/
        enter_exit_item_tts.put(1,"倒车入库");
        enter_exit_item_tts.put(2,"坡道定点停车和起步");
        enter_exit_item_tts.put(3,"侧方停车");
        enter_exit_item_tts.put(4,"曲线行驶");
        enter_exit_item_tts.put(5,"直角转弯");
    }
    private static final String WORK_PLATFORM_STATUS = " work_platform";
@@ -166,6 +179,18 @@
        return examPlatformStrs.get(work_platform);
    }
    /**
     * 进入退出某个场地的文字
     * @param item
     * @return
     */
    public String getItemStatusStr(int item) {
        if (item<1 || item>enter_exit_item_tts.size()){
            return "未知项目";
        }
        return enter_exit_item_tts.get(item);
    }
    public Speaker getTTS(){
        if (speaker == null){
            throw new RuntimeException("请先初始化TTS,先调用initTTS");
@@ -183,4 +208,6 @@
            speaker = new Speaker(context);
        }
    }
}
app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java
@@ -249,6 +249,9 @@
            if (hasSnEqulas(failedProj_selects)){
            }else{
                ExamPlatformData.getInstance().getTTS().speak(failedProj_selects.get(i).getDeducting_reason()+(
                        failedProj_selects.get(i).getScore_deducting()==100?"不合格":"扣"+
                        failedProj_selects.get(i).getScore_deducting()+"分"));
                MyLog.i("没有相同的sn,发送");
                sns.add(failedProj_selects.get(i).getSn());
                jkMessage0203.timeBCD = failedProj_selects.get(i).getUtc();
@@ -335,7 +338,7 @@
    private void initView(View view) {
        view.findViewById(R.id.profile).setOnClickListener(this);
        view.findViewById(R.id.iv_head).setOnClickListener(this);
        av_curve = view.findViewById(R.id.av3);
        av_park = view.findViewById(R.id.av2);
        av_podao = view.findViewById(R.id.av1);
@@ -419,7 +422,7 @@
            case R.id.btn_return:
                _mActivity.onBackPressed();
                break;
            case R.id.profile:
            case R.id.iv_head:
                MyLog.i(TAG,"签到,获取身份证物理卡号");
                AYSdk.getInstance().sendCmd(Constant.READ_PHYSICAL_ID,"");
                //TODO 获得物理卡号 发送JKMessage0201给平台,获取姓名、身份证、head_url
app/src/main/res/layout/layout_net_train_iii_item.xml
New file
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="5dp"
    android:gravity="bottom">
    <TableRow android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/simulate_light_night"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/side_by_side"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/over_take"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/school_area"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/bus_area"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/start_vehicle"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/junction_left"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/junction_right"/>
    </TableRow>
    <TableRow android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/crosswalk"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/straight_line"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/pull_over"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/night_driving"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/turn_around"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/add_subtract"/>
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/by_crossing"/>        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="@string/lane_change"/>
    </TableRow>
</TableLayout>
app/src/main/res/values/strings.xml
@@ -35,4 +35,20 @@
    <string name="chesu">车速:</string>
    <string name="engine">转速:</string>
    <string name="platform_status">考试平台:%1$s</string>
    <string name="simulate_light_night">模拟夜间灯光</string>
    <string name="side_by_side">会车</string>
    <string name="over_take">超车</string>
    <string name="school_area">通过学校区域</string>
    <string name="bus_area">通过公共汽车站</string>
    <string name="start_vehicle">起步</string>
    <string name="junction_left">路口左转弯</string>
    <string name="junction_right">路口右转弯</string>
    <string name="crosswalk">通过人行横道</string>
    <string name="straight_line">直线行驶</string>
    <string name="pull_over">靠边停车</string>
    <string name="night_driving">夜间行驶</string>
    <string name="turn_around">掉头</string>
    <string name="add_subtract">加减档</string>
    <string name="by_crossing">通过路口</string>
    <string name="lane_change">变更车道</string>
</resources>