public void Read_SDtoView(Controller_View cv) { float rfdata[] = {0, 0, 0, (float) 0.6, 30}; GeneralTool.read2vFromSDcard_value(file_config, rfdata, 5); SFM1_4 = (int) rfdata[0]; EFM1_4 = (int) rfdata[1]; MODE = (int) rfdata[2]; STEP_PARAM = rfdata[3]; DISTANCE = rfdata[4]; cv.edit_start.setText("" + SFM1_4); cv.edit_end.setText("" + EFM1_4); cv.edit_stepparam.setText("" + GeneralTool.cut_decimal(STEP_PARAM, 2)); // 截取小数点后2两位,显示 cv.edit_distance.setText("" + DISTANCE); // 提示信息 cv.edit_mode.setText(""); cv.edit_mode.setHint(Selector_Model.name_mode[MODE]); }
public void GetPointsLine() { // 数组扩容2倍 if (pointsLine.length < bufflength) { pointsLine = GeneralTool.enlarge_float(pointsLine, iLastIndex); } if (iLastIndex < 4) { pointsLine[0] = StepTranslate[0]; pointsLine[1] = StepTranslate[1]; pointsLine[2] = StepTranslate[0]; pointsLine[3] = StepTranslate[1]; } else { pointsLine[iLastIndex - 2] = StepTranslate[0]; pointsLine[iLastIndex - 1] = StepTranslate[1]; pointsLine[iLastIndex] = StepTranslate[0]; pointsLine[iLastIndex + 1] = StepTranslate[1]; pointsLine[iLastIndex + 2] = StepTranslate[0]; pointsLine[iLastIndex + 3] = StepTranslate[1]; } iLastIndex = (iLastIndex + 4) % bufflength; }
// 把es--SFM1_4,ee--EFM1_4,md--MODE,sp--STEP_PARAM保存到SD卡中 public void Read_ViewtoSD(EditText es, EditText ee, EditText md, EditText sp, EditText ed) { // 从界面获取参数 MODE = parse_mode(md); SFM1_4 = Integer.parseInt(es.getText().toString()); EFM1_4 = Integer.parseInt(ee.getText().toString()); STEP_PARAM = Float.parseFloat(sp.getText().toString()); DISTANCE = Float.parseFloat(ed.getText().toString()); // 提示信息 md.setText(""); md.setHint(Selector_Model.name_mode[MODE]); // 存储参数 GeneralTool.removefile(file_config); GeneralTool.saveToSDcard(SFM1_4, file_config); GeneralTool.saveToSDcard(EFM1_4, file_config); GeneralTool.saveToSDcard(MODE, file_config); GeneralTool.saveToSDcard(STEP_PARAM, file_config); GeneralTool.saveToSDcard(DISTANCE, file_config); }