.gitignore
@@ -11,3 +11,9 @@ /build /captures .externalNativeBuild *.ninja lib/.cxx/cmake/debug signal_config_file.json.orig lib/.cxx/cmake ndk_locator_record.json misc.xml app/src/androidTest/java/safeluck/drive/evaluation/ExampleInstrumentedTest.java
@@ -1,8 +1,9 @@ package safeluck.drive.evaluation; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import androidx.test.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; app/src/main/java/safeluck/drive/evaluation/app.java
@@ -10,10 +10,8 @@ import androidx.annotation.NonNull; import androidx.lifecycle.Observer; import androidx.work.Data; import androidx.work.OneTimeWorkRequest; import androidx.work.WorkInfo; import androidx.work.WorkManager; import com.anyun.exam.lib.AYSdk; @@ -25,18 +23,15 @@ import com.anyun.exam.lib.MyLog; import com.anyun.exam.lib.crash.CrashHandler; import com.facebook.stetho.Stetho; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.safeluck.aykj.utils.BytesUtils; import org.json.JSONException; import org.json.JSONObject; import java.util.Date; import java.util.Random; import safeluck.drive.evaluation.DB.WorkRoomDataBase; import safeluck.drive.evaluation.DB.appstatusdb.AppStatusWorker; @@ -47,7 +42,6 @@ import safeluck.drive.evaluation.DB.failitems.FailedProj; import safeluck.drive.evaluation.DB.failitems.LuKaoFailedProj; import safeluck.drive.evaluation.DB.gps.GpsInfoWorker; import safeluck.drive.evaluation.DB.rtktb.RTKConfig; import safeluck.drive.evaluation.DB.rtktb.RTKConfigUpdateWorker; import safeluck.drive.evaluation.bean.ExamPlatformData; import safeluck.drive.evaluation.cEventCenter.CEventCenter; @@ -583,12 +577,7 @@ 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(); } }); CThreadPoolExecutor.runOnMainThread(() -> Toast.makeText(getAppContext(), String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName()), Toast.LENGTH_SHORT).show()); } app/src/main/java/safeluck/drive/evaluation/bean/ExamPlatformData.java
@@ -140,6 +140,7 @@ private int rtkPort = 12125; private String rtkIP = "47.93.80.84"; public final int MAX_SCORE_DUCT = 20; private String coachID;//教练员身份证号码 public static ExamPlatformData getInstance() { return ourInstance; @@ -207,7 +208,10 @@ } /** * 获取学员ID(身份证) * @return */ public String getID() { return id; } @@ -388,4 +392,19 @@ return roadmapPath; } /** * 设置保存教练员身份证号 * @param id */ public void setCoachID(String id) { this.coachID = id; } /** * 获取 * @return 教练员身份证 */ public String getCoachID() { return coachID; } } app/src/main/java/safeluck/drive/evaluation/customview/LoadProgressDialog.java
New file @@ -0,0 +1,73 @@ package safeluck.drive.evaluation.customview; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.DialogFragment; import safeluck.drive.evaluation.R; /** * @ProjectName: DriveJudge * @Package: safeluck.drive.evaluation.customview * @ClassName: LoadProgressDialog * @Description: java类作用描述 * @Author: 李占伟 * @CreateDate: 2020-04-16 09:57 * @UpdateUser: 更新者 * @UpdateDate: 2020-04-16 09:57 * @UpdateRemark: 更新说明 * @Version: 1.0 */ public class LoadProgressDialog extends DialogFragment { private String message="正在加载..."; private boolean canCancel= false; private TextView textView; private Handler handler = new Handler(Looper.getMainLooper()){ @Override public void handleMessage(Message msg) { super.handleMessage(msg); if (msg.what==1) dismiss(); } }; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.layout_dialog_loading,container,false); initView(view); setCancelable(canCancel); Message message = Message.obtain(); message.what = 1; handler.sendMessageDelayed(message,10*1000); return view; } private void initView(View view) { textView =view.findViewById(R.id.tv_message); } public static LoadProgressDialog newInstance(String message){ LoadProgressDialog fragment = new LoadProgressDialog(); Bundle bundle = new Bundle(); bundle.putString("tittle", message); fragment.setArguments(bundle); return fragment; } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { message = getArguments().getString("title"); textView.setText(message); } } app/src/main/java/safeluck/drive/evaluation/customview/QRCodeDialog.java
New file @@ -0,0 +1,100 @@ package safeluck.drive.evaluation.customview; import android.app.Dialog; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import java.nio.charset.Charset; import safeluck.drive.evaluation.R; import safeluck.drive.evaluation.util.QRCodeUtil; /** * @ProjectName: DriveJudge * @Package: safeluck.drive.evaluation.customview * @ClassName: LoadProgressDialog * @Description: java类作用描述 * @Author: 李占伟 * @CreateDate: 2020-04-16 09:57 * @UpdateUser: 更新者 * @UpdateDate: 2020-04-16 09:57 * @UpdateRemark: 更新说明 * @Version: 1.0 */ public class QRCodeDialog extends DialogFragment { private static final String TAG = "QRCodeDialog"; private String message="正在加载..."; private boolean canCancel= true; private ImageView iv_qrCode; private Button btn; private Bitmap qrBitmap; private Bitmap logobitmap; private Handler handler = new Handler(Looper.getMainLooper()){ @Override public void handleMessage(Message msg) { super.handleMessage(msg); if (msg.what==1) dismiss(); } }; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.layout_dialog_qrcode,container,false); initView(view); setCancelable(canCancel); Message message = Message.obtain(); message.what = 1; handler.sendMessageDelayed(message,15*1000); return view; } private void initView(View view) { Bundle bundle =getArguments(); message = bundle.getString("tittle"); Log.i(TAG,"meesage="+message); btn = view.findViewById(R.id.btn_qr_sure); iv_qrCode =view.findViewById(R.id.iv_qr_code); logobitmap = BitmapFactory.decodeResource(getResources(),R.drawable.anyunlog); qrBitmap = QRCodeUtil.createQRCodeBitmap(message,640,640,"UTF-8","H", "1", Color.BLACK,Color.WHITE,logobitmap,0.2f,null); iv_qrCode.setImageBitmap(qrBitmap); btn.setOnClickListener(v -> { dismiss(); }); } public static QRCodeDialog newInstance(String message){ QRCodeDialog fragment = new QRCodeDialog(); Bundle bundle = new Bundle(); bundle.putString("tittle", message); Log.i(TAG,"messae="+message); fragment.setArguments(bundle); return fragment; } } app/src/main/java/safeluck/drive/evaluation/fragment/HomeFragment.java
@@ -15,6 +15,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import com.anyun.exam.lib.AYSdk; @@ -24,6 +25,7 @@ import safeluck.drive.evaluation.BuildConfig; import safeluck.drive.evaluation.R; import safeluck.drive.evaluation.bean.ExamPlatformData; import safeluck.drive.evaluation.customview.LoadProgressDialog; /** @@ -82,6 +84,8 @@ } } break; case R.id.network_train: if (ExamPlatformData.getInstance().getTrainingMode()==ExamPlatformData.TRAINING_MODE){ @@ -106,28 +110,12 @@ public void onClick(DialogInterface dialog, int which) { _mActivity.finish(); } }).setNegativeButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { }).setNegativeButton("取消", (DialogInterface dialog, int which)-> { dialog.dismiss(); } }).show(); // TakePhotoFragment takePhotoFragment = findFragment(TakePhotoFragment.class); // if (takePhotoFragment == null){ // takePhotoFragment = TakePhotoFragment.newInstance(); // } // start(takePhotoFragment); break; case R.id.system_setting: //打开输入密码界面 // PasswordFragment passwordFragment = findFragment(PasswordFragment.class); // if (passwordFragment == null) { // passwordFragment = (PasswordFragment) PasswordFragment.newInstance(); // start(passwordFragment); // } else { // start(passwordFragment); // } BaseSettingFragment sysSetingFragment = findFragment(BaseSettingFragment.class); if (sysSetingFragment == null) { sysSetingFragment = (BaseSettingFragment) BaseSettingFragment.newInstance(); app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java
@@ -21,6 +21,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.DialogFragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import androidx.work.OneTimeWorkRequest; @@ -58,11 +59,15 @@ import safeluck.drive.evaluation.cEventCenter.ICEventListener; import safeluck.drive.evaluation.customview.ArrowView; import safeluck.drive.evaluation.customview.HouseView; import safeluck.drive.evaluation.customview.LoadProgressDialog; import safeluck.drive.evaluation.customview.MyDialogFragment; import safeluck.drive.evaluation.customview.QRCodeDialog; import safeluck.drive.evaluation.httpmodule.RetrofitCreator; import safeluck.drive.evaluation.im.MessageProcessor; import safeluck.drive.evaluation.platformMessage.JKMessage0201; import safeluck.drive.evaluation.platformMessage.JKMessage0202; import safeluck.drive.evaluation.platformMessage.JKMessage0204; import safeluck.drive.evaluation.platformMessage.PlatFormConstant; import safeluck.drive.evaluation.util.Utils; import safeluck.drive.evaluation.viewmodels.TimeViewModel; @@ -103,11 +108,13 @@ private FailedProjViewModel failedProjViewModel; String icson;//返回的ic卡信息 json WokViewModel wokViewModel; private List<SimulateNightBean.QuestionBean> tempQs= new ArrayList<>(); private List<Integer> btn_ids = new ArrayList<Integer>(); public static SupportFragment newInstance() { return new NetWorkTrainFragment(); } private String content;//用以生成二维码的内容 private Handler mHandler = new Handler(new Handler.Callback() { @@ -484,6 +491,8 @@ ExamPlatformData.getInstance().setId(student.getID()); tv_sex.setText(getString(R.string.sex)+(student.getSex()==2?"女":"男")); tv_start_time.setText(getString(R.string.begin_time)+Utils.formatTimeYYMMDDHHmmSS(student.getBegin_time())); }else if (!TextUtils.isEmpty(student.getName())&&student.getStu_id()==ExamPlatformData.COACH_ID){ ExamPlatformData.getInstance().setCoachID(student.getID()); } } } @@ -559,9 +568,7 @@ view.findViewById(R.id.btn_return).setOnClickListener(this); mListView = view.findViewById(R.id.lv); mListView.setFocusable(false); mListView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent ev) { mListView.setOnTouchListener((v, ev) -> { switch (ev.getAction()) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_MOVE: @@ -573,7 +580,6 @@ break; } return false; } }); view.findViewById(R.id.view_map).setOnClickListener(this); @@ -587,9 +593,8 @@ } private LoadProgressDialog loadProgressDialog; MyDialogFragment myDialogFragment; SimulateNightBean simulateNightBean = null; @Override public void onClick(View v) { switch (v.getId()) { @@ -597,8 +602,6 @@ clearArrayListResetTotalScore(); //TODO 发送JKMessage0202 给平台,开始考试 final JKMessage0202 jkMessage0202 = new JKMessage0202(); if (myDialogFragment == null){ myDialogFragment = new MyDialogFragment(); @@ -607,44 +610,12 @@ myDialogFragment.setCallback(new MyDialogFragment.Callback() { @Override public void changKao() { exam_type = 2; ExamPlatformData.getInstance().setTrainingMode(ExamPlatformData.EXAMING_MODE); ExamPlatformData.getInstance().setExamType(exam_type); examStatusViewModel.updateStartExam(exam_type); sendExamJson(1,exam_type); ExamPlatformData.getInstance().getTTS().speak("开始考试"); Date date = new Date(); wokViewModel.updateBeginTime(date.getTime()); jkMessage0202.timeBCD = date; ExamPlatformData.getInstance().setExam_id(Utils.parseUnsignedInt(String.valueOf(date.getTime()/1000),10)); jkMessage0202.exam_id = ExamPlatformData.getInstance().getExam_id(); jkMessage0202.curr_exam = 0; jkMessage0202.mode = ExamPlatformData.getInstance().getExamType()==ExamPlatformData.TRAINING_MODE?1:0; MessageProcessor.getInstance().sendMessage(jkMessage0202); sendJK0202(2); } @Override public void luKao() { ExamPlatformData.getInstance().setTrainingMode(ExamPlatformData.EXAMING_MODE); exam_type = 3; ExamPlatformData.getInstance().setExamType(exam_type); examStatusViewModel.updateStartExam(exam_type); sendExamJson(1,exam_type); ExamPlatformData.getInstance().getTTS().speak("开始考试"); Date date = new Date(); wokViewModel.updateBeginTime(date.getTime()); jkMessage0202.timeBCD = date; ExamPlatformData.getInstance().setExam_id(Utils.parseUnsignedInt(String.valueOf(date.getTime()/1000),10)); jkMessage0202.exam_id = ExamPlatformData.getInstance().getExam_id(); jkMessage0202.curr_exam = 1; jkMessage0202.mode = ExamPlatformData.getInstance().getExamType()==ExamPlatformData.TRAINING_MODE?1:0; MessageProcessor.getInstance().sendMessage(jkMessage0202); sendJK0202(3); } }); @@ -680,12 +651,37 @@ _mActivity.onBackPressed(); break; case R.id.iv_head: MyLog.i(TAG,"签到,获取身份证物理卡号"); AYSdk.getInstance().sendCmd(Constant.READ_PHYSICAL_ID,""); //TODO 获得物理卡号 发送JKMessage0201给平台,获取姓名、身份证、head_url MyLog.i(PlatFormConstant.HTTPTAG,"签到"); loadProgressDialog = LoadProgressDialog.newInstance("请稍后..."); loadProgressDialog.setStyle(DialogFragment.STYLE_NORMAL,R.style.Dialog_FullScreen); loadProgressDialog.showNow(getFragmentManager(),"loadingdiaolog"); //从服务器获取用于生成签到二维码的url break; } } private void sendJK0202(int type) { final JKMessage0202 jkMessage0202 = new JKMessage0202(); exam_type = type; ExamPlatformData.getInstance().setTrainingMode(ExamPlatformData.EXAMING_MODE); ExamPlatformData.getInstance().setExamType(exam_type); examStatusViewModel.updateStartExam(exam_type); sendExamJson(1,exam_type); ExamPlatformData.getInstance().getTTS().speak("开始考试"); Date date = new Date(); wokViewModel.updateBeginTime(date.getTime()); jkMessage0202.timeBCD = date; ExamPlatformData.getInstance().setExam_id(Utils.parseUnsignedInt(String.valueOf(date.getTime()/1000),10)); jkMessage0202.stu_id = ExamPlatformData.getInstance().getID(); jkMessage0202.coach_id = ExamPlatformData.getInstance().getCoachID(); jkMessage0202.exam_id = ExamPlatformData.getInstance().getExam_id(); jkMessage0202.curr_exam = (type-2);// 跟移动站服务定义的场考是2 ,平台是0 ; 移动站路考是3 ,平台是1 jkMessage0202.mode = ExamPlatformData.getInstance().getTrainingMode()==ExamPlatformData.TRAINING_MODE?1:0; MessageProcessor.getInstance().sendMessage(jkMessage0202); } private void sendExamJson(int i,int type) { @@ -768,4 +764,6 @@ super.onDetach(); CEventCenter.onBindEvent(false,icEventListener,Constant.BIND_SPEED_TOPIC); } } app/src/main/java/safeluck/drive/evaluation/fragment/SetArgumentsFragment.java
@@ -97,9 +97,7 @@ View view = inflater.inflate(R.layout.layout_base_datas, container, false); initView(view); rtkConfigViewModel= ViewModelProviders.of(this).get(RTKConfigViewModel.class); rtkConfigViewModel.getRTKConfig().observe(this, new Observer<RTKConfig>() { @Override public void onChanged(RTKConfig rtkConfig) { rtkConfigViewModel.getRTKConfig().observe(this, rtkConfig -> { if (rtkConfig != null){ Log.i(TAG, "RTKConfig Changed: "+rtkConfig.toString()); mRtkConfig = rtkConfig; @@ -114,7 +112,6 @@ } } }); @@ -279,16 +276,15 @@ final Uri uri= data.getData(); Log.i(TAG, "onActivityResult: "+uri.getPath()); ExamPlatformData.getInstance().setNewMapPath(uri.getPath()); CThreadPoolExecutor.runInBackground(new Runnable() { @Override public void run() { CThreadPoolExecutor.runInBackground(()-> { byte[] fileContent = FileUtil.readFile(uri.getPath()); if (fileContent != null){ String str = new String(fileContent); Log.i(TAG, "文件内容:"+str); AYSdk.getInstance().sendCmd(Constant.PUSH_MAP_INFO,str); } } }); } @@ -298,16 +294,15 @@ final Uri uri= data.getData(); Log.i(TAG, "onActivityResult: "+uri.getPath()); ExamPlatformData.getInstance().setCarModelPath(uri.getPath()); CThreadPoolExecutor.runInBackground(new Runnable() { @Override public void run() { CThreadPoolExecutor.runInBackground(()-> { byte[] fileContent = FileUtil.readFile(uri.getPath()); if (fileContent != null){ String str = new String(fileContent); Log.i(TAG, "文件内容:"+str); AYSdk.getInstance().sendCmd(Constant.PUSH_VECHILE_PROFILE,str); } } }); } @@ -317,15 +312,12 @@ final Uri uri= data.getData(); Log.i(TAG, "onActivityResult: "+uri.getPath()); ExamPlatformData.getInstance().setNewRoadMapPath(uri.getPath()); CThreadPoolExecutor.runInBackground(new Runnable() { @Override public void run() { CThreadPoolExecutor.runInBackground(() -> { byte[] fileContent = FileUtil.readFile(uri.getPath()); if (fileContent != null){ String str = new String(fileContent); Log.i(TAG, "文件内容:"+str); AYSdk.getInstance().sendCmd(Constant.PUSH_ROAD_MAP_INFO,str); } } }); } app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java
@@ -6,6 +6,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.DialogFragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import androidx.work.OneTimeWorkRequest; @@ -59,6 +60,7 @@ import safeluck.drive.evaluation.cEventCenter.ICEventListener; import safeluck.drive.evaluation.customview.ArrowView; import safeluck.drive.evaluation.customview.HouseView; import safeluck.drive.evaluation.customview.LoadProgressDialog; import safeluck.drive.evaluation.customview.MyDialogFragment; import safeluck.drive.evaluation.im.MessageProcessor; import safeluck.drive.evaluation.platformMessage.JKMessage0201; @@ -106,8 +108,9 @@ private static final int SPEED_DATA = 2; private FailedProjViewModel failedProjViewModel; String icson;//返回的ic卡信息 json private List<SimulateNightBean.QuestionBean> tempQs= new ArrayList<>(); private TableRow tableRow1,tableRow2,tableRow3; private String content;//用以生成二维码的内容 private LoadProgressDialog loadProgressDialog; private List<Integer> btn_ids = new ArrayList<Integer>(); @@ -474,6 +477,8 @@ tv_sex.setText(getString(R.string.sex)+(student.getSex()==2?"女":"男")); tv_start_time.setText(getString(R.string.begin_time)+Utils.formatTimeYYMMDDHHmmSS(student.getBegin_time())); }else if (!TextUtils.isEmpty(student.getName())&&student.getStu_id()==ExamPlatformData.COACH_ID){ ExamPlatformData.getInstance().setCoachID(student.getID()); } } } @@ -542,10 +547,6 @@ tv_total_score = view.findViewById(R.id.tv_total_score); tv_network_time = view.findViewById(R.id.network_time); tableRow1 = view.findViewById(R.id.first); tableRow2 = view.findViewById(R.id.second); tableRow3 = view.findViewById(R.id.third); tv_network_time.setText(Utils.getHHmm()); @@ -606,30 +607,12 @@ @Override public void changKao() { exam_type = 2; ExamPlatformData.getInstance().setTrainingMode(ExamPlatformData.TRAINING_MODE);//设置为训练模式 ExamPlatformData.getInstance().setExamType(exam_type); examStatusViewModel.updateStartExam(exam_type); sendExamJson(1,exam_type); ExamPlatformData.getInstance().getTTS().speak("开始训练"); jkMessage0202.curr_exam = 0; jkMessage0202.mode = ExamPlatformData.getInstance().getExamType()==ExamPlatformData.TRAINING_MODE?1:0; MessageProcessor.getInstance().sendMessage(jkMessage0202); sendJK0202(2); } @Override public void luKao() { exam_type = 3; ExamPlatformData.getInstance().setTrainingMode(ExamPlatformData.TRAINING_MODE); ExamPlatformData.getInstance().setExamType(exam_type); examStatusViewModel.updateStartExam(exam_type); sendExamJson(1,exam_type); ExamPlatformData.getInstance().getTTS().speak("开始训练"); jkMessage0202.curr_exam = 1; jkMessage0202.mode = ExamPlatformData.getInstance().getExamType()==ExamPlatformData.TRAINING_MODE?1:0; MessageProcessor.getInstance().sendMessage(jkMessage0202); sendJK0202(3); @@ -669,13 +652,36 @@ break; case R.id.iv_head: MyLog.i(TAG,"签到,获取身份证物理卡号"); AYSdk.getInstance().sendCmd(Constant.READ_PHYSICAL_ID,""); //TODO 获得物理卡号 发送JKMessage0201给平台,获取姓名、身份证、head_url loadProgressDialog = LoadProgressDialog.newInstance("请稍后..."); loadProgressDialog.setStyle(DialogFragment.STYLE_NORMAL,R.style.Dialog_FullScreen); loadProgressDialog.showNow(getFragmentManager(),"loadingdiaolog"); break; } } private void sendJK0202(int type) { final JKMessage0202 jkMessage0202 = new JKMessage0202(); exam_type = type; ExamPlatformData.getInstance().setTrainingMode(ExamPlatformData.TRAINING_MODE); ExamPlatformData.getInstance().setExamType(exam_type); examStatusViewModel.updateStartExam(exam_type); sendExamJson(1,exam_type); ExamPlatformData.getInstance().getTTS().speak("开始训练"); Date date = new Date(); wokViewModel.updateBeginTime(date.getTime()); jkMessage0202.timeBCD = date; ExamPlatformData.getInstance().setExam_id(Utils.parseUnsignedInt(String.valueOf(date.getTime()/1000),10)); jkMessage0202.stu_id = ExamPlatformData.getInstance().getID(); jkMessage0202.coach_id = ExamPlatformData.getInstance().getCoachID(); jkMessage0202.exam_id = ExamPlatformData.getInstance().getExam_id(); jkMessage0202.curr_exam = (type-2);// 跟移动站服务定义的场考是2 ,平台是0 ; 移动站路考是3 ,平台是1 jkMessage0202.mode = ExamPlatformData.getInstance().getTrainingMode()==ExamPlatformData.TRAINING_MODE?1:0; MessageProcessor.getInstance().sendMessage(jkMessage0202); } private void sendExamJson(int i,int type) { try { app/src/main/java/safeluck/drive/evaluation/platformMessage/JKMessage0002.java
@@ -1,9 +1,5 @@ package safeluck.drive.evaluation.platformMessage; import com.safeluck.aykj.annotation.Hex; import com.safeluck.aykj.annotation.Int32; import com.safeluck.aykj.annotation.Length; import com.safeluck.aykj.annotation.Order; public class JKMessage0002 extends JK2019MessageBase { /** app/src/main/java/safeluck/drive/evaluation/platformMessage/JKMessage0202.java
@@ -6,17 +6,25 @@ public class JKMessage0202 extends JK2019MessageBase { @Order(1) @Length(18) @Ascii public String coach_id; @Order(2) @Length(18) @Ascii public String stu_id; @Order(3) @BcdDateTime public Date timeBCD; @Order(2) @Order(4) @Int32 public int exam_id; @Order(3) @Order(5) @Int8 public int curr_exam; @Order(3) @Order(6) @Int8 public int mode; app/src/main/java/safeluck/drive/evaluation/platformMessage/JKMessage0203.java
@@ -2,7 +2,6 @@ import com.safeluck.aykj.annotation.Ascii; import com.safeluck.aykj.annotation.BcdDateTime; import com.safeluck.aykj.annotation.Hex; import com.safeluck.aykj.annotation.Int32; import com.safeluck.aykj.annotation.Int8; import com.safeluck.aykj.annotation.Length; app/src/main/java/safeluck/drive/evaluation/platformMessage/JKMessage0204.java
@@ -1,10 +1,8 @@ package safeluck.drive.evaluation.platformMessage; import com.safeluck.aykj.annotation.Ascii; import com.safeluck.aykj.annotation.BcdDateTime; import com.safeluck.aykj.annotation.Int32; import com.safeluck.aykj.annotation.Int8; import com.safeluck.aykj.annotation.Length; import com.safeluck.aykj.annotation.Order; import java.util.Date; app/src/main/java/safeluck/drive/evaluation/platformMessage/JKMessage0206.java
@@ -2,8 +2,6 @@ import com.safeluck.aykj.annotation.*; import safeluck.drive.evaluation.platformMessage.decoder.JWD; import safeluck.drive.evaluation.platformMessage.decoder.SPEED; public class JKMessage0206 extends JK2019MessageBase { @Order(1) app/src/main/res/drawable/anim_loading.xml
New file @@ -0,0 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/icon_loading" android:fromDegrees="0.0" android:pivotX="50.0%" android:pivotY="50.0%" android:toDegrees="360.0" /> app/src/main/res/drawable/anyunlog.jpg
app/src/main/res/drawable/dialog_round.xml
New file @@ -0,0 +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="#333333"/> <corners android:radius="8dp"/> </shape> app/src/main/res/drawable/icon_loading.png
app/src/main/res/drawable/qrcode.jpg
app/src/main/res/layout/layout_dialog_loading.xml
New file @@ -0,0 +1,40 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/transparent" android:gravity="center" android:orientation="vertical" > <LinearLayout android:id="@+id/linearLayout" android:layout_width="100dp" android:layout_height="100dp" android:background="#333333" android:gravity="center" android:orientation="vertical" > <ProgressBar android:id="@+id/progressBar1" style="?android:attr/progressBarStyleInverse" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:indeterminateBehavior="repeat" android:indeterminateDrawable="@drawable/anim_loading" android:background="@android:color/transparent" /> <TextView android:id="@+id/tv_message" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:paddingTop="5dp" android:text="Message" android:visibility="gone" android:textColor="@android:color/holo_red_dark" /> </LinearLayout> </LinearLayout> app/src/main/res/layout/layout_dialog_qrcode.xml
New file @@ -0,0 +1,36 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/transparent" android:gravity="center" android:orientation="vertical" > <LinearLayout android:id="@+id/linearLayout" android:layout_width="210dp" android:layout_height="210dp" android:gravity="center" android:background="@android:color/white" android:orientation="vertical" > <ImageView android:id="@+id/iv_qr_code" android:layout_width="125dp" android:layout_height="125dp" android:layout_margin="10dp" android:scaleType="fitCenter" android:src="@drawable/qrcode" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="确定" android:padding="10dp" android:background="@drawable/ic_btn_daikao" android:textColor="@android:color/white" android:id="@+id/btn_qr_sure"/> </LinearLayout> </LinearLayout> app/src/main/res/values/styles.xml
@@ -52,4 +52,9 @@ <item name="android:ems">6</item> <item name="android:background">@android:drawable/edit_text</item> </style> <style name="Dialog.FullScreen" parent="Theme.AppCompat.Dialog"> <item name="android:padding">0dp</item> <item name="android:windowBackground">@android:color/transparent</item> </style> </resources> lib/src/main/cpp/test_items/area_exam.cpp
@@ -2,6 +2,7 @@ // Created by YY on 2020/4/3. // #include <cstdlib> #include "area_exam.h" #include "../test_common/car_sensor.h" #include "../driver_test.h"