Merge remote-tracking branch 'remotes/origin/test_switch' into test_deplotSimulation

This commit is contained in:
joylink_cuiweidong 2021-09-14 10:56:03 +08:00
commit 5e3006bf91
67 changed files with 4018 additions and 2511 deletions

View File

@ -180,14 +180,63 @@ class Iscs {
update(list) {
(list || []).forEach(elem => {
const code = elem.code;
const oDevice = this.iscsDevice[code];
if (elem.dispose) {
this.$painter.delete(oDevice);
if (elem.deviceType === 'IBP') {
if (this.iscsDevice['IscsCircle_20']) {
elem.upStatus.operate ? this.iscsDevice['IscsCircle_20'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_20'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_20']);
}
if (this.iscsDevice['IscsCircle_17']) {
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_17'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_17'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_17']);
}
if (this.iscsDevice['IscsCircle_18']) {
elem.upStatus.openSideCommand ? this.iscsDevice['IscsCircle_18'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_18'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_18']);
}
if (this.iscsDevice['IscsCircle_19']) {
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_19'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_19'].model.fillColor = '008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_19']);
}
} else if (elem.deviceType === 'PSL') {
if (this.iscsDevice['IscsCircle_12']) {
elem.upStatus.operate ? this.iscsDevice['IscsCircle_12'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_12'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_12']);
}
if (this.iscsDevice['IscsCircle_9']) {
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_9'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_9'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_9']);
}
if (this.iscsDevice['IscsCircle_35']) {
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_35'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_35'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_35']);
}
if (this.iscsDevice['IscsCircle_37']) {
elem.upStatus.interlockRelease ? this.iscsDevice['IscsCircle_37'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_37'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_37']);
}
} else if (elem.deviceType === 'SAFETY_CIRCLE') {
if (this.iscsDevice['IscsCircle_26']) {
elem.upStatus.pfdcFault ? this.iscsDevice['IscsCircle_26'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_26'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_26']);
}
if (this.iscsDevice['IscsCircle_25']) {
elem.upStatus.busFault ? this.iscsDevice['IscsCircle_25'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_25'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_25']);
}
if (this.iscsDevice['IscsCircle_27']) {
elem.upStatus.safetyCircle ? this.iscsDevice['IscsCircle_27'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_27'].model.fillColor = '#008DCE';
this.$painter.update(this.iscsDevice['IscsCircle_27']);
}
} else {
const oDevice = this.iscsDevice[code];
if (oDevice && elem.dispose) {
this.$painter.delete(oDevice);
} else if (oDevice) {
if (this.hookHandle(oDevice.model, elem)) {
this.$painter.update(oDevice);
}
}
}
});
if (this.methods.stateUpdate instanceof Function) { this.methods.stateUpdate(list); }

View File

@ -97,7 +97,7 @@ class Painter {
} else {
const instance = device.instance;
if (instance) {
instance.setState(device);
instance.setState(device.model);
}
}
}

View File

@ -68,15 +68,29 @@ export default class fuzhouPsd extends Group {
this.add(this.grouper);
}
setState(model) {
if (model.alarm) {
this.fuzhouPsdBorder.setStyle('lineWidth', 1);
}
if (model.noStatus) {
// if (model.alarm) {
// this.fuzhouPsdBorder.setStyle('lineWidth', 1);
// }
if (model.status === 'UNDEFINED') {
this.fuzhouPsdLeft.attr({shape:{x: 2}});
this.fuzhouPsdRight.attr({shape:{x: this.model.height * 0.9 - 0.4}});
this.fuzhouPsdBorder.setStyle('fill', '#0f96dc');
this.fuzhouPsdRight.setStyle('fill', '#0f96dc');
this.fuzhouPsdLeft.setStyle('fill', '#0f96dc');
} else if (model.status === 'DCU_FAULT') {
this.fuzhouPsdBorder.setStyle('lineWidth', 1);
} else if (model.status === 'OPEN') {
this.fuzhouPsdLeft.attr({shape:{x: 2 + (this.model.height * 1.5 - 4) * 0.1}});
this.fuzhouPsdRight.attr({shape:{x: (this.model.height * 1.5 - 4) * 0.5 + 2}});
this.fuzhouPsdBorder.setStyle('fill', '#33CC00');
this.fuzhouPsdRight.setStyle('fill', '#33CC00');
this.fuzhouPsdLeft.setStyle('fill', '#33CC00');
} else if (model.status === 'CLOSE') {
this.fuzhouPsdLeft.attr({shape:{x: 2 + (this.model.height * 1.5 - 4) * 0.1}});
this.fuzhouPsdRight.attr({shape:{x: (this.model.height * 1.5 - 4) * 0.5 + 2}});
this.fuzhouPsdBorder.setStyle('fill', '#33CC00');
this.fuzhouPsdRight.setStyle('fill', '#33CC00');
this.fuzhouPsdLeft.setStyle('fill', '#33CC00');
}
}
setModel(dx, dy) {

View File

@ -130,3 +130,19 @@ export function trainSimulationDoorControl(group, data) {
data: data
});
}
export function trainSimulationDoorSelection(group, data) {
return request({
url: `/simulation/${group}/operate/Driver_Door_Selection`,
method: 'post',
data: data
});
}
export function trainSimulationDoorMode(group, data) {
return request({
url: `/simulation/${group}/operate/Driver_Door_Mode`,
method: 'post',
data: data
});
}

View File

@ -145,7 +145,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
scene.add(controls3.getObject());
let cameracctv = new THREE.PerspectiveCamera(50, dom.clientWidth/dom.clientHeight, 0.1, 50);
cameracctv.position.set( -3, 0,4.5 );
cameracctv.position.set( 1, 0,4.5 );
cameracctv.rotation.y = -Math.PI/2;
cameracctv.rotation.x = Math.PI/2;
@ -387,7 +387,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
rails = loadrails;
// console.log(trainlisttest.group.children[0]);
trainlisttest.group.children[0].getObjectByName("C3").add(cameracctv);
trainlisttest.group.children[0].getObjectByName("C6").add(cameracctv);
}
this.eventon = function() {

View File

@ -823,7 +823,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
// console.log(trainmodel.openleft);
// console.log(trainmodel.openright);
if(trainmodel.code == data.code){
console.log(data);
if(trainmodel.right == "0"){
if(data.doorCode == "2"){
@ -834,10 +834,10 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].top[an].timeScale = -1;
actions["traindoor"].top[an].play();
}
}else if(trainmodel.openleft != data.open && data.open == "1"){
trainmodel.openleft = "1";
console.log(data);
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = 0;

View File

@ -73,15 +73,19 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
this.actionModelControl = function(actionType,actionModel){
console.log(actionType);
console.log(actionModel);
// console.log(actionType);
// console.log(actionModel);
if(actionType == "remove"){
assetModelManager.otherModel.remove(actionModel);
}else if(actionType == "show"){
actionModel.visible = true;
assetModelManager.otherModel.add(actionModel);
}else if(actionType == "changeIndex"){
actionModel.visible = true;
assetModelManager.otherModel.add(actionModel);
}
}
this.actionRemove = function(actionModel){
@ -91,15 +95,16 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
this.changeIndex = function(nowIndex){
if(nowIndex!=0){
oldIndex = lessonIndex;
}
if(lessonData.lessonProgress[oldIndex].roleName == nowRole){
updateExam(lessonData.lessonProgress[oldIndex],oldIndex);
}
}
lessonIndex = nowIndex;
console.log(nowIndex);
// console.log(nowIndex);
scope.nowSceneType = lessonData.lessonProgress[nowIndex].progressScene;
// console.log(nowRole);
// console.log(lessonData.lessonProgress[lessonIndex].roleName);
@ -118,7 +123,10 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,false,assetModelManager.lessonTriggerList[scope.nowSceneType]);
}
if(nowIndex == lessonData.lessonProgress.length-1){
if(nowIndex == (lessonData.lessonProgress.length-1)){
console.log(nowIndex);
console.log(lessonData.lessonProgress.length);
lessonEnd();
}
}
@ -137,6 +145,7 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
}
controlManager.initRoleMode(roleMode);
for(let i=0;i<lessonData.lessonProgress.length;i++){
if(nowRole == lessonData.lessonProgress[i].roleName){
examList.push(
{
@ -157,7 +166,7 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
time:0,
};
controlManager.initExam(examList,examData);
updataExamStatus(examData);
// updataExamStatus(examData);
// if(lessonData.lessonProgress[lessonIndex].action.length>0){
controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,roleMode,assetModelManager.lessonTriggerList[scope.nowSceneType]);

View File

@ -29,9 +29,9 @@ export function AssetModelManager(editor,scene) {
scope.staticAsset['station'] = {
modelId:'station',
packageName:"车站",
url:JL3D_LOCAL_STATIC+"/lesson3d/station.FBX",
url:"/MODEL/2021-09-08/211-9861.FBX",
mesh:"",
assetType:'static',
assetType:'onlineasset',
isUse:true,
resourceType:"三维课程",
sceneType:"standstation",
@ -219,7 +219,12 @@ export function AssetModelManager(editor,scene) {
scope.staticAsset['station'].mesh.getObjectByName("spbmkg").actionName = "PBMDH";
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("spbmkg"));
// console.log(scope.loadAsset['default1'].mesh.getObjectByName("FTKG"));
scope.staticAsset['station'].mesh.getObjectByName("DMH").showType = "default";
scope.staticAsset['station'].mesh.getObjectByName("DMH").label = "隔离门";
scope.staticAsset['station'].mesh.getObjectByName("DMH").actionName = "PBMDH";
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("DMH"));
scope.staticAsset['station'].mesh.getObjectByName("DMH").rotation.z = Math.PI/2;
}
//动态加载资源

View File

@ -513,7 +513,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
if((lessonData.lessonProgress[nowLessonIndex].changeCamera == true && lessonData.lessonProgress[nowLessonIndex].roleName == nowRole) || nowLessonIndex == 0 || lessonData.lessonProgress[nowLessonIndex].roleName== 'kong'){
console.log(scope.controlMode);
scope.controlMode = lessonData.lessonProgress[nowLessonIndex].controlMode;
if(scope.controlMode == "free" || scope.controlMode == "non"){
@ -564,25 +564,62 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
// console.log(eventTrigger);
// console.log("----------------------------");
if(actions.length>0 && roleMode){
console.log(roleMode);
if(actions.length>0 ){
scope.eventHitMode = true;
for(let i=0;i<actions.length;i++){
if(actions[i].actionType == "auto"){
console.log(actions[i]);
if(actions[i].actionMode == "play"){
for(let j=0;j<eventTrigger.length;j++){
if(eventTrigger[j].label == actions[i].actionModel){
if(actionList[eventTrigger[j].actionName].status == "01"){
actionList[eventTrigger[j].actionName].status = "02";
actionList[eventTrigger[j].actionName].action.reset();
actionList[eventTrigger[j].actionName].action.timeScale = 1;
actionList[eventTrigger[j].actionName].action.clampWhenFinished = true;
actionList[eventTrigger[j].actionName].action.setLoop(THREE.LoopOnce);
actionList[eventTrigger[j].actionName].action.play();
}else{
actionList[eventTrigger[j].actionName].status = "01";
actionList[eventTrigger[j].actionName].action.reset();
actionList[eventTrigger[j].actionName].action.timeScale = -1;
actionList[eventTrigger[j].actionName].action.clampWhenFinished = true;
actionList[eventTrigger[j].actionName].action.setLoop(THREE.LoopOnce);
actionList[eventTrigger[j].actionName].action.play();
}
}
}
}
if(actions[i].actionMode == "show"){
for(let j=0;j<eventTrigger.length;j++){
if(eventTrigger[j].label == actions[i].actionModel){
actionEvent("show",actions[i],eventTrigger[j]);
j = eventTrigger.length;
}
console.log(eventTrigger);
}
}
if(actions[i].actionMode == "remove"){
for(let j=0;j<eventTrigger.length;j++){
if(eventTrigger[j].label == actions[i].actionModel){
actionEvent("remove",actions[i],eventTrigger[j]);
j = eventTrigger.length;
}
}
}
}
if(roleMode){
if(actions[i].actionType == "contact"){
if(eventTrigger){
for(let j=0;j<eventTrigger.length;j++){
if(eventTrigger[j].label == actions[i].actionModel){
let eventTestBox = new THREE.Box3(new THREE.Vector3(), new THREE.Vector3());
@ -594,6 +631,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
}
}
}
}
if(actions[i].actionType == "switch"){
for(let j=0;j<eventTrigger.length;j++){
@ -626,8 +664,10 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
}
}
}
}
}else if(actions.length>0){
console.log(actions);
// console.log(actions);
}
};

View File

@ -0,0 +1,238 @@
export function Fire() {
let scope = this;
this.points = {};
var last_time_activate = Date.now();
this.createNew = function(scene,pos){
scope.points = new Points(pos);
scope.points.init(pos);
scene.add(scope.points.obj);
}
this.update = function(){
var now = Date.now();
scope.points.update();
if (now - last_time_activate > 10) {
scope.points.activateMover();
last_time_activate = Date.now();
}
}
var Mover = function() {
this.position = new THREE.Vector3();
this.velocity = new THREE.Vector3();
this.acceleration = new THREE.Vector3();
this.anchor = new THREE.Vector3();
this.mass = 1;
this.r = 0;
this.g = 0;
this.b = 0;
this.a = 1;
this.time = 0;
this.is_active = false;
};
Mover.prototype = {
init: function(vector) {
this.position = vector.clone();
this.velocity = vector.clone();
this.anchor = vector.clone();
this.acceleration.set(0, 0, 0);
this.a = 1;
this.time = 0;
},
updatePosition: function() {
this.position.copy(this.velocity);
},
updateVelocity: function() {
this.acceleration.divideScalar(this.mass);
this.velocity.add(this.acceleration);
// if (this.velocity.distanceTo(this.position) >= 1) {
// this.direct(this.velocity);
// }
},
applyForce: function(vector) {
this.acceleration.add(vector);
},
applyFriction: function() {
var friction = friction(this.acceleration, 0.1);
this.applyForce(friction);
},
applyDragForce: function(value) {
var drag = drag(this.acceleration, value);
this.applyForce(drag);
},
hook: function(rest_length, k) {
var force = hook(this.velocity, this.anchor, rest_length, k);
this.applyForce(force);
},
activate: function() {
this.is_active = true;
},
inactivate: function() {
this.is_active = false;
}
};
var Points = function(pos) {
this.movers_num = 3000;
this.movers = [];
this.pos = pos;
this.geometry = null;
this.material = null;
this.obj = null;
this.texture = null;
this.antigravity = new THREE.Vector3(0, 0.1, 0);
};
Points.prototype = {
init: function(pos) {
this.createTexture();
this.geometry = new THREE.Geometry();
this.material = new THREE.PointsMaterial({
color: 0xff6633,
size: 3,
transparent: true,
opacity: 0.5,
map: this.texture,
// depthTest: false,
depthWrite:false,
alphaTest: 0.1,
blending: THREE.AdditiveBlending,
});
for (var i = 0; i < this.movers_num; i++) {
var mover = new Mover();
mover.init(new THREE.Vector3((10*Math.random()+pos.x),pos.y, (10*Math.random()+pos.z)));
this.movers.push(mover);
this.geometry.vertices.push(mover.position);
}
this.obj = new THREE.Points(this.geometry, this.material);
this.obj.renderOrder = 1;
},
update: function() {
var points_vertices = [];
for (var i = 0; i < this.movers.length; i++) {
var mover = this.movers[i];
if (mover.is_active) {
mover.applyForce(this.antigravity);
mover.updateVelocity();
mover.updatePosition();
if (mover.position.y > (this.pos.y+5)) {
mover.inactivate();
}
}
points_vertices.push(mover.position);
}
this.obj.geometry.vertices = points_vertices;
this.obj.geometry.verticesNeedUpdate = true;
},
activateMover: function() {
var count = 0;
let pos = this.pos;
for (var i = 0; i < this.movers.length; i++) {
var mover = this.movers[i];
if (mover.is_active) continue;
var rad1 = getRadian(Math.log(getRandomInt(200, 256)) / Math.log(256) * 270);
var rad2 = getRadian(getRandomInt(0, 360));
var force = getSpherical(rad1, rad2, 1);
mover.activate();
mover.init(new THREE.Vector3((10*Math.random()+pos.x), pos.y+5, (10*Math.random()+pos.z)));
mover.applyForce(force);
count++;
if (count >= 10) break;
}
},
createTexture: function() {
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
var grad = null;
canvas.width = 200;
canvas.height = 200;
grad = ctx.createRadialGradient(100, 100, 20, 100, 100, 100);
grad.addColorStop(0.2, 'rgba(255, 255, 255, 1)');
grad.addColorStop(0.5, 'rgba(255, 255, 255, 0.3)');
grad.addColorStop(1.0, 'rgba(255, 255, 255, 0)');
ctx.fillStyle = grad;
ctx.arc(100, 100, 100, 0, Math.PI / 180, true);
ctx.fill();
this.texture = new THREE.Texture(canvas);
this.texture.minFilter = THREE.NearestFilter;
this.texture.needsUpdate = true;
}
};
var HemiLight = function() {
this.rad1 = getRadian(60);
this.rad2 = getRadian(30);
this.range = 1000;
this.hex1 = 0xffffff;
this.hex2 = 0x333333;
this.intensity = 1;
this.obj;
};
HemiLight.prototype = {
init: function(hex1, hex2) {
if (hex1) this.hex1 = hex1;
if (hex2) this.hex2 = hex2;
this.obj = new THREE.HemisphereLight(this.hex1, this.hex2, this.intensity);
this.setPosition();
},
setPosition: function() {
var points = getSpherical(this.rad1, this.rad2, this.range);
this.obj.position.copy(points);
}
};
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
function getDegree(radian) {
return radian / Math.PI * 180;
}
function getRadian(degrees) {
return degrees * Math.PI / 180;
}
function getSpherical(rad1, rad2, r) {
var x = Math.cos(rad1) * Math.cos(rad2) * r;
var z = Math.cos(rad1) * Math.sin(rad2) * r;
var y = Math.sin(rad1) * r;
return new THREE.Vector3(x, y, z);
}
function friction(acceleration, mu, normal, mass) {
var force = acceleration.clone();
if (!normal) normal = 1;
if (!mass) mass = 1;
force.multiplyScalar(-1);
force.normalize();
force.multiplyScalar(mu);
return force;
}
function drag(acceleration, value) {
var force = acceleration.clone();
force.multiplyScalar(-1);
force.normalize();
force.multiplyScalar(acceleration.length() * value);
return force;
}
function hook(velocity, anchor, rest_length, k) {
var force = velocity.clone().sub(anchor);
var distance = force.length() - rest_length;
force.normalize();
force.multiplyScalar(-1 * k * distance);
return force;
}
}

View File

@ -10,7 +10,9 @@ import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
//骨骼动画模型辅助工具
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
import { AssetModelManager } from '@/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js';
import { AssetModelManager } from '@/jlmap3d/lesson3dedit/manager/assetmodelmanager.js';
import { AccidentManager } from '@/jlmap3d/lesson3dedit/manager/accidentmanager.js';
import { TransformControls } from '@/jlmap3d/lesson3dedit/controls/TransformControls';
@ -75,6 +77,8 @@ export function Lesson3dEditor(dom,lessonData) {
//
scene.add(transcontrol);
let accidentManager = new AccidentManager(scene);
accidentManager.initAccident();
let assetModelManager = new AssetModelManager(scope,scene);
@ -85,6 +89,11 @@ export function Lesson3dEditor(dom,lessonData) {
}else{
assetModelManager.lessonAssetsLoader();
}
if(lessonData.accidentList){
accidentManager.loadAccidentList(lessonData.accidentList)
}
}else{
assetModelManager.lessonAssetsLoader();
}
@ -98,6 +107,7 @@ export function Lesson3dEditor(dom,lessonData) {
render();
scope.controls.update();
// delta = clock.getDelta();
accidentManager.update();
requestAnimationFrame(animate);
}
@ -112,8 +122,11 @@ export function Lesson3dEditor(dom,lessonData) {
this.changeIndex = function(nowIndex){
lessonIndex = nowIndex;
console.log(lessonData.lessonProgress[lessonIndex]);
scope.nowSceneType = lessonData.lessonProgress[lessonIndex].progressScene;
assetModelManager.changeSceneGroup(scope.nowSceneType);
accidentManager.changeSceneGroup(scope.nowSceneType);
// if(lessonData.lessonProgress[lessonIndex].roleName == nowRole){
// controlManager.initControlMode(lessonIndex);
// controlManager.initRoleMode(true,nowRole);
@ -131,6 +144,7 @@ export function Lesson3dEditor(dom,lessonData) {
console.log(value2);
if(type == "changeScene"){
assetModelManager.changeSceneGroup(value1);
accidentManager.changeSceneGroup(value1);
scope.nowSceneType = value1;
}
}
@ -155,10 +169,32 @@ export function Lesson3dEditor(dom,lessonData) {
}
this.createAccident = function(accidentData,mousePos){
var mouse = new THREE.Vector2();
var raycaster = new THREE.Raycaster();
mouse.x = ( mousePos.x / window.innerWidth ) * 2 - 1;
mouse.y = - ( mousePos.y / dom.offsetHeight ) * 2 + 1;
raycaster.setFromCamera(mouse,scope.camerass) // 也可以给构造函数传参的形式写
var intersects = raycaster.intersectObjects( scene.children,true );
if(intersects.length>0){
accidentManager.createNewAccident(accidentData,intersects[0].point,scope.nowSceneType);
}
}
this.saveAssetModel = function(){
return assetModelManager.saveModelList();
}
this.saveAccidentModel = function(){
return accidentManager.saveDataList();
}
this.attachModel = function(selectModel){
transcontrol.attach(selectModel);
}
@ -167,4 +203,8 @@ export function Lesson3dEditor(dom,lessonData) {
transcontrol.detach();
assetModelManager.deleteAsset(selectModel,scope.nowSceneType);
}
this.deleteAccident = function(selectAccident){
accidentManager.deleteAccident(selectAccident,scope.nowSceneType);
}
}

View File

@ -0,0 +1,146 @@
// import { AssetModelManager } from '@/jlmap3d/lesson3dedit/manager/assetmodelmanager.js';
import { Fire } from '@/jlmap3d/lesson3dedit/accident/fire.js';
export function AccidentManager(scene) {
let scope = this;
this.accidentList = [];
this.accidentGroup = new THREE.Group();
//场景中可触发事件模型
this.accidentList = [];
scope.accidentList["standstation"] = [];
scope.accidentList["stopstation"] = [];
scope.accidentList["occ"] = [];
scope.accidentList["device"] = [];
scope.accidentList["xl"] = [];
scope.accidentList["dc"] = [];
let groupList = [];
groupList["standstation"] = new THREE.Group();
groupList["stopstation"] = new THREE.Group();
groupList["occ"] = new THREE.Group();
groupList["device"] = new THREE.Group();
groupList["xl"] = new THREE.Group();
groupList["dc"] = new THREE.Group();
let updateSceneType = "standstation";
scene.add(scope.accidentGroup);
this.initAccident = function(nowSceneType){
let accidentData = [
{
id:'1',
name:"火灾",
type:"fire"
}
];
jl3dUpdateAccidentData(accidentData);
}
this.saveDataList = function(){
let saveList = [];
for(let g in scope.accidentList){
for(let i=0;i<scope.accidentList[g].length;i++){
if(scope.accidentList[g][i].showType != "default"){
saveList.push({
id:scope.accidentList[g][i].id,
name:scope.accidentList[g][i].name,
label:scope.accidentList[g][i].label,
type:scope.accidentList[g][i].type,
pos:{
x:scope.accidentList[g][i].pos.x,
y:scope.accidentList[g][i].pos.y,
z:scope.accidentList[g][i].pos.z
},
showType:scope.accidentList[g][i].showType,
sceneType:scope.accidentList[g][i].sceneType,
});
}
}
}
return saveList;
}
this.changeSceneGroup = function(nowSceneType){
if(scope.accidentGroup.children.length>0){
scope.accidentGroup.remove(scope.accidentGroup.children[0]);
}
scope.accidentGroup.add(groupList[nowSceneType]);
jl3dUpdateAccidentlist(scope.accidentList[nowSceneType]);
updateSceneType = nowSceneType;
}
this.createNewAccident = function(type,pos,nowSceneType){
var rand = Math.floor(Math.random () * 900) + 100;
let newAccident = {
id:rand,
name:type,
label:type+rand,
type:type,
object:{},
pos:pos,
sceneType:nowSceneType,
showType:"loadModel",
};
if(type == "fire"){
newAccident.object = new Fire();
newAccident.object.createNew(groupList[nowSceneType],pos);
}
scope.accidentList[nowSceneType].push(newAccident);
jl3dUpdateAccidentlist(scope.accidentList[nowSceneType]);
}
this.deleteAccident = function(selectAccident,nowSceneType){
groupList[nowSceneType].remove(selectAccident.object.points.obj);
console.log(selectAccident);
for(let i=0;i<scope.accidentList[nowSceneType].length;i++){
if(scope.accidentList[nowSceneType][i].id == selectAccident.id){
scope.accidentList[nowSceneType].splice(i,1);
jl3dUpdateAccidentlist(scope.accidentList[nowSceneType]);
break;
}
}
}
this.loadAccidentList = function(accidentList){
console.log(accidentList);
for(let i=0;i<accidentList.length;i++){
let newAccident = {
id:accidentList[i].id,
name:accidentList[i].name,
label:accidentList[i].label,
type:accidentList[i].type,
object:{},
pos:accidentList[i].pos,
sceneType:accidentList[i].sceneType,
showType:"loadModel",
};
if(accidentList[i].type == "fire"){
newAccident.object = new Fire();
newAccident.object.createNew(groupList[accidentList[i].sceneType],accidentList[i].pos);
}
scope.accidentList[accidentList[i].sceneType].push(newAccident);
// jl3dUpdateAccidentlist(scope.accidentList[accidentList[i].sceneType]);
}
}
this.changeAccidentStatus = function(){
}
this.update = function(){
for(let i=0;i<scope.accidentList[updateSceneType].length;i++){
scope.accidentList[updateSceneType][i].object.update();
}
}
}

View File

@ -0,0 +1,391 @@
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export function AssetModelManager(editor,scene) {
let scope = this;
this.assetList = [];
this.otherModel = new THREE.Group();
//场景中可触发事件模型
this.lessonTriggerList = [];
scope.lessonTriggerList["standstation"] = [];
scope.lessonTriggerList["stopstation"] = [];
scope.lessonTriggerList["occ"] = [];
scope.lessonTriggerList["device"] = [];
scope.lessonTriggerList["xl"] = [];
scope.lessonTriggerList["dc"] = [];
let groupList = [];
groupList["standstation"] = new THREE.Group();
groupList["stopstation"] = new THREE.Group();
groupList["occ"] = new THREE.Group();
groupList["device"] = new THREE.Group();
groupList["xl"] = new THREE.Group();
groupList["dc"] = new THREE.Group();
let geometryDevice = new THREE.PlaneGeometry( 100, 100, 32 );
let materialDevice = new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide} );
let planeDevice = new THREE.Mesh( geometryDevice, materialDevice );
planeDevice.rotation.x = -Math.PI/2;
groupList["device"].add(planeDevice);
let geometryXl = new THREE.PlaneGeometry( 100, 100, 32 );
let materialXl = new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide} );
let planeXl = new THREE.Mesh( geometryXl, materialXl );
planeXl.rotation.x = -Math.PI/2;
groupList["xl"].add(planeXl);
this.loadAsset = [];
this.staticAsset = [];
scope.staticAsset['station'] = {
modelId:'station',
packageName:"车站",
url:"/MODEL/2021-09-08/211-9861.FBX",
mesh:"",
assetType:'onlineasset',
isUse:true,
resourceType:"三维课程",
sceneType:"standstation",
};
scope.staticAsset['FTDH'] = {
modelId:'FTDH',
packageName:"电扶梯",
url:JL3D_LOCAL_STATIC+"/lesson3d/FTDH.FBX",
mesh:"",
assetType:'static',
isUse:true,
resourceType:"三维课程",
sceneType:"standstation",
};
scope.staticAsset['IN'] = {
modelId:'IN',
packageName:"进闸机",
url:JL3D_LOCAL_STATIC+"/lesson3d/IN.FBX",
mesh:"",
assetType:'static',
isUse:true,
resourceType:"三维课程",
sceneType:"standstation",
};
scope.staticAsset['OUT'] = {
modelId:'OUT',
packageName:"出闸机",
url:JL3D_LOCAL_STATIC+"/lesson3d/OUT.FBX",
mesh:"",
assetType:'static',
isUse:true,
resourceType:"三维课程",
sceneType:"standstation",
};
scope.staticAsset['PBMDH'] = {
modelId:'PBMDH',
packageName:"屏蔽门",
url:JL3D_LOCAL_STATIC+"/lesson3d/PBMDH.FBX",
mesh:"",
assetType:'static',
isUse:true,
resourceType:"三维课程",
sceneType:"standstation",
};
scope.staticAsset['wxc'] = {
modelId:'wxc',
packageName:"维修厂",
url:"/MODEL/2021-08-12/196-43574.FBX",
mesh:"",
assetType:'onlineasset',
isUse:true,
resourceType:"三维课程",
sceneType:"stopstation",
};
scope.staticAsset['occ'] = {
modelId:'occ',
packageName:"occ大厅",
url:"/MODEL/2021-09-02/210-32471.FBX",
mesh:"",
assetType:'onlineasset',
isUse:true,
resourceType:"三维课程",
sceneType:"occ",
};
this.changeSceneGroup = function(groupType){
// console.log(groupType);
// console.log(editor.nowSceneType);
// console.log(scope.lessonTriggerList[editor.nowSceneType]);
editor.nowSceneType = groupType;
scene.remove(this.otherModel);
this.otherModel = groupList[groupType];
scene.add(this.otherModel);
updateTriggerList(scope.lessonTriggerList[editor.nowSceneType]);
}
this.saveModelList = function(){
let modelList = {
assetList:[],
modelList:[],
};
for(let k in scope.loadAsset){
modelList.assetList.push({
modelId:scope.loadAsset[k].modelId,
packageName:scope.loadAsset[k].packageName,
url:scope.loadAsset[k].url,
assetType:scope.loadAsset[k].assetType,
isUse:scope.loadAsset[k].isUse,
resourceType:scope.loadAsset[k].resourceType,
sceneType:scope.loadAsset[k].sceneType,
});
}
for(let g in scope.lessonTriggerList){
for(let i=0;i<scope.lessonTriggerList[g].length;i++){
if(scope.lessonTriggerList[g][i].showType != "default"){
modelList.modelList.push({
name:scope.lessonTriggerList[g][i].name,
modelId:scope.lessonTriggerList[g][i].modelId,
label:scope.lessonTriggerList[g][i].label,
pos:{
x:scope.lessonTriggerList[g][i].position.x,
y:scope.lessonTriggerList[g][i].position.y,
z:scope.lessonTriggerList[g][i].position.z
},
rot:{
x:scope.lessonTriggerList[g][i].rotation.x,
y:scope.lessonTriggerList[g][i].rotation.y,
z:scope.lessonTriggerList[g][i].rotation.z
},
showType:scope.lessonTriggerList[g][i].showType,
visible:scope.lessonTriggerList[g][i].visible,
sceneType:scope.lessonTriggerList[g][i].sceneType,
});
}
}
}
console.log(modelList);
return modelList;
}
//加载课程资源
this.lessonAssetsLoader = function(lessonData){
let initlist = [];
if(lessonData){
// scene.remove(this.otherModel);
this.otherModel = groupList[lessonData.lessonProgress[0].progressScene];
scene.add(this.otherModel);
let assetList = lessonData.assetList;
for(let i = 0;i<assetList.length;i++){
assetList[i].mesh = "";
// assetList[i].sceneType = "standstation";
if(assetList[i].modelId == "default1"){
}else{
scope.loadAsset[assetList[i].modelId] = assetList[i];
}
}
}else{
this.otherModel = groupList["standstation"];
scene.add(this.otherModel);
}
for(let k in scope.staticAsset){
initlist.push(fbxpromise(scope.staticAsset[k]));
}
for(let k in scope.loadAsset){
initlist.push(fbxpromise(scope.loadAsset[k]));
}
return new Promise(function(resolve, reject){
Promise.all(initlist).then((result) => {
initTriggerList();
if(lessonData){
let modelList = lessonData.modelList;
for(let i=0;i<modelList.length;i++){
let newModelTrigger = scope.loadAsset[modelList[i].modelId].mesh.clone(true);
// modelList[i].sceneType = "standstation";
newModelTrigger.showType = "loadModel";
newModelTrigger.label = modelList[i].label;
newModelTrigger.modelId = modelList[i].modelId;
newModelTrigger.visible = modelList[i].visible;
newModelTrigger.position.x = modelList[i].pos.x;
newModelTrigger.position.y = modelList[i].pos.y;
newModelTrigger.position.z = modelList[i].pos.z;
newModelTrigger.rotation.x = modelList[i].rot.x;
newModelTrigger.rotation.y = modelList[i].rot.y;
newModelTrigger.rotation.z = modelList[i].rot.z;
newModelTrigger.sceneType = modelList[i].sceneType;
scope.lessonTriggerList[modelList[i].sceneType].push(newModelTrigger);
groupList[modelList[i].sceneType].add(newModelTrigger);
}
}
editor.changeIndex(0);
updateTriggerList(scope.lessonTriggerList[editor.nowSceneType]);
resolve("loaderassets"); //['成功了', 'success']
}).catch((error) => {
//console.log(error);
});
});
}
this.deleteAsset = function(selectModel,nowSceneType){
scope.otherModel.remove(selectModel);
for(let i=0;i<scope.lessonTriggerList[nowSceneType].length;i++){
if(scope.lessonTriggerList[nowSceneType][i].uuid == selectModel.uuid){
scope.lessonTriggerList[nowSceneType].splice(i,1);
updateTriggerList(scope.lessonTriggerList[nowSceneType]);
break;
}
}
}
// <el-option label="车站" value="standstation"></el-option>
// <el-option label="停车场" value="stopstation"></el-option>
// <el-option label="单体设备" value="device"></el-option>
// <el-option label="线路" value="xl"></el-option>
// <el-option label="道岔" value="dc"></el-option>
//FT 扶梯
//FTAN 扶梯按钮(急停)
//FTD 扶梯灯
//FTKG 扶梯开关(钥匙孔)
//FTTJ 扶梯台阶
function initTriggerList(){
scope.staticAsset['station'].mesh.getObjectByName("FTAN").showType = "default";
scope.staticAsset['station'].mesh.getObjectByName("FTAN").label = "扶梯急停按钮";
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("FTAN"));
scope.staticAsset['station'].mesh.getObjectByName("FTKG").showType = "default";
scope.staticAsset['station'].mesh.getObjectByName("FTKG").label = "扶梯钥匙孔";
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("FTKG"));
scope.staticAsset['station'].mesh.getObjectByName("spbmkg").showType = "default";
scope.staticAsset['station'].mesh.getObjectByName("spbmkg").label = "屏蔽门开关";
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("spbmkg"));
scope.staticAsset['station'].mesh.getObjectByName("DMH").showType = "default";
scope.staticAsset['station'].mesh.getObjectByName("DMH").label = "隔离门";
scope.lessonTriggerList["standstation"].push(scope.staticAsset['station'].mesh.getObjectByName("DMH"));
// console.log(scope.loadAsset['default1'].mesh.getObjectByName("FTKG"));
}
//动态加载资源
this.lessonAssetsNewLoader = function(assetData,pos,nowSceneType){
let isLoaded = false;
var rand = Math.floor(Math.random () * 900) + 100;
if(scope.loadAsset[assetData.id]){
let newModelTrigger = scope.loadAsset[assetData.id].mesh.clone(true);
newModelTrigger.modelId = assetData.id;
newModelTrigger.showType = "loadModel";
newModelTrigger.label = assetData.packageName +rand;
newModelTrigger.position.copy(pos);
newModelTrigger.sceneType = nowSceneType;
scope.lessonTriggerList[nowSceneType].push(newModelTrigger);
groupList[nowSceneType].add(newModelTrigger);
updateTriggerList(scope.lessonTriggerList[nowSceneType]);
}else{
scope.loadAsset[assetData.id] = {
modelId:assetData.id,
packageName:assetData.packageName +rand,
url:assetData.url,
mesh:"",
assetType:'loadModel',
isUse:true,
resourceType:"三维课程",
sceneType:nowSceneType,
};
console.log("new");
fbxpromise(scope.loadAsset[assetData.id]).then(function(object){
console.log(scope.loadAsset[assetData.id].mesh);
let newModelTrigger = scope.loadAsset[assetData.id].mesh.clone(true);
newModelTrigger.showType = "loadModel";
newModelTrigger.modelId = assetData.id;
newModelTrigger.label = assetData.packageName+rand;
newModelTrigger.position.copy(pos);
newModelTrigger.sceneType = nowSceneType;
scope.lessonTriggerList[nowSceneType].push(newModelTrigger);
groupList[nowSceneType].add(newModelTrigger);
updateTriggerList(scope.lessonTriggerList[nowSceneType]);
// resolve("loadednew");
});
}
}
//fbx模型加载
function fbxpromise(asset){
return new Promise(function(resolve, reject){
var loader = new THREE.FBXLoader();
// console.log(asset);
// console.log(asset.url);
if(asset.assetType == "static"){
loader.load( asset.url, function ( object ) {
if(asset.sceneType){
object.sceneType = asset.sceneType;
}
asset.mesh = object;
groupList[asset.sceneType].add(object);
// scope.otherModel.add(object);
resolve();
} );
}else if(asset.assetType == "onlineasset"){
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
if(asset.sceneType){
object.sceneType = asset.sceneType;
}
asset.mesh = object;
groupList[asset.sceneType].add(object);
resolve();
} );
}else{
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
if(asset.sceneType){
object.sceneType = asset.sceneType;
}
asset.mesh = object;
if(asset.assetType == "default"){
console.log(object);
// scene.add(object);
}else if(asset.assetType == 'loadModel'){
}
resolve();
} );
}
});
}
}

View File

@ -9,6 +9,7 @@ export function LessonData() {
this.lessonData = {
//资源列表
assetList:[],
accidentList:[],
setup:{
examMode:"",
checkedRole:"",
@ -32,7 +33,7 @@ export function LessonData() {
roleName:"",
roleUse:true,
score:0,
progressScene:"",
progressScene:"standstation",
nextCode:"",
nextNode:"",
triggerType:"",

View File

@ -102,7 +102,7 @@ export function DriverLoadNew(data,scope,netdata,mapdata,sectionlist,signallist,
.then(function(data){
//console.log(data);
//console.log(assetloader);
console.log(stationstandlist);
// console.log(stationstandlist);
return tdt.initTdt(stationstandlist.list,mapdata.sectionList,rails.sectionrail,sceneload);
})
.then(function(data){

View File

@ -36,11 +36,11 @@ export function TdtList() {
let pos = stationData[k].mesh.position;
if(stationData[k].stands[i].right == true){
newmesh.rotation.y = -Math.PI/2;
newmesh.position.set(pos.x+75,0,pos.z+14.8);
newmesh.position.set(pos.x+75,0,pos.z+12.8);
}else{
newmesh.rotation.y = Math.PI/2;
newmesh.position.set(pos.x-75,0,pos.z-14.8);
newmesh.position.set(pos.x-75,0,pos.z-12.8);
}

View File

@ -32,8 +32,7 @@ deviceState[deviceType.Switch] = {
blockade: 0, // 是否封锁
routeLock: 0, // 是否进路锁闭
overlapLock: 0, // 是否进路延续保护锁闭
normalPosition: 1, // 是否定位
reversePosition: 0, // 是否反位
pos:'N', // // 道岔位置定位、反位 N-定位 R-反位 NO-无(失表) EX-挤叉
isCiConfirm: 0, // 是否进行联锁确认
/** 定位状态*/
// locateType: {
@ -72,9 +71,7 @@ deviceState[deviceType.Switch] = {
deviceState[deviceType.Signal] = {
blockade: 0, // 是否锁闭
logicLight: 0, // 逻辑点灯
greenOpen: 0, // 绿灯开放
yellowOpen: 0, // 黄灯开放
redOpen: 1, // 红灯开放(默认状态)
aspect:'R', // 信号机颜色默认状态
delayTime: 0, // 信号机延迟解锁倒计时
atsControl: 1, // 0是人工1是自动
checkConflict:0, // 0是不检查冲突1是检测冲突检测冲突进路

View File

@ -45,8 +45,7 @@ class Status {
blockade: device.blockade, // 是否封锁
routeLock: device.routeLock, // 是否进路锁闭
overlapLock: device.overlapLock, // 是否进路延续保护锁闭
normalPosition: device.normalPosition, // 是否定位
reversePosition: device.reversePosition, // 是否反位
pos:device.pos, // 道岔位置定位、反位 N-定位 R-反位 NO-无(失表) EX-挤叉
fault: device.fault /** 非故障*/
};
}
@ -56,9 +55,7 @@ class Status {
atsControl: device.atsControl, /** 0是人工控制1是自动控制 */
blockade: device.blockade,
logicLight: device.logicLight,
greenOpen: device.greenOpen,
redOpen: device.redOpen,
yellowOpen: device.yellowOpen,
aspect:device.aspect, // 信号机颜色默认状态 R-红 G-绿 Y-黄 W-月白 B-蓝 RY-红黄 RW-红白 GG-绿绿 GY-绿黄 YY-黄黄 RF-红闪 YF-黄闪 GF-绿闪 WF-白闪
ciControl: device.ciControl || 0,
canSetCi: !!device.canSetCi
};

View File

@ -37,6 +37,9 @@ class Jlmap {
// 设备数据
this.mapDevice = {};
// 大屏配置
this.splitList = [];
// 默认状态
this.defaultStateDict = this.loadDefaultState();
@ -143,6 +146,7 @@ class Jlmap {
setOptions(opts) {
const options = this.pullBack(opts);
if (this.screenFlag) {
this.$options.update(options);
this.$painter.updateScreen(options);
} else {
this.$options.update(options);
@ -216,8 +220,6 @@ class Jlmap {
setUpdateScreen(opts) {
this.setRecover({ scaleRate: 1, offsetX: 0, offsetY: 0 });
this.screenFlag = true;
const screenList = [];
const rectList = [];
let rect = '';
for (const i in this.mapDevice) {
const element = this.mapDevice[i];
@ -233,31 +235,56 @@ class Jlmap {
opts.offsetList = [];
}
const screenSplit = opts.list.length ? opts.list : Vue.prototype.$theme.loadPropConvert(this.lineCode).screenSplit;
const screenDifference = Vue.prototype.$theme.loadPropConvert(this.lineCode).screenDifference || 160;
const splitList = JSON.parse(JSON.stringify(screenSplit));
this.splitList = JSON.parse(JSON.stringify(screenSplit));
const num = screenSplit.length + 1;
const offsetY = (opts.height - 100) / num; // 高度差
const maxWidth = rect.width;
splitList.push(maxWidth);
this.splitList.push(maxWidth);
const scaleX = Math.floor((((opts.width - 200) * num) / rect.width) * 100) / 100;
const scaleY = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100;
const scale = Math.min(scaleX, scaleY);
this.screenScale = Math.min(scaleX, scaleY);
for (let i = 0; i < splitList.length; i++) {
this.optsWidth = opts.width;
this.optsHeight = opts.height;
this.optsOffsetList = opts.offsetList;
const scaleBili = this.screenScale;
this.$options.scaleRate = this.screenScale || 1;
this.$options.scaleIndex = 0;
this.$options.offsetX = 0;
this.$options.offsetY = 0;
// 更新视图大小
// this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
const {screenList, rectList} = this.calculateScreenPosition(scaleBili);
this.$painter.updateTransform1(screenList, rectList);
}
calculateScreenPosition(scaleBili) {
const screenList = [];
const rectList = [];
const screenDifference = Vue.prototype.$theme.loadPropConvert(this.lineCode).screenDifference || 160;
const bili = scaleBili / this.screenScale;
const offsetY = (this.optsHeight - 100) / this.splitList.length; // 高度差
for (let i = 0; i < this.splitList.length; i++) {
let offsetX = '';
if (i == 0) {
offsetX = -(opts.width - splitList[0] * scale) / 2;
offsetX = -(this.optsWidth - this.splitList[0] * scaleBili) / 2;
} else {
const dx = (opts.width - (splitList[i] - splitList[i - 1]) * scale) / 2; // 居中计算偏移值
offsetX = splitList[i - 1] * scale - dx;
const dx = (this.optsWidth - (this.splitList[i] - this.splitList[i - 1]) * scaleBili) / 2; // 居中计算偏移值
offsetX = this.splitList[i - 1] * scaleBili - dx;
}
const offset = opts.offsetList[i] || 0;
const param = { scaleRateX: scale, scaleRateY: scale, offsetX: offsetX, offsetY: -screenDifference - (offsetY * i) - offset };
const offset = this.optsOffsetList[i] || 0;
const param = { scaleRateX: scaleBili, scaleRateY: scaleBili, offsetX: offsetX, offsetY: (-screenDifference - (offsetY * i) - offset) * bili };
screenList.push(param);
const rect = {x: 0, y: 0, width: Number(splitList[i]) + 5, height: opts.height};
const rect = {x: 0, y: 0, width: Number(this.splitList[i]) + 5, height: this.optsHeight};
rectList.push(rect);
}
this.$painter.updateTransform1(screenList, rectList);
return {
screenList,
rectList
};
}
setLevelVisible(list) {

View File

@ -225,6 +225,11 @@ class Painter {
this.screenFlag = true;
this.$transformHandleScreen.updateTransform(list, opts);
}
updateScreenZoom(bili) {
return this.$jmap.calculateScreenPosition(bili);
}
/**
* 更新zrender尺寸
* @param {*} opt

View File

@ -93,12 +93,12 @@ export default class EBadShunt extends Group {
if (swch && swch.instance) {
const traingle = new JTriangle(swch.intersection, swch.skew);
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && !swch.normalPosition && swch.sectionCCode == model.code) {
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && swch.pos != 'N' && swch.sectionCCode == model.code) {
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
}
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.normalPosition && swch.sectionCCode == model.code) {
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.pos == 'N' && swch.sectionCCode == model.code) {
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
}

View File

@ -93,12 +93,12 @@ export default class ELimitLines extends Group {
if (swch && swch.instance) {
const traingle = new JTriangle(swch.intersection, swch.skew);
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && !swch.normalPosition && swch.sectionCCode == model.code) {
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && swch.pos != 'N' && swch.sectionCCode == model.code) {
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
}
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.normalPosition && swch.sectionCCode == model.code) {
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.pos == 'N' && swch.sectionCCode == model.code) {
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
}

View File

@ -388,17 +388,18 @@ export default class Section extends Group {
const sectionB = this.mapDevice[switchModel.sectionBCode];
const sectionC = this.mapDevice[switchModel.sectionCCode];
const sectionA = this.mapDevice[switchModel.sectionACode];
if (switchModel && switchModel.normalPosition === 1) {
// N-定位 R-反位 NO-无(失表) EX-挤叉
if (switchModel && switchModel.pos === 'N') {
this.setSwitchSectionColor(sectionC, sectionB);// 定位
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && switchModel.fault !== 'SPLIT') {
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && switchModel.fault !== 'SPLIT') {
this.setSwitchSectionColor(sectionC, sectionB);// 反位转定位前
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'normal' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'NORMAL_SPLIT')) {
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'normal' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'NORMAL_SPLIT')) {
this.setSwitchSectionColor(sectionC, sectionB);// 定位变失表或定位失表
} else if (switchModel && switchModel.reversePosition === 1) {
} else if (switchModel && switchModel.pos === 'R') {
this.setSwitchSectionColor(sectionB, sectionC); // 反位
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'normal' && switchModel.fault !== 'SPLIT') {
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'normal' && switchModel.fault !== 'SPLIT') {
this.setSwitchSectionColor(sectionB, sectionC); // 定位转反位前
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'REVERSE_SPLIT')) {
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'REVERSE_SPLIT')) {
this.setSwitchSectionColor(sectionB, sectionC);// 反位变失表后反位失表
}
if (this.style.Section.switchFault && switchModel.fault === 'SQUEEZE') {

View File

@ -826,8 +826,6 @@ class Signal extends Group {
}
if (this.style.Signal.post.autoRouteColor) {
this.sigPost.setColor(this.style.Signal.post.autoRouteColor);
} else if (this.style.Signal.post.autoRouteVerColor) {
this.sigPost.setVerColor(this.style.Signal.post.autoRouteVerColor);
}
}
@ -966,10 +964,32 @@ class Signal extends Group {
model.isRouteSignal && this.setLowButtonShow();
/** 设置灯的颜色 */
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放
model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示
switch (model.aspect) {
// 红
case 'R': {
this.close(model.logicLight); // 信号关闭
break;
}
// 绿
case 'G': {
this.openPositive(model.logicLight); // 信号正向开放
break;
}
// 黄
case 'Y': {
this.openLateral(model.logicLight); // 信号侧向开放
break;
}
// 红黄
case 'RY': {
this.guid(); // 引导信号显示
break;
}
default: {
break;
}
}
if (model.remainTime) {
this.showRemainTime(model.remainTime);
} else {
@ -1034,12 +1054,15 @@ class Signal extends Group {
});
}
}
// LEVEL_Close = 0;---关闭 LEVEL_Guide = 1;-----引导级 LEVEL_Atp = 2;-----ATP级 LEVEL_Main = 3-----主信号级
if ( model.level === 3 && this.style.Signal.post.mainSignalVerColor && !model.fleetMode) {
this.sigPost.setVerColor(this.style.Signal.post.mainSignalVerColor);
} else if (model.level === 1 && this.style.Signal.post.closeSignalVerColor && !model.fleetMode) {
} else if (model.level === 0 && this.style.Signal.post.closeSignalVerColor && !model.fleetMode) {
this.sigPost.setVerColor(this.style.Signal.post.closeSignalVerColor);
} else if (model.level === 2 && this.style.Signal.post.guideSignalVerColor && !model.fleetMode) {
} else if (model.level === 1 && this.style.Signal.post.guideSignalVerColor && !model.fleetMode) {
this.sigPost.setVerColor(this.style.Signal.post.guideSignalVerColor);
} else if (model.level === 2 && this.style.Signal.post.autoRouteVerColor && !model.fleetMode) {
this.sigPost.setVerColor(this.style.Signal.post.autoRouteVerColor);
}
if (this.style.Signal.lamp.special) {
@ -1059,7 +1082,7 @@ class Signal extends Group {
this.tText && this.tText.show();
}
// 设置灰显
if (model.noStatus || model.level === 0) {
if (model.noStatus) {
this.setAshShow();
}

View File

@ -86,12 +86,12 @@ class EMouse extends Group {
stroke: this.device.__over
? this.device.style.Switch.mouseOverStyle.coreBackgroundColorOver
: this.device.style.Switch.mouseOverStyle.coreBackgroundColor
})
});
this.device.shapeModelB.addHover({
stroke: this.device.__over
? this.device.style.Switch.mouseOverStyle.coreBackgroundColorOver
: this.device.style.Switch.mouseOverStyle.coreBackgroundColor
})
});
}
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
@ -114,7 +114,8 @@ class EMouse extends Group {
if (this.device.style.Switch.mouseOverStyle.coreBackgroundColor) {
this.device.shapeModelA.removeHover();
this.device.shapeModelB.removeHover();
if (this.device.model.normalPosition) {
// if (this.device.model.normalPosition) {
if (this.device.model.pos == 'N') {
this.device.shapeModelA.hide();
this.device.shapeModelB.show();
} else {

View File

@ -433,15 +433,17 @@ export default class Switch extends Group {
.when(1000, { stroke: this.style.backgroundColor })
.start();
}
setSwitchFault(fault, normalPosition, reversePosition) {
if (this.style.Switch.jointImg.faultStatus && fault && !reversePosition && !normalPosition ) { // 宁波线失表状态
this.setForkAction(); // 道岔挤岔
// N-定位 R-反位 NO-无(失表) EX-挤叉
setSwitchFault(fault, pos) {
if (this.style.Switch.jointImg.faultStatus && fault && (pos == 'NO' || pos == 'EX') ) { // 宁波线失表状态
this.setForkAction(fault); // 道岔挤岔
} else if (this.style.Switch.faultNoHandle ) {
this.shapeModelA.hide();
this.shapeModelB.hide();
this.shapeModelC.hide();
} else {
if (this.model.switchFaultCode && (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition))) {
// (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition))
if (this.model.switchFaultCode && (pos == 'NO' || pos == 'EX') ) {
const switchFault = this.mapDevice[this.model.switchFaultCode];
switchFault.instance.setControlColor('#F00', true);
} else if (this.model.switchFaultCode) {
@ -455,7 +457,7 @@ export default class Switch extends Group {
}
}
/** 挤叉*/
setForkAction() {
setForkAction(fault) {
if (this.style.Switch.jointImg.fork) {
this.recover();
this.shapeModelB.show();
@ -483,11 +485,13 @@ export default class Switch extends Group {
.start();
});
this.setTextColor('red');
} else {
this.setLossAction(fault); // 若不是具有特殊的挤岔,则显示状态和失表一样
}
}
/** 单锁*/
setMonolock(normalPosition, reversePosition) {
setMonolock(pos) {
if (this.style.Switch.rectLock &&
this.style.Switch.rectLock.monolock) { // 判断单锁矩形是否显示
this.lockRect.show();
@ -503,9 +507,9 @@ export default class Switch extends Group {
if (this.style.Switch.arcBlcok &&
this.style.Switch.arcBlcok.show) { // 圆形单锁是否显示
this.lockArc.show();
if (normalPosition) {
if (pos == 'N') {
this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.locationColor });
} else if (reversePosition) {
} else if (pos == 'R') {
this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.inversionColor });
}
}
@ -513,7 +517,7 @@ export default class Switch extends Group {
}
/** 封锁 */
block(normalPosition, reversePosition) {
block(pos) {
if (this.style.Switch.jointImg.block) { // 宁波专用封锁显示
this.shapeModelB.show();
this.shapeModelB.animateStyle(item => {
@ -547,10 +551,10 @@ export default class Switch extends Group {
this.setTextColor(this.style.Switch.text.blockText);
}
if (this.style.Switch.jointImg.trapezoidBlock) { // 范围且封锁时显示
if (normalPosition) {
if ( pos == 'N') {
this.shapeModelB.show();
this.shapeModelB.setColor('#000080');
} else if (reversePosition) {
} else if ( pos == 'R') {
this.shapeModelA.show();
this.shapeModelA.setColor('#000080');
}
@ -600,11 +604,11 @@ export default class Switch extends Group {
// 处理岔芯颜色
setSectionState(state) {
const sectionC = this.mapDevice[state.sectionCCode];
if (sectionC && state.reversePosition && !state.blockade) {
if (sectionC && state.pos == 'R' & !state.blockade) {
this.setSwitchModelStatus(this.shapeModelA, sectionC);
}
const sectionA = this.mapDevice[state.sectionACode];
if (sectionA && state.normalPosition && !this.style.Switch.core.graphShow && !state.blockade) {
if (sectionA && state.pos == 'N' && !this.style.Switch.core.graphShow && !state.blockade) {
this.setSwitchModelStatus(this.shapeModelB, sectionA);
}
}
@ -650,23 +654,23 @@ export default class Switch extends Group {
this.shapeModelC.setColor('#7F7F7F');
this.name.getNameText().setStyle({textFill: '#7F7F7F'});
}
preReset(normalPosition, reversePosition ) {
preReset(pos) {
const coverBlock = this.style.Switch.coverBlock;
if (coverBlock && coverBlock.preResetColor) { // 范围且封锁时显示
if (normalPosition) {
if (pos == 'N') {
this.shapeModelB.show();
this.shapeModelB.setColor(coverBlock.preResetColor);
} else if (reversePosition) {
} else if (pos == 'R') {
this.shapeModelA.show();
this.shapeModelA.setColor(coverBlock.preResetColor);
}
} else {
const sectionReset = this.style.Section.sectionMiddle;
if (sectionReset && sectionReset.preResetColor) {
if (normalPosition) {
if (pos == 'N') {
this.shapeModelB.show();
this.shapeModelB.setColor(sectionReset.preResetColor);
} else if (reversePosition) {
} else if (pos == 'R') {
this.shapeModelA.show();
this.shapeModelA.setColor(sectionReset.preResetColor);
}
@ -678,13 +682,13 @@ export default class Switch extends Group {
this.recover();
// 只响应前端自定义类型的状态变化
if (model._free) {
if (model.normalPosition) {
if (model.pos == 'N') {
this.switchPosition = 'normal';
this.setLocationAction(model); /** 定位*/
if (model.routeLock) {
this.setSectionState(model);
}
} else if (model.reversePosition) {
} else if (model.pos == 'R') {
this.switchPosition = 'reverse';
this.setInversionAction(model); /** 反位*/
if (model.routeLock) {
@ -694,23 +698,26 @@ export default class Switch extends Group {
this.setAshShow();
}
} else {
this.setSwitchFault(model.fault, model.normalPosition, model.reversePosition);
if (model.normalPosition) {
this.setSwitchFault(model.fault, model.pos);
// model.pos == 'NO' || model.pos == 'EX';
// N-定位 R-反位 NO-无(失表) EX-挤叉
if (model.pos == 'N') {
this.switchPosition = 'normal';
this.setLocationAction(model); /** 定位*/
} else if (model.reversePosition) {
} else if (model.pos == 'R') {
this.switchPosition = 'reverse';
this.setInversionAction(model); /** 反位*/
} else {
} else if (model.pos == 'NO') {
this.setLossAction(model.fault); // 失去
if (model.switchSplit) {
this.setForkAction();
}
} else if (model.pos == 'EX') {
this.setForkAction(model.fault); // 挤岔
}
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
model.singleLock && this.setMonolock(model.normalPosition, model.reversePosition); // 道岔单锁
model.blockade && this.block(model.normalPosition, model.reversePosition); // 道岔封锁
model.singleLock && this.setMonolock(model.pos); // 道岔单锁
model.blockade && this.block(model.pos); // 道岔封锁
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
const path = window.location.href;
if (!path.includes('/map/draw')) {
@ -720,7 +727,7 @@ export default class Switch extends Group {
model.routeLock && this.handleRouteLock(); // 道岔进路锁闭
model.overlapLock && this.handleOverlapLock(); // 道岔进路延续保护
// this.interlockingReserved(); // 联锁预留道岔
model.preReset && this.preReset(model.normalPosition, model.reversePosition); // 道岔预复位
model.preReset && this.preReset(model.pos); // 道岔预复位
if (this.style.Switch.sectionAction.flag && this.model.showMode !== '05') { // 哈尔滨线路处理道岔相关区段颜色
const switchModel = this.mapDevice[model.code];

View File

@ -243,7 +243,7 @@ export default {
}
case OperationEvent.Signal.reopenSignal.button.operation: {
//
if (selectType.greenOpen) {
if (selectType.aspect == 'G') { // 绿
this.$refs.noticeInfo.doShow(`信号机[${selectType.name}(${selectType.code})]已开启,无需重开信号机`);
} else {
//

View File

@ -173,14 +173,14 @@ export default {
switch (buttonOperation) {
case OperationEvent.Switch.locate.button.operation: {
//
if (!selectType.normalPosition && selectType.reversePosition) {
if (selectType.pos == 'R') {
this.locate(selectType);
}
break;
}
case OperationEvent.Switch.reverse.button.operation: {
//
if (selectType.normalPosition && !selectType.reversePosition) {
if (selectType.pos == 'N') {
this.reverse(selectType);
}
break;

View File

@ -316,7 +316,7 @@ export default {
},
checkRoutes(routes) {
const route = routes.filter(route => {
return route.greenOpen;
return route.aspect == 'G';
});
return route[0].code;
},

View File

@ -348,7 +348,7 @@ export default {
}
}
//
if (signal.redOpen && !signal.greenOpen && !signal.yellowOpen && isArrangementRoute) { //
if (signal.aspect == 'R' && isArrangementRoute) { //
operate.over = true;
operate.cmdType = CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL;
operate.code = deviceList[0].code;
@ -580,7 +580,7 @@ export default {
operation: this.$store.state.menuOperation.buttonOperation
};
if (model.yellowOpen && model.redOpen) {
if (model.aspect == 'RY') {
operate.cmdType = CMD.Signal.CMD_SIGNAL_CLOSE_GUIDE;
operate.param = {signalCode: model.code};
this.deviceList = [];

View File

@ -146,7 +146,7 @@ export default {
}
},
'$store.state.menuOperation.selectedCount': function(val) {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Switch') {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Section') {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
}
}
@ -193,19 +193,32 @@ export default {
}
},
operationHandler(buttonOperation, selectType) {
debugger;
switch (buttonOperation) {
case OperationEvent.Section.fault.button.operation: {
//
if (!selectType.normalPosition && selectType.reversePosition) {
this.locate(selectType);
debugger;
commitOperate(menuOperate.Section.fault, {sectionCode:selectType.code}, 3).then(({valid, operate})=>{
if (valid) {
// this.$refs.sectionUnLock.doShow(operate, this.selected);
}
}).catch(error=>{
console.log(error);
this.$refs.noticeInfo.doShow();
});
break;
}
case OperationEvent.Section.axlePreReset.button.operation: {
//
if (selectType.normalPosition && !selectType.reversePosition) {
this.reverse(selectType);
debugger;
commitOperate(menuOperate.Section.axlePreReset, {sectionCode:selectType.code}, 3).then(({valid, operate})=>{
if (valid) {
// this.$refs.sectionUnLock.doShow(operate, this.selected);
}
}).catch(error=>{
console.log(error);
this.$refs.noticeInfo.doShow();
});
break;
}
}

View File

@ -213,14 +213,14 @@ export default {
switch (buttonOperation) {
case OperationEvent.Switch.locate.button.operation: {
//
if (!selectType.normalPosition && selectType.reversePosition) {
if (selectType.pos == 'R') {
this.locate(selectType);
}
break;
}
case OperationEvent.Switch.reverse.button.operation: {
//
if (selectType.normalPosition && !selectType.reversePosition) {
if (selectType.pos == 'N') {
this.reverse(selectType);
}
break;

View File

@ -33,7 +33,7 @@
</el-row>
</el-col>
<el-col v-show="showExpand" :span="showExpand? 18: 0">
<map-visual ref="map" :mapData="mapData" :width="780" :height="600" />
<map-visual ref="map" :map-data="mapData" :width="780" :height="600" />
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
@ -99,7 +99,7 @@ export default {
return '进路设置';
},
expandTitle() {
return this.showExpand? '收起进路预览' : '展开进路预览'
return this.showExpand ? '收起进路预览' : '展开进路预览';
},
commitDisabled() {
let disabled = true;
@ -183,8 +183,8 @@ export default {
if (this.beforeSwitchList && this.beforeSwitchList.length) {
this.beforeSwitchList.forEach(el => {
el.normalPosition = false;
el.reversePosition = false;
// N- R- NO-() EX-
el.pos = 'NO';
el.routeLock = false;
});
}
@ -235,7 +235,8 @@ export default {
const sectionA = this.$refs.map.getDeviceByCode(swch.sectionACode);
const sectionB = this.$refs.map.getDeviceByCode(swch.sectionBCode);
const sectionC = this.$refs.map.getDeviceByCode(swch.sectionCCode);
containSwitchList.push({code: el.switchCode, routeLock: true, normalPosition: el.normal, reversePosition: !el.normal});
// normalPosition: el.normal, reversePosition: !el.normal
containSwitchList.push({code: el.switchCode, routeLock: true, pos:el.pos });
if (el.normal) {
containSectionList.push({code: sectionA.code, routeLock:true });
containSectionList.push({code: sectionC.code, preBlue: true });

View File

@ -132,17 +132,8 @@ export default {
},
getSignalShow(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);
if (signalEle.redOpen && !signalEle.yellowOpen && !signalEle.greenOpen) {
return '红';
} else if (!signalEle.redOpen && !signalEle.yellowOpen && signalEle.greenOpen) {
return '绿';
} else if (!signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
return '黄';
} else if (signalEle.redOpen && signalEle.yellowOpen && !signalEle.greenOpen) {
return '引导';
} else {
return '';
}
const data = {'R':'红', 'G':'绿', 'Y':'黄', 'RY':'引导'};
return data[signalEle.aspect] || '';
},
getCanGuide(code) {
const signalEle = this.$store.getters['map/getDeviceByCode'](code);

View File

@ -134,17 +134,8 @@ export default {
},
getSignalShow(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.redOpen && !elem.yellowOpen && !elem.greenOpen) {
return '红';
} else if (!elem.redOpen && !elem.yellowOpen && elem.greenOpen) {
return '绿';
} else if (!elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '黄';
} else if (elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '引导';
} else {
return '';
}
const data = {'R':'红', 'G':'绿', 'Y':'黄', 'RY':'引导'};
return data[elem.aspect] || '';
},
cancel() {
const operate = {

View File

@ -245,17 +245,8 @@ export default {
},
getSignalShow(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.redOpen && !elem.yellowOpen && !elem.greenOpen) {
return '红';
} else if (!elem.redOpen && !elem.yellowOpen && elem.greenOpen) {
return '绿';
} else if (!elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '黄';
} else if (elem.redOpen && elem.yellowOpen && !elem.greenOpen) {
return '引导';
}
return '';
const data = {'R':'红', 'G':'绿', 'Y':'黄', 'RY':'引导'};
return data[elem.aspect] || '';
},
getCanGuide(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);

View File

@ -13,7 +13,8 @@
<el-table-column prop="name" label="ID" />
<el-table-column prop="status" label="信号指示模式">
<template slot-scope="scope">
<span v-if="scope.row.redOpen">灭灯模式</span>
<!-- <span v-if="scope.row.redOpen">灭灯模式</span> -->
<span v-if="scope.row.aspect=='R'">灭灯模式</span>
<span v-else>开灯模式</span>
</template>
</el-table-column>
@ -109,7 +110,7 @@ export default {
'selected': function(val) {
if (val) {
const signal = this.$store.getters['map/getDeviceByCode'](val.code);
if (signal && signal.redOpen) {
if (signal && signal.aspect == 'R') {
this.status = true;
} else {
this.status = false;

View File

@ -36,8 +36,8 @@
</div>
<div class="radio-box-title">设置位置</div>
<div class="radio-box">
<el-radio v-model="position" label="normal" :disabled="!!(selectedSwitch.normalPosition || selectedSwitch.auto)" style="display: block;margin-bottom: 10px;">定位</el-radio>
<el-radio v-model="position" label="reserve" :disabled="!!(selectedSwitch.reversePosition || selectedSwitch.auto)" style="display: block;">反位</el-radio>
<el-radio v-model="position" label="normal" :disabled="!!(selectedSwitch.pos=='N' || selectedSwitch.auto)" style="display: block;margin-bottom: 10px;">定位</el-radio>
<el-radio v-model="position" label="reserve" :disabled="!!(selectedSwitch.pos=='R' || selectedSwitch.auto)" style="display: block;">反位</el-radio>
</div>
<div class="radio-box-title">设置预留</div>
<div class="radio-box">
@ -208,9 +208,10 @@ export default {
},
getSwitchPosition(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.normalPosition) {
// N- R- NO-() EX-
if (elem.pos == 'N') {
return '定位';
} else if (elem.reversePosition) {
} else if (elem.pos == 'R') {
return '反位';
} else {
return '';

View File

@ -109,9 +109,10 @@ export default {
},
getSwitchPosition(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.normalPosition) {
// N- R- NO-() EX-
if (elem.pos == 'N') {
return '定位';
} else if (elem.reversePosition) {
} else if (elem.pos == 'R') {
return '反位';
} else {
return '';

View File

@ -1,9 +1,24 @@
import {createTransform1, createBoundingRect} from './utils/parser';
class TransformHandle {
constructor(painter) {
this.$painter = painter;
this.scale = '';
this.scaleIndex = 0;
this.scaleList = [
0.2, 0.4, 0.6, 0.8, 0.9,
1, 1.2, 1.4, 1.6, 1.8,
2, 2.2, 2.4, 2.6, 2.8,
3, 3.2, 3.4, 3.6, 3.8,
4, 4.2, 4.4, 4.6, 4.8,
5, 5.2, 5.4, 5.6, 5.8,
6, 6.2, 6.4, 6.6, 6.8,
7, 7.2, 7.4, 7.6, 7.8,
8
];
this.parentLevel = painter.getParentLevel();
this.rect = { x: 0, y: 0, width: 0, height: 0 };
@ -79,6 +94,7 @@ class TransformHandle {
// 更新偏移量
updateTransform(list, rectList) {
this.rectList = rectList;
// this.scale = list[0].scaleRateX;
this.transform = [];
list.forEach(item => {
this.transform.push(createTransform1(item));
@ -87,10 +103,24 @@ class TransformHandle {
this.transformAll();
}
updataOffset(opt) {
if (opt.scale) {
if (opt.scale <= 0) {
this.scaleIndex = this.scaleIndex <= 0 ? 0 : this.scaleIndex - 1;
} else {
this.scaleIndex = this.scaleIndex >= 40 ? 40 : this.scaleIndex + 1;
}
const {screenList, rectList} = this.$painter.updateScreenZoom(this.scaleList[this.scaleIndex]);
this.rectList = rectList;
this.transform = [];
screenList.forEach(item => {
this.transform.push(createTransform1(item));
});
} else {
this.transform.forEach(item => {
item[4] = item[4] + opt.dx;
item[5] = item[5] + opt.dy;
});
}
this.transformAll1();
}
updataOffsetNum(opts) {

View File

@ -15,6 +15,7 @@ const Jlmap3dedit = () => import('@/views/jlmap3d/edit/jlmap3dedit');
const Jlmap3dAssetManager = () => import('@/views/jlmap3d/jl3dassetmanager/assetmanager');
const Jlmap3dLesson3dEdit = () => import('@/views/jlmap3d/lesson3dedit/lesson3dedit');
const Jlmap3dLesson3dPlayer = () => import('@/views/jlmap3d/lesson3dplayer/lesson3dplayer');
const Jlmap3dLesson3dSelect = () => import('@/views/jlmap3d/lesson3dplayer/lesson3dselect');
const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive');
const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation');
@ -41,6 +42,7 @@ const PracticeDisplay = () => import('@/views/newMap/displayNew/practiceDisplay'
const BigLPFStrategy = () => import('@/views/newMap/displayNew/bigLPFStrategy');
const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index');
const jointTrainingNewCCTV = () => import('@/views/newMap/jointTrainingNew/realCCTV');
const Errpr404 = () => import('@/views/error-page/404');
@ -289,6 +291,12 @@ export const constantRoutes = [
component: Jlmap3dLesson3dPlayer,
hidden: true
},
{
path: '/jlmap3d/lesson3dselect',
component: Jlmap3dLesson3dSelect,
hidden: true
},
{
path: '/data2json',
component: () => import('@/views/planMonitor/data2json/page.vue'),
@ -346,6 +354,7 @@ export const constantRoutes = [
component: Jl3dRailwayDrive,
hidden: true
},
{
path: '/jlmap3d/devicemodel',
component: Jlmap3dModel,
@ -442,6 +451,11 @@ export const publicAsyncRoute = [
component: JointTrainingNew,
hidden: true
},
{
path: '/jointTrainingNewCCTV',
component: jointTrainingNewCCTV,
hidden: true
},
{
path: '/jlmap3d',
component: Jlmap3d,

View File

@ -448,6 +448,17 @@ export const loginInfo = {
navigationMarginLeft: '50px',
systemType: '022'
},
richorlesson3d:{
title: '中航锐创城市轨道交通实训平台',
loginPath: '/login?project=richorlesson3d',
loginParam: 'RICHOR',
bottomColumn: '中航锐创(北京)科技发展有限公司 联系电话:4000500081',
linkIcon: FaviconRichor,
titleIcon: FaviconRichor,
navigationLogoWidth: '40px',
navigationMarginLeft: '50px',
systemType: '022'
},
designrichorjoint: {
title: '中航锐创城市轨道交通设计平台',
loginPath: '/design/login?project=richorjoint',
@ -513,6 +524,7 @@ export const ProjectIcon = {
cgy: FaviconCgy,
designcgy: FaviconCgy,
richor:FaviconRichor,
richorlesson3d:FaviconRichor,
richorjoint: FaviconRichor,
designrichorjoint: FaviconRichor
};
@ -546,14 +558,15 @@ export const ProjectCode = {
cgy: 'CGY',
designcgy: 'CGY',
richor:'RICHOR',
richorlesson3d:'RICHOR',
richorjoint: 'RICHOR_JOINT',
designrichorjoint: 'RICHOR_JOINT'
};
export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'richor', 'richorjoint', 'designrichorjoint']; // 底部栏仅展示公司信息不展示备案号
export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb', 'designdrts', 'drts', 'wjls', 'nty', 'designnty', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'designbjd', 'cgy', 'designcgy', 'zzww', 'zzwwtest', 'richor', 'richorjoint', 'designrichorjoint']; // 实训设计平台通过项目code获取地图列表的项目
export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'richor', 'richorlesson3d', 'richorjoint', 'designrichorjoint']; // 底部栏仅展示公司信息不展示备案号
export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb', 'designdrts', 'drts', 'wjls', 'nty', 'designnty', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'designbjd', 'cgy', 'designcgy', 'zzww', 'zzwwtest', 'richor','richorlesson3d', 'richorjoint', 'designrichorjoint']; // 实训设计平台通过项目code获取地图列表的项目
export const CaseHideProjectList = ['heb', 'designheb', 'cgy', 'designcgy']; // 案例展示隐藏的项目
export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls', 'drts', 'wjls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'xadt', 'designxadt']; // 登录页右下角版本开发基于不展示
export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'xadt', 'designxadt']; // 登录页右下角主体不展示
export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'xadt', 'designxadt','richor','richorlesson3d', 'richorjoint']; // 登录页右下角主体不展示
export const ProjectLoginStyleList = ['gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc',
'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'wjls', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'cgy', 'designcgy', 'zzww', 'zzwwtest']; // 登录页样式
export const NoQrcodeList = ['heb', 'designheb', 'cgy', 'designcgy', 'ntyl', 'designntyl'];
@ -614,6 +627,7 @@ export const ProjectList = [
{value: 'zzww', label: '郑州共赢'},
{value: 'zzwwtest', label: '郑州共赢考试'},
{value: 'richor', label: '中航锐创'},
{value: 'richorlesson3d', label: '中航锐创(三维课程)'},
{value: 'richor_joint', label: '中航锐创(实训室)'}
];
export const localPackageProject = {

View File

@ -181,6 +181,9 @@ const iscs = {
},
setCloseMusic: (state, num) => {
state.closeMusicNum = num;
},
updateIscsState: (state, deviceStatus) => {
Vue.prototype.$iscs && Vue.prototype.$iscs.update(deviceStatus);
}
},
@ -188,6 +191,9 @@ const iscs = {
setIscsData: ({ commit }, iscs) => {
commit('setIscsData', iscs);
},
updateIscsState: ({ commit }, deviceStatus) => {
commit('updateIscsState', deviceStatus);
},
updateIscsDevices: ({ commit }, models) => {
return new Promise((resolve) => {
if (!(models instanceof Array)) {

View File

@ -340,6 +340,7 @@ const socket = {
competitionPracticeFinish:0, // 竞赛场景结束标识
simulationAlarmInfo: [], // 仿真报警信息
deviceStateMessages: null, // 新版订阅设备状态消息
iscsStateMessages: null, // iscs设备状态消息
simulationSpeed: 1, // 仿真倍速
simulationPause: false,
simulationPslStatus: [], // PSL面板按钮状态信息
@ -421,6 +422,9 @@ const socket = {
},
setSimulationSpeed: (state, speed) => {
state.simulationSpeed = speed;
},
setIscsStateMessages: (state, speed) => {
state.iscsStateMessages = speed;
}
},
@ -506,6 +510,9 @@ const socket = {
},
setSimulationTimeSync:({ commit }, time) => {
commit('setSimulationTimeSync', time);
},
handleIscsState:({ commit }, state) => {
commit('setIscsStateMessages', state);
}
}
};

View File

@ -10,7 +10,7 @@ export function getBaseUrl() {
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
} else {
BASE_API = process.env.VUE_APP_BASE_API;
}

View File

@ -7,24 +7,16 @@ export default function parseStatus(deviceStatus) {
elem.deviceType = deviceType.Switch;
switch (msg[1]) {
case 0:
elem.normalPosition = 0;
elem.reversePosition = 0;
elem.switchSplit = 0;
elem.pos = 'NO'; // 失表
break;
case 1:
elem.normalPosition = 1;
elem.reversePosition = 0;
elem.switchSplit = 0;
elem.pos = 'N'; // 定位
break;
case 2:
elem.normalPosition = 0;
elem.reversePosition = 1;
elem.switchSplit = 0;
elem.pos = 'R'; // 反位
break;
case 4:
elem.normalPosition = 0;
elem.reversePosition = 0;
elem.switchSplit = 1;
elem.pos = 'EX'; // 挤岔
break;
}
elem.blockade = msg[2];

View File

@ -8,6 +8,7 @@ export const perpetualTopic = '/user/topic/message'; // 公用topic
export const roomTopic = '/user/queue/room'; // 房间topic
export const jl3dTopic = '/user/queue/simulation/jl3d'; // 三维topic
export const LPFTopic = '/user/queue/simulation/passenger'; // 客流topic
// export const iscsTopic = '/topic/simulation/iscs'; // iscs topic
export function getTopic(type, group) {
let topic = '';
@ -24,6 +25,9 @@ export function getTopic(type, group) {
// topic = `/user/queue/simulation/${group}/state`;
topic = `/queue/simulation/${group}/state`;
break;
case 'ISCSPSD':
topic = `/queue/simulation/${group}/iscs/psd`;
break;
}
return topic;
}
@ -49,6 +53,8 @@ function callback(Response) {
store.dispatch('socket/setSimulationTimeSync', Number.parseInt(Response.body));
} else if (Response.headers.destination.includes('state')) {
store.dispatch('socket/handleSimulationState', Number.parseInt(Response.body));
} else if (Response.headers.destination.includes('iscs')) {
store.dispatch('socket/handleIscsState', JSON.parse(Response.body));
} else {
const data = JSON.parse(Response.body);
store.dispatch('socket/setStomp', data);

View File

@ -62,7 +62,7 @@ export default {
},
'$store.state.map.mapViewLoadedCount':function() {
this.$store.dispatch('map/setTrainWindowShow', false);
this.$jlmap.off('zoom');
// this.$jlmap.off('zoom');
this.handleUpdateScreen();
if (this.$route.query.group && !this.$route.path.includes('displayIscs')) {
this.subscribe();

View File

@ -1,6 +1,9 @@
<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="code">
<el-input v-model="form.code" :disabled="true" size="small" />
</el-form-item>
<el-form-item label="图层:" prop="z2">
<el-input-number v-model="form.z2" controls-position="right" :min="0" size="small" />
</el-form-item>

View File

@ -1,6 +1,9 @@
<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 v-model="form.code" :disabled="true" size="small" />
</el-form-item>
<el-form-item label="门高:" prop="height">
<el-input-number v-model="form.height" controls-position="right" :min="20" size="small" />
</el-form-item>

View File

@ -41,6 +41,8 @@ export default {
return this.$route.query.lineCode;
}
},
mounted() {
},
methods: {
}
};

View File

@ -173,6 +173,7 @@ export default {
}
});
}
this.$emit('viewLoaded');
},
setIscs(data, oldData) {
this.$iscs.setIscs(oldData, data, this.$route.query.lineCode);

View File

@ -58,6 +58,9 @@ export default {
this.$store.dispatch('runPlan/setRunPlanInfo', res.data.runPlan);
loadRunPlanData(this.group);
});
},
'$store.state.socket.iscsStateMessages': function (list) {
this.$store.dispatch('iscs/updateIscsState', list);
}
},
mounted() {

View File

@ -2,7 +2,7 @@
<div class="psdSystem">
<div class="psdSystem_header">{{ stationName+' 屏蔽门系统' }}</div>
<div>
<iscsSystem ref="iscsPlate" />
<iscsSystem ref="iscsPlate" @viewLoaded="viewLoaded" />
<!-- :width-canvas="width" :canvas-height="height" -->
</div>
<!-- <div class="psdSystem_footer">
@ -14,6 +14,8 @@
<script>
import iscsSystem from '../canvas/iscsCanvas';
import {getIscsData} from '@/api/iscs';
import { getToken } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, getTopic } from '@/utils/stomp';
export default {
name:'PsdSystem',
components:{
@ -52,6 +54,23 @@ export default {
this.loading = false;
}
});
},
beforeDestroy() {
},
methods: {
viewLoaded() {
this.subscribe();
},
subscribe() {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(getTopic('ISCSPSD', this.$route.query.group), header);
this.$store.dispatch('app/animationsClose');
},
clearSubscribe() {
clearSubscribe(getTopic('ISCSPSD', this.$route.query.group));
}
}
};
</script>

View File

@ -103,14 +103,6 @@
<div class="buttontext">{{ $t('jlmap3d.removalATP') }}</div>
</div>
<!-- <div id="staymode" class="panebutton2" style="bottom:6%;left:80%;">
<img class="buttonimg2" :src="zuoimg" />
<img class="buttonimg2" :src="niuimg" :style="{transform:toutransform}" @touchstart='stopmodetouchstart' @touchmove='stopmodetouchmove' @touchend='stopmodetouchend'/>
<div class="tfbutton" style="top:25px;left:1px;">{{ $t('jlmap3d.infliction') }}</div>
<div class="tfbutton" style="top:8px;left:25px;">{{ $t('jlmap3d.mesoPosition') }}</div>
<div class="tfbutton" style="top:25px;left:50px;">{{ $t('jlmap3d.remission') }}</div>
<div class="buttontext2">{{ $t('jlmap3d.parkingBrakeMode') }}</div>
</div> -->
<div id="dropen" class="panebutton" style="bottom:6%;left:45%;" @click="droclick">
<img class="buttonimg" :src="redlimg" />
<div class="buttontext">{{ $t('jlmap3d.openRightDoor') }}</div>
@ -123,14 +115,23 @@
<img class="buttonimg" :style="urgestopStyle" :src="urgestopimg" />
<div class="buttontext">{{ $t('jlmap3d.emergencyBraking') }}</div>
</div>
<!-- <div id="doorpick" class="panebutton2" style="bottom:6%;left:85%;">
<img class="buttonimg2" :src="zuoimg" />
<img class="buttonimg2" :src="niuimg" :style="{transform:doordirecttou}" @touchstart='doordirecttouchstart' @touchmove='doordirecttouchmove' @touchend='doordirecttouchend'/>
<div class="tfbutton" style="font-size:1px;top:13px;left:5px;">{{ $t('jlmap3d.leftSide') }}</div>
<div class="tfbutton" style="font-size:1px;top:8px;left:33px;">{{ $t('jlmap3d.location0') }}</div>
<div class="tfbutton" style="font-size:1px;top:13px;left:50px;">{{ $t('jlmap3d.rightSide') }}</div>
<div id="doorpick" class="panebutton2" style="top:6%;left:85%;">
<img class="buttonimg2" :src="zuoimg" @mouseout='doorModeOut'/>
<img id="doormodeniu" class="buttonimg2" :src="niuimg" :style="{transform:doormodetou}" @mousedown='doormodetouchstart'/>
<div class="tfbutton" style="font-size:8px;top:11px;left:18px;">AA</div>
<div class="tfbutton" style="font-size:8px;top:8px;left:33px;">AM</div>
<div class="tfbutton" style="font-size:8px;top:11px;left:48px;">MM</div>
<div class="buttontext2">{{ $t('jlmap3d.doorModel') }}</div>
</div>
<div id="doorpick" class="panebutton2" style="bottom:6%;left:85%;">
<img class="buttonimg2" :src="zuoimg" @mouseout='doorSelectionOut'/>
<img id="doorpickniu" class="buttonimg2" :src="niuimg" :style="{transform:doordirecttou}" @mousedown='doordirecttouchstart'/>
<div class="tfbutton" style="font-size:8px;top:11px;left:18px;">{{ $t('jlmap3d.leftSide') }}</div>
<div class="tfbutton" style="font-size:8px;top:8px;left:33px;">{{ $t('jlmap3d.location0') }}</div>
<div class="tfbutton" style="font-size:8px;top:11px;left:48px;">{{ $t('jlmap3d.rightSide') }}</div>
<div class="buttontext2">{{ $t('jlmap3d.doorSideChoose') }}</div>
</div> -->
</div>
</div>
@ -140,7 +141,17 @@
<script>
import Vue from 'vue';
// import { sendSimulationCommand } from '@/api/simulation.js';
import { trainSimulationDriveMode, trainSimulationAto ,trainSimulationAtp,trainSimulationChangeHead,trainSimulationDoorControl,trainSimulationEb } from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js';
import {
trainSimulationDriveMode,
trainSimulationAto ,
trainSimulationAtp,
trainSimulationChangeHead,
trainSimulationDoorControl,
trainSimulationEb,
trainSimulationDoorSelection,
trainSimulationDoorMode
} from '@/jlmap3d/jl3ddrive/drivecontrol/simulation.js';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
@ -166,7 +177,7 @@
greenimg:JL3D_LOCAL_STATIC+"/jl3d/control/green.png",
urgestopimg:JL3D_LOCAL_STATIC+"/jl3d/control/urgestop.png",
iconrotate:0,
doordirecttou:"rotate(0deg)",
doordirecttou:"rotate(415deg)",
doormodetou:"rotate(0deg)",
watertou:"rotate(0deg)",
washtou:"rotate(0deg)",
@ -198,6 +209,14 @@
jgl:JL3D_LOCAL_STATIC+"/jl3d/control/redz.png",
sgd:JL3D_LOCAL_STATIC+"/jl3d/control/greenz.png",
jgd:JL3D_LOCAL_STATIC+"/jl3d/control/redz.png",
angleoffset: {
x: null,
y: null
},
oldDoorMode:"",
oldDoorSelection:"",
doorModePut:true,
doorSelectionPut:true,
}
},
watch: {
@ -253,32 +272,118 @@
};
setTimeout( callback.bind(this),2000);
},
stopmodetouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
doormodetouchstart:function(e){
let domoffset = document.getElementById("doormodeniu").getBoundingClientRect();
// movelimit
this.angleoffset.x = domoffset.x;
this.angleoffset.y = domoffset.y;
e.preventDefault();
this.doorModePut = true;
document.getElementById("doormodeniu").onmousemove = this.doormodetouchmove;
document.getElementById("doormodeniu").onmouseup = this.doormodetouchend;
},
stopmodetouchmove:function(e){//finger move
if(this.touchcontrol == true){
this.getAngle(e.changedTouches[0].clientX,e.changedTouches[0].clientY);
}
doormodetouchmove:function(e){//finger move
this.getModeAngle(e.pageX-this.angleoffset.x ,e.pageY-this.angleoffset.y);
},
stopmodetouchend:function(e){
this.touchcontrol = false;
doormodetouchend:function(e){
document.getElementById("doormodeniu").onmousemove = null;
document.getElementById("doormodeniu").onmouseup = null;
},
getAngle:function(mx,my){
doordirecttouchstart:function(e){
let domoffset = document.getElementById("doorpickniu").getBoundingClientRect();
// movelimit
this.angleoffset.x = domoffset.x;
this.angleoffset.y = domoffset.y;
e.preventDefault();
this.doorSelectionPut = true;
document.getElementById("doorpickniu").onmousemove = this.doordirecttouchmove;
document.getElementById("doorpickniu").onmouseup = this.doordirecttouchend;
},
doordirecttouchmove:function(e){//finger move
this.getDirectAngle(e.pageX-this.angleoffset.x ,e.pageY-this.angleoffset.y);
},
doordirecttouchend:function(e){
document.getElementById("doorpickniu").onmousemove = null;
document.getElementById("doorpickniu").onmouseup = null;
},
getModeAngle:function(mx,my){
//
let px=140;
let py=510;
// console.log(mx);
// console.log(my);
let px=30;
let py=30;
let command ={
groupNumber:this.groupNum,
doorMode:""
};
let angle = this.transAngle(px,py,mx,my);
if(angle<250 && angle>122){
if(angle<160 && angle>122){
command.doorMode = "AA";
}else if(angle<210 && angle>=160){
command.doorMode = "AM";
}else if(angle<250 && angle>=210){
command.doorMode = "MM";
}
if(this.doorModePut == true && this.oldDoorMode != command.doorMode){
this.doorModePut = false;
this.oldDoorMode = command.doorMode;
trainSimulationDoorMode(this.group,command).then(netdata => {
});
}
}
},
getDirectAngle:function(mx,my){
//
// console.log(mx);
// console.log(my);
let px=30;
let py=30;
let angle = this.transAngle(px,py,mx,my);
let command ={
groupNumber:this.groupNum,
doorSelection:""
};
if(angle<250 && angle>122){
if(angle<160 && angle>122){
command.doorSelection = "L";
}else if(angle<210 && angle>=160){
command.doorSelection = "Z";
}else if(angle<250 && angle>=210){
command.doorSelection = "R";
}
if(this.doorSelectionPut == true && this.oldDoorSelection != command.doorSelection ){
this.doorSelectionPut = false;
this.oldDoorSelection = command.doorSelection;
trainSimulationDoorSelection(this.group,command).then(netdata => {
});
}
}
},
doorSelectionOut: function(event){
document.getElementById("doorpickniu").onmousemove = null;
document.getElementById("doorpickniu").onmouseup = null;
},
doorModeOut: function(event){
document.getElementById("doormodeniu").onmousemove = null;
document.getElementById("doormodeniu").onmouseup = null;
},
transAngle: function(px,py,mx,my){
let x = Math.abs(px-mx);
let y = Math.abs(py-my);
let z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
@ -309,50 +414,7 @@
if(mx<px&&my<py){//鼠标在第二象限
angle = 360 - angle;
}
if(angle<338 && angle>219){
if(angle<245 && angle>219){
this.toutransform = "rotate(305deg)";
}else if(angle<295 && angle>245){
this.toutransform = "rotate(359deg)";
}else if(angle<338 && angle>295){
this.toutransform = "rotate(412deg)";
}
}
},
doordirecttouchstart:function(e){
// let command ={
// code:this.traincode,
// operation:"607",
// type:"07",
// param:""
// };
// command.param = this.touchstate;
// sendSimulationCommand(this.group,command).then(netdata => {
// if(netdata.data == true){
this.touchcontrol = true;
// }
// });
},
doordirecttouchmove:function(e){//finger move
if(this.touchcontrol == true){
let px=230;
let py=180;
let angle = this.getAngle(px,py,e.changedTouches[0].clientX,e.changedTouches[0].clientY);
if(angle<338 && angle>219){
if(angle<245 && angle>219){
this.doordirecttou = "rotate(305deg)";
}else if(angle<295 && angle>245){
this.doordirecttou = "rotate(359deg)";
}else if(angle<338 && angle>295){
this.doordirecttou = "rotate(412deg)";
}
}
}
},
doordirecttouchend:function(e){
this.touchcontrol = false;
return angle;
},
sgclink: function (e){
//console.log("");
@ -441,7 +503,7 @@
};
trainSimulationDoorControl(this.group,data).then(netdata => {
// console.log(netdata);
this.doorleftimg = this.greenimg;
// this.doorleftimg = this.greenimg;
});
},
@ -463,7 +525,7 @@
};
trainSimulationDoorControl(this.group,data).then(netdata => {
// console.log(netdata);
this.doorrightimg = this.greenimg;
// this.doorrightimg = this.greenimg;
});
},
atoaclick: function (e){
@ -485,6 +547,7 @@
// console.log(netdata);
});
},
updatabuttonlight: function (data){
// console.log(data);
// if(data.runLevel){
@ -495,6 +558,7 @@
// this.cbtcbuttonimg = this.greenimg;
// }
// }
// console.log(data);
if(data.driveMode){
// this.driveMode = data.driveMode;
@ -524,6 +588,32 @@
}
}
if(data.doorMode){
this.oldDoorMode = data.doorMode;
if(data.doorMode == "AA"){
this.doormodetou = "rotate(305deg)";
}
if(data.doorMode == "AM"){
this.doormodetou = "rotate(359deg)";
}
if(data.doorMode == "MM"){
this.doormodetou = "rotate(50deg)";
}
}
if(data.doorSelection){
this.oldDoorSelection = data.doorSelection;
if(data.doorSelection == "R"){
this.doordirecttou = "rotate(50deg)";
}
if(data.doorSelection == "Z"){
this.doordirecttou = "rotate(359deg)";
}
if(data.doorSelection == "L"){
this.doordirecttou = "rotate(305deg)";
}
}
}
},
}

View File

@ -237,6 +237,10 @@ export default {
// this.updatemmidrivemode(newdata.driveMode);
//
// this.updatemmiatoatp(newdata.atoOn,newdata.atpOn);
if(newdata.doorMode){
this.updateM7(newdata.doorMode);
}
if(newdata.nextStation){
this.updateMmiNextStation(newdata.nextStation);
}
@ -359,6 +363,17 @@ export default {
this.m4image = this.images.m4['none'];
}
},
updateM7(newdata){
if(newdata == "AA"){
this.m7image = this.images.m7['aoac'];
}
if(newdata == "AM"){
this.m7image = this.images.m7['aomc'];
}
if(newdata == "MM"){
this.m7image = this.images.m7['momc'];
}
},
updateTiaoting(newdata){
if(newdata.jump != undefined){

View File

@ -4,7 +4,7 @@
<el-tabs v-model="activeName" class="activediv" type="card" @tab-click="handleClick">
<el-tab-pane label="课程场景" name="progresslist" >
<draggable v-model="lessonData.lessonData.lessonProgress" group="people" @start="drag=true" @end="drag=false" >
<div class="progressdiv" v-for="(element,index) in lessonData.lessonData.lessonProgress">
<div class="progressdiv" :class="{active:index==isActive}" v-for="(element,index) in lessonData.lessonData.lessonProgress">
<div class="changeprogressdiv" @click="changeProgressView(index)">{{element.progressName}}</div>
<div class="progressdivimg"
:style="{'background-image': 'url('+localstatic+'/lesson3d/sc.png)'}"/>
@ -28,6 +28,18 @@
</div>
</el-tab-pane>
<el-tab-pane label="场景特效管理" name="accidentlist" >
<div class="progressdiv"
v-for="(elementaccident,indexaccident) in accidentlist" :key="elementaccident.label">
<div class="progressdivtext" >{{elementaccident.label}}</div>
<div class="progressassetimg"
:style="{'background-image': 'url('+localstatic+'/lesson3d/box.png)'}"/>
<div class="delprogressdiv" @click="deleteAccident(elementaccident)" >删除</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
@ -44,12 +56,13 @@
export default {
name: 'LessonProgress',
props:['lessonData','triggerList'],
props:['lessonData','triggerList','accidentlist'],
components: {
draggable
},
data() {
return {
isActive:-1,
localstatic:JL3D_LOCAL_STATIC,
activeName: 'progresslist',
progressList:[
@ -84,6 +97,7 @@
this.$emit('addProgress');
},
changeProgressView(viewIndex){
this.isActive=viewIndex;
this.$emit('changeProgressView',viewIndex);
console.log(viewIndex);
},
@ -97,6 +111,9 @@
deleteModel(selectedModel){
this.$emit('deleteModel',selectedModel);
},
deleteAccident(selectAccident){
this.$emit('deleteAccident',selectAccident);
}
},
@ -107,7 +124,9 @@
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.active{
background-color:#409EFF;
}
.lessonprogressdiv {
position: absolute;
width: 70%;

View File

@ -27,6 +27,19 @@
</div>
</draggable>
</el-tab-pane>
<el-tab-pane label="特效资源" name="spritTrigger">
<draggable v-model="accidentDataList" group="accidentDataList" @start="drag=true" @end="drag=false" >
<div class="progressdiv" v-for="(item,index) in accidentDataList"@dragend="createAccident($event,item,index)">
<div class="progressdivimg"
:style="{'background-image': 'url('+localstatic+'/lesson3d/box.png)'}"/>
<div class="progressdivtext">{{item.name}}</div>
</div>
</draggable>
</el-tab-pane>
<el-tab-pane label="图片资源列表" name="picasset">
<el-tabs v-model="activeName" class="activediv" type="card" @tab-click="handleClick" >
@ -82,6 +95,7 @@
activeName: 'lessoncomponent',
lessonAssetList:[],
picAssetList:[],
accidentDataList:[],
triggerList:[
{},
{},
@ -98,6 +112,7 @@
},
mounted() {
window.jl3dUpdateAccidentData = this.jl3dUpdateAccidentData;
this.localstatic = JL3D_LOCAL_STATIC;
console.log(this.localstatic);
getMap3dModelData("三维课程").then(netdata => {
@ -147,7 +162,13 @@
// console.log(event);
this.$emit('createModel',item,{x:event.clientX,y:event.clientY});
},
createAccident(event,item, index){
this.$emit('createAccident',item.type,{x:event.clientX,y:event.clientY});
},
jl3dUpdateAccidentData(accidentData){
this.accidentDataList = accidentData;
},
},
}

View File

@ -4,6 +4,7 @@
<LessonTools-Manager
@createModel='createModel'
@createAccident='createAccident'
:lessonTools='lessonTools'
></LessonTools-Manager>
@ -62,11 +63,13 @@
<Lesson-Progress
:lessonData='lessonData'
:triggerList='triggerList'
:accidentlist='accidentlist'
@addProgress="addProgress"
@changeProgressView="changeProgressView"
@removeProgress="removeProgress"
@selectModel="selectModel"
@deleteModel="deleteModel"
@deleteAccident="deleteAccident"
>
</Lesson-Progress>
@ -163,6 +166,7 @@
data:{},
},
triggerList:[],
accidentlist:[],
lessonData:{
lessonData:{
lessonProgress:[
@ -209,6 +213,7 @@
},
mounted() {
window.updateTriggerList = this.updateTriggerList;
window.jl3dUpdateAccidentlist = this.jl3dUpdateAccidentlist;
window.editAction = this.editAction;
this.init(this.$route.query.lessonId);
@ -257,6 +262,11 @@
let assetModelData = this.jl3d.saveAssetModel();
saveData.assetList = assetModelData.assetList;
saveData.modelList = assetModelData.modelList;
let accidentData = this.jl3d.saveAccidentModel();
saveData.accidentList = accidentData;
saveData.setup.examMode = this.examMode;
saveData.setup.checkedRole = this.checkedRole;
this.netData.data = JSON.stringify(saveData);
@ -291,6 +301,9 @@
deleteModel(selectedModel){
this.jl3d.deleteModel(selectedModel);
},
deleteAccident(selectedAccident){
this.jl3d.deleteAccident(selectedAccident);
},
setupclick(){
this.showSetup = true;
@ -298,11 +311,16 @@
createModel(assetData,mousePos){
this.jl3d.createModelTrigger(assetData,mousePos);
},
createAccident(accidentData,mousePos){
this.jl3d.createAccident(accidentData,mousePos);
},
updateTriggerList(newTriggerList){
this.triggerList = newTriggerList;
console.log(this.triggerList);
},
jl3dUpdateAccidentlist(newAccidentlist){
this.accidentlist = newAccidentlist;
},
editAction(type,value1,value2){
this.jl3d.editActionManager(type,value1,value2);
},

View File

@ -267,14 +267,17 @@
userJob:"",
};
loadData = JSON.parse(data.data.data);
if(this.$route.query.examMode == 1){
this.examMode = true;
}else{
this.examMode = loadData.setup.examMode;
}
if(loadData.setup.checkedRole.length == 0){
this.showSelectJob = false;
}
this.selectJobList = loadData.setup.checkedRole;
this.jobPaneData.dataList = loadData.toolJobPane;
this.$refs.jobpane.initJobList(this.jobPaneData.dataList);
console.log(loadData.lessonTools);
this.lessonTools = loadData.lessonTools;
this.lessonData.loadLessonProgress(loadData.lessonProgress);
@ -295,13 +298,12 @@
this.examStatus = newExamStatus;
},
lessonEnd(){
if(this.examMode == true){
this.endExam = true;
this.showResult();
this.examStatus.time = this.lastPlayTime;
}
this.stopTime();
}
},
showResult(){
this.$refs.rtui.showdiv();
@ -311,7 +313,7 @@
for(let i=0;i<this.jobPaneData.dataList.length;i++){
if(job == this.jobPaneData.dataList[i].name){
this.nowRole = this.jobPaneData.dataList[i].value;
console.log(this.nowRole);
this.lessonMsg.userJob = job;
this.jl3d.initNowRole(this.nowRole);
this.timeStart();

View File

@ -0,0 +1,126 @@
<template>
<div class="jl3dmap3dMaintainer">
<div class="jl3dmap3dMaintainerSelect" :style="{'background-image': 'url('+localStatic+'/texture/bg.jpg)'}">
<div style="position:absolute;left:40%;top:20%;font-size:30px">
<el-row>
考试模式:
<el-switch
v-model="examMode"
active-text="开启考试模式"
inactive-text="关闭考试模式">
</el-switch>
</el-row>
</div>
<div class="lesson3dSelectButton"
:style="{'background-image': 'url('+localStatic+'/texture/scene.png)'}"
style="left:20%;top:40%;" @click="enterPlayer">单对屏蔽门无法开启</div>
<div class="lesson3dSelectButton"
:style="{'background-image': 'url('+localStatic+'/texture/scene.png)'}"
style="left:60%;top:40%;" >单对屏蔽门无法关闭</div>
<div class="lesson3dSelectButton"
:style="{'background-image': 'url('+localStatic+'/texture/scene.png)'}"
style="left:20%;top:70%;" >整列屏蔽门无法开启</div>
<div class="lesson3dSelectButton"
:style="{'background-image': 'url('+localStatic+'/texture/scene.png)'}"
style="left:60%;top:70%;" >整列屏蔽门无法关闭</div>
</div>
</div>
</template>
<script>
import { ProjectIcon } from '@/scripts/ProjectConfig';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
import bgPsdImg from '@/assets/bg_psd.png';
// import Jlmap3dMsg from '@/views/jlmap3d/show/msg';
var train;
export default {
name: 'LessondSelect',
components: {
},
data() {
return {
localStatic:JL3D_LOCAL_STATIC,
normalShow:false,
vrShow:false,
trainRescueShow:false,
examMode:false
};
},
beforeDestroy() {
},
created() {
// document.querySelector("link[rel*='icon']").href = loginInfo[this.$route.query.project].linkIcon || ProjectIcon[this.$route.query.project];
},
mounted() {
// console.log("");
},
methods: {
enterPlayer:function ( ) {
let examcode = 0;
if(this.examMode == true){
examcode = 1;
}
this.$router.push({ path: '/design/jlmap3d/lesson3dplayer', query: {lessonId:'34',examMode:examcode} });
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.jl3dmap3dMaintainer {
position:absolute;
width: 100%;
height: 100%;
z-index: 35;
}
.jl3dmap3dMaintainerSelect{
position:absolute;
width: 100%;
height: 100%;
z-index: 350;
top:0;
left:0;
// background-repeat:no-repeat;
z-index: 350;
background-size:100%;
}
.lesson3dSelectButton{
position:absolute;
width: 20%;
height: 20%;
position:absolute;
text-align: center;
font-size: 25px;
line-height:100px;
background-size: 100%;
background-repeat: no-repeat;
color:#FFF;
cursor:pointer;
}
</style>

View File

@ -54,7 +54,7 @@
handler: function (newVal, oldVal) {
if (newVal != oldVal) {
console.log(this.lessonData.lessonData.lessonProgress[oldVal]);
// console.log(this.lessonData.lessonData.lessonProgress[oldVal]);
this.logTexts.push(this.lessonData.lessonData.lessonProgress[oldVal].explainPane);
this.processTexts.push(this.lessonData.lessonData.lessonProgress[oldVal].explainPane);
this.nowProcessText = this.lessonData.lessonData.lessonProgress[newVal].explainPane.text;

View File

@ -6,7 +6,7 @@
<div class="resultMsgDiv">
<div v-for="(examItem,index) in examStatus.trueStep" style="width:100%;height:10%">
<div>
{{examItem.explainPane.tittle}}
{{examItem.explainPane.text}}
</div>
<div>
得分:10
@ -56,6 +56,7 @@
methods: {
showdiv(){
this.divshow = true;
console.log(this.divshow);
},
closediv(){
this.divshow = false;
@ -79,7 +80,7 @@
border-radius:10px;
border:solid 2px #000;
background-color: #fff;
z-index:1;
z-index:10;
}

View File

@ -482,6 +482,18 @@ export default {
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type} });
} else if (this.$route.query.type == 'CCTV') {
if (this.project == 'richorjoint') {
this.$router.push({
path:'/jointTrainingNewCCTV',
query:{
mapid:resp.data.map.id,
group:res.data.group,
project: getSessionStorage('project'),
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
}
});
} else {
this.$router.push({ path: `/jlmap3d/passengerflow`, query:{
mapid:resp.data.map.id,
group:res.data.group,
@ -490,6 +502,7 @@ export default {
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
} });
}
} else if (this.$route.query.type === 'DEPOT') {
this.$router.push({ path: `/displayNew/demon`, query: {
group: res.data.group,
@ -569,6 +582,8 @@ export default {
});
} else if (this.project === 'zzwwtest') {
this.$router.push({ path: '/design/jlmap3d/lesson3dplayer', query: {lessonId:'31'} });
} else if (this.project === 'richorlesson3d') {
this.$router.push({ path: '/jlmap3d/lesson3dselect', query: {} });
} else {
if (this.teacherLogin) {
this.$router.push({ path: '/info/organization/classManage?enter=teacher' });

View File

@ -0,0 +1,90 @@
<template>
<div class="jl3dpassflow">
<div id="jlReal3d" class="jlReal3d">
<div class="realCctv1">
<video id="myvideo0" class="video-js">
<source src="http://192.168.1.254/hls/cctv1.m3u8" type="application/x-mpegURL">
</video>
</div>
<div class="realCctv2">
<video id="myvideo1" class="video-js">
<source src="http://192.168.1.254/hls/cctv2.m3u8" type="application/x-mpegURL">
</video>
</div>
</div>
<div class="menudown">
<el-button-group>
<el-button type="primary" @click="back">退出</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import Video from 'video.js';
import 'video.js/dist/video-js.css';
export default {
name:'RealCCTV',
data() {
return {
videoList:[]
};
},
mounted() {
for (var i = 0; i < 2; i++) {
const videoPlay = new Video('myvideo' + i, {
controls: false,
autoplay: 'muted',
loop:true,
preload: 'auto',
width: window.innerWidth / 2 + 'px',
height: window.innerHeight + 'px',
hls: {
withCredentials: true
}
}, function () { console.log('videojs播放器初始化成功'); });
this.videoList.push(videoPlay);
}
},
methods:{
back() {
window.close();
}
}
};
</script>
<style>
.jl3dpassflow{
width: 100%;
height: 100%;
}
.jlReal3d{
width: 100%;
height: 100%;
z-index: 0;
font-size:0;
}
.realCctv1{
position: absolute;
width:50%;
height:50%;
left:0;
top:0;
}
.realCctv2{
position: absolute;
width:50%;
height:50%;
left:50%;
top:0;
}
.menudown{
bottom:0;
right:0;
position:absolute;
z-index: 2;
}
.video-js video{
outline: none !important;
}
</style>

View File

@ -77,7 +77,8 @@ export default {
x: skew.x,
y: skew.y
},
normalPosition: 1 //
pos: 'N' //
// N- R- NO-() EX-
};
const model = Object.assign(switchModel, data);
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);
@ -135,7 +136,8 @@ export default {
x: skew.x,
y: skew.y
},
normalPosition: 1 //
pos: 'N' //
// N- R- NO-() EX-
};
const model = Object.assign(switchModel, data);
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);

File diff suppressed because it is too large Load Diff