|
|
|
@ -1,9 +1,6 @@ |
|
|
|
|
package com.project.survey.ui.lofting.pointlofting; |
|
|
|
|
|
|
|
|
|
import static com.bingce.surveyor.util.ConstUtils.intentConst.KEY_JOB_ID; |
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint; |
|
|
|
|
import android.app.Activity; |
|
|
|
|
import android.content.Context; |
|
|
|
|
import android.content.Intent; |
|
|
|
|
import android.content.SharedPreferences; |
|
|
|
@ -11,6 +8,8 @@ import android.graphics.DashPathEffect; |
|
|
|
|
import android.text.TextUtils; |
|
|
|
|
import android.view.View; |
|
|
|
|
|
|
|
|
|
import androidx.lifecycle.Observer; |
|
|
|
|
import androidx.lifecycle.ViewModelProvider; |
|
|
|
|
import androidx.preference.PreferenceManager; |
|
|
|
|
import androidx.sqlite.db.SimpleSQLiteQuery; |
|
|
|
|
|
|
|
|
@ -23,7 +22,6 @@ import com.bingce.coordlib.util.CoordUtil; |
|
|
|
|
import com.bingce.data.DeviceInfoData; |
|
|
|
|
import com.bingce.data.cache.CachedCurrentJob; |
|
|
|
|
import com.bingce.data.cache.CachedCurrentRoad; |
|
|
|
|
import com.bingce.data.cache.CachedCurrentRoadKt; |
|
|
|
|
import com.bingce.data.cache.CachedProject; |
|
|
|
|
import com.bingce.data.database.DBQueryConstant; |
|
|
|
|
import com.bingce.data.database.PointDb; |
|
|
|
@ -59,19 +57,23 @@ import com.bingce.utils.ThreadPoolUtil; |
|
|
|
|
import com.bingce.utils.Util; |
|
|
|
|
import com.project.survey.App; |
|
|
|
|
import com.project.survey.R; |
|
|
|
|
import com.project.survey.constants.SPConstants; |
|
|
|
|
import com.project.survey.databinding.ActivityPointStakingBinding; |
|
|
|
|
import com.project.survey.dialog.CustomInputListDialog; |
|
|
|
|
import com.project.survey.dialog.CustomLineChartDialog; |
|
|
|
|
import com.project.survey.logic.viewmodel.ProjectViewModel; |
|
|
|
|
import com.project.survey.model.ControlRecord; |
|
|
|
|
import com.project.survey.model.LoftingPointBean; |
|
|
|
|
import com.project.survey.model.LoftingPointListBean; |
|
|
|
|
import com.project.survey.model.LoftingPointRecordEntry; |
|
|
|
|
import com.project.survey.ui.base.BaseSurveyNewActivity; |
|
|
|
|
import com.project.survey.ui.instrument.setupstation.ControlPointsNewActivity; |
|
|
|
|
import com.project.survey.ui.instrument.setupstation.CoordinatePointsLibraryActivity; |
|
|
|
|
import com.project.survey.ui.instrument.setupstation.StakingNewJobActivity; |
|
|
|
|
import com.project.survey.ui.lofting.pointlofting.record.RecordsActivity; |
|
|
|
|
import com.project.survey.ui.lofting.pointlofting.record.util.RecordTypeConstants; |
|
|
|
|
import com.project.survey.ui.pointmeasure.measure.util.SurveyToolBarClickListenerUtils; |
|
|
|
|
import com.project.survey.util.CommonUtils; |
|
|
|
|
import com.project.survey.util.DeviceConnectUtil; |
|
|
|
|
import com.project.survey.util.SPUtils; |
|
|
|
|
import com.project.survey.util.SurveyUIUtils; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
@ -96,6 +98,7 @@ import lecho.hellocharts.renderer.LineChartRenderer; |
|
|
|
|
*/ |
|
|
|
|
public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
|
|
|
|
|
private ProjectViewModel viewModel; |
|
|
|
|
private Context mContext; |
|
|
|
|
private ActivityPointStakingBinding binding; |
|
|
|
|
private final Line currentPointLine = new Line(); //实测点
|
|
|
|
@ -105,12 +108,12 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
private final Line effectGuideLine = new Line(); //放样引导线
|
|
|
|
|
private final Line effectHorLine = new Line(); //放样提示横向虚线
|
|
|
|
|
private final Line effectVerLine = new Line(); //放样提示纵向虚线
|
|
|
|
|
private final List<PointRecord> stakingLibraryPointList = new ArrayList<>(); |
|
|
|
|
private final List<PointRecord> stakingLibraryPointList = new ArrayList<>(); //放样点列表
|
|
|
|
|
private List<PointStakeRecord> recordStakingBasePointList; |
|
|
|
|
private PointRecord targetStakePointRecord; |
|
|
|
|
private Coordinate currentCoordinate; |
|
|
|
|
private Coordinate currentSmoothCoordinate; |
|
|
|
|
// protected final CachedCurrentRoadKt cachedRoadKt = new CachedCurrentRoadKt(this);
|
|
|
|
|
// protected final CachedCurrentRoadKt cachedRoadKt = new CachedCurrentRoadKt(this);
|
|
|
|
|
private final SurveyRemarksUtils surveyRemarksUtils = new SurveyRemarksUtils(); |
|
|
|
|
private IText distance, moveWestEast, moveSouthNorth, moveDigFill, moveLeftRight, moveBeforeAfter; |
|
|
|
|
private MoveValue<MoveK> moveK; |
|
|
|
@ -126,6 +129,8 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
private boolean isFirstUpdateChartView; |
|
|
|
|
private boolean mStakingPointIsInMemory = false; |
|
|
|
|
|
|
|
|
|
private String workId = ""; //作业ID
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public View getContentView() { |
|
|
|
|
binding = ActivityPointStakingBinding.inflate(getLayoutInflater()); |
|
|
|
@ -135,7 +140,10 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
@Override |
|
|
|
|
protected void initView() { |
|
|
|
|
mContext = this; |
|
|
|
|
workId = IntentUtil.stringExtra(this, KEY_WORK_ID); |
|
|
|
|
viewModel = new ViewModelProvider(this).get(ProjectViewModel.class); |
|
|
|
|
preferences = PreferenceManager.getDefaultSharedPreferences(this); |
|
|
|
|
// 指南针角度
|
|
|
|
|
targetCompassHelper.register(angle -> { |
|
|
|
|
binding.dirCompass.setAngle(angle); |
|
|
|
|
}); |
|
|
|
@ -149,13 +157,13 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
baseSurveyActivityUtils.activityBaseSurveyBinding, |
|
|
|
|
binding.baseSurveyStakingSetting, new SurveyToolBarClickListenerUtils.IToolBarClickListener() { |
|
|
|
|
@Override |
|
|
|
|
public void onSettingClickListener() { |
|
|
|
|
public void onSettingClickListener() { //设置
|
|
|
|
|
stopSoundPool(); |
|
|
|
|
PointStakingSettingActivity.start(mContext); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void onPositionCenterClickListener() { |
|
|
|
|
public void onPositionCenterClickListener() { //居中
|
|
|
|
|
if (currentCoordinate == null) { |
|
|
|
|
ToastUtils.showShort(getString(R.string.please_observe_measure_first)); |
|
|
|
|
return; |
|
|
|
@ -165,7 +173,7 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void onFullScreenClickListener() { |
|
|
|
|
public void onFullScreenClickListener() { // 全图
|
|
|
|
|
ChartViewUtils.centerInScreen(binding.lineChartView); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -193,8 +201,10 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
//点库选点
|
|
|
|
|
binding.pointLibrary.setOnClickListener(v -> { |
|
|
|
|
if (mStakingPointIsInMemory) return; |
|
|
|
|
StakingNewJobActivity.pickPoint(this, (pointId, pointsListIndex, name, x, y, z) -> |
|
|
|
|
onPickedPoint(true, pointId, name, x, y, z)); |
|
|
|
|
StakingNewJobActivity.start(this, workId, pointId -> { |
|
|
|
|
targetStakePointRecord = stakingLibraryPointList.stream().filter(p -> p.id.equals(pointId)).findFirst().get(); |
|
|
|
|
updateUI(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
//移动方法
|
|
|
|
|
showTopMoveMethod(); |
|
|
|
@ -339,7 +349,7 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
} |
|
|
|
|
String content = getString(R.string.whether_staking_selected_point) + getString(R.string.colon) + stakingLibraryPointList.get(pointIndex).name + "\n" |
|
|
|
|
+ "X" + getString(R.string.colon) + Util.formatDouble2Double(stakingLibraryPointList.get(pointIndex).x, 6) + " " |
|
|
|
|
+ "Y" + getString(R.string.colon) + Util.formatDouble2Double(stakingLibraryPointList.get(pointIndex).y, 6)+ "\n" |
|
|
|
|
+ "Y" + getString(R.string.colon) + Util.formatDouble2Double(stakingLibraryPointList.get(pointIndex).y, 6) + "\n" |
|
|
|
|
+ "Z" + getString(R.string.colon) + Util.formatDouble2Double(stakingLibraryPointList.get(pointIndex).h, 6); |
|
|
|
|
builder.setContent(content).setButtonConfirm(v -> { |
|
|
|
|
targetStakePointRecord = stakingLibraryPointList.get(pointIndex); |
|
|
|
@ -357,29 +367,58 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected void initData() { |
|
|
|
|
String targetPointList = IntentUtil.stringExtra(this, KEY_POINT_LIST); |
|
|
|
|
if (StringUtil.isEmpty(targetPointList)) { |
|
|
|
|
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(), |
|
|
|
|
viewModel.getErrorResponse().observe(this, ToastUtils::showShort); |
|
|
|
|
// 上传测点记录成功
|
|
|
|
|
viewModel.getUploadLoftingPointRecordResponse().observe(this, ToastUtils::showShort); |
|
|
|
|
// 放样点列表
|
|
|
|
|
viewModel.getLoftingPointListResponse().observe(this, loftingPointListBeans -> { |
|
|
|
|
List<PointRecord> pointRecordList = new ArrayList<>(); |
|
|
|
|
for (LoftingPointBean point : loftingPointListBeans) { |
|
|
|
|
PointRecord pointRecord = new PointRecord( |
|
|
|
|
SPUtils.INSTANCE.getString(SPConstants.PROJECT_ID, ""), workId, "", |
|
|
|
|
3, |
|
|
|
|
point.getZBSJ_D_NAME(), |
|
|
|
|
"", |
|
|
|
|
"", |
|
|
|
|
point.getX(), point.getY(), point.getZ(), |
|
|
|
|
0, 0, 0, PointConstants.POINT_FORMAT_XYZ, new DeviceInfoData())); |
|
|
|
|
Double.parseDouble(point.getZBSJ_FYZB_X()), Double.parseDouble(point.getZBSJ_FYZB_Y()), Double.parseDouble(point.getZBSJ_FYZB_Z()), |
|
|
|
|
0, 0, 0, PointConstants.POINT_FORMAT_XYZ, new DeviceInfoData()); |
|
|
|
|
pointRecord.id = point.getBD_ZYLBMX_ID(); |
|
|
|
|
pointRecordList.add(pointRecord); |
|
|
|
|
} |
|
|
|
|
onPointRecordsUpdate(pointRecords); |
|
|
|
|
} |
|
|
|
|
onPointRecordsUpdate(pointRecordList); |
|
|
|
|
// 保存到数据库
|
|
|
|
|
ThreadPoolUtil.execute(() -> { |
|
|
|
|
PointDb.getInstance().save(pointRecordList); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// 获取放样点
|
|
|
|
|
viewModel.fetchLoftingPointList(workId); |
|
|
|
|
|
|
|
|
|
// String targetPointList = IntentUtil.stringExtra(this, KEY_POINT_LIST);
|
|
|
|
|
// String targetPointList = "";
|
|
|
|
|
// if (StringUtil.isEmpty(targetPointList)) {
|
|
|
|
|
// 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) { |
|
|
|
@ -391,9 +430,10 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
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) { |
|
|
|
|
if (!stakingLibraryPointList.isEmpty()) { //待放样点列表不为空
|
|
|
|
|
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); |
|
|
|
@ -434,13 +474,16 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
private CustomLineChartDialog customDialog; |
|
|
|
|
private boolean isControlSurvey; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 观测并记录 |
|
|
|
|
*/ |
|
|
|
|
private void watchSurveyRecord() { |
|
|
|
|
if (DeviceConnectUtil.isDeviceConnectSelectDialog(this, baseSurveyActivityUtils.activityBaseSurveyBinding)) { |
|
|
|
|
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_TS) { |
|
|
|
|
isTsWatchRecord = true; |
|
|
|
|
if (currentCoordinate != null) { |
|
|
|
|
if (targetStakePointRecord == null) { |
|
|
|
|
ToastUtils.showShort(getString(R.string.add_points_staking_point_first)); |
|
|
|
|
ToastUtils.showShort(R.string.add_points_staking_point_first); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
SurveyLimitCheckUtils.checkStakingLimit(this, currentCoordinate, new Coordinate(targetStakePointRecord.x, targetStakePointRecord.y), (currentCoordinate, targetCoordinate) -> recordPoint()); |
|
|
|
@ -449,15 +492,15 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (targetStakePointRecord == null) { |
|
|
|
|
ToastUtils.showShort(getString(R.string.add_points_staking_point_first)); |
|
|
|
|
ToastUtils.showShort(R.string.add_points_staking_point_first); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// 平滑点数
|
|
|
|
|
boolean isSmoothStaking = PreferencesUtil.getPreferenceInt(ConstUtils.preferConst.rtkStakingSmoothPointsNumber, 1) != 1; |
|
|
|
|
if (isSmoothStaking) { |
|
|
|
|
lineChartViewBuilder = new CustomLineChartDialog.Builder(this).setTitle(getString(R.string.staking_points_being_collected)); |
|
|
|
|
lineChartViewBuilder.setButtonConfirmTextColor(R.color.color_E2E1DD); |
|
|
|
|
lineChartViewBuilder.setButtonConfirm(v -> { |
|
|
|
|
|
|
|
|
|
SurveyLimitCheckUtils.checkStakingLimit(this, currentSmoothCoordinate, new Coordinate(targetStakePointRecord.x, targetStakePointRecord.y), (currentCoordinate, targetCoordinate) -> recordPoint()); |
|
|
|
|
}); |
|
|
|
|
// lineChartViewBuilder.setButtonConfirm(v -> checkRtkStringLimit());
|
|
|
|
@ -498,11 +541,11 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
|
|
|
|
|
private void onRecentlyPoint() { |
|
|
|
|
if (currentCoordinate == null) { |
|
|
|
|
ToastUtils.showShort(getString(R.string.return_coordinate_empty_check_device)); |
|
|
|
|
ToastUtils.showShort(R.string.return_coordinate_empty_check_device); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (targetStakePointRecord == null) { |
|
|
|
|
ToastUtils.showShort(getString(R.string.add_points_staking_point_first)); |
|
|
|
|
ToastUtils.showShort(R.string.add_points_staking_point_first); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (stakingLibraryPointList.size() > 0) { |
|
|
|
@ -521,7 +564,10 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void onLastOrNextPoint(boolean nextOrLast) { |
|
|
|
|
/** |
|
|
|
|
* @param isLast true上一个,false下一个 |
|
|
|
|
*/ |
|
|
|
|
private void onLastOrNextPoint(boolean isLast) { |
|
|
|
|
if (targetStakePointRecord == null) { |
|
|
|
|
ToastUtils.showShort(getString(R.string.add_points_staking_point_first)); |
|
|
|
|
return; |
|
|
|
@ -538,51 +584,42 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
currentIndex += stakingLibraryPointList.size(); |
|
|
|
|
int targetIndex = (nextOrLast ? currentIndex + 1 : currentIndex - 1) % stakingLibraryPointList.size(); |
|
|
|
|
int targetIndex = (isLast ? currentIndex + 1 : currentIndex - 1) % stakingLibraryPointList.size(); |
|
|
|
|
targetStakePointRecord = stakingLibraryPointList.get(targetIndex); |
|
|
|
|
updateUI(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
ThreadPoolUtil.execute(() -> { |
|
|
|
|
String projectId = CachedProject.currentProjectId(); |
|
|
|
|
String jobId = CachedCurrentJob.currentJobId(projectId); |
|
|
|
|
PointRecord pointRecord = PointDb.getInstance().rawQueryData(PointConstants.findLastNextKnownPointByJobAndDate(jobId, targetStakePointRecord.createDate, nextOrLast)); |
|
|
|
|
runOnUiThread(() -> { |
|
|
|
|
if (pointRecord == null) { |
|
|
|
|
ToastUtils.showShort(nextOrLast ? getString(R.string.the_first_staking_point_list) : getString(R.string.the_last_staking_point_list)); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
targetStakePointRecord = pointRecord; |
|
|
|
|
|
|
|
|
|
// 当前点所在列表位置
|
|
|
|
|
int currentPosition = stakingLibraryPointList.indexOf(targetStakePointRecord); |
|
|
|
|
if (isLast) { //上一个
|
|
|
|
|
if (currentPosition > 0) { //有上一个
|
|
|
|
|
targetStakePointRecord = stakingLibraryPointList.get(currentPosition - 1); |
|
|
|
|
updateUI(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 点库返回选择的点 |
|
|
|
|
*/ |
|
|
|
|
private void onPickedPoint(boolean isStakingLibPoint, String pointId, String name, double x, double y, double z) { |
|
|
|
|
if (!isStakingLibPoint) { |
|
|
|
|
DeviceInfoData deviceInfoData = DeviceUtils.collectDeviceInfo(); |
|
|
|
|
PointRecord tempStakePointRecord = new PointRecord(pointId, "", "", |
|
|
|
|
PointConstants.POINT_TYPE_SURVEY_CONTROL_POINT, name, "", "", |
|
|
|
|
x, y, z, 0, 0, 0, PointConstants.POINT_FORMAT_XYZ, deviceInfoData); |
|
|
|
|
stakingLibraryPointList.add(tempStakePointRecord); |
|
|
|
|
targetStakePointRecord = tempStakePointRecord; |
|
|
|
|
surveyBasePointLine.getValues().add(new PointValue(tempStakePointRecord.y, tempStakePointRecord.x).setLabel(tempStakePointRecord.name)); |
|
|
|
|
updateUI(); |
|
|
|
|
} else { |
|
|
|
|
ThreadPoolUtil.execute(() -> { |
|
|
|
|
PointRecord knowPointRecord = PointDb.getInstance().rawQueryData(PointConstants.findKnownPointById(pointId)); |
|
|
|
|
runOnUiThread(() -> { |
|
|
|
|
targetStakePointRecord = knowPointRecord; |
|
|
|
|
updateUI(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
ToastUtils.showShort(R.string.the_first_staking_point_list); |
|
|
|
|
} |
|
|
|
|
} else { //下一个
|
|
|
|
|
if (currentPosition < stakingLibraryPointList.size() - 1) { //有下一个
|
|
|
|
|
targetStakePointRecord = stakingLibraryPointList.get(currentPosition + 1); |
|
|
|
|
updateUI(); |
|
|
|
|
} else { |
|
|
|
|
ToastUtils.showShort(R.string.the_last_staking_point_list); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// private void navigate2PointLibrary(){
|
|
|
|
|
// StakingNewJobActivity.start(this, workId, (pointId, pointsListIndex, name, x, y, z) ->
|
|
|
|
|
// ThreadPoolUtil.execute(() -> {
|
|
|
|
|
// PointRecord knowPointRecord = PointDb.getInstance().rawQueryData(PointConstants.findKnownPointById(pointId));
|
|
|
|
|
// runOnUiThread(() -> {
|
|
|
|
|
// targetStakePointRecord = knowPointRecord;
|
|
|
|
|
// updateUI();
|
|
|
|
|
// });
|
|
|
|
|
// })
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
private void updateUI() { |
|
|
|
|
if (targetStakePointRecord == null) { |
|
|
|
|
return; |
|
|
|
@ -618,6 +655,7 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 接收 RTK 返回的数据 |
|
|
|
|
* |
|
|
|
|
* @param antennaHeight |
|
|
|
|
* @param blh |
|
|
|
|
* @param originalBlh |
|
|
|
@ -777,7 +815,7 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
if (targetStakePointRecord == null) { |
|
|
|
|
if (isTirpsAddSP) { |
|
|
|
|
builder.setContent(getString(R.string.add_points_staking_point_first)).setButtonConfirm(v -> { |
|
|
|
|
StakingNewJobActivity.start(this); |
|
|
|
|
StakingNewJobActivity.start(this, workId); |
|
|
|
|
}).create().show(); |
|
|
|
|
isTirpsAddSP = false; |
|
|
|
|
} |
|
|
|
@ -1037,15 +1075,13 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
|
|
|
|
|
ThreadPoolUtil.execute(() -> { |
|
|
|
|
String projectId = CachedProject.currentProjectId(); |
|
|
|
|
String jobId = CachedCurrentJob.currentJobId(projectId); |
|
|
|
|
String roadId = CachedCurrentRoad.currentRoadId(projectId); |
|
|
|
|
|
|
|
|
|
DeviceUtils.StationData stationData = DeviceUtils.stationData( |
|
|
|
|
new BasePoint(targetStakePointRecord.x, targetStakePointRecord.y, targetStakePointRecord.h), |
|
|
|
|
((App) Utils.getApp()).angleNotNumber(), |
|
|
|
|
6); |
|
|
|
|
DeviceInfoData deviceInfoData = DeviceUtils.collectDeviceInfo(); |
|
|
|
|
PointStakeRecord pointStakeRecord = new PointStakeRecord(projectId, jobId, roadId, |
|
|
|
|
PointStakeRecord pointStakeRecord = new PointStakeRecord(projectId, workId, "", |
|
|
|
|
targetStakePointRecord.id, moveBeforeAfter != null ? moveBeforeAfter.getString() : "", moveLeftRight != null ? moveLeftRight.getString() : "", moveWestEast != null ? moveWestEast.getString() : "", moveSouthNorth != null ? moveSouthNorth.getString() : "", |
|
|
|
|
"" |
|
|
|
|
, targetStakePointRecord.name |
|
|
|
@ -1065,6 +1101,9 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
, deviceInfoData); |
|
|
|
|
|
|
|
|
|
PointStakeDb.getInstance().save(pointStakeRecord); |
|
|
|
|
// 上传测点
|
|
|
|
|
LoftingPointRecordEntry entry = new LoftingPointRecordEntry(pointStakeRecord); |
|
|
|
|
viewModel.uploadLoftingPointRecord(entry); |
|
|
|
|
|
|
|
|
|
runOnUiThread(() -> { |
|
|
|
|
recordPointLine.getValues().add(new PointValue(pointStakeRecord.measuredY, pointStakeRecord.measuredX).setLabel("")); |
|
|
|
@ -1108,8 +1147,8 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
// binding.tvTopFour.setText(getString(R.string.d));
|
|
|
|
|
// break;
|
|
|
|
|
// case 1:
|
|
|
|
|
binding.tvTopThree.setText(getString(R.string.to_north)); |
|
|
|
|
binding.tvTopFour.setText(getString(R.string.to_east)); |
|
|
|
|
binding.tvTopThree.setText(getString(R.string.to_north)); |
|
|
|
|
binding.tvTopFour.setText(getString(R.string.to_east)); |
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
binding.topFiveSixLayout.setVisibility(View.GONE); |
|
|
|
@ -1118,40 +1157,11 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
binding.tvTopSix.setText(getString(R.string.station_angle_diff)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected void onHelpClicked() { |
|
|
|
|
HelpWebActivity.navigation2KnownPointStakingHelp(this); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean isShowTopBarHrPoleLayout() { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String jobId() { |
|
|
|
|
return IntentUtil.stringExtra(getIntent(), KEY_JOB_ID); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void start(Activity activity) { |
|
|
|
|
ThreadPoolUtil.execute(() -> { |
|
|
|
|
String projectId = CachedProject.currentProjectId(); |
|
|
|
|
String roadId = CachedCurrentRoad.currentRoadId(projectId); |
|
|
|
|
String jobId = CachedCurrentJob.currentJobId(projectId); |
|
|
|
|
Intent intent = new Intent(activity, PointStakingActivity.class); |
|
|
|
|
intent.putExtra(KEY_JOB_ID, jobId); |
|
|
|
|
// intent.putExtra(KEY_PROJECT_ID, projectId);
|
|
|
|
|
// intent.putExtra(KEY_ROAD_ID, roadId);
|
|
|
|
|
activity.startActivity(intent); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String KEY_POINT_LIST = "key_point_list"; |
|
|
|
|
private static final String KEY_WORK_ID = "keyWorkId"; |
|
|
|
|
|
|
|
|
|
public static void start(Context context, List<StakingPoint> stakingPointList) { |
|
|
|
|
Gson gson = new Gson(); |
|
|
|
|
public static void start(Context context, String workId) { |
|
|
|
|
Intent intent = new Intent(context, PointStakingActivity.class); |
|
|
|
|
intent.putExtra(KEY_POINT_LIST, gson.toJson(stakingPointList)); |
|
|
|
|
intent.putExtra(KEY_WORK_ID, workId); |
|
|
|
|
context.startActivity(intent); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1177,6 +1187,17 @@ public class PointStakingActivity extends BaseSurveyNewActivity { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean isHideHelpDoc() { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean isShowTopBarHrPoleLayout() { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// public boolean isUseSystemStyleNavigationBar() {
|
|
|
|
|
// return true;
|
|
|
|
|