This commit is contained in:
zyy 2020-09-18 11:08:30 +08:00
commit 733503afe6
25 changed files with 815 additions and 206 deletions

View File

@ -621,9 +621,9 @@ export function getPlcGateway(group) {
// });
// }
export function handlerIbpEvent(group, button) {
export function handlerIbpEvent(group, button, stationCode) {
return request({
url: `/simulation/${group}/ibp/${button}`,
url: `/simulation/${group}/ibp/${button}?stationCode=${stationCode}`,
method: 'put'
});
}

View File

@ -308,4 +308,10 @@ deviceRender[deviceType.FuzhouDoor] = {
zlevel: 1,
z: 4
};
// 福州通讯图符
deviceRender[deviceType.CommunicationButcher] = {
_type: deviceType.CommunicationButcher,
zlevel: 1,
z: 4
};
export default deviceRender;

View File

@ -47,7 +47,8 @@ const deviceType = {
Draught: 'Draught',
IscsImage: 'IscsImage',
OrdinaryDoor: 'OrdinaryDoor',
FuzhouDoor: 'FuzhouDoor'
FuzhouDoor: 'FuzhouDoor',
CommunicationButcher: 'CommunicationButcher'
};
export default deviceType;

View File

@ -0,0 +1,218 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import Line from 'zrender/src/graphic/shape/Line';
export default class CommunicationButcher extends Group {
constructor(device) {
super();
this.model = device.model;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this._type = device.model._type;
this._code = device.model.code;
this.create();
this.setState(this.model);
}
create() {
this.grouper = new Group({
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.add(this.grouper);
this.rect1 = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: 0,
y: 0,
width: this.model.width,
height: this.model.width * 5 / 12
},
style: {
fill: '#0F0',
stroke: '#000',
lineWidth: 2
}
});
this.rect2 = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: this.model.width / 30,
y: this.model.width * 5 / 12,
width: this.model.width - this.model.width / 15,
height: this.model.width / 30
},
style: {
fill: '#000'
}
});
this.rect3 = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: this.model.width / 4 * 3,
y: this.model.width / 8,
width: this.model.width / 7,
height: this.model.width / 12
},
style: {
fill: 'rgba(0,0,0,0)',
lineWidth: 1,
stroke: '#000'
}
});
this.line1 = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: this.model.width * 7 / 24,
y1: 0,
x2: this.model.width * 7 / 24,
y2: this.model.width * 5 / 12
},
style: {
stroke: '#000',
lineWidth: 1
}
});
this.line2 = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: this.model.width * 7 / 12,
y1: 0,
x2: this.model.width * 7 / 12,
y2: this.model.width * 5 / 12
},
style: {
stroke: '#000',
lineWidth: 1
}
});
this.line3 = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: this.model.width * 7 / 24,
y1: this.model.width * 5 / 84,
x2: this.model.width * 7 / 12,
y2: this.model.width * 5 / 84
},
style: {
stroke: '#000',
lineWidth: 1
}
});
this.line4 = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: this.model.width * 7 / 24,
y1: this.model.width * 5 / 42,
x2: this.model.width * 7 / 12,
y2: this.model.width * 5 / 42
},
style: {
stroke: '#000',
lineWidth: 1
}
});
this.line5 = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: this.model.width * 7 / 24,
y1: this.model.width * 5 / 28,
x2: this.model.width * 7 / 12,
y2: this.model.width * 5 / 28
},
style: {
stroke: '#000',
lineWidth: 1
}
});
this.line6 = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: this.model.width * 7 / 24,
y1: this.model.width * 5 / 21,
x2: this.model.width * 7 / 12,
y2: this.model.width * 5 / 21
},
style: {
stroke: '#000',
lineWidth: 1
}
});
this.line7 = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: this.model.width * 7 / 24,
y1: this.model.width * 25 / 84,
x2: this.model.width * 7 / 12,
y2: this.model.width * 25 / 84
},
style: {
stroke: '#000',
lineWidth: 1
}
});
this.line8 = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: this.model.width * 7 / 24,
y1: this.model.width * 5 / 14,
x2: this.model.width * 7 / 12,
y2: this.model.width * 5 / 14
},
style: {
stroke: '#000',
lineWidth: 1
}
});
this.line9 = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: this.model.width * 3 / 4,
y1: this.model.width / 6,
x2: this.model.width * 25 / 28,
y2: this.model.width / 6
},
style: {
stroke: '#000',
lineWidth: 1
}
});
this.grouper.add(this.rect1);
this.grouper.add(this.rect2);
this.grouper.add(this.rect3);
this.grouper.add(this.line1);
this.grouper.add(this.line2);
this.grouper.add(this.line3);
this.grouper.add(this.line4);
this.grouper.add(this.line5);
this.grouper.add(this.line6);
this.grouper.add(this.line7);
this.grouper.add(this.line8);
this.grouper.add(this.line9);
this.add(this.grouper);
}
setState(model) {
if (model.state === 'normal') {
this.rect1.setStyle({fill: '#0F0'});
} else if (model.state === 'fault') {
this.rect1.setStyle({fill: '#F00'});
} else if (model.state === 'unknow') {
this.rect1.setStyle({fill: '#00F'});
}
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -48,6 +48,7 @@ import Draught from './bas/draught';
import IscsImage from './iscsImage';
import OrdinaryDoor from './ordinaryDoor';
import FuzhouDoor from './fuzhouDoor';
import CommunicationButcher from './communicationButcher';
const iscsShape = {};
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
@ -100,6 +101,7 @@ iscsShape[deviceType.Draught] = Draught;
iscsShape[deviceType.IscsImage] = IscsImage;
iscsShape[deviceType.OrdinaryDoor] = OrdinaryDoor;
iscsShape[deviceType.FuzhouDoor] = FuzhouDoor;
iscsShape[deviceType.CommunicationButcher] = CommunicationButcher;
function shapefactory(device, iscs) {
const type = device.model._type;

View File

@ -18,7 +18,6 @@ export default class fuzhouDoor extends Group {
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.add(this.grouper);
this.door = new Rect({
zlevel: this.zlevel,
z: this.z,
@ -29,7 +28,9 @@ export default class fuzhouDoor extends Group {
height: this.model.width * 25 / 16
},
style: {
fill: '#33CC00'// D3D0C9
fill: '#33CC00',
stroke: '#000',
lineWidth: 2
}
});
this.doorWindow = new Rect({
@ -49,10 +50,10 @@ export default class fuzhouDoor extends Group {
zlevel: this.zlevel,
z: this.z,
shape: {
x: this.model.width * 13 / 17,
y: this.model.width * 21 / 17,
width: this.model.width / 17,
height: this.model.width / 17
x: this.model.width * 12 / 17,
y: this.model.width * 20 / 17,
width: this.model.width / 9,
height: this.model.width / 9
},
style: {
fill: '#000'
@ -64,7 +65,7 @@ export default class fuzhouDoor extends Group {
shape: {
points:[
[0, 0],
[this.model.width * 3 / 4, this.model.width * 5 / 16],
[this.model.width * 3 / 4, this.model.width * 7 / 24],
[this.model.width * 3 / 4, this.model.width * 7 / 4],
[0, this.model.width * 25 / 16]
]
@ -80,10 +81,10 @@ export default class fuzhouDoor extends Group {
z: this.z + 2,
shape: {
points: [
[this.model.width / 6, this.model.width / 4],
[this.model.width * 2 / 3, this.model.width * 5 / 12],
[this.model.width / 6, this.model.width * 7 / 12],
[this.model.width * 2 / 3, this.model.width * 2 / 3]
[this.model.width / 8, this.model.width / 4],
[this.model.width * 5 / 8, this.model.width * 5 / 12],
[this.model.width * 5 / 8, this.model.width * 3 / 4],
[this.model.width / 8, this.model.width * 7 / 12]
]
},
style: {
@ -95,10 +96,10 @@ export default class fuzhouDoor extends Group {
z: this.z + 2,
shape: {
points: [
[this.model.width * 11 / 24, this.model.width * 55 / 48],
[this.model.width / 3, this.model.width * 29 / 24],
[this.model.width * 11 / 24, this.model.width * 5 / 4],
[this.model.width / 3, this.model.width * 21 / 16]
[this.model.width * 5 / 12, this.model.width * 55 / 48],
[this.model.width * 14 / 24, this.model.width * 29 / 24],
[this.model.width * 14 / 24, this.model.width * 21 / 16],
[this.model.width * 5 / 12, this.model.width * 5 / 4]
]
},
style: {
@ -120,12 +121,12 @@ export default class fuzhouDoor extends Group {
}
setState(model) {
if (model.doorOpen) {
this.door.setStyle({fill: 'D3D0C9'});
this.door.setStyle({fill: '#D3D0C9'});
this.polygon1.show();
this.polygon2.show();
this.polygon3.show();
} else {
this.door.setStyle({fill: 'D3D0C9'});
this.door.setStyle({fill: '#0F0'});
this.doorWindow.show();
this.doorknob.show();
}

View File

@ -190,6 +190,9 @@ export function parser(data) {
zrUtil.each(data.fuzhoudoorList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.FuzhouDoor, elem);
});
zrUtil.each(data.communicationButcherList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.CommunicationButcher, elem);
});
}
return iscsDevice;

View File

@ -986,9 +986,10 @@ export function SectionList() {
}
console.log(scope.sections.datalist);
for(let i=0;i<section2d.length;i++){
if(section2d[i].type == "01" || section2d[i].type == "03"){
if(scope.sections.datalist[section2d[i].code]){
scope.sections.datalist[section2d[i].code].rsection = section2d[i].rightSectionCode;
scope.sections.datalist[section2d[i].code].lsection = section2d[i].leftSectionCode;
scope.sections.datalist[section2d[i].code].points = section2d[i].points;
@ -1004,6 +1005,8 @@ export function SectionList() {
}
}
}
}
//连接区段

View File

@ -15,6 +15,10 @@ export function SectionModel(data) {
this.isStandTrack = null;
this.rsection = null;
this.lsection = null;
this.type = null;
//指向模型
this.mesh = null;

View File

@ -277,10 +277,10 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
function setpsdstationmap(stationlist){
for(let i=0,leni=stationlist.length;i<leni;i++){
psdtexturemap[stationlist[i].direction1.code] = stationlist[i].code;
psdtexturemap[stationlist[i].direction2.code] = stationlist[i].code;
psdtexturemap[stationlist[i].direction1.name] = stationlist[i].code;
psdtexturemap[stationlist[i].direction2.name] = stationlist[i].code;
psdtexturemap[stationlist[i].stands[0].code] = stationlist[i].code;
psdtexturemap[stationlist[i].stands[1].code] = stationlist[i].code;
psdtexturemap[stationlist[i].stands[0].name] = stationlist[i].code;
psdtexturemap[stationlist[i].stands[1].name] = stationlist[i].code;
}
}

View File

@ -114,7 +114,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
// 地图模型数据
let mapdata = new Jl3ddata();
let camera = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 1, 400);
let camera = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 0.1, 400);
camera.position.set( 0, 0, 0 );
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
@ -143,8 +143,8 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
// controls3.getObject().rotation.x = Math.PI/2;
scene.add(controls3.getObject());
let cameracctv = new THREE.PerspectiveCamera(50, dom.clientWidth/dom.clientHeight, 1, 50);
cameracctv.position.set( 0, -1,30 );
let cameracctv = new THREE.PerspectiveCamera(50, dom.clientWidth/dom.clientHeight, 0.1, 50);
cameracctv.position.set( 0, -0.4,29 );
// cameracctv.rotation.y = Math.PI/2;
camera.add(cameracctv);

View File

@ -508,23 +508,28 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
trainmodel.position.x = pos.x;
// trainmodel.children[0].position.z = pos.z;
if(data.right == "0"){
if(-trainmodel.children[0].position.z != pos.z){
if(-trainmodel.children[0].position.z != pos.z || trainmodel.children[0].position.y != pos.y){
trainmodel.children[0].up = new THREE.Vector3(1,0,0);
let tangent = trainmodel.curve.getTangentAt(data.offset).normalize();
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
trainmodel.children[0].rotation.x = -Math.PI/2;
let newRotationZ = trainmodel.children[0].rotation.z;
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
trainmodel.children[0].rotation.y = 0;
trainmodel.children[0].rotation.y = -newRotationZ;
let rotas = {
posr:pos,
rota:trainmodel.children[0].rotation.z
roty:trainmodel.children[0].rotation.y,
rotz:trainmodel.children[0].rotation.z
}
trainmodel.children[1].rotalist.push(rotas);
let offsetz = pos.z + trainmodel.children[0].position.z;
trainmodel.children[0].position.z -= offsetz;
let offsety = pos.y - trainmodel.children[0].position.y;
trainmodel.children[0].position.y += offsetz;
// trainmodel.position.z = point.z;
}
@ -537,6 +542,9 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
let offsetz = parseFloat(trainmodel.children[rs].rotalist[0].posr.z) + parseFloat(trainmodel.children[rs].position.z);
trainmodel.children[rs].position.z -= offsetz;
let offsety = parseFloat(trainmodel.children[rs].rotalist[0].posr.y) - parseFloat(trainmodel.children[rs].position.y);
trainmodel.children[rs].position.y += offsety;
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
if((trainmodel.children[rs].matrixWorld.elements[12]+10)>=trainmodel.children[rs].rotalist[0].posr.x){
@ -547,7 +555,8 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
}
//let offsetx = trainmodel.children[1].matrixWorld.elements[12]-trainmodel.children[0].children[3].matrixWorld.elements[12];
trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rota;
trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rotz;
trainmodel.children[rs].rotation.y = trainmodel.children[rs].rotalist[0].roty;
trainmodel.children[rs].rotalist.splice(0,1)
xh--;
}else{
@ -565,6 +574,11 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
}else{
//
let rotas = {
posr:null,
roty:null,
rotz:null,
};
if(trainmodel.children[0].position.z < pos.z ){
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
let tangent = trainmodel.curve.getTangentAt(data.offset).normalize();
@ -574,12 +588,10 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
trainmodel.children[0].rotation.x = -Math.PI/2;
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
trainmodel.children[0].rotation.y = 0;
let rotas = {
posr:pos,
rota:trainmodel.children[0].rotation.z
}
trainmodel.children[1].rotalist.push(rotas);
rotas.posr = pos;
// rotas.roty = trainmodel.children[0].rotation.y;
rotas.rotz = trainmodel.children[0].rotation.z;
let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z);
trainmodel.children[0].position.z += offsetz;
@ -592,26 +604,56 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
trainmodel.children[0].rotation.x = -Math.PI/2;
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
trainmodel.children[0].rotation.y = 0;
let rotas = {
posr:pos,
rota:trainmodel.children[0].rotation.z
}
trainmodel.children[1].rotalist.push(rotas);
rotas.posr = pos;
// rotas.roty = trainmodel.children[0].rotation.y;
rotas.rotz = trainmodel.children[0].rotation.z;
let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z);
trainmodel.children[0].position.z += offsetz;
}
if(trainmodel.children[0].position.y != pos.y){
if(rotas.posr == null){
trainmodel.children[0].up = new THREE.Vector3(-1,0,0);
let tangent = trainmodel.curve.getTangentAt(data.offset).normalize();
trainmodel.children[0].axis.crossVectors(trainmodel.children[0].up, tangent).normalize();
let radians = Math.acos(trainmodel.children[0].up.dot(tangent));
trainmodel.children[0].quaternion.setFromAxisAngle(trainmodel.children[0].axis, radians);
trainmodel.children[0].rotation.x = -Math.PI/2;
trainmodel.children[0].rotation.z = trainmodel.children[0].rotation.y;
trainmodel.children[0].rotation.y = 0;
rotas.posr = pos;
rotas.roty = trainmodel.children[0].rotation.y;
rotas.rotz = trainmodel.children[0].rotation.z;
let offsetz = parseFloat(pos.z) - parseFloat(trainmodel.children[0].position.z);
trainmodel.children[0].position.z += offsetz;
let offsety = parseFloat(pos.y) - parseFloat(trainmodel.children[0].position.y);
trainmodel.children[0].position.y += offsety;
}else{
rotas.roty = trainmodel.children[0].rotation.y;
let offsety = parseFloat(rotas.posr.y) - parseFloat(trainmodel.children[0].position.y);
trainmodel.children[0].position.y += offsety;
}
}
if(rotas.posr!= null){
trainmodel.children[1].rotalist.push(rotas);
}
if(trainmodel.children[1].rotalist.length > 0 || trainmodel.children[2].rotalist.length > 0 || trainmodel.children[3].rotalist.length > 0 || trainmodel.children[4].rotalist.length > 0|| trainmodel.children[5].rotalist.length > 0){
for(let rs = 1;rs<6;rs++){
//console.log(rs);
if(trainmodel.children[rs].rotalist[0]){
let offsetz = parseFloat(trainmodel.children[rs].rotalist[0].posr.z) - parseFloat(trainmodel.children[rs].matrixWorld.elements[14]);
trainmodel.children[rs].position.z += offsetz;
let offsety = parseFloat(trainmodel.children[rs].rotalist[0].posr.y) - parseFloat(trainmodel.children[rs].matrixWorld.elements[13]);
trainmodel.children[rs].position.y += offsety;
for(let xh=0;xh<trainmodel.children[rs].rotalist.length;xh++){
if((trainmodel.children[rs].matrixWorld.elements[12]-10)<=trainmodel.children[rs].rotalist[0].posr.x){
@ -620,8 +662,10 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
trainmodel.children[rs+1].rotalist.push(asd);
}
trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rota;
if(trainmodel.children[rs].rotalist[0].roty != null){
trainmodel.children[rs].rotation.y = trainmodel.children[rs].rotalist[0].roty;
}
trainmodel.children[rs].rotation.z = trainmodel.children[rs].rotalist[0].rotz;
trainmodel.children[rs].rotalist.splice(0,1)
xh--;
}else{

View File

@ -166,8 +166,9 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
function setpsdstationmap(stationlist){
for(let i=0,leni=stationlist.length;i<leni;i++){
psdtexturemap[stationlist[i].direction1.code] = stationlist[i].code;
psdtexturemap[stationlist[i].direction2.code] = stationlist[i].code;
console.log(stationlist[i]);
psdtexturemap[stationlist[i].stands[0].code] = stationlist[i].code;
psdtexturemap[stationlist[i].stands[1].code] = stationlist[i].code;
}
}
this.startAnimate = function(){

View File

@ -278,7 +278,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
trainlisttest.list[code].children[0].rotation.x = -Math.PI/2;
let newRotationZ = trainlisttest.list[code].children[0].rotation.z;
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
trainlisttest.list[code].children[0].rotation.y = 0;
trainlisttest.list[code].children[0].rotation.y = -newRotationZ;
// trainlisttest.list[code].children[0].rotation.y = -newRotationZ;
let rotas = {
posr:point,
@ -290,8 +290,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
let offsetz = parseFloat(point.z) - parseFloat(trainlisttest.list[code].children[0].position.z);
trainlisttest.list[code].children[0].position.z += offsetz;
// let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y);
// trainlisttest.list[code].children[0].position.y += offsety;
let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y);
trainlisttest.list[code].children[0].position.y += offsety;
}
if(trainlisttest.list[code].children[1].rotalist.length > 0 || trainlisttest.list[code].children[2].rotalist.length > 0 || trainlisttest.list[code].children[3].rotalist.length > 0 || trainlisttest.list[code].children[4].rotalist.length > 0|| trainlisttest.list[code].children[5].rotalist.length > 0){
for(let rs = 1;rs<6;rs++){
@ -299,8 +299,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
if(trainlisttest.list[code].children[rs].rotalist[0]){
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[14]);
trainlisttest.list[code].children[rs].position.z += offsetz;
// let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]);
// trainlisttest.list[code].children[rs].position.y += offsety;
let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]);
trainlisttest.list[code].children[rs].position.y += offsety;
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])>=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
@ -316,7 +316,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
}
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rotz;
// trainlisttest.list[code].children[rs].rotation.y = trainlisttest.list[code].children[rs].rotalist[0].roty;
trainlisttest.list[code].children[rs].rotation.y = trainlisttest.list[code].children[rs].rotalist[0].roty;
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
xh--;
}else{
@ -369,7 +369,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
let newRotationZ = trainlisttest.list[code].children[0].rotation.z;
trainlisttest.list[code].children[0].rotation.z = trainlisttest.list[code].children[0].rotation.y;
trainlisttest.list[code].children[0].rotation.y = 0;
// trainlisttest.list[code].children[0].rotation.y = -newRotationZ;
trainlisttest.list[code].children[0].rotation.y = -newRotationZ;
let rotas = {
posr:point,
@ -379,8 +379,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
trainlisttest.list[code].children[1].rotalist.push(rotas);
let offsetz = point.z + trainlisttest.list[code].children[0].position.z;
trainlisttest.list[code].children[0].position.z -= offsetz;
// let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y);
// trainlisttest.list[code].children[0].position.y += offsety;
let offsety = parseFloat(point.y) - parseFloat(trainlisttest.list[code].children[0].position.y);
trainlisttest.list[code].children[0].position.y += offsety;
// trainlisttest.list[code].position.z = point.z;
}
@ -392,8 +392,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
let offsetz = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.z) + parseFloat(trainlisttest.list[code].children[rs].position.z);
trainlisttest.list[code].children[rs].position.z -= offsetz;
// let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]);
// trainlisttest.list[code].children[rs].position.y += offsety;
let offsety = parseFloat(trainlisttest.list[code].children[rs].rotalist[0].posr.y) - parseFloat(trainlisttest.list[code].children[rs].matrixWorld.elements[13]);
trainlisttest.list[code].children[rs].position.y += offsety;
for(let xh=0;xh<trainlisttest.list[code].children[rs].rotalist.length;xh++){
if((trainlisttest.list[code].children[rs].matrixWorld.elements[12])<=trainlisttest.list[code].children[rs].rotalist[0].posr.x){
@ -402,8 +402,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
let asd = trainlisttest.list[code].children[rs].rotalist[0];
trainlisttest.list[code].children[rs+1].rotalist.push(asd);
}
//let offsetx = trainlisttest.list[code].children[1].matrixWorld.elements[12]-trainlisttest.list[code].children[0].children[3].matrixWorld.elements[12];
// trainlisttest.list[code].children[rs].rotation.y = trainlisttest.list[code].children[rs].rotalist[0].roty;
let offsetx = trainlisttest.list[code].children[1].matrixWorld.elements[12]-trainlisttest.list[code].children[0].children[3].matrixWorld.elements[12];
trainlisttest.list[code].children[rs].rotation.y = trainlisttest.list[code].children[rs].rotalist[0].roty;
trainlisttest.list[code].children[rs].rotation.z = trainlisttest.list[code].children[rs].rotalist[0].rotz;
trainlisttest.list[code].children[rs].rotalist.splice(0,1)
xh--;

View File

@ -116,8 +116,8 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){
};
var shape = new THREE.Shape();
len = closedSpline.getLength();
if(newsection.railpoint[0].y != newsection.railpoint[2].y){
console.log(newsection);
shape.moveTo( -2, 0 );
shape.lineTo( 2, 0 );
}else{

View File

@ -15,6 +15,10 @@ export function SectionModel(data) {
this.isStandTrack = null;
this.rsection = null;
this.lsection = null;
this.type = null;
//指向模型
this.mesh = null;

View File

@ -156,7 +156,7 @@ export function StationStandListN() {
for(let i=0;i<standsdata.length;i++){
let newstationstand = new StationStandModel(standsdata[i]);
console.log(standsdata[i]);
// console.log(standsdata[i]);
if(standsdata[i].code != "Station96090"){
newstationstand.code = standsdata[i].code;
newstationstand.name = standsdata[i].name;

View File

@ -69,14 +69,22 @@ export function TrainListN() {
selectmesh = assetloader.modellist[n].mesh;
scope.trainmesh = assetloader.modellist[n].mesh
ntracks1 = assetloader.modellist[n].animations.slice(16,27);
// ntracks1 = assetloader.modellist[n].animations.slice(16,27);
//
// tclip = new THREE.AnimationClip("three",2,ntracks1);
//
// ntracks2 = assetloader.modellist[n].animations.slice(0,15);
//
// fclip = new THREE.AnimationClip("four",2,ntracks2);
tclip = new THREE.AnimationClip("three",2,ntracks1);
ntracks2 = assetloader.modellist[n].animations.slice(0,15);
ntracks2 = assetloader.modellist[n].animations.slice(6,13);
fclip = new THREE.AnimationClip("four",2,ntracks2);
ntracks1 = assetloader.modellist[n].animations.slice(0,5);
tclip = new THREE.AnimationClip("three",2,ntracks1);
n = 0;
}
}
@ -202,21 +210,21 @@ export function TrainListN() {
selectmesh = assetloader.modellist[n].mesh
ntracks1 = assetloader.modellist[n].animations.slice(16,27);
// ntracks1 = assetloader.modellist[n].animations.slice(16,27);
//
// tclip = new THREE.AnimationClip("three",2,ntracks1);
//
// ntracks2 = assetloader.modellist[n].animations.slice(0,15);
//
// fclip = new THREE.AnimationClip("four",2,ntracks2);
tclip = new THREE.AnimationClip("three",2,ntracks1);
ntracks2 = assetloader.modellist[n].animations.slice(0,15);
ntracks2 = assetloader.modellist[n].animations.slice(6,13);
fclip = new THREE.AnimationClip("four",2,ntracks2);
// ntracks2 = assetloader.modellist[n].animations.slice(6,13);
//
// fclip = new THREE.AnimationClip("four",2,ntracks2);
//
// ntracks1 = assetloader.modellist[n].animations.slice(0,5);
//
// tclip = new THREE.AnimationClip("three",2,ntracks1);
ntracks1 = assetloader.modellist[n].animations.slice(0,5);
tclip = new THREE.AnimationClip("three",2,ntracks1);
n = 0;
}
}

View File

@ -191,7 +191,7 @@ export default {
onMouseDown(em) {
if (em.deviceModel.mean) {
if (IbpOperation[em.deviceModel.mean]) {
handlerIbpEvent(this.$route.query.group, IbpOperation[em.deviceModel.mean].event);
handlerIbpEvent(this.$route.query.group, IbpOperation[em.deviceModel.mean].event, this.stationCode);
}
}
},

View File

@ -454,47 +454,47 @@ export default {
},
{
name: '自动售检票/门禁',
mode: '',
id: '',
type: '',
mode: 'fafc',
id: 'fafc',
type: 'totalSystem',
children: [
{
name: '自动售检票系统',
mode: '',
id: '',
type: ''
mode: 'autoTicket',
id: 'autoTicket',
type: 'interface'
},
{
name: '门禁系统',
mode: '',
id: '',
type: ''
mode: 'entranceGuard',
id: 'entranceGuard',
type: 'interface'
}
]
},
{
name: '火灾报警系统',
mode: '',
id: '',
type: '',
mode: 'ffas',
id: 'ffas',
type: 'totalSystem',
children: [
{
name: '火灾报警系统-FAS联动',
mode: '',
id: '',
type: ''
mode: 'linkage',
id: 'linkage',
type: 'interface'
},
{
name: '火灾报警系统-站厅层',
mode: '',
id: '',
type: ''
mode: 'stationHall',
id: 'stationHall',
type: 'interface'
},
{
name: '火灾报警系统-站台层',
mode: '',
id: '',
type: ''
mode: 'platform',
id: 'platform',
type: 'interface'
},
{
name: '火灾报警系统-区间',

View File

@ -58,6 +58,22 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="门禁" name="fuzhouDoor">
<fuzhou-door
ref="fuzhouDoor"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="通讯图符" name="communicationButcher">
<communication-butcher
ref="communication"
style="width: 100%;height: 100%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
@ -71,6 +87,8 @@ import IscsLine from '../iscsCommonElem/line';
import IscsText from '../iscsCommonElem/text';
import IscsRect from '../iscsCommonElem/rect';
import OrdinaryDoor from '../iscsCommonElem/ordinaryDoor';
import FuzhouDoor from '../iscsCommonElem/fuzhouDoor';
import CommunicationButcher from '../iscsCommonElem/communicationButcher';
export default {
name: 'IscsAcsOperate',
@ -80,7 +98,9 @@ export default {
IscsLine,
IscsText,
IscsRect,
OrdinaryDoor
OrdinaryDoor,
FuzhouDoor,
CommunicationButcher
},
mixins: [
],

View File

@ -0,0 +1,110 @@
<template>
<div style="overflow-y: scroll;height: calc(100% - 46px); width: 100%;">
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
<el-form-item label="门宽:" prop="height">
<el-input-number v-model="form.width" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="X轴坐标:">
<el-input-number v-model="form.x" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item label="Y轴坐标:">
<el-input-number v-model="form.y" controls-position="right" :min="1" size="small" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" size="small" type="danger" @click="deleteDevice">删除</el-button>
<el-button v-show="showDeleteButton" size="small" @click="initPage">取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import {getUID} from '@/iscs/utils/Uid';
import { mapGetters } from 'vuex';
export default {
name: 'CommunicationButcher',
data() {
return {
form:{
code: '',
width: 50,
x: 10,
y: 10
},
rules: {},
isUpdate: false,
buttonText: '立即创建',
showDeleteButton: false
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'CommunicationButcher' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.x = model.point.x;
this.form.y = model.point.y;
this.form.width = model.width;
}
}
},
mounted() {},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const model = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.isUpdate ? this.form.code : getUID('CommunicationButcher', this.iscs.communicationButcherList),
_type: 'CommunicationButcher',
width: this.form.width
};
this.$emit('createDataModel', model);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const model = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'CommunicationButcher',
width: this.form.width
};
this.$emit('deleteDataModel', model);
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code: '',
width: 50,
x: 10,
y: 10
};
}
}
};
</script>
<style scoped>
</style>

View File

@ -23,12 +23,12 @@
import {getUID} from '@/iscs/utils/Uid';
import { mapGetters } from 'vuex';
export default {
name: 'OrdinaryDoor',
name: 'FuzhouDoor',
data() {
return {
form:{
code: '',
width: 1,
width: 20,
x: 10,
y: 10
},
@ -46,16 +46,14 @@ export default {
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'OrdinaryDoor' ) {
if (model._type === 'FuzhouDoor' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.x = model.point.x;
this.form.y = model.point.y;
this.form.r = model.r;
this.form.doorType = model.doorType;
this.form.rotationAngle = model.rotationAngle;
this.form.width = model.width;
}
}
},
@ -69,11 +67,9 @@ export default {
x: this.form.x,
y: this.form.y
},
code: this.isUpdate ? this.form.code : getUID('OrdinaryDoor', this.iscs.ordinaryDoorList),
_type: 'OrdinaryDoor',
rotationAngle: this.form.rotationAngle,
r: this.form.r,
doorType: this.form.doorType
code: this.isUpdate ? this.form.code : getUID('FuzhouDoor', this.iscs.fuzhouDoorList),
_type: 'FuzhouDoor',
width: this.form.width
};
this.$emit('createDataModel', model);
this.initPage();
@ -83,18 +79,16 @@ export default {
});
},
deleteDevice() {
const lineModel = {
const model = {
point: {
x: this.form.x,
y: this.form.y
},
code: this.form.code,
_type: 'OrdinaryDoor',
rotationAngle: this.form.rotationAngle,
r: this.form.r,
doorType: this.form.doorType
_type: 'FuzhouDoor',
width: this.form.width
};
this.$emit('deleteDataModel', lineModel);
this.$emit('deleteDataModel', model);
},
initPage() {
this.isUpdate = false;
@ -102,9 +96,7 @@ export default {
this.showDeleteButton = false;
this.form = {
code: '',
doorType: '1',
r: 1,
rotationAngle: 0,
width: 20,
x: 10,
y: 10
};

View File

@ -0,0 +1,116 @@
<template>
<div class="question">
<div class="ql-editor" v-html="appendIndex($escapeHTML(`${option.topic}`), $vnode.key, option)" />
<template v-if="checkType(option, 'judge')">
<el-radio-group v-model="answer" disabled :class="{'select-box': option.rightAnswer != option.answer}" @change="onChnage">
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: inline">
<span>{{ el.content }}</span>
</el-radio>
</el-radio-group>
</template>
<template v-else-if="checkType(option, 'select')">
<el-radio-group v-model="answer" disabled :class="{'select-box': option.rightAnswer != option.answer}" @change="onChnage">
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: block">
<span>{{ $asc2chart(i+65) }}. </span>
<div class="ql-editor" style="display: inline; padding: 0" v-html="$escapeHTML(el.content)" />
</el-radio>
</el-radio-group>
</template>
</div>
</template>
<script>
export default {
props: {
value: {
type: String,
default: ''
},
option: {
type: Object,
required: true
}
},
data() {
return {
answer: 0
};
},
watch: {
value(val) {
this.changeValue();
}
},
mounted() {
this.changeValue();
},
methods: {
changeValue() {
this.answer = parseInt(this.value);
},
checkType(option, type) {
return option.type == type;
},
appendIndex(str, index, option) {
let result = '';
const i = option.optionList.findIndex(ele => ele.correct);
if (option.type === 'select') {
if (option.answer == option.optionList[i].id) {
result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
} else {
result = `<span style="color: red;margin-left: 10px;">(错误 正确答案: ${this.$asc2chart(i + 65)})</span>`;
}
} else if (option.type === 'judge') {
if (option.answer == option.optionList[i].id) {
result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
} else {
result = `<span style="color: red;margin-left: 10px;">(错误 正确答案: ${option.optionList[i].content})</span>`;
}
}
this.$set(option, 'rightAnswer', option.optionList[i].id);
//
return `${index + 1}. ${str} ${result}`;
},
onChnage(e) {
const answer = `${e}`;
this.$emit('input', answer);
this.$emit('save', {userExamQuestionId: this.option.id, answer: answer});
}
}
};
</script>
<style lang="scss" scoped>
.rich-text {
padding: 0;
display: inline;
}
.question {
/deep/ {
.ql-editor {
line-height: 26px;
padding: 0;
}
.el-radio {
color: #000;
}
.el-radio__label {
font-size: 16px;
line-height: 26px;
}
.el-radio-group .is-disabled .el-radio__label{
color: #333;
}
.select-box.el-radio-group .is-checked.is-disabled .el-radio__label{
color: red;
}
}
}
</style>

View File

@ -1,109 +1,185 @@
<template>
<el-dialog :visible.sync="dialogVisible" fullscreen>
<div class="joylink-card paper">
<div class="card-title">
<span style="font-weight:bold ">{{ $t('exam.examResultsDetails') }}</span>
</div>
<div class="context">
<el-table :data="operateScoreData" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary>
<el-table-column prop="questionTopic" label="题目" />
<el-table-column prop="remarks" label="描述" />
<el-table-column prop="totalScore" width="100" label="分值" />
<el-table-column prop="score" width="100" label="得分" />
</el-table>
</div>
<div class="draf_box">
<el-button type="primary " @click="restart">重新测试</el-button>
<el-button type="primary" @click="close">关闭</el-button>
<el-container class="quiz">
<el-container class="quiz__container">
<el-header class="quiz__container-header layer-center">
<div class="titles">考试结果</div>
</el-header>
<el-main class="quiz__container-main layer-center">
<div v-for="(el,i) in sortedList" :id="'anchor__lst-'+i" :key="i" class="section">
<template v-if="el.children.length">
<div class="caption">{{ index2UnicodeList[i] }}{{ el.title }}</div>
<question v-for="(item,j) in el.children" :id="'anchor__lst-'+item.type+'-'+item.index" :key="j" v-model="item.answer" class="context" :option="item" />
</template>
</div>
<div style="padding-left: 20px;margin-top: 20px;">
<span>考试总分: </span>
<span style="font-size: 20px">{{ totalScore }}</span>
</div>
</el-main>
<el-footer class="quiz__container-footer layer-center" @click="returnTop">
<el-button-group class="buttons">
<el-button type="primary" @click="restart">重新测验</el-button>
<el-button type="primary" @click="close">返回</el-button>
</el-button-group>
</el-footer>
</el-container>
</el-container>
</el-dialog>
</template>
<script>
import Question from './requestQuestion';
export default {
name: 'ExamResult',
components: {
Question
},
props: {
},
data() {
return {
resultModel: {
trainingName: '',
score: 0
index: 0,
height: 0,
loading: false,
formModel: {
description: '',
duration: 10,
name: '',
status: '',
totalScore: 0,
passScore: 10
},
tableData: [],
operateScoreData: [],
totalScore: 0,
examQuestions: [],
dialogVisible: false
};
},
computed: {
height() {
return this.$store.state.app.height - 50;
examId() {
return this.$route.params.examId;
},
userExamId() {
return this.$route.params.userExamId;
},
question() {
return this.examQuestions[this.index] || {};
},
index2UnicodeList() {
return ['一', '二', '三', '四'];
},
sortedList() {
return [
{
title: '判断题',
children: this.examQuestions.filter(el => { return el.type === 'judge'; })
},
{
title: '选择题',
children: this.examQuestions.filter(el => { return el.type === 'select'; })
}
];
}
},
created() {
},
methods: {
doShow(result) {
this.examQuestions = [];
this.dialogVisible = true;
this.operateScoreData = result;
},
getSummaries(param) { //
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = this.$t('exam.totalScore');
return;
}
if (column.property === 'score' || column.property === 'totalScore') {
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += this.$t('exam.points');
} else {
sums[index] = '';
}
}
if (result.length) {
result.forEach((item, i) => {
this.examQuestions.push({...item.question, ...{answer: String(item.answerOptionId), score: item.score, index: i}});
});
return sums;
this.totalScore = result.reduce((pre, ver) => pre + ver.score, 0);
}
},
restart() {
this.$emit('restart');
},
close() {
this.dialogVisible = false;
},
returnTop() {
document.querySelector('.el-header').scrollIntoView(true);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.paper {
.layer-center {
width: 900px;
height: 100%;
margin: auto;
background: #fff;
padding-top: 0;
}
.quiz {
background: #eee;
height: 100%;
&::-webkit-scrollbar {
display:none
}
&__card {
height: 100%;
.dir-item {
padding-left: 25px;
}
.dir-caption {
padding-left: 10px;
line-height: 26px;
background: #f1f1f1;
}
}
&__container {
height: 100%;
&-header {
height: auto !important;
.titles {
font-size: 24px;
line-height: 60px;
font-weight: bold;
text-align: center;
margin: 0 auto;
}
.notes {
color:#606266;
white-space: nowrap;
overflow: hidden;
.card-title{
height: 47px;
line-height: 47px;
border-bottom: 1px solid #e6e6e6;
text-align: center;
text-overflow: ellipsis;
margin: 0 20px;
}
}
&-main {
.section {
padding: 5px 20px;
.caption {
line-height: 26px;
}
.context {
padding: 30px 60px;
height: calc(100% - 107px);
overflow: auto;
}
}
}
.draf_box{
padding: 10px 0;
text-align: center;
&-footer {
text-align: right;
position: sticky;
bottom: 0px;
padding: 40px ;
.buttons {
position: relative;
bottom: 20px;
}
}
}
}
</style>