|
@@ -14,7 +14,7 @@ export default class LocationModeControl {
|
|
|
|
|
|
//设置直角定位法
|
|
|
setAngle() {
|
|
|
- let selectBasePoint = this.isFocusBasePoint();
|
|
|
+ let selectBasePoint = this.beforeSetLocation();
|
|
|
if (selectBasePoint) {
|
|
|
this.deleteOldLines();
|
|
|
let points = dataService.getPoints();
|
|
@@ -27,6 +27,9 @@ export default class LocationModeControl {
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -82,40 +85,49 @@ export default class LocationModeControl {
|
|
|
guideLocationLine.setLinkedFixPointId(fixPointId);
|
|
|
}
|
|
|
|
|
|
- /******************************************************************************************************************************************************/
|
|
|
-
|
|
|
- //设置综合定位法
|
|
|
- setAll() {}
|
|
|
-
|
|
|
- /******************************************************************************************************************************************************/
|
|
|
-
|
|
|
- isFocusBasePoint() {
|
|
|
+ //要考虑是否有基准点,基准线,固定点
|
|
|
+ beforeSetLocation() {
|
|
|
let basePointCount = 0;
|
|
|
+ let fixPointCount = 0;
|
|
|
let selectBasePointId = null;
|
|
|
- if (!Settings.selectBasePointId) {
|
|
|
- let points = dataService.getPoints();
|
|
|
- for (let key in points) {
|
|
|
- let point = dataService.getPoint(key);
|
|
|
- if (point.getCategory() == VectorCategory.Point.BasePoint) {
|
|
|
- ++basePointCount;
|
|
|
- selectBasePointId = key;
|
|
|
- }
|
|
|
+ let points = dataService.getPoints();
|
|
|
+ for (let key in points) {
|
|
|
+ let point = dataService.getPoint(key);
|
|
|
+ if (point.getCategory() == VectorCategory.Point.BasePoint) {
|
|
|
+ ++basePointCount;
|
|
|
+ selectBasePointId = key;
|
|
|
+ } else if (point.getCategory() == VectorCategory.Point.FixPoint) {
|
|
|
+ ++fixPointCount;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if (basePointCount == 1) {
|
|
|
uiService.setSelectBasePointId(selectBasePointId);
|
|
|
}
|
|
|
|
|
|
- if (Settings.selectBasePointId) {
|
|
|
- let point = dataService.getPoint(Settings.selectBasePointId);
|
|
|
- if (point.getCategory() == VectorCategory.Point.BasePoint) {
|
|
|
- return point;
|
|
|
+ if (
|
|
|
+ basePointCount == 0 ||
|
|
|
+ fixPointCount == 0 ||
|
|
|
+ Settings.baseLineId == null
|
|
|
+ ) {
|
|
|
+ return null;
|
|
|
+ } else {
|
|
|
+ if (Settings.selectBasePointId) {
|
|
|
+ let point = dataService.getPoint(Settings.selectBasePointId);
|
|
|
+ if (point.getCategory() == VectorCategory.Point.BasePoint) {
|
|
|
+ return point;
|
|
|
+ }
|
|
|
}
|
|
|
+ return null;
|
|
|
}
|
|
|
- return null;
|
|
|
}
|
|
|
|
|
|
+ /******************************************************************************************************************************************************/
|
|
|
+
|
|
|
+ //设置综合定位法
|
|
|
+ setAll() {}
|
|
|
+
|
|
|
+ /******************************************************************************************************************************************************/
|
|
|
+
|
|
|
//设置定位法前,需要删除和定位法相关的线条
|
|
|
deleteOldLines() {
|
|
|
let lines = dataService.getLines();
|