Merge branch 'master' of git.code.tencent.com:beijing-rtss-test/bj-rtss-client

This commit is contained in:
Yuan 2023-08-07 16:21:29 +08:00
commit 27d56b851d
2 changed files with 12 additions and 8 deletions

View File

@ -6,7 +6,10 @@ import {
VectorText,
calculateLineMidpoint,
} from 'src/jl-graphic';
import { SlopeKiloMarker } from '../slopeKiloMarker/SlopeKiloMarker';
import {
SlopeKiloMarker,
KiloMarkerConsts,
} from '../slopeKiloMarker/SlopeKiloMarker';
export interface ISlopeData extends GraphicData {
get points(): IPointData[]; // 线坐标点
set points(points: IPointData[]);
@ -22,7 +25,6 @@ export interface ISlopeData extends GraphicData {
export const SlopeConsts = {
lineColor: '0xffffff',
lineWidth: 2,
height: 100,
};
export class Slope extends JlGraphic {
@ -63,8 +65,8 @@ export class Slope extends JlGraphic {
if (this.datas.slopeNumber !== 0) {
distanceY =
this.datas.slopeNumber > 0
? -SlopeConsts.height / 2
: SlopeConsts.height / 2;
? -KiloMarkerConsts.size
: KiloMarkerConsts.size;
}
this.datas.points.forEach((p, i) => {
if (i !== 0) {
@ -98,8 +100,8 @@ export class Slope extends JlGraphic {
this.datas.refDeviceId[1]
) as SlopeKiloMarker;
this.slopeLong.text =
slopeKiloMarkerR.datas.kilometerSystem?.kilometer -
slopeKiloMarkerL.datas.kilometerSystem?.kilometer;
slopeKiloMarkerR.datas.kilometerSystem[0]?.kilometer -
slopeKiloMarkerL.datas.kilometerSystem[0]?.kilometer;
const slopeLongPosition = this.datas.childTransforms?.find(
(t) => t.name === this.slopeLong.name
)?.transform.position;

View File

@ -68,11 +68,13 @@ export class SlopeDraw extends GraphicDrawAssistant<SlopeTemplate, ISlopeData> {
const refSlopeKiloMarker = this.app.queryStore.queryById(
g.datas.refDeviceId[0]
) as SlopeKiloMarker;
return refSlopeKiloMarker.datas.direction == dirSlop;
return (
refSlopeKiloMarker.datas.kilometerSystem[0].direction == dirSlop
);
});
const slopeKiloMarkers = this.app.queryStore
.queryByType<SlopeKiloMarker>(SlopeKiloMarker.Type)
.filter((g) => g.datas.direction == dirSlop);
.filter((g) => g.datas.kilometerSystem[0].direction == dirSlop);
slopeKiloMarkers.sort((a, b) => a.position.x - b.position.x);
const slopeKiloMarkersPos = slopeKiloMarkers.map((g) => g.position.x);
//检验坡度有效性--是否有增加和删除