|  |  | @ -57,6 +57,7 @@ import com.bingce.totalstation.TsConfig; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.bingce.utils.IntentUtil; |  |  |  | import com.bingce.utils.IntentUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.bingce.utils.PointUtils; |  |  |  | import com.bingce.utils.PointUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.bingce.utils.SoundPoolUtil; |  |  |  | import com.bingce.utils.SoundPoolUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.bingce.utils.StringUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.bingce.utils.ThreadPoolUtil; |  |  |  | import com.bingce.utils.ThreadPoolUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.bingce.utils.Util; |  |  |  | import com.bingce.utils.Util; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.project.survey.App; |  |  |  | import com.project.survey.App; | 
			
		
	
	
		
		
			
				
					|  |  | @ -85,6 +86,8 @@ import blankj.utilcode.util.ToastUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import blankj.utilcode.util.Utils; |  |  |  | import blankj.utilcode.util.Utils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.liuyanbing.surveyor.model.base.BasePoint; |  |  |  | import cn.liuyanbing.surveyor.model.base.BasePoint; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.liuyanbing.surveyor.model.util.CUtil; |  |  |  | import cn.liuyanbing.surveyor.model.util.CUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import google.gson.Gson; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import google.gson.reflect.TypeToken; | 
			
		
	
		
		
			
				
					
					|  |  |  | import lecho.hellocharts.listener.LineChartOnValueSelectListener; |  |  |  | import lecho.hellocharts.listener.LineChartOnValueSelectListener; | 
			
		
	
		
		
			
				
					
					|  |  |  | import lecho.hellocharts.model.Line; |  |  |  | import lecho.hellocharts.model.Line; | 
			
		
	
		
		
			
				
					
					|  |  |  | import lecho.hellocharts.model.LineChartData; |  |  |  | import lecho.hellocharts.model.LineChartData; | 
			
		
	
	
		
		
			
				
					|  |  | @ -125,6 +128,7 @@ public class PointStakingActivity extends BaseSurveyNewActivity { | 
			
		
	
		
		
			
				
					
					|  |  |  |     private final List<String> methodList = new ArrayList<>(); |  |  |  |     private final List<String> methodList = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |     private SharedPreferences preferences; |  |  |  |     private SharedPreferences preferences; | 
			
		
	
		
		
			
				
					
					|  |  |  |     private boolean isFirstUpdateChartView; |  |  |  |     private boolean isFirstUpdateChartView; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private boolean mStakingPointIsInMemory = false; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Override |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |     public View getContentView() { |  |  |  |     public View getContentView() { | 
			
		
	
	
		
		
			
				
					|  |  | @ -220,7 +224,8 @@ public class PointStakingActivity extends BaseSurveyNewActivity { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 }); |  |  |  |                 }); | 
			
		
	
		
		
			
				
					
					|  |  |  |         //点库选点
 |  |  |  |         //点库选点
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         binding.pointLibrary.setOnClickListener(v -> |  |  |  |         binding.pointLibrary.setOnClickListener(v -> { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (mStakingPointIsInMemory) return; | 
			
		
	
		
		
			
				
					
					|  |  |  |             CustomRecycleDialog.showDialog(PointStakingActivity.this, R.string.data_source, stringListLibraty, 0, false, (index, itemString) -> { |  |  |  |             CustomRecycleDialog.showDialog(PointStakingActivity.this, R.string.data_source, stringListLibraty, 0, false, (index, itemString) -> { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 stopSoundPool(); |  |  |  |                 stopSoundPool(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 switch (index) { |  |  |  |                 switch (index) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -242,7 +247,9 @@ public class PointStakingActivity extends BaseSurveyNewActivity { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         }); |  |  |  |                         }); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         break; |  |  |  |                         break; | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 })); |  |  |  |             }); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         //移动方法
 |  |  |  |         //移动方法
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         showTopMoveMethod(); |  |  |  |         showTopMoveMethod(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         binding.tvMoveMethod.setOnClickListener(v -> { |  |  |  |         binding.tvMoveMethod.setOnClickListener(v -> { | 
			
		
	
	
		
		
			
				
					|  |  | @ -408,7 +415,69 @@ public class PointStakingActivity extends BaseSurveyNewActivity { | 
			
		
	
		
		
			
				
					
					|  |  |  |         stringListLibraty.add(getString(R.string.global_control_point)); |  |  |  |         stringListLibraty.add(getString(R.string.global_control_point)); | 
			
		
	
		
		
			
				
					
					|  |  |  |         stringListLibraty.add(getString(R.string.point_survey_point_library)); |  |  |  |         stringListLibraty.add(getString(R.string.point_survey_point_library)); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        PointDb.getInstance().rawQueryListLiveData(PointConstants.findKnownPointByJob(jobId())).observe(this, pointRecords -> {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            surveyBasePointLine.getValues().clear();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            stakingPointLine.getValues().clear();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            recordPointLine.getValues().clear();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            effectGuideLine.getValues().clear();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            stakingLibraryPointList.clear();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            stakingLibraryPointList.addAll(pointRecords);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            for (int i = 0; i < stakingLibraryPointList.size(); i++) {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                PointRecord pointRecord = stakingLibraryPointList.get(i);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                surveyBasePointLine.getValues().add(new PointValue(pointRecord.y, pointRecord.x).setLabel(pointRecord.name));
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            if (stakingLibraryPointList.size() > 0) {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                targetStakePointRecord = stakingLibraryPointList.get(0);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                stakingPointLine.getValues().add(new PointValue(targetStakePointRecord.y, targetStakePointRecord.x).setLabel(targetStakePointRecord.name));
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                updateBottomInfo(targetStakePointRecord.name, targetStakePointRecord.x, targetStakePointRecord.y, targetStakePointRecord.h);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                drawRecordPointLine();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                if (currentCoordinate != null) {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                    drawCurrentPointLine(currentCoordinate.getX(), currentCoordinate.getY(), currentCoordinate.getZ());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                    updateTopInfo(currentCoordinate);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                } else {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                    showTopMoveMethod();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                isTirpsAddSP = false;
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            } else {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                targetStakePointRecord = null;
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                binding.tvStakingPointName.setText(getString(R.string.staking_point_name));
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                binding.tvTargetX.setText(TextFactory.fixedString("X"));
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                binding.tvTargetY.setText(TextFactory.fixedString("Y"));
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                binding.tvTargetZ.setText(TextFactory.fixedString("Z"));
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                showTopMoveMethod();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                isTirpsAddSP = true;
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            ((LineChartRenderer) binding.lineChartView.getChartRenderer()).calculateMaxViewport(1.5f);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            binding.lineChartView.onChartDataChange();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            binding.lineChartView.setCurrentViewport(binding.lineChartView.getMaximumViewport());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        });
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String targetPointList = IntentUtil.stringExtra(this, KEY_POINT_LIST); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (StringUtil.isEmpty(targetPointList)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             PointDb.getInstance().rawQueryListLiveData(PointConstants.findKnownPointByJob(jobId())).observe(this, pointRecords -> { |  |  |  |             PointDb.getInstance().rawQueryListLiveData(PointConstants.findKnownPointByJob(jobId())).observe(this, pointRecords -> { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 onPointRecordsUpdate(pointRecords); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             mStakingPointIsInMemory = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             Gson gson = new Gson(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             List<StakingPoint> points = gson.fromJson(targetPointList, new TypeToken<List<StakingPoint>>() { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             }.getType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             List<PointRecord> pointRecords = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             for (StakingPoint point : points) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 pointRecords.add(new PointRecord( | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         "", "", "", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         point.getCategory(), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         point.getName(), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         "", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         "", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         point.getX(), point.getY(), point.getZ(), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         0, 0, 0, PointConstants.POINT_FORMAT_XYZ, new DeviceInfoData())); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             onPointRecordsUpdate(pointRecords); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private void onPointRecordsUpdate(List<PointRecord> pointRecords) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         surveyBasePointLine.getValues().clear(); |  |  |  |         surveyBasePointLine.getValues().clear(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         stakingPointLine.getValues().clear(); |  |  |  |         stakingPointLine.getValues().clear(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         recordPointLine.getValues().clear(); |  |  |  |         recordPointLine.getValues().clear(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -443,7 +512,6 @@ public class PointStakingActivity extends BaseSurveyNewActivity { | 
			
		
	
		
		
			
				
					
					|  |  |  |         ((LineChartRenderer) binding.lineChartView.getChartRenderer()).calculateMaxViewport(1.5f); |  |  |  |         ((LineChartRenderer) binding.lineChartView.getChartRenderer()).calculateMaxViewport(1.5f); | 
			
		
	
		
		
			
				
					
					|  |  |  |         binding.lineChartView.onChartDataChange(); |  |  |  |         binding.lineChartView.onChartDataChange(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         binding.lineChartView.setCurrentViewport(binding.lineChartView.getMaximumViewport()); |  |  |  |         binding.lineChartView.setCurrentViewport(binding.lineChartView.getMaximumViewport()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         }); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     private void watchSurvey() { |  |  |  |     private void watchSurvey() { | 
			
		
	
	
		
		
			
				
					|  |  | @ -553,6 +621,23 @@ public class PointStakingActivity extends BaseSurveyNewActivity { | 
			
		
	
		
		
			
				
					
					|  |  |  |             ToastUtils.showShort(getString(R.string.add_points_staking_point_first)); |  |  |  |             ToastUtils.showShort(getString(R.string.add_points_staking_point_first)); | 
			
		
	
		
		
			
				
					
					|  |  |  |             return; |  |  |  |             return; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (mStakingPointIsInMemory) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             int currentIndex = -1; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             for (int i = 0; i < stakingLibraryPointList.size(); i++) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (stakingLibraryPointList.get(i) == targetStakePointRecord) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     currentIndex = i; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     break; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (currentIndex == -1) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             currentIndex += stakingLibraryPointList.size(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             int targetIndex = (nextOrLast ? currentIndex + 1 : currentIndex - 1) % stakingLibraryPointList.size(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             targetStakePointRecord = stakingLibraryPointList.get(targetIndex); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             updateUI(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         ThreadPoolUtil.execute(() -> { |  |  |  |         ThreadPoolUtil.execute(() -> { | 
			
		
	
		
		
			
				
					
					|  |  |  |             String projectId = CachedProject.currentProjectId(); |  |  |  |             String projectId = CachedProject.currentProjectId(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             String jobId = CachedCurrentJob.currentJobId(projectId); |  |  |  |             String jobId = CachedCurrentJob.currentJobId(projectId); | 
			
		
	
	
		
		
			
				
					|  |  | @ -1132,6 +1217,16 @@ public class PointStakingActivity extends BaseSurveyNewActivity { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return IntentUtil.stringExtra(getIntent(), KEY_JOB_ID); |  |  |  |         return IntentUtil.stringExtra(getIntent(), KEY_JOB_ID); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private static final String KEY_POINT_LIST = "key_point_list"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public static void start(Context context, List<StakingPoint> stakingPointList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         Gson gson = new Gson(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         Intent intent = new Intent(context, PointStakingActivity.class); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         intent.putExtra(KEY_POINT_LIST, gson.toJson(stakingPointList)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         context.startActivity(intent); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public static void start(Context context) { |  |  |  |     public static void start(Context context) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         ThreadPoolUtil.execute(() -> { |  |  |  |         ThreadPoolUtil.execute(() -> { | 
			
		
	
		
		
			
				
					
					|  |  |  |             String projectId = CachedProject.currentProjectId(); |  |  |  |             String projectId = CachedProject.currentProjectId(); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |