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

View File

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