diff --git a/src/api/jlmap3d/assets3d.js b/src/api/jlmap3d/assets3d.js index 8c62cb23e..d794ca436 100644 --- a/src/api/jlmap3d/assets3d.js +++ b/src/api/jlmap3d/assets3d.js @@ -4,14 +4,19 @@ import { getBaseUrl } from '@/utils/baseUrl'; const BASE_API = getBaseUrl(); let uploadurl = null; +let asseturl = null; if(BASE_API == "https://test.joylink.club/jlcloud"){ uploadurl = "https://test.joylink.club/jlfile"; + asseturl = "https://test.joylink.club/oss/joylink" }else if(BASE_API == "https://joylink.club/jlcloud"){ uploadurl = "https://joylink.club/jlfile"; + asseturl = "https://joylink.club/oss/joylink" }else{ uploadurl = "http://192.168.3.41:9300"; + asseturl = "https://test.joylink.club/oss/joylink" } const BASE_UPLOAD_API = uploadurl; +const BASE_ASSET_API = asseturl; export function getUploadModelUrl() { return (BASE_UPLOAD_API+"/api/upload/MODEL?appId=00001&appSecret=joylink00001"); diff --git a/src/jlmap3d/jl3ddevice/config.js b/src/jlmap3d/jl3ddevice/config.js index b245ccb58..ff882cf0f 100644 --- a/src/jlmap3d/jl3ddevice/config.js +++ b/src/jlmap3d/jl3ddevice/config.js @@ -37,6 +37,17 @@ var Staticmodel = { //https://joylink.club/oss/wx/stationstand/stationstand.FBX //../../static/model/device/stationstand.FBX + }, + room: { + id: "5", + name: "通号设备间", + deviceType: "room", + type: "low", + picUrl: "", + assetUrl: "../../static/model/device/room/room.FBX" + //https://joylink.club/oss/wx/stationstand/stationstand.FBX + //../../static/model/device/stationstand.FBX + } } diff --git a/src/jlmap3d/jl3ddevice/loader.js b/src/jlmap3d/jl3ddevice/loader.js index e50eb95c6..16cbcb997 100644 --- a/src/jlmap3d/jl3ddevice/loader.js +++ b/src/jlmap3d/jl3ddevice/loader.js @@ -33,12 +33,20 @@ export function ModelManager(){ action:null }; + this.roommodel = { + code:"room", + sectionstatus:"01", + mesh:null, + action:null + }; + this.loadpromise = function (data,mixers){ let initlist = []; initlist.push(fbxpromise(data.Switch,mixers,scope.switchmodel)); initlist.push(fbxpromise(data.Signal,mixers,scope.signalmodel)); initlist.push(fbxpromise(data.stationstand,mixers,scope.standmodel)); initlist.push(fbxpromise(data.section,mixers,scope.sectionmodel)); + initlist.push(fbxpromise(data.room,mixers,scope.roommodel)); return new Promise(function(resolve, reject){ diff --git a/src/jlmap3d/jl3dmaintainer/Jl3dfaultdevice.js b/src/jlmap3d/jl3dmaintainer/Jl3dfaultdevice.js index 2ac99e1b2..217672c9b 100644 --- a/src/jlmap3d/jl3dmaintainer/Jl3dfaultdevice.js +++ b/src/jlmap3d/jl3dmaintainer/Jl3dfaultdevice.js @@ -219,7 +219,7 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) { } - if (data.type == "PSD") { + if (data.type == "STAND") { // console.log(data); scope.modelmanager.standmodel.code = data.code; scope.showmodel = scope.modelmanager.standmodel.mesh; @@ -233,15 +233,24 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) { // scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true; } - if (data.type == "AXLE_COUNTER") { + if (data.type == "SECTION") { // console.log(data); scope.modelmanager.sectionmodel.code = data.code; scope.showmodel = scope.modelmanager.sectionmodel.mesh; scope.scene.add(scope.showmodel); - // scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map =scope.stationtexture[psdtexturemap[data.standCode]]; - // scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true; + } + if (data.type == "room") { + scope.showmodel = scope.modelmanager.roommodel.mesh; + scope.scene.add(scope.showmodel); + scope.camera.position.set(0, 10, 9); + scope.controls.target = new THREE.Vector3(0, 9, 8); + scope.controls.update(); + }else{ + scope.camera.position.set(0, 20, 30); + scope.controls.target = new THREE.Vector3(0, 0, 0); + scope.controls.update(); } if(scope.showmodel){ scope.resetmodel(); @@ -284,7 +293,7 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) { scope.scene.add(scope.showmodel); } - if (data.type == "PSD") {; + if (data.type == "STAND") {; scope.showmodel = scope.modelmanager.standmodel.mesh; scope.scene.add(scope.showmodel); scope.modelmanager.standmodel.action.reset(); @@ -295,7 +304,7 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) { // scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true; } - if (data.type == "AXLE_COUNTER") { + if (data.type == "SECTION") { scope.showmodel = scope.modelmanager.sectionmodel.mesh; scope.scene.add(scope.showmodel); @@ -303,6 +312,18 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) { // scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true; } + if (data.type == "room") { + + scope.showmodel = scope.modelmanager.roommodel.mesh; + scope.scene.add(scope.showmodel); + scope.camera.position.set(0, 10, 9); + scope.controls.target = new THREE.Vector3(0, 9, 8);; + scope.controls.update(); + }else{ + scope.camera.position.set(0, 20, 30); + scope.controls.target = new THREE.Vector3(0, 0, 0); + scope.controls.update(); + } // initstatus(data); } diff --git a/src/jlmap3d/jl3dmaintainer/maintainerconnect.js b/src/jlmap3d/jl3dmaintainer/maintainerconnect.js index 41d22b844..fb526cc6d 100644 --- a/src/jlmap3d/jl3dmaintainer/maintainerconnect.js +++ b/src/jlmap3d/jl3dmaintainer/maintainerconnect.js @@ -71,35 +71,35 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) { } if(event.data.body.type == "SIGNAL"){ newfault.name = lablecodemap.signal[newfault.code]; - if(event.data.body.fault == "MAIN_FILAMENT_BROKEN"){ + newfault.typetext = "信号机"; + if(event.data.body.fault[1] == "MAIN_FILAMENT_BROKEN"){ newfault.text = "主灯丝断丝故障"; - newfault.typetext = "信号机"; } } if(event.data.body.type == "SWITCH"){ newfault.name = lablecodemap.switch[newfault.code]; - if(event.data.body.fault == "SPLIT"){ + newfault.typetext = "道岔"; + if(event.data.body.fault[1] == "SPLIT"){ newfault.text = "道岔挤岔"; - newfault.typetext = "道岔"; } } - if(event.data.body.type == "AXLE_COUNTER"){ + if(event.data.body.type == "SECTION"){ newfault.name = lablecodemap.section[newfault.code]; - if(event.data.body.fault == "FAULT"){ + newfault.typetext = "区段"; + if(event.data.body.fault[1] == "FAULT"){ newfault.text = "计轴故障"; - newfault.typetext = "区段"; } } - if(event.data.body.type == "PSD"){ - newfault.name = lablecodemap.psd[newfault.code]; - if(event.data.body.fault == "FAULT"){ + if(event.data.body.type == "STAND"){ + newfault.name = newfault.code; + newfault.typetext = "屏蔽门"; + if(event.data.body.fault[1] == "FAULT_PSD_OPEN"){ newfault.text = "屏蔽门无法关闭故障"; - newfault.typetext = "屏蔽门"; } } @@ -135,35 +135,35 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) { } if(fault[i].type == "SIGNAL"){ newfault.name = lablecodemap.signal[newfault.code]; - if(fault[i].fault == "MAIN_FILAMENT_BROKEN"){ + newfault.typetext = "信号机"; + if(fault[i].fault[1] == "MAIN_FILAMENT_BROKEN"){ newfault.text = "主灯丝断丝故障"; - newfault.typetext = "信号机"; } } if(fault[i].type == "SWITCH"){ newfault.name = lablecodemap.switch[newfault.code]; - if(fault[i].fault == "SPLIT"){ + newfault.typetext = "道岔"; + if(fault[i].fault[1] == "SPLIT"){ newfault.text = "道岔挤岔"; - newfault.typetext = "道岔"; } } - if(fault[i].type == "AXLE_COUNTER"){ + if(fault[i].type == "SECTION"){ newfault.name = lablecodemap.section[newfault.code]; - if(fault[i].fault == "FAULT"){ + newfault.typetext = "区段"; + if(fault[i].fault[1] == "FAULT"){ newfault.text = "计轴故障"; - newfault.typetext = "区段"; } } - if(fault[i].type == "PSD"){ - newfault.name = lablecodemap.psd[newfault.code]; - if(fault[i].fault == "FAULT"){ + if(fault[i].type == "STAND"){ + newfault.name = newfault.code; + newfault.typetext = "屏蔽门"; + if(fault[i].fault[1] == "FAULT_PSD_OPEN"){ newfault.text = "屏蔽门无法关闭故障"; - newfault.typetext = "屏蔽门"; } } @@ -171,38 +171,38 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) { } return; } - - if(event.data.type == 'TrainRun_3D'){ - - for(let i=0,leni=event.data.body.length;i { item.show(); }); + this.lamps[0].faultHide(); this.sigName.setStyle({ textBorderWidth: 0 }); this.sigName.setColor(this.style.Signal.text.defaultColor); this.setAutoClose(); @@ -588,6 +595,7 @@ class Signal extends Group { model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭 model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放 model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放 + model.fault && this.fault();// 信号机故障 // 联锁自动进路通过 model.fleetMode && this.setAutoRouteOpen(); diff --git a/src/views/jlmap3d/edit/component/action.vue b/src/views/jlmap3d/edit/component/action.vue index 40cd45ca4..fac0faa6e 100644 --- a/src/views/jlmap3d/edit/component/action.vue +++ b/src/views/jlmap3d/edit/component/action.vue @@ -101,6 +101,7 @@ diff --git a/src/views/jlmap3d/edit/component/assets.vue b/src/views/jlmap3d/edit/component/assets.vue index 3ebc32829..f2c657ef6 100644 --- a/src/views/jlmap3d/edit/component/assets.vue +++ b/src/views/jlmap3d/edit/component/assets.vue @@ -200,14 +200,16 @@ export default { .modellist { float:left; position: relative; - width:100px; - height:100px; + width:120px; + height:120px; + text-align:center; } .modelpic{ left:0; position: absolute; - width:100%; - height:100%; + width:60%; + height:60%; + text-align:center; background-image: url('/static/texture/modelfile.png'); background-size: 100% 100%; } diff --git a/src/views/jlmap3d/jl3dassetmanager/component/piclist.vue b/src/views/jlmap3d/jl3dassetmanager/component/piclist.vue index 0f40d4d0e..6c1e381b9 100644 --- a/src/views/jlmap3d/jl3dassetmanager/component/piclist.vue +++ b/src/views/jlmap3d/jl3dassetmanager/component/piclist.vue @@ -13,7 +13,7 @@ - + diff --git a/src/views/jlmap3d/jl3dassetmanager/component/uploadmodel.vue b/src/views/jlmap3d/jl3dassetmanager/component/uploadmodel.vue index beac30f30..7d6677b7c 100644 --- a/src/views/jlmap3d/jl3dassetmanager/component/uploadmodel.vue +++ b/src/views/jlmap3d/jl3dassetmanager/component/uploadmodel.vue @@ -34,7 +34,7 @@ - + diff --git a/src/views/jlmap3d/maintainer/component/faultdevice.vue b/src/views/jlmap3d/maintainer/component/faultdevice.vue index b621c8d77..95c62e094 100644 --- a/src/views/jlmap3d/maintainer/component/faultdevice.vue +++ b/src/views/jlmap3d/maintainer/component/faultdevice.vue @@ -10,6 +10,7 @@ -->
+
@@ -181,7 +182,7 @@ if(this.nowdevice){ let command = { code:this.nowdevice.code, - faultType:this.nowdevice.fault, + faultType:this.nowdevice.fault[1], }; sendCommandNew(this.group,"Cancel_Fault", command).then((response) => { // resolve(response); @@ -211,10 +212,21 @@ // // }, showmodel(devicedata){ + console.log(devicedata); this.jl3d.updatewindowstatus('1'); this.jl3d.selectmodel(devicedata); this.nowdevice = devicedata; }, + showroom(){ + let roomdata = { + code:"room", + name:"room", + type:"room", + }; + this.jl3d.updatewindowstatus('1'); + this.jl3d.selectmodel(roomdata); + this.nowdevice = roomdata; + }, back(){ this.jl3d.resetmodel(); }, @@ -303,6 +315,8 @@ background-size:100%; } + + #canvastexture { position: absolute; float: left; @@ -312,7 +326,7 @@ .jl3dcontrolpane{ position: absolute; top:0; - right:85px; + right:165px; z-index: 10; } diff --git a/src/views/jlmap3d/maintainer/jl3dmaintainer.vue b/src/views/jlmap3d/maintainer/jl3dmaintainer.vue index b26c0c4db..5e608ccf8 100644 --- a/src/views/jlmap3d/maintainer/jl3dmaintainer.vue +++ b/src/views/jlmap3d/maintainer/jl3dmaintainer.vue @@ -32,7 +32,7 @@ - +
@@ -212,6 +212,10 @@ export default { this.msgshow = false; }, + showroom(){ + this.deviceShow = true; + this.$refs.faultdevice.showroom(); + }, back() { this.$emit('back'); this.isswitch = false; @@ -301,6 +305,17 @@ export default { font-size: 40px; } + .roombutton{ + width:50px; + height:50px; + position: absolute; + right:70px; + top:5px; + z-index:30; + background-image:url("/static/texture/room.png"); + background-repeat:no-repeat; + background-size:100%; + } #canvastexture { position: absolute; float: left; diff --git a/static/model/device/room/room.FBX b/static/model/device/room/room.FBX new file mode 100644 index 000000000..1f8988c9f Binary files /dev/null and b/static/model/device/room/room.FBX differ diff --git a/static/texture/room.png b/static/texture/room.png new file mode 100644 index 000000000..a47e517ce Binary files /dev/null and b/static/texture/room.png differ diff --git a/static/workertest/maintainerworker.js b/static/workertest/maintainerworker.js index a77a25e77..24bbaeb2e 100644 --- a/static/workertest/maintainerworker.js +++ b/static/workertest/maintainerworker.js @@ -684,7 +684,7 @@ function timedCount(){ function callback(Response) { data = JSON.parse(Response.body); - // console.log(data); + console.log(data); // if(data.type == 'TrainRun_3D'){ // for (let i=0,leni = data.body.length; i