| | |
| | | public static final String BIND_RTK_SPEED_TOPIC = "BIND_RTK_SPEED_TOPIC"; |
| | | public static final int EXIT_CURRENT_ITEM = 0;//退出某场地 |
| | | public static final String RTK_INFO_SAT_QF = "RTK_INFO_SAT_QF";//从RTK info中获取的卫星颗数和qf 组成的json |
| | | public static final int SUBJECT_III = 3;//路考 |
| | | public static String exam_enter_exitdata="exam_enter_exitdata"; |
| | | public static int Chang_di = 2; |
| | | public static int DaoLu_night = 3; |
| | |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | * |
| | | * 科目二 II类考场评判标准表 |
| | | * 路考类考场评判标准表 |
| | | */ |
| | | @Entity(tableName = "criteria_three") |
| | | public class CriteriaForIII { |
| | |
| | | val TAG:String = "ExamStatusOutWorker" |
| | | private var signalConfiglist: MutableList<SignalConfigRemote> = ArrayList() |
| | | private val gson = Gson() |
| | | lateinit var simulateNightBean:SimulateNightBean |
| | | var simulateNightBean:SimulateNightBean=SimulateNightBean() |
| | | private var singalConfigs :List<SingalConfig> = ArrayList() |
| | | private val tempQs: MutableList<QuestionBean> = java.util.ArrayList() |
| | | override fun doWork(): Result { |
| | | val examType =WorkRoomDataBase.getWorkRoomDataBase(applicationContext).examStatusDao.startExamInt; |
| | | |
| | | simulateNightBean = SimulateNightBean() |
| | | simulateNightBean.setExam(0) |
| | | |
| | | val list = ExamPlatformData.getInstance().simulate_light_tips |
| | | simulateNightBean.setQuestion(list.subList(list.size - 2, list.size - 1)) |
| | | |
| | | |
| | | |
| | | |
| | | tempQs.add(list[list.size-2])//提示下面将进行灯光考试 |
| | | tempQs.add(list[0]) |
| | | val a = Utils.getRandomInts(4, 12) |
| | | for (i in a.indices) { |
| | | tempQs.add(list[a[i]]) |
| | | } |
| | | |
| | | tempQs.add(list[list.size-1])//提示灯光考试结束 |
| | | simulateNightBean.setQuestion(tempQs) |
| | | AYSdk.getInstance().sendCmd(0x8012, gson.toJson(simulateNightBean)) |
| | | |
| | | |
| | | MyLog.i(TAG,"查到的考试type="+examType) |
| | | ExamPlatformData.getInstance().examType = examType |
| | | val data = Data.Builder().putInt(Constant.EXAM_STATUS_TYPE,examType).build() |
| | | if (examType != safeluck.drive.evaluation.Constant.NONE_BEEN_START_EXAM) { |
| | | try { |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import safeluck.drive.evaluation.bean.ExamPlatformData; |
| | | |
| | | public class ExamStatusViewModel extends AndroidViewModel { |
| | | ExamStatusWorkRepo examStatusWorkRepo; |
| | | LiveData<List<ExamStatus>> examStatus; |
| | |
| | | } |
| | | |
| | | public void updateStartExam(int statExam) { |
| | | |
| | | examStatusWorkRepo.updateStartExam(statExam); |
| | | } |
| | | |
| | |
| | | import androidx.room.Dao; |
| | | import androidx.room.Delete; |
| | | import androidx.room.Insert; |
| | | import androidx.room.OnConflictStrategy; |
| | | import androidx.room.Query; |
| | | |
| | | import java.util.List; |
| | |
| | | @Dao |
| | | public interface FailProjDao { |
| | | |
| | | @Insert |
| | | @Insert(onConflict = OnConflictStrategy.REPLACE) |
| | | void insert(FailedProj proj); |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Query("SELECT emp_id,stu_id,utc,sn,deducting_reason,score_deducting,item_content from criteria_two INNER JOIN fail_projects ON criteria_two.item_id= fail_projects.emp_id where fail_projects.stu_id=:stu_id and fail_projects.subject=2") |
| | | LiveData<List<FailedProj_select>> getFailedProjectsForII(long stu_id); |
| | | /** |
| | | * 查询 科目三 路考考场的失败项目 (多表查询) |
| | | * 如果要添加 科目二II III类考场失败项目,需要建立相应的评判标准表数据表 |
| | | * @return |
| | | */ |
| | | @Query("SELECT emp_id,stu_id,utc,sn,deducting_reason,score_deducting,item_content from criteria_three INNER JOIN fail_projects ON criteria_three.item_id= fail_projects.emp_id where fail_projects.stu_id=:stu_id and fail_projects.subject=3") |
| | | LiveData<List<FailedProj_select>> getFailedProjectsForIII(long stu_id); |
| | | |
| | | /** |
| | | * 获取失败项目条数 |
| | |
| | | |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaForI; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaForII; |
| | | import safeluck.drive.evaluation.DB.criterias.CriteriaForIII; |
| | | |
| | | import static androidx.room.ForeignKey.CASCADE; |
| | | |
| | |
| | | */ |
| | | @Entity(tableName = "fail_projects",foreignKeys = {@ForeignKey(entity = CriteriaForI.class, |
| | | parentColumns = "item_id",childColumns = "emp_id",onDelete = CASCADE),@ForeignKey(entity = CriteriaForII.class, |
| | | parentColumns = "item_id",childColumns = "emp_id",onDelete = CASCADE),@ForeignKey(entity = CriteriaForIII.class, |
| | | parentColumns = "item_id",childColumns = "emp_id",onDelete = CASCADE)},indices = @Index(value = {"emp_id"})) |
| | | public class FailedProj { |
| | | @PrimaryKey(autoGenerate = true) |
| | |
| | | |
| | | import androidx.lifecycle.LiveData; |
| | | |
| | | import com.anyun.exam.lib.MyLog; |
| | | |
| | | import java.util.List; |
| | | |
| | | import safeluck.drive.evaluation.Constant; |
| | | import safeluck.drive.evaluation.DB.WorkRoomDataBase; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public LiveData<List<FailedProj_select>> getFailedProjectsForII(long stu_id) { |
| | | return failProjDao.getFailedProjectsForII(stu_id); |
| | | } /** |
| | | * 获得科目三 路考考场失败项目扣分项 |
| | | * |
| | | * @param stu_id |
| | | * @return |
| | | */ |
| | | public LiveData<List<FailedProj_select>> getFailedProjectsForIII(long stu_id) { |
| | | return failProjDao.getFailedProjectsForIII(stu_id); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public LiveData<List<FailedProj_select>> getFailedProjectsForII(long stu_id){ |
| | | return failedProjRepository.getFailedProjectsForII(stu_id); |
| | | } |
| | | public LiveData<List<FailedProj_select>> getFailedProjectsForIII(long stu_id){ |
| | | return failedProjRepository.getFailedProjectsForIII(stu_id); |
| | | } |
| | | public void insert(FailedProj proj){ |
| | | failedProjRepository.insert(proj); |
| | | } |
| | |
| | | utc = utc.substring(2,utc.length()-3); |
| | | MyLog.i("评判消息解析之后的utc="+utc); |
| | | int sn = jsonObject.get("sn").getAsInt(); |
| | | if (ExamPlatformData.getInstance().getExamType()==2){//场地评判消息 |
| | | if (emp_id>31|| emp_id<0){ |
| | | MyLog.i(TAG,"emp_id超出范围不能插入数据库(I类考场)"); |
| | | return; |
| | |
| | | MyLog.i("插入fail_projects表="+failedProj.toString()); |
| | | failedProjRepository.insert(failedProj); |
| | | } |
| | | if (ExamPlatformData.getInstance().getExamType()>2){//道路 评判消息 |
| | | if (emp_id>66|| emp_id<1){ |
| | | MyLog.i(TAG,"emp_id超出范围不能插入数据库(路考类考场)"); |
| | | return; |
| | | } |
| | | FailedProj failedProj = new FailedProj(Constant.SUBJECT_III, emp_id, Constant.TEST_STU_ID,utc,sn); |
| | | MyLog.i("插入路考fail_projects表="+failedProj.toString()); |
| | | // failedProjRepository.insert(failedProj); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | break; |
| | |
| | | |
| | | private String mPhone = "";//考试平台消息用到的phone |
| | | |
| | | private int examType = 0;//2 场地; |
| | | //3 道路,模拟夜考; |
| | | // 4 道路,实际夜考; |
| | | |
| | | public static final int TCP_DISCONNECT = 1; |
| | | public static final int TCP_CONNECTED = 2;///2-未连接(tcp连接不上) |
| | | public static final int DEV_NOT_REGISTERED = 3; |
| | |
| | | setQfAndSatNum(0,0); |
| | | setExamplatformStatus(0); |
| | | } |
| | | |
| | | public int getExamType() { |
| | | return examType; |
| | | } |
| | | |
| | | public void setExamType(int examType) { |
| | | this.examType = examType; |
| | | } |
| | | } |
| | |
| | | if (maps != null&& maps.size()>0){ |
| | | for (int i = 0; i < maps.size(); i++) { |
| | | RoadExamMap.MapsBean mapItem = maps.get(i); |
| | | |
| | | if (mapItem.getItem() == ALL_MAP){ |
| | | List<List<Integer>> redLines= mapItem.getRed_line(); |
| | | List<List<Integer>> greenLines = mapItem.getGreen_line(); |
| | | List<List<Integer>> allTringgerLines = mapItem.getAll_trigger_line(); |
| | | |
| | | |
| | | for (List<Integer> allTriggerLine: allTringgerLines |
| | | ) { |
| | | for (int kk = 1; kk < allTriggerLine.size(); kk++) { |
| | | int pos = allTriggerLine.get(kk); |
| | | if (kk ==1){ |
| | | path.moveTo((float) (base_x + (map[pos][0] - min_x) * scale_x), (float) (base_y + (map[pos][1] - min_y) * scale_y)); |
| | | } |
| | | path.lineTo((float) (base_x + (map[pos][0] - min_x) * scale_x), (float) (base_y + (map[pos][1] - min_y) * scale_y)); |
| | | Log.i(TAG,String.format("trigerline map[%d][0]=%f,map[%d][1]=%f,line to (%f,%f)",pos,map[pos][0],pos,map[pos][1], |
| | | (float) (base_x + (map[pos][0] - min_x) * scale_x),(float) (base_y + (map[pos][1] - min_y) * scale_y))); |
| | | } |
| | | } |
| | | |
| | | paint.reset(); |
| | | paint.setStyle(Paint.Style.STROKE); |
| | | paint.setStrokeWidth(1.5f); |
| | | paint.setAntiAlias(true); |
| | | paint.setColor(Color.RED); |
| | | paint.setPathEffect(null); |
| | | |
| | | Log.i(TAG,"redLinesSize"+redLines.size()); |
| | | for (List<Integer> redline: redLines |
| | | ) { |
| | |
| | | } |
| | | canvas2.drawPath(path,paint); |
| | | |
| | | }else{ |
| | | List<Integer> area = mapItem.getArea(); |
| | | for (int jj = 0; jj < area.size(); jj++) { |
| | | int pos = area.get(jj); |
| | | if (jj==0){ |
| | | path.moveTo((float) (base_x + (map[pos][0] - min_x) * scale_x), (float) (base_y + (map[pos][1] - min_y) * scale_y)); |
| | | }else{ |
| | | path.lineTo((float) (base_x + (map[pos][0] - min_x) * scale_x), (float) (base_y + (map[pos][1] - min_y) * scale_y)); |
| | | } |
| | | } |
| | | path.close(); |
| | | canvas2.drawPath(path,paint); |
| | | } |
| | | } |
| | | |