|
|
|
@ -6,7 +6,6 @@ import android.text.TextUtils; |
|
|
|
|
|
|
|
|
|
import androidx.annotation.WorkerThread; |
|
|
|
|
|
|
|
|
|
import com.bingce.controlapphelper.datasource.database.ProjectType; |
|
|
|
|
import com.bingce.controlapphelper.datasource.database.ProjectTypeValue; |
|
|
|
|
import com.bingce.controlapphelper.datasource.database.SurveyorDatabaseFactory; |
|
|
|
|
import com.bingce.controlapphelper.datasource.database.line.ILineRecordDataSource; |
|
|
|
@ -23,20 +22,18 @@ import com.bingce.controlapphelper.datasource.database.tolerance.detail.IToleran |
|
|
|
|
import com.bingce.controlapphelper.datasource.database.tolerance.detail.ToleranceDetailRecord; |
|
|
|
|
import com.bingce.controlapphelper.datasource.database.tolerance.group.ToleranceGroupRecord; |
|
|
|
|
import com.bingce.controlapphelper.datasource.database.tolerance.level.ToleranceLevelRecord; |
|
|
|
|
import com.bingce.controlapphelper.surveyor.data.CachedData; |
|
|
|
|
import com.bingce.controlapphelper.surveyor.data.CachedDataAloneDistance; |
|
|
|
|
import com.bingce.controlapphelper.surveyor.method.ExportStationMethod; |
|
|
|
|
import com.bingce.controlapphelper.surveyor.method.ExportUtils; |
|
|
|
|
import com.bingce.controlapphelper.surveyor.method.SurveyorAdjustMethod; |
|
|
|
|
import com.bingce.controlapphelper.util.Tools; |
|
|
|
|
import com.bingce.controlnetwork.App; |
|
|
|
|
import com.bingce.controlnetwork.R; |
|
|
|
|
import com.bingce.controlnetwork.model.AloneAdjustItem; |
|
|
|
|
import com.bingce.controlnetwork.newui.configfragment.SelectExportType; |
|
|
|
|
import com.bingce.controlnetwork.surveyor.data.CachedData; |
|
|
|
|
import com.bingce.controlnetwork.surveyor.data.CachedDataPointType; |
|
|
|
|
import com.bingce.controlnetwork.surveyor.state.StateConstantsPla; |
|
|
|
|
import com.bingce.controlnetwork.util.CheckRegUtil; |
|
|
|
|
import com.bingce.utils.DateUtils; |
|
|
|
|
import com.bingce.utils.RegisterUtil; |
|
|
|
|
import com.bingce.utils.Util; |
|
|
|
|
import com.bingce.utils.VipManager; |
|
|
|
|
import com.bingce.zip.ZipUtil; |
|
|
|
|
|
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
@ -236,7 +233,7 @@ public class ExportUtilsPla { |
|
|
|
|
ExportStationMethod.save(" ", periodFolder, "边长.TXT"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
exportProjectAndControlPoint(project,projectCachedDir); |
|
|
|
|
exportProjectAndControlPoint(project, projectCachedDir); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -355,15 +352,44 @@ public class ExportUtilsPla { |
|
|
|
|
private static void collectCustomTj61365(String stationName, SurveyorStationRecord stationRecord, ToleranceDetailRecord toleranceRecord, |
|
|
|
|
StringBuilder horSbTianjinOne, StringBuilder verSbTianjinOne, |
|
|
|
|
StringBuilder disSbTianjinOne) { |
|
|
|
|
// if (stationRecord.isSeparateObservation()) {
|
|
|
|
|
// collectAloneHorAngleTjUnique(stationName, stationRecord, toleranceRecord, horSbTianjinOne);
|
|
|
|
|
// } else {
|
|
|
|
|
// collectCombineAngleDistanceTjUnique(stationName, stationRecord, toleranceRecord, horSbTianjinOne, verSbTianjinOne, disSbTianjinOne);
|
|
|
|
|
// }
|
|
|
|
|
collectCombineAngleDistanceTjUnique(stationName, stationRecord, toleranceRecord, horSbTianjinOne, verSbTianjinOne, disSbTianjinOne); |
|
|
|
|
if (stationRecord.isSeparateObservation()) { |
|
|
|
|
collectAloneHorAngleTjUnique(stationName, stationRecord, toleranceRecord, horSbTianjinOne); |
|
|
|
|
} else { |
|
|
|
|
collectCombineAngleDistanceTjUnique(stationName, stationRecord, toleranceRecord, horSbTianjinOne, verSbTianjinOne, disSbTianjinOne); |
|
|
|
|
} |
|
|
|
|
collectAloneVerAngleTjUnique(stationName, stationRecord, toleranceRecord, verSbTianjinOne); |
|
|
|
|
collectAloneDistanceTjUnique(stationName, stationRecord, toleranceRecord, disSbTianjinOne); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void collectAloneHorAngleTjUnique(String stationName, SurveyorStationRecord stationRecord, |
|
|
|
|
ToleranceDetailRecord toleranceRecord, StringBuilder horSbTianjinOne) { |
|
|
|
|
SurveyorAdjustMethodPla.AdjustResult adjustResultHorAngle = SurveyorAdjustMethodPla.calStationAdjust(StateConstantsPla.VALUE_MEASURE_WHAT_ANGLE_HOR, stationRecord, |
|
|
|
|
CachedData.newInstance( |
|
|
|
|
StateConstantsPla.VALUE_MEASURE_WHAT_ANGLE_HOR, |
|
|
|
|
CachedDataPointType.ALL_POINT, |
|
|
|
|
stationRecord.isAutoClose(), |
|
|
|
|
stationRecord.isLeftAndRightSurveyor(), |
|
|
|
|
stationRecord.getId(), |
|
|
|
|
toleranceRecord |
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
if (adjustResultHorAngle.errorString == null || adjustResultHorAngle.errorString.isEmpty()) { |
|
|
|
|
//水平角
|
|
|
|
|
horSbTianjinOne.append(stationName).append(SPACE).append(formatHeight(Double.parseDouble(stationRecord.getInstrumentHeightDeal()))).append(SPACE); |
|
|
|
|
//遍历测站测点
|
|
|
|
|
for (int i = 0; i < adjustResultHorAngle.result.size(); i++) { |
|
|
|
|
SurveyorAdjustMethodPla.Item item = adjustResultHorAngle.result.get(i); |
|
|
|
|
//水平角
|
|
|
|
|
String exportHorAngle = ExportStationMethod.radianToDmsForTj61365(item.getHorAngle(), true); |
|
|
|
|
if (i != 0) { |
|
|
|
|
horSbTianjinOne.append(SPACE).append(SPACE); |
|
|
|
|
} |
|
|
|
|
horSbTianjinOne.append(item.getPointName()).append(SPACE).append(exportHorAngle).append(SPACE).append(formatHeight(Double.parseDouble(item.getPrismHeightActual()))); |
|
|
|
|
horSbTianjinOne.append(NEW_LINE); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 收集合并观测的水平角,垂直角和距离 |
|
|
|
|
* 距离可能存在单独测距 |
|
|
|
@ -377,7 +403,7 @@ public class ExportUtilsPla { |
|
|
|
|
stationRecord.getId(), toleranceRecord); |
|
|
|
|
|
|
|
|
|
//测距测角的平差结果
|
|
|
|
|
SurveyorAdjustMethod.AdjustResult adjustResult = SurveyorAdjustMethod.calStationAdjust(stationRecord, cachedData); |
|
|
|
|
SurveyorAdjustMethodPla.AdjustResult adjustResult = SurveyorAdjustMethodPla.calStationAdjust(stationRecord, cachedData); |
|
|
|
|
if (adjustResult.errorString == null || adjustResult.errorString.isEmpty()) { |
|
|
|
|
//水平角
|
|
|
|
|
horSbTianjinOne.append(stationName).append(SPACE).append(formatHeight(Double.parseDouble(stationRecord.getInstrumentHeight()))).append(SPACE); |
|
|
|
@ -386,19 +412,19 @@ public class ExportUtilsPla { |
|
|
|
|
int verEverySurveyorPoint = 0; |
|
|
|
|
//遍历测站测点
|
|
|
|
|
for (int i = 0; i < adjustResult.result.size(); i++) { |
|
|
|
|
SurveyorAdjustMethod.Item item = adjustResult.result.get(i); |
|
|
|
|
SurveyorAdjustMethodPla.Item item = adjustResult.result.get(i); |
|
|
|
|
//水平角
|
|
|
|
|
String exportHorAngle = ExportStationMethod.radianToDmsForTj61365(item.getHorAngle(), true); |
|
|
|
|
if (i != 0) { |
|
|
|
|
horSbTianjinOne.append(SPACE).append(SPACE); |
|
|
|
|
} |
|
|
|
|
horSbTianjinOne.append(item.getPointName()).append(SPACE).append(exportHorAngle).append(SPACE).append(formatHeight(item.getPrismHeight())); |
|
|
|
|
horSbTianjinOne.append(item.getPointName()).append(SPACE).append(exportHorAngle).append(SPACE).append(formatHeight(Double.parseDouble(item.getPrismHeight()))); |
|
|
|
|
horSbTianjinOne.append(NEW_LINE); |
|
|
|
|
|
|
|
|
|
verEverySurveyorPoint++; |
|
|
|
|
String exportVerAngle = ExportStationMethod.radianToDmsForTj61365(item.getVerAngle(), false); |
|
|
|
|
verSbTianjinEveryStation.append(item.getPointName()).append(SPACE).append(exportVerAngle).append(SPACE).append(formatHeight(Double.parseDouble(stationRecord.getInstrumentHeight()))) |
|
|
|
|
.append(SPACE).append(formatHeight(item.getPrismHeight())); |
|
|
|
|
.append(SPACE).append(formatHeight(Double.parseDouble(item.getPrismHeight()))); |
|
|
|
|
verSbTianjinEveryStation.append(NEW_LINE); |
|
|
|
|
|
|
|
|
|
double distance = item.getDistance(); |
|
|
|
@ -416,29 +442,53 @@ public class ExportUtilsPla { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void collectAloneVerAngleTjUnique(String stationName, SurveyorStationRecord stationRecord, |
|
|
|
|
ToleranceDetailRecord toleranceRecord, StringBuilder verSbTianjinOne) { |
|
|
|
|
List<AloneAdjustItem> adjustResult = SurveyorAdjustMethodPla.calAloneVer(stationRecord.getId(), |
|
|
|
|
CachedData.newInstance( |
|
|
|
|
StateConstantsPla.VALUE_MEASURE_WHAT_ANGLE_VER, |
|
|
|
|
CachedDataPointType.ALONE_MEASURE_VER_ANGLE_POINT, |
|
|
|
|
stationRecord.isAutoClose(), |
|
|
|
|
stationRecord.isLeftAndRightSurveyor(), |
|
|
|
|
stationRecord.getId(), |
|
|
|
|
toleranceRecord |
|
|
|
|
), false); |
|
|
|
|
|
|
|
|
|
if (!adjustResult.isEmpty()) { |
|
|
|
|
verSbTianjinOne.append(stationName).append(SPACE).append(adjustResult.size()).append(NEW_LINE); |
|
|
|
|
//遍历测站测点
|
|
|
|
|
for (int i = 0; i < adjustResult.size(); i++) { |
|
|
|
|
AloneAdjustItem item = adjustResult.get(i); |
|
|
|
|
String exportVerAngle = ExportStationMethod.radianToDmsForTj61365(item.getVerAngle(), false); |
|
|
|
|
verSbTianjinOne.append(item.getPointName()).append(SPACE).append(exportVerAngle).append(SPACE) |
|
|
|
|
.append(formatHeight(Double.parseDouble(stationRecord.getInstrumentHeightDeal()))).append(SPACE).append(formatHeight(Double.parseDouble(item.getPrismHeightActual()))); |
|
|
|
|
verSbTianjinOne.append(NEW_LINE); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 收集天津边长数据 |
|
|
|
|
* 合并观测和分开观测的单独测距 |
|
|
|
|
*/ |
|
|
|
|
private static void collectAloneDistanceTjUnique(String stationName, SurveyorStationRecord stationRecord, |
|
|
|
|
ToleranceDetailRecord toleranceRecord, StringBuilder disSbTianjinOne) { |
|
|
|
|
SurveyorAdjustMethod.calAloneDistance(stationRecord.getId(), |
|
|
|
|
CachedDataAloneDistance.newInstance(stationRecord.getId()), new SurveyorAdjustMethod.ICallback() { |
|
|
|
|
@Override |
|
|
|
|
public void onGet(ArrayList<SurveyorAdjustMethod.Item> adjustResult, Boolean isShowSlopDistance) { |
|
|
|
|
if (!adjustResult.isEmpty()) { |
|
|
|
|
for (SurveyorAdjustMethod.Item item : adjustResult) { |
|
|
|
|
appendAloneDistance(disSbTianjinOne, stationName, item.getPointName(), item.getDistance(), |
|
|
|
|
Double.parseDouble(stationRecord.getInstrumentHeightDeal()), String.valueOf(item.getPrismHeight())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void onFailure(String error) { |
|
|
|
|
List<AloneAdjustItem> adjustResult = SurveyorAdjustMethodPla.calAloneDistance(stationRecord.getId(), |
|
|
|
|
CachedData.newInstance( |
|
|
|
|
StateConstantsPla.VALUE_MEASURE_WHAT_DISTANCE, |
|
|
|
|
CachedDataPointType.ALONE_MEASURE_DISTANCE_POINT, |
|
|
|
|
stationRecord.isAutoClose(), |
|
|
|
|
stationRecord.isLeftAndRightSurveyor(), |
|
|
|
|
stationRecord.getId(), |
|
|
|
|
toleranceRecord |
|
|
|
|
), false); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (!adjustResult.isEmpty()) { |
|
|
|
|
for (AloneAdjustItem item : adjustResult) { |
|
|
|
|
appendAloneDistance(disSbTianjinOne, stationName, item.getPointName(), item.getDistance(), Double.parseDouble(stationRecord.getInstrumentHeightDeal()), item.getPrismHeightActual()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void appendAloneDistance(StringBuilder disSbTianjinOne, String stationName, String pointName, double distance, |
|
|
|
@ -506,10 +556,10 @@ public class ExportUtilsPla { |
|
|
|
|
cachedData.onShowSlopDistance(false);//平距
|
|
|
|
|
|
|
|
|
|
//计算平差数据
|
|
|
|
|
SurveyorAdjustMethod.AdjustResult adjustResult = SurveyorAdjustMethod.calStationAdjust(stationRecord, cachedData); |
|
|
|
|
SurveyorAdjustMethodPla.AdjustResult adjustResult = SurveyorAdjustMethodPla.calStationAdjust(stationRecord, cachedData); |
|
|
|
|
if (TextUtils.isEmpty(adjustResult.errorString)) { |
|
|
|
|
ksStringBuilder.append(stationName).append(NEW_LINE); |
|
|
|
|
for (SurveyorAdjustMethod.Item item : adjustResult.result) { |
|
|
|
|
for (SurveyorAdjustMethodPla.Item item : adjustResult.result) { |
|
|
|
|
ksStringBuilder |
|
|
|
|
.append(item.getPointName()) |
|
|
|
|
.append(",L,") |
|
|
|
@ -517,7 +567,7 @@ public class ExportUtilsPla { |
|
|
|
|
.append(NEW_LINE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (SurveyorAdjustMethod.Item item : adjustResult.result) { |
|
|
|
|
for (SurveyorAdjustMethodPla.Item item : adjustResult.result) { |
|
|
|
|
//这里兼容下钢丝测距的距离
|
|
|
|
|
String pointName = item.getPointName(); |
|
|
|
|
|
|
|
|
@ -668,9 +718,9 @@ public class ExportUtilsPla { |
|
|
|
|
cachedData.onShowSlopDistance(false); |
|
|
|
|
|
|
|
|
|
//计算平差数据
|
|
|
|
|
SurveyorAdjustMethod.AdjustResult adjustResult = SurveyorAdjustMethod.calStationAdjust(stationRecord, cachedData); |
|
|
|
|
SurveyorAdjustMethodPla.AdjustResult adjustResult = SurveyorAdjustMethodPla.calStationAdjust(stationRecord, cachedData); |
|
|
|
|
if (TextUtils.isEmpty(adjustResult.errorString)) { |
|
|
|
|
for (SurveyorAdjustMethod.Item item : adjustResult.result) { |
|
|
|
|
for (SurveyorAdjustMethodPla.Item item : adjustResult.result) { |
|
|
|
|
//这里兼容下钢丝测距的距离
|
|
|
|
|
String pointName = item.getPointName(); |
|
|
|
|
|
|
|
|
@ -859,7 +909,7 @@ public class ExportUtilsPla { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
StringBuilder stationSb = new StringBuilder(); |
|
|
|
|
Map<String, List<SurveyorAdjustMethod.Item>> tempDataMap = new LinkedHashMap<>(); |
|
|
|
|
Map<String, List<SurveyorAdjustMethodPla.Item>> tempDataMap = new LinkedHashMap<>(); |
|
|
|
|
|
|
|
|
|
for (Map.Entry<String, Station> stationEntry : cycle.stationMap.entrySet()) { |
|
|
|
|
String stationId = stationEntry.getValue().stationId; |
|
|
|
@ -878,7 +928,7 @@ public class ExportUtilsPla { |
|
|
|
|
cachedData.onShowSlopDistance(false); |
|
|
|
|
|
|
|
|
|
//计算平差数据
|
|
|
|
|
SurveyorAdjustMethod.AdjustResult adjustResult = SurveyorAdjustMethod.calStationAdjust(stationRecord, cachedData); |
|
|
|
|
SurveyorAdjustMethodPla.AdjustResult adjustResult = SurveyorAdjustMethodPla.calStationAdjust(stationRecord, cachedData); |
|
|
|
|
if (TextUtils.isEmpty(adjustResult.errorString)) { |
|
|
|
|
stationSb.append(cycle.stationMap.keySet().size()); |
|
|
|
|
stationSb.append(NEW_LINE); |
|
|
|
@ -886,7 +936,7 @@ public class ExportUtilsPla { |
|
|
|
|
stationSb.append(stationName).append(",").append(adjustResult.result.size()).append(",").append(NEW_LINE); |
|
|
|
|
stationSb.append("照准点").append(NEW_LINE); |
|
|
|
|
|
|
|
|
|
for (SurveyorAdjustMethod.Item item : adjustResult.result) { |
|
|
|
|
for (SurveyorAdjustMethodPla.Item item : adjustResult.result) { |
|
|
|
|
//这里兼容下钢丝测距的距离
|
|
|
|
|
String pointName = item.getPointName(); |
|
|
|
|
|
|
|
|
@ -1319,16 +1369,16 @@ public class ExportUtilsPla { |
|
|
|
|
final double[] verAngle = new double[1]; |
|
|
|
|
final double[] distance = new double[1]; |
|
|
|
|
|
|
|
|
|
SurveyorAdjustMethod.AdjustResult adjustResult = SurveyorAdjustMethod.calStationAdjust(stationRecord, cachedData); |
|
|
|
|
SurveyorAdjustMethodPla.AdjustResult adjustResult = SurveyorAdjustMethodPla.calStationAdjust(stationRecord, cachedData); |
|
|
|
|
if (TextUtils.isEmpty(adjustResult.errorString)) { |
|
|
|
|
//展示结果数据
|
|
|
|
|
//检测归零值是否为负,如果是需要+2PI
|
|
|
|
|
for (SurveyorAdjustMethod.Item item : adjustResult.result) { |
|
|
|
|
for (SurveyorAdjustMethodPla.Item item : adjustResult.result) { |
|
|
|
|
if (item.getHorAngle() < 0) { |
|
|
|
|
item.setHorAngle(Math.PI * 2 + item.getHorAngle()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
SurveyorAdjustMethod.Item item = adjustResult.result.get(adjustResult.result.size() - 1); |
|
|
|
|
SurveyorAdjustMethodPla.Item item = adjustResult.result.get(adjustResult.result.size() - 1); |
|
|
|
|
horAngle[0] = item.getHorAngle(); |
|
|
|
|
verAngle[0] = item.getVerAngle(); |
|
|
|
|
distance[0] = item.getDistance(); |
|
|
|
|