diff --git a/src/app/babylon/controller/config-manager.ts b/src/app/babylon/controller/config-manager.ts index b8fbb67..ce1d165 100644 --- a/src/app/babylon/controller/config-manager.ts +++ b/src/app/babylon/controller/config-manager.ts @@ -100,6 +100,7 @@ export class ConfigManager { case FacilityType.JY_SYGX: result = "输油管线"; break; case FacilityType.JY_YQHSGX: result = "油气回收管线"; break; case FacilityType.JY_FM: result = "阀门"; break; + case FacilityType.JY_XYKG: result = "卸油口盖"; break; } return result; } diff --git a/src/app/babylon/controller/data-manager.ts b/src/app/babylon/controller/data-manager.ts index a192a75..0d7a7aa 100644 --- a/src/app/babylon/controller/data-manager.ts +++ b/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_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_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_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'; @@ -487,7 +488,7 @@ export class DataManager { case FacilityType.JY_SYGX: result = new PropertyData_SYGX(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_XYKG: result = new PropertyData_XYKG(key); break; } if (result == null) { diff --git a/src/app/babylon/model/data/institution/facility/property-data/in/property-data-xykg.ts b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-xykg.ts new file mode 100644 index 0000000..81d5113 --- /dev/null +++ b/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; + } + +} \ No newline at end of file diff --git a/src/app/babylon/model/data/institution/jyz-show-data.ts b/src/app/babylon/model/data/institution/jyz-show-data.ts index b587ebb..e2a966d 100644 --- a/src/app/babylon/model/data/institution/jyz-show-data.ts +++ b/src/app/babylon/model/data/institution/jyz-show-data.ts @@ -23,12 +23,16 @@ export class JYZShowData { */ 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.cameraData = new ArcRotateCameraData(); if (camera != null) { this.cameraData.getDataFromCamera(camera); } + this.showZP = showZP; + this.closeXYKG = closeXYKG; } diff --git a/src/app/babylon/model/data/mark/mark-data.ts b/src/app/babylon/model/data/mark/mark-data.ts index 597a50d..0f68788 100644 --- a/src/app/babylon/model/data/mark/mark-data.ts +++ b/src/app/babylon/model/data/mark/mark-data.ts @@ -10,10 +10,6 @@ import { MarkProperty } from "./mark-property"; * 标绘数据 */ export class MarkData extends ModelData { - - - - /** * 名称类型,标志其具体是什么 */ diff --git a/src/app/babylon/model/data/mark/mark-plan-data.ts b/src/app/babylon/model/data/mark/mark-plan-data.ts index b10e625..a5a37ac 100644 --- a/src/app/babylon/model/data/mark/mark-plan-data.ts +++ b/src/app/babylon/model/data/mark/mark-plan-data.ts @@ -234,6 +234,11 @@ export class MarkNodeData { */ showZP: boolean; + /** + * 关闭卸油口盖 + */ + closeXYKG: boolean = true; + /** * 所处环境的信息 */ diff --git a/src/app/babylon/model/data/model-data/model-data-facility.ts b/src/app/babylon/model/data/model-data/model-data-facility.ts index 99c7922..109920a 100644 --- a/src/app/babylon/model/data/model-data/model-data-facility.ts +++ b/src/app/babylon/model/data/model-data/model-data-facility.ts @@ -248,6 +248,11 @@ export enum FacilityType { */ JY_FM = "JY_FM", + /** + * 卸油口盖 + */ + JY_XYKG = "JY_XYKG", + /** * 油气回收管线 阻挡物 */ diff --git a/src/app/babylon/model/info/model/model-info-facility.ts b/src/app/babylon/model/info/model/model-info-facility.ts index 6084ee3..ee864c8 100644 --- a/src/app/babylon/model/info/model/model-info-facility.ts +++ b/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 { BabylonUIStyleTool } from "src/app/babylon/tool/babylon-ui-style-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 { FacilityInfoInSceneWindow } from "src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-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 { FacilityPosType, FacilityShowType, FacilityType, ModelData_facility } from "../../data/model-data/model-data-facility"; import { BuildingInfo } from "../building/building-info"; @@ -30,6 +32,9 @@ export class ModelInfo_facility extends ModelInfo { nameUIRoot: Rectangle; nameText: TextBlock; + //卸油口盖 + bg_xykg: Rectangle; + btn_xykg: Button; constructor( key: string, @@ -47,15 +52,45 @@ export class ModelInfo_facility extends ModelInfo { onCreateFollowUI() { let facilityData = this.modelData as ModelData_facility; + let instance = this; super.onCreateFollowUI(); 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)) { return; } - - let instance = this; - let posType = ConfigManager.getPosType(facilityData.facilityType); let iconPath = ConfigManager.getFacilityIconUrl(facilityData.facilityType, posType); @@ -220,6 +255,9 @@ export class ModelInfo_facility extends ModelInfo { */ playShowAnim(play: boolean) { this.showFollowUI(play); + if (this.bg_xykg != null) { + this.bg_xykg.isVisible = play; + } if (this.modelBox != null) { 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) { if (this.areaInfo != null) { @@ -258,6 +315,10 @@ export class ModelInfo_facility extends ModelInfo { this.nameText = null; } + if (this.bg_xykg != null) { + this.bg_xykg.dispose(); + this.bg_xykg = null; + } super.dispose(disposeMesh); } } diff --git a/src/app/babylon/view/building-window/building-window.ts b/src/app/babylon/view/building-window/building-window.ts index ba28401..b7e0787 100644 --- a/src/app/babylon/view/building-window/building-window.ts +++ b/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); // this.showZP(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 showZP */ - revoverCamera(cameraData: ArcRotateCameraData, showZP: boolean, onAnimationEnd?: () => void) { + revoverCamera(cameraData: ArcRotateCameraData, showZP: boolean, closeXYKG: boolean, onAnimationEnd?: () => void) { this.showZP(showZP); + this.closeXYKG(closeXYKG); PlanComponent.instance.isOpenAwning = showZP; let camera = SceneManager.Instance.defaultCamera; if (cameraData != null) { @@ -824,7 +825,10 @@ export class BuildingWindow extends UIBase { */ currentZPShow: boolean = true; - + /** + * 关闭卸油口盖 + */ + currentCloseXYKG: boolean = true; /** * 展示加油站信息模块 @@ -848,9 +852,11 @@ export class BuildingWindow extends UIBase { else { // console.log("退出应急处置"); MarkWindow.closeWindow(); - } - + } + } + else { + this.closeXYKG(true) } 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 + "_")) { 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; } + /** + * 关闭卸油口盖 + */ + 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材质(如果有的话) * @param facilityType @@ -1144,12 +1179,13 @@ export class BuildingWindow extends UIBase { } } if (jyzShowData == null) { - jyzShowData = new JYZShowData(moudleType, camera, showZP); + jyzShowData = new JYZShowData(moudleType, camera, showZP, this.currentCloseXYKG); DataManager.institutionData.JYZShowDatas.push(jyzShowData); } jyzShowData.moudleType = moudleType; jyzShowData.cameraData.getDataFromCamera(camera); jyzShowData.showZP = showZP; + jyzShowData.closeXYKG = this.currentCloseXYKG console.log("保存展示数据", DataManager.institutionData.JYZShowDatas); } diff --git a/src/app/babylon/view/facility-window/facility-window.ts b/src/app/babylon/view/facility-window/facility-window.ts index 6d9dd89..d34ee13 100644 --- a/src/app/babylon/view/facility-window/facility-window.ts +++ b/src/app/babylon/view/facility-window/facility-window.ts @@ -666,9 +666,11 @@ export class FacilityWindow extends UIBase { this.createNewFacilityByMesh(mesh, FacilityType.JY_YQHSGX); } else if (TsTool.stringContain(mesh.name, FacilityType.JY_FM)) { - console.log("找到阀门", mesh) this.createNewFacilityByMesh(mesh, FacilityType.JY_FM); } + else if (TsTool.stringContain(mesh.name, FacilityType.JY_XYKG)) { + this.createNewFacilityByMesh(mesh, FacilityType.JY_XYKG); + } } /** diff --git a/src/app/babylon/view/mark-window/mark-window.ts b/src/app/babylon/view/mark-window/mark-window.ts index 50a5444..5d111d4 100644 --- a/src/app/babylon/view/mark-window/mark-window.ts +++ b/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.showZP = BuildingWindow.instance.currentZPShow; + markNodeData.closeXYKG = BuildingWindow.instance.currentCloseXYKG; // console.log("记录节点", markNodeData); } @@ -1233,6 +1234,7 @@ export class MarkWindow extends UIBase { let environmentData = this.currentMarkNodeInfo.nodeData.getCurrentEnvironmentData(); let cameraData = this.currentMarkNodeInfo.nodeData.cameraData; let showZP = this.currentMarkNodeInfo.nodeData.showZP; + let closeXYKG = this.currentMarkNodeInfo.nodeData.closeXYKG; let instance = this; 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) { instance.readDescribe(instance.currentMarkNodeInfo.nodeData.describe); } diff --git a/src/assets/images/mark/inside/syg.png b/src/assets/images/mark/inside/syg.png index 955d0d1..548c828 100644 Binary files a/src/assets/images/mark/inside/syg.png and b/src/assets/images/mark/inside/syg.png differ diff --git a/src/assets/mesh/mark/inside/ygc/YGC.gltf.manifest b/src/assets/mesh/mark/inside/ygc/YGC.gltf.manifest index 1781cb5..e369002 100644 --- a/src/assets/mesh/mark/inside/ygc/YGC.gltf.manifest +++ b/src/assets/mesh/mark/inside/ygc/YGC.gltf.manifest @@ -1,5 +1,5 @@ { - "version" : 1, + "version" : 2, "enableSceneOffline" : true, "enableTexturesOffline" : true } \ No newline at end of file