修改三维编辑器模型配置,修改三维的沙盘,驾驶,cctv,单体设备,通号维修模型加载,贴图加载的问题

This commit is contained in:
sunzhenyu 2020-07-20 17:32:16 +08:00
parent 9352cac2b3
commit ac0efbd97b
38 changed files with 1399 additions and 958 deletions

View File

@ -12,8 +12,8 @@ if(BASE_API == "https://test.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"
uploadurl = "../static";
asseturl = "../static"
}
const BASE_UPLOAD_API = uploadurl;
export const BASE_ASSET_API = asseturl;

View File

@ -71,6 +71,7 @@ export function Jlmap3ddata(mapid,scope){
//
jlmap3ddata.raillist = new RailList();
jlmap3ddata.raillist.setrail();
assetloader.assetinit(scene)
.then(function(data){
//console.log(data);
@ -122,39 +123,63 @@ export function Jlmap3ddata(mapid,scope){
let signaldata = JSON.parse(netdata.signals);
let standsdata = JSON.parse(netdata.stands);
jlmap3dasset = JSON.parse(netdata.assets);
console.log(jlmap3dasset);
assetloader.setmodellistnew(netdata.assets,5);
assetloader.assetpromise(scene)
.then(function(data){
console.log(assetloader);
// return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader);
return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,mapdata.stationStandList,scene,assetloader);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene);
return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,sectiondata.section,scene);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader);
return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader,mapdata.signalList);
})
.then(function(data){
// return jlmap3ddata.switchlist.initpromise(jlmap3ddata,mapdata.switchList,scene,assetloader);
return jlmap3ddata.switchlist.loadpromise(jlmap3ddata,switchdata,scene,assetloader);
})
// .then(function(data){
// //console.log(data);
// return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,loaderdata.section,switchdata,scene);
// })
if(jlmap3dasset.sceneAssetList == undefined){
// loadEditAllAsset(jlmap3dasset);
assetloader.setmodellistnew(netdata.assets,5);
assetloader.assetpromise(scene)
.then(function(data){
// return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader);
return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,mapdata.stationStandList,scene,assetloader);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene);
return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,sectiondata.section,scene);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader);
return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader,mapdata.signalList);
})
.then(function(data){
// return jlmap3ddata.switchlist.initpromise(jlmap3ddata,mapdata.switchList,scene,assetloader);
return jlmap3ddata.switchlist.loadpromise(jlmap3ddata,switchdata,scene,assetloader);
})
.then(function(data){
//console.log(data);
loadingInstance.close();
});
}else{
loadEditAllAsset(jlmap3dasset);
assetloader.setModelListOver(jlmap3dasset.sceneAssetList,5);
assetloader.assetPromiseOver(scene)
.then(function(data){
console.log(assetloader.modellist);
// return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader);
return jlmap3ddata.stationstandlist.loadpromise(jlmap3ddata,standsdata,mapdata.stationStandList,scene,assetloader);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.sectionlist.initpromise(jlmap3ddata,assetloader,mapdata.sectionList,mapdata.switchList,scene);
return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,sectiondata.section,scene);
})
.then(function(data){
//console.log(data);
// return jlmap3ddata.signallist.initpromise(jlmap3ddata,mapdata.signalList,scene,assetloader);
return jlmap3ddata.signallist.loadpromise(signaldata,scene,assetloader,mapdata.signalList);
})
.then(function(data){
// return jlmap3ddata.switchlist.initpromise(jlmap3ddata,mapdata.switchList,scene,assetloader);
return jlmap3ddata.switchlist.loadpromise(jlmap3ddata,switchdata,scene,assetloader);
})
.then(function(data){
//console.log(data);
loadingInstance.close();
});
}
.then(function(data){
//console.log(data);
loadingInstance.close();
});
});
}

View File

@ -3,49 +3,56 @@ export let driverListConfig = [
assetname:"列车模型",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'train',
url:''
},
{
assetname:"信号机模型",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'signal',
url:''
},
{
assetname:"道岔模型",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'switch',
url:''
},
{
assetname:"内侧车站",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'stationInside',
url:''
},
{
assetname:"外侧车站",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'stationOutside',
url:''
},
{
assetname:"三站台",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'stationThree',
url:''
},
{
assetname:"隧道背景",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'suidao',
url:''
}
];
@ -54,49 +61,56 @@ export let sceneListConfig = [
assetname:"列车模型",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'train',
url:''
},
{
assetname:"信号机模型",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'signal',
url:''
},
{
assetname:"道岔模型",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'switch',
url:''
},
{
assetname:"内侧车站",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'stationInside',
url:''
},
{
assetname:"外侧车站",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'stationOutside',
url:''
},
{
assetname:"三站台",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'stationThree',
url:''
},
{
assetname:"隧道背景",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'suidao',
url:''
}
];
@ -105,28 +119,32 @@ export let deviceListConfig = [
assetname:"信号机模型",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'deviceSignal',
url:''
},
{
assetname:"道岔模型",
id:'',
name:'',
type:'',
nampackageNamee:'',
deviceType:'',
type:'deviceSwitch',
url:''
},
{
assetname:"屏蔽门",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'deviceDoor',
url:''
},
{
assetname:"区段铁轨",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'deviceSection',
url:''
},
];
@ -136,35 +154,40 @@ export let maintainerListConfig = [
assetname:"信号机模型",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'maintainerSignal',
url:''
},
{
assetname:"道岔模型",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'maintainerSwitch',
url:''
},
{
assetname:"屏蔽门",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'maintainerDoor',
url:''
},
{
assetname:"区段铁轨",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'maintainerSection',
url:''
},
{
assetname:"设备间",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'maintainerEquipRoom',
url:''
},
];
@ -174,53 +197,64 @@ export let cctvListConfig = [
assetname:"人物1",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'cctvMan1',
url:''
},
{
assetname:"人物2",
id:'',
packageName:'',
deviceType:'',
type:'cctvMan2',
url:''
},
{
assetname:"cctv车站",
id:'',
packageName:'',
deviceType:'',
type:'cctvStation',
url:''
},
{
assetname:"进站闸机",
id:'',
packageName:'',
deviceType:'',
type:'cctvGateIn',
url:''
},
{
assetname:"出站闸机",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'cctvGateOut',
url:''
},
{
assetname:"监控设备",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'cctvMonitor',
url:''
},
{
assetname:"列车",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'cctvTrain',
url:''
},
{
assetname:"站台轨",
id:'',
packageName:'',
type:'',
deviceType:'',
type:'cctvSection',
url:''
}
];
@ -230,6 +264,7 @@ export let stationTextureListConfig = [
assetname:"车站站台贴图包",
id:'',
packageName:'',
deviceType:'',
type:'',
name:[],
urls:[],
@ -241,6 +276,7 @@ export let deviceTextureListConfig = [
assetname:"设备贴图列表包",
id:'',
packageName:'',
deviceType:'',
type:'',
name:[],
urls:[],
@ -252,6 +288,7 @@ export let signalTextureListConfig = [
assetname:"信号机灯光贴图包",
id:'',
packageName:'',
deviceType:'',
type:'',
name:[],
urls:[],

View File

@ -39,70 +39,75 @@ export function getmodels(data) {
// }
// assets.push(asset);
// }
//信号机资源
let assetsignal = {
id:"3",
name:"低位三灯",
deviceType:"signal",
type:"low",
assetUrl:"../../static/model/signal/d3d.FBX"
assetname:"信号机模型",
id:"1",
packageName:"高位三灯信号机",
deviceType:"SimulationSignal",
type:"signal",
url:"../../static/model/signal/d3d.FBX"
}
assets.push(assetsignal);
//列车资源
let assettrain = {
id:"9",
name:"6节列车",
deviceType:"train",
type:"num4",
assetUrl:"../../static/model/train/train.FBX"
assetname:"列车模型",
id:"2",
packageName:"6节列车",
deviceType:"SimulationTrain",
type:"train",
url:"../../static/model/train/train.FBX"
}
assets.push(assettrain);
let assetneicestation = {
id:"8",
name:"内侧车站",
deviceType:"stand",
type:"num4",
assetUrl:"../../static/model/station/fuzhou.FBX"
assetname:"内侧车站",
id:"3",
packageName:"沙盘驾驶内侧站台",
deviceType:"SimulationStation",
type:"stationInside",
url:"../../static/model/station/fuzhou.FBX"
}//"../../static/model/station/fuzhou/fuzhou.FBX"
assets.push(assetneicestation);
let assetswitch = {
id:"104",
name:"道岔",
deviceType:"autoswitch",
type:"fuzhou",
assetUrl:"../../static/model/auto/autoswitch.FBX"
assetname:"道岔模型",
id:"4",
packageName:"轨道通用道岔",
deviceType:"SimulationSwitch",
type:"switch",
url:"../../static/model/auto/autoswitch.FBX"
}
assets.push(assetswitch);
let assetwaicestation = {
id:"10",
name:"外侧车站",
deviceType:"standwaice",
type:"num4",
assetUrl:"../../static/model/station/waicestation.FBX"
assetname:"外侧车站",
id:"5",
packageName:"沙盘驾驶外侧站台",
deviceType:"SimulationStation",
type:"stationOutside",
url:"../../static/model/station/waicestation.FBX"
}
assets.push(assetwaicestation);
let assetstation3 = {
id:"10000",
name:"三站台",
deviceType:"station3",
type:"num4",
assetUrl:"../../static/model/station/station3.FBX"
assetname:"三站台",
id:"6",
packageName:"沙盘驾驶三站台",
deviceType:"SimulationStation",
type:"stationThree",
url:"../../static/model/station/station3.FBX"
}
assets.push(assetstation3);
let backgroundmodel = {
id:"1010",
name:"nbsuidao",
deviceType:"suidaobg",
type:"nbsuidao",
picUrl:"",
assetUrl:"../../static/model/suidao/xiansuidao.FBX"
assetname:"隧道背景",
id:"7",
packageName:"隧道背景",
deviceType:"SimulationBg",
type:"suidao",
url:"../../static/model/suidao/xiansuidao.FBX"
}
assets.push(backgroundmodel);

View File

@ -11,7 +11,7 @@ export function testgetmodels(data) {
stands:"null",
switchs:"null"
};
console.log(data.mapdata);
if(data.mapdata.sectionlist.sections== undefined){
return postmap;
}
@ -23,29 +23,9 @@ export function testgetmodels(data) {
}else{
let models = data.assetManager;
console.log(data.assetManager);
postmap.assets = JSON.stringify(models);
console.log(models);
//link轨道
// let links = [];
// for(let i=0;i<data.mapdata.linklist.linksgroup.children.length;i++){
// let link = {
// uuid:data.mapdata.linklist.linksgroup.children[i].uuid,
// code:data.mapdata.linklist.linksgroup.children[i].code,
// name:data.mapdata.linklist.linksgroup.children[i].name,
// lengthfact:data.mapdata.linklist.linksgroup.children[i].lengthfact,
// position:data.mapdata.linklist.linksgroup.children[i].position,
// rotation:data.mapdata.linklist.linksgroup.children[i].rotation,
// scale:data.mapdata.linklist.linksgroup.children[i].scale,
// rightlist:data.mapdata.linklist.linksgroup.children[i].rightlist,
// leftlist:data.mapdata.linklist.linksgroup.children[i].leftlist,
// lp:data.mapdata.linklist.linksgroup.children[i].lp,
// rp:data.mapdata.linklist.linksgroup.children[i].rp,
// rail:data.mapdata.linklist.linksgroup.children[i].rail,
// }
// links.push(link);
// }
// postmap.sections.link = JSON.stringify(links);
//section隧道
let sections = [];
@ -66,7 +46,7 @@ export function testgetmodels(data) {
scale:data.mapdata.sectionlist.sections.datalist[i].mesh.scale,
}
let nowmesh = data.mapdata.sectionlist.sectiongroup.getObjectByProperty("code",section.code);
section.railpoint = nowmesh.railpoint
section.railpoint = nowmesh.railpoint;
// console.log(nowmesh.railpoint);
// if(data.mapdata.sectionlist.sections.datalist[i].rsection){
// section.rsection = data.mapdata.sectionlist.sections.datalist[i].rsection;

View File

@ -159,15 +159,65 @@ export function JLmap3dEdit(dom, data, mapid) {
window.removeEventListener( 'resize', onWindowResize, false );
};
this.export = function(){
this.exportsection = function(){
let exporter = new THREE.OBJExporter();
console.log(scope.mapdata);
// let exportmodels = scope.mapdata.stationstandlist.group;
let exportmodels = scope.mapdata.sectionlist.sectiongroup;
// let exportmodels = scope.mapdata.stationstandlist.group;
let result = exporter.parse( exportmodels );
// 创建隐藏的可下载链接
var eleLink = document.createElement('a');
eleLink.download = filename;
eleLink.style.display = 'none';
// 字符内容转变成blob地址
var blob = new Blob([result]);
eleLink.href = URL.createObjectURL(blob);
// 触发点击
document.body.appendChild(eleLink);
eleLink.click();
// 然后移除
document.body.removeChild(eleLink);
}
console.log(result);
this.exportsection = function(){
let exporter = new THREE.OBJExporter();
console.log(scope.mapdata);
// let exportmodels = scope.mapdata.stationstandlist.group;
let exportSectionModel = scope.mapdata.sectionlist.sectiongroup;
objDownload("section",exporter.parse( exportSectionModel ));
let exportStationModel = scope.mapdata.stationstandlist.group;
objDownload("station",exporter.parse( exportStationModel ));
}
function objDownload(filename,content){
var eleLink = document.createElement('a');
eleLink.download = filename+".obj";
eleLink.style.display = 'none';
// 字符内容转变成blob地址
var blob = new Blob([content]);
eleLink.href = URL.createObjectURL(blob);
// 触发点击
document.body.appendChild(eleLink);
eleLink.click();
// 然后移除
document.body.removeChild(eleLink);
eleLink = null;
}
function download(filename, text) {
var pom = document.createElement('a');
pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
pom.setAttribute('download', filename);
if (document.createEvent) {
var event = document.createEvent('MouseEvents');
event.initEvent('click', true, true);
pom.dispatchEvent(event);
} else {
pom.click();
}
}
this.actiommode = function(changedata){

View File

@ -426,160 +426,10 @@ export function SectionList() {
data.mesh = testmesh2;
if(type == "right"){
let dx = Math.abs(data.points[0].x - data.points[data.pointslength].x);
    let dy = Math.abs(data.points[0].y - data.points[data.pointslength].y);
    let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
if(data.points[0].x == data.points[data.pointslength].x && data.points[0].y == data.points[data.pointslength].y){
data.rp.x = (data.points[data.pointslength].x-data.points[0].x)*data.lengthFact/distance+origin.rp.x;
data.rp.z = (data.points[data.pointslength].y-data.points[0].y)*data.lengthFact/distance+origin.rp.z;
data.lp.x = origin.rp.x;
data.lp.z = origin.rp.z;
let axix = new THREE.Vector3(1,0,0);
let axixnow = new THREE.Vector3(data.rp.x-data.lp.x,0,data.rp.z-data.lp.z);
let rotenum = axixnow.angleTo(axix);
//不同坐标系方向值不同
if(data.points[0].y>data.points[data.pointslength].y){
testmesh2.rotation.z = 0.2193;
data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.rp.z = data.lp.z-(data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else if(data.points[0].y<data.points[data.pointslength].y){
testmesh2.rotation.z = -0.2193;
data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.rp.z = data.lp.z-(data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else{
data.rp.z = data.lp.z;
// testmesh2.rotation.z = rotenum;
}
testmesh2.position.x = (data.lp.x + data.rp.x)/2;
testmesh2.position.z = (data.lp.z + data.rp.z)/2;
if(data.rp.z != data.lp.z){
testmesh2.railpoint = [
{x:data.lp.x,y:0,z:data.lp.z},
{x:testmesh2.position.x,y:0,z:testmesh2.position.z},
{x:data.rp.x,y:0,z:data.rp.z}
];
}else{
testmesh2.railpoint = [
{x:data.lp.x,y:0,z:data.lp.z},
{x:data.rp.x,y:0,z:data.rp.z}
];
}
// if(data.iscur == "3"){
// testmesh2.position.z = origin.mesh.position.z;
// }
// if(data.iscur == "1"){
// testmesh2.position.z = origin.rp.z - data.lengthFact/2;
// data.rp.z = origin.rp.z - data.lengthFact;
// testmesh2.rotation.z = 0.2193;
// }
// if(data.iscur == "2"){
// testmesh2.position.z = origin.rp.z + data.lengthFact/2;
// data.rp.z = origin.rp.z + data.lengthFact;
// testmesh2.rotation.z = -0.2193;
// }
}
if(type == "left"){
let dx = Math.abs(data.points[0].x - data.points[data.pointslength].x);
    let dy = Math.abs(data.points[0].y - data.points[data.pointslength].y);
    let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
data.lp.x = (data.points[0].x-data.points[data.pointslength].x)*data.lengthFact/distance+origin.lp.x;
data.lp.z = (data.points[0].y-data.points[data.pointslength].y)*data.lengthFact/distance+origin.lp.z;
data.rp.x = origin.lp.x;
data.rp.z = origin.lp.z;
let axix = new THREE.Vector3(1,0,0);
let axixnow = new THREE.Vector3(data.rp.x-data.lp.x,0,data.rp.z-data.lp.z);
let rotenum = axixnow.angleTo(axix);
//不同坐标系方向值不同
if(data.points[0].y>data.points[data.pointslength].y){
testmesh2.rotation.z = 0.2193;
data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else if(data.points[0].y<data.points[data.pointslength].y){
testmesh2.rotation.z = -0.2193;
data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else{
data.lp.z = data.rp.z;
// testmesh2.rotation.z = rotenum;
}
testmesh2.position.x = (data.rp.x + data.lp.x)/2;
testmesh2.position.z = (data.rp.z + data.lp.z)/2;
if(data.rp.z != data.lp.z){
testmesh2.railpoint = [
{x:data.lp.x,y:0,z:data.lp.z},
{x:testmesh2.position.x,y:0,z:testmesh2.position.z},
{x:data.rp.x,y:0,z:data.rp.z}
];
}else{
testmesh2.railpoint = [
{x:data.lp.x,y:0,z:data.lp.z},
{x:data.rp.x,y:0,z:data.rp.z}
];
}
// if(data.iscur == "3"){
// testmesh2.position.z = origin.mesh.position.z;
// }
// if(data.iscur == "1"){
// testmesh2.position.z = origin.lp.z + data.lengthFact/2;
// data.lp.z = origin.lp.z + data.lengthFact;
// testmesh2.rotation.z = 0.2193;
// }
// if(data.iscur == "2"){
// testmesh2.position.z = origin.lp.z - data.lengthFact/2;
// data.lp.z = origin.lp.z + data.lengthFact;
// testmesh2.rotation.z = -0.2193;
// }
}
// console.log(data.ctype);
if(type == "cross"){
// console.log(data.ctype);
// console.log(scope.sections.datalist[data.code].points.length);
// console.log(scope.sections.datalist[data.code]);
if(data.ctype == "1"||data.ctype == "2" ){
let dx = Math.abs(data.points[0].x - data.points[data.pointslength].x);
    let dy = Math.abs(data.points[0].y - data.points[data.pointslength].y);
    let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
data.lp.x = (data.points[0].x-data.points[data.pointslength].x)*data.lengthFact/distance+origin.lp.x;
data.lp.z = (data.points[0].y-data.points[data.pointslength].y)*data.lengthFact/distance+origin.lp.z;
data.rp.x = origin.lp.x;
data.rp.z = origin.lp.z;
let axix = new THREE.Vector3(1,0,0);
let axixnow = new THREE.Vector3(data.rp.x-data.lp.x,0,data.rp.z-data.lp.z);
let rotenum = axixnow.angleTo(axix);
//不同坐标系方向值不同
if(data.points[0].y>data.points[data.pointslength].y){
testmesh2.rotation.z = 0.2193;
data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else if(data.points[0].y<data.points[data.pointslength].y){
testmesh2.rotation.z = -0.2193;
data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else{
data.lp.z = data.rp.z;
}
testmesh2.position.x = (data.rp.x + data.lp.x)/2;
testmesh2.position.z = (data.rp.z + data.lp.z)/2;
// testmesh2.rotation.z = ;
}
if(data.ctype == "3" || data.ctype == "4"){
}else{
if(type == "right"){
let dx = Math.abs(data.points[0].x - data.points[data.pointslength].x);
    let dy = Math.abs(data.points[0].y - data.points[data.pointslength].y);
    let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
@ -597,24 +447,183 @@ export function SectionList() {
testmesh2.rotation.z = 0.2193;
data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.rp.z = data.lp.z-(data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else if(data.points[0].y<data.points[data.pointslength].y){
testmesh2.rotation.z = -0.2193;
data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.rp.z = data.lp.z-(data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else{
data.lp.z = data.rp.z;
data.rp.z = data.lp.z;
// testmesh2.rotation.z = rotenum;
}
testmesh2.position.x = (data.lp.x + data.rp.x)/2;
testmesh2.position.z = (data.lp.z + data.rp.z)/2;
if(data.rp.z != data.lp.z){
testmesh2.railpoint = [
{x:data.lp.x,y:0,z:data.lp.z},
{x:testmesh2.position.x,y:0,z:testmesh2.position.z},
{x:data.rp.x,y:0,z:data.rp.z}
];
}else{
testmesh2.railpoint = [
{x:data.lp.x,y:0,z:data.lp.z},
{x:data.rp.x,y:0,z:data.rp.z}
];
}
// if(data.iscur == "3"){
// testmesh2.position.z = origin.mesh.position.z;
// }
// if(data.iscur == "1"){
// testmesh2.position.z = origin.rp.z - data.lengthFact/2;
// data.rp.z = origin.rp.z - data.lengthFact;
// testmesh2.rotation.z = 0.2193;
// }
// if(data.iscur == "2"){
// testmesh2.position.z = origin.rp.z + data.lengthFact/2;
// data.rp.z = origin.rp.z + data.lengthFact;
// testmesh2.rotation.z = -0.2193;
// }
}
if(type == "left"){
let dx = Math.abs(data.points[0].x - data.points[data.pointslength].x);
    let dy = Math.abs(data.points[0].y - data.points[data.pointslength].y);
    let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
console.log("-------------------");
console.log(data);
console.log(origin);
console.log(distance);
data.lp.x = (data.points[0].x-data.points[data.pointslength].x)*data.lengthFact/distance+origin.lp.x;
data.lp.z = (data.points[0].y-data.points[data.pointslength].y)*data.lengthFact/distance+origin.lp.z;
data.rp.x = origin.lp.x;
data.rp.z = origin.lp.z;
let axix = new THREE.Vector3(1,0,0);
let axixnow = new THREE.Vector3(data.rp.x-data.lp.x,0,data.rp.z-data.lp.z);
let rotenum = axixnow.angleTo(axix);
//不同坐标系方向值不同
if(data.points[0].y>data.points[data.pointslength].y){
testmesh2.rotation.z = 0.2193;
data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else if(data.points[0].y<data.points[data.pointslength].y){
testmesh2.rotation.z = -0.2193;
data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else{
data.lp.z = data.rp.z;
// testmesh2.rotation.z = rotenum;
}
testmesh2.position.x = (data.rp.x + data.lp.x)/2;
testmesh2.position.z = (data.rp.z + data.lp.z)/2;
if(data.rp.z != data.lp.z){
testmesh2.railpoint = [
{x:data.lp.x,y:0,z:data.lp.z},
{x:testmesh2.position.x,y:0,z:testmesh2.position.z},
{x:data.rp.x,y:0,z:data.rp.z}
];
}else{
testmesh2.railpoint = [
{x:data.lp.x,y:0,z:data.lp.z},
{x:data.rp.x,y:0,z:data.rp.z}
];
}
// if(data.iscur == "3"){
// testmesh2.position.z = origin.mesh.position.z;
// }
// if(data.iscur == "1"){
// testmesh2.position.z = origin.lp.z + data.lengthFact/2;
// data.lp.z = origin.lp.z + data.lengthFact;
// testmesh2.rotation.z = 0.2193;
// }
// if(data.iscur == "2"){
// testmesh2.position.z = origin.lp.z - data.lengthFact/2;
// data.lp.z = origin.lp.z + data.lengthFact;
// testmesh2.rotation.z = -0.2193;
// }
}
// console.log(data.ctype);
if(type == "cross"){
// console.log(data.ctype);
// console.log(scope.sections.datalist[data.code].points.length);
// console.log(scope.sections.datalist[data.code]);
if(data.ctype == "1"||data.ctype == "2" ){
let dx = Math.abs(data.points[0].x - data.points[data.pointslength].x);
    let dy = Math.abs(data.points[0].y - data.points[data.pointslength].y);
    let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
data.lp.x = (data.points[0].x-data.points[data.pointslength].x)*data.lengthFact/distance+origin.lp.x;
data.lp.z = (data.points[0].y-data.points[data.pointslength].y)*data.lengthFact/distance+origin.lp.z;
data.rp.x = origin.lp.x;
data.rp.z = origin.lp.z;
let axix = new THREE.Vector3(1,0,0);
let axixnow = new THREE.Vector3(data.rp.x-data.lp.x,0,data.rp.z-data.lp.z);
let rotenum = axixnow.angleTo(axix);
//不同坐标系方向值不同
if(data.points[0].y>data.points[data.pointslength].y){
testmesh2.rotation.z = 0.2193;
data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else if(data.points[0].y<data.points[data.pointslength].y){
testmesh2.rotation.z = -0.2193;
data.lp.x = data.rp.x - (data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.lp.z = data.rp.z + (data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else{
data.lp.z = data.rp.z;
}
testmesh2.position.x = (data.rp.x + data.lp.x)/2;
testmesh2.position.z = (data.rp.z + data.lp.z)/2;
// testmesh2.rotation.z = ;
}
if(data.ctype == "3" || data.ctype == "4"){
let dx = Math.abs(data.points[0].x - data.points[data.pointslength].x);
    let dy = Math.abs(data.points[0].y - data.points[data.pointslength].y);
    let distance = Math.sqrt(Math.pow(dx,2)+Math.pow(dy,2));
data.rp.x = (data.points[data.pointslength].x-data.points[0].x)*data.lengthFact/distance+origin.rp.x;
data.rp.z = (data.points[data.pointslength].y-data.points[0].y)*data.lengthFact/distance+origin.rp.z;
data.lp.x = origin.rp.x;
data.lp.z = origin.rp.z;
let axix = new THREE.Vector3(1,0,0);
let axixnow = new THREE.Vector3(data.rp.x-data.lp.x,0,data.rp.z-data.lp.z);
let rotenum = axixnow.angleTo(axix);
//不同坐标系方向值不同
if(data.points[0].y>data.points[data.pointslength].y){
testmesh2.rotation.z = 0.2193;
data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.rp.z = data.lp.z-(data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else if(data.points[0].y<data.points[data.pointslength].y){
testmesh2.rotation.z = -0.2193;
data.rp.x = data.lp.x+(data.lengthFact)*Math.cos(testmesh2.rotation.z);
data.rp.z = data.lp.z-(data.lengthFact)*Math.sin(testmesh2.rotation.z);
}else{
data.lp.z = data.rp.z;
}
testmesh2.position.x = (data.lp.x + data.rp.x)/2;
testmesh2.position.z = (data.lp.z + data.rp.z)/2;
// testmesh2.rotation.z = ;
}
testmesh2.railpoint = [
{x:data.lp.x,y:0,z:data.lp.z},
{x:testmesh2.position.x,y:0,z:testmesh2.position.z},
{x:data.rp.x,y:0,z:data.rp.z}
];
// testmesh2.rotation.z = ;
}
testmesh2.railpoint = [
{x:data.lp.x,y:0,z:data.lp.z},
{x:testmesh2.position.x,y:0,z:testmesh2.position.z},
{x:data.rp.x,y:0,z:data.rp.z}
];
}
@ -710,7 +719,9 @@ export function SectionList() {
}
this.loadpromise = function(jlmap3ddata,assetloader,sectiondata,scene){
// console.log("-------------------");
// console.log(jlmap3ddata.sectionlist.sections.datalist);
// console.log(sectiondata);
var texture = new THREE.TextureLoader().load( '../../static/test/z0251.png' );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 1,1);
@ -735,120 +746,123 @@ export function SectionList() {
let len = newsection.lengthFact;
let testmesh2 = null;
if(newsection.railpoint.length>2){
// console.log(newsection);
let height = Math.random()/1000;
var closedSpline = new THREE.CatmullRomCurve3( [
new THREE.Vector3(newsection.railpoint[0].x,height,newsection.railpoint[0].z),
new THREE.Vector3(newsection.railpoint[1].x,height,newsection.railpoint[1].z),
new THREE.Vector3(newsection.railpoint[2].x,height,newsection.railpoint[2].z)
] );
closedSpline.type = 'catmullrom';
closedSpline.closed = false;
var extrudeSettings = {
steps : 5,
curveSegments : 1,
bevelSegments : 1,
bevelEnabled : false,
extrudePath : closedSpline,
};
var shape = new THREE.Shape();
shape.moveTo( 0,-2 );
shape.lineTo( 0, 2 );
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
testmesh2 = new THREE.Mesh( geometry, selectmaterial );
if(newsection.railpoint){
if(newsection.railpoint.length>2){
// console.log(newsection);
let height = Math.random()/1000;
var closedSpline = new THREE.CatmullRomCurve3( [
new THREE.Vector3(newsection.railpoint[0].x,height,newsection.railpoint[0].z),
new THREE.Vector3(newsection.railpoint[1].x,height,newsection.railpoint[1].z),
new THREE.Vector3(newsection.railpoint[2].x,height,newsection.railpoint[2].z)
] );
closedSpline.type = 'catmullrom';
closedSpline.closed = false;
var extrudeSettings = {
steps : 5,
curveSegments : 1,
bevelSegments : 1,
bevelEnabled : false,
extrudePath : closedSpline,
};
var shape = new THREE.Shape();
shape.moveTo( 0,-2 );
shape.lineTo( 0, 2 );
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
testmesh2 = new THREE.Mesh( geometry, selectmaterial );
testmesh2.railpoint = [
{x:newsection.railpoint[0].x,y:height,z:newsection.railpoint[0].z},
{x:newsection.railpoint[1].x,y:height,z:newsection.railpoint[1].z},
{x:newsection.railpoint[2].x,y:height,z:newsection.railpoint[2].z},
];
testmesh2.lengthFact = newsection.railpoint[2].x - newsection.railpoint[0].x;
// closedSpline.arcLengthDivisions;
let count = testmesh2.geometry.attributes.position.count/3;
for(let i=0;i<count;i++){
let ui=i*6;
if(i%2 != 0){
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 1;
testmesh2.geometry.attributes.uv.array[ui+2] = len/5;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len/5;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}else{
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 0;
testmesh2.geometry.attributes.uv.array[ui+2] = 0;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len/5;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}
}
}else{
let height = Math.random()/1000;
var closedSpline = new THREE.CatmullRomCurve3( [
new THREE.Vector3(newsection.railpoint[0].x,height,newsection.railpoint[0].z),
new THREE.Vector3(newsection.railpoint[1].x,height,newsection.railpoint[0].z),
] );
closedSpline.type = 'catmullrom';
closedSpline.closed = false;
// Set up settings for later extrusion
var extrudeSettings = {
steps : 1,
curveSegments : 1,
bevelSegments : 1,
bevelEnabled : false,
extrudePath : closedSpline,
};
var shape = new THREE.Shape();
shape.moveTo( -2,0 );
shape.lineTo( 2,0 );
// Extrude the triangle along the CatmullRom curve
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
testmesh2 = new THREE.Mesh( geometry, selectmaterial );
testmesh2.railpoint = [
{x:newsection.railpoint[0].x,y:height,z:newsection.railpoint[0].z},
{x:newsection.railpoint[1].x,y:height,z:newsection.railpoint[0].z},
];
testmesh2.lengthFact = newsection.railpoint[1].x - newsection.railpoint[0].x;
testmesh2.railpoint = [
{x:newsection.railpoint[0].x,y:height,z:newsection.railpoint[0].z},
{x:newsection.railpoint[1].x,y:height,z:newsection.railpoint[1].z},
{x:newsection.railpoint[2].x,y:height,z:newsection.railpoint[2].z},
];
testmesh2.lengthFact = newsection.railpoint[2].x - newsection.railpoint[0].x;
// closedSpline.arcLengthDivisions;
let count = testmesh2.geometry.attributes.position.count/3;
let count = testmesh2.geometry.attributes.position.count/3;
for(let i=0;i<count;i++){
let ui=i*6;
if(i%2 != 0){
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 1;
testmesh2.geometry.attributes.uv.array[ui+2] = len;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}else{
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 0;
testmesh2.geometry.attributes.uv.array[ui+2] = 0;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}
}
for(let i=0;i<count;i++){
let ui=i*6;
if(i%2 != 0){
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 1;
testmesh2.geometry.attributes.uv.array[ui+2] = len/5;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len/5;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}else{
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 0;
testmesh2.geometry.attributes.uv.array[ui+2] = 0;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len/5;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}
}
}else{
let height = Math.random()/1000;
var closedSpline = new THREE.CatmullRomCurve3( [
new THREE.Vector3(newsection.railpoint[0].x,height,newsection.railpoint[0].z),
new THREE.Vector3(newsection.railpoint[1].x,height,newsection.railpoint[0].z),
] );
closedSpline.type = 'catmullrom';
closedSpline.closed = false;
// Set up settings for later extrusion
var extrudeSettings = {
steps : 1,
curveSegments : 1,
bevelSegments : 1,
bevelEnabled : false,
extrudePath : closedSpline,
};
var shape = new THREE.Shape();
shape.moveTo( -2,0 );
shape.lineTo( 2,0 );
// Extrude the triangle along the CatmullRom curve
var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
testmesh2 = new THREE.Mesh( geometry, selectmaterial );
testmesh2.railpoint = [
{x:newsection.railpoint[0].x,y:height,z:newsection.railpoint[0].z},
{x:newsection.railpoint[1].x,y:height,z:newsection.railpoint[0].z},
];
testmesh2.lengthFact = newsection.railpoint[1].x - newsection.railpoint[0].x;
// closedSpline.arcLengthDivisions;
let count = testmesh2.geometry.attributes.position.count/3;
for(let i=0;i<count;i++){
let ui=i*6;
if(i%2 != 0){
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 1;
testmesh2.geometry.attributes.uv.array[ui+2] = len;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}else{
testmesh2.geometry.attributes.uv.array[ui] = 0;
testmesh2.geometry.attributes.uv.array[ui+1] = 0;
testmesh2.geometry.attributes.uv.array[ui+2] = 0;
testmesh2.geometry.attributes.uv.array[ui+3] = 1;
testmesh2.geometry.attributes.uv.array[ui+4] = len;
testmesh2.geometry.attributes.uv.array[ui+5] = 0;
}
}
}
testmesh2.code = newsection.code;
testmesh2.standTrack = newsection.standTrack;
testmesh2.meshtype = "section";
// testmesh2.geometry.computeBoundingBox();
// testmesh2.geometry.center()
// testmesh2.position.set(sectiondata[i].position.x,sectiondata[i].position.y,sectiondata[i].position.z);
scope.sectiongroup.add(testmesh2);
newsection.mesh = testmesh2;
scope.sections.datalist[newsection.code] = newsection;
}
testmesh2.code = newsection.code;
testmesh2.standTrack = newsection.standTrack;
testmesh2.meshtype = "section";
// testmesh2.geometry.computeBoundingBox();
// testmesh2.geometry.center()
// testmesh2.position.set(sectiondata[i].position.x,sectiondata[i].position.y,sectiondata[i].position.z);
scope.sectiongroup.add(testmesh2);
newsection.mesh = testmesh2;
scope.sections.datalist[newsection.code] = newsection;
}
resolve("loadersection");

View File

@ -132,7 +132,7 @@ export function SignalList() {
return new Promise(function(resolve, reject){
let num;
for(let j=0;j<assetloader.modellist.length;j++){
if(assetloader.modellist[j].id == signaldata[0].modelid){
if(assetloader.modellist[j].type == "signal"){
num = j;
}
}

View File

@ -167,6 +167,17 @@ export function StationStandList() {
let num2;
let num3;
for(let j=0;j<assetloader.modellist.length;j++){
if(assetloader.modellist[j].type == "stationInside"){
num = j;
}
if(assetloader.modellist[j].type == "stationOutside"){
num2 = j;
}
if(assetloader.modellist[j].type == "stationThree"){
num3 = j;
}
if(assetloader.modellist[j].deviceType == "stand"){
num = j;
}
@ -176,7 +187,6 @@ export function StationStandList() {
}
if(assetloader.modellist[j].deviceType == "station3"){
num3 = j;
// assetloader.modellist[num2].mesh.rotation.y = Math.PI/2;
}
}
// console.log("+++++++++++++");
@ -190,7 +200,7 @@ export function StationStandList() {
if(jlmapstanddata[j].code == standsdata[i].direction1.code){
if(standsdata[i].code != "Station96090"){
if(standsdata[i].inside == true){
newstationmesh = assetloader.modellist[num].mesh.clone(true);
}else{

View File

@ -61,6 +61,10 @@ export function SwitchList() {
// console.log(sectiondata);
let num;
for(let j=0;j<assetloader.modellist.length;j++){
if(assetloader.modellist[j].type == "switch"){
num = j;
}
if(assetloader.modellist[j].deviceType == "autoswitch"){
num = j;
}

View File

@ -9,7 +9,7 @@ import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js';
import { Moveanimate } from '@/jlmap3d/jl3ddevice/component/moveanimate.js';
import { Textconfig } from '@/jlmap3d/jl3ddevice/component/textconfig.js';
import { getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
import { getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata';
import StompClient from '@/utils/sock';
@ -20,6 +20,10 @@ import { logout } from '@/api/login';
var clock = new THREE.Clock();
export function Jl3ddeviceNew(dom,group,token,skinCode) {
var scope = this;
let helpbox,textplane;
let daochamodel;
let psdtexturemap = [];
this.dom = dom;
this.nowcode = null;
@ -29,10 +33,7 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
this.mixers = [];
this.showmodel = null;
let helpbox,textplane;
let daochamodel;
let psdtexturemap = [];
//点击事件状态
this.raycasterstatus = false;
//动画状态
@ -99,8 +100,24 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
this.controls.screenSpacePanning = true;
this.controls.update();
//设备名称和设备code
let lableCodeMap = [];
getPublishMapDetail(skinCode).then(data => {
let mapnetdata = data.data;
console.log(mapnetdata);
for(let i=0,leni=mapnetdata.switchList.length;i<leni;i++){
lableCodeMap[mapnetdata.switchList[i].name] = mapnetdata.switchList[i].code;
}
for(let i=0,leni=mapnetdata.psdList.length;i<leni;i++){
lableCodeMap[mapnetdata.psdList[i].standCode] = mapnetdata.psdList[i].code;
}
for(let i=0,leni=mapnetdata.signalList.length;i<leni;i++){
lableCodeMap[mapnetdata.signalList[i].name] = mapnetdata.signalList[i].code;
}
for(let i=0,leni=mapnetdata.sectionList.length;i<leni;i++){
lableCodeMap[mapnetdata.sectionList[i].name] = mapnetdata.sectionList[i].code;
}
});
document.addEventListener( "mousedown", onselect, false );
let teststomp = new StompClient();
@ -116,7 +133,7 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
function callback(Response) {
let data = JSON.parse(Response.body);
console.log(data);
// if(scope.nowcode != data.body.code){
// scope.nowcode = data.body.code;
// scope.selectmodel(data);
@ -126,8 +143,29 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
if(data.body.code == scope.nowcode){
scope.updateaction(data.body);
}
}
if(data.type == "Device_Fault_Set_3D"){
// console.log(data.body);
let realDeviceCode = lableCodeMap[data.body.code];
console.log(scope.nowcode);
console.log(lableCodeMap);
console.log(realDeviceCode);
if(realDeviceCode == scope.nowcode){
scope.deviceFaultSet(data.body);
}
}
if(data.type == "Device_Fault_Over_3D"){
// console.log(data.body);
let realDeviceCode = lableCodeMap[data.body.code];
if(realDeviceCode == scope.nowcode){
scope.deviceFaultOver(data.body);
}
}
if(data.type == 'Simulation_Over'){
logout(getToken()).then(() => {
this.$store.dispatch('LogOut').then(() => {
@ -154,20 +192,24 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
this.anime = null;
this.modelmanager = new ModelManager();
getPublish3dMapDetail(skinCode).then(netdata => {
if(netdata.data){
let netDataAssets = JSON.parse(netdata.data.assets);
console.log(netDataAssets);
if(netDataAssets.stationTextureList[0].urls.length > 1){
setpsdstationmap(JSON.parse(netdata.data.stands));
Standtextureload(scope,JSON.parse(netdata.data.assets));
Standtextureload(scope,netDataAssets.stationTextureList[0]);
}
scope.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
// console.log(scope,JSON.parse(netdata.data.assets));
scope.modelmanager.loadpromise(netDataAssets.deviceAssetList, scope.mixers).then(function (data) {
//综合演练情况下当模型加载后显示
psdModelShow();
moveanima.initlistnew(scope.modelmanager.switchmodel.mesh);
daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA");
if(scope.stationtexture["stationlist"]){
scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
if(scope.stationtexture["devicelist"]){
scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["devicelist"];
scope.modelmanager.standmodel.mesh.getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
}
if(scope.stationtexture["pingbimen"]){
@ -218,6 +260,9 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
}
this.selectmodel = function (data) {
console.log(data);
console.log(scope.modelmanager);
scope.modelmanager
if (scope.showmodel) {
if (scope.showmodel.code != data.code) {
@ -257,9 +302,14 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
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 == "Section") {
// console.log(data);
scope.showmodel = scope.modelmanager.sectionmodel.mesh;
scope.scene.add(scope.showmodel);
}
if(scope.showmodel){
scope.resetmodel();
scope.showmodel.code = data.code;
@ -306,10 +356,17 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
scope.modelmanager.standmodel.mesh.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
}
if (data._type == "Section") {
scope.showmodel = scope.modelmanager.sectionmodel.mesh;
scope.scene.add(scope.showmodel);
}
initstatus(data);
}
}
//设备分解、归位动画按钮
@ -426,7 +483,7 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
}
if (data.type == "PSD") {
if (data.type == "PSD" || data.type == "STAND") {
if (data.code == scope.nowcode) {
if (data.open == "1" ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = "0";
@ -451,6 +508,45 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
// scope.showmodel.
}
this.deviceFaultSet = function (data) {
if (data.type == "SIGNAL") {//从上往下红绿黄
scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
if (data.type == "PSD" || data.type == "STAND") {
scope.modelmanager.standmodel.screenDoorOpenStatus = "0";
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = 0;
scope.modelmanager.standmodel.action.timeScale = 1;
scope.modelmanager.standmodel.action.play();
}
}
this.deviceFaultOver = function (data) {
if (data.type == "SIGNAL") {//从上往下红绿黄
scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["red"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["yellow"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["green"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
if (data.type == "PSD" || data.type == "STAND") {
scope.modelmanager.standmodel.screenDoorOpenStatus = "1";
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration;
scope.modelmanager.standmodel.action.timeScale = -1;
scope.modelmanager.standmodel.action.play();
}
}
this.updateselect = function(updata){
// console.log(updata);
if(helpbox){
@ -537,24 +633,34 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
}
if (data._type == "Psd") {
if (data.screenDoorOpenStatus == "0") {
scope.modelmanager.standmodel.screenDoorOpenStatus = "0";
if (data.screenDoorOpenStatus == "0") {
scope.modelmanager.standmodel.screenDoorOpenStatus = "0";
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration;
scope.modelmanager.standmodel.action.timeScale = 1;
scope.modelmanager.standmodel.action.play();
}
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration;
scope.modelmanager.standmodel.action.timeScale = 1;
scope.modelmanager.standmodel.action.play();
}
if (data.screenDoorOpenStatus == "1") {
scope.modelmanager.standmodel.screenDoorOpenStatus = "1";
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = 0;
scope.modelmanager.standmodel.action.timeScale = -1;
scope.modelmanager.standmodel.action.play();
}
if (data.screenDoorOpenStatus == "1") {
scope.modelmanager.standmodel.screenDoorOpenStatus = "1";
scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = 0;
scope.modelmanager.standmodel.action.timeScale = -1;
scope.modelmanager.standmodel.action.play();
}
scope.camera.position.x = 0;
scope.camera.position.y = 8.3;
scope.camera.position.z = 12;
scope.controls.target = new THREE.Vector3(0,8.3,0);
scope.controls.update();
}else{
scope.camera.position.x = 0;
scope.camera.position.y = 20;
scope.camera.position.z = 30;
scope.controls.target = new THREE.Vector3(0,10,0);
scope.controls.update();
}
}

View File

@ -1,4 +1,5 @@
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
export function ModelManager(){
let scope = this;
@ -42,11 +43,28 @@ export function ModelManager(){
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));
for(let i=0,leni=data.length;i<leni;i++){
if(data[i].deviceType == "DeviceSignal"){
initlist.push(fbxpromise(data[i],mixers,scope.signalmodel));
}
if(data[i].deviceType == "DeviceSwitch"){
initlist.push(fbxpromise(data[i],mixers,scope.switchmodel));
}
if(data[i].deviceType == "DeviceDoor"){
initlist.push(fbxpromise(data[i],mixers,scope.standmodel));
}
if(data[i].deviceType == "DeviceSection"){
initlist.push(fbxpromise(data[i],mixers,scope.sectionmodel));
}
if(data[i].deviceType == "MaintainerRoom"){
initlist.push(fbxpromise(data[i],mixers,scope.roommodel));
}
}
// 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){
@ -64,7 +82,7 @@ export function ModelManager(){
function fbxpromise(asset,mixers,model){
return new Promise(function(resolve, reject){
var loader = new THREE.FBXLoader();
loader.load( asset.assetUrl, function ( object ) {
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
let mixer = new THREE.AnimationMixer( object );
object.traverse( function ( child ) {
if ( child.isMesh ) {
@ -82,6 +100,7 @@ function fbxpromise(asset,mixers,model){
mixers.push(mixer);
//model.action.play();
}
resolve(asset.deviceType);
} );

View File

@ -1,104 +1,110 @@
export function Standtextureload(jlmap3dedit,assettype){
if(assettype.stationtexture == "xian3"){
if(jlmap3dedit.stationtexture){
setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/xian3/devicelist.jpg');
setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/xian3/pingbimen.png');
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
setstationtexture(jlmap3dedit.stationtexture,"Station18000",'../../static/texture/xian3/Station18000.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station61238",'../../static/texture/xian3/Station61238.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station41790",'../../static/texture/xian3/Station41790.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station67945",'../../static/texture/xian3/Station67945.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station85598",'../../static/texture/xian3/Station85598.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station4324",'../../static/texture/xian3/Station4324.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station55755",'../../static/texture/xian3/Station55755.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station53597",'../../static/texture/xian3/Station53597.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station68029",'../../static/texture/xian3/Station68029.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station17596",'../../static/texture/xian3/Station17596.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station66742",'../../static/texture/xian3/Station66742.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station90701",'../../static/texture/xian3/Station90701.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station90652",'../../static/texture/xian3/Station90652.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station54200",'../../static/texture/xian3/Station54200.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station19253",'../../static/texture/xian3/Station19253.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station37821",'../../static/texture/xian3/Station37821.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station47557",'../../static/texture/xian3/Station47557.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station78551",'../../static/texture/xian3/Station78551.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station64474",'../../static/texture/xian3/Station64474.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station21203",'../../static/texture/xian3/Station21203.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station34499",'../../static/texture/xian3/Station34499.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station571",'../../static/texture/xian3/Station571.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station99903",'../../static/texture/xian3/Station99903.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station43447",'../../static/texture/xian3/Station43447.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station67917",'../../static/texture/xian3/Station67917.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station60649",'../../static/texture/xian3/Station60649.jpg');
}
}
if(assettype.stationtexture == "haerbin1"){
if(jlmap3dedit.stationtexture){
setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/heb/devicelist.jpg');
setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/heb/pingbimen.png');
export function Standtextureload(jlmap3dedit,standTextureData){
console.log(standTextureData);
setstationtexture(jlmap3dedit.stationtexture,"Station5361",'../../static/texture/heb/Station5361.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station11094",'../../static/texture/heb/Station11094.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station11136",'../../static/texture/heb/Station11136.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station17293",'../../static/texture/heb/Station17293.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station18398",'../../static/texture/heb/Station18398.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station22163",'../../static/texture/heb/Station22163.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station25464",'../../static/texture/heb/Station25464.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station28090",'../../static/texture/heb/Station28090.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station41999",'../../static/texture/heb/Station41999.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station44338",'../../static/texture/heb/Station44338.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station46464",'../../static/texture/heb/Station46464.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station50565",'../../static/texture/heb/Station50565.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station60068",'../../static/texture/heb/Station60068.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station62429",'../../static/texture/heb/Station62429.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station64444",'../../static/texture/heb/Station64444.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station71700",'../../static/texture/heb/Station71700.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station72132",'../../static/texture/heb/Station72132.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station78164",'../../static/texture/heb/Station78164.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station79537",'../../static/texture/heb/Station79537.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station82618",'../../static/texture/heb/Station82618.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station85520",'../../static/texture/heb/Station85520.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station89483",'../../static/texture/heb/Station89483.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station96090",'../../static/texture/heb/Station96090.jpg');
}
}
if(assettype.stationtexture == "nb1"){
if(jlmap3dedit.stationtexture){
setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/nb1/devicelist.jpg');
setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/nb1/pingbimen.png');
setstationtexture(jlmap3dedit.stationtexture,"Station1533",'../../static/texture/nb1/Station1533.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station11231",'../../static/texture/nb1/Station11231.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station12421",'../../static/texture/nb1/Station12421.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station16356",'../../static/texture/nb1/Station16356.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station18678",'../../static/texture/nb1/Station18678.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station19817",'../../static/texture/nb1/Station19817.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station23567",'../../static/texture/nb1/Station23567.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station24903",'../../static/texture/nb1/Station24903.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station26416",'../../static/texture/nb1/Station26416.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station27207",'../../static/texture/nb1/Station27207.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station28032",'../../static/texture/nb1/Station28032.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station28958",'../../static/texture/nb1/Station28958.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station30520",'../../static/texture/nb1/Station30520.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station32955",'../../static/texture/nb1/Station32955.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station38286",'../../static/texture/nb1/Station38286.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station38674",'../../static/texture/nb1/Station38674.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station44173",'../../static/texture/nb1/Station44173.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station63100",'../../static/texture/nb1/Station63100.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station69378",'../../static/texture/nb1/Station69378.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station72310",'../../static/texture/nb1/Station72310.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station72764",'../../static/texture/nb1/Station72764.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station75414",'../../static/texture/nb1/Station75414.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station75494",'../../static/texture/nb1/Station75494.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station75703",'../../static/texture/nb1/Station75703.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station78392",'../../static/texture/nb1/Station78392.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station81700",'../../static/texture/nb1/Station81700.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station84098",'../../static/texture/nb1/Station84098.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station86112",'../../static/texture/nb1/Station86112.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station99584",'../../static/texture/nb1/Station99584.jpg');
}
}
for(let i=0,leni=standTextureData.urls.length;i<leni;i++){
setstationtexture(jlmap3dedit.stationtexture,standTextureData.urls[i].name,BASE_ASSET_API + standTextureData.urls[i].url);
}
// if(assettype.stationtexture == "xian3"){
// if(jlmap3dedit.stationtexture){
// setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/xian3/devicelist.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/xian3/pingbimen.png');
//
// setstationtexture(jlmap3dedit.stationtexture,"Station18000",'../../static/texture/xian3/Station18000.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station61238",'../../static/texture/xian3/Station61238.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station41790",'../../static/texture/xian3/Station41790.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station67945",'../../static/texture/xian3/Station67945.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station85598",'../../static/texture/xian3/Station85598.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station4324",'../../static/texture/xian3/Station4324.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station55755",'../../static/texture/xian3/Station55755.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station53597",'../../static/texture/xian3/Station53597.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station68029",'../../static/texture/xian3/Station68029.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station17596",'../../static/texture/xian3/Station17596.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station66742",'../../static/texture/xian3/Station66742.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station90701",'../../static/texture/xian3/Station90701.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station90652",'../../static/texture/xian3/Station90652.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station54200",'../../static/texture/xian3/Station54200.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station19253",'../../static/texture/xian3/Station19253.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station37821",'../../static/texture/xian3/Station37821.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station47557",'../../static/texture/xian3/Station47557.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station78551",'../../static/texture/xian3/Station78551.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station64474",'../../static/texture/xian3/Station64474.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station21203",'../../static/texture/xian3/Station21203.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station34499",'../../static/texture/xian3/Station34499.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station571",'../../static/texture/xian3/Station571.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station99903",'../../static/texture/xian3/Station99903.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station43447",'../../static/texture/xian3/Station43447.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station67917",'../../static/texture/xian3/Station67917.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station60649",'../../static/texture/xian3/Station60649.jpg');
// }
// }
// if(assettype.stationtexture == "haerbin1"){
// if(jlmap3dedit.stationtexture){
// setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/heb/devicelist.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/heb/pingbimen.png');
//
// setstationtexture(jlmap3dedit.stationtexture,"Station5361",'../../static/texture/heb/Station5361.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station11094",'../../static/texture/heb/Station11094.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station11136",'../../static/texture/heb/Station11136.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station17293",'../../static/texture/heb/Station17293.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station18398",'../../static/texture/heb/Station18398.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station22163",'../../static/texture/heb/Station22163.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station25464",'../../static/texture/heb/Station25464.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station28090",'../../static/texture/heb/Station28090.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station41999",'../../static/texture/heb/Station41999.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station44338",'../../static/texture/heb/Station44338.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station46464",'../../static/texture/heb/Station46464.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station50565",'../../static/texture/heb/Station50565.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station60068",'../../static/texture/heb/Station60068.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station62429",'../../static/texture/heb/Station62429.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station64444",'../../static/texture/heb/Station64444.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station71700",'../../static/texture/heb/Station71700.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station72132",'../../static/texture/heb/Station72132.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station78164",'../../static/texture/heb/Station78164.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station79537",'../../static/texture/heb/Station79537.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station82618",'../../static/texture/heb/Station82618.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station85520",'../../static/texture/heb/Station85520.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station89483",'../../static/texture/heb/Station89483.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station96090",'../../static/texture/heb/Station96090.jpg');
// }
// }
// if(assettype.stationtexture == "nb1"){
// if(jlmap3dedit.stationtexture){
// setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/nb1/devicelist.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/nb1/pingbimen.png');
//
// setstationtexture(jlmap3dedit.stationtexture,"Station1533",'../../static/texture/nb1/Station1533.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station11231",'../../static/texture/nb1/Station11231.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station12421",'../../static/texture/nb1/Station12421.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station16356",'../../static/texture/nb1/Station16356.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station18678",'../../static/texture/nb1/Station18678.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station19817",'../../static/texture/nb1/Station19817.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station23567",'../../static/texture/nb1/Station23567.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station24903",'../../static/texture/nb1/Station24903.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station26416",'../../static/texture/nb1/Station26416.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station27207",'../../static/texture/nb1/Station27207.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station28032",'../../static/texture/nb1/Station28032.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station28958",'../../static/texture/nb1/Station28958.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station30520",'../../static/texture/nb1/Station30520.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station32955",'../../static/texture/nb1/Station32955.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station38286",'../../static/texture/nb1/Station38286.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station38674",'../../static/texture/nb1/Station38674.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station44173",'../../static/texture/nb1/Station44173.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station63100",'../../static/texture/nb1/Station63100.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station69378",'../../static/texture/nb1/Station69378.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station72310",'../../static/texture/nb1/Station72310.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station72764",'../../static/texture/nb1/Station72764.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station75414",'../../static/texture/nb1/Station75414.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station75494",'../../static/texture/nb1/Station75494.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station75703",'../../static/texture/nb1/Station75703.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station78392",'../../static/texture/nb1/Station78392.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station81700",'../../static/texture/nb1/Station81700.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station84098",'../../static/texture/nb1/Station84098.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station86112",'../../static/texture/nb1/Station86112.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station99584",'../../static/texture/nb1/Station99584.jpg');
// }
// }
//console.log(jlmap3dedit.materiallist);
}

View File

@ -104,7 +104,6 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,sta
return;
}
if(data.type == "Train_Hmi_3D"){
console.log(data);
updatestatus(data.body);
if(data.body.trust == '1'){
updateDriverTrust(data.body.code,true);

View File

@ -142,9 +142,10 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
this.modelmanager = new ModelManager();
getPublish3dMapDetail(skinCode).then(netdata => {
let netDataAssets = JSON.parse(netdata.data.assets);
setpsdstationmap(JSON.parse(netdata.data.stands));
Standtextureload(scope,JSON.parse(netdata.data.assets));
scope.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
Standtextureload(scope,netDataAssets.stationTextureList[0]);
scope.modelmanager.loadpromise(JSON.parse(netdata.data.assets).maintainerAssetList, scope.mixers).then(function (data) {
moveanima.initlistnew(scope.modelmanager.switchmodel.mesh);
daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA");

View File

@ -47,7 +47,8 @@ export function MaintainerLoad(data,scope,netdata,mapdata,camera,controls,scene)
}
function initnew3d(data,netdata){
Materialload(scope,JSON.parse(netdata.assets));
Materialload(scope,JSON.parse(netdata.assets).stationTextureList[0]);
let mapdata = data;
//初始化轨道和道岔
// lengthfact(data);
@ -69,12 +70,12 @@ export function MaintainerLoad(data,scope,netdata,mapdata,camera,controls,scene)
let signaldata = JSON.parse(netdata.signals);
let standsdata = JSON.parse(netdata.stands);
let psddata = data.psdList;
assetloader.setmodellistnew(netdata.assets);
// assetloader.setmodellistnew(netdata.assets);
//
// assetloader.assetpromise(sceneload)
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList);
assetloader.assetpromise(sceneload)
// .then(function(data){
// return linklist.loadpromise(loaderdata.link,sceneload,assetloader);
// })
assetloader.assetPromiseOver(sceneload)
.then(function(data){
//console.log(data);
//,netdata.stands,mixers,actions,"0"
@ -97,46 +98,46 @@ export function MaintainerLoad(data,scope,netdata,mapdata,camera,controls,scene)
//console.log(assetloader);
return trainlisttest.initpromise(mapdata.trainList,sceneload,assetloader,mixers,actions,"02");
})
// .then(function(data){
// return new Promise(function(resolve, reject){
// rails.init(sectiondata.section,sectiondata,switchdata,sceneload);
// resolve("loadrail");
//
// });
// })
.then(function(data){
return new Promise(function(resolve, reject){
//
let netasset = JSON.parse(netdata.assets);
if(netasset.istexture){
for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
if(scope.assetloader.modellist[mn].deviceType && scope.assetloader.modellist[mn].type == "suidao"){
// scope.assetloader.modellist[mn].mesh.deviceType = "suidaobg";
scene.add(scope.assetloader.modellist[mn].mesh);
}
}
resolve("loadersuidao");
});
})
.then(function(data){
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;
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;
}
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;
}
}
for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
if(scope.assetloader.modellist[mn].deviceType && scope.assetloader.modellist[mn].deviceType == "suidaobg"){
// scope.assetloader.modellist[mn].mesh.deviceType = "suidaobg";
scene.add(scope.assetloader.modellist[mn].mesh);
}
}
// console.log(stationstandlist.group.children[0].name );
// if(stationstandlist.group.children[0].name == "Station75414"){
// for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
// if(scope.assetloader.modellist[mn].name && scope.assetloader.modellist[mn].name == "nbsuidao"){
// scope.assetloader.modellist[mn].mesh.name = "nbsuidao";
// scene.add(scope.assetloader.modellist[mn].mesh);
// }
// }
// }
resolve("mergemodel");
});
})

View File

@ -411,31 +411,24 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
let stationlist = [];
let socktest = null;
this.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
// console.log(scope.modelmanager);
initstationanimation(scope.modelmanager.station.mesh);
initzhajiinaimation(scope.modelmanager.zhajiin.mesh);
initzhajioutanimation(scope.modelmanager.zhajiout.mesh);
inittrain(scope.modelmanager.train.mesh);
scene.add(scope.modelmanager.section.mesh);
// scene.add(scope.modelmanager.train.mesh);
getPublish3dMapDetail(skinCode).then(netdata3d => {
console.log(JSON.parse(netdata3d.data.assets).cctvAssetList);
this.modelmanager.loadpromise(JSON.parse(netdata3d.data.assets).cctvAssetList, scope.mixers).then(function (data) {
// console.log(scope.modelmanager);
initstationanimation(scope.modelmanager.station.mesh);
initzhajiinaimation(scope.modelmanager.zhajiin.mesh);
initzhajioutanimation(scope.modelmanager.zhajiout.mesh);
inittrain(scope.modelmanager.train.mesh);
scene.add(scope.modelmanager.section.mesh);
// scene.add(scope.modelmanager.train.mesh);
level = scope.modelmanager.station.mesh;
level = scope.modelmanager.station.mesh;
monitor = scope.modelmanager.monitor.mesh;
scene.add(monitor);
monitor = scope.modelmanager.monitor.mesh;
scene.add(monitor);
getPublish3dMapDetail(skinCode).then(netdata3d => {
if(netdata3d.data){
Materialload(scope,JSON.parse(netdata3d.data.assets));
}
Materialload(scope,JSON.parse(netdata3d.data.assets).stationTextureList[0]);
getPublishMapDetail(skinCode).then(netdata => {
scope.switchviews(4);
inithumans();
@ -444,11 +437,10 @@ export function Jl3dpassflow(dom,skinCode,routegroup) {
});
});
loadingInstance.close();
animate();
})
loadingInstance.close();
animate();
})
});
function inithumans(){
originhuman1 = scope.modelmanager.man1.mesh;
originhuman1.progress = 1;

View File

@ -1,4 +1,4 @@
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
export function ModelManager(){
let scope = this;
@ -68,14 +68,34 @@ export function ModelManager(){
this.loadpromise = function (data,mixers){
let initlist = [];
initlist.push(fbxpromise(data.man1,mixers,scope.man1));
initlist.push(fbxpromise(data.man2,mixers,scope.man2));
initlist.push(fbxpromise(data.station,mixers,scope.station));
initlist.push(fbxpromise(data.zhajiin,mixers,scope.zhajiin));
initlist.push(fbxpromise(data.zhajiout,mixers,scope.zhajiout));
initlist.push(fbxpromise(data.monitor,mixers,scope.monitor));
initlist.push(fbxpromise(data.train,mixers,scope.train));
initlist.push(fbxpromise(data.section,mixers,scope.section));
console.log(data);
for(let i=0,leni=data.length;i<leni;i++){
if(data[i].type == "man1" || data[i].type == "cctvMan1"){
initlist.push(fbxpromise(data[i],mixers,scope.man1));
}
if(data[i].type == "man2" || data[i].type == "cctvMan2"){
initlist.push(fbxpromise(data[i],mixers,scope.man2));
}
if(data[i].type == "cctvStation"){
initlist.push(fbxpromise(data[i],mixers,scope.station));
}
if(data[i].type == "cctvGateIn"){
initlist.push(fbxpromise(data[i],mixers,scope.zhajiin));
}
if(data[i].type == "cctvGateOut"){
initlist.push(fbxpromise(data[i],mixers,scope.zhajiout));
}
if(data[i].type == "cctvMonitor"){
initlist.push(fbxpromise(data[i],mixers,scope.monitor));
}
if(data[i].type == "cctvTrain"){
initlist.push(fbxpromise(data[i],mixers,scope.train));
}
if(data[i].type == "cctvSection"){
initlist.push(fbxpromise(data[i],mixers,scope.section));
}
}
return new Promise(function(resolve, reject){
@ -93,7 +113,7 @@ export function ModelManager(){
function fbxpromise(asset,mixers,model){
return new Promise(function(resolve, reject){
var loader = new THREE.FBXLoader();
loader.load( asset.assetUrl, function ( object ) {
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
// let mixer = new THREE.AnimationMixer( object );
// object.traverse( function ( child ) {
// if ( child.isMesh ) {
@ -101,7 +121,7 @@ function fbxpromise(asset,mixers,model){
// child.receiveShadow = true;
// }
// } );
if(asset.deviceType == "train"){
if(asset.type == "cctvTrain"){
// let mixer = new THREE.AnimationMixer( object );
let realtrain = new THREE.Group();
for(let j=6;j>0;j--){

View File

@ -2,6 +2,7 @@ import { AssetModel } from '@/jlmap3d/main/loaders/model/Assetmodel';
import { Assetmaterial } from '@/jlmap3d/main/loaders/model/Assetmaterial';
import { getBaseUrl } from '@/utils/baseUrl';
import { Loading } from 'element-ui';
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
const BASE_API = getBaseUrl();
let modelurl = "../../static/model";
// if(BASE_API == 'https://joylink.club/jlcloud'){
@ -17,7 +18,7 @@ let defaultsignal = {
deviceType:"signal",
type:"low",
picUrl:"",
assetUrl:"../../static/model/signal/d3d.FBX"
url:"../../static/model/signal/d3d.FBX"
}
let defaulttrain = {
@ -26,7 +27,7 @@ let defaulttrain = {
deviceType:"train",
type:"num4",
picUrl:"",
assetUrl:"../../static/model/train/train.FBX"
url:"../../static/model/train/train.FBX"
}
@ -36,7 +37,7 @@ let defaultstation = {
deviceType:"stand",
type:"num4",
picUrl:"",
assetUrl:"../../static/model/station/fuzhou.FBX"
url:"../../static/model/station/fuzhou.FBX"
}//"../../static/model/station/fuzhou/fuzhou.FBX"
let waicestation = {
id:"10",
@ -44,7 +45,7 @@ let waicestation = {
deviceType:"standwaice",
type:"num4",
picUrl:"",
assetUrl:"../../static/model/station/waicestation.FBX"
url:"../../static/model/station/waicestation.FBX"
}
let station3 = {
id:"10000",
@ -52,7 +53,7 @@ let station3 = {
deviceType:"station3",
type:"num4",
picUrl:"",
assetUrl:"../../static/model/station/station3.FBX"
url:"../../static/model/station/station3.FBX"
}
//"../../static/model/station/fuzhou/fuzhou.FBX"
//https://test.joylink.club/oss/station/fuzhou/fuzhou.FBX
@ -65,7 +66,7 @@ let defaultswitch = {
deviceType:"switch",
type:"fuzhou",
picUrl:"",
assetUrl:"../../static/model/daocha/daocha.FBX"
url:"../../static/model/daocha/daocha.FBX"
}
@ -75,7 +76,7 @@ let defaultsuidao = {
deviceType:"suidao",
type:"suidao",
picUrl:"",
assetUrl:"../../static/model/suidao/suidao.FBX"
url:"../../static/model/suidao/suidao.FBX"
}
let hebsuidao = {
@ -84,7 +85,7 @@ let hebsuidao = {
deviceType:"hebsuidao",
type:"hebsuidao",
picUrl:"",
assetUrl:"../../static/model/suidao/hebsuidao.FBX"
url:"../../static/model/suidao/hebsuidao.FBX"
}
let nbsuidao = {
id:"1010",
@ -92,7 +93,7 @@ let nbsuidao = {
deviceType:"nbsuidao",
type:"nbsuidao",
picUrl:"",
assetUrl:"../../static/model/suidao/nbsuidao.FBX"
url:"../../static/model/suidao/nbsuidao.FBX"
}
let defaultbackground = {
id:"16",
@ -100,7 +101,7 @@ let defaultbackground = {
deviceType:"background",
type:"background",
picUrl:"",
assetUrl:"../../static/model/suidao/background.FBX"
url:"../../static/model/suidao/background.FBX"
}
//"../../static/model/suidao/suidao.FBX"
//https://test.joylink.club/oss/suidao/suidao.FBX
@ -113,7 +114,7 @@ let defaultautorail = {
deviceType:"autorail",
type:"autorail",
picUrl:"",
assetUrl:"../../static/model/auto/rail.FBX"
url:"../../static/model/auto/rail.FBX"
}
let autoswitch = {
@ -122,7 +123,7 @@ let autoswitch = {
deviceType:"autoswitch",
type:"fuzhou",
picUrl:"",
assetUrl:"../../static/model/auto/autoswitch.FBX"
url:"../../static/model/auto/autoswitch.FBX"
}
let autoswitch1 = {
@ -131,7 +132,7 @@ let autoswitch1 = {
deviceType:"autoswitch1",
type:"fuzhou",
picUrl:"",
assetUrl:"../../static/model/auto/switch1.FBX"
url:"../../static/model/auto/switch1.FBX"
}
let autoswitch2 = {
@ -140,7 +141,7 @@ let autoswitch2 = {
deviceType:"autoswitch2",
type:"fuzhou",
picUrl:"",
assetUrl:"../../static/model/auto/switch2.FBX"
url:"../../static/model/auto/switch2.FBX"
}
export function AssetLoader(){
@ -182,7 +183,6 @@ export function AssetLoader(){
scope.modellist.push(defaultswitch2);
let modeldata = JSON.parse(data);
console.log(data);
for(let j=0;j<modeldata.length;j++){
let had = false;
for(let i=0;i<scope.modellist.length;i++){
@ -205,42 +205,44 @@ export function AssetLoader(){
}
}
this.setModelListOver = function (data,trainoffset){
if(trainoffset){
scope.trainoffset = trainoffset;
}
let modeldata = data;
// console.log(data);
for(let j=0;j<modeldata.length;j++){
let had = false;
for(let i=0;i<scope.modellist.length;i++){
if(scope.modellist[i].id == modeldata[j].id){
had = true;
i = scope.modellist.length;
}
}
if(had == false){
let model = new AssetModel(modeldata[j]);
scope.modellist.push(modeldata[j]);
}
}
}
this.setmodellistnew = function (data,trainoffset){
if(trainoffset){
scope.trainoffset = trainoffset;
}
// let defaultmodel1 = new AssetModel(defaultsignal);
// scope.modellist.push(defaultmodel1);
//
// let defaultmodel2 = new AssetModel(defaulttrain);
// scope.modellist.push(defaultmodel2);
//
// let station = new AssetModel(defaultstation);
// scope.modellist.push(station);
//
// let wstation = new AssetModel(waicestation);
// scope.modellist.push(wstation);
//
// let s3 = new AssetModel(station3);
// scope.modellist.push(s3);
//
// let hebsd = new AssetModel(hebsuidao);
// scope.modellist.push(hebsd);
//
// let nbsd = new AssetModel(nbsuidao);
// scope.modellist.push(nbsd);
//
//
// let defaultswitch1 = new AssetModel(autoswitch1);
// scope.modellist.push(defaultswitch1);
//
// let defaultswitch2 = new AssetModel(autoswitch2);
// scope.modellist.push(defaultswitch2);
let modeldata = JSON.parse(data);
// console.log(data);
for(let j=0;j<modeldata.assets.length;j++){
let had = false;
for(let i=0;i<scope.modellist.length;i++){
@ -264,10 +266,32 @@ export function AssetLoader(){
}
this.assetPromiseOver = function (scene){
let initlist = [];
console.log(scope.modellist);
for(let i=0;i<scope.modellist.length;i++){
initlist.push(fbxPromiseOver(scope.modellist[i]));
}
return new Promise(function(resolve, reject){
Promise.all(initlist).then((result) => {
resolve("loaderassets"); //['成功了', 'success']
}).catch((error) => {
//console.log(error);
});
});
}
this.assetpromise = function (scene){
let initlist = [];
console.log(scope.modellist);
for(let i=0;i<scope.modellist.length;i++){
initlist.push(fbxpromise(scope.modellist[i]));
initlist.push(fbxpromiseold(scope.modellist[i]));
}
return new Promise(function(resolve, reject){
@ -310,7 +334,7 @@ export function AssetLoader(){
let autoswitchs = new AssetModel(autoswitch);
scope.modellist.push(autoswitchs);
console.log(signal);
fbxpromise(signal)
.then(function(data){
////console.log(data);
@ -563,13 +587,12 @@ export function AssetLoader(){
function fbxpromise(asset){
return new Promise(function(resolve, reject){
var loader = new THREE.FBXLoader();
loader.load( asset.assetUrl, function ( object ) {
loader.load( asset.url, function ( object ) {
let mixer = new THREE.AnimationMixer( object );
//object.traverse(function (node) {//获取其中对象
// node.frustumCulled = true;
//});
if(asset.deviceType == "train"){
let realtrain = new THREE.Group();
for(let j=6;j>0;j--){
@ -599,4 +622,80 @@ export function AssetLoader(){
});
}
function fbxpromiseold(asset){
return new Promise(function(resolve, reject){
var loader = new THREE.FBXLoader();
console.log(asset);
loader.load( asset.assetUrl, function ( object ) {
let mixer = new THREE.AnimationMixer( object );
//object.traverse(function (node) {//获取其中对象
// node.frustumCulled = true;
//});
asset.type = asset.deviceType;
if(asset.deviceType == "train"){
let realtrain = new THREE.Group();
for(let j=6;j>0;j--){
let name = "c"+j;
for(let i=0;i<object.children.length;i++){
if(object.children[i].name == name){
object.children[i].position.x = object.children[i].position.x+scope.trainoffset;
//object.children[i].position.y = j*10;
realtrain.add(object.children[i]);
i--;
}
}
}
asset.mesh = realtrain;
asset.animations = object.animations[0].tracks;
}else{
asset.mesh = object;
}
//object.scale.set(0.1,0.1,0.1);
resolve("fbxload");
} );
});
}
function fbxPromiseOver(asset){
return new Promise(function(resolve, reject){
var loader = new THREE.FBXLoader();
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
let mixer = new THREE.AnimationMixer( object );
//object.traverse(function (node) {//获取其中对象
// node.frustumCulled = true;
//});
if(asset.type == "train"){
let realtrain = new THREE.Group();
for(let j=6;j>0;j--){
let name = "c"+j;
for(let i=0;i<object.children.length;i++){
if(object.children[i].name == name){
object.children[i].position.x = object.children[i].position.x+scope.trainoffset;
//object.children[i].position.y = j*10;
realtrain.add(object.children[i]);
i--;
}
}
}
asset.mesh = realtrain;
asset.animations = object.animations[0].tracks;
}else{
asset.mesh = object;
}
//object.scale.set(0.1,0.1,0.1);
resolve("fbxload");
} );
});
}
}

View File

@ -49,7 +49,7 @@ export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist,
}
function initnew3d(data,netdata){
Materialload(scope,JSON.parse(netdata.assets));
Materialload(scope,JSON.parse(netdata.assets).stationTextureList[0]);
let mapdata = data;
//初始化轨道和道岔
// linklist = new LinkList();
@ -69,12 +69,15 @@ export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist,
let signaldata = JSON.parse(netdata.signals);
let standsdata = JSON.parse(netdata.stands);
let psddata = data.psdList;
assetloader.setmodellistnew(netdata.assets);
assetloader.assetpromise(sceneload)
// .then(function(data){
// return linklist.loadpromise(loaderdata.link,sceneload,assetloader);
// })
// assetloader.setmodellistnew(netdata.assets);
// assetloader.assetpromise(sceneload)
// console.log(netdata.assets);
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList);
assetloader.assetPromiseOver(sceneload)
.then(function(data){
//console.log(data);
//,netdata.stands,mixers,actions,"0"
@ -96,39 +99,42 @@ export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist,
//console.log(assetloader);
return trainlisttest.drivertrain(mapdata.trainList,sceneload,assetloader,mixers,actions,"01");
})
// .then(function(data){
// return new Promise(function(resolve, reject){
// let stopoffset = 64;
// rails.init(sectiondata.section,sectiondata,switchdata,sceneload);
// resolve("loadrail");
//
// });
// })
.then(function(data){
return new Promise(function(resolve, reject){
let netasset = JSON.parse(netdata.assets);
if(netasset.istexture){
for(let mm=0;mm< stationstandlist.group.children.length;mm++){
let stationname = stationstandlist.group.children[mm].name;
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
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;
}
}
for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
if(scope.assetloader.modellist[mn].deviceType && scope.assetloader.modellist[mn].deviceType == "suidaobg"){
if(scope.assetloader.modellist[mn].deviceType && scope.assetloader.modellist[mn].type == "suidao"){
// scope.assetloader.modellist[mn].mesh.deviceType = "suidaobg";
scene.add(scope.assetloader.modellist[mn].mesh);
}
}
resolve("loadedsuidao");
});
})
.then(function(data){
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;
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;
}
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;
}
}
resolve("mergemodel");
});
})
@ -144,7 +150,6 @@ export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist,
//
//
scope.animateswitch = true;
// // mapdata = jlmap3ddata;
backdata.loaderdata(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails);
scope.Subscribe.updatamap(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,scope.materiallist,scope.actions,scope.sceneload);

View File

@ -1,4 +1,6 @@
export function Materialload(jlmap3dedit,assettype){
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
export function Materialload(jlmap3dedit,standTextureData){
if(jlmap3dedit.materiallist){
settexture(jlmap3dedit.materiallist,"red",'../../static/material/signal/1.jpg');
@ -9,105 +11,110 @@ export function Materialload(jlmap3dedit,assettype){
settexture( jlmap3dedit.materiallist,"black",'../../static/material/signal/5.jpg');
}
if(assettype){
if(assettype.stationtexture == "xian3"){
if(jlmap3dedit.stationtexture){
setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/xian3/xian3list.jpg');
setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/xian3/pingbimen.png');
setstationtexture(jlmap3dedit.stationtexture,"Station18000",'../../static/texture/xian3/Station18000.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station61238",'../../static/texture/xian3/Station61238.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station41790",'../../static/texture/xian3/Station41790.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station67945",'../../static/texture/xian3/Station67945.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station85598",'../../static/texture/xian3/Station85598.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station4324",'../../static/texture/xian3/Station4324.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station55755",'../../static/texture/xian3/Station55755.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station53597",'../../static/texture/xian3/Station53597.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station68029",'../../static/texture/xian3/Station68029.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station17596",'../../static/texture/xian3/Station17596.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station66742",'../../static/texture/xian3/Station66742.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station90701",'../../static/texture/xian3/Station90701.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station90652",'../../static/texture/xian3/Station90652.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station54200",'../../static/texture/xian3/Station54200.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station19253",'../../static/texture/xian3/Station19253.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station37821",'../../static/texture/xian3/Station37821.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station47557",'../../static/texture/xian3/Station47557.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station78551",'../../static/texture/xian3/Station78551.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station64474",'../../static/texture/xian3/Station64474.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station21203",'../../static/texture/xian3/Station21203.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station34499",'../../static/texture/xian3/Station34499.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station571",'../../static/texture/xian3/Station571.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station99903",'../../static/texture/xian3/Station99903.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station43447",'../../static/texture/xian3/Station43447.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station67917",'../../static/texture/xian3/Station67917.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station60649",'../../static/texture/xian3/Station60649.jpg');
}
}
if(assettype.stationtexture == "haerbin1"){
if(jlmap3dedit.stationtexture){
setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/heb/haerbinlist.jpg');
setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/heb/pingbimen.png');
setstationtexture(jlmap3dedit.stationtexture,"Station5361",'../../static/texture/heb/Station5361.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station11094",'../../static/texture/heb/Station11094.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station11136",'../../static/texture/heb/Station11136.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station17293",'../../static/texture/heb/Station17293.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station18398",'../../static/texture/heb/Station18398.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station22163",'../../static/texture/heb/Station22163.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station25464",'../../static/texture/heb/Station25464.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station28090",'../../static/texture/heb/Station28090.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station41999",'../../static/texture/heb/Station41999.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station44338",'../../static/texture/heb/Station44338.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station46464",'../../static/texture/heb/Station46464.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station50565",'../../static/texture/heb/Station50565.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station60068",'../../static/texture/heb/Station60068.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station62429",'../../static/texture/heb/Station62429.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station64444",'../../static/texture/heb/Station64444.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station71700",'../../static/texture/heb/Station71700.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station72132",'../../static/texture/heb/Station72132.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station78164",'../../static/texture/heb/Station78164.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station79537",'../../static/texture/heb/Station79537.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station82618",'../../static/texture/heb/Station82618.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station85520",'../../static/texture/heb/Station85520.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station89483",'../../static/texture/heb/Station89483.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station96090",'../../static/texture/heb/Station96090.jpg');
}
}
if(assettype.stationtexture == "nb1"){
if(jlmap3dedit.stationtexture){
setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/nb1/nb1list.jpg');
setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/nb1/pingbimen.png');
setstationtexture(jlmap3dedit.stationtexture,"Station1533",'../../static/texture/nb1/Station1533.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station11231",'../../static/texture/nb1/Station11231.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station12421",'../../static/texture/nb1/Station12421.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station16356",'../../static/texture/nb1/Station16356.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station18678",'../../static/texture/nb1/Station18678.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station19817",'../../static/texture/nb1/Station19817.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station23567",'../../static/texture/nb1/Station23567.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station24903",'../../static/texture/nb1/Station24903.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station26416",'../../static/texture/nb1/Station26416.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station27207",'../../static/texture/nb1/Station27207.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station28032",'../../static/texture/nb1/Station28032.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station28958",'../../static/texture/nb1/Station28958.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station30520",'../../static/texture/nb1/Station30520.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station32955",'../../static/texture/nb1/Station32955.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station38286",'../../static/texture/nb1/Station38286.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station38674",'../../static/texture/nb1/Station38674.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station44173",'../../static/texture/nb1/Station44173.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station63100",'../../static/texture/nb1/Station63100.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station69378",'../../static/texture/nb1/Station69378.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station72310",'../../static/texture/nb1/Station72310.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station72764",'../../static/texture/nb1/Station72764.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station75414",'../../static/texture/nb1/Station75414.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station75494",'../../static/texture/nb1/Station75494.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station75703",'../../static/texture/nb1/Station75703.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station78392",'../../static/texture/nb1/Station78392.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station81700",'../../static/texture/nb1/Station81700.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station84098",'../../static/texture/nb1/Station84098.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station86112",'../../static/texture/nb1/Station86112.jpg');
setstationtexture(jlmap3dedit.stationtexture,"Station99584",'../../static/texture/nb1/Station99584.jpg');
}
}
}
if(standTextureData.urls.length > 1){
for(let i=0,leni=standTextureData.urls.length;i<leni;i++){
setstationtexture(jlmap3dedit.stationtexture,standTextureData.urls[i].name,BASE_ASSET_API + standTextureData.urls[i].url);
}
}
//
// if(assettype){
// if(assettype.stationtexture == "xian3"){
// if(jlmap3dedit.stationtexture){
// setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/xian3/xian3list.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/xian3/pingbimen.png');
// setstationtexture(jlmap3dedit.stationtexture,"Station18000",'../../static/texture/xian3/Station18000.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station61238",'../../static/texture/xian3/Station61238.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station41790",'../../static/texture/xian3/Station41790.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station67945",'../../static/texture/xian3/Station67945.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station85598",'../../static/texture/xian3/Station85598.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station4324",'../../static/texture/xian3/Station4324.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station55755",'../../static/texture/xian3/Station55755.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station53597",'../../static/texture/xian3/Station53597.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station68029",'../../static/texture/xian3/Station68029.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station17596",'../../static/texture/xian3/Station17596.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station66742",'../../static/texture/xian3/Station66742.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station90701",'../../static/texture/xian3/Station90701.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station90652",'../../static/texture/xian3/Station90652.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station54200",'../../static/texture/xian3/Station54200.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station19253",'../../static/texture/xian3/Station19253.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station37821",'../../static/texture/xian3/Station37821.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station47557",'../../static/texture/xian3/Station47557.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station78551",'../../static/texture/xian3/Station78551.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station64474",'../../static/texture/xian3/Station64474.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station21203",'../../static/texture/xian3/Station21203.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station34499",'../../static/texture/xian3/Station34499.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station571",'../../static/texture/xian3/Station571.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station99903",'../../static/texture/xian3/Station99903.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station43447",'../../static/texture/xian3/Station43447.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station67917",'../../static/texture/xian3/Station67917.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station60649",'../../static/texture/xian3/Station60649.jpg');
// }
// }
// if(assettype.stationtexture == "haerbin1"){
// if(jlmap3dedit.stationtexture){
// setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/heb/haerbinlist.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/heb/pingbimen.png');
// setstationtexture(jlmap3dedit.stationtexture,"Station5361",'../../static/texture/heb/Station5361.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station11094",'../../static/texture/heb/Station11094.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station11136",'../../static/texture/heb/Station11136.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station17293",'../../static/texture/heb/Station17293.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station18398",'../../static/texture/heb/Station18398.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station22163",'../../static/texture/heb/Station22163.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station25464",'../../static/texture/heb/Station25464.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station28090",'../../static/texture/heb/Station28090.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station41999",'../../static/texture/heb/Station41999.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station44338",'../../static/texture/heb/Station44338.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station46464",'../../static/texture/heb/Station46464.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station50565",'../../static/texture/heb/Station50565.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station60068",'../../static/texture/heb/Station60068.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station62429",'../../static/texture/heb/Station62429.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station64444",'../../static/texture/heb/Station64444.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station71700",'../../static/texture/heb/Station71700.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station72132",'../../static/texture/heb/Station72132.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station78164",'../../static/texture/heb/Station78164.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station79537",'../../static/texture/heb/Station79537.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station82618",'../../static/texture/heb/Station82618.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station85520",'../../static/texture/heb/Station85520.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station89483",'../../static/texture/heb/Station89483.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station96090",'../../static/texture/heb/Station96090.jpg');
// }
// }
// if(assettype.stationtexture == "nb1"){
// if(jlmap3dedit.stationtexture){
// setstationtexture(jlmap3dedit.stationtexture,"stationlist",'../../static/texture/nb1/nb1list.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"pingbimen",'../../static/texture/nb1/pingbimen.png');
// setstationtexture(jlmap3dedit.stationtexture,"Station1533",'../../static/texture/nb1/Station1533.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station11231",'../../static/texture/nb1/Station11231.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station12421",'../../static/texture/nb1/Station12421.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station16356",'../../static/texture/nb1/Station16356.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station18678",'../../static/texture/nb1/Station18678.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station19817",'../../static/texture/nb1/Station19817.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station23567",'../../static/texture/nb1/Station23567.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station24903",'../../static/texture/nb1/Station24903.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station26416",'../../static/texture/nb1/Station26416.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station27207",'../../static/texture/nb1/Station27207.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station28032",'../../static/texture/nb1/Station28032.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station28958",'../../static/texture/nb1/Station28958.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station30520",'../../static/texture/nb1/Station30520.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station32955",'../../static/texture/nb1/Station32955.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station38286",'../../static/texture/nb1/Station38286.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station38674",'../../static/texture/nb1/Station38674.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station44173",'../../static/texture/nb1/Station44173.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station63100",'../../static/texture/nb1/Station63100.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station69378",'../../static/texture/nb1/Station69378.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station72310",'../../static/texture/nb1/Station72310.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station72764",'../../static/texture/nb1/Station72764.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station75414",'../../static/texture/nb1/Station75414.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station75494",'../../static/texture/nb1/Station75494.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station75703",'../../static/texture/nb1/Station75703.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station78392",'../../static/texture/nb1/Station78392.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station81700",'../../static/texture/nb1/Station81700.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station84098",'../../static/texture/nb1/Station84098.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station86112",'../../static/texture/nb1/Station86112.jpg');
// setstationtexture(jlmap3dedit.stationtexture,"Station99584",'../../static/texture/nb1/Station99584.jpg');
// }
// }
// }
//console.log(jlmap3dedit.materiallist);
}

View File

@ -47,7 +47,8 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
}
function initnew3d(data,netdata){
Materialload(scope,JSON.parse(netdata.assets));
// console.log(JSON.parse(netdata.assets));
Materialload(scope,JSON.parse(netdata.assets).stationTextureList[0]);
let mapdata = data;
//初始化轨道和道岔
// lengthfact(data);
@ -69,12 +70,12 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
let signaldata = JSON.parse(netdata.signals);
let standsdata = JSON.parse(netdata.stands);
let psddata = data.psdList;
assetloader.setmodellistnew(netdata.assets);
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList);
// assetloader.setmodellistnew(netdata.assets);
assetloader.assetpromise(sceneload)
// .then(function(data){
// return linklist.loadpromise(loaderdata.link,sceneload,assetloader);
// })
// assetloader.assetpromise(sceneload)
assetloader.assetPromiseOver(sceneload)
.then(function(data){
//console.log(data);
//,netdata.stands,mixers,actions,"0"
@ -97,19 +98,24 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
//console.log(assetloader);
return trainlisttest.initpromise(mapdata.trainList,sceneload,assetloader,mixers,actions,"02");
})
// .then(function(data){
// return new Promise(function(resolve, reject){
// rails.init(sectiondata.section,sectiondata,switchdata,sceneload);
// resolve("loadrail");
//
// });
// })
.then(function(data){
return new Promise(function(resolve, reject){
//
let netasset = JSON.parse(netdata.assets);
if(netasset.istexture){
for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
if(scope.assetloader.modellist[mn].type == "suidao"){
// scope.assetloader.modellist[mn].mesh.deviceType = "suidaobg";
scene.add(scope.assetloader.modellist[mn].mesh);
mn = scope.assetloader.modellist.length;
}
}
resolve("loadsuidao");
});
})
.then(function(data){
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;
stationstandlist.group.children[mm].getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
@ -132,35 +138,12 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
}
for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
if(scope.assetloader.modellist[mn].deviceType && scope.assetloader.modellist[mn].deviceType == "suidaobg"){
// scope.assetloader.modellist[mn].mesh.deviceType = "suidaobg";
scene.add(scope.assetloader.modellist[mn].mesh);
}
}
// console.log(stationstandlist.group.children[0].name );
// if(stationstandlist.group.children[0].name == "Station75414"){
// for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
// if(scope.assetloader.modellist[mn].name && scope.assetloader.modellist[mn].name == "nbsuidao"){
// scope.assetloader.modellist[mn].mesh.name = "nbsuidao";
// scene.add(scope.assetloader.modellist[mn].mesh);
// }
// }
// }
resolve("mergemodel");
});
})
.then(function(data){
// for(let mn=0;mn<scope.assetloader.modellist.length;mn++){
// if(scope.assetloader.modellist[mn].name && scope.assetloader.modellist[mn].name == "suidao"){
// // scope.assetloader.modellist[mn].mesh.rotation.x = Math.PI/2;
// // scope.assetloader.modellist[mn].mesh.position.y -=0.1;
// // console.log(scope.assetloader.modellist[mn].mesh);
// scene.add(scope.assetloader.modellist[mn].mesh);
// }
// }
//
// // mapdata = jlmap3ddata;
backdata.loaderdata(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails);
scope.Subscribe.updatamap(sectionlist,linklist,signallist,stationstandlist,trainlisttest,realsectionlist,rails,scope.materiallist,scope.actions,scope.sceneload);
scope.webwork.postMessage("on");

View File

@ -11,9 +11,7 @@ export function AssetModel(data){
this.type = data.type;
this.type = null;
this.assetUrl = data.assetUrl;
this.url = data.url;
this.mesh = null;

View File

@ -18,7 +18,9 @@ export function SectionListN() {
this.standtrack = [];
var autorail;
this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){
// console.log(sectiondata);
console.log("-------------------");
console.log(sectiondata);
console.log(rails);
var texture = new THREE.TextureLoader().load( '../../static/test/z0251.png' );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 1,1);
@ -48,6 +50,7 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){
// console.log(sectiondata);
let mergegeometry = new THREE.Geometry();
for(let i=0,leni = sectiondata.length;i<leni;i++){
let newsection = {
code:sectiondata[i].code,
name:sectiondata[i].name,

View File

@ -22,7 +22,7 @@ export function SignalListN() {
let newsignal = new SignalModel(signaldata[i]);
let selectmesh = null;
for(let j=0;j<assetloader.modellist.length;j++){
if(assetloader.modellist[j].deviceType == "signal"){
if(assetloader.modellist[j].type == "signal"){
selectmesh = assetloader.modellist[j].mesh;
}
}

View File

@ -139,18 +139,20 @@ export function StationStandListN() {
let selectmesh1;
let selectmesh2;
let selectmesh3;
console.log(assetloader.modellist);
for(let j=0;j<assetloader.modellist.length;j++){
if(assetloader.modellist[j].deviceType == "stand"){
if(assetloader.modellist[j].type == "stationInside"){
selectmesh1 = assetloader.modellist[j].mesh;
}
if(assetloader.modellist[j].deviceType == "standwaice"){
if(assetloader.modellist[j].type == "stationOutside"){
selectmesh2 = assetloader.modellist[j].mesh;
// assetloader.modellist[num2].mesh.rotation.y = Math.PI/2;
}
if(assetloader.modellist[j].deviceType == "station3"){
if(assetloader.modellist[j].type == "stationThree"){
selectmesh3 = assetloader.modellist[j].mesh;
// assetloader.modellist[num2].mesh.rotation.y = Math.PI/2;
}
}
for(let i=0;i<standsdata.length;i++){
let newstationstand = new StationStandModel(standsdata[i]);

View File

@ -20,7 +20,7 @@ export function SwitchListN() {
// console.log(sectiondata);
let num;
for(let j=0;j<assetloader.modellist.length;j++){
if(assetloader.modellist[j].deviceType == "autoswitch"){
if(assetloader.modellist[j].type == "switch"){
num = j;
}
};

View File

@ -19,7 +19,7 @@ export function TrainListN() {
let selectmesh,ntracks1,ntracks2,tclip,fclip;
for(let n=assetloader.modellist.length-1;n>=0;n--){
if(assetloader.modellist[n].deviceType == "train"){
if(assetloader.modellist[n].type == "train"){
selectmesh = assetloader.modellist[n].mesh
@ -152,7 +152,7 @@ export function TrainListN() {
return new Promise(function(resolve, reject){
let selectmesh,ntracks1,ntracks2,tclip,fclip;
for(let n=assetloader.modellist.length-1;n>=0;n--){
if(assetloader.modellist[n].deviceType == "train"){
if(assetloader.modellist[n].type == "train"){
selectmesh = assetloader.modellist[n].mesh

View File

@ -4,7 +4,7 @@ export function getBaseUrl() {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';

View File

@ -321,64 +321,59 @@
if(mx<px&&my<py){//鼠标在第二象限
angle = 360 - angle;
}
console.log(angle);
console.log(this.userRole );
if(angle<127 && angle>46){
if(this.userRole == "DRIVER"){
if(angle<63 && angle>46){
if(this.touchstate != "Drive"){
let data = {
groupNumber:this.groupNum,
gear:"Drive"
};
trainSimulationGear(this.group,data).then(netdata => {
console.log(netdata);
if(netdata.code == "200"){
this.toutransform = "rotate(140deg)";
this.touchstate = "Drive";
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
}
});
}
}else if(angle<93 && angle>68){
if(this.touchstate != "Neutral"){
let data = {
groupNumber:this.groupNum,
gear:"Neutral"
};
trainSimulationGear(this.group,data).then(netdata => {
if(netdata.code == "200"){
this.toutransform = "rotate(175deg)";
this.touchstate = "Neutral";
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
}
});
}
}else if(angle<127 && angle>101){
if(this.touchstate != "Reverse"){
let data = {
groupNumber:this.groupNum,
gear:"Reverse"
};
trainSimulationGear(this.group,data).then(netdata => {
if(netdata.code == "200"){
this.toutransform = "rotate(205deg)";
this.touchstate = "Reverse";
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
}
});
}
if(angle<63 && angle>46){
if(this.touchstate != "Drive"){
let data = {
groupNumber:this.groupNum,
gear:"Drive"
};
trainSimulationGear(this.group,data).then(netdata => {
console.log(netdata);
if(netdata.code == "200"){
this.toutransform = "rotate(140deg)";
this.touchstate = "Drive";
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
}
});
}
}else if(angle<93 && angle>68){
if(this.touchstate != "Neutral"){
let data = {
groupNumber:this.groupNum,
gear:"Neutral"
};
trainSimulationGear(this.group,data).then(netdata => {
if(netdata.code == "200"){
this.toutransform = "rotate(175deg)";
this.touchstate = "Neutral";
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
}
});
}
}else if(angle<127 && angle>101){
if(this.touchstate != "Reverse"){
let data = {
groupNumber:this.groupNum,
gear:"Reverse"
};
trainSimulationGear(this.group,data).then(netdata => {
if(netdata.code == "200"){
this.toutransform = "rotate(205deg)";
this.touchstate = "Reverse";
document.getElementById("directimg").onmousemove = null;
document.getElementById("directimg").onmouseup = null;
}
});
}
}
}
},

View File

@ -192,10 +192,7 @@ import axios from 'axios';
this.tuoguanbuttonmsg = "托管";
}
this.$store.dispatch('training/updateMemberTrust', {deviceCode:code,trust:trustStatus});
}
},
updatetrainlist(){
getSimulationTrainlistNew(this.group).then(netdata => {

View File

@ -114,26 +114,6 @@
</div>
</el-tab-pane>
<el-tab-pane label="cctv模型配置" name="cctvEdit">
<div class= "editmodelconfig" :class="{active:index==isActive}" v-for="(asset,index) in cctvAssetList" @click="assetSelect(cctvAssetList[index],index)">
<div>{{asset.assetname}}</div>
<div>
资源id:
<el-input v-model="asset.id"></el-input>
</div>
<div>
资源名称:
<el-input v-model="asset.packageName"></el-input>
</div>
<div>
资源地址:
<el-input v-model="asset.url"></el-input>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="通号模型配置" name="maintainerEdit">
<div class= "editmodelconfig" :class="{active:index==isActive}" v-for="(asset,index) in maintainerAssetList" @click="assetSelect(maintainerAssetList[index],index)">
<div>{{asset.assetname}}</div>
@ -152,6 +132,23 @@
</div>
</el-tab-pane>
<el-tab-pane label="cctv模型配置" name="cctvEdit">
<div class= "editmodelconfig" :class="{active:index==isActive}" v-for="(asset,index) in cctvAssetList" @click="assetSelect(cctvAssetList[index],index)">
<div>{{asset.assetname}}</div>
<div>
资源id:
<el-input v-model="asset.id"></el-input>
</div>
<div>
资源名称:
<el-input v-model="asset.packageName"></el-input>
</div>
<div>
资源地址:
<el-input v-model="asset.url"></el-input>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="车站名称列表贴图" name="stationTextures">
<div class= "editmodelconfig" :class="{active:index==isActive}" v-for="(asset,index) in stationTextureList" @click="assetSelect(stationTextureList[index],index)">
@ -238,8 +235,8 @@ export default {
},
mounted() {
window.updateSelectAsset = this.updateSelectAsset;
window.updateEditSelectAsset = this.updateEditSelectAsset;
window.loadEditAllAsset = this.loadEditAllAsset;
},
methods: {
@ -287,45 +284,103 @@ export default {
this.isActive=index;
this.nowSelect = index;
},
loadEditAllAsset(netData){
console.log(netData);
if(netData.sceneAssetList){
for(let i=0,leni=netData.driverAssetList.length;i<leni;i++){
this.driverAssetList[i].assetname = netData.driverAssetList[i].assetname;
this.driverAssetList[i].id = netData.driverAssetList[i].id;
this.driverAssetList[i].packageName = netData.driverAssetList[i].packageName;
this.driverAssetList[i].deviceType = netData.driverAssetList[i].deviceType;
this.driverAssetList[i].type = netData.driverAssetList[i].type;
this.driverAssetList[i].url = netData.driverAssetList[i].url;
}
for(let i=0,leni=netData.sceneAssetList.length;i<leni;i++){
this.sceneAssetList[i].assetname = netData.sceneAssetList[i].assetname;
this.sceneAssetList[i].id = netData.sceneAssetList[i].id;
this.sceneAssetList[i].packageName = netData.sceneAssetList[i].packageName;
this.sceneAssetList[i].deviceType = netData.sceneAssetList[i].deviceType;
this.sceneAssetList[i].type = netData.sceneAssetList[i].type;
this.sceneAssetList[i].url = netData.sceneAssetList[i].url;
// this.driverAssetList[i].assetname = netData.sceneAssetList[i].assetname;
// this.driverAssetList[i].id = netData.sceneAssetList[i].id;
// this.driverAssetList[i].packageName = netData.sceneAssetList[i].packageName;
// this.driverAssetList[i].deviceType = netData.sceneAssetList[i].deviceType;
// this.driverAssetList[i].type = netData.sceneAssetList[i].type;
// this.driverAssetList[i].url = netData.sceneAssetList[i].url;
}
for(let i=0,leni=netData.deviceAssetList.length;i<leni;i++){
this.deviceAssetList[i].assetname = netData.deviceAssetList[i].assetname;
this.deviceAssetList[i].id = netData.deviceAssetList[i].id;
this.deviceAssetList[i].packageName = netData.deviceAssetList[i].packageName;
this.deviceAssetList[i].deviceType = netData.deviceAssetList[i].deviceType;
this.deviceAssetList[i].type = netData.deviceAssetList[i].type;
this.deviceAssetList[i].url = netData.deviceAssetList[i].url;
}
for(let i=0,leni=netData.maintainerAssetList.length;i<leni;i++){
this.maintainerAssetList[i].assetname = netData.maintainerAssetList[i].assetname;
this.maintainerAssetList[i].id = netData.maintainerAssetList[i].id;
this.maintainerAssetList[i].packageName = netData.maintainerAssetList[i].packageName;
this.maintainerAssetList[i].deviceType = netData.maintainerAssetList[i].deviceType;
this.maintainerAssetList[i].type = netData.maintainerAssetList[i].type;
this.maintainerAssetList[i].url = netData.maintainerAssetList[i].url;
}
for(let i=0,leni=netData.cctvAssetList.length;i<leni;i++){
this.cctvAssetList[i].assetname = netData.cctvAssetList[i].assetname;
this.cctvAssetList[i].id = netData.cctvAssetList[i].id;
this.cctvAssetList[i].packageName = netData.cctvAssetList[i].packageName;
this.cctvAssetList[i].deviceType = netData.cctvAssetList[i].deviceType;
this.cctvAssetList[i].type = netData.cctvAssetList[i].type;
this.cctvAssetList[i].url = netData.cctvAssetList[i].url;
}
//
//
this.stationTextureList[0].id = netData.stationTextureList[0].id;
this.stationTextureList[0].packageName = netData.stationTextureList[0].packageName;
this.stationTextureList[0].fileType = netData.stationTextureList[0].fileType;
this.stationTextureList[0].resourceType = netData.stationTextureList[0].resourceType
this.stationTextureList[0].urls = netData.stationTextureList[0].urls;
this.changeAssetList();
}
},
//
updateSelectAsset(selectData){
updateEditSelectAsset(selsetAsset,selectData){
console.log(selectData);
if(this.nowSelect != null){
if(selectData.fileType == "model"){
if(selectData.resourceType == "SandboxScene"){
if(selsetAsset == "sceneEdit"){
this.sceneAssetList[this.nowSelect].id = selectData.id;
this.sceneAssetList[this.nowSelect].packageName = selectData.packageName;
this.sceneAssetList[this.nowSelect].type = selectData.deviceType;
this.sceneAssetList[this.nowSelect].deviceType = selectData.deviceType;
this.sceneAssetList[this.nowSelect].url = selectData.url;
console.log(this.sceneAssetList);
}
if(selectData.resourceType == "DriveScene"){
if(selsetAsset == "driveEdit"){//DriveScene
this.driverAssetList[this.nowSelect].id = selectData.id;
this.driverAssetList[this.nowSelect].packageName = selectData.packageName;
this.driverAssetList[this.nowSelect].type = selectData.deviceType;
this.driverAssetList[this.nowSelect].deviceType = selectData.deviceType;
this.driverAssetList[this.nowSelect].url = selectData.url;
console.log(this.driverAssetList);
}
if(selectData.resourceType == "DeviceScene"){
if(selsetAsset == "deviceEdit"){
this.deviceAssetList[this.nowSelect].id = selectData.id;
this.deviceAssetList[this.nowSelect].packageName = selectData.packageName;
this.deviceAssetList[this.nowSelect].type = selectData.deviceType;
this.deviceAssetList[this.nowSelect].deviceType = selectData.deviceType;
this.deviceAssetList[this.nowSelect].url = selectData.url;
console.log(this.deviceAssetList);
}
if(selectData.resourceType == "CctvScene"){
this.cctvAssetList[this.nowSelect].id = selectData.id;
this.cctvAssetList[this.nowSelect].packageName = selectData.packageName;
this.cctvAssetList[this.nowSelect].type = selectData.deviceType;
this.cctvAssetList[this.nowSelect].url = selectData.url;
console.log(this.cctvAssetList);
}
if(selectData.resourceType == "MaintainerScene"){
if(selsetAsset == "maintainerEdit"){//MaintainerScene
this.maintainerAssetList[this.nowSelect].id = selectData.id;
this.maintainerAssetList[this.nowSelect].packageName = selectData.packageName;
this.maintainerAssetList[this.nowSelect].type = selectData.deviceType;
this.maintainerAssetList[this.nowSelect].deviceType = selectData.deviceType;
this.maintainerAssetList[this.nowSelect].url = selectData.url;
console.log(this.maintainerAssetList);
}
if(selsetAsset == "cctvEdit"){
this.cctvAssetList[this.nowSelect].id = selectData.id;
this.cctvAssetList[this.nowSelect].packageName = selectData.packageName;
this.cctvAssetList[this.nowSelect].deviceType = selectData.deviceType;
this.cctvAssetList[this.nowSelect].url = selectData.url;
}
}
@ -333,19 +388,21 @@ export default {
if(selectData.resourceType == "textureStation"){
this.stationTextureList[this.nowSelect].id = selectData.id;
this.stationTextureList[this.nowSelect].packageName = selectData.packageName;
this.stationTextureList[this.nowSelect].type = selectData.deviceType;
this.stationTextureList[this.nowSelect].fileType = selectData.fileType;
this.stationTextureList[this.nowSelect].resourceType = selectData.resourceType
this.stationTextureList[this.nowSelect].urls = selectData.urls;
console.log(this.stationTextureList);
}
if(selectData.resourceType == "textureSignal"){
this.signalTextureAssetList[this.nowSelect].id = selectData.id;
this.signalTextureAssetList[this.nowSelect].packageName = selectData.packageName;
this.signalTextureAssetList[this.nowSelect].type = selectData.deviceType;
this.signalTextureAssetList[this.nowSelect].deviceType = selectData.deviceType;
console.log(this.signalTextureAssetList);
}
if(selectData.resourceType == "textureDevice"){
this.deviceTextureList[this.nowSelect].id = selectData.id;
this.deviceTextureList[this.nowSelect].packageName = selectData.packageName;
this.deviceTextureList[this.nowSelect].type = selectData.deviceType;
this.deviceTextureList[this.nowSelect].deviceType = selectData.deviceType;
this.$emit('changeAsset',this.modelList[index]);
console.log(this.deviceTextureList);
}
@ -353,6 +410,10 @@ export default {
}
}
this.changeAssetList();
},
changeAssetList(){
this.assetListAll ={
driverAssetList:this.driverAssetList,
sceneAssetList:this.sceneAssetList,
@ -364,7 +425,6 @@ export default {
signalTextureAssetList:this.signalTextureAssetList
};
changeEditAssetList(this.assetListAll);
console.log(this.assetListAll);
},
actionevent(event){
console.log(event.currentTarget.id);

View File

@ -6,7 +6,7 @@
<el-tab-pane label="资源" name="models">
<el-scrollbar style="margin-bottom:1px">
<el-form ref="form" label-width="130px" size="mini">
<div class="modellist" v-for="(asset,index) in nowassetlist" @click="modelSelect(index)">
<div class="modellist" v-for="(asset,index) in nowAssetList" @click="modelSelect(index)">
<div >
<img class="modelpic" draggable="true" >
<div class="modelid">资源ID:{{asset.id }}</div>
@ -41,7 +41,8 @@ export default {
data() {
return {
activeName: 'models',
nowassetlist: '',
nowAssetList: '',
nowAssetName:'',
filterText: '',
defaultProps: {
children: 'children',
@ -80,9 +81,9 @@ export default {
mounted() {
window.updateAssetList = this.updateAssetList;
this.assetList.model["sceneEdit"] = [];
this.assetList.model["driveEdit"] = [];
// this.assetList.model["driveEdit"] = [];
this.assetList.model["deviceEdit"] = [];
this.assetList.model["maintainerEdit"] = [];
// this.assetList.model["maintainerEdit"] = [];
this.assetList.model["cctvEdit"] = [];
this.assetList.texture["stationTextures"] = [];
@ -99,13 +100,13 @@ export default {
this.assetList.model["sceneEdit"].push(assetdata[i]);
}
if(assetdata[i].resourceType == "DriveScene"){
this.assetList.model["driveEdit"].push(assetdata[i]);
this.assetList.model["sceneEdit"].push(assetdata[i]);
}
if(assetdata[i].resourceType == "DeviceScene"){
this.assetList.model["deviceEdit"].push(assetdata[i]);
}
if(assetdata[i].resourceType == "MaintainerScene"){
this.assetList.model["maintainerEdit"].push(assetdata[i]);
this.assetList.model["deviceEdit"].push(assetdata[i]);
}
if(assetdata[i].resourceType == "CctvScene"){
this.assetList.model["cctvEdit"].push(assetdata[i]);
@ -117,7 +118,7 @@ export default {
packageName:assetdata[i].packageName,
fileType:assetdata[i].fileType,
resourceType:assetdata[i].resourceType,
data:[]
urls:[]
}
@ -131,10 +132,14 @@ export default {
}
}
let newTextureData = {
name:assetdata[i].name.split(".")[0],
url:assetdata[i].url,
};
if(index != null){
newtexturesdata[index].data[assetdata[i].name.split(".")[0]] = assetdata[i].url;
newtexturesdata[index].urls.push(newTextureData);
}else{
newtexture.data[assetdata[i].name.split(".")[0]] = assetdata[i].url;
newtexture.urls.push(newTextureData);
newtexturesdata.push(newtexture)
}
}
@ -159,19 +164,30 @@ export default {
methods: {
modelSelect(index){
// //console.log(this.modelList);
console.log(this.nowassetlist[index]);
console.log(this.nowAssetList[index]);
// this.$emit('smodel',this.modelList[index]);
updateSelectAsset(this.nowassetlist[index]);
updateEditSelectAsset(this.nowAssetName,this.nowAssetList[index]);
},
//
updateAssetList(newdata,newtype){
console.log(newdata);
if(newtype == "model"){
this.nowassetlist = this.assetList.model[newdata];
if(newdata == "driveEdit"){
this.nowAssetName = "driveEdit";
this.nowAssetList = this.assetList.model["sceneEdit"];
}else if(newdata == "maintainerEdit"){
this.nowAssetName = "maintainerEdit";
this.nowAssetList = this.assetList.model["deviceEdit"];
}else{
this.nowAssetName = newdata;
this.nowAssetList = this.assetList.model[newdata];
}
}
if(newtype == "texture"){
this.nowassetlist = this.assetList.texture[newdata];
this.nowAssetList = this.assetList.texture[newdata];
}
console.log(this.nowassetlist);
console.log(this.nowAssetList);
},
filterNode(value, data) {
if (!value) return true;

View File

@ -122,7 +122,9 @@
},
methods: {
changeEditAssetList(newList){
this.jlmap3dedit.assetManager = newList;
console.log(this.jlmap3dedit.assetManager);
},
show: function () {
@ -182,7 +184,7 @@
},
expo() {
this.jlmap3dedit.export();
this.jlmap3dedit.exportsection();
},
save() {
//console.log("save");
@ -202,6 +204,7 @@
console.log(this.jlmap3dedit.assetManager);
let param = testgetmodels(this.jlmap3dedit);
console.log(param);
update3dMapData(param).then(data => {
//console.log(data);
if (data.code == "200") {

View File

@ -34,6 +34,8 @@
<el-option label="cctv监视器" value="CctvCamera"></el-option>
<el-option label="cctv闸机" value="CctvGate"></el-option>
<el-option label="cctv人物" value="CctvHuman"></el-option>
<el-option label="cctv列车" value="CctvTrain"></el-option>
<el-option label="cctv铁轨" value="CctvSection"></el-option>
<el-option label="通号设备间" value="MaintainerRoom"></el-option>
</el-select>

View File

@ -33,6 +33,8 @@
<el-option label="cctv监视器" value="CctvCamera"></el-option>
<el-option label="cctv闸机" value="CctvGate"></el-option>
<el-option label="cctv人物" value="CctvHuman"></el-option>
<el-option label="cctv列车" value="CctvTrain"></el-option>
<el-option label="cctv铁轨" value="CctvSection"></el-option>
<el-option label="通号设备间" value="MaintainerRoom"></el-option>
</el-select>
@ -137,7 +139,7 @@
};
for(let i=0,leni=fileList.length;i<leni;i++){
// let resdata = fileList[i].response.replace(/\\/g,"\\\\");
// console.log(resdata);
console.log(fileList[i].response.data);
data.nameAndUrl[fileList[i].name] = fileList[i].response.data;
}
console.log(data);

View File

@ -182,7 +182,7 @@
if(this.nowdevice){
let command = {
code:this.nowdevice.code,
faultType:this.nowdevice.fault[1],
faultType:this.nowdevice.fault,
};
sendCommandNew(this.group,"Cancel_Fault", command).then((response) => {
// resolve(response);

Binary file not shown.