邵佳豪 3 years ago
parent
commit
ee9a982e86
  1. 2
      src/app/babylon/controller/config-manager.ts
  2. 7
      src/app/babylon/model/info/model/model-info-facility.ts
  3. 1
      src/app/babylon/model/info/model/model-info.ts
  4. 17
      src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item.ts
  5. 1
      src/app/pages/left-domain/left-domain.component.ts
  6. 29
      src/app/pages/plan/plan.component.ts

2
src/app/babylon/controller/config-manager.ts

@ -43,7 +43,7 @@ export class ConfigManager {
case FacilityType.QY:
case FacilityType.TPBZ:
case FacilityType.DWBZ:
case FacilityType.JY_JYJ://临时
// case FacilityType.JY_JYJ://临时
case FacilityType.JY_YG://临时
result = true;

7
src/app/babylon/model/info/model/model-info-facility.ts

@ -47,15 +47,18 @@ export class ModelInfo_facility extends ModelInfo {
onCreateFollowUI() {
let facilityData = this.modelData as ModelData_facility;
super.onCreateFollowUI();
BabylonUIStyleTool.setStyle_size(this.uiFollowRoot, ConfigManager.c_size_facilityIconSize + "px", ConfigManager.c_size_facilityIconSize + "px");
if (!ConfigManager.getFacilityNeedIcon(facilityData.facilityType)) {
return;
}
super.onCreateFollowUI();
let instance = this;
let posType = ConfigManager.getPosType(facilityData.facilityType);
let iconPath = ConfigManager.getFacilityIconUrl(facilityData.facilityType, posType);
BabylonUIStyleTool.setStyle_size(this.uiFollowRoot, ConfigManager.c_size_facilityIconSize + "px", ConfigManager.c_size_facilityIconSize + "px");
this.uiFollowRoot.thickness = 0;

1
src/app/babylon/model/info/model/model-info.ts

@ -144,6 +144,7 @@ export class ModelInfo {
onCreateFollowUI() {
this.uiFollowRoot = new Rectangle('follow_' + this.key);
this.uiFollowRoot.thickness = 0;
UIManager.Instance.uiRoot.addControl(this.uiFollowRoot);
}

17
src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item.ts

@ -96,6 +96,7 @@ export class FacilityInfoUIItem {
this.facilityInfoInSceneWindow.selectFacilityItemToThree([this], true);
this.modelInfo.setIconEnable(select);
this.facilityInfoInSceneWindow.playJYJSelectEffect(select, this.modelInfo)
this.setHeadUICurrentPos();
}
else {
this.facilityInfoInSceneWindow.selectFacilityItemToThree([this], false);
@ -137,18 +138,32 @@ export class FacilityInfoUIItem {
}
/**
* ui位置
*/
currentUIPos: Vector2 = Vector2.Zero();
/**
* UI的位置
*/
getHeadUIPos(): Vector2 {
if (this.modelInfo != null) {
return this.modelInfo.getHeadUIPos();
this.currentUIPos = Vector2.Lerp(this.currentUIPos, this.modelInfo.getHeadUIPos(), 0.3);
return this.currentUIPos;
}
else {
return null;
}
}
/**
* UI当前位置起点
*/
setHeadUICurrentPos() {
this.currentUIPos = this.modelInfo.getHeadUIPos();
}
}

1
src/app/pages/left-domain/left-domain.component.ts

@ -283,7 +283,6 @@ export class LeftDomainComponent implements OnInit {
this.updateFatherData(index) //更新/初始化父组件 数据
PlanComponent.instance.initViewer()
MarkWindow.instance.selectMarkNode(item.id, e.id)
PlanComponent.instance.beforePlanNode = MarkWindow.instance.currentMarkNodeInfo.nodeData
} else if (this.selectPlanId === item.id && this.selectNodeId === e.id) { //取消选中
this.selectPlanId = null
this.selectNodeId = null

29
src/app/pages/plan/plan.component.ts

@ -30,6 +30,7 @@ import { Event_GetAllMarkPlanData } from 'src/app/babylon/controller/event-manag
import { FacilityInfoInSceneWindow } from 'src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window';
import { FacilityType } from 'src/app/babylon/model/data/model-data/model-data-facility';
import { HttpClient } from '@angular/common/http';
import { DataBuffer } from '@babylonjs/core';
@ -54,6 +55,8 @@ export class PlanComponent implements OnInit {
public isShowLoading: boolean = true; //显隐 loading加载条
public companyData: any; //当前加油站所属组织机构 data
private readonly c_frameSpace = 16;//更新的帧间隔, 16大概是60帧每秒
private lasteUpdateTime = 0;//上次更新的时间(毫秒)
ngOnInit(): void {
PlanComponent.instance = this;
@ -79,6 +82,9 @@ export class PlanComponent implements OnInit {
}
})
//监听 delete键盘事件
this.game.scene.onBeforeRenderObservable.add(() => {
PlanComponent.instance.onUpdate();
})
}
ngAfterViewInit(): void {
@ -123,7 +129,16 @@ export class PlanComponent implements OnInit {
})
}
ngAfterViewChecked () {
/**
*
*/
onUpdate() {
let currentTime = new Date().getTime();
let space = currentTime - this.lasteUpdateTime;
if (space < this.c_frameSpace) {
return;
}
this.lasteUpdateTime = currentTime;
if (this.isShowNature && this.beforeOnePropertyData && (this.selectFence === 1 || this.selectFence === 2)) { //刷新弹窗 位置
this.renovateDialogPosition()
}
@ -403,10 +418,12 @@ export class PlanComponent implements OnInit {
//刷新设备属性 弹窗位置
renovateDialogPosition() {
window.setTimeout(()=>{
this.naturePosition.left = `${this.beforeOnePropertyData.getHeadUIPos().x - 150}px`
this.naturePosition.top = `${this.beforeOnePropertyData.getHeadUIPos().y + 100}px`
},0)
// window.setTimeout(() => {
this.naturePosition.left = `${this.beforeOnePropertyData.getHeadUIPos().x - 150}px`
this.naturePosition.top = `${this.beforeOnePropertyData.getHeadUIPos().y + 100}px`
// }, 0)
}
//上传设备 图片
@ -458,7 +475,6 @@ export class PlanComponent implements OnInit {
this.isShowChildComponent && this.leftDomain ? this.leftDomain.selectPlanId = this.beforeEmergencyPlan.id : null
this.isShowChildComponent && this.leftDomain ? this.leftDomain.selectNodeId = this.beforePlanNode.id : null
MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id, false, true)
this.beforePlanNode = MarkWindow.instance.currentMarkNodeInfo.nodeData
this.initViewer()
this.updateProgress() //更新进度条
resolve(true)
@ -855,6 +871,7 @@ export class taskList {
export class naturePosition {
top: string = "0px"
left: string = "0px"
}
// 处置预案 所有图标
export class planIcons {

Loading…
Cancel
Save