New file |
| | |
| | | {"road_slide_yellow_distance":0.1,"road_slide_red_distance":0.3,"road_pause_criteria":2000,"crash_dotted_line_cumulative_time":10,"continuous_change_lane_min_time":10,"change_lane_limit_distance":100} |
New file |
| | |
| | | {"turn_signal_min_advance":3} |
New file |
| | |
| | | {"overtake_limit_distance":150} |
New file |
| | |
| | | {"road_total_distance":3000,"road_max_speed":3,"stop_car_open_door_allow_time":15,"stop_car_limit_distance":150,"stop_car_edge_red_distance":0.5,"stop_car_edge_yellow_distance":0.3} |
New file |
| | |
| | | {"start_car_limit_distance":10,"open_door_drive_allow_distance":1.1,"start_car_max_rpm":2500} |
New file |
| | |
| | | {"cross_school_max_speed":30,"crossing_break_valid_distance":30,"crossing_stop_valid_distance":3.5} |
New file |
| | |
| | | {"straight_limit_distance":100,"straight_max_offset":0.3} |
New file |
| | |
| | | {"shift_limit_distance":120,"shift_hold_time":3} |
New file |
| | |
| | | package safeluck.drive.evaluation.bean; |
| | | |
| | | /** |
| | | * DriveJudge |
| | | * Created by lzw on 2020/10/26. 13:49:28 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public class CommonSetting { |
| | | |
| | | /** |
| | | * road_slide_yellow_distance : 0.1 |
| | | * road_slide_red_distance : 0.3 |
| | | * road_pause_criteria : 2000 |
| | | * crash_dotted_line_cumulative_time : 10 |
| | | * continuous_change_lane_min_time : 10 |
| | | * change_lane_limit_distance : 100 |
| | | */ |
| | | |
| | | private double road_slide_yellow_distance; |
| | | private double road_slide_red_distance; |
| | | private int road_pause_criteria; |
| | | private int crash_dotted_line_cumulative_time; |
| | | private int continuous_change_lane_min_time; |
| | | private int change_lane_limit_distance; |
| | | |
| | | public double getRoad_slide_yellow_distance() { |
| | | return road_slide_yellow_distance; |
| | | } |
| | | |
| | | public void setRoad_slide_yellow_distance(double road_slide_yellow_distance) { |
| | | this.road_slide_yellow_distance = road_slide_yellow_distance; |
| | | } |
| | | |
| | | public double getRoad_slide_red_distance() { |
| | | return road_slide_red_distance; |
| | | } |
| | | |
| | | public void setRoad_slide_red_distance(double road_slide_red_distance) { |
| | | this.road_slide_red_distance = road_slide_red_distance; |
| | | } |
| | | |
| | | public int getRoad_pause_criteria() { |
| | | return road_pause_criteria; |
| | | } |
| | | |
| | | public void setRoad_pause_criteria(int road_pause_criteria) { |
| | | this.road_pause_criteria = road_pause_criteria; |
| | | } |
| | | |
| | | public int getCrash_dotted_line_cumulative_time() { |
| | | return crash_dotted_line_cumulative_time; |
| | | } |
| | | |
| | | public void setCrash_dotted_line_cumulative_time(int crash_dotted_line_cumulative_time) { |
| | | this.crash_dotted_line_cumulative_time = crash_dotted_line_cumulative_time; |
| | | } |
| | | |
| | | public int getContinuous_change_lane_min_time() { |
| | | return continuous_change_lane_min_time; |
| | | } |
| | | |
| | | public void setContinuous_change_lane_min_time(int continuous_change_lane_min_time) { |
| | | this.continuous_change_lane_min_time = continuous_change_lane_min_time; |
| | | } |
| | | |
| | | public int getChange_lane_limit_distance() { |
| | | return change_lane_limit_distance; |
| | | } |
| | | |
| | | public void setChange_lane_limit_distance(int change_lane_limit_distance) { |
| | | this.change_lane_limit_distance = change_lane_limit_distance; |
| | | } |
| | | } |
New file |
| | |
| | | package safeluck.drive.evaluation.bean; |
| | | |
| | | /** |
| | | * DriveJudge |
| | | * Created by lzw on 2020/10/26. 13:59:39 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public class CorneringLampSetting { |
| | | |
| | | /** |
| | | * turn_signal_min_advance : 3 |
| | | */ |
| | | |
| | | private int turn_signal_min_advance; |
| | | |
| | | public int getTurn_signal_min_advance() { |
| | | return turn_signal_min_advance; |
| | | } |
| | | |
| | | public void setTurn_signal_min_advance(int turn_signal_min_advance) { |
| | | this.turn_signal_min_advance = turn_signal_min_advance; |
| | | } |
| | | } |
New file |
| | |
| | | package safeluck.drive.evaluation.bean; |
| | | |
| | | /** |
| | | * DriveJudge |
| | | * Created by lzw on 2020/10/26. 13:59:39 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public class OverTakeMeetingSetting { |
| | | |
| | | /** |
| | | * overtake_limit_distance : 150 |
| | | */ |
| | | |
| | | private int overtake_limit_distance; |
| | | |
| | | public int getOvertake_limit_distance() { |
| | | return overtake_limit_distance; |
| | | } |
| | | |
| | | public void setOvertake_limit_distance(int overtake_limit_distance) { |
| | | this.overtake_limit_distance = overtake_limit_distance; |
| | | } |
| | | } |
New file |
| | |
| | | package safeluck.drive.evaluation.bean; |
| | | |
| | | /** |
| | | * DriveJudge |
| | | * Created by lzw on 2020/10/26. 13:59:39 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public class SideStopSetting { |
| | | |
| | | /** |
| | | * road_total_distance : 3000 |
| | | * road_max_speed : 3 |
| | | * stop_car_open_door_allow_time : 15 |
| | | * stop_car_limit_distance : 150 |
| | | * stop_car_edge_red_distance : 0.5 |
| | | * stop_car_edge_yellow_distance : 0.3 |
| | | */ |
| | | |
| | | private int road_total_distance; |
| | | private int road_max_speed; |
| | | private int stop_car_open_door_allow_time; |
| | | private int stop_car_limit_distance; |
| | | private double stop_car_edge_red_distance; |
| | | private double stop_car_edge_yellow_distance; |
| | | |
| | | public int getRoad_total_distance() { |
| | | return road_total_distance; |
| | | } |
| | | |
| | | public void setRoad_total_distance(int road_total_distance) { |
| | | this.road_total_distance = road_total_distance; |
| | | } |
| | | |
| | | public int getRoad_max_speed() { |
| | | return road_max_speed; |
| | | } |
| | | |
| | | public void setRoad_max_speed(int road_max_speed) { |
| | | this.road_max_speed = road_max_speed; |
| | | } |
| | | |
| | | public int getStop_car_open_door_allow_time() { |
| | | return stop_car_open_door_allow_time; |
| | | } |
| | | |
| | | public void setStop_car_open_door_allow_time(int stop_car_open_door_allow_time) { |
| | | this.stop_car_open_door_allow_time = stop_car_open_door_allow_time; |
| | | } |
| | | |
| | | public int getStop_car_limit_distance() { |
| | | return stop_car_limit_distance; |
| | | } |
| | | |
| | | public void setStop_car_limit_distance(int stop_car_limit_distance) { |
| | | this.stop_car_limit_distance = stop_car_limit_distance; |
| | | } |
| | | |
| | | public double getStop_car_edge_red_distance() { |
| | | return stop_car_edge_red_distance; |
| | | } |
| | | |
| | | public void setStop_car_edge_red_distance(double stop_car_edge_red_distance) { |
| | | this.stop_car_edge_red_distance = stop_car_edge_red_distance; |
| | | } |
| | | |
| | | public double getStop_car_edge_yellow_distance() { |
| | | return stop_car_edge_yellow_distance; |
| | | } |
| | | |
| | | public void setStop_car_edge_yellow_distance(double stop_car_edge_yellow_distance) { |
| | | this.stop_car_edge_yellow_distance = stop_car_edge_yellow_distance; |
| | | } |
| | | } |
New file |
| | |
| | | package safeluck.drive.evaluation.bean; |
| | | |
| | | /** |
| | | * DriveJudge |
| | | * Created by lzw on 2020/10/26. 13:59:39 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public class StartCarSetting { |
| | | |
| | | |
| | | /** |
| | | * start_car_limit_distance : 10 |
| | | * open_door_drive_allow_distance : 1.1 |
| | | * start_car_max_rpm : 2500 |
| | | */ |
| | | |
| | | private int start_car_limit_distance; |
| | | private double open_door_drive_allow_distance; |
| | | private int start_car_max_rpm; |
| | | |
| | | public int getStart_car_limit_distance() { |
| | | return start_car_limit_distance; |
| | | } |
| | | |
| | | public void setStart_car_limit_distance(int start_car_limit_distance) { |
| | | this.start_car_limit_distance = start_car_limit_distance; |
| | | } |
| | | |
| | | public double getOpen_door_drive_allow_distance() { |
| | | return open_door_drive_allow_distance; |
| | | } |
| | | |
| | | public void setOpen_door_drive_allow_distance(double open_door_drive_allow_distance) { |
| | | this.open_door_drive_allow_distance = open_door_drive_allow_distance; |
| | | } |
| | | |
| | | public int getStart_car_max_rpm() { |
| | | return start_car_max_rpm; |
| | | } |
| | | |
| | | public void setStart_car_max_rpm(int start_car_max_rpm) { |
| | | this.start_car_max_rpm = start_car_max_rpm; |
| | | } |
| | | } |
New file |
| | |
| | | package safeluck.drive.evaluation.bean; |
| | | |
| | | /** |
| | | * DriveJudge |
| | | * Created by lzw on 2020/10/26. 13:59:39 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public class StationSetting { |
| | | |
| | | /** |
| | | * cross_school_max_speed : 30 |
| | | * crossing_break_valid_distance : 30 |
| | | * crossing_stop_valid_distance : 3.5 |
| | | */ |
| | | |
| | | private int cross_school_max_speed; |
| | | private int crossing_break_valid_distance; |
| | | private double crossing_stop_valid_distance; |
| | | |
| | | public int getCross_school_max_speed() { |
| | | return cross_school_max_speed; |
| | | } |
| | | |
| | | public void setCross_school_max_speed(int cross_school_max_speed) { |
| | | this.cross_school_max_speed = cross_school_max_speed; |
| | | } |
| | | |
| | | public int getCrossing_break_valid_distance() { |
| | | return crossing_break_valid_distance; |
| | | } |
| | | |
| | | public void setCrossing_break_valid_distance(int crossing_break_valid_distance) { |
| | | this.crossing_break_valid_distance = crossing_break_valid_distance; |
| | | } |
| | | |
| | | public double getCrossing_stop_valid_distance() { |
| | | return crossing_stop_valid_distance; |
| | | } |
| | | |
| | | public void setCrossing_stop_valid_distance(double crossing_stop_valid_distance) { |
| | | this.crossing_stop_valid_distance = crossing_stop_valid_distance; |
| | | } |
| | | } |
New file |
| | |
| | | package safeluck.drive.evaluation.bean; |
| | | |
| | | /** |
| | | * DriveJudge |
| | | * Created by lzw on 2020/10/26. 13:59:39 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public class StraightLineSetting { |
| | | |
| | | /** |
| | | * straight_limit_distance : 100 |
| | | * straight_max_offset : 0.3 |
| | | */ |
| | | |
| | | private int straight_limit_distance; |
| | | private double straight_max_offset; |
| | | |
| | | public int getStraight_limit_distance() { |
| | | return straight_limit_distance; |
| | | } |
| | | |
| | | public void setStraight_limit_distance(int straight_limit_distance) { |
| | | this.straight_limit_distance = straight_limit_distance; |
| | | } |
| | | |
| | | public double getStraight_max_offset() { |
| | | return straight_max_offset; |
| | | } |
| | | |
| | | public void setStraight_max_offset(double straight_max_offset) { |
| | | this.straight_max_offset = straight_max_offset; |
| | | } |
| | | } |
New file |
| | |
| | | package safeluck.drive.evaluation.bean; |
| | | |
| | | /** |
| | | * DriveJudge |
| | | * Created by lzw on 2020/10/26. 13:59:39 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public class SubDecGearSetting { |
| | | |
| | | /** |
| | | * shift_limit_distance : 120 |
| | | * shift_hold_time : 3 |
| | | */ |
| | | |
| | | private int shift_limit_distance; |
| | | private int shift_hold_time; |
| | | |
| | | public int getShift_limit_distance() { |
| | | return shift_limit_distance; |
| | | } |
| | | |
| | | public void setShift_limit_distance(int shift_limit_distance) { |
| | | this.shift_limit_distance = shift_limit_distance; |
| | | } |
| | | |
| | | public int getShift_hold_time() { |
| | | return shift_hold_time; |
| | | } |
| | | |
| | | public void setShift_hold_time(int shift_hold_time) { |
| | | this.shift_hold_time = shift_hold_time; |
| | | } |
| | | } |
| | |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.Toast; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.lifecycle.Observer; |
| | | import androidx.lifecycle.ViewModelProviders; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.bean.CommonSetting; |
| | | import safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText; |
| | | import safeluck.drive.evaluation.util.Utils; |
| | | import safeluck.drive.evaluation.viewmodels.CommonSettingViewModel; |
| | | |
| | | /** |
| | | * DriveJudge |
| | |
| | | private static final String ARG_NUMBER = "arg_number"; |
| | | private static final String TAG = FragmentSetting2.class.getSimpleName(); |
| | | |
| | | private CommonSetting mCommonSetting; |
| | | private CommonSettingViewModel commonSettingViewModel; |
| | | |
| | | private TextEditText te_road_pause_time; |
| | | private TextEditText te_crash_dotted_line_time; |
| | | private TextEditText te_slide_yellow_distance; |
| | | private TextEditText te_slide_red_distance; |
| | | private TextEditText te_lane_min_time; |
| | | private TextEditText te_change_lane_dis; |
| | | |
| | | private int mNumber; |
| | | |
| | |
| | | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View view = inflater.inflate(R.layout.layout_common_judge_1, container, false); |
| | | initView(view); |
| | | commonSettingViewModel = ViewModelProviders.of(this).get(CommonSettingViewModel.class); |
| | | commonSettingViewModel.getCommonSetting().observe(this, new Observer<CommonSetting>() { |
| | | @Override |
| | | public void onChanged(CommonSetting commonSetting) { |
| | | if (commonSetting != null){ |
| | | mCommonSetting = commonSetting; |
| | | setDatas(); |
| | | } |
| | | } |
| | | }); |
| | | return view; |
| | | } |
| | | |
| | | private void setDatas() { |
| | | if (mCommonSetting != null){ |
| | | te_change_lane_dis.setInput(String.valueOf(mCommonSetting.getChange_lane_limit_distance())); |
| | | te_crash_dotted_line_time.setInput(String.valueOf(mCommonSetting.getCrash_dotted_line_cumulative_time())); |
| | | te_lane_min_time.setInput(String.valueOf(mCommonSetting.getContinuous_change_lane_min_time())); |
| | | te_road_pause_time.setInput(String.valueOf(mCommonSetting.getRoad_pause_criteria())); |
| | | te_slide_red_distance.setInput(String.valueOf(mCommonSetting.getRoad_slide_red_distance())); |
| | | te_slide_yellow_distance.setInput(String.valueOf(mCommonSetting.getRoad_slide_yellow_distance())); |
| | | } |
| | | } |
| | | |
| | | private void initView(View view) { |
| | | te_change_lane_dis = view.findViewById(R.id.road_change_lane_dist); |
| | | te_crash_dotted_line_time = view.findViewById(R.id.road_crash_dotted_line_time); |
| | | te_lane_min_time = view.findViewById(R.id.road_lane_min_time); |
| | | te_road_pause_time = view.findViewById(R.id.road_pause_time); |
| | | te_slide_red_distance = view.findViewById(R.id.road_slide_red_distance); |
| | | te_slide_yellow_distance = view.findViewById(R.id.road_slide_yellow_distance); |
| | | |
| | | view.findViewById(R.id.btn_setting_save).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | String change_lane_dis_str = te_change_lane_dis.getInput(); |
| | | String crash_dotted_line_time_str = te_crash_dotted_line_time.getInput(); |
| | | String lane_min_time_str = te_lane_min_time.getInput(); |
| | | String road_pause_time_str = te_road_pause_time.getInput(); |
| | | String slide_red_distance_str = te_slide_red_distance.getInput(); |
| | | String slide_yellow_distance_str = te_slide_yellow_distance.getInput(); |
| | | |
| | | if (mCommonSetting != null){ |
| | | |
| | | if (Utils.isDigital(change_lane_dis_str)){ |
| | | |
| | | mCommonSetting.setChange_lane_limit_distance(Integer.parseInt(change_lane_dis_str)); |
| | | } |
| | | if (Utils.isDigital(crash_dotted_line_time_str)){ |
| | | mCommonSetting.setCrash_dotted_line_cumulative_time(Integer.parseInt(crash_dotted_line_time_str)); |
| | | } |
| | | if (Utils.isDigital(lane_min_time_str)){ |
| | | mCommonSetting.setContinuous_change_lane_min_time(Integer.parseInt(lane_min_time_str)); |
| | | } |
| | | if (Utils.isDigital(road_pause_time_str)){ |
| | | |
| | | mCommonSetting.setRoad_pause_criteria(Integer.parseInt(road_pause_time_str)); |
| | | } |
| | | if (Utils.isNumber(slide_red_distance_str)){ |
| | | mCommonSetting.setRoad_slide_red_distance(Double.parseDouble(slide_red_distance_str)); |
| | | } |
| | | if (Utils.isNumber(slide_yellow_distance_str)){ |
| | | mCommonSetting.setRoad_slide_yellow_distance(Double.parseDouble(slide_yellow_distance_str)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | commonSettingViewModel.saveCommonSetting(mCommonSetting); |
| | | Toast.makeText(_mActivity, "通用设置成功", Toast.LENGTH_SHORT).show(); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | |
| | | import android.view.ViewGroup; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.lifecycle.Observer; |
| | | import androidx.lifecycle.ViewModelProviders; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.bean.CommonSetting; |
| | | import safeluck.drive.evaluation.bean.StartCarSetting; |
| | | import safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText; |
| | | import safeluck.drive.evaluation.viewmodels.CommonSettingViewModel; |
| | | import safeluck.drive.evaluation.viewmodels.StartCarSettingViewModel; |
| | | |
| | | /** |
| | | * DriveJudge |
| | |
| | | |
| | | |
| | | private int mNumber; |
| | | |
| | | private StartCarSetting mStartCarSetting; |
| | | private StartCarSettingViewModel startCarSettingViewModel; |
| | | |
| | | private TextEditText te_start_car_max_rpm; |
| | | private TextEditText te_start_car_limit_distance; |
| | | private TextEditText te_open_door_drive_allow_distance; |
| | | |
| | | public static FragmentSetting3 newInstance(String number) { |
| | | FragmentSetting3 fragment = new FragmentSetting3(); |
| | |
| | | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View view = inflater.inflate(R.layout.layout_fragment_start, container, false); |
| | | initView(view); |
| | | startCarSettingViewModel = ViewModelProviders.of(this).get(StartCarSettingViewModel.class); |
| | | startCarSettingViewModel.getStartCarSetting().observe(this, new Observer<StartCarSetting>() { |
| | | @Override |
| | | public void onChanged(StartCarSetting commonSetting) { |
| | | if (commonSetting != null){ |
| | | mStartCarSetting = commonSetting; |
| | | setDatas(); |
| | | } |
| | | } |
| | | }); |
| | | return view; |
| | | } |
| | | |
| | | private void setDatas() { |
| | | te_open_door_drive_allow_distance.setInput(String.valueOf(mStartCarSetting.getOpen_door_drive_allow_distance())); |
| | | te_start_car_limit_distance.setInput(String.valueOf(mStartCarSetting.getStart_car_limit_distance())); |
| | | te_start_car_max_rpm.setInput(String.valueOf(mStartCarSetting.getStart_car_max_rpm())); |
| | | } |
| | | |
| | | private void initView(View view) { |
| | | |
| | | |
| | | te_open_door_drive_allow_distance = view.findViewById(R.id.road_start_open_door_dist); |
| | | te_start_car_limit_distance = view.findViewById(R.id.road_start_dist); |
| | | te_start_car_max_rpm = view.findViewById(R.id.road_start_max_rpm); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import android.view.ViewGroup; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.lifecycle.Observer; |
| | | import androidx.lifecycle.ViewModelProviders; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.bean.CommonSetting; |
| | | import safeluck.drive.evaluation.bean.StraightLineSetting; |
| | | import safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText; |
| | | import safeluck.drive.evaluation.viewmodels.CommonSettingViewModel; |
| | | import safeluck.drive.evaluation.viewmodels.StraightLineSettingViewModel; |
| | | |
| | | /** |
| | | * DriveJudge |
| | | * |
| | | * 直线行驶设置 |
| | | * Created by lzw on 2020/9/14. 10:16:39 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | |
| | | |
| | | |
| | | private int mNumber; |
| | | |
| | | private TextEditText te_straight_limit_distance; |
| | | private TextEditText te_straight_max_offset; |
| | | |
| | | private StraightLineSetting mStrarightLineSetting; |
| | | private StraightLineSettingViewModel straightLineSettingViewModel; |
| | | |
| | | public static FragmentSetting4 newInstance(String number) { |
| | | FragmentSetting4 fragment = new FragmentSetting4(); |
| | |
| | | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View view = inflater.inflate(R.layout.layout_fragment_straight_line, container, false); |
| | | initView(view); |
| | | straightLineSettingViewModel = ViewModelProviders.of(this).get(StraightLineSettingViewModel.class); |
| | | straightLineSettingViewModel.getStraightLineSetting().observe(this, new Observer<StraightLineSetting>() { |
| | | @Override |
| | | public void onChanged(StraightLineSetting commonSetting) { |
| | | if (commonSetting != null){ |
| | | mStrarightLineSetting = commonSetting; |
| | | setDatas(); |
| | | } |
| | | } |
| | | }); |
| | | return view; |
| | | } |
| | | |
| | | private void initView(View view) { |
| | | |
| | | te_straight_limit_distance = view.findViewById(R.id.straight_limit_distance); |
| | | te_straight_max_offset = view.findViewById(R.id.straight_max_offset); |
| | | |
| | | } |
| | | |
| | | private void setDatas() { |
| | | te_straight_limit_distance.setInput(String.valueOf(mStrarightLineSetting.getStraight_limit_distance())); |
| | | te_straight_max_offset.setInput(String.valueOf(mStrarightLineSetting.getStraight_max_offset())); |
| | | } |
| | | } |
| | |
| | | import android.view.ViewGroup; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.lifecycle.Observer; |
| | | import androidx.lifecycle.ViewModelProviders; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.bean.CommonSetting; |
| | | import safeluck.drive.evaluation.bean.StationSetting; |
| | | import safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText; |
| | | import safeluck.drive.evaluation.viewmodels.CommonSettingViewModel; |
| | | import safeluck.drive.evaluation.viewmodels.StationSettingViewModel; |
| | | |
| | | /** |
| | | * DriveJudge |
| | | * |
| | | * 通过站点设置 |
| | | * Created by lzw on 2020/9/14. 10:16:39 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | |
| | | private static final String ARG_NUMBER = "arg_number"; |
| | | private static final String TAG = FragmentSetting5.class.getSimpleName(); |
| | | |
| | | private StationSetting mStationSetting; |
| | | private StationSettingViewModel mStationSettingViewModel; |
| | | |
| | | private TextEditText te_cross_school_max_speed; |
| | | private TextEditText te_crossing_break_valid_distance; |
| | | private TextEditText te_crossing_stop_valid_distance; |
| | | |
| | | private int mNumber; |
| | | |
| | |
| | | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View view = inflater.inflate(R.layout.layout_fragment_stationsettin, container, false); |
| | | initView(view); |
| | | mStationSettingViewModel = ViewModelProviders.of(this).get(StationSettingViewModel.class); |
| | | mStationSettingViewModel.getStationSetting().observe(this, new Observer<StationSetting>() { |
| | | @Override |
| | | public void onChanged(StationSetting commonSetting) { |
| | | if (commonSetting != null){ |
| | | mStationSetting = commonSetting; |
| | | setDatas(); |
| | | } |
| | | } |
| | | }); |
| | | return view; |
| | | } |
| | | |
| | | private void initView(View view) { |
| | | |
| | | te_cross_school_max_speed = view.findViewById(R.id.cross_school_max_speed); |
| | | te_crossing_break_valid_distance = view.findViewById(R.id.crossing_break_valid_distance); |
| | | te_crossing_stop_valid_distance = view.findViewById(R.id.crossing_stop_valid_distance); |
| | | |
| | | } |
| | | |
| | | private void setDatas() { |
| | | te_cross_school_max_speed.setInput(String.valueOf(mStationSetting.getCross_school_max_speed())); |
| | | te_crossing_break_valid_distance.setInput(String.valueOf(mStationSetting.getCrossing_break_valid_distance())); |
| | | te_crossing_stop_valid_distance.setInput(String.valueOf(mStationSetting.getCrossing_stop_valid_distance())); |
| | | } |
| | | } |
| | |
| | | import android.view.ViewGroup; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.lifecycle.Observer; |
| | | import androidx.lifecycle.ViewModelProviders; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.bean.CommonSetting; |
| | | import safeluck.drive.evaluation.bean.CorneringLampSetting; |
| | | import safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText; |
| | | import safeluck.drive.evaluation.viewmodels.CommonSettingViewModel; |
| | | import safeluck.drive.evaluation.viewmodels.CorneringLampSettingViewModel; |
| | | |
| | | /** |
| | | * DriveJudge |
| | |
| | | |
| | | |
| | | private int mNumber; |
| | | |
| | | private TextEditText te_turn_signal_min_advance; |
| | | private CorneringLampSetting mCornerLampSetting; |
| | | private CorneringLampSettingViewModel corneringLampSettingViewModel; |
| | | |
| | | public static FragmentSetting6 newInstance(String number) { |
| | | FragmentSetting6 fragment = new FragmentSetting6(); |
| | |
| | | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View view = inflater.inflate(R.layout.layout_fragment_setlights, container, false); |
| | | initView(view); |
| | | corneringLampSettingViewModel = ViewModelProviders.of(this).get(CorneringLampSettingViewModel.class); |
| | | corneringLampSettingViewModel.getCorneringLampSetting().observe(this, new Observer<CorneringLampSetting>() { |
| | | @Override |
| | | public void onChanged(CorneringLampSetting commonSetting) { |
| | | if (commonSetting != null){ |
| | | mCornerLampSetting = commonSetting; |
| | | setDatas(); |
| | | } |
| | | } |
| | | }); |
| | | return view; |
| | | } |
| | | |
| | | private void initView(View view) { |
| | | |
| | | te_turn_signal_min_advance = view.findViewById(R.id.turn_signal_min_advance); |
| | | |
| | | } |
| | | |
| | | private void setDatas() { |
| | | te_turn_signal_min_advance.setInput(String.valueOf(mCornerLampSetting.getTurn_signal_min_advance())); |
| | | } |
| | | } |
| | |
| | | import android.view.ViewGroup; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.lifecycle.Observer; |
| | | import androidx.lifecycle.ViewModelProviders; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.bean.CommonSetting; |
| | | import safeluck.drive.evaluation.bean.OverTakeMeetingSetting; |
| | | import safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText; |
| | | import safeluck.drive.evaluation.viewmodels.CommonSettingViewModel; |
| | | import safeluck.drive.evaluation.viewmodels.OverTakeAndMeetingSettingViewModel; |
| | | |
| | | /** |
| | | * DriveJudge |
| | |
| | | private static final String ARG_NUMBER = "arg_number"; |
| | | private static final String TAG = FragmentSetting7.class.getSimpleName(); |
| | | |
| | | private OverTakeAndMeetingSettingViewModel overTakeAndMeetingSettingViewModel; |
| | | private OverTakeMeetingSetting overTakeMeetingSetting; |
| | | |
| | | private int mNumber; |
| | | |
| | | private TextEditText te_overtake_limit_distance; |
| | | |
| | | public static FragmentSetting7 newInstance(String number) { |
| | | FragmentSetting7 fragment = new FragmentSetting7(); |
| | |
| | | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View view = inflater.inflate(R.layout.layout_fragment_over_take, container, false); |
| | | initView(view); |
| | | overTakeAndMeetingSettingViewModel = ViewModelProviders.of(this).get(OverTakeAndMeetingSettingViewModel.class); |
| | | overTakeAndMeetingSettingViewModel.getOverTakeMeetingSetting().observe(this, new Observer<OverTakeMeetingSetting>() { |
| | | @Override |
| | | public void onChanged(OverTakeMeetingSetting commonSetting) { |
| | | if (commonSetting != null){ |
| | | overTakeMeetingSetting = commonSetting; |
| | | setDatas(); |
| | | } |
| | | } |
| | | }); |
| | | return view; |
| | | } |
| | | |
| | | private void initView(View view) { |
| | | |
| | | te_overtake_limit_distance = view.findViewById(R.id.overtake_limit_distance); |
| | | |
| | | } |
| | | |
| | | private void setDatas() { |
| | | if (overTakeMeetingSetting != null){ |
| | | te_overtake_limit_distance.setInput(String.valueOf(overTakeMeetingSetting.getOvertake_limit_distance())); |
| | | } |
| | | } |
| | | } |
| | |
| | | import android.view.ViewGroup; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.lifecycle.Observer; |
| | | import androidx.lifecycle.ViewModelProviders; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.bean.CommonSetting; |
| | | import safeluck.drive.evaluation.bean.SubDecGearSetting; |
| | | import safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText; |
| | | import safeluck.drive.evaluation.viewmodels.CommonSettingViewModel; |
| | | import safeluck.drive.evaluation.viewmodels.SubDecGearSettingViewModel; |
| | | |
| | | /** |
| | | * DriveJudge |
| | |
| | | |
| | | |
| | | private int mNumber; |
| | | |
| | | |
| | | private TextEditText te_shift_limit_distance; |
| | | private TextEditText te_road_shift_hold_time; |
| | | |
| | | private SubDecGearSetting mSubGearSetting; |
| | | private SubDecGearSettingViewModel subDecGearSettingViewModel; |
| | | |
| | | public static FragmentSetting8 newInstance(String number) { |
| | | FragmentSetting8 fragment = new FragmentSetting8(); |
| | |
| | | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View view = inflater.inflate(R.layout.fragment_add_sub_gear_setting_1, container, false); |
| | | initView(view); |
| | | subDecGearSettingViewModel = ViewModelProviders.of(this).get(SubDecGearSettingViewModel.class); |
| | | subDecGearSettingViewModel.getSubDecGearSetting().observe(this, new Observer<SubDecGearSetting>() { |
| | | @Override |
| | | public void onChanged(SubDecGearSetting commonSetting) { |
| | | if (commonSetting != null){ |
| | | mSubGearSetting = commonSetting; |
| | | setDatas(); |
| | | } |
| | | } |
| | | }); |
| | | return view; |
| | | } |
| | | |
| | | private void initView(View view) { |
| | | |
| | | |
| | | te_shift_limit_distance = view.findViewById(R.id.shift_limit_distance); |
| | | te_road_shift_hold_time =view.findViewById(R.id.road_shift_hold_time); |
| | | } |
| | | |
| | | private void setDatas() { |
| | | if (mSubGearSetting != null){ |
| | | te_shift_limit_distance.setInput(String.valueOf(mSubGearSetting.getShift_limit_distance())); |
| | | te_road_shift_hold_time.setInput(String.valueOf(mSubGearSetting.getShift_hold_time())); |
| | | } |
| | | } |
| | | } |
| | |
| | | import android.view.ViewGroup; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.lifecycle.Observer; |
| | | import androidx.lifecycle.ViewModelProviders; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.bean.CommonSetting; |
| | | import safeluck.drive.evaluation.bean.SideStopSetting; |
| | | import safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText; |
| | | import safeluck.drive.evaluation.viewmodels.CommonSettingViewModel; |
| | | import safeluck.drive.evaluation.viewmodels.SideStopSettingViewModel; |
| | | |
| | | /** |
| | | * DriveJudge |
| | |
| | | private static final String ARG_NUMBER = "arg_number"; |
| | | private static final String TAG = FragmentSetting9.class.getSimpleName(); |
| | | |
| | | |
| | | private SideStopSetting mSideStopSetting; |
| | | private SideStopSettingViewModel mSideStopSettingViewModel; |
| | | private int mNumber; |
| | | |
| | | private TextEditText te_road_total_distance; |
| | | private TextEditText te_road_max_speed; |
| | | private TextEditText te_stop_car_open_door_allow_time; |
| | | private TextEditText te_stop_car_limit_distance; |
| | | private TextEditText te_stop_car_edge_red_distance; |
| | | private TextEditText te_stop_car_edge_yellow_distance; |
| | | |
| | | public static FragmentSetting9 newInstance(String number) { |
| | | FragmentSetting9 fragment = new FragmentSetting9(); |
| | |
| | | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View view = inflater.inflate(R.layout.layout_fragment_parkover_1, container, false); |
| | | initView(view); |
| | | mSideStopSettingViewModel = ViewModelProviders.of(this).get(SideStopSettingViewModel.class); |
| | | mSideStopSettingViewModel.getSideStopSetting().observe(this, new Observer<SideStopSetting>() { |
| | | @Override |
| | | public void onChanged(SideStopSetting commonSetting) { |
| | | if (commonSetting != null){ |
| | | mSideStopSetting = commonSetting; |
| | | setDatas(); |
| | | } |
| | | } |
| | | }); |
| | | return view; |
| | | } |
| | | |
| | | private void initView(View view) { |
| | | |
| | | te_road_total_distance = view.findViewById(R.id.road_total_distance); |
| | | te_road_max_speed = view.findViewById(R.id.road_max_speed); |
| | | te_stop_car_open_door_allow_time = view.findViewById(R.id.stop_car_open_door_allow_time); |
| | | te_stop_car_limit_distance = view.findViewById(R.id.stop_car_limit_distance); |
| | | te_stop_car_edge_red_distance = view.findViewById(R.id.stop_car_edge_red_distance); |
| | | te_stop_car_edge_yellow_distance = view.findViewById(R.id.stop_car_edge_yellow_distance); |
| | | |
| | | } |
| | | |
| | | private void setDatas() { |
| | | if (mSideStopSetting != null){ |
| | | te_road_total_distance.setInput(String.valueOf(mSideStopSetting.getRoad_total_distance())); |
| | | te_stop_car_open_door_allow_time.setInput(String.valueOf(mSideStopSetting.getStop_car_open_door_allow_time())); |
| | | te_stop_car_limit_distance.setInput(String.valueOf(mSideStopSetting.getStop_car_limit_distance())); |
| | | te_stop_car_edge_red_distance.setInput(String.valueOf(mSideStopSetting.getStop_car_edge_red_distance())); |
| | | te_stop_car_edge_yellow_distance.setInput(String.valueOf(mSideStopSetting.getStop_car_edge_yellow_distance())); |
| | | te_road_max_speed.setInput(String.valueOf(mSideStopSetting.getRoad_max_speed())); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package safeluck.drive.evaluation.viewmodels |
| | | |
| | | import android.app.Application |
| | | import androidx.lifecycle.* |
| | | import com.google.gson.Gson |
| | | |
| | | import safeluck.drive.evaluation.app |
| | | import safeluck.drive.evaluation.bean.AreaSetting |
| | | import safeluck.drive.evaluation.bean.CommonSetting |
| | | import safeluck.drive.evaluation.util.CThreadPoolExecutor |
| | | import safeluck.drive.evaluation.util.FileUtil |
| | | |
| | | /**DriveJudge |
| | | * |
| | | * 场考设置 |
| | | * Created by lzw on 2020/10/9. 14:22:48 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | class CommonSettingViewModel() : ViewModel() { |
| | | var gson = Gson() |
| | | private val gearRelateSet:MutableLiveData<CommonSetting> by lazy { |
| | | MutableLiveData<CommonSetting>().also { |
| | | loadData() |
| | | } |
| | | } |
| | | |
| | | fun saveCommonSetting(gearRelateSet: CommonSetting){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | FileUtil.writeTxtFileToSD(app.getAppContext(),"common_setting.json",gson.toJson(gearRelateSet),"") |
| | | } |
| | | } |
| | | |
| | | private fun loadData(){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | var buffer =FileUtil.readTxtFileFromSD(app.getAppContext(),"common_setting.json",false) |
| | | var g = gson.fromJson(buffer.toString(),CommonSetting::class.java) |
| | | gearRelateSet.postValue(g) |
| | | } |
| | | } |
| | | |
| | | fun getCommonSetting():LiveData<CommonSetting> { |
| | | return gearRelateSet |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package safeluck.drive.evaluation.viewmodels |
| | | |
| | | import android.app.Application |
| | | import androidx.lifecycle.* |
| | | import com.google.gson.Gson |
| | | |
| | | import safeluck.drive.evaluation.app |
| | | import safeluck.drive.evaluation.bean.* |
| | | import safeluck.drive.evaluation.util.CThreadPoolExecutor |
| | | import safeluck.drive.evaluation.util.FileUtil |
| | | |
| | | /**DriveJudge |
| | | * |
| | | * 转向灯设置 |
| | | * Created by lzw on 2020/10/9. 14:22:48 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | class CorneringLampSettingViewModel() : ViewModel() { |
| | | var gson = Gson() |
| | | private val gearRelateSet:MutableLiveData<CorneringLampSetting> by lazy { |
| | | MutableLiveData<CorneringLampSetting>().also { |
| | | loadData() |
| | | } |
| | | } |
| | | |
| | | fun saveCommonSetting(gearRelateSet: CorneringLampSetting){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | FileUtil.writeTxtFileToSD(app.getAppContext(),"cornerlamp_setting.json",gson.toJson(gearRelateSet),"") |
| | | } |
| | | } |
| | | |
| | | private fun loadData(){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | var buffer =FileUtil.readTxtFileFromSD(app.getAppContext(),"cornerlamp_setting.json",false) |
| | | var g = gson.fromJson(buffer.toString(),CorneringLampSetting::class.java) |
| | | gearRelateSet.postValue(g) |
| | | } |
| | | } |
| | | |
| | | fun getCorneringLampSetting():LiveData<CorneringLampSetting> { |
| | | return gearRelateSet |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package safeluck.drive.evaluation.viewmodels |
| | | |
| | | import android.app.Application |
| | | import androidx.lifecycle.* |
| | | import com.google.gson.Gson |
| | | |
| | | import safeluck.drive.evaluation.app |
| | | import safeluck.drive.evaluation.bean.AreaSetting |
| | | import safeluck.drive.evaluation.bean.CommonSetting |
| | | import safeluck.drive.evaluation.bean.OverTakeMeetingSetting |
| | | import safeluck.drive.evaluation.bean.StartCarSetting |
| | | import safeluck.drive.evaluation.util.CThreadPoolExecutor |
| | | import safeluck.drive.evaluation.util.FileUtil |
| | | |
| | | /**DriveJudge |
| | | * |
| | | * 场考设置 |
| | | * Created by lzw on 2020/10/9. 14:22:48 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | class OverTakeAndMeetingSettingViewModel() : ViewModel() { |
| | | var gson = Gson() |
| | | private val gearRelateSet:MutableLiveData<OverTakeMeetingSetting> by lazy { |
| | | MutableLiveData<OverTakeMeetingSetting>().also { |
| | | loadData() |
| | | } |
| | | } |
| | | |
| | | fun saveCommonSetting(gearRelateSet: OverTakeMeetingSetting){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | FileUtil.writeTxtFileToSD(app.getAppContext(),"overtake_setting.json",gson.toJson(gearRelateSet),"") |
| | | } |
| | | } |
| | | |
| | | private fun loadData(){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | var buffer =FileUtil.readTxtFileFromSD(app.getAppContext(),"overtake_setting.json",false) |
| | | var g = gson.fromJson(buffer.toString(),OverTakeMeetingSetting::class.java) |
| | | gearRelateSet.postValue(g) |
| | | } |
| | | } |
| | | |
| | | fun getOverTakeMeetingSetting():LiveData<OverTakeMeetingSetting> { |
| | | return gearRelateSet |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package safeluck.drive.evaluation.viewmodels |
| | | |
| | | import android.app.Application |
| | | import androidx.lifecycle.* |
| | | import com.google.gson.Gson |
| | | |
| | | import safeluck.drive.evaluation.app |
| | | import safeluck.drive.evaluation.bean.AreaSetting |
| | | import safeluck.drive.evaluation.bean.CommonSetting |
| | | import safeluck.drive.evaluation.bean.SideStopSetting |
| | | import safeluck.drive.evaluation.util.CThreadPoolExecutor |
| | | import safeluck.drive.evaluation.util.FileUtil |
| | | |
| | | /**DriveJudge |
| | | * |
| | | * 场考设置 |
| | | * Created by lzw on 2020/10/9. 14:22:48 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | class SideStopSettingViewModel() : ViewModel() { |
| | | var gson = Gson() |
| | | private val gearRelateSet:MutableLiveData<SideStopSetting> by lazy { |
| | | MutableLiveData<SideStopSetting>().also { |
| | | loadData() |
| | | } |
| | | } |
| | | |
| | | fun saveSideStopSetting(gearRelateSet: SideStopSetting){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | FileUtil.writeTxtFileToSD(app.getAppContext(),"sidestop_setting.json",gson.toJson(gearRelateSet),"") |
| | | } |
| | | } |
| | | |
| | | private fun loadData(){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | var buffer =FileUtil.readTxtFileFromSD(app.getAppContext(),"sidestop_setting.json",false) |
| | | var g = gson.fromJson(buffer.toString(),SideStopSetting::class.java) |
| | | gearRelateSet.postValue(g) |
| | | } |
| | | } |
| | | |
| | | fun getSideStopSetting():LiveData<SideStopSetting> { |
| | | return gearRelateSet |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package safeluck.drive.evaluation.viewmodels |
| | | |
| | | import android.app.Application |
| | | import androidx.lifecycle.* |
| | | import com.google.gson.Gson |
| | | |
| | | import safeluck.drive.evaluation.app |
| | | import safeluck.drive.evaluation.bean.AreaSetting |
| | | import safeluck.drive.evaluation.bean.CommonSetting |
| | | import safeluck.drive.evaluation.bean.StartCarSetting |
| | | import safeluck.drive.evaluation.util.CThreadPoolExecutor |
| | | import safeluck.drive.evaluation.util.FileUtil |
| | | |
| | | /**DriveJudge |
| | | * |
| | | * 场考设置 |
| | | * Created by lzw on 2020/10/9. 14:22:48 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | class StartCarSettingViewModel() : ViewModel() { |
| | | var gson = Gson() |
| | | private val gearRelateSet:MutableLiveData<StartCarSetting> by lazy { |
| | | MutableLiveData<StartCarSetting>().also { |
| | | loadData() |
| | | } |
| | | } |
| | | |
| | | fun saveCommonSetting(gearRelateSet: StartCarSetting){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | FileUtil.writeTxtFileToSD(app.getAppContext(),"startcar_setting.json",gson.toJson(gearRelateSet),"") |
| | | } |
| | | } |
| | | |
| | | private fun loadData(){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | var buffer =FileUtil.readTxtFileFromSD(app.getAppContext(),"startcar_setting.json",false) |
| | | var g = gson.fromJson(buffer.toString(),StartCarSetting::class.java) |
| | | gearRelateSet.postValue(g) |
| | | } |
| | | } |
| | | |
| | | fun getStartCarSetting():LiveData<StartCarSetting> { |
| | | return gearRelateSet |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package safeluck.drive.evaluation.viewmodels |
| | | |
| | | import android.app.Application |
| | | import androidx.lifecycle.* |
| | | import com.google.gson.Gson |
| | | |
| | | import safeluck.drive.evaluation.app |
| | | import safeluck.drive.evaluation.bean.* |
| | | import safeluck.drive.evaluation.util.CThreadPoolExecutor |
| | | import safeluck.drive.evaluation.util.FileUtil |
| | | |
| | | /**DriveJudge |
| | | * |
| | | * 场考设置 |
| | | * Created by lzw on 2020/10/9. 14:22:48 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | class StationSettingViewModel() : ViewModel() { |
| | | var gson = Gson() |
| | | private val gearRelateSet:MutableLiveData<StationSetting> by lazy { |
| | | MutableLiveData<StationSetting>().also { |
| | | loadData() |
| | | } |
| | | } |
| | | |
| | | fun saveCommonSetting(gearRelateSet: StationSetting){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | FileUtil.writeTxtFileToSD(app.getAppContext(),"station_setting.json",gson.toJson(gearRelateSet),"") |
| | | } |
| | | } |
| | | |
| | | private fun loadData(){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | var buffer =FileUtil.readTxtFileFromSD(app.getAppContext(),"station_setting.json",false) |
| | | var g = gson.fromJson(buffer.toString(),StationSetting::class.java) |
| | | gearRelateSet.postValue(g) |
| | | } |
| | | } |
| | | |
| | | fun getStationSetting():LiveData<StationSetting> { |
| | | return gearRelateSet |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package safeluck.drive.evaluation.viewmodels |
| | | |
| | | import android.app.Application |
| | | import androidx.lifecycle.* |
| | | import com.google.gson.Gson |
| | | |
| | | import safeluck.drive.evaluation.app |
| | | import safeluck.drive.evaluation.bean.AreaSetting |
| | | import safeluck.drive.evaluation.bean.CommonSetting |
| | | import safeluck.drive.evaluation.bean.StartCarSetting |
| | | import safeluck.drive.evaluation.bean.StraightLineSetting |
| | | import safeluck.drive.evaluation.util.CThreadPoolExecutor |
| | | import safeluck.drive.evaluation.util.FileUtil |
| | | |
| | | /**DriveJudge |
| | | * |
| | | * 场考设置 |
| | | * Created by lzw on 2020/10/9. 14:22:48 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | class StraightLineSettingViewModel() : ViewModel() { |
| | | var gson = Gson() |
| | | private val gearRelateSet:MutableLiveData<StraightLineSetting> by lazy { |
| | | MutableLiveData<StraightLineSetting>().also { |
| | | loadData() |
| | | } |
| | | } |
| | | |
| | | fun saveCommonSetting(gearRelateSet: StraightLineSetting){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | FileUtil.writeTxtFileToSD(app.getAppContext(),"straightline_setting.json",gson.toJson(gearRelateSet),"") |
| | | } |
| | | } |
| | | |
| | | private fun loadData(){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | var buffer =FileUtil.readTxtFileFromSD(app.getAppContext(),"straightline_setting.json",false) |
| | | var g = gson.fromJson(buffer.toString(),StraightLineSetting::class.java) |
| | | gearRelateSet.postValue(g) |
| | | } |
| | | } |
| | | |
| | | fun getStraightLineSetting():LiveData<StraightLineSetting> { |
| | | return gearRelateSet |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package safeluck.drive.evaluation.viewmodels |
| | | |
| | | import android.app.Application |
| | | import androidx.lifecycle.* |
| | | import com.google.gson.Gson |
| | | |
| | | import safeluck.drive.evaluation.app |
| | | import safeluck.drive.evaluation.bean.* |
| | | import safeluck.drive.evaluation.util.CThreadPoolExecutor |
| | | import safeluck.drive.evaluation.util.FileUtil |
| | | |
| | | /**DriveJudge |
| | | * |
| | | * 场考设置 |
| | | * Created by lzw on 2020/10/9. 14:22:48 |
| | | * 邮箱:632393724@qq.com |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | class SubDecGearSettingViewModel() : ViewModel() { |
| | | var gson = Gson() |
| | | private val gearRelateSet:MutableLiveData<SubDecGearSetting> by lazy { |
| | | MutableLiveData<SubDecGearSetting>().also { |
| | | loadData() |
| | | } |
| | | } |
| | | |
| | | fun saveSubDecGearSetting(gearRelateSet: SubDecGearSetting){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | FileUtil.writeTxtFileToSD(app.getAppContext(),"subdecGear_setting.json",gson.toJson(gearRelateSet),"") |
| | | } |
| | | } |
| | | |
| | | private fun loadData(){ |
| | | CThreadPoolExecutor.runInBackground { |
| | | var buffer =FileUtil.readTxtFileFromSD(app.getAppContext(),"subdecGear_setting.json",false) |
| | | var g = gson.fromJson(buffer.toString(),SubDecGearSetting::class.java) |
| | | gearRelateSet.postValue(g) |
| | | } |
| | | } |
| | | |
| | | fun getSubDecGearSetting():LiveData<SubDecGearSetting> { |
| | | return gearRelateSet |
| | | } |
| | | } |
| | | |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:txt_des_tvedit = "全程考试里程/米" |
| | | android:id="@+id/road_max_dist" |
| | | android:id="@+id/road_total_distance" |
| | | app:et_input="3000" |
| | | /> |
| | | <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:txt_des_tvedit = "下车时车门允许开启的时间/秒" |
| | | android:id="@+id/road_stop_open_door_time" |
| | | android:id="@+id/stop_car_open_door_allow_time" |
| | | app:et_input="17" |
| | | /> |
| | | <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:txt_des_tvedit = "靠边停车行驶距离限制/米" |
| | | android:id="@+id/road_stop_dist" |
| | | android:id="@+id/stop_car_limit_distance" |
| | | app:et_input="150" |
| | | /> <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:txt_des_tvedit = "靠边停车边沿到线距离(红牌)/米" |
| | | android:id="@+id/road_stop_edge_red_dist" |
| | | android:id="@+id/stop_car_edge_red_distance" |
| | | app:et_input="3000" |
| | | /><safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:txt_des_tvedit = "靠边停车边沿到线距离(黄牌)/米" |
| | | android:id="@+id/road_stop_edge_yellow_dist" |
| | | android:id="@+id/stop_car_edge_yellow_distance" |
| | | app:et_input="17" |
| | | /> |
| | | |
| | |
| | | <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/cross_school_max_speed" |
| | | app:txt_des_tvedit = "学校/车站/横道区域最高速度KM/H" |
| | | app:et_input="30" |
| | | /> |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:txt_des_tvedit = "通过学校/车站/横道,距离检查点的有效距离(米)" |
| | | android:id="@+id/crossing_break_valid_distance" |
| | | app:et_input="30" |
| | | /> |
| | | <safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:txt_des_tvedit = "停止线外需停车时,距停止线有效距离(米)" |
| | | android:id="@+id/crossing_stop_valid_distance" |
| | | app:et_input="3.0" |
| | | /> |
| | | |