军测第一个版本,改版

main_modify
huangwei 8 months ago
parent f291762ab3
commit 5d0e055511
  1. 3
      app/src/main/java/com/bingce/controlnetwork/fragment/SelectExportSurveyorRecordFragment.java
  2. 12
      app/src/main/java/com/bingce/controlnetwork/fragment/StationDataAdjustDialogFragment.java
  3. 185
      app/src/main/java/com/bingce/controlnetwork/fragment/StationDataAdjustDialogFragmentTj.java
  4. 104
      app/src/main/java/com/bingce/controlnetwork/newui/stationsetting/StationSettingSettingFragment.kt
  5. 19
      app/src/main/java/com/bingce/controlnetwork/newui/stationsetting/StationSettingVm.kt
  6. 18
      app/src/main/java/com/bingce/controlnetwork/newui/stationsetting/model/StationSettingSettingData.kt
  7. 34
      app/src/main/java/com/bingce/controlnetwork/surveyor/method/SurveyorAdjustMethodTj.java
  8. 4
      app/src/main/java/com/bingce/controlnetwork/surveyor/state/_DoCalAdjustState.java
  9. 1
      app/src/main/java/com/bingce/controlnetwork/surveyor/state/heighttraverse/StateManagerHeightTraverse.java
  10. 305
      app/src/main/java/com/bingce/controlnetwork/ui/vh/SurveyorDataViewHolderHor.java
  11. 302
      app/src/main/java/com/bingce/controlnetwork/ui/vh/SurveyorDataViewHolderVer.java
  12. 28
      app/src/main/java/com/bingce/controlnetwork/ui/widget/ViewFactory.java
  13. 31
      app/src/main/java/com/bingce/controlnetwork/util/StationUtilPla.java
  14. 8
      app/src/main/res/layout/new_fragment_station_setting_setting.xml
  15. 16
      app/src/main/res/layout/new_item_station_setting_point_setting.xml
  16. 2
      control_common

@ -32,6 +32,7 @@ import com.bingce.controlnetwork.surveyor.method.ExportUtilsPla;
import com.bingce.controlnetwork.ui.widget.treeview.TreeNode;
import com.bingce.controlnetwork.ui.widget.treeview.TreeView;
import com.bingce.controlnetwork.ui.widget.treeview.custom.MyNodeViewFactory;
import com.bingce.controlnetwork.util.StationUtilPla;
import com.bingce.file.FileOperator;
import com.bingce.utils.ThreadPoolUtil;
@ -176,7 +177,7 @@ public class SelectExportSurveyorRecordFragment extends BaseFragment {
2);
periodNode.addChild(stationNode);
boolean stationCanExport = StationUtil.isStationCanExport(stationRecord);
boolean stationCanExport = StationUtilPla.checkStationCanExport(stationRecord);
stationNode.setEnable(stationCanExport);
if (stationCanExport) {
projectHasData = true;

@ -172,6 +172,7 @@ public class StationDataAdjustDialogFragment extends DialogFragment {
}
}
public static void showDialog(String type, ArrayList<SurveyorAdjustMethod.Item> finalItemList,
Boolean isShowSlopDistance,
FragmentManager fragmentManager) {
@ -184,15 +185,4 @@ public class StationDataAdjustDialogFragment extends DialogFragment {
dialogFragment.show(fragmentManager, StationDataAdjustDialogFragment.class.getName());
}
public static void showDialog(int measureWhat, ArrayList<SurveyorAdjustMethodTj.Item> finalItemList,
Boolean isShowSlopDistance,
FragmentManager fragmentManager) {
StationDataAdjustDialogFragment dialogFragment = new StationDataAdjustDialogFragment();
Bundle args = new Bundle();
args.putInt(KEY_MEASURE_WHAT, measureWhat);
args.putParcelableArrayList(KEY_LIST, finalItemList);
args.putBoolean(KEY_IS_SHOW_SLOP_DISTANCE, isShowSlopDistance);
dialogFragment.setArguments(args);
dialogFragment.show(fragmentManager, StationDataAdjustDialogFragment.class.getName());
}
}

@ -0,0 +1,185 @@
package com.bingce.controlnetwork.fragment;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bingce.controlapphelper.model.ViewItemType;
import com.bingce.controlapphelper.surveyor.method.RadianMethod;
import com.bingce.controlapphelper.surveyor.method.SurveyorAdjustMethod;
import com.bingce.controlapphelper.util.SettingValueUtil;
import com.bingce.controlnetwork.R;
import com.bingce.controlnetwork.adapter.BaseAdapter;
import com.bingce.controlnetwork.surveyor.method.SurveyorAdjustMethodTj;
import com.bingce.controlnetwork.surveyor.state.StateConstantsTj;
import com.bingce.controlnetwork.ui.vh.StationAdjustItemViewHolder;
import com.bingce.controlnetwork.ui.widget.ViewFactory;
import com.bingce.utils.Util;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
public class StationDataAdjustDialogFragmentTj extends DialogFragment {
public static final String KEY_MEASURE_WHAT = "__key_measure_what";
private static final String KEY_LIST = "__key_list";
private static final String KEY_IS_SHOW_SLOP_DISTANCE = "__key_show_slop";
private int measureWhat;
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
Bundle arguments = getArguments();
if (arguments != null) {
measureWhat = arguments.getInt(KEY_MEASURE_WHAT, StateConstantsTj.VALUE_MEASURE_WHAT_DEFAULT);
}
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (getDialog() == null) {
return;
}
Window window = getDialog().getWindow();
window.setBackgroundDrawable(new ColorDrawable(0x00000000));
window.setLayout(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.WRAP_CONTENT);
}
@Nullable
@org.jetbrains.annotations.Nullable
@Override
public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_station_data_adjust_dialog_layout, container, false);
if (getArguments() != null) {
ArrayList<SurveyorAdjustMethodTj.Item> items = getArguments().getParcelableArrayList(KEY_LIST);
boolean isShowSlop = getArguments().getBoolean(KEY_IS_SHOW_SLOP_DISTANCE, true);
RecyclerView recyclerView = rootView.findViewById(R.id.list);
TextView distanceTitle = rootView.findViewById(R.id.distance_angle_title);
if (recyclerView != null) {
_Adapter adapter = new _Adapter(items);
recyclerView.setAdapter(adapter);
if (distanceTitle != null) {
distanceTitle.setText(isShowSlop ? R.string.distance_slope : R.string.distance_horizontal);
}
}
initShowView(rootView.findViewById(R.id.hor_angle_title),
rootView.findViewById(R.id.ver_angle_title),
rootView.findViewById(R.id.distance_angle_title));
}
return rootView;
}
private void initShowView(View horView, View verView, View disView) {
switch (measureWhat) {
case StateConstantsTj.VALUE_MEASURE_WHAT_DISTANCE:
horView.setVisibility(View.GONE);
verView.setVisibility(View.GONE);
disView.setVisibility(View.VISIBLE);
break;
case StateConstantsTj.VALUE_MEASURE_WHAT_ANGLE_HOR:
horView.setVisibility(View.VISIBLE);
verView.setVisibility(View.GONE);
disView.setVisibility(View.GONE);
break;
case StateConstantsTj.VALUE_MEASURE_WHAT_ANGLE_VER:
horView.setVisibility(View.GONE);
verView.setVisibility(View.VISIBLE);
disView.setVisibility(View.GONE);
break;
// case StateConstants.VALUE_MEASURE_WHAT_ANGLE:
case StateConstantsTj.VALUE_MEASURE_WHAT_DEFAULT:
default:
horView.setVisibility(View.VISIBLE);
verView.setVisibility(View.VISIBLE);
disView.setVisibility(View.VISIBLE);
break;
}
}
private class _Adapter extends BaseAdapter<SurveyorAdjustMethodTj.Item, StationAdjustItemViewHolder> {
public _Adapter(List<SurveyorAdjustMethodTj.Item> items) {
super(items);
}
@Override
protected StationAdjustItemViewHolder createVH(@NotNull ViewGroup parent, int viewType) {
RecyclerView.ViewHolder viewHolder = ViewFactory.generatorViewHolder(parent.getContext(), parent, ViewItemType.stationAdjust);
if (viewHolder instanceof StationAdjustItemViewHolder) {
return (StationAdjustItemViewHolder) viewHolder;
}
return null;
}
@Override
public void onBindViewHolder(@NonNull @NotNull StationAdjustItemViewHolder holder, int position) {
SurveyorAdjustMethodTj.Item item = getItem(position);
initShowView(holder.horAngle, holder.verAngle, holder.distance);
setText(holder.pointName, item.getPointName());
setText(holder.horAngle, formatAngle(item.getHorAngle()));
setText(holder.verAngle, formatAngle(item.getVerAngle()));
setText(holder.distance, formatDistance(item.getDistance()));
}
private void setText(TextView textView, String string) {
if (textView != null) {
textView.setText(string);
}
}
private String formatAngle(double angle) {
// if (angle < 0) {
// return "";
// }
return RadianMethod.dmsStringOf(angle);
}
private String formatDistance(double distance) {
if (distance < 0) {
return "";
}
return Util.formatDouble2String(distance, SettingValueUtil.getLengthDecimalPoint());
}
}
public static void showDialog(int measureWhat, ArrayList<SurveyorAdjustMethodTj.Item> finalItemList,
Boolean isShowSlopDistance,
FragmentManager fragmentManager) {
StationDataAdjustDialogFragmentTj dialogFragment = new StationDataAdjustDialogFragmentTj();
Bundle args = new Bundle();
args.putInt(KEY_MEASURE_WHAT, measureWhat);
args.putParcelableArrayList(KEY_LIST, finalItemList);
args.putBoolean(KEY_IS_SHOW_SLOP_DISTANCE, isShowSlopDistance);
dialogFragment.setArguments(args);
dialogFragment.show(fragmentManager, StationDataAdjustDialogFragmentTj.class.getName());
}
}

@ -36,7 +36,9 @@ class StationSettingSettingFragment :
}
override fun initView() {
mBinding.scSeparate.setOnCheckedChangeListener { buttonView, isChecked ->
refreshEveryPointUi(isChecked)
}
}
override fun initData() {
@ -54,18 +56,17 @@ class StationSettingSettingFragment :
}
mBinding.scLeftRight.isChecked = viewModel.getStationLeftRight()
mBinding.scZero.isChecked = viewModel.getStationZero()
mBinding.scSeparate.isChecked = viewModel.getStationSeparateObservation()
//显示斜距还是平距
mBinding.showSlopSwitch.isChecked = viewModel.getShowSlop()
setDisEnableByHasData(mBinding.scLeftRight, mBinding.scZero)
isCanSetAloneDistance = viewModel.isCanShowAloneDistance()
setDisEnableByHasData(mBinding.scLeftRight, mBinding.scZero, mBinding.scSeparate)
refreshEveryPointUi()
refreshEveryPointUi(viewModel.getStationSeparateObservation())
}
}
private fun refreshEveryPointUi() {
private fun refreshEveryPointUi(separateObservation: Boolean) {
mBinding.llPoints.removeAllViews()
for (point in viewModel.settingData.pointList) {
val itemView =
@ -78,23 +79,44 @@ class StationSettingSettingFragment :
val tvPoint = itemView.findViewById<TextView>(R.id.tvPoint)
val scAloneMeasureDistance =
itemView.findViewById<SwitchCompat>(R.id.scAloneMeasureDistance)
val scOpenAtr = itemView.findViewById<SwitchCompat>(R.id.scOpenAtr)
val scMeasureVer = itemView.findViewById<SwitchCompat>(R.id.scMeasureVer)
val scMeasureDistance = itemView.findViewById<SwitchCompat>(R.id.scMeasureDistance)
// val scOpenAtr = itemView.findViewById<SwitchCompat>(R.id.scOpenAtr)
val spinnerPrismType = itemView.findViewById<Spinner>(R.id.spinnerPrismType)
if (isCanSetAloneDistance) {
scAloneMeasureDistance.visibility=View.VISIBLE
}else{
tvPoint.text = viewModel.settingData.getPointName(point.originalPointId)
//单独测距
scAloneMeasureDistance.isChecked = point.isAloneMeasureDistance
scMeasureVer.isChecked = !point.isMeasureVerNot
scMeasureDistance.isChecked = !point.isMeasureDistanceNot
if (separateObservation) {
//分开观测
// 不显示单独测距
scAloneMeasureDistance.visibility = View.GONE
} else {
//合并观测
// 单独测距显示
scAloneMeasureDistance.visibility = View.VISIBLE
//设置垂直角文案
scMeasureVer.text = "垂直角一并观测"
scMeasureDistance.text = "距离一并观测"
}
scAloneMeasureDistance.setOnCheckedChangeListener { buttonView, isChecked ->
if (isChecked) {
//单独测距打开
scMeasureDistance.isChecked = false
scMeasureDistance.isEnabled = false
} else {
scMeasureDistance.isChecked = true
scMeasureDistance.isEnabled = true
}
}
tvPoint.text = viewModel.settingData.getPointName(point.originalPointId)
//单独测距
scAloneMeasureDistance.isChecked = point.isAloneDistance
setDisEnableByHasData(scAloneMeasureDistance)
setDisEnableByHasData(scAloneMeasureDistance, scMeasureVer, scMeasureDistance)
setItemSpinnerData(spinnerPrismType, scOpenAtr, point)
setItemSpinnerData(spinnerPrismType, point)
params.topMargin = ScreenUtil.dp2px(requireContext(), 12f)
mBinding.llPoints.addView(itemView, params)
@ -107,7 +129,6 @@ class StationSettingSettingFragment :
private fun setItemSpinnerData(
spinner: Spinner,
scOpenAtr: SwitchCompat,
point: SurveyorPoint
) {
spinner.adapter = ArrayAdapter<String>(
@ -116,25 +137,24 @@ class StationSettingSettingFragment :
viewModel.settingData.getAllPrismNameList()
)
spinner.setSelection(viewModel.settingData.getPointPrismSelection(point.originalPointId))
spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(
parent: AdapterView<*>?,
view: View?,
position: Int,
id: Long
) {
val prismRecord = viewModel.settingData.getPrismRecord(position)
setItemOpenAtr(scOpenAtr, prismRecord, point)
}
override fun onNothingSelected(parent: AdapterView<*>?) {
}
}
// spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
// override fun onItemSelected(
// parent: AdapterView<*>?,
// view: View?,
// position: Int,
// id: Long
// ) {
// val prismRecord = viewModel.settingData.getPrismRecord(position)
// setItemOpenAtr( prismRecord, point)
// }
//
// override fun onNothingSelected(parent: AdapterView<*>?) {
// }
//
// }
}
private fun setItemOpenAtr(
scOpenAtr: SwitchCompat,
selectPrismRecord: PrismRecord,
point: SurveyorPoint
) {
@ -143,9 +163,9 @@ class StationSettingSettingFragment :
selectPrismRecord.prismTypeLarge
)
val openAtrSurveyorPoint = SurveyorOpenAtrUtil.isOpenAtr(point)
val openAtr = openAtrEnable && openAtrSurveyorPoint
scOpenAtr.isChecked = openAtr
scOpenAtr.isEnabled = openAtrEnable
// val openAtr = openAtrEnable && openAtrSurveyorPoint
// scOpenAtr.isChecked = openAtr
// scOpenAtr.isEnabled = openAtrEnable
}
override fun setDataToStation() {
@ -155,6 +175,8 @@ class StationSettingSettingFragment :
if (mBinding.scZero.visibility == View.VISIBLE) {
viewModel.setStationZeroToStation(mBinding.scZero.isChecked)
}
val separateObservation = mBinding.scSeparate.isChecked
viewModel.setStationSeparateObservation(separateObservation)
//显示斜距还是平距
viewModel.setStationShowSlop(mBinding.showSlopSwitch.isChecked)
@ -163,14 +185,18 @@ class StationSettingSettingFragment :
val itemView = mBinding.llPoints.getChildAt(i)
val scAloneMeasureDistance =
itemView.findViewById<SwitchCompat>(R.id.scAloneMeasureDistance)
val scMeasureVer = itemView.findViewById<SwitchCompat>(R.id.scMeasureVer)
val scMeasureDistance = itemView.findViewById<SwitchCompat>(R.id.scMeasureDistance)
val spinnerPrismType = itemView.findViewById<Spinner>(R.id.spinnerPrismType)
val scOpenAtr = itemView.findViewById<SwitchCompat>(R.id.scOpenAtr)
// val scOpenAtr = itemView.findViewById<SwitchCompat>(R.id.scOpenAtr)
viewModel.setPointSettingToStation(
i,
separateObservation, i,
scAloneMeasureDistance.isChecked,
!scMeasureVer.isChecked,
!scMeasureDistance.isChecked,
spinnerPrismType.selectedItemPosition,
!scOpenAtr.isChecked
// !scOpenAtr.isChecked
)
}

@ -125,17 +125,23 @@ class StationSettingVm : ViewModel() {
* 当有一个点是单独测距这个测站就是单独测距
*/
fun setPointSettingToStation(
separateMeasure: Boolean,
pointIndex: Int,
aloneMeasureDistance: Boolean,
measureVerNot: Boolean,
measureDistanceNot: Boolean,
selectionPrismType: Int,
isOpenAtrNot: Boolean
// isOpenAtrNot:Boolean
) {
stationRecord?.let {
settingData.updatePointSettingData(
separateMeasure,
pointIndex,
aloneMeasureDistance,
measureVerNot,
measureDistanceNot,
selectionPrismType,
isOpenAtrNot
// isOpenAtrNot
)
}
}
@ -170,6 +176,9 @@ class StationSettingVm : ViewModel() {
fun getStationSurveyorPointSize() = stationRecord?.items?.size ?: 0
fun getStationSeparateObservation() = stationRecord?.isSeparateObservation ?: false
/**
* 存储数据库
*/
@ -208,6 +217,12 @@ class StationSettingVm : ViewModel() {
return ProjectType.isConnection(stationRecord!!.projectType)
}
fun setStationSeparateObservation(isSeparateObservation: Boolean) {
stationRecord?.let {
it.isSeparateObservation = isSeparateObservation
}
}
// /**
// * 当测点的状态更新完再调用这个方法
// */

@ -65,13 +65,25 @@ class StationSettingSettingData {
* 保存时
*/
fun updatePointSettingData(
separateMeasure: Boolean,
pointIndex: Int,
aloneMeasureDistance: Boolean,
measureVerNot: Boolean,
measureDistanceNot: Boolean,
selectionPosPrismType: Int,
isOpenAtrNot: Boolean
// isOpenAtrNot:Boolean
) {
val surveyorPoint = pointList[pointIndex]
surveyorPoint.isAloneDistance = aloneMeasureDistance
if (separateMeasure) {
//分开观测 隐藏了单独测距
surveyorPoint.isAloneMeasureDistance = !measureDistanceNot
surveyorPoint.isMeasureDistanceNot = measureDistanceNot
} else {
//合并观测里有单独测距
surveyorPoint.isAloneMeasureDistance = aloneMeasureDistance
surveyorPoint.isMeasureDistanceNot = measureDistanceNot
}
surveyorPoint.isMeasureVerNot = measureVerNot
//棱镜类型相关
val prismRecord = getPrismRecord(selectionPosPrismType)
surveyorPoint.prismType = prismRecord.prismType
@ -79,7 +91,7 @@ class StationSettingSettingData {
surveyorPoint.prismTypeConstant = prismRecord.prismTypeConstant
surveyorPoint.prismTypeName = prismRecord.prismTypeName
//openAtr
surveyorPoint.isOpenAtrNot = isOpenAtrNot
// surveyorPoint.isOpenAtrNot=isOpenAtrNot
}
fun getPrismRecord(selectionPosPrismType: Int) = prismAllList[selectionPosPrismType]

@ -221,7 +221,7 @@ public class SurveyorAdjustMethodTj {
if (hdvVer == FaultTolerantData.ERROR_VER_ANGLE) {
return hdvVer;
}
return hdvVer / cycleCount;
return Math.PI / 2 - hdvVer / cycleCount;
}
private static double getFinalAdjustDistance(double a, double b, double distance) {
@ -463,7 +463,7 @@ public class SurveyorAdjustMethodTj {
}
if (errorCycleIndex == -1) {
resultAdjustList.add(new AloneAdjustItem(pointId, pointName, 0, verSum / verCalCount,
resultAdjustList.add(new AloneAdjustItem(pointId, pointName, 0, Math.PI / 2 - verSum / verCalCount,
0, prismHeight,
false, false, false,
null));
@ -560,23 +560,23 @@ public class SurveyorAdjustMethodTj {
// continue;
// }
// double average = 0;
// for (int cycleIndex = 0; cycleIndex < cycleCount; cycleIndex++) {
//
//
// double distanceAverageEveryCycle = Tools.calculateCollectionDoubleAverage(distanceValues.subList(cycleIndex * surveyorCount, (cycleIndex + 1) * surveyorCount), projectRecord.isShowSlopDistance());
//// if (lastSurveyorPointSchedule.isHighPrecision()) {
//// distanceAverageEveryCycle = getHighPrecisionDistance(stationId, cycleIndex, pointId, distanceAverageEveryCycle);
//// } else if (lastSurveyorPointSchedule.isOrdinary()) {
//// distanceAverageEveryCycle = getOrdinaryOrNoAmendDistance(stationId, pointId, SurveyorPointScheduleRecord.AMMEND_TYPE_ORDINARY, distanceAverageEveryCycle);
//// } else {
//// distanceAverageEveryCycle = getOrdinaryOrNoAmendDistance(stationId, pointId, SurveyorPointScheduleRecord.AMMEND_TYPE_NO, distanceAverageEveryCycle);
//// }
//
// average += distanceAverageEveryCycle;
double average = 0;
for (int cycleIndex = 0; cycleIndex < cycleCount; cycleIndex++) {
double distanceAverageEveryCycle = Tools.calculateCollectionDoubleAverage(distanceValues.subList(cycleIndex * surveyorCount, (cycleIndex + 1) * surveyorCount), projectRecord.isShowSlopDistance());
// if (lastSurveyorPointSchedule.isHighPrecision()) {
// distanceAverageEveryCycle = getHighPrecisionDistance(stationId, cycleIndex, pointId, distanceAverageEveryCycle);
// } else if (lastSurveyorPointSchedule.isOrdinary()) {
// distanceAverageEveryCycle = getOrdinaryOrNoAmendDistance(stationId, pointId, SurveyorPointScheduleRecord.AMMEND_TYPE_ORDINARY, distanceAverageEveryCycle);
// } else {
// distanceAverageEveryCycle = getOrdinaryOrNoAmendDistance(stationId, pointId, SurveyorPointScheduleRecord.AMMEND_TYPE_NO, distanceAverageEveryCycle);
// }
average += distanceAverageEveryCycle;
}
// TODO: 2024/8/30
resultAdjustList.add(new AloneAdjustItem(pointId, pointName, 0, 0, 1, prismHeight,
resultAdjustList.add(new AloneAdjustItem(pointId, pointName, 0, 0, average / cycleCount, prismHeight,
true, false, false,
null));
}

@ -5,7 +5,7 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.bingce.controlnetwork.fragment.StationDataAdjustDialogFragment;
import com.bingce.controlnetwork.fragment.StationDataAdjustDialogFragmentTj;
import com.bingce.controlnetwork.surveyor.method.SurveyorAdjustMethodTj;
@ -40,7 +40,7 @@ public class _DoCalAdjustState extends __BaseState {
item.setHorAngle(Math.PI * 2 + item.getHorAngle());
}
}
StationDataAdjustDialogFragment.showDialog(measureWhat(), adjustResult.result, getStation().isShowSlopDistance(), fragmentManager());
StationDataAdjustDialogFragmentTj.showDialog(measureWhat(), adjustResult.result, getStation().isShowSlopDistance(), fragmentManager());
});
}

@ -40,6 +40,7 @@ import com.bingce.controlapphelper.util.Tools;
import com.bingce.controlnetwork.R;
import com.bingce.controlnetwork.fragment.StationDataAdjustDialogFragment;
import com.bingce.controlnetwork.fragment.TipsFragment;
import com.bingce.controlnetwork.surveyor.method.SurveyorAdjustMethodTj;
import com.bingce.controlnetwork.surveyor.state.AutoModeType;
import com.bingce.controlnetwork.surveyor.state.IScrollDelegate;
import com.bingce.controlnetwork.surveyor.state.StateConstants;

@ -0,0 +1,305 @@
package com.bingce.controlnetwork.ui.vh;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.bingce.controlapphelper.model.DataCategory;
import com.bingce.controlapphelper.model.LeftOrRight;
import com.bingce.controlapphelper.surveyor.method.RadianMethod;
import com.bingce.controlapphelper.surveyor.method.model.SdAngleValueType;
import com.bingce.controlapphelper.util.Tools;
import com.bingce.controlnetwork.App;
import com.bingce.controlnetwork.R;
import com.bingce.controlnetwork.surveyor.data.ICachedData;
import com.bingce.controlnetwork.surveyor.data.ICycleRecorder;
import com.bingce.controlnetwork.surveyor.data.ISurveyorData;
import com.bingce.controlnetwork.surveyor.method.AverageValueMethod;
import com.bingce.controlnetwork.surveyor.method.ValueOf2cMethod;
import com.bingce.controlnetwork.surveyor.method.model.CacheResult;
import com.bingce.controlnetwork.util.IdUtil;
import com.bingce.utils.Util;
import blankj.utilcode.util.Utils;
/**
* 水平角
*/
public class SurveyorDataViewHolderHor extends AbstractSurveyorDataViewHolder {
public SurveyorDataViewHolderHor(Context context, @NonNull View itemView) {
super(context, itemView);
}
@Override
public void setup(int itemIndex,
String stationId,
boolean showSlopDistance,
ICachedData cachedData,
ICycleRecorder cycleRecorder,
ISurveyorData surveyorData) {
if (showSlopDistance) {
distanceTitle.setText(R.string.distance_slope);
} else {
distanceTitle.setText(R.string.distance_horizontal);
}
int currentCycleIndex = cycleRecorder.currentCycleIndex();
int currentSurveyorIndex = surveyorData.currentIndex();
//设置当前测量状态标识
if (currentSurveyorIndex == itemIndex) {
//当前非跳过点背景黄边白色
selectMask.setBackground(Tools.getDrawable(R.drawable.select_mask));
} else {
// if (cachedData.isAbandonPoint(currentCycleIndex, itemIndex)) {
// selectMask.setBackground(ToolsTj.getDrawable(R.drawable.bg_skip));
// } else {
// selectMask.setBackgroundColor(ToolsTj.getColor(R.color.white));
// }
selectMask.setBackgroundColor(Tools.getColor(R.color.white));
}
//初始化
setValue(TYPE_LEFT1, ORIGINAL_VALUE, ORIGINAL_VALUE, ORIGINAL_VALUE);
setValue(TYPE_LEFT2, ORIGINAL_VALUE, ORIGINAL_VALUE, ORIGINAL_VALUE);
setValue(TYPE_RIGHT1, ORIGINAL_VALUE, ORIGINAL_VALUE, ORIGINAL_VALUE);
setValue(TYPE_RIGHT2, ORIGINAL_VALUE, ORIGINAL_VALUE, ORIGINAL_VALUE);
leftLabel.setTextColor(context.getResources().getColor(R.color.value_1_normal));
setTextColor(TYPE_LEFT1, R.color.value_1_normal);
setTextColor(TYPE_LEFT2, R.color.value_2_normal);
rightLabel.setTextColor(context.getResources().getColor(R.color.value_1_normal));
setTextColor(TYPE_RIGHT1, R.color.value_1_normal);
setTextColor(TYPE_RIGHT2, R.color.value_2_normal);
averageHorAngle.setText(ORIGINAL_VALUE);
averageVerAngle.setText(ORIGINAL_VALUE);
averageDistance.setText(ORIGINAL_VALUE);
_2c.setText(ORIGINAL_VALUE);
_i.setText(ORIGINAL_VALUE);
_2d.setText(ORIGINAL_VALUE);
boolean excludeDistance = cachedData.isWellSteelPoint(currentCycleIndex, itemIndex) || cachedData.isAloneMeasureDistancePoint(currentCycleIndex, itemIndex);
//如果当前正在测量,使用缓存数据设置相应信息
LeftOrRight surveyorState = surveyorData.leftOrRight();
if (currentSurveyorIndex == itemIndex) {
if (surveyorState == LeftOrRight.left) {
if (surveyorData.hasSurveyor1()) {
setValue(excludeDistance, TYPE_LEFT1, surveyorData.getAngleHor1(), surveyorData.getAngleVer1(), surveyorData.getDistance1());
}
if (surveyorData.hasSurveyor2()) {
setValue(excludeDistance, TYPE_LEFT2, surveyorData.getAngleHor2(), surveyorData.getAngleVer2(), surveyorData.getDistance2());
}
//设置颜色
setTextColor(TYPE_LEFT1, R.color.value_1_selected);
setTextColor(TYPE_LEFT2, R.color.value_2_selected);
leftLabel.setTextColor(context.getResources().getColor(R.color.value_1_selected));
} else if (surveyorState == LeftOrRight.right) {
if (surveyorData.hasSurveyor1()) {
setValue(excludeDistance, TYPE_RIGHT1, surveyorData.getAngleHor1(), surveyorData.getAngleVer1(), surveyorData.getDistance1());
}
if (surveyorData.hasSurveyor2()) {
setValue(excludeDistance, TYPE_RIGHT2, surveyorData.getAngleHor2(), surveyorData.getAngleVer2(), surveyorData.getDistance2());
}
//设置颜色
setTextColor(TYPE_RIGHT1, R.color.value_1_selected);
setTextColor(TYPE_RIGHT2, R.color.value_2_selected);
rightLabel.setTextColor(context.getResources().getColor(R.color.value_1_selected));
}
}
//根据测量次数,控制数据显示
setValue2Visibility(surveyorData.surveyorCount() > 1);
pointName.setText(cachedData.pointName(currentCycleIndex, itemIndex));
heightValue.setText(cachedData.getPrismHeight(currentCycleIndex, itemIndex));
prismValue.setText(cachedData.getPrismTypeName(currentCycleIndex, itemIndex));
//重新监听observe---但是根据当前测量状态,需要排除一些数据监听
boolean skipLeft1 = false, skipLeft2 = false, skipRight1 = false, skipRight2 = false;
//根据内存缓存排除
if (currentSurveyorIndex == itemIndex) {
if (surveyorState == LeftOrRight.left) {
if (surveyorData.hasSurveyor1()) {
skipLeft1 = true;
}
if (surveyorData.hasSurveyor2() || surveyorData.surveyorCount() == 1) {
skipLeft2 = true;
}
} else if (surveyorState == LeftOrRight.right) {
if (surveyorData.hasSurveyor1()) {
skipRight1 = true;
}
if (surveyorData.hasSurveyor2() || surveyorData.surveyorCount() == 1) {
skipRight2 = true;
}
}
}
String pointId = cachedData.pointId(currentCycleIndex, itemIndex);
String leftRecordId = IdUtil.surveyorRecordKey(stationId, currentCycleIndex, pointId, LeftOrRight.left);
if (!skipLeft1) {
DataCategory dataCategory = cachedData.valueState(leftRecordId, 0);
if (!dataCategory.isEmptyData()) {
setValue(excludeDistance, TYPE_LEFT1,
cachedData.angleHor1(leftRecordId),
cachedData.angleVer1(leftRecordId),
cachedData.distance1(leftRecordId));
}
if (dataCategory.isNeedResurvey()) {
setTextColor(TYPE_LEFT1, R.color.value_dirty);
} else if (dataCategory == DataCategory.dirtyAndSurveyed) {
setTextColor(TYPE_LEFT1, R.color.value_resurveyed);
}
}
if (!skipLeft2) {
DataCategory dataCategory = cachedData.valueState(leftRecordId, 1);
if (!dataCategory.isEmptyData()) {
setValue(excludeDistance, TYPE_LEFT2,
cachedData.angleHor2(leftRecordId),
cachedData.angleVer2(leftRecordId),
cachedData.distance2(leftRecordId));
}
if (dataCategory.isNeedResurvey()) {
setTextColor(TYPE_LEFT2, R.color.value_dirty);
} else if (dataCategory == DataCategory.dirtyAndSurveyed) {
setTextColor(TYPE_LEFT2, R.color.value_resurveyed);
}
}
String rightRecordId = IdUtil.surveyorRecordKey(stationId, currentCycleIndex, pointId, LeftOrRight.right);
if (!skipRight1) {
DataCategory dataCategory = cachedData.valueState(rightRecordId, 0);
if (!dataCategory.isEmptyData()) {
setValue(excludeDistance, TYPE_RIGHT1,
cachedData.angleHor1(rightRecordId),
cachedData.angleVer1(rightRecordId),
cachedData.distance1(rightRecordId));
}
if (dataCategory.isNeedResurvey()) {
setTextColor(TYPE_RIGHT1, R.color.value_dirty);
} else if (dataCategory == DataCategory.dirtyAndSurveyed) {
setTextColor(TYPE_RIGHT1, R.color.value_resurveyed);
}
}
if (!skipRight2) {
DataCategory dataCategory = cachedData.valueState(rightRecordId, 1);
if (!dataCategory.isEmptyData()) {
setValue(excludeDistance, TYPE_RIGHT2,
cachedData.angleHor2(rightRecordId),
cachedData.angleVer2(rightRecordId),
cachedData.distance2(rightRecordId));
}
if (dataCategory.isNeedResurvey()) {
setTextColor(TYPE_RIGHT2, R.color.value_dirty);
} else if (dataCategory == DataCategory.dirtyAndSurveyed) {
setTextColor(TYPE_RIGHT2, R.color.value_resurveyed);
}
}
//均值(中值)
int surveyorCount = surveyorData.surveyorCount();
CacheResult horAngleLeftAndRightAverageValue = AverageValueMethod.leftAndRightValue(SdAngleValueType.horAngle,
leftRecordId,
rightRecordId, surveyorCount, cachedData);
//水平角中值
if (horAngleLeftAndRightAverageValue.validate) {
double radian = RadianMethod.formatRadian(horAngleLeftAndRightAverageValue.value);
averageHorAngle.setText(RadianMethod.dmsStringOf(radian));
} else {
averageHorAngle.setText(ORIGINAL_VALUE);
}
//垂直角中值
averageVerAngle.setText(ORIGINAL_VALUE);
//距离中值
averageDistance.setText(ORIGINAL_VALUE);
//设置2c、i、2d
CacheResult value2C = ValueOf2cMethod.valueOf2C(SdAngleValueType.horAngle,
stationId, currentCycleIndex, itemIndex, surveyorData, cycleRecorder.currentCycleIndex(), cachedData);
if (value2C.validate && horAngleLeftAndRightAverageValue.validate) {
_2c.setText(String.format("%s″", Util.formatDouble2String(value2C.value, 1)));
} else {
_2c.setText(ORIGINAL_VALUE);
}
_i.setText(ORIGINAL_VALUE);
_2d.setText(ORIGINAL_VALUE);
}
private void setTextColor(int type, int value) {
angleHor(type).setTextColor(context.getResources().getColor(value));
angleVer(type).setTextColor(context.getResources().getColor(value));
distance(type).setTextColor(context.getResources().getColor(value));
}
private void setValue(boolean excludeDistance, int type, double angleHor, double angleVer, double distance) {
//判断是否测水平角
String distanceString;
if (excludeDistance) {
distanceString = ORIGINAL_VALUE;
} else {
distanceString = Util.formatDouble2String(distance, ((App) Utils.getApp()).notNumber);
}
setValue(type,
RadianMethod.dmsStringOf(angleHor),
RadianMethod.dmsStringOf(angleVer),
distanceString);
}
private void setValue(int type, String angleHor, String angleVer, String distance) {
angleHor(type).setText(angleHor);
angleVer(type).setText(ORIGINAL_VALUE);
distance(type).setText(ORIGINAL_VALUE);
}
private void setValue2Visibility(boolean visibility) {
leftAngleHor2.setVisibility(visibility ? View.VISIBLE : View.GONE);
leftAngleVer2.setVisibility(visibility ? View.VISIBLE : View.GONE);
leftDistance2.setVisibility(visibility ? View.VISIBLE : View.GONE);
rightAngleHor2.setVisibility(visibility ? View.VISIBLE : View.GONE);
rightAngleVer2.setVisibility(visibility ? View.VISIBLE : View.GONE);
rightDistance2.setVisibility(visibility ? View.VISIBLE : View.GONE);
}
private TextView angleHor(int type) {
if (TYPE_LEFT1 == type) {
return leftAngleHor1;
} else if (TYPE_LEFT2 == type) {
return leftAngleHor2;
} else if (TYPE_RIGHT1 == type) {
return rightAngleHor1;
}
return rightAngleHor2;
}
private TextView angleVer(int type) {
if (TYPE_LEFT1 == type) {
return leftAngleVer1;
} else if (TYPE_LEFT2 == type) {
return leftAngleVer2;
} else if (TYPE_RIGHT1 == type) {
return rightAngleVer1;
}
return rightAngleVer2;
}
private TextView distance(int type) {
if (TYPE_LEFT1 == type) {
return leftDistance1;
} else if (TYPE_LEFT2 == type) {
return leftDistance2;
} else if (TYPE_RIGHT1 == type) {
return rightDistance1;
}
return rightDistance2;
}
}

@ -0,0 +1,302 @@
package com.bingce.controlnetwork.ui.vh;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.bingce.controlapphelper.model.DataCategory;
import com.bingce.controlapphelper.model.LeftOrRight;
import com.bingce.controlapphelper.surveyor.method.RadianMethod;
import com.bingce.controlapphelper.surveyor.method.model.SdAngleValueType;
import com.bingce.controlapphelper.util.Tools;
import com.bingce.controlnetwork.App;
import com.bingce.controlnetwork.R;
import com.bingce.controlnetwork.surveyor.data.ICachedData;
import com.bingce.controlnetwork.surveyor.data.ICycleRecorder;
import com.bingce.controlnetwork.surveyor.data.ISurveyorData;
import com.bingce.controlnetwork.surveyor.method.AverageValueMethod;
import com.bingce.controlnetwork.surveyor.method.ValueOf2cMethod;
import com.bingce.controlnetwork.surveyor.method.model.CacheResult;
import com.bingce.controlnetwork.util.IdUtil;
import com.bingce.utils.Util;
import blankj.utilcode.util.Utils;
/**
* 分开观测的垂直角holder
*/
public class SurveyorDataViewHolderVer extends AbstractSurveyorDataViewHolder {
public SurveyorDataViewHolderVer(Context context, @NonNull View itemView) {
super(context, itemView);
}
@Override
public void setup(int itemIndexCycle,
String stationId,
boolean showSlopDistance,
ICachedData cachedData,
ICycleRecorder cycleRecorder,
ISurveyorData surveyorData) {
if (showSlopDistance) {
distanceTitle.setText(R.string.distance_slope);
} else {
distanceTitle.setText(R.string.distance_horizontal);
}
int currentCycleIndex = cycleRecorder.currentCycleIndex();
int currentSurveyorIndex = surveyorData.currentIndex();
//设置当前测量状态标识
if (currentCycleIndex == itemIndexCycle) {
//当前非跳过点背景黄边白色
selectMask.setBackground(Tools.getDrawable(R.drawable.select_mask));
} else {
// if (cachedData.isAbandonPoint(currentCycleIndex, itemIndexCycle)) {
// selectMask.setBackground(ToolsTj.getDrawable(R.drawable.bg_skip));
// } else {
// selectMask.setBackgroundColor(ToolsTj.getColor(R.color.white));
// }
selectMask.setBackgroundColor(Tools.getColor(R.color.white));
}
//初始化
setValue(TYPE_LEFT1, ORIGINAL_VALUE, ORIGINAL_VALUE, ORIGINAL_VALUE);
setValue(TYPE_LEFT2, ORIGINAL_VALUE, ORIGINAL_VALUE, ORIGINAL_VALUE);
setValue(TYPE_RIGHT1, ORIGINAL_VALUE, ORIGINAL_VALUE, ORIGINAL_VALUE);
setValue(TYPE_RIGHT2, ORIGINAL_VALUE, ORIGINAL_VALUE, ORIGINAL_VALUE);
leftLabel.setTextColor(context.getResources().getColor(R.color.value_1_normal));
setTextColor(TYPE_LEFT1, R.color.value_1_normal);
setTextColor(TYPE_LEFT2, R.color.value_2_normal);
rightLabel.setTextColor(context.getResources().getColor(R.color.value_1_normal));
setTextColor(TYPE_RIGHT1, R.color.value_1_normal);
setTextColor(TYPE_RIGHT2, R.color.value_2_normal);
averageHorAngle.setText(ORIGINAL_VALUE);
averageVerAngle.setText(ORIGINAL_VALUE);
averageDistance.setText(ORIGINAL_VALUE);
_2c.setText(ORIGINAL_VALUE);
_i.setText(ORIGINAL_VALUE);
_2d.setText(ORIGINAL_VALUE);
boolean excludeDistance = cachedData.isWellSteelPoint(currentCycleIndex, itemIndexCycle) || cachedData.isAloneMeasureDistancePoint(currentCycleIndex, itemIndexCycle);
//如果当前正在测量,使用缓存数据设置相应信息
LeftOrRight surveyorState = surveyorData.leftOrRight();
if (isCurrentItem(itemIndexCycle, currentCycleIndex)) {
if (surveyorState == LeftOrRight.left) {
if (surveyorData.hasSurveyor1()) {
setValue(excludeDistance, TYPE_LEFT1, surveyorData.getAngleHor1(), surveyorData.getAngleVer1(), surveyorData.getDistance1());
}
if (surveyorData.hasSurveyor2()) {
setValue(excludeDistance, TYPE_LEFT2, surveyorData.getAngleHor2(), surveyorData.getAngleVer2(), surveyorData.getDistance2());
}
//设置颜色
setTextColor(TYPE_LEFT1, R.color.value_1_selected);
setTextColor(TYPE_LEFT2, R.color.value_2_selected);
leftLabel.setTextColor(context.getResources().getColor(R.color.value_1_selected));
} else if (surveyorState == LeftOrRight.right) {
if (surveyorData.hasSurveyor1()) {
setValue(excludeDistance, TYPE_RIGHT1, surveyorData.getAngleHor1(), surveyorData.getAngleVer1(), surveyorData.getDistance1());
}
if (surveyorData.hasSurveyor2()) {
setValue(excludeDistance, TYPE_RIGHT2, surveyorData.getAngleHor2(), surveyorData.getAngleVer2(), surveyorData.getDistance2());
}
//设置颜色
setTextColor(TYPE_RIGHT1, R.color.value_1_selected);
setTextColor(TYPE_RIGHT2, R.color.value_2_selected);
rightLabel.setTextColor(context.getResources().getColor(R.color.value_1_selected));
}
}
//根据测量次数,控制数据显示
setValue2Visibility(surveyorData.surveyorCount() > 1);
pointName.setText("第" + (itemIndexCycle + 1) + "测回");
heightValue.setText(cachedData.getPrismHeight(0, currentSurveyorIndex));
prismValue.setText(cachedData.getPrismTypeName(0, currentSurveyorIndex));
//重新监听observe---但是根据当前测量状态,需要排除一些数据监听
boolean skipLeft1 = false, skipLeft2 = false, skipRight1 = false, skipRight2 = false;
//根据内存缓存排除
if (isCurrentItem(itemIndexCycle, currentCycleIndex)) {
if (surveyorState == LeftOrRight.left) {
if (surveyorData.hasSurveyor1()) {
skipLeft1 = true;
}
if (surveyorData.hasSurveyor2() || surveyorData.surveyorCount() == 1) {
skipLeft2 = true;
}
} else if (surveyorState == LeftOrRight.right) {
if (surveyorData.hasSurveyor1()) {
skipRight1 = true;
}
if (surveyorData.hasSurveyor2() || surveyorData.surveyorCount() == 1) {
skipRight2 = true;
}
}
}
String pointId = cachedData.pointId(itemIndexCycle, currentSurveyorIndex);
String leftRecordId = IdUtil.surveyorRecordKey(stationId, itemIndexCycle, pointId, LeftOrRight.left);
if (!skipLeft1) {
DataCategory dataCategory = cachedData.valueState(leftRecordId, 0);
if (!dataCategory.isEmptyData()) {
setValue(excludeDistance, TYPE_LEFT1,
cachedData.angleHor1(leftRecordId),
cachedData.angleVer1(leftRecordId),
cachedData.distance1(leftRecordId));
}
if (dataCategory.isNeedResurvey()) {
setTextColor(TYPE_LEFT1, R.color.value_dirty);
} else if (dataCategory == DataCategory.dirtyAndSurveyed) {
setTextColor(TYPE_LEFT1, R.color.value_resurveyed);
}
}
if (!skipLeft2) {
DataCategory dataCategory = cachedData.valueState(leftRecordId, 1);
if (!dataCategory.isEmptyData()) {
setValue(excludeDistance, TYPE_LEFT2,
cachedData.angleHor2(leftRecordId),
cachedData.angleVer2(leftRecordId),
cachedData.distance2(leftRecordId));
}
if (dataCategory.isNeedResurvey()) {
setTextColor(TYPE_LEFT2, R.color.value_dirty);
} else if (dataCategory == DataCategory.dirtyAndSurveyed) {
setTextColor(TYPE_LEFT2, R.color.value_resurveyed);
}
}
String rightRecordId = IdUtil.surveyorRecordKey(stationId, itemIndexCycle, pointId, LeftOrRight.right);
if (!skipRight1) {
DataCategory dataCategory = cachedData.valueState(rightRecordId, 0);
if (!dataCategory.isEmptyData()) {
setValue(excludeDistance, TYPE_RIGHT1,
cachedData.angleHor1(rightRecordId),
cachedData.angleVer1(rightRecordId),
cachedData.distance1(rightRecordId));
}
if (dataCategory.isNeedResurvey()) {
setTextColor(TYPE_RIGHT1, R.color.value_dirty);
} else if (dataCategory == DataCategory.dirtyAndSurveyed) {
setTextColor(TYPE_RIGHT1, R.color.value_resurveyed);
}
}
if (!skipRight2) {
DataCategory dataCategory = cachedData.valueState(rightRecordId, 1);
if (!dataCategory.isEmptyData()) {
setValue(excludeDistance, TYPE_RIGHT2,
cachedData.angleHor2(rightRecordId),
cachedData.angleVer2(rightRecordId),
cachedData.distance2(rightRecordId));
}
if (dataCategory.isNeedResurvey()) {
setTextColor(TYPE_RIGHT2, R.color.value_dirty);
} else if (dataCategory == DataCategory.dirtyAndSurveyed) {
setTextColor(TYPE_RIGHT2, R.color.value_resurveyed);
}
}
//均值(中值)
int surveyorCount = surveyorData.surveyorCount();
//水平角中值
averageHorAngle.setText(ORIGINAL_VALUE);
//垂直角中值
CacheResult verAngleLeftAndRightAverageValue = AverageValueMethod.leftAndRightValue(SdAngleValueType.verAngle,
leftRecordId,
rightRecordId, surveyorCount, cachedData);
if (verAngleLeftAndRightAverageValue.validate) {//显示天顶距
averageVerAngle.setText(RadianMethod.dmsStringOf(Math.PI / 2 - verAngleLeftAndRightAverageValue.value));
} else {
averageVerAngle.setText(ORIGINAL_VALUE);
}
//距离中值
averageDistance.setText(ORIGINAL_VALUE);
//设置2c、i、2d
_2c.setText(ORIGINAL_VALUE);
CacheResult valueI = ValueOf2cMethod.valueOf2C(SdAngleValueType.verAngle,
stationId, itemIndexCycle, currentSurveyorIndex, surveyorData, cycleRecorder.currentCycleIndex(), cachedData);
if (valueI.validate && verAngleLeftAndRightAverageValue.validate) {
_i.setText(String.format("%s″", Util.formatDouble2String(valueI.value, 1)));
} else {
_i.setText(ORIGINAL_VALUE);
}
_2d.setText(ORIGINAL_VALUE);
}
private void setTextColor(int type, int value) {
angleHor(type).setTextColor(context.getResources().getColor(value));
angleVer(type).setTextColor(context.getResources().getColor(value));
distance(type).setTextColor(context.getResources().getColor(value));
}
private void setValue(boolean excludeDistance, int type, double angleHor, double angleVer, double distance) {
//判断是否测水平角
String distanceString;
if (excludeDistance) {
distanceString = ORIGINAL_VALUE;
} else {
distanceString = Util.formatDouble2String(distance, ((App) Utils.getApp()).notNumber);
}
setValue(type,
RadianMethod.dmsStringOf(angleHor),
RadianMethod.dmsStringOf(angleVer),
distanceString);
}
private void setValue(int type, String angleHor, String angleVer, String distance) {
angleHor(type).setText(ORIGINAL_VALUE);
angleVer(type).setText(angleVer);
distance(type).setText(ORIGINAL_VALUE);
}
private void setValue2Visibility(boolean visibility) {
leftAngleHor2.setVisibility(visibility ? View.VISIBLE : View.GONE);
leftAngleVer2.setVisibility(visibility ? View.VISIBLE : View.GONE);
leftDistance2.setVisibility(visibility ? View.VISIBLE : View.GONE);
rightAngleHor2.setVisibility(visibility ? View.VISIBLE : View.GONE);
rightAngleVer2.setVisibility(visibility ? View.VISIBLE : View.GONE);
rightDistance2.setVisibility(visibility ? View.VISIBLE : View.GONE);
}
private TextView angleHor(int type) {
if (TYPE_LEFT1 == type) {
return leftAngleHor1;
} else if (TYPE_LEFT2 == type) {
return leftAngleHor2;
} else if (TYPE_RIGHT1 == type) {
return rightAngleHor1;
}
return rightAngleHor2;
}
private TextView angleVer(int type) {
if (TYPE_LEFT1 == type) {
return leftAngleVer1;
} else if (TYPE_LEFT2 == type) {
return leftAngleVer2;
} else if (TYPE_RIGHT1 == type) {
return rightAngleVer1;
}
return rightAngleVer2;
}
private TextView distance(int type) {
if (TYPE_LEFT1 == type) {
return leftDistance1;
} else if (TYPE_LEFT2 == type) {
return leftDistance2;
} else if (TYPE_RIGHT1 == type) {
return rightDistance1;
}
return rightDistance2;
}
}

@ -8,7 +8,6 @@ import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import com.bingce.controlapphelper.model.ViewItemType;
import com.bingce.controlnetwork.R;
import com.bingce.controlnetwork.ui.vh.DraggableTextViewHolder;
import com.bingce.controlnetwork.ui.vh.GroupParentViewHolder;
@ -23,21 +22,9 @@ import com.bingce.controlnetwork.ui.vh.StationGroupItemViewHolder;
import com.bingce.controlnetwork.ui.vh.SurveyorDataAloneDistanceViewHolder;
import com.bingce.controlnetwork.ui.vh.SurveyorDataViewHolder;
import com.bingce.controlnetwork.ui.vh.SurveyorDataViewHolderHeightTraverse;
import com.bingce.controlnetwork.ui.vh.TextSelectableViewHolder;
import com.bingce.controlnetwork.ui.vh.TitleWithSubtitleViewHolder;
import com.bingce.controlnetwork.ui.vh.DraggableTextViewHolder;
import com.bingce.controlnetwork.ui.vh.GroupParentViewHolder;
import com.bingce.controlnetwork.ui.vh.IndexTextSelectableViewHolder;
import com.bingce.controlnetwork.ui.vh.IndexTextViewHolder;
import com.bingce.controlnetwork.ui.vh.IndexTextWithPrefixViewHolder;
import com.bingce.controlnetwork.ui.vh.ItemWellViewHolder;
import com.bingce.controlnetwork.ui.vh.KeyBoolViewHolder;
import com.bingce.controlnetwork.ui.vh.KeyValueViewHolder;
import com.bingce.controlnetwork.ui.vh.StationAdjustItemViewHolder;
import com.bingce.controlnetwork.ui.vh.StationGroupItemViewHolder;
import com.bingce.controlnetwork.ui.vh.SurveyorDataAloneDistanceViewHolder;
import com.bingce.controlnetwork.ui.vh.SurveyorDataViewHolder;
import com.bingce.controlnetwork.ui.vh.SurveyorDataViewHolderHeightTraverse;
import com.bingce.controlnetwork.ui.vh.SurveyorDataViewHolderHor;
import com.bingce.controlnetwork.ui.vh.SurveyorDataViewHolderVer;
import com.bingce.controlnetwork.ui.vh.SurveyorDataWellDistanceViewHolder;
import com.bingce.controlnetwork.ui.vh.TextSelectableViewHolder;
import com.bingce.controlnetwork.ui.vh.TitleWithSubtitleViewHolder;
@ -68,6 +55,8 @@ public class ViewFactory {
case textSelectable:
return LayoutInflater.from(context).inflate(R.layout.list_item_text_selectable_layout, parent, false);
case surveyorStationPointItem:
case sepatateHorAngle:
case sepatateVerAngle://分开观测水平角,垂直角复用原来的布局
return LayoutInflater.from(context).inflate(R.layout.list_item_surveyor_station_point_layout, parent, false);
case stationAdjust:
return LayoutInflater.from(context).inflate(R.layout.list_item_station_adjust_layout, parent, false);
@ -115,7 +104,12 @@ public class ViewFactory {
case wellItem:
return new ItemWellViewHolder(view);
case aloneDistanceMeasure:
return new SurveyorDataAloneDistanceViewHolder(context, view);
// SurveyorDataAloneDistanceViewHolder
return new SurveyorDataWellDistanceViewHolder(context, view);
case sepatateHorAngle:
return new SurveyorDataViewHolderHor(context, view);
case sepatateVerAngle:
return new SurveyorDataViewHolderVer(context, view);
case heightTraverseSurveyor:
return new SurveyorDataViewHolderHeightTraverse(context, view);
default:

@ -11,6 +11,7 @@ import com.bingce.controlapphelper.datasource.database.surveyorstation.model.Sur
import com.bingce.controlapphelper.datasource.database.tolerance.detail.ToleranceDetailRecord;
import com.bingce.controlnetwork.bean.SurveyorScheduleConstants;
import com.bingce.controlnetwork.surveyor.data.CachedDataPointType;
import com.bingce.controlnetwork.surveyor.state.StateConstantsTj;
import com.bingce.utils.ThreadPoolUtil;
import java.util.ArrayList;
@ -118,4 +119,34 @@ public class StationUtilPla {
public interface ICanAdjust {
void adjust(boolean isCanAdjust);
}
@WorkerThread
public static boolean checkStationCanExport(SurveyorStationRecord stationRecord) {
List<String> stationStatusList = new ArrayList<>();
// if (stationRecord.isSeparateObservation()) {
// stationStatusList.add(getStationStatus(stationRecord.getId(), StateConstantsTj.VALUE_MEASURE_WHAT_ANGLE_HOR));
// } else {
// stationStatusList.add(getStationStatus(stationRecord.getId(), StateConstantsTj.VALUE_MEASURE_WHAT_DEFAULT));
// addAloneDistanceStatusToList(stationRecord, stationStatusList);
// }
if (stationRecord.isSeparateObservation()) {
stationStatusList.add(getStationStatus(stationRecord.getId(), StateConstantsTj.VALUE_MEASURE_WHAT_ANGLE_HOR));
}else {
stationStatusList.add(getStationStatus(stationRecord.getId(), StateConstantsTj.VALUE_MEASURE_WHAT_DEFAULT));
}
return checkStationCanExport(stationStatusList);
}
private static boolean checkStationCanExport(List<String> stationStatusList) {
boolean canExport = true;
for (String status : stationStatusList) {
if (!SurveyorScheduleConstants.STATUE_VALUE_CHECKED.equals(status)) {
canExport = false;
break;
}
}
return canExport;
}
}

@ -33,6 +33,14 @@
android:text="左右角观测"
android:visibility="visible" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/scSeparate"
android:layout_width="match_parent"
android:layout_height="48dp"
android:checked="false"
android:text="水平角,垂直角,距离分开观测"
android:visibility="visible" />
</LinearLayout>
<com.bingce.controlnetwork.newui.widget.switchtext.SwitchWithText

@ -41,6 +41,7 @@
</LinearLayout>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/scAloneMeasureDistance"
android:layout_width="match_parent"
@ -51,13 +52,22 @@
android:visibility="visible" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/scOpenAtr"
android:id="@+id/scMeasureVer"
android:layout_width="match_parent"
android:layout_height="48dp"
android:checked="false"
android:paddingVertical="12dp"
android:text="是否开启ATR"
android:visibility="gone" />
android:text="是否观测垂直角"
android:visibility="visible" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/scMeasureDistance"
android:layout_width="match_parent"
android:layout_height="48dp"
android:checked="false"
android:paddingVertical="12dp"
android:text="是否观测距离"
android:visibility="visible" />
</LinearLayout>

@ -1 +1 @@
Subproject commit 0c4327501a3bc4830c366d2b7f9c947839152a29
Subproject commit 686f68e2478454ec4d4903173f6f17d80229137b
Loading…
Cancel
Save