Browse Source

完成输油管部分

beijing
刘向辉 3 years ago
parent
commit
a9cc16b19d
  1. 1
      src/app/babylon/controller/config-manager.ts
  2. 3
      src/app/babylon/controller/data-manager.ts
  3. 22
      src/app/babylon/model/data/institution/facility/property-data/in/property-data-xykg.ts
  4. 6
      src/app/babylon/model/data/institution/jyz-show-data.ts
  5. 4
      src/app/babylon/model/data/mark/mark-data.ts
  6. 5
      src/app/babylon/model/data/mark/mark-plan-data.ts
  7. 5
      src/app/babylon/model/data/model-data/model-data-facility.ts
  8. 67
      src/app/babylon/model/info/model/model-info-facility.ts
  9. 50
      src/app/babylon/view/building-window/building-window.ts
  10. 4
      src/app/babylon/view/facility-window/facility-window.ts
  11. 4
      src/app/babylon/view/mark-window/mark-window.ts
  12. BIN
      src/assets/images/mark/inside/syg.png
  13. 2
      src/assets/mesh/mark/inside/ygc/YGC.gltf.manifest

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

@ -100,6 +100,7 @@ export class ConfigManager {
case FacilityType.JY_SYGX: result = "输油管线"; break; case FacilityType.JY_SYGX: result = "输油管线"; break;
case FacilityType.JY_YQHSGX: result = "油气回收管线"; break; case FacilityType.JY_YQHSGX: result = "油气回收管线"; break;
case FacilityType.JY_FM: result = "阀门"; break; case FacilityType.JY_FM: result = "阀门"; break;
case FacilityType.JY_XYKG: result = "卸油口盖"; break;
} }
return result; return result;
} }

3
src/app/babylon/controller/data-manager.ts

@ -16,6 +16,7 @@ import { PropertyData_FM } from '../model/data/institution/facility/property-dat
import { PropertyData_JYJ } from '../model/data/institution/facility/property-data/in/property-data-jyj'; import { PropertyData_JYJ } from '../model/data/institution/facility/property-data/in/property-data-jyj';
import { PropertyData_MHQ } from '../model/data/institution/facility/property-data/in/property-data-mhq'; import { PropertyData_MHQ } from '../model/data/institution/facility/property-data/in/property-data-mhq';
import { PropertyData_SYGX } from '../model/data/institution/facility/property-data/in/property-data-sygx'; import { PropertyData_SYGX } from '../model/data/institution/facility/property-data/in/property-data-sygx';
import { PropertyData_XYKG } from '../model/data/institution/facility/property-data/in/property-data-xykg';
import { PropertyData_YG } from '../model/data/institution/facility/property-data/in/property-data-yg'; import { PropertyData_YG } from '../model/data/institution/facility/property-data/in/property-data-yg';
import { PropertyData_YQHSGX } from '../model/data/institution/facility/property-data/in/property-data-yqhsgx'; import { PropertyData_YQHSGX } from '../model/data/institution/facility/property-data/in/property-data-yqhsgx';
import { PropertyData_DWBZ } from '../model/data/institution/facility/property-data/out/property-data-dwbz'; import { PropertyData_DWBZ } from '../model/data/institution/facility/property-data/out/property-data-dwbz';
@ -487,7 +488,7 @@ export class DataManager {
case FacilityType.JY_SYGX: result = new PropertyData_SYGX(key); break; case FacilityType.JY_SYGX: result = new PropertyData_SYGX(key); break;
case FacilityType.JY_YQHSGX: result = new PropertyData_YQHSGX(key); break; case FacilityType.JY_YQHSGX: result = new PropertyData_YQHSGX(key); break;
case FacilityType.JY_FM: result = new PropertyData_FM(key, ""); break; case FacilityType.JY_FM: result = new PropertyData_FM(key, ""); break;
case FacilityType.JY_XYKG: result = new PropertyData_XYKG(key); break;
} }
if (result == null) { if (result == null) {

22
src/app/babylon/model/data/institution/facility/property-data/in/property-data-xykg.ts

@ -0,0 +1,22 @@
import { FacilityType } from "../../../../model-data/model-data-facility";
import { PropertyData_Base } from "../property-data-base";
/**
*
*/
export class PropertyData_XYKG extends PropertyData_Base {
constructor(key: string) {
super(key, FacilityType.JY_XYKG);
this.name = "卸油口盖";
}
clone(key: string) {
let result = new PropertyData_XYKG(key);
result.name = this.name;
return result;
}
}

6
src/app/babylon/model/data/institution/jyz-show-data.ts

@ -23,12 +23,16 @@ export class JYZShowData {
*/ */
showZP: boolean; showZP: boolean;
constructor(moudleType: JYZInfoMoudleType, camera: ArcRotateCamera, showZP: boolean) { closeXYKG: boolean = true;
constructor(moudleType: JYZInfoMoudleType, camera: ArcRotateCamera, showZP: boolean, closeXYKG: boolean) {
this.moudleType = moudleType; this.moudleType = moudleType;
this.cameraData = new ArcRotateCameraData(); this.cameraData = new ArcRotateCameraData();
if (camera != null) { if (camera != null) {
this.cameraData.getDataFromCamera(camera); this.cameraData.getDataFromCamera(camera);
} }
this.showZP = showZP;
this.closeXYKG = closeXYKG;
} }

4
src/app/babylon/model/data/mark/mark-data.ts

@ -10,10 +10,6 @@ import { MarkProperty } from "./mark-property";
* *
*/ */
export class MarkData extends ModelData { export class MarkData extends ModelData {
/** /**
* *
*/ */

5
src/app/babylon/model/data/mark/mark-plan-data.ts

@ -234,6 +234,11 @@ export class MarkNodeData {
*/ */
showZP: boolean; showZP: boolean;
/**
*
*/
closeXYKG: boolean = true;
/** /**
* *
*/ */

5
src/app/babylon/model/data/model-data/model-data-facility.ts

@ -248,6 +248,11 @@ export enum FacilityType {
*/ */
JY_FM = "JY_FM", JY_FM = "JY_FM",
/**
*
*/
JY_XYKG = "JY_XYKG",
/** /**
* 线 * 线
*/ */

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

@ -5,9 +5,11 @@ import { SceneManager } from "src/app/babylon/controller/scene-manager";
import { UIManager } from "src/app/babylon/controller/ui-manager"; import { UIManager } from "src/app/babylon/controller/ui-manager";
import { BabylonUIStyleTool } from "src/app/babylon/tool/babylon-ui-style-tool"; import { BabylonUIStyleTool } from "src/app/babylon/tool/babylon-ui-style-tool";
import { TsTool } from "src/app/babylon/tool/ts-tool"; import { TsTool } from "src/app/babylon/tool/ts-tool";
import { BuildingWindow } from "src/app/babylon/view/building-window/building-window";
import { FacilityWindow } from "src/app/babylon/view/facility-window/facility-window"; import { FacilityWindow } from "src/app/babylon/view/facility-window/facility-window";
import { FacilityInfoInSceneWindow } from "src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window"; import { FacilityInfoInSceneWindow } from "src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window";
import { PropertyBaseWindow } from "src/app/babylon/view/property-window/property-base-window"; import { PropertyBaseWindow } from "src/app/babylon/view/property-window/property-base-window";
import { PropertyData_XYKG } from "../../data/institution/facility/property-data/in/property-data-xykg";
import { ModelData } from "../../data/model-data/model-data"; import { ModelData } from "../../data/model-data/model-data";
import { FacilityPosType, FacilityShowType, FacilityType, ModelData_facility } from "../../data/model-data/model-data-facility"; import { FacilityPosType, FacilityShowType, FacilityType, ModelData_facility } from "../../data/model-data/model-data-facility";
import { BuildingInfo } from "../building/building-info"; import { BuildingInfo } from "../building/building-info";
@ -30,6 +32,9 @@ export class ModelInfo_facility extends ModelInfo {
nameUIRoot: Rectangle; nameUIRoot: Rectangle;
nameText: TextBlock; nameText: TextBlock;
//卸油口盖
bg_xykg: Rectangle;
btn_xykg: Button;
constructor( constructor(
key: string, key: string,
@ -47,15 +52,45 @@ export class ModelInfo_facility extends ModelInfo {
onCreateFollowUI() { onCreateFollowUI() {
let facilityData = this.modelData as ModelData_facility; let facilityData = this.modelData as ModelData_facility;
let instance = this;
super.onCreateFollowUI(); super.onCreateFollowUI();
BabylonUIStyleTool.setStyle_size(this.uiFollowRoot, ConfigManager.c_size_facilityIconSize + "px", ConfigManager.c_size_facilityIconSize + "px"); BabylonUIStyleTool.setStyle_size(this.uiFollowRoot, ConfigManager.c_size_facilityIconSize + "px", ConfigManager.c_size_facilityIconSize + "px");
if (facilityData.facilityType == FacilityType.JY_XYKG) {
let l_propertyData = facilityData.propertyData as PropertyData_XYKG;
this.bg_xykg = new Rectangle("bg_xykg");
this.bg_xykg.thickness = 0;
this.bg_xykg.background = BabylonUIStyleTool.c_color_blueBtnBg;
this.bg_xykg.color = BabylonUIStyleTool.c_color_blue;//"#0CB7F7";
this.bg_xykg.alpha = 0.9;
UIManager.Instance.uiRoot.addControl(this.bg_xykg);
this.bg_xykg.width = '100px';
this.bg_xykg.height = '26px';
this.bg_xykg.thickness = 2;
this.bg_xykg.linkWithMesh(this.head);
this.btn_xykg = Button.CreateSimpleButton("btn_xykg", "卸油口盖")
this.bg_xykg.addControl(this.btn_xykg);
this.btn_xykg.color = "white";
this.btn_xykg.top = "2px";
this.btn_xykg.fontSize = 16;
this.btn_xykg.thickness = 0
this.btn_xykg.onPointerClickObservable.add(() => {
instance.changeXYKG(undefined)
})
this.bg_xykg.linkWithMesh(this.modelBox)
this.bg_xykg.linkOffsetY = "-30px"
// this.modelBox.setEnabled(l_propertyData.isClose)
// instance.changeXYKG(l_propertyData.isClose)
}
if (!ConfigManager.getFacilityNeedIcon(facilityData.facilityType)) { if (!ConfigManager.getFacilityNeedIcon(facilityData.facilityType)) {
return; return;
} }
let instance = this;
let posType = ConfigManager.getPosType(facilityData.facilityType); let posType = ConfigManager.getPosType(facilityData.facilityType);
let iconPath = ConfigManager.getFacilityIconUrl(facilityData.facilityType, posType); let iconPath = ConfigManager.getFacilityIconUrl(facilityData.facilityType, posType);
@ -220,6 +255,9 @@ export class ModelInfo_facility extends ModelInfo {
*/ */
playShowAnim(play: boolean) { playShowAnim(play: boolean) {
this.showFollowUI(play); this.showFollowUI(play);
if (this.bg_xykg != null) {
this.bg_xykg.isVisible = play;
}
if (this.modelBox != null) { if (this.modelBox != null) {
let facilityType = (this.modelData as ModelData_facility).facilityType; let facilityType = (this.modelData as ModelData_facility).facilityType;
//消防 或 阀门 持续高亮 //消防 或 阀门 持续高亮
@ -245,6 +283,25 @@ export class ModelInfo_facility extends ModelInfo {
} }
} }
/**
*
*/
changeXYKG(isClose: boolean | undefined) {
// let facilityData = this.modelData as ModelData_facility;
// let properData = facilityData.propertyData as PropertyData_XYKG
// if (isClose == undefined) {
// isClose = !properData.isClose;
// }
// properData.isClose = isClose;
// this.modelBox.setEnabled(isClose);
if (isClose == undefined) {
isClose = !BuildingWindow.instance.currentCloseXYKG;
}
// console.log("改变卸油口" + isClose)
BuildingWindow.instance.closeXYKG(isClose)
}
dispose(disposeMesh?: boolean) { dispose(disposeMesh?: boolean) {
if (this.areaInfo != null) { if (this.areaInfo != null) {
@ -258,6 +315,10 @@ export class ModelInfo_facility extends ModelInfo {
this.nameText = null; this.nameText = null;
} }
if (this.bg_xykg != null) {
this.bg_xykg.dispose();
this.bg_xykg = null;
}
super.dispose(disposeMesh); super.dispose(disposeMesh);
} }
} }

50
src/app/babylon/view/building-window/building-window.ts

@ -275,7 +275,7 @@ export class BuildingWindow extends UIBase {
// BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta); // BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta);
// this.showZP(showData.showZP); // this.showZP(showData.showZP);
// PlanComponent.instance.isOpenAwning = showData.showZP; // PlanComponent.instance.isOpenAwning = showData.showZP;
this.revoverCamera(cameraData, showData.showZP); this.revoverCamera(cameraData, showData.showZP, showData.closeXYKG);
} }
} }
@ -285,8 +285,9 @@ export class BuildingWindow extends UIBase {
* @param cameraData * @param cameraData
* @param showZP * @param showZP
*/ */
revoverCamera(cameraData: ArcRotateCameraData, showZP: boolean, onAnimationEnd?: () => void) { revoverCamera(cameraData: ArcRotateCameraData, showZP: boolean, closeXYKG: boolean, onAnimationEnd?: () => void) {
this.showZP(showZP); this.showZP(showZP);
this.closeXYKG(closeXYKG);
PlanComponent.instance.isOpenAwning = showZP; PlanComponent.instance.isOpenAwning = showZP;
let camera = SceneManager.Instance.defaultCamera; let camera = SceneManager.Instance.defaultCamera;
if (cameraData != null) { if (cameraData != null) {
@ -824,7 +825,10 @@ export class BuildingWindow extends UIBase {
*/ */
currentZPShow: boolean = true; currentZPShow: boolean = true;
/**
*
*/
currentCloseXYKG: boolean = true;
/** /**
* *
@ -848,9 +852,11 @@ export class BuildingWindow extends UIBase {
else { else {
// console.log("退出应急处置"); // console.log("退出应急处置");
MarkWindow.closeWindow(); MarkWindow.closeWindow();
}
}
}
else {
this.closeXYKG(true)
} }
this.initFacilityTypeByMoudleType(type, this.currentBuidngItem.buildingInfo); this.initFacilityTypeByMoudleType(type, this.currentBuidngItem.buildingInfo);
@ -1007,7 +1013,9 @@ export class BuildingWindow extends UIBase {
else if (TsTool.stringContain(l_facilityByType.type, "_" + moudleTypeKey) || TsTool.stringContain(l_facilityByType.type, moudleTypeKey + "_")) { else if (TsTool.stringContain(l_facilityByType.type, "_" + moudleTypeKey) || TsTool.stringContain(l_facilityByType.type, moudleTypeKey + "_")) {
this.facilitysByMoudle.get(moudleType).push(l_facilityByType); this.facilitysByMoudle.get(moudleType).push(l_facilityByType);
} }
if (moudleType == JYZInfoMoudleType.YJCZ && l_facilityByType.type == FacilityType.JY_XYKG) {
this.facilitysByMoudle.get(moudleType).push(l_facilityByType);
}
} }
} }
@ -1029,6 +1037,33 @@ export class BuildingWindow extends UIBase {
this.currentZPShow = show; this.currentZPShow = show;
} }
/**
*
*/
closeXYKG(close: boolean) {
this.initFacilityTypeByMoudleType(JYZInfoMoudleType.YJCZ, this.currentBuidngItem.buildingInfo);
if (this.facilitysByMoudle != null) {
if (this.facilitysByMoudle.has(JYZInfoMoudleType.YJCZ)) {
let YJCZList: FacilityInfoByType[] = this.facilitysByMoudle.get(JYZInfoMoudleType.YJCZ)
if (YJCZList != null) {
for (let i = 0; i < YJCZList.length; i++) {
let type = YJCZList[i].type;
let infos = YJCZList[i].facilityInfo;
if (type == FacilityType.JY_XYKG) {
for (let j = 0; j < infos.length; j++) {
if (close != undefined) {
infos[j].modelBox.setEnabled(close);
}
}
}
}
}
}
}
this.currentCloseXYKG = close;
}
/** /**
* UV材质() * UV材质()
* @param facilityType * @param facilityType
@ -1144,12 +1179,13 @@ export class BuildingWindow extends UIBase {
} }
} }
if (jyzShowData == null) { if (jyzShowData == null) {
jyzShowData = new JYZShowData(moudleType, camera, showZP); jyzShowData = new JYZShowData(moudleType, camera, showZP, this.currentCloseXYKG);
DataManager.institutionData.JYZShowDatas.push(jyzShowData); DataManager.institutionData.JYZShowDatas.push(jyzShowData);
} }
jyzShowData.moudleType = moudleType; jyzShowData.moudleType = moudleType;
jyzShowData.cameraData.getDataFromCamera(camera); jyzShowData.cameraData.getDataFromCamera(camera);
jyzShowData.showZP = showZP; jyzShowData.showZP = showZP;
jyzShowData.closeXYKG = this.currentCloseXYKG
console.log("保存展示数据", DataManager.institutionData.JYZShowDatas); console.log("保存展示数据", DataManager.institutionData.JYZShowDatas);
} }

4
src/app/babylon/view/facility-window/facility-window.ts

@ -666,9 +666,11 @@ export class FacilityWindow extends UIBase {
this.createNewFacilityByMesh(mesh, FacilityType.JY_YQHSGX); this.createNewFacilityByMesh(mesh, FacilityType.JY_YQHSGX);
} }
else if (TsTool.stringContain(mesh.name, FacilityType.JY_FM)) { else if (TsTool.stringContain(mesh.name, FacilityType.JY_FM)) {
console.log("找到阀门", mesh)
this.createNewFacilityByMesh(mesh, FacilityType.JY_FM); this.createNewFacilityByMesh(mesh, FacilityType.JY_FM);
} }
else if (TsTool.stringContain(mesh.name, FacilityType.JY_XYKG)) {
this.createNewFacilityByMesh(mesh, FacilityType.JY_XYKG);
}
} }
/** /**

4
src/app/babylon/view/mark-window/mark-window.ts

@ -1108,6 +1108,7 @@ export class MarkWindow extends UIBase {
markNodeData.cameraData.getDataFromCamera(SceneManager.Instance.defaultCamera); markNodeData.cameraData.getDataFromCamera(SceneManager.Instance.defaultCamera);
markNodeData.showZP = BuildingWindow.instance.currentZPShow; markNodeData.showZP = BuildingWindow.instance.currentZPShow;
markNodeData.closeXYKG = BuildingWindow.instance.currentCloseXYKG;
// console.log("记录节点", markNodeData); // console.log("记录节点", markNodeData);
} }
@ -1233,6 +1234,7 @@ export class MarkWindow extends UIBase {
let environmentData = this.currentMarkNodeInfo.nodeData.getCurrentEnvironmentData(); let environmentData = this.currentMarkNodeInfo.nodeData.getCurrentEnvironmentData();
let cameraData = this.currentMarkNodeInfo.nodeData.cameraData; let cameraData = this.currentMarkNodeInfo.nodeData.cameraData;
let showZP = this.currentMarkNodeInfo.nodeData.showZP; let showZP = this.currentMarkNodeInfo.nodeData.showZP;
let closeXYKG = this.currentMarkNodeInfo.nodeData.closeXYKG;
let instance = this; let instance = this;
if (environmentData.isOutdoor) //要在室外 if (environmentData.isOutdoor) //要在室外
{ {
@ -1261,7 +1263,7 @@ export class MarkWindow extends UIBase {
//仅此分支生效 //仅此分支生效
//动画还原相机,结束后开始阅读 //动画还原相机,结束后开始阅读
BuildingWindow.instance.revoverCamera(cameraData, showZP, (() => { BuildingWindow.instance.revoverCamera(cameraData, showZP, closeXYKG, (() => {
if (readDescribe) { if (readDescribe) {
instance.readDescribe(instance.currentMarkNodeInfo.nodeData.describe); instance.readDescribe(instance.currentMarkNodeInfo.nodeData.describe);
} }

BIN
src/assets/images/mark/inside/syg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

2
src/assets/mesh/mark/inside/ygc/YGC.gltf.manifest

@ -1,5 +1,5 @@
{ {
"version" : 1, "version" : 2,
"enableSceneOffline" : true, "enableSceneOffline" : true,
"enableTexturesOffline" : true "enableTexturesOffline" : true
} }
Loading…
Cancel
Save