修改三维驾驶列车号更新和显示,修改佛山加载三维通号设备间贴图问题

This commit is contained in:
sunzhenyu 2020-12-17 15:23:25 +08:00
parent d08be87108
commit c4d96ec386
9 changed files with 56 additions and 60 deletions

View File

@ -10,7 +10,7 @@ const publicPath = process.env.VUE_APP_PRO == 'local' ? '' : '/cbtc';
const BASE_API = getBaseUrl();
export const JL3D_LOCAL_STATIC = publicPath+"/static";
// console.log(JL3D_LOCAL_STATIC);
console.log(JL3D_LOCAL_STATIC);
let uploadurl = null;
let asseturl = null;

View File

@ -94,7 +94,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
this.nowmxlen = null;
this.atpspeed = null;
this.atospeed = null;
this.trainnum = null;
// this.trainnum = null;
this.stime = null;
this.drivecount = 0;
this.drivedata = null;
@ -257,12 +257,12 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
updatemmi.updateatospeed = function(atospeed) {
scope.atospeed = atospeed;
};
updatemmi.updatetrainnum = function(trainnum) {
scope.trainnum = trainnum;
};
updatemmi.updatestoptime = function(stime) {
scope.stime = stime;
};
// updatemmi.updatetrainnum = function(trainnum) {
// scope.trainnum = trainnum;
// };
// updatemmi.updatestoptime = function(stime) {
// scope.stime = stime;
// };
updatemmi.updatedrivedata = function(drivedata) {
scope.drivecount += 1;
scope.drivedata = drivedata;

View File

@ -74,6 +74,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
if(data.body.groupNumber){
changeNowTrain(data.body);
updateDriveValue(data.body.groupNumber);
}
updatestatus(data.body);
@ -400,9 +401,9 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
// trainmodel.position.z = point.z;
}
if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children[5].rotalist.length > 0){
// if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children[5].rotalist.length > 0){
for(let rs = 1;rs<6;rs++){
for(let rs = 1;rs<updateTrainModel.children.length;rs++){
//console.log(rs);
if(updateTrainModel.children[rs].rotalist[0]){
@ -433,7 +434,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
}
// console.log(trainmodel.rotalist);
}
// }
}else{
//
@ -476,8 +477,8 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
}
if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children[5].rotalist.length > 0){
for(let rs = 1;rs<6;rs++){
// if(updateTrainModel.children[1].rotalist.length > 0 || updateTrainModel.children[2].rotalist.length > 0 || updateTrainModel.children[3].rotalist.length > 0 || updateTrainModel.children[4].rotalist.length > 0|| updateTrainModel.children[5].rotalist.length > 0){
for(let rs = 1;rs<updateTrainModel.children.length;rs++){
//console.log(rs);
if(updateTrainModel.children[rs].rotalist[0]){
let offsetz = parseFloat(updateTrainModel.children[rs].rotalist[0].posr.z) - parseFloat(updateTrainModel.children[rs].matrixWorld.elements[14]);
@ -502,7 +503,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
}
}
}
}
// }
}
}

View File

@ -167,7 +167,7 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
function setpsdstationmap(stationlist){
for(let i=0,leni=stationlist.length;i<leni;i++){
console.log(stationlist[i]);
psdtexturemap[stationlist[i].stands[0].code] = stationlist[i].code;
psdtexturemap[stationlist[i].stands[1].code] = stationlist[i].code;
}
@ -285,7 +285,7 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
} else {
scope.nowcode = data.code;
if (data.type == "room") {
console.log(scope.modelmanager.roommodel.mesh);
scope.showmodel = scope.modelmanager.roommodel.mesh;
scope.scene.add(scope.showmodel);
scope.camera.position.set(5, 7, -9);

View File

@ -114,7 +114,6 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
if(event.data.type == "Device_Fault_Over_3D"){
console.log(event.data);
deletefault(event.data.body.code);
warningmsg("已修复故障设备:"+event.data.body.code);
@ -127,7 +126,7 @@ export function Maintainerconnect(jlmap3d,routegroup,jsonwebwork,lablecodemap) {
let fault = event.data.body.faultInfoList;
for(let i=0,leni= fault.length;i<leni;i++){
console.log(fault[i]);
let newfault = {
code:fault[i].code,
name:'',

View File

@ -15,10 +15,7 @@ import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
// import {SwitchModel} from '@/jlmap3d/model/SwitchModel.js';
export function MaintainerLoad(data,scope,netdata,mapdata,camera,controls,scene){
//console.log(mapdata);
//console.log(data);
//console.log(scope);
let sceneload = scene;
let backdata = scope;
let jlmap3ddata = mapdata;
@ -69,25 +66,20 @@ export function MaintainerLoad(data,scope,netdata,mapdata,camera,controls,scene)
assetloader.assetPromiseOver(sceneload)
.then(function(data){
//console.log(data);
//,netdata.stands,mixers,actions,"0"
return stationstandlist.loadpromise(mapdata.stationList,standsdata,psddata,sceneload,assetloader,mixers,actions,"02");
})
.then(function(data){
//console.log(data);
return sectionlist.loadpromise(mapdata.sectionList,sectiondata.section,rails,scene,assetloader);
})
.then(function(data){
//console.log(data);
return signallist.loadpromise(mapdata.signalList,signaldata,sceneload,assetloader);
})
.then(function(data){
return switchlist.loadpromise(mapdata.switchList,switchdata,sceneload,assetloader,mixers,actions);
})
.then(function(data){
//console.log(data);
//console.log(assetloader);
return trainlisttest.initpromise(mapdata.trainList,sceneload,assetloader,mixers,actions,"02");
})
.then(function(data){
@ -108,22 +100,27 @@ export function MaintainerLoad(data,scope,netdata,mapdata,camera,controls,scene)
return new Promise(function(resolve, reject){
if(scope.stationtexture["stationlist"]){
for(let mm=0;mm< stationstandlist.group.children.length;mm++){
let stationname = stationstandlist.group.children[mm].name;
let stationname = stationstandlist.group.children[mm].name;
if(stationstandlist.group.children[mm].getObjectByName("zhantailiebiao")){
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
// console.log(stationstandlist.group.children[mm].getObjectByName("menkuangyanse"));
if(stationstandlist.group.children[mm].getObjectByName("menkuangyanse")){
stationstandlist.group.children[mm].getObjectByName("menkuangyanse").material.map =scope.stationtexture["pingbimen"];
stationstandlist.group.children[mm].getObjectByName("menkuangyanse").material.map.needsUpdate = true;
}
}
if(stationstandlist.group.children[mm].getObjectByName("menkuangyanse")){
stationstandlist.group.children[mm].getObjectByName("menkuangyanse").material.map =scope.stationtexture["pingbimen"];
stationstandlist.group.children[mm].getObjectByName("menkuangyanse").material.map.needsUpdate = true;
}
if(stationstandlist.group.children[mm].getObjectByName("zhantaiming")){
let newmaterial = stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.clone();
newmaterial.map =scope.stationtexture[stationname];
stationstandlist.group.children[mm].getObjectByName("zhantaiming").material = newmaterial;
stationstandlist.group.children[mm].getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
}

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.8.129:9000'; // 旭强
// BASE_API = 'http://192.168.8.119:9000'; // 张赛
BASE_API = 'http://192.168.8.110:9000'; // 杜康
// BASE_API = 'http://192.168.8.110:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -2,10 +2,10 @@
<div id="drivediv" class="jalmap3ddiv" >
<div class="trainstatus">
<!-- <div class="trainstatus">
{{$t('jlmap3d.trainGroupNumber')}}{{ trainnum }}</br>
{{ stoptimes }}
</div>
</div> -->
<div class="display-draft">
<el-button-group>
@ -88,8 +88,8 @@ export default {
mmishow: false,
showbuttonmsg: this.$t('jlmap3d.trainInstrumentationDisplay'),
backmsg:this.$t('global.back'),
trainnum: '',
stoptimes: '',
// trainnum: '',
// stoptimes: '',
dcontrolshow: false,
msgshow:false,
controlmsg:"不能选择其它列车",
@ -133,20 +133,20 @@ export default {
}
}
},
'jlmap3d.trainnum': {
handler: function (newVal, oldVal) {
if (newVal != oldVal) {
this.trainnum = newVal;
}
}
},
'jlmap3d.stime': {
handler: function (newVal, oldVal) {
if (newVal != oldVal) {
this.stoptimes = newVal;
}
}
},
// 'jlmap3d.trainnum': {
// handler: function (newVal, oldVal) {
// if (newVal != oldVal) {
// this.trainnum = newVal;
// }
// }
// },
// 'jlmap3d.stime': {
// handler: function (newVal, oldVal) {
// if (newVal != oldVal) {
// this.stoptimes = newVal;
// }
// }
// },
'jlmap3d.drivecount': {
handler: function (newVal, oldVal) {
if (newVal != oldVal) {
@ -315,11 +315,11 @@ export default {
},
updatestatus(newdata){
if(newdata.groupNumber){
this.trainnum = newdata.groupNumber;
updateDriveValue(this.trainnum);
}
// if(newdata.groupNumber){
// this.trainnum = newdata.groupNumber;
//
// updateDriveValue(this.trainnum);
// }
updatedoorlight(newdata);
if(this.$refs.mmiui){
this.$refs.mmiui.updatetrainstatus(newdata);

View File

@ -219,7 +219,7 @@ export default {
//
this.updateMmiSpeedView(newdata.v,newdata.pv,newdata.tv);
if(newdata.maLen){
this.updateMmiLen(newdata.maLen);
@ -512,7 +512,6 @@ export default {
if(end){
this.endstation = end;
}
},
},
beforeDestroy() {