New file |
| | |
| | | [ |
| | | { |
| | | "item_id":1, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "不按规定使用安全带", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":2, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "遮挡、关闭车内音视频监控设备", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":3, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "不按考试员指令驾驶", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":4, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "启动发动机时档位未置于空挡(驻车档)", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":5, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "起步时车辆后溜距离大于30cm", |
| | | "score_deducting":100, |
| | | "required_precision":"距离检测误差:0mm~50mm" |
| | | }, |
| | | { |
| | | "item_id":6, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "使用挡位与车速长时间不匹配,造成车辆发动机转速过高或过低", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":7, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "车辆在行驶中连续2次挂挡不进", |
| | | "score_deducting":100, |
| | | "required_precision":"5s内两次挂同一挡位未成功" |
| | | }, |
| | | { |
| | | "item_id":8, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "行驶中空挡滑行", |
| | | "score_deducting":100, |
| | | "required_precision":"时间大于5s" |
| | | }, |
| | | { |
| | | "item_id":9, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "不按交通信号灯、标志、标线信号行驶", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":10, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "不按规定速度行驶", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":11, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "车辆行驶中骑轧车道中心实线或者车道边缘实线", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":12, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "长时间骑轧车道分界线行驶", |
| | | "score_deducting":100, |
| | | "required_precision":"时间大于10s" |
| | | }, |
| | | { |
| | | "item_id":13, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "起步、转向、变更车道、超车、靠边停车前不使用或错误使用转向灯", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":14, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "起步、转向、变更车道、超车、靠边停车前,开转 向灯少于3 s即转向", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":15, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "连续变更两条或两条以上车道", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":16, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "将车辆停在人行横道、网状线内等禁止停车区域", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":17, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "因观察、判断或者操作不当出现危险情况", |
| | | "score_deducting":100, |
| | | "required_precision":"副制动踏板踩下后" |
| | | }, |
| | | { |
| | | "item_id":18, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "起步时车辆后溜,但后溜距离小于30cm", |
| | | "score_deducting":10, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":19, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "起步或行驶中挂错挡", |
| | | "score_deducting":10, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":20, |
| | | "item_content": "通用要求", |
| | | "deducting_reason": "因操作不当造成发动机熄火一次", |
| | | "score_deducting":10, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":21, |
| | | "item_content": "上车准备", |
| | | "deducting_reason": "未逆时针绕车一周检查车辆外观及周围环境", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":22, |
| | | "item_content": "起步", |
| | | "deducting_reason": "制动气压不足起步", |
| | | "score_deducting":100, |
| | | "required_precision":"仅适用于采用气动制动器的车型" |
| | | }, |
| | | { |
| | | "item_id":23, |
| | | "item_content": "起步", |
| | | "deducting_reason": "车门未完全关闭起步", |
| | | "score_deducting":100, |
| | | "required_precision":"行驶距离大于 1m 时,车门未完 全关闭" |
| | | }, |
| | | { |
| | | "item_id":24, |
| | | "item_content": "起步", |
| | | "deducting_reason": "启动发动机时,挡位未置于空挡(驻车挡)", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":25, |
| | | "item_content": "起步", |
| | | "deducting_reason": "不松驻车制动器起步,未及时纠正", |
| | | "score_deducting":100, |
| | | "required_precision":"行驶距离大于 10 m" |
| | | }, |
| | | |
| | | { |
| | | "item_id":26, |
| | | "item_content": "起步", |
| | | "deducting_reason": "不松驻车制动器起步,但能及时纠正", |
| | | "score_deducting":10, |
| | | "required_precision":"行驶距离为 1 m~10 m" |
| | | }, |
| | | { |
| | | "item_id":27, |
| | | "item_content": "起步", |
| | | "deducting_reason": "发动机启动后,不及时松开启动开关", |
| | | "score_deducting":10, |
| | | "required_precision":"距离检测误差:0mm~+50mn" |
| | | }, |
| | | { |
| | | "item_id":28, |
| | | "item_content": "起步", |
| | | "deducting_reason": "起步时车辆发生闯动", |
| | | "score_deducting":5, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":29, |
| | | "item_content": "起步", |
| | | "deducting_reason": "起步时,加速踏板控制不当,致使发动机转速过高", |
| | | "score_deducting":5, |
| | | "required_precision":"根据考试车型设定(大于 2500rpm)" |
| | | } , |
| | | { |
| | | "item_id":30, |
| | | "item_content": "直线行驶", |
| | | "deducting_reason": "方向控制不稳,不能保持车辆直线运行", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":31, |
| | | "item_content": "加减挡位操作", |
| | | "deducting_reason": "未按指令平稳加、减挡", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":32, |
| | | "item_content": "加减挡位操作", |
| | | "deducting_reason": "车辆运行速度和挡位不匹配", |
| | | "score_deducting":10, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":33, |
| | | "item_content": "靠边停车", |
| | | "deducting_reason": "考试员发出靠边停车指令后,未能在规定的距离内停车", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":34, |
| | | "item_content": "靠边停车", |
| | | "deducting_reason": "停车后,车身超过道路右侧边缘线或者人行道边缘", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":35, |
| | | "item_content": "靠边停车", |
| | | "deducting_reason": "下车后不关闭车门", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":36, |
| | | "item_content": "靠边停车", |
| | | "deducting_reason": "停车后,车身距离道路右侧边缘线或者人行道边缘超出50cm", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":37, |
| | | "item_content": "靠边停车", |
| | | "deducting_reason": "停车后,车身距离道路右侧边缘线或者人行道边缘超出30cm,未超出50cm", |
| | | "score_deducting":10, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":38, |
| | | "item_content": "靠边停车", |
| | | "deducting_reason": "停车后,未拉紧驻车制动器", |
| | | "score_deducting":10, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":39, |
| | | "item_content": "靠边停车", |
| | | "deducting_reason": "拉紧驻车制动器前放松行车制动踏板", |
| | | "score_deducting":10, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":40, |
| | | "item_content": "靠边停车", |
| | | "deducting_reason": "下车前不将发动机熄火", |
| | | "score_deducting":5, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":41, |
| | | "item_content": "直行通过路口", |
| | | "deducting_reason": "不按规定减速", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":42, |
| | | "item_content": "直行通过路口", |
| | | "deducting_reason": "不按规定停车瞭望", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":43, |
| | | "item_content": "路口左转弯", |
| | | "deducting_reason": "不按规定减速", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":44, |
| | | "item_content": "路口左转弯", |
| | | "deducting_reason": "不按规定停车瞭望", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":45, |
| | | "item_content": "路口左转弯", |
| | | "deducting_reason": "左转通过路口时,未靠路口中心点左侧转弯", |
| | | "score_deducting":10, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":46, |
| | | "item_content": "路口右转弯", |
| | | "deducting_reason": "不按规定减速", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":47, |
| | | "item_content": "路口右转弯", |
| | | "deducting_reason": "不按规定停车瞭望", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":48, |
| | | "item_content": "通过人行道横线", |
| | | "deducting_reason": "不按规定减速慢行", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":49, |
| | | "item_content": "通过学校区域", |
| | | "deducting_reason": "不按规定减速慢行", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":50, |
| | | "item_content": "通过公共汽车站", |
| | | "deducting_reason": "不按规定减速慢行", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":51, |
| | | "item_content": "掉头", |
| | | "deducting_reason": "掉头前未开启左转向灯", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":52, |
| | | "item_content": "夜间行驶", |
| | | "deducting_reason": "不能正确开启灯光", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":53, |
| | | "item_content": "夜间行驶", |
| | | "deducting_reason": "通过急弯、坡路、拱桥、人行横道或者没有交通信号灯控制的路口时,不交替使用远、近光灯示意", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":54, |
| | | "item_content": "夜间行驶", |
| | | "deducting_reason": "通过路口时使用远光灯", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":55, |
| | | "item_content": "夜间行驶", |
| | | "deducting_reason": "在有路灯、照明良好的道路上行驶时,使用远光灯", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":56, |
| | | "item_content": "夜间行驶", |
| | | "deducting_reason": "在路边临时停车不关闭前照灯或不开启示廓灯", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":57, |
| | | "item_content": "夜间行驶", |
| | | "deducting_reason": "进入无照明道路行驶时不使用远光灯", |
| | | "score_deducting":5, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":58, |
| | | "item_content": "模拟夜间灯光使用(语音模拟)", |
| | | "deducting_reason": "不能正确开启灯光", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":59, |
| | | "item_content": "模拟夜间灯光使用(语音模拟)", |
| | | "deducting_reason": "同方向近距离跟车行驶时,使用远光灯", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":60, |
| | | "item_content": "模拟夜间灯光使用(语音模拟)", |
| | | "deducting_reason": "通过急弯、坡路、拱桥、人行横道或者没有交通信号灯控制的路口时,不交替使用远、近光灯示意", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":61, |
| | | "item_content": "模拟夜间灯光使用(语音模拟)", |
| | | "deducting_reason": "会车时不按规定使用近光灯", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":62, |
| | | "item_content": "模拟夜间灯光使用(语音模拟)", |
| | | "deducting_reason": "通过路口时使用远光灯", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":63, |
| | | "item_content": "模拟夜间灯光使用(语音模拟)", |
| | | "deducting_reason": "超车时未交替使用远近光灯提醒被超越车辆", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":64, |
| | | "item_content": "模拟夜间灯光使用(语音模拟)", |
| | | "deducting_reason": "在有路灯、照明良好的道路上行驶时,使用远光灯", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":65, |
| | | "item_content": "模拟夜间灯光使用(语音模拟)", |
| | | "deducting_reason": "在路边临时停车不关闭前照灯或不开启示廓灯", |
| | | "score_deducting":100, |
| | | "required_precision":"" |
| | | }, |
| | | { |
| | | "item_id":66, |
| | | "item_content": "模拟夜间灯光使用(语音模拟)", |
| | | "deducting_reason": "进入无照明、照明不良的道路行驶时不使用远光灯", |
| | | "score_deducting":5, |
| | | "required_precision":"" |
| | | } |
| | | ] |
| | |
| | | public class Constant { |
| | | public static final String CRITERIAFOR_I_JSON = "criteria_I.json"; |
| | | public static final String CRITERIAFOR_II_JSON = "criteria_II.json"; |
| | | public static final String CRITERIAFOR_III_JSON = "criteria_III.json"; |
| | | public static final String RTK_CONFIG_UPDATE_JSON = "RTK_CONFIG_UPDATE_JSON"; |
| | | public static final String RTK_CONFIG_PHONE = "RTK_CONFIG_PHONE"; |
| | | public static final String RTK_CONFIG_IMEI = "RTK_CONFIG_IMEI"; |
| | |
| | | import safeluck.drive.evaluation.DB.appstatusdb.AppStatusInitWork; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaForI; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaForII; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaForIII; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaForIIIWorker; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaForIIWorker; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaForIWorker; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaIDao; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaIIDao; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaIIIDao; |
| | | import safeluck.drive.evaluation.DB.exam_status.ExamStatus; |
| | | import safeluck.drive.evaluation.DB.exam_status.ExamStatusDao; |
| | | import safeluck.drive.evaluation.DB.exam_status.ExamStatusInitWorker; |
| | |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | @Database(entities = {Student.class, CriteriaForI.class, FailedProj.class, CriteriaForII.class, RTKConfig.class, GPSInfo.class, AppStatus.class, ExamStatus.class, SingalConfig.class},version = 1,exportSchema = false) |
| | | @Database(entities = {Student.class, CriteriaForI.class, FailedProj.class, CriteriaForII.class, CriteriaForIII.class,RTKConfig.class, GPSInfo.class, AppStatus.class, ExamStatus.class, SingalConfig.class},version = 1,exportSchema = false) |
| | | public abstract class WorkRoomDataBase extends RoomDatabase { |
| | | private static final String TAG = "WorkRoomDataBase"; |
| | | public abstract StudentDao getstudentDao(); |
| | |
| | | OneTimeWorkRequest oneTimeWorkRequest = OneTimeWorkRequest.from(SeedDatabaseWorker.class); |
| | | OneTimeWorkRequest oneTimeWorkRequest1 = OneTimeWorkRequest.from(CriteriaForIWorker.class); |
| | | OneTimeWorkRequest oneTimeWorkRequest3 = OneTimeWorkRequest.from(CriteriaForIIWorker.class); |
| | | OneTimeWorkRequest mCriteriaForIIIWorker= OneTimeWorkRequest.from(CriteriaForIIIWorker.class); |
| | | OneTimeWorkRequest oneTimeWorkRequest2 = OneTimeWorkRequest.from(FailedProjWorker.class); |
| | | OneTimeWorkRequest RTKConfigWorkRequest = OneTimeWorkRequest.from(RTKConfigWork.class); |
| | | OneTimeWorkRequest appStatusInitWork = OneTimeWorkRequest.from(AppStatusInitWork.class); |
| | |
| | | WorkManager.getInstance(mContext).enqueue(oneTimeWorkRequest1); |
| | | WorkManager.getInstance(mContext).enqueue(oneTimeWorkRequest2); |
| | | WorkManager.getInstance(mContext).enqueue(oneTimeWorkRequest3); |
| | | WorkManager.getInstance(mContext).enqueue(mCriteriaForIIIWorker); |
| | | WorkManager.getInstance(mContext).enqueue(RTKConfigWorkRequest); |
| | | WorkManager.getInstance(mContext).enqueue(appStatusInitWork); |
| | | WorkManager.getInstance(mContext).enqueue(examStatusInitWorker); |
| | |
| | | public abstract ExamStatusDao getExamStatusDao(); |
| | | |
| | | public abstract SignalConfigDao getSignalConfigDao(); |
| | | |
| | | /** |
| | | * 获取科目三评判表的 Dao |
| | | * |
| | | * @return |
| | | */ |
| | | public abstract CriteriaIIIDao getCriteriaIIIDao(); |
| | | } |
New file |
| | |
| | | package safeluck.drive.evaluation.DB.criterias; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.room.ColumnInfo; |
| | | import androidx.room.Entity; |
| | | import androidx.room.PrimaryKey; |
| | | |
| | | /** |
| | | * MyApplication2 |
| | | * Created by lzw on 2019/11/26. 10:15:55 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | * |
| | | * 科目二 II类考场评判标准表 |
| | | */ |
| | | @Entity(tableName = "criteria_three") |
| | | public class CriteriaForIII { |
| | | /************** |
| | | * item_id item_content deducting_reason score_deducting required _precision |
| | | 23 起步 车门未完全关闭起步 不合格 行驶距离大于1m 时 |
| | | **************/ |
| | | @PrimaryKey |
| | | @ColumnInfo(name = "item_id") |
| | | @NonNull |
| | | private int item_id; |
| | | |
| | | @ColumnInfo(name = "item_content") |
| | | private String item_content; |
| | | |
| | | @ColumnInfo(name = "deducting_reason") |
| | | private String deducting_reason; |
| | | |
| | | |
| | | @NonNull @ColumnInfo(name = "score_deducting") |
| | | private int score_deducting; |
| | | |
| | | @ColumnInfo(name = "required_precision") |
| | | private String required_precision; |
| | | |
| | | public int getItem_id() { |
| | | return item_id; |
| | | } |
| | | |
| | | public void setItem_id(int item_id) { |
| | | this.item_id = item_id; |
| | | } |
| | | |
| | | public String getItem_content() { |
| | | return item_content; |
| | | } |
| | | |
| | | public void setItem_content(String item_content) { |
| | | this.item_content = item_content; |
| | | } |
| | | |
| | | public String getDeducting_reason() { |
| | | return deducting_reason; |
| | | } |
| | | |
| | | public void setDeducting_reason(String deducting_reason) { |
| | | this.deducting_reason = deducting_reason; |
| | | } |
| | | |
| | | public int getScore_deducting() { |
| | | return score_deducting; |
| | | } |
| | | |
| | | public void setScore_deducting(int score_deducting) { |
| | | this.score_deducting = score_deducting; |
| | | } |
| | | |
| | | public String getRequired_precision() { |
| | | return required_precision; |
| | | } |
| | | |
| | | public void setRequired_precision(String required_precision) { |
| | | this.required_precision = required_precision; |
| | | } |
| | | } |
New file |
| | |
| | | package safeluck.drive.evaluation.DB.criterias; |
| | | |
| | | import android.content.Context; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.work.Worker; |
| | | import androidx.work.WorkerParameters; |
| | | |
| | | import com.anyun.exam.lib.MyLog; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.google.gson.stream.JsonReader; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.lang.reflect.Type; |
| | | import java.util.List; |
| | | |
| | | import safeluck.drive.evaluation.DB.Constant; |
| | | import safeluck.drive.evaluation.DB.WorkRoomDataBase; |
| | | |
| | | /** |
| | | * MyApplication2 |
| | | * Created by lzw on 2019/11/26. 11:59:25 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public class CriteriaForIIIWorker extends Worker { |
| | | |
| | | private static final String TAG = "CriteriaForIWorker"; |
| | | |
| | | public CriteriaForIIIWorker(@NonNull Context context, @NonNull WorkerParameters workerParams) { |
| | | super(context, workerParams); |
| | | } |
| | | |
| | | @NonNull |
| | | @Override |
| | | public Result doWork() { |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = getApplicationContext().getAssets() |
| | | .open(Constant.CRITERIAFOR_III_JSON); |
| | | InputStreamReader inputStreamReader = new InputStreamReader(inputStream); |
| | | JsonReader jsonReader = new JsonReader(inputStreamReader); |
| | | Gson gson = new Gson(); |
| | | Type type = new TypeToken<List<CriteriaForIII>>(){}.getType(); |
| | | |
| | | List<CriteriaForIII> criteriaForIIS = gson.fromJson(jsonReader,type); |
| | | MyLog.i(TAG,"插入科目三考场评判表"); |
| | | WorkRoomDataBase.getWorkRoomDataBase(getApplicationContext()).getCriteriaIIIDao().insertAllCriteriaIII(criteriaForIIS); |
| | | return Result.success(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return Result.failure(); |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package safeluck.drive.evaluation.DB.criterias; |
| | | |
| | | import androidx.lifecycle.LiveData; |
| | | import androidx.room.Dao; |
| | | import androidx.room.Insert; |
| | | import androidx.room.OnConflictStrategy; |
| | | import androidx.room.Query; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * MyApplication2 |
| | | * Created by lzw on 2019/11/26. 11:12:18 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | @Dao |
| | | public interface CriteriaIIIDao { |
| | | @Insert(onConflict = OnConflictStrategy.IGNORE) |
| | | void insertCriteriaIII(CriteriaForIII criteriaForIII); |
| | | |
| | | @Insert(onConflict = OnConflictStrategy.REPLACE) |
| | | void insertAllCriteriaIII(List<CriteriaForIII> criteriaForIII); |
| | | |
| | | @Query( "SELECT * FROM criteria_three WHERE item_id =:item_id") |
| | | LiveData<CriteriaForIII > queryItemForCriteriaIII(int item_id); |
| | | } |
| | |
| | | //5 - 直角转弯 |
| | | @PrimaryKey |
| | | private int map_id; |
| | | /**侧方位停车 type = 3 |
| | | 技术部 叶怿 15:51:49 |
| | | 倒车入库 type = 1 |
| | | 上坡起步 type = 2 |
| | | zhijiao type = 5*/ |
| | | |
| | | |
| | | |
| | | |
| | | private int map_item; |
| | | |
| | | //0 退出(考试完毕) |
| | | //1 进入(正在进行考试) 2-待考 |
| | |
| | | this.enter = enter; |
| | | } |
| | | |
| | | public int getMap_item() { |
| | | return map_item; |
| | | } |
| | | |
| | | public void setMap_item(int map_item) { |
| | | this.map_item = map_item; |
| | | } |
| | | |
| | | public ExamStatus() { |
| | | } |
| | | |
| | |
| | | import com.anyun.exam.lib.AYSdk; |
| | | import com.anyun.exam.lib.MyLog; |
| | | import com.anyun.exam.lib.util.ByteUtil; |
| | | import com.anyun.exam.lib.util.Speaker; |
| | | import com.anyun.im_lib.listener.IMSConnectStatusCallback; |
| | | import com.google.gson.Gson; |
| | | import com.safeluck.aykj.utils.BytesUtils; |
| | |
| | | requestWindowFeature(Window.FEATURE_NO_TITLE); |
| | | getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); |
| | | setContentView(R.layout.activity_main); |
| | | //初始化tts |
| | | ExamPlatformData.getInstance().initTTS(this); |
| | | // TODO |
| | | // 进行tcp连接 |
| | | final String userId = "100002"; |
| | |
| | | import safeluck.drive.evaluation.platformMessage.JKMessage0101; |
| | | import safeluck.drive.evaluation.platformMessage.JKMessage0203; |
| | | import safeluck.drive.evaluation.platformMessage.JKMessage0206; |
| | | import safeluck.drive.evaluation.util.CThreadPoolExecutor; |
| | | import safeluck.drive.evaluation.util.FileUtil; |
| | | import safeluck.drive.evaluation.util.SPUtils; |
| | | import safeluck.drive.evaluation.util.SystemUtil; |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | String mapPath = ExamPlatformData.getInstance().getMapPath(); |
| | | final String mapPath = ExamPlatformData.getInstance().getMapPath(); |
| | | if (!TextUtils.isEmpty(mapPath)){ |
| | | MyLog.i("调用更新Map路径后的地图"+mapPath); |
| | | byte[] fileContent = FileUtil.readFile(mapPath); |
| | |
| | | AYSdk.getInstance().sendCmd(Constant.PUSH_MAP_INFO,str); |
| | | }else{ |
| | | MyLog.i(String.format("文件:%s不存在",mapPath)); |
| | | |
| | | CThreadPoolExecutor.runOnMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | Toast.makeText(getAppContext(), "文件:"+mapPath+"不存在", Toast.LENGTH_SHORT).show(); |
| | | } |
| | | }); |
| | | } |
| | | }else{ |
| | | MyLog.i("读取Assert目录下初始化的地图"); |
| | | CThreadPoolExecutor.runOnMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | Toast.makeText(getAppContext(), "读取Assert目录下初始化的地图", Toast.LENGTH_SHORT).show(); |
| | | } |
| | | }); |
| | | StringBuffer buffer =FileUtil.readAssetTxtFile(getApplicationContext(),Constant.MAP); |
| | | if (buffer != null){ |
| | | |
| | | AYSdk.getInstance().sendCmd(Constant.PUSH_MAP_INFO,buffer.toString()); |
| | | }else{ |
| | | MyLog.d(TAG,String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName())); |
| | | CThreadPoolExecutor.runOnMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | Toast.makeText(getAppContext(), String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName()), Toast.LENGTH_SHORT).show(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | |
| | | import androidx.work.WorkManager; |
| | | |
| | | import com.anyun.exam.lib.MyLog; |
| | | import com.anyun.exam.lib.util.Speaker; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Random; |
| | |
| | | private int examplatformStatus =1;//1-未连接(tcp连接不上) 3-未注册(设备没有注册) 5-未登录(鉴权未通过) |
| | | |
| | | private String id;//身份证 |
| | | |
| | | private Speaker speaker = null; |
| | | |
| | | private String ip; |
| | | private int port; |
| | |
| | | |
| | | return examPlatformStrs.get(work_platform); |
| | | } |
| | | |
| | | public Speaker getTTS(){ |
| | | if (speaker == null){ |
| | | throw new RuntimeException("请先初始化TTS,先调用initTTS"); |
| | | }else |
| | | return speaker; |
| | | } |
| | | |
| | | /** |
| | | * 初始化tts |
| | | * @param context |
| | | */ |
| | | public void initTTS(Context context){ |
| | | if (speaker == null){ |
| | | |
| | | speaker = new Speaker(context); |
| | | } |
| | | } |
| | | } |
| | |
| | | currTotalScore -=item_id; |
| | | if (currTotalScore < Constant.PASSING_SCORE){ |
| | | MyLog.i(TAG,"低于80,不合格"); |
| | | ExamPlatformData.getInstance().getTTS().speak("考试不合格"); |
| | | stopExam(); |
| | | } |
| | | MyLog.i(TAG,"监测到有失败项目加入,通知UI更新颜色"); |
| | |
| | | jkMessage0202.ID = ExamPlatformData.getInstance().getID(); |
| | | jkMessage0202.exam_id = ExamPlatformData.getInstance().getExam_id(); |
| | | MessageProcessor.getInstance().sendMessage(jkMessage0202); |
| | | ExamPlatformData.getInstance().getTTS().speak("开始考试"); |
| | | break; |
| | | case R.id.tv_stop: |
| | | Toast.makeText(_mActivity, "结束考试", Toast.LENGTH_SHORT).show(); |
| | | stopExam(); |
| | | |
| | | break; |
| | | case R.id.view_map: |
| | | MapFragment mapFragment = findFragment(MapFragment.class); |
| | |
| | | iv_head.getDrawable().setLevel(0); |
| | | OneTimeWorkRequest examStatusInitWork = OneTimeWorkRequest.from(ExamStatusInitWorker.class); |
| | | WorkManager.getInstance(_mActivity).enqueue(examStatusInitWork); |
| | | ExamPlatformData.getInstance().getTTS().speak("结束考试"); |
| | | sendExamJson(0); |
| | | //TODO 发送JKMessage0204给平台 结束考试 |
| | | JKMessage0204 jkMessage0204 = new JKMessage0204(); |