|
@@ -6,6 +6,7 @@ import { dataService } from "../Service/DataService";
|
|
|
import { lineService } from "../Service/LineService";
|
|
|
import { pointService } from "../Service/PointService";
|
|
|
import VectorCategory from "../enum/VectorCategory";
|
|
|
+import Msg from "../enum/Msg";
|
|
|
import Constant from "../Constant";
|
|
|
import { uiService } from "../Service/UIService";
|
|
|
|
|
@@ -14,8 +15,9 @@ export default class LocationModeControl {
|
|
|
|
|
|
//设置直角定位法
|
|
|
setAngle() {
|
|
|
- let selectBasePoint = this.beforeSetLocation();
|
|
|
- if (selectBasePoint) {
|
|
|
+ const code = this.beforeSetLocation();
|
|
|
+ if (code == Msg.OK) {
|
|
|
+ let selectBasePoint = dataService.getPoint(Settings.selectBasePointId);
|
|
|
this.deleteOldLines();
|
|
|
let points = dataService.getPoints();
|
|
|
for (let key in points) {
|
|
@@ -27,10 +29,8 @@ export default class LocationModeControl {
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
- return true;
|
|
|
- } else {
|
|
|
- return false;
|
|
|
}
|
|
|
+ return code;
|
|
|
}
|
|
|
|
|
|
//对一个点进行直角定位法
|
|
@@ -102,6 +102,8 @@ export default class LocationModeControl {
|
|
|
}
|
|
|
if (basePointCount == 1) {
|
|
|
uiService.setSelectBasePointId(selectBasePointId);
|
|
|
+ } else if (basePointCount > 1 && Settings.selectBasePointId == null) {
|
|
|
+ return Msg.UnSelectBasePoint;
|
|
|
}
|
|
|
|
|
|
if (
|
|
@@ -109,16 +111,15 @@ export default class LocationModeControl {
|
|
|
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;
|
|
|
- }
|
|
|
+ if (basePointCount == 0) {
|
|
|
+ return Msg.UnBasePoint;
|
|
|
+ } else if (fixPointCount == 0) {
|
|
|
+ return Msg.UnFixPoint;
|
|
|
+ } else if (Settings.baseLineId == null) {
|
|
|
+ return Msg.UnBaseLine;
|
|
|
}
|
|
|
- return null;
|
|
|
}
|
|
|
+ return Msg.OK;
|
|
|
}
|
|
|
|
|
|
/******************************************************************************************************************************************************/
|