# Conflicts:
#	src/views/iscs/iscsSystem/stationConfig/index.vue
This commit is contained in:
zyy 2020-10-12 09:27:53 +08:00
commit d05cb2e3bd
184 changed files with 4199 additions and 9013 deletions

View File

@ -4,7 +4,7 @@ pipeline {
label 'master' label 'master'
} }
} }
stages { stages {
stage('Package') { stage('Package') {
tools { tools {
@ -18,6 +18,8 @@ pipeline {
} }
stage('Publish') { stage('Publish') {
steps { steps {
sh 'mkdir -p /usr/local/joylink/jlclient'
sh 'rm -rf /usr/local/joylink/jlclient/*'
sh 'cp -rf ./dist/* /usr/local/joylink/jlclient' sh 'cp -rf ./dist/* /usr/local/joylink/jlclient'
} }
} }

View File

@ -4,20 +4,23 @@ pipeline {
label 'master' label 'master'
} }
} }
stages { stages {
stage('Package') { stage('Package') {
tools { tools {
nodejs 'nodejs-10' nodejs 'nodejs-10'
} }
steps { steps {
sh 'npm update'
sh 'npm install' sh 'npm install'
sh 'npm run test' sh 'npm run test'
} }
} }
stage('Publish') { stage('Publish') {
steps { steps {
sh 'cp -rf ./dist/* /usr/local/joylink/jlclient' sh 'mkdir -p /usr/local/joylink/jlclient'
sh 'rm -rf /usr/local/joylink/jlclient/*'
sh 'cp -rf ./dist/* /usr/local/joylink/jlclient'
} }
} }
} }

View File

@ -8,8 +8,8 @@
<!-- cdn.bootcss.com替换成cdnjs.cloudflare.com/ajax/libs --> <!-- cdn.bootcss.com替换成cdnjs.cloudflare.com/ajax/libs -->
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
<script src="/static/inflate.min.js"></script> <script src="/cbtc/static/inflate.min.js"></script>
<script src="/static/three.min.js"></script> <script src="/cbtc/static/three.min.js"></script>
<!--<% if (process.env.VUE_APP_PRO !== 'local') { %>--> <!--<% if (process.env.VUE_APP_PRO !== 'local') { %>-->
<!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.7.2/theme-chalk/index.css">--> <!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/element-ui/2.7.2/theme-chalk/index.css">-->
<!--<link href="https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">--> <!--<link href="https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">-->

View File

@ -277,7 +277,7 @@ export function getCompetitionPracticalScene(params) {
}); });
} }
/** 获取场景列表 */ /** 添加场景 */
export function addCompetitionPracticalScene(data) { export function addCompetitionPracticalScene(data) {
return request({ return request({
url: `/api/v1/competitionPractical`, url: `/api/v1/competitionPractical`,
@ -286,3 +286,85 @@ export function addCompetitionPracticalScene(data) {
}); });
} }
/** 删除场景 */
export function deleteCompetitionPracticalScene(sceneId) {
return request({
url: `/api/v1/competitionPractical/${sceneId}`,
method: 'delete'
});
}
/** 更新场景 */
export function updateCompetitionPracticalScene(data) {
return request({
url: `/api/v1/competitionPractical`,
method: 'PUT',
data
});
}
/** 获取场景 */
export function getCompetitionPracticalSceneById(id) {
return request({
url: `/api/v1/competitionPractical/detail/${id}`,
method: 'get'
});
}
/** 更新步骤数据 */
export function updateCompetitionPracticalStep(data) {
return request({
url: `/api/v1/competitionPractical/detail`,
method: 'POST',
data
});
}
/** 加载场景 */
export function loadCompetitionPracticalScene(group, id) {
return request({
url: `/api/v1/competitionPractical/load/${group}/${id}`,
method: 'PUT'
});
}
/** 场景开始演出 */
export function competitionPracticalSceneStart(group, memberId, mode) {
return request({
url: `/api/v1/competitionPractical/start/${group}?memberId=${memberId}&mode=${mode}`,
method: 'PUT'
});
}
/** 退出场景 */
export function competitionPracticalSceneExit(group) {
return request({
url: `/api/v1/competitionPractical/exit/${group}`,
method: 'PUT'
});
}
/** 退出场景 */
export function competitionPracticalSceneFinish(group) {
return request({
url: `/api/v1/competitionPractical/finish/${group}`,
method: 'PUT'
});
}
/** 获取空白运营数据 */
export function getEmptyOperationalStatistics(group) {
return request({
url: `/api/v1/competitionPractical/detail/os/${group}`,
method: 'GET'
});
}
/** 提交运营数据 */
export function submitOperationalStatistics(group, data) {
return request({
url: `/api/v1/competitionPractical/detail/os/${group}`,
method: 'PUT',
data
});
}

View File

@ -67,3 +67,19 @@ export function getIbpInfoByStation(mapId, stationCode) {
method: 'get' method: 'get'
}); });
} }
// 获取IBP盘数据
export function getIbpList(params) {
return request({
url: `/api/ibp/list`,
method: 'get',
params: params
});
}
// 复制ibp盘数据
export function copyIbpData(data) {
return request({
url: `/api/draftIbp/copy`,
method: 'post',
data: data
});
}

View File

@ -16,8 +16,8 @@ if(BASE_API == "https://test.joylink.club/jlcloud"){
}else{ }else{
// uploadurl = "https://joylink.club/jlfile"; // uploadurl = "https://joylink.club/jlfile";
// asseturl = "https://joylink.club/oss/joylink"; // asseturl = "https://joylink.club/oss/joylink";
uploadurl = "../static"; uploadurl = "../cbtc/static";
asseturl = "../static"; asseturl = "../cbtc/static";
} }
const BASE_UPLOAD_API = uploadurl; const BASE_UPLOAD_API = uploadurl;
export const BASE_ASSET_API = asseturl; export const BASE_ASSET_API = asseturl;

View File

@ -26,7 +26,13 @@ export function setFailureModeNew(data, group) {
data: data data: data
}); });
} }
/** 取消自动故障 */
export function cancelFailureModeNew(id, group) {
return request({
url: `/simulation/${group}/faultMode/${id}`,
method: 'put'
});
}
/** 获取仿真待触发的故障列表*/ /** 获取仿真待触发的故障列表*/
export function getSimulationFaultRules(group) { export function getSimulationFaultRules(group) {
return request({ return request({

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -1,5 +1,5 @@
<template> <template>
<el-form ref="form" :rules="rules" :model="formModel" :inline="inline" :label-width="form.labelWidth"> <el-form ref="form" :rules="rules" :model="formModel" :inline="inline" :label-width="form.labelWidth" @submit.native.prevent>
<template v-for="item in form.items"> <template v-for="item in form.items">
<template v-if="checkFieldType(item, 'text')"> <template v-if="checkFieldType(item, 'text')">
<el-form-item :key="item.prop" :prop="item.prop" :label="item.label" :required="item.required"> <el-form-item :key="item.prop" :prop="item.prop" :label="item.label" :required="item.required">

View File

@ -198,7 +198,8 @@ class IbpPan {
const deviceList = Object.values(this.ibpDevice); const deviceList = Object.values(this.ibpDevice);
deviceList.forEach(elem =>{ deviceList.forEach(elem =>{
for (var key in val) { for (var key in val) {
if (elem.model.mean === key) { const mean = elem.model.mean || '';
if (mean.toUpperCase() === key.toUpperCase()) {
const state = {}; const state = {};
state[key] = val[key]; state[key] = val[key];
elem.instance.setStatus(state); elem.instance.setStatus(state);

View File

@ -130,7 +130,7 @@ class MouseController extends Eventful {
} }
mouseup(e) { mouseup(e) {
if (eventTool.notLeftMouse(e) || !this.eventTarget ) { if (!this.eventTarget ) {
return; return;
} }
if (this.deviceList.length) { if (this.deviceList.length) {
@ -268,7 +268,7 @@ class MouseController extends Eventful {
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y }); this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
} }
} }
if (this.eventTarget && this.eventTarget.grouper) { if (this.eventTarget && this.eventTarget.grouper && this.boundingRect) {
const x = e.event.x + this.$ibp.$options.offsetX; const x = e.event.x + this.$ibp.$options.offsetX;
const y = e.event.y + this.$ibp.$options.offsetY; const y = e.event.y + this.$ibp.$options.offsetY;
if (!(x <= this.boundingRect.x2 && x >= this.boundingRect.x1 && y <= this.boundingRect.y2 && y >= this.boundingRect.y1)) { if (!(x <= this.boundingRect.x2 && x >= this.boundingRect.x1 && y <= this.boundingRect.y2 && y >= this.boundingRect.y1)) {

View File

@ -62,12 +62,11 @@ class Options {
} }
this.scaleRate = this.scaleList[this.scaleIndex]; this.scaleRate = this.scaleList[this.scaleIndex];
} }
if (Number.isFinite(payload.scaleRate)) { if (Number.isFinite(payload.scaleRate)) {
const idx = this.scaleList.indexOf(payload.scaleRate); const idx = this.scaleList.indexOf(payload.scaleRate);
if (idx < 0) { // if (idx < 0) {
return; // return;
} // }
this.scaleIndex = idx; this.scaleIndex = idx;
this.scaleRate = payload.scaleRate; this.scaleRate = payload.scaleRate;
} }
@ -83,7 +82,6 @@ class Options {
if (payload.zoomOnMouseWheel === true || payload.zoomOnMouseWheel === false) { if (payload.zoomOnMouseWheel === true || payload.zoomOnMouseWheel === false) {
this.zoomOnMouseWheel = payload.zoomOnMouseWheel; this.zoomOnMouseWheel = payload.zoomOnMouseWheel;
} }
if (this.trigger instanceof Function) { this.trigger(this); } if (this.trigger instanceof Function) { this.trigger(this); }
} }

View File

@ -84,7 +84,7 @@ export default class key extends Group {
x: model.width / 2, x: model.width / 2,
y: model.width / 361 * 336 + 12, y: model.width / 361 * 336 + 12,
fontWeight: 600, fontWeight: 600,
fontSize: 10, fontSize: model.textFontSize || 10,
fontFamily: model.fontFamily, fontFamily: model.fontFamily,
text: model.bottomText, text: model.bottomText,
textStrokeWidth: 0, textStrokeWidth: 0,
@ -102,7 +102,7 @@ export default class key extends Group {
x: model.width + 14, x: model.width + 14,
y: model.width / 361 * 336 / 2 - 4, y: model.width / 361 * 336 / 2 - 4,
fontWeight: 600, fontWeight: 600,
fontSize: 10, fontSize: model.textFontSize || 10,
fontFamily: model.fontFamily, fontFamily: model.fontFamily,
text: model.topText, text: model.topText,
textStrokeWidth: 0, textStrokeWidth: 0,

View File

@ -9,7 +9,7 @@ class TransformHandle {
this.rect = { x: 0, y: 0, width: 0, height: 0 }; this.rect = { x: 0, y: 0, width: 0, height: 0 };
this.transform = createTransform({ scaleRate: 1, offsetX: 0, offsetY: 0 }); this.transform = createTransform({ scaleRate: painter.$ibp.$options.scaleRate, offsetX: 0, offsetY: 0 });
} }
checkVisible(view) { checkVisible(view) {
@ -58,13 +58,12 @@ class TransformHandle {
if (canvasSize.y - opts.offsetY > 0) { if (canvasSize.y - opts.offsetY > 0) {
opts.offsetY = -elRect.y; opts.offsetY = -elRect.y;
} }
if (elRect.x + canvasSize.width * this.$painter.$ibp.$options.scaleRate < zrRect.width) {
if (elRect.x + canvasSize.width < zrRect.width) { opts.offsetX -= zrRect.width - (elRect.x + canvasSize.width * this.$painter.$ibp.$options.scaleRate);
opts.offsetX -= zrRect.width - (elRect.x + canvasSize.width);
} }
if (elRect.y + canvasSize.height < zrRect.height) { if (elRect.y + canvasSize.height * this.$painter.$ibp.$options.scaleRate < zrRect.height) {
opts.offsetY -= zrRect.height - (elRect.y + canvasSize.height); opts.offsetY -= zrRect.height - (elRect.y + canvasSize.height * this.$painter.$ibp.$options.scaleRate);
} }
} }
this.transform = createTransform(opts); this.transform = createTransform(opts);

View File

@ -184,19 +184,19 @@ deviceRender[deviceType.VolumeControlDamper] = {
deviceRender[deviceType.IscsText] = { deviceRender[deviceType.IscsText] = {
_type: deviceType.IscsText, _type: deviceType.IscsText,
zlevel: 1, zlevel: 1,
z: 7 z: 6
}; };
/** 线段渲染配置 */ /** 线段渲染配置 */
deviceRender[deviceType.IscsLine] = { deviceRender[deviceType.IscsLine] = {
_type: deviceType.IscsLine, _type: deviceType.IscsLine,
zlevel: 1, zlevel: 1,
z: 4 z: 5
}; };
/** 矩形渲染配置 */ /** 矩形渲染配置 */
deviceRender[deviceType.IscsRect] = { deviceRender[deviceType.IscsRect] = {
_type: deviceType.IscsRect, _type: deviceType.IscsRect,
zlevel:1, zlevel:1,
z: 6 z: 5
}; };
/** 菱形渲染配置 */ /** 菱形渲染配置 */
deviceRender[deviceType.IscsRhombus] = { deviceRender[deviceType.IscsRhombus] = {
@ -220,7 +220,7 @@ deviceRender[deviceType.IscsArrow] = {
deviceRender[deviceType.IscsRadioText] = { deviceRender[deviceType.IscsRadioText] = {
_type: deviceType.IscsRadioText, _type: deviceType.IscsRadioText,
zlevel:1, zlevel:1,
z: 5 z: 6
}; };
/** 图片渲染配置 */ /** 图片渲染配置 */
deviceRender[deviceType.IscsPicture] = { deviceRender[deviceType.IscsPicture] = {
@ -276,7 +276,7 @@ deviceRender[deviceType.IscsButton] = {
deviceRender[deviceType.StateTable] = { deviceRender[deviceType.StateTable] = {
_type: deviceType.StateTable, _type: deviceType.StateTable,
zlevel: 1, zlevel: 1,
z: 2 z: 5
}; };
/** 照明组 */ /** 照明组 */
deviceRender[deviceType.LightingGroup] = { deviceRender[deviceType.LightingGroup] = {
@ -360,7 +360,7 @@ deviceRender[deviceType.AfcDoorUnite] = {
deviceRender[deviceType.RectText] = { deviceRender[deviceType.RectText] = {
_type: deviceType.RectText, _type: deviceType.RectText,
zlevel: 1, zlevel: 1,
z: 4 z: 5
}; };
/** 福州 三角形 */ /** 福州 三角形 */

View File

@ -33,7 +33,8 @@ class Iscs {
const height = opts.config.height; const height = opts.config.height;
this.isAllowDragging = false; this.isAllowDragging = false;
this.$iscsZr = zrender.init(opts.dom, Object.assign({ renderer, devicePixelRatio, width, height }, opts.config)); this.$iscsZr = zrender.init(opts.dom, Object.assign({ renderer, devicePixelRatio, width, height }, opts.config));
this.$options = new Options(Object.assign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {})); // 缩放 this.$iscsZr.dom.setAttribute('tabIndex', -1);
this.$options = new Options(Object.assign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {})); // 缩放
this.$mouseController = new MouseController(this); this.$mouseController = new MouseController(this);
this.$mouseController.enable(); this.$mouseController.enable();

View File

@ -13,16 +13,18 @@ class KeyboardController extends Eventful {
initHandler(zr) { initHandler(zr) {
if (zr) { if (zr) {
var keydownHandle = this.keydown.bind(this); var keydownHandle = this.keydown.bind(this);
var dom = this.$zr.dom;
this.enable = function (opts) { this.enable = function (opts) {
opts = opts || {}; opts = opts || {};
this._keyOnDownUp = opts.keyOnDownUp || true; this._keyOnDownUp = opts.keyOnDownUp || true;
window.addEventListener('keyup', keydownHandle, false); dom.addEventListener('keyup', keydownHandle, false);
dom.focus();
}; };
this.disable = function () { this.disable = function () {
window.removeEventListener('keyup', keydownHandle, false); dom.removeEventListener('keyup', keydownHandle, false);
}; };
this.dispose = function() { this.dispose = function() {

View File

@ -86,7 +86,8 @@ class MouseController extends Eventful {
mousedown(e) { mousedown(e) {
e.event.preventDefault(); e.event.preventDefault();
e.event.stopPropagation(); e.event.stopPropagation();
const em = new EventModel(e); const em = new EventModel(e);
this.$zr.dom.focus();
this.eventTarget = em.eventTarget; this.eventTarget = em.eventTarget;
this._offsetX = e.offsetX; this._offsetX = e.offsetX;
this._offsetY = e.offsetY; this._offsetY = e.offsetY;

View File

@ -8,7 +8,7 @@ export default class iscsCircle extends Group {
this._type = device.model._type; this._type = device.model._type;
this._code = device.model.code; this._code = device.model.code;
this.zlevel = device.model.zlevel; this.zlevel = device.model.zlevel;
this.z = device.model.z; this.z = device.model.z;
this.create(); this.create();
} }
create() { create() {
@ -19,7 +19,8 @@ export default class iscsCircle extends Group {
}); });
this.iscsCircle = new Circle({ this.iscsCircle = new Circle({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
z2: model.z2||0,
shape: { shape: {
cx:this.model.radius, cx:this.model.radius,
cy:this.model.radius, cy:this.model.radius,

View File

@ -53,7 +53,8 @@ export default class iscsTriangle extends Group {
} }
this.iscsTriangle = new Polygon({ this.iscsTriangle = new Polygon({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
z2: model.z2||0,
shape: { shape: {
points:[ points:[
[point1.x, point1.y], [point1.x, point1.y],

View File

@ -52,7 +52,8 @@ export default class line extends Group {
}); });
this.iscsLine = new Polyline({ this.iscsLine = new Polyline({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
z2: model.z2||0,
draggable: false, draggable: false,
shape: { shape: {
points: modelPoints points: modelPoints
@ -74,7 +75,8 @@ export default class line extends Group {
} }
this.arrows = new Polygon({ this.arrows = new Polygon({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
z2: model.z2||0,
origin: [0, 0], origin: [0, 0],
rotation: rotation, rotation: rotation,
shape: { shape: {
@ -101,7 +103,8 @@ export default class line extends Group {
const y = model.points[this.model.points.length - 1].y - model.points[this.model.points.length - 2].y; const y = model.points[this.model.points.length - 1].y - model.points[this.model.points.length - 2].y;
this.arrows = new Polygon({ this.arrows = new Polygon({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
z2: model.z2||0,
origin: [x, y], origin: [x, y],
rotation: rotation, rotation: rotation,
shape: { shape: {

View File

@ -6,13 +6,49 @@ import psdSystem from '@/assets/iscs_picture/iscs-psd.png';
import psdRight from '@/assets/iscs_picture/iscs-psd-right.png'; import psdRight from '@/assets/iscs_picture/iscs-psd-right.png';
import fireBlue from '@/assets/iscs_picture/iscs-fire-blue.png'; import fireBlue from '@/assets/iscs_picture/iscs-fire-blue.png';
import fireRed from '@/assets/iscs_picture/iscs-fire-red.png'; import fireRed from '@/assets/iscs_picture/iscs-fire-red.png';
import envPersonDoor from '@/assets/iscs_picture/renfangmen.png';
import hand from '@/assets/iscs_picture/hand.png';
import fmBlue from '@/assets/iscs_picture/fm-blue.png';
import fmGray from '@/assets/iscs_picture/fm-gray.png';
import fmGreen from '@/assets/iscs_picture/fm-green.png';
import airCond from '@/assets/iscs_picture/kongtiao.png';
import airCondMul from '@/assets/iscs_picture/mul-kongtiao.png';
import setting from '@/assets/iscs_picture/setting.png';
import blowerRedLeft from '@/assets/iscs_picture/gufengji-red-l.png';
import blowerGrayLeft from '@/assets/iscs_picture/gufengji-gray-l.png';
import blowerRedRight from '@/assets/iscs_picture/gufengji-red-r.png';
import blowerGrayRight from '@/assets/iscs_picture/gufengji-gray-r.png';
import iscsAPF from '@/assets/iscs_picture/iscs_APF.png';
import drum from '@/assets/iscs_picture/drum.png';
import exhaustFan from '@/assets/iscs_picture/exhaustFan.png'
import waterCooler from '@/assets/iscs_picture/ZSDF533.png';
import textBgBluePoint from '@/assets/iscs_picture/textBgBluePoint.png';
import ventilationFan from '@/assets/iscs_picture/ventilationFan.png'
const pictureObj = { const pictureObj = {
'psdLeft': psdLeft, 'psdLeft': psdLeft,
'psdSystem': psdSystem, 'psdSystem': psdSystem,
'psdRight': psdRight, 'psdRight': psdRight,
'APF': iscsAPF,
'envPersonDoor': envPersonDoor,
's': fireBlue, 's': fireBlue,
'a': fireRed 'a': fireRed,
hand,
fmBlue,
fmGray,
fmGreen,
airCond,
airCondMul,
setting,
blowerRedLeft,
blowerGrayLeft,
blowerRedRight,
blowerGrayRight,
drum,
exhaustFan,
waterCooler,
textBgBluePoint,
ventilationFan
}; };
export default class Picture extends Group { export default class Picture extends Group {
constructor(device) { constructor(device) {
@ -33,7 +69,9 @@ export default class Picture extends Group {
}); });
this.imageButton = new Image({ this.imageButton = new Image({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
origin: [model.width/2, model.height/2],
rotation: (model.rotation||0)*Math.PI/180,
style: { style: {
x: 0, x: 0,
y: 0, y: 0,

View File

@ -20,7 +20,8 @@ export default class rect extends Group {
const lineDash = model.type == 'dashed' ? [8, 5] : [0, 0]; const lineDash = model.type == 'dashed' ? [8, 5] : [0, 0];
this.iscsRect = new Rect({ this.iscsRect = new Rect({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
z2: model.z2||0,
shape: { shape: {
x: 0, x: 0,
y: 0, y: 0,

View File

@ -3,6 +3,7 @@ import Rect from 'zrender/src/graphic/shape/Rect';
import Line from 'zrender/src/graphic/shape/Line'; import Line from 'zrender/src/graphic/shape/Line';
import Text from 'zrender/src/graphic/Text'; import Text from 'zrender/src/graphic/Text';
import Circle from 'zrender/src/graphic/shape/Circle'; import Circle from 'zrender/src/graphic/shape/Circle';
import { merge } from 'lodash';
const stateMap = { const stateMap = {
slidingDoorEmergencyDoorOpenMalfunction : '滑动门&应急门开门故障', slidingDoorEmergencyDoorOpenMalfunction : '滑动门&应急门开门故障',
slidingDoorEmergencyDoorCloseMalfunction: '滑动门&应急门关门故障', slidingDoorEmergencyDoorCloseMalfunction: '滑动门&应急门关门故障',
@ -166,89 +167,83 @@ export default class StateTable extends Group {
this.create(); this.create();
} }
create() { create() {
const model = this.model; const model = this.model;
const sumWidth = model.columnWidthList.reduce((a,b) => {return a+b;})
this.rectsArr = [];
this.contextsArr = [];
this.grouper = new Group({ this.grouper = new Group({
id: model.code, id: model.code,
position: [model.point.x, model.point.y] position: [model.point.x, model.point.y]
}); });
this.lines = [];
let columnWidth = 0; let rowNum = model.rowNum;
let rowNum = model.rowNum;
let contentIndex = 2; let contentIndex = 2;
if (model.headerType === 'none') { if (model.headerType === 'none') {
rowNum = model.rowNum - 1; rowNum = model.rowNum - 1;
contentIndex = 1; contentIndex = 1;
} }
model.columnWidthList.forEach(item => {
columnWidth += item; if (model.rowHeight||!model.rowHeightList) {
const line = new Line({ model.rowHeightList = new Array(model.rowNum).fill(model.rowHeight);
zlevel: this.zlevel, }
z: this.z,
shape: { let sumRowSize = 0;
x1: columnWidth, model.rowHeightList.forEach((height,i) => {
y1: model.headerType === 'merge' ? model.rowHeight : 0, const rects = [];
x2: columnWidth, let sumColumnSize = 0;
y2: rowNum * model.rowHeight let isMegerHeader = model.headerType === 'merge' && i == 0;
},
style: { if (model.headerType === 'none' && i == 0) {
stroke: model.borderColor || '#FFF', return;
lineWidth: 2 }
}
}); model.columnWidthList.forEach((width,j) => {
this.grouper.add(line); const defBg = model.bgColor||'rgba(0,0,0,0)'
this.lines.push(line); const rect = new Rect({
}); zlevel: this.zlevel,
this.tabelBorder = new Rect({ z: this.z,
zlevel: this.zlevel, shape: {
z: this.z, x: isMegerHeader? 0: sumColumnSize,
shape: { y: sumRowSize,
x: 0, width: isMegerHeader? sumWidth: width,
y: 0, height
width: columnWidth, },
height: rowNum * model.rowHeight style: {
}, stroke: model.borderColor || '#FFF',
style: { lineWidth: 1,
stroke: model.borderColor || '#aFFF', fill: model.tableData[i-1]? model.tableData[i-1]['bg'+(j+1)]||defBg : defBg
fill: 'rgba(255, 255, 255, 0)', }
lineWidth: 2 });
}
}); rects.push(rect);
this.grouper.add(this.tabelBorder); this.grouper.add(rect);
for (let i = 0; i < rowNum; i++) { sumColumnSize += width;
const line = new Line({ });
zlevel: this.zlevel,
z: this.z, this.rectsArr.push(rects);
shape: { sumRowSize += height;
x1: 0, })
y1: i * model.rowHeight,
x2: columnWidth,
y2: i * model.rowHeight
},
style: {
stroke: model.borderColor || '#FFF',
lineWidth: 2
}
});
this.grouper.add(line);
this.lines.push(line);
}
this.header = []; this.header = [];
if (model.headerType === 'merge') { if (model.headerType === 'merge') {
const header = new Text({ const header = new Text({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z + 1, z: model.z + 1,
style: { style: {
x: columnWidth / 2, x: sumWidth / 2,
y: model.rowHeight, y: model.rowHeightList[0] / 2,
fontWeight: 'normal', fontWeight: model.headerFontWeight||'normal',
fontSize: model.headerFontSize, fontSize: model.headerFontSize,
fontFamily: 'consolas', fontFamily: 'consolas',
text: model.headerContextList[0], text: model.headerContextList[0],
textFill: model.textColor || '#FFF', textFill: model.textColor || '#FFF',
textAlign: 'center', textAlign: 'center',
textPosition: 'inside', textPosition: 'inside',
textVerticalAlign: 'bottom', textVerticalAlign: 'center',
textLineHeight: model.rowHeight textLineHeight: model.headerFontSize
} }
}); });
this.grouper.add(header); this.grouper.add(header);
@ -261,92 +256,116 @@ export default class StateTable extends Group {
z: model.z + 1, z: model.z + 1,
style: { style: {
x: item / 2 + width, x: item / 2 + width,
y: model.rowHeight, y: model.rowHeightList[0] / 2,
fontWeight: 'normal', fontWeight: model.headerFontWeight||'normal',
fontSize: model.headerFontSize, fontSize: model.headerFontSize,
fontFamily: 'consolas', fontFamily: 'consolas',
text: model.headerContextList[i], text: model.headerContextList[i],
textFill: model.textColor || '#FFF', textFill: model.textColor || '#FFF',
textAlign: 'center', textAlign: 'center',
textPosition: 'inside', textPosition: 'inside',
textVerticalAlign: 'bottom', textVerticalAlign: 'center',
textLineHeight: model.rowHeight textLineHeight: model.headerFontSize
} }
}); });
width += item; width += item;
this.grouper.add(header); this.grouper.add(header);
this.header.push(header); this.header.push(header);
}); });
} }
this.tabelContent = [];
model.tableData.forEach((item, i)=> { model.tableData.forEach((item, i)=> {
let width = 0; const index = model.headerType === 'none'? i: i+1;
const rects = this.rectsArr[index];
const contexts = [];
model.columnWidthList.forEach((elem, j) => { model.columnWidthList.forEach((elem, j) => {
if (stateMap[item['column' + (j + 1)]] && stateMap[item['column' + (j + 1)]].type === 'Circle') { const rect = rects[j];
const circle = new Circle({ if (rect) {
zlevel: model.zlevel, if (stateMap[item['column' + (j + 1)]] &&
z: model.z + 1, stateMap[item['column' + (j + 1)]].type === 'Circle') {
_subType: stateMap[item['column' + (j + 1)]], const contextColor = stateMap[item['column' + (j + 1)]].color||item['color'+(j + 1)]||'#4CCDE4';
shape: { const circle = new Circle({
cx: elem / 2 + width, zlevel: model.zlevel,
cy: model.rowHeight * (i + contentIndex) - model.rowHeight / 2, z: model.z + 1,
r: model.rowHeight / 3 _subType: stateMap[item['column' + (j + 1)]],
}, shape: {
style: { cx: rect.shape.x + rect.shape.width / 2,
fill: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].color : '#4CCDE4' cy: rect.shape.y + rect.shape.height / 2,
} r: model.rowHeightList[index] / 3
}); },
this.grouper.add(circle); style: {
this.tabelContent.push(circle); fill: contextColor
} else { }
const text = new Text({ });
zlevel: model.zlevel, this.grouper.add(circle);
z: model.z + 1, contexts.push(circle);
_subType: stateMap[item['column' + (j + 1)]], } else {
style:{ const bg = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].background : null;
x: elem / 2 + width, const textPadding = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].textPadding : 0;
y: model.rowHeight * (i + contentIndex), const context = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].default : item['column' + (j + 1)];
fontWeight: 'normal', const contextColor = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].color : item['color'+(j + 1)]||(this.model.textColor ? this.model.textColor : '#4CCDE4');
fontSize: model.fontSize, const contextWeight = stateMap[item['column' + (j + 1)]] ? 'normal': item['weight'+(j + 1)]||this.model.fontWeight||'normal';
fontFamily: 'consolas', const unit = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unit : '';
text: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].default : item['column' + (j + 1)], const unitColor = stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unitColor : item['color'+(j + 1)]||(this.model.textColor ? this.model.textColor : '#4CCDE4')
textFill: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].color : this.model.textColor ? this.model.textColor : '#4CCDE4',
textAlign: 'center', let text = null;
textPosition: 'inside', if (stateMap[item['column' + (j + 1)]] && stateMap[item['column' + (j + 1)]].unit) {
textVerticalAlign: 'bottom', text = new Text({
textPadding: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].textPadding : 0, zlevel: model.zlevel,
textBackgroundColor: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].textBackgroundColor : null, z: model.z + 1,
textLineHeight: model.rowHeight _subType: stateMap[item['column' + (j + 1)]],
} style:{
}); x: rect.shape.x + rect.shape.width / 2,
if (stateMap[item['column' + (j + 1)]] && stateMap[item['column' + (j + 1)]].unit) { y: rect.shape.y + rect.shape.height / 2,
const unitText = new Text({ fontWeight: contextWeight,
zlevel: model.zlevel, fontFamily: 'consolas',
z: model.z + 1, fontSize: model.fontSize,
_subType: stateMap[item['column' + (j + 1)]], text: `{context|${context}} {unit|${unit}}`,
style:{ rich: {
x: elem + width - 5, context: {
y: model.rowHeight * (i + contentIndex), textFill: contextColor,
fontWeight: 'normal', },
fontSize: model.fontSize, unit: {
fontFamily: 'consolas', textFill: unitColor,
text: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unit : '', }
textFill: stateMap[item['column' + (j + 1)]] ? stateMap[item['column' + (j + 1)]].unitColor : this.model.textColor ? this.model.textColor : '#4CCDE4', },
textAlign: 'right', textBackgroundColor: bg,
textPosition: 'inside', textLineHeight: model.fontSize,
textVerticalAlign: 'bottom', textAlign: 'center',
textLineHeight: model.rowHeight textPosition: 'inside',
} textVerticalAlign: 'center',
}); textPadding
this.grouper.add(unitText); }
this.tabelContent.push(unitText); });
} } else {
this.grouper.add(text); text = new Text({
this.tabelContent.push(text); zlevel: model.zlevel,
} z: model.z + 1,
width += elem; _subType: stateMap[item['column' + (j + 1)]],
style:{
x: rect.shape.x + rect.shape.width / 2,
y: rect.shape.y + rect.shape.height / 2,
fontWeight: contextWeight,
fontFamily: 'consolas',
fontSize: model.fontSize,
text: context,
textFill: contextColor,
textBackgroundColor: bg,
textLineHeight: model.fontSize,
textAlign: 'center',
textPosition: 'inside',
textVerticalAlign: 'center',
textPadding
}
});
}
this.grouper.add(text);
contexts.push(text);
}
}
}); });
}); this.contextsArr.push(contexts)
});
this.add(this.grouper); this.add(this.grouper);
} }
setModel(dx, dy) { setModel(dx, dy) {

View File

@ -1,5 +1,5 @@
export function SetRender(dom) { export function SetRender(dom) {
var renderer = new THREE.WebGLRenderer();//{antialias: true} var renderer = new THREE.WebGLRenderer({logarithmicDepthBuffer: true});//{antialias: true}
renderer.setSize(dom.offsetWidth, dom.offsetHeight); renderer.setSize(dom.offsetWidth, dom.offsetHeight);
return renderer; return renderer;
} }

View File

@ -2,7 +2,7 @@ export function SetScene(project) {
var scene = new THREE.Scene(); var scene = new THREE.Scene();
// var cubeTextureLoader = new THREE.CubeTextureLoader(); // var cubeTextureLoader = new THREE.CubeTextureLoader();
// //
// cubeTextureLoader.setPath( '../../static/skybox/star/' ); // cubeTextureLoader.setPath( '/cbtc/static/skybox/star/' );
// //
// var cubeTexture = cubeTextureLoader.load( [ // var cubeTexture = cubeTextureLoader.load( [
// 'px.png', 'nx.png', // 'px.png', 'nx.png',
@ -13,9 +13,9 @@ export function SetScene(project) {
var bgTexture; var bgTexture;
// console.log(project); // console.log(project);
if(project == "login" || project == undefined){ if(project == "login" || project == undefined){
bgTexture = new THREE.TextureLoader().load("../../static/background/other.jpg"); bgTexture = new THREE.TextureLoader().load("/cbtc/static/background/other.jpg");
}else if(project == "heb"){ }else if(project == "heb"){
bgTexture = new THREE.TextureLoader().load("../../static/background/other.jpg"); bgTexture = new THREE.TextureLoader().load("/cbtc/static/background/other.jpg");
} }
scene.background = bgTexture; scene.background = bgTexture;
// cubeTexture.dispos e(); // cubeTexture.dispos e();

View File

@ -46,7 +46,7 @@ export function getmodels(data) {
packageName:"高位三灯信号机", packageName:"高位三灯信号机",
deviceType:"SimulationSignal", deviceType:"SimulationSignal",
type:"signal", type:"signal",
url:"../../static/MODEL/signal/d3d.FBX" url:"/cbtc/static/MODEL/signal/d3d.FBX"
} }
assets.push(assetsignal); assets.push(assetsignal);
@ -57,7 +57,7 @@ export function getmodels(data) {
packageName:"6节列车", packageName:"6节列车",
deviceType:"SimulationTrain", deviceType:"SimulationTrain",
type:"train", type:"train",
url:"../../static/MODEL/train/train.FBX" url:"/cbtc/static/MODEL/train/train.FBX"
} }
assets.push(assettrain); assets.push(assettrain);
@ -67,8 +67,8 @@ export function getmodels(data) {
packageName:"沙盘驾驶内侧站台", packageName:"沙盘驾驶内侧站台",
deviceType:"SimulationStation", deviceType:"SimulationStation",
type:"stationInside", type:"stationInside",
url:"../../static/MODEL/station/fuzhou.FBX" url:"/cbtc/static/MODEL/station/fuzhou.FBX"
}//"../../static/MODEL/station/fuzhou/fuzhou.FBX" }//"/cbtc/static/MODEL/station/fuzhou/fuzhou.FBX"
assets.push(assetneicestation); assets.push(assetneicestation);
let assetswitch = { let assetswitch = {
@ -77,7 +77,7 @@ export function getmodels(data) {
packageName:"轨道通用道岔", packageName:"轨道通用道岔",
deviceType:"SimulationSwitch", deviceType:"SimulationSwitch",
type:"switch", type:"switch",
url:"../../static/MODEL/auto/autoswitch.FBX" url:"/cbtc/static/MODEL/auto/autoswitch.FBX"
} }
assets.push(assetswitch); assets.push(assetswitch);
@ -87,7 +87,7 @@ export function getmodels(data) {
packageName:"沙盘驾驶外侧站台", packageName:"沙盘驾驶外侧站台",
deviceType:"SimulationStation", deviceType:"SimulationStation",
type:"stationOutside", type:"stationOutside",
url:"../../static/MODEL/station/waicestation.FBX" url:"/cbtc/static/MODEL/station/waicestation.FBX"
} }
assets.push(assetwaicestation); assets.push(assetwaicestation);
@ -97,7 +97,7 @@ export function getmodels(data) {
packageName:"沙盘驾驶三站台", packageName:"沙盘驾驶三站台",
deviceType:"SimulationStation", deviceType:"SimulationStation",
type:"stationThree", type:"stationThree",
url:"../../static/MODEL/station/station3.FBX" url:"/cbtc/static/MODEL/station/station3.FBX"
} }
assets.push(assetstation3); assets.push(assetstation3);
@ -107,7 +107,7 @@ export function getmodels(data) {
packageName:"隧道背景", packageName:"隧道背景",
deviceType:"SimulationBg", deviceType:"SimulationBg",
type:"suidao", type:"suidao",
url:"../../static/MODEL/suidao/xiansuidao.FBX" url:"/cbtc/static/MODEL/suidao/xiansuidao.FBX"
} }
assets.push(backgroundmodel); assets.push(backgroundmodel);

View File

@ -19,10 +19,10 @@ export function TrainList() {
// model // model
THREE.Loader.Handlers.add( /\.dds$/i, new THREE.DDSLoader() ) ; THREE.Loader.Handlers.add( /\.dds$/i, new THREE.DDSLoader() ) ;
for(let i=0;i<data.length;i++){ for(let i=0;i<data.length;i++){
new THREE.MTLLoader().setPath( '../../static/MODEL/train/' ).load( 'train.mtl', function ( materials ) { new THREE.MTLLoader().setPath( '/cbtc/static/MODEL/train/' ).load( 'train.mtl', function ( materials ) {
materials.preload(); materials.preload();
new THREE.OBJLoader().setMaterials( materials ).setPath( '../../static/MODEL/train/' ).load( 'train.obj', function ( object ) { new THREE.OBJLoader().setMaterials( materials ).setPath( '/cbtc/static/MODEL/train/' ).load( 'train.obj', function ( object ) {
object.name = data[i].code; object.name = data[i].code;

View File

@ -322,7 +322,6 @@ export function JLmap3dEdit(dom, data, mapid) {
this.testrail = function(){ this.testrail = function(){
if(stationStopGroup.children.length == 0){ if(stationStopGroup.children.length == 0){
for(let k in scope.mapdata.sectionlist.sections.datalist){ for(let k in scope.mapdata.sectionlist.sections.datalist){
if(scope.mapdata.sectionlist.sections.datalist[k].standTrack == true){ if(scope.mapdata.sectionlist.sections.datalist[k].standTrack == true){
var geometry = new THREE.PlaneGeometry( 10, 10, 4 ); var geometry = new THREE.PlaneGeometry( 10, 10, 4 );
var material = new THREE.MeshBasicMaterial( {color: 0xffff00, side: THREE.DoubleSide} ); var material = new THREE.MeshBasicMaterial( {color: 0xffff00, side: THREE.DoubleSide} );
@ -343,31 +342,28 @@ export function JLmap3dEdit(dom, data, mapid) {
}else{ }else{
for(let i=0,leni = stationStopGroup.children.length;i<leni;i++){ for(let i=0,leni = stationStopGroup.children.length;i<leni;i++){
let k = stationStopGroup.children[i].code; let k = stationStopGroup.children[i].code;
if(stationStopGroup.children[i].stopType == "left"){ if(stationStopGroup.children[i].stopType == "left"){
stationStopGroup.children[i].position.set(scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x+scope.mapdata.sectionlist.sections.datalist[k].leftStopPointOffset,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].y,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].z); stationStopGroup.children[i].position.set(scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x+scope.mapdata.sectionlist.sections.datalist[k].mesh.leftStopPointOffset,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].y,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].z);
}else{ }else{
stationStopGroup.children[i].position.set(scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x+scope.mapdata.sectionlist.sections.datalist[k].rightStopPointOffset,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].y,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].z); stationStopGroup.children[i].position.set(scope.mapdata.sectionlist.sections.datalist[k].railpoint[0].x+scope.mapdata.sectionlist.sections.datalist[k].mesh.rightStopPointOffset,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].y,scope.mapdata.sectionlist.sections.datalist[k].railpoint[1].z);
} }
} }
} }
// console.log("testrail");
// console.log(scope.mapdata);
// scope.mapdata.raillist.resetrail(scope.mapdata,scope.scene);
}; };
//自动匹配轨道信号灯道岔
this.autoss = function(){ this.autoss = function(){
console.log("autoss"); console.log("autoss");
console.log(scope.mapdata); // console.log(scope.mapdata);
scope.mapdata.signallist.resetsignal(scope.mapdata); scope.mapdata.signallist.resetsignal(scope.mapdata);
scope.mapdata.switchlist.resetswitch(scope.mapdata); scope.mapdata.switchlist.resetswitch(scope.mapdata);
//old //old
// scope.mapdata.signallist.resetsignal(scope.mapdata.linklist); // scope.mapdata.signallist.resetsignal(scope.mapdata.linklist);
}; };
//区段左右相邻的区段对齐 //区段左右对齐
this.alignmentSection = function(alignmentCode,direct){ this.alignmentSection = function(alignmentCode,direct){
let oldobject = scope.mapdata.sectionlist.sections.datalist[alignmentCode].mesh; let oldobject = scope.mapdata.sectionlist.sections.datalist[alignmentCode].mesh;
let alignmentModel = scope.mapdata.sectionlist.sections.datalist[alignmentCode]; let alignmentModel = scope.mapdata.sectionlist.sections.datalist[alignmentCode];
@ -388,7 +384,7 @@ export function JLmap3dEdit(dom, data, mapid) {
alignmentModel.railpoint[1].x -= offsetX; alignmentModel.railpoint[1].x -= offsetX;
alignmentModel.railpoint[1].y -= offsetY; alignmentModel.railpoint[1].y -= offsetY;
alignmentModel.railpoint[1].z -= offsetZ; alignmentModel.railpoint[1].z -= offsetZ+0.0001;
alignmentModel.railpoint[2].x -= offsetX; alignmentModel.railpoint[2].x -= offsetX;
alignmentModel.railpoint[2].y -= offsetY; alignmentModel.railpoint[2].y -= offsetY;
@ -409,7 +405,7 @@ export function JLmap3dEdit(dom, data, mapid) {
alignmentModel.railpoint[1].x -= offsetX; alignmentModel.railpoint[1].x -= offsetX;
alignmentModel.railpoint[1].y -= offsetY; alignmentModel.railpoint[1].y -= offsetY;
alignmentModel.railpoint[1].z -= offsetZ; alignmentModel.railpoint[1].z -= offsetZ+0.0001;
alignmentModel.railpoint[0].x -= offsetX; alignmentModel.railpoint[0].x -= offsetX;
alignmentModel.railpoint[0].y -= offsetY; alignmentModel.railpoint[0].y -= offsetY;
@ -481,6 +477,7 @@ export function JLmap3dEdit(dom, data, mapid) {
objectparent.add(newAlignmentSection); objectparent.add(newAlignmentSection);
}; };
//区段平整
this.flatSection = function(alignmentCode){ this.flatSection = function(alignmentCode){
let oldobject = scope.mapdata.sectionlist.sections.datalist[alignmentCode].mesh; let oldobject = scope.mapdata.sectionlist.sections.datalist[alignmentCode].mesh;
let alignmentModel = scope.mapdata.sectionlist.sections.datalist[alignmentCode]; let alignmentModel = scope.mapdata.sectionlist.sections.datalist[alignmentCode];
@ -548,6 +545,8 @@ export function JLmap3dEdit(dom, data, mapid) {
scope.mapdata.sectionlist.sections.datalist[alignmentCode].mesh = newAlignmentSection; scope.mapdata.sectionlist.sections.datalist[alignmentCode].mesh = newAlignmentSection;
objectparent.add(newAlignmentSection); objectparent.add(newAlignmentSection);
} }
//屏幕自适应
function onWindowResize() { function onWindowResize() {
//窗口自适应 //窗口自适应
scope.camera.aspect = window.innerWidth / window.innerHeight; scope.camera.aspect = window.innerWidth / window.innerHeight;
@ -613,6 +612,7 @@ export function JLmap3dEdit(dom, data, mapid) {
} }
//画面渲染
function render() { function render() {
scope.renderer.render( scope.scene, scope.camera ); scope.renderer.render( scope.scene, scope.camera );

View File

@ -733,7 +733,7 @@ export function SectionList() {
// console.log("-------------------"); // console.log("-------------------");
// console.log(jlmap3ddata.sectionlist.sections.datalist); // console.log(jlmap3ddata.sectionlist.sections.datalist);
// console.log(sectiondata); // console.log(sectiondata);
var texture = new THREE.TextureLoader().load( '../../static/test/z0251.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/test/z0251.png' );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping; texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 1,1); texture.repeat.set( 1,1);

View File

@ -20,7 +20,7 @@ export function SectionList() {
this.initpromise = function(jlmap3ddata,assetloader,sectiondata,switchdata,scene){ this.initpromise = function(jlmap3ddata,assetloader,sectiondata,switchdata,scene){
var texture = new THREE.TextureLoader().load( '../../static/test/z0251.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/test/z0251.png' );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping; texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 1,1); texture.repeat.set( 1,1);
@ -72,7 +72,7 @@ export function SectionList() {
sectiondata[i].standRightLeftX = sectiondata[i].points[1].x; sectiondata[i].standRightLeftX = sectiondata[i].points[1].x;
sectiondata[i].standRightRightY = sectiondata[i].points[1].y; sectiondata[i].standRightRightY = sectiondata[i].points[1].y;
scope.sections.datalist[sectiondata[i].code].leftStopPointOffset = sectiondata[i].leftStopPointOffset; scope.sections.datalist[sectiondata[i].code].leftStopPointOffset = sectiondata[i].leftStopPointOffset;
scope.sections.datalist[sectiondata[i].code].rightStopPointOffset = sectiondata[i].leftStopPointOffset+124; scope.sections.datalist[sectiondata[i].code].rightStopPointOffset = sectiondata[i].leftStopPointOffset+120;
// if(sectiondata[i].lengthFact<70){ // if(sectiondata[i].lengthFact<70){
// scope.sections.datalist[sectiondata[i].code].lengthFact = 63; // scope.sections.datalist[sectiondata[i].code].lengthFact = 63;
@ -384,14 +384,14 @@ export function SectionList() {
assetloader.modellist[num2].mesh.rotation.x = 0; assetloader.modellist[num2].mesh.rotation.x = 0;
} }
} }
//根据站台区段创建站台位置 128停车点距离 //根据站台区段创建站台位置 120停车点距离
for(let j=0,lenj=stations.length;j<lenj;j++){ for(let j=0,lenj=stations.length;j<lenj;j++){
// console.log(j); // console.log(j);
console.log(stations[j]); console.log(stations[j]);
let direction1 = scope.sections.datalist[stations[j].stands[0].section]; let direction1 = scope.sections.datalist[stations[j].stands[0].section];
let direction2 = scope.sections.datalist[stations[j].stands[1].section]; let direction2 = scope.sections.datalist[stations[j].stands[1].section];
console.log(direction1); console.log(direction1);
let x = direction1.railpoint[0].x+direction1.leftStopPointOffset+64; let x = direction1.railpoint[0].x+direction1.leftStopPointOffset+60;
let z = (direction1.railpoint[0].z+direction2.railpoint[0].z)/2; let z = (direction1.railpoint[0].z+direction2.railpoint[0].z)/2;
let mesh; let mesh;
if(stations[j].stands[0].inside == true){ if(stations[j].stands[0].inside == true){
@ -414,7 +414,7 @@ export function SectionList() {
}; };
function createsection(origin,position,start,py){ function createsection(origin,position,start,py){
var texture = new THREE.TextureLoader().load( '../../static/test/z0251.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/test/z0251.png' );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping; texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 1,1); texture.repeat.set( 1,1);
@ -455,7 +455,7 @@ export function SectionList() {
}) })
let testmesh2; let testmesh2;
if(scope.sections.datalist[start].standTrack == false){ if(scope.sections.datalist[start].standTrack == false){
testmesh2 = new THREE.Mesh( geometry, randomMaterail ); testmesh2 = new THREE.Mesh( geometry, selectmaterial );
}else{ }else{
testmesh2 = new THREE.Mesh( geometry, selectmaterial ); testmesh2 = new THREE.Mesh( geometry, selectmaterial );
} }
@ -804,7 +804,7 @@ export function SectionList() {
} }
this.loadpromise = function(jlmap3ddata,assetloader,sectiondata,section2d,switch2d,scene){ this.loadpromise = function(jlmap3ddata,assetloader,sectiondata,section2d,switch2d,scene){
var texture = new THREE.TextureLoader().load( '../../static/test/z0251.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/test/z0251.png' );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping; texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 1,1); texture.repeat.set( 1,1);
@ -1002,7 +1002,7 @@ export function SectionList() {
scope.sections.datalist[section2d[i].code].standRightLeftX = section2d[i].points[1].x; scope.sections.datalist[section2d[i].code].standRightLeftX = section2d[i].points[1].x;
scope.sections.datalist[section2d[i].code].standRightRightY = section2d[i].points[1].y; scope.sections.datalist[section2d[i].code].standRightRightY = section2d[i].points[1].y;
scope.sections.datalist[section2d[i].code].leftStopPointOffset = section2d[i].leftStopPointOffset; scope.sections.datalist[section2d[i].code].leftStopPointOffset = section2d[i].leftStopPointOffset;
scope.sections.datalist[section2d[i].code].rightStopPointOffset = section2d[i].leftStopPointOffset+124; scope.sections.datalist[section2d[i].code].rightStopPointOffset = section2d[i].leftStopPointOffset+120;
} }
} }

View File

@ -1,13 +1,13 @@
export function Signallightload(lights) { export function Signallightload(lights) {
settexture(lights, "red", '../../static/MODEL/device/signal/1.jpg'); settexture(lights, "red", '/cbtc/static/MODEL/device/signal/1.jpg');
settexture(lights, "yellow", '../../static/MODEL/device/signal/2.jpg'); settexture(lights, "yellow", '/cbtc/static/MODEL/device/signal/2.jpg');
settexture(lights, "green", '../../static/MODEL/device/signal/3.jpg'); settexture(lights, "green", '/cbtc/static/MODEL/device/signal/3.jpg');
settexture(lights, "black", '../../static/MODEL/device/signal/4.jpg'); settexture(lights, "black", '/cbtc/static/MODEL/device/signal/4.jpg');
} }
function settexture(lights, name, textureurl) { function settexture(lights, name, textureurl) {

View File

@ -5,16 +5,16 @@ var Staticmodel = {
deviceType: "Switch", deviceType: "Switch",
type: "fuzhou", type: "fuzhou",
picUrl: "", picUrl: "",
assetUrl: "./../static/MODEL/device/switch/ZD6D.FBX" assetUrl: "./../cbtc/static/MODEL/device/switch/ZD6D.FBX"
},//"https://joylink.club/oss/wx/switch/switch.FBX" },//"https://joylink.club/oss/wx/switch/switch.FBX"
//../../static/MODEL/device/switch.FBX ///cbtc/static/MODEL/device/switch.FBX
Signal: { Signal: {
id: "2", id: "2",
name: "信号机", name: "信号机",
deviceType: "Signal", deviceType: "Signal",
type: "low", type: "low",
picUrl: "", picUrl: "",
assetUrl: "../../static/MODEL/device/signal/signal.FBX" assetUrl: "/cbtc/static/MODEL/device/signal/signal.FBX"
}, },
stationstand: { stationstand: {
id: "3", id: "3",
@ -22,9 +22,9 @@ var Staticmodel = {
deviceType: "stationstand", deviceType: "stationstand",
type: "low", type: "low",
picUrl: "", picUrl: "",
assetUrl: "../../static/MODEL/device/stationstand/stationstand.FBX" assetUrl: "/cbtc/static/MODEL/device/stationstand/stationstand.FBX"
//https://joylink.club/oss/wx/stationstand/stationstand.FBX //https://joylink.club/oss/wx/stationstand/stationstand.FBX
//../../static/MODEL/device/stationstand.FBX ///cbtc/static/MODEL/device/stationstand.FBX
}, },
section: { section: {
@ -33,9 +33,9 @@ var Staticmodel = {
deviceType: "section", deviceType: "section",
type: "low", type: "low",
picUrl: "", picUrl: "",
assetUrl: "../../static/MODEL/device/section/section.FBX" assetUrl: "/cbtc/static/MODEL/device/section/section.FBX"
//https://joylink.club/oss/wx/stationstand/stationstand.FBX //https://joylink.club/oss/wx/stationstand/stationstand.FBX
//../../static/MODEL/device/stationstand.FBX ///cbtc/static/MODEL/device/stationstand.FBX
}, },
room: { room: {
@ -44,9 +44,9 @@ var Staticmodel = {
deviceType: "room", deviceType: "room",
type: "low", type: "low",
picUrl: "", picUrl: "",
assetUrl: "../../static/MODEL/device/room/room.FBX" assetUrl: "/cbtc/static/MODEL/device/room/room.FBX"
//https://joylink.club/oss/wx/stationstand/stationstand.FBX //https://joylink.club/oss/wx/stationstand/stationstand.FBX
//../../static/MODEL/device/stationstand.FBX ///cbtc/static/MODEL/device/stationstand.FBX
} }

View File

@ -688,7 +688,7 @@ export function Jl3ddevice(dom,group,token) {
} }
} }
var beauty = new Image(); var beauty = new Image();
beauty.src = "../../static/texture/guide.png"; beauty.src = "/cbtc/static/texture/guide.png";
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text){ function getTextCanvas(text){

View File

@ -828,7 +828,7 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
} }
} }
var beauty = new Image(); var beauty = new Image();
beauty.src = "../../static/texture/guide.png"; beauty.src = "/cbtc/static/texture/guide.png";
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text){ function getTextCanvas(text){

View File

@ -1,7 +1,7 @@
import { getBaseUrl } from '@/utils/baseUrl'; import { getBaseUrl } from '@/utils/baseUrl';
const BASE_API = getBaseUrl(); const BASE_API = getBaseUrl();
let modelurl = "../../static/MODEL/jdq/"; let modelurl = "/cbtc/static/MODEL/jdq/";
// if(BASE_API == 'https://joylink.club/jlcloud'){ // if(BASE_API == 'https://joylink.club/jlcloud'){
// modelurl = "https://joylink.club/oss/jdq/"; // modelurl = "https://joylink.club/oss/jdq/";
// }else if(BASE_API == 'https://test.joylink.club/jlcloud'){ // }else if(BASE_API == 'https://test.joylink.club/jlcloud'){

View File

@ -61,7 +61,7 @@ export function Jl3ddevice(dom,serviceid) {
//定义场景(渲染容器) //定义场景(渲染容器)
let scene = new THREE.Scene(); let scene = new THREE.Scene();
var bgTexture = new THREE.TextureLoader().load("../../static/background/other.jpg"); var bgTexture = new THREE.TextureLoader().load("/cbtc/static/background/other.jpg");
scene.background = bgTexture; scene.background = bgTexture;
//定义全局光 //定义全局光
@ -540,7 +540,7 @@ export function Jl3ddevice(dom,serviceid) {
} }
var beauty = new Image(); var beauty = new Image();
beauty.src = "../../static/texture/guide.png"; beauty.src = "/cbtc/static/texture/guide.png";
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text){ function getTextCanvas(text){

View File

@ -56,7 +56,7 @@ export function Jl3ddevice(dom,serviceid) {
//定义场景(渲染容器) //定义场景(渲染容器)
let scene = new THREE.Scene(); let scene = new THREE.Scene();
var bgTexture = new THREE.TextureLoader().load("../../static/background/other.jpg"); var bgTexture = new THREE.TextureLoader().load("/cbtc/static/background/other.jpg");
scene.background = bgTexture; scene.background = bgTexture;
//定义全局光 //定义全局光
@ -537,7 +537,7 @@ export function Jl3ddevice(dom,serviceid) {
} }
var beauty = new Image(); var beauty = new Image();
beauty.src = "../../static/texture/guide.png"; beauty.src = "/cbtc/static/texture/guide.png";
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text){ function getTextCanvas(text){

View File

@ -110,7 +110,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
var rails = null; var rails = null;
this.webwork=new Worker('../../static/workertest/trainworker.js'); this.webwork=new Worker('/cbtc/static/workertest/trainworker.js');
// 地图模型数据 // 地图模型数据
let mapdata = new Jl3ddata(); let mapdata = new Jl3ddata();
@ -130,7 +130,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
// load a sound and set it as the Audio object's buffer // load a sound and set it as the Audio object's buffer
// let audioLoader = new THREE.AudioLoader(); // let audioLoader = new THREE.AudioLoader();
// audioLoader.load( '../../static/audio/trainmove.ogg', function( buffer ) { // audioLoader.load( '/cbtc/static/audio/trainmove.ogg', function( buffer ) {
// sound.setBuffer( buffer ); // sound.setBuffer( buffer );
// sound.setLoop( true ); // sound.setLoop( true );
// sound.setVolume( 0 ); // sound.setVolume( 0 );
@ -144,10 +144,11 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
scene.add(controls3.getObject()); scene.add(controls3.getObject());
let cameracctv = new THREE.PerspectiveCamera(50, dom.clientWidth/dom.clientHeight, 0.1, 50); let cameracctv = new THREE.PerspectiveCamera(50, dom.clientWidth/dom.clientHeight, 0.1, 50);
cameracctv.position.set( 0, -0.4,29 ); cameracctv.position.set( -3, 0,1.5 );
// cameracctv.rotation.y = Math.PI/2; cameracctv.rotation.y = -Math.PI/2;
camera.add(cameracctv); cameracctv.rotation.x = Math.PI/2;
// camera.add(cameracctv);
// 初始化加载数据和模型 // 初始化加载数据和模型
@ -159,7 +160,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
if(assetsdata.link){ if(assetsdata.link){
scope.datatype = "old"; scope.datatype = "old";
// datanew(); // datanew();
// scope.jsonwebwork = new Worker("../../static/workertest/jsonworker.js"); // scope.jsonwebwork = new Worker("/cbtc/static/workertest/jsonworker.js");
// scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork); // scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork);
// scope.Subscribe.socketon(scope.Subscribe.topic); // scope.Subscribe.socketon(scope.Subscribe.topic);
@ -208,7 +209,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
}, 2000); }, 2000);
}else{ }else{
scope.datatype = "new"; scope.datatype = "new";
driverWebWorker = new Worker("../../static/workertest/driverWebWorker.js"); driverWebWorker = new Worker("/cbtc/static/workertest/driverWebWorker.js");
scope.Subscribe = new Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,driverWebWorker,stats); scope.Subscribe = new Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,driverWebWorker,stats);
datanew(); datanew();
@ -433,6 +434,9 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
trainlisttest = loadtrainlisttest; trainlisttest = loadtrainlisttest;
realsectionlist = loadrealsectionlist; realsectionlist = loadrealsectionlist;
rails = loadrails; rails = loadrails;
console.log(trainlisttest.group.children[0]);
trainlisttest.group.children[0].getObjectByName("c1").add(cameracctv);
} }
this.eventon = function() { this.eventon = function() {

View File

@ -50,8 +50,10 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
driverWebWorker.onmessage = function (event) { driverWebWorker.onmessage = function (event) {
let data = event.data; let data = event.data;
// console.log(data);
if(data.type == "Train_Position"){ if(data.type == "Train_Position"){
trainrun(data.body); nowTrainRun(data.body);
return; return;
} }
@ -60,7 +62,15 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
otherTrainRun(data.body); otherTrainRun(data.body);
return; return;
} }
if(data.type == "Train_Hmi_3D"){ if(data.type == "Train_Hmi_3D"){
//改变当前列车code
if(data.body.groupNumber){
changeNowTrain(data.body);
}
updatestatus(data.body); updatestatus(data.body);
return; return;
} }
@ -92,7 +102,88 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
return; return;
} }
} }
//切换车辆修改列车属性
function changeNowTrain(data){
if(data.right == "0"){
if(data.rightDoorCanClose == false){
trainmodel.openright = '0';
for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = 0;
actions["traindoor"].down[an].timeScale = -1;
actions["traindoor"].down[an].play();
}
}else{
trainmodel.openright = "1";
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].down[an].timeScale = 1;
actions["traindoor"].down[an].play();
}
}
if(data.leftDoorCanClose == false){
trainmodel.openleft = "0";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = 0;
actions["traindoor"].top[an].timeScale = -1;
actions["traindoor"].top[an].play();
}
}else{
trainmodel.openleft = "1";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].top[an].timeScale = 1;
actions["traindoor"].top[an].play();
}
}
}else{
if(data.leftDoorCanClose == false){
trainmodel.openleft = "0";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = 0;
actions["traindoor"].top[an].timeScale = -1;
actions["traindoor"].top[an].play();
}
}else{
trainmodel.openleft = "1";
for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].top[an].timeScale = 1;
actions["traindoor"].top[an].play();
}
}
if(data.rightDoorCanClose == false){
trainmodel.openright = '0';
for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = 0;
actions["traindoor"].down[an].timeScale = -1;
actions["traindoor"].down[an].play();
}
}else{
trainmodel.openright = "1";
for(let an=actions["traindoor"].down.length-1;an>=0;an--){
actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].down[an].timeScale = 1;
actions["traindoor"].down[an].play();
}
}
}
}
this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails, materiallist, nowaction, scene) { this.updatamap = function(newsectionlist,newlinklist,newsignallist,newstationstandlist,newtrainlisttest,newrealsectionlist,newrails, materiallist, nowaction, scene) {
// console.log(mapdata); // console.log(mapdata);
// console.log(newtrainlisttest); // console.log(newtrainlisttest);
@ -115,7 +206,7 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
this.socketon = function(topic) { this.socketon = function(topic) {
try { try {
// console.log("teststomp"); // console.log("teststomp");
scope.teststomp.subscribe(topic, callback, header); // scope.teststomp.subscribe(topic, callback, header);
} catch (error) { } catch (error) {
console.error('websocket订阅失败'); console.error('websocket订阅失败');
} }
@ -153,9 +244,9 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
let data = JSON.parse(Response.body); let data = JSON.parse(Response.body);
// stats.update(); // stats.update();
// 遍历后台数据 // 遍历后台数据
// console.log(data); console.log(data);
if(data.type == "Train_Position"){ if(data.type == "Train_Position"){
trainrun(data.body); nowTrainRun(data.body);
return; return;
} }
@ -405,13 +496,10 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
} }
//更新当前驾驶车辆
function nowTrainRun(data){
function trainrun(data){ //改变当前列车code
// console.log(data);
// if(data.code = "336"){
// console.log(data);
// }
if(data.code != trainmodel.code){ if(data.code != trainmodel.code){
if(trainlisttest.otherTrainList[trainmodel.code] && trainmodel.code){ if(trainlisttest.otherTrainList[trainmodel.code] && trainmodel.code){
trainlisttest.otherTrainList[trainmodel.code].offset = 0; trainlisttest.otherTrainList[trainmodel.code].offset = 0;
@ -421,11 +509,13 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
trainmodel.nowcode = data.code; trainmodel.nowcode = data.code;
} }
//改变当前列车行驶的区段code
if(data.section != trainmodel.nowsection){ if(data.section != trainmodel.nowsection){
trainmodel.nowsection = data.section; trainmodel.nowsection = data.section;
trainmodel.curve = rails.sectionrail[data.section].lineleft; trainmodel.curve = rails.sectionrail[data.section].lineleft;
} }
// console.log(trainmodel.right);
//判断转向
if(trainmodel.right != data.right){ if(trainmodel.right != data.right){
if(data.right == "0"){ if(data.right == "0"){
@ -528,8 +618,8 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
let offsetz = pos.z + trainmodel.children[0].position.z; let offsetz = pos.z + trainmodel.children[0].position.z;
trainmodel.children[0].position.z -= offsetz; trainmodel.children[0].position.z -= offsetz;
let offsety = pos.y - trainmodel.children[0].position.y; // let offsety = pos.y - trainmodel.children[0].position.y;
trainmodel.children[0].position.y += offsetz; // trainmodel.children[0].position.y += offsetz;
// trainmodel.position.z = point.z; // trainmodel.position.z = point.z;
} }
@ -768,8 +858,6 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
} }
} }
}else{ }else{
if (trainmodel.openright != data.open && data.open == '0') { if (trainmodel.openright != data.open && data.open == '0') {
trainmodel.openright = '0'; trainmodel.openright = '0';
for (let an=actions["traindoor"].down.length-1; an>=0; an--) { for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
@ -787,11 +875,9 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
actions["traindoor"].down[an].play(); actions["traindoor"].down[an].play();
} }
} }
} }
} }
} }
} }

View File

@ -701,7 +701,7 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
} }
} }
var beauty = new Image(); var beauty = new Image();
beauty.src = "../../static/texture/guide.png"; beauty.src = "/cbtc/static/texture/guide.png";
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text){ function getTextCanvas(text){

View File

@ -73,7 +73,7 @@ export function Jl3dfaultdeviceVR(dom,group,skinCode) {
let playerPosition = new THREE.Vector3( -3.5, 0.5, 5.5 ); let playerPosition = new THREE.Vector3( -3.5, 0.5, 5.5 );
let targetPosition = new THREE.Vector3(); let targetPosition = new THREE.Vector3();
let pathFinder = new THREE.Pathfinding(); let pathFinder = new THREE.Pathfinding();
var textureNav = new THREE.TextureLoader().load( '../../static/vrtest/daohang.png' ); var textureNav = new THREE.TextureLoader().load( '/cbtc/static/vrtest/daohang.png' );
textureNav.wrapS = THREE.RepeatWrapping; textureNav.wrapS = THREE.RepeatWrapping;
textureNav.wrapT=THREE.RepeatWrapping; textureNav.wrapT=THREE.RepeatWrapping;
textureNav.repeat.x = 40; textureNav.repeat.x = 40;
@ -195,7 +195,7 @@ export function Jl3dfaultdeviceVR(dom,group,skinCode) {
// load a resource // load a resource
loaderObj.load( loaderObj.load(
// resource URL // resource URL
'../../static/vrtest/path.obj', '/cbtc/static/vrtest/path.obj',
// called when resource is loaded // called when resource is loaded
function ( object ) { function ( object ) {
@ -267,7 +267,7 @@ export function Jl3dfaultdeviceVR(dom,group,skinCode) {
document.addEventListener( "mousedown", onselect, false ); document.addEventListener( "mousedown", onselect, false );
let vrwebworker = new Worker("../../static/workertest/vrwebworker.js"); let vrwebworker = new Worker("/cbtc/static/workertest/vrwebworker.js");
let connectmsg = { let connectmsg = {
type:'init', type:'init',
@ -1144,7 +1144,7 @@ export function Jl3dfaultdeviceVR(dom,group,skinCode) {
var loader = new THREE.TextureLoader(); var loader = new THREE.TextureLoader();
var circle; var circle;
loader.load( loader.load(
'../../static/vrtest/ring.png', '/cbtc/static/vrtest/ring.png',
// onLoad callback // onLoad callback
function ( texture ) { function ( texture ) {
@ -1404,7 +1404,7 @@ export function Jl3dfaultdeviceVR(dom,group,skinCode) {
} }
} }
var beauty = new Image(); var beauty = new Image();
beauty.src = "../../static/texture/scene.png"; beauty.src = "/cbtc/static/texture/scene.png";
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text){ function getTextCanvas(text){

View File

@ -170,7 +170,7 @@ export function Jl3dOtherVR(dom,group,skinCode) {
this.controls.update(); this.controls.update();
let otherVrViewWorker = new Worker("../../static/workertest/otherVrViewWorker.js"); let otherVrViewWorker = new Worker("/cbtc/static/workertest/otherVrViewWorker.js");
let connectmsg = { let connectmsg = {
type:'init', type:'init',
@ -822,7 +822,7 @@ export function Jl3dOtherVR(dom,group,skinCode) {
} }
} }
var beauty = new Image(); var beauty = new Image();
beauty.src = "../../static/texture/scene.png"; beauty.src = "/cbtc/static/texture/scene.png";
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text){ function getTextCanvas(text){

View File

@ -19,6 +19,10 @@ let controller1, controller2,raycastervr;
//地板 //地板
let floors = []; let floors = [];
var loader = new THREE.TextureLoader();
var circle;
export function Jl3dTrainRescueVr(dom,group,skinCode) { export function Jl3dTrainRescueVr(dom,group,skinCode) {
var scope = this; var scope = this;
@ -99,9 +103,35 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
this.controls.target.set( 0, 1.6, 0 ); this.controls.target.set( 0, 1.6, 0 );
this.controls.update(); this.controls.update();
this.modelmanager = new ModelManagerVR();
loader.load(
'/cbtc/static/vrtest/ring.png',
// onLoad callback
function ( texture ) {
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var geometry = new THREE.PlaneBufferGeometry( 0.6, 0.6, 32 );
// var geometry = new THREE.CircleBufferGeometry( 0.2, 32 );
circle = new THREE.Mesh( geometry, material );
circle.rotation.x = -Math.PI/2;
scope.scene.add( circle );
scope.modelmanager.loadpromise(TrainRescueStatic,mixers);
},
// onProgress callback currently not supported
undefined,
// onError callback
function ( err ) {
console.error( 'An error happened.' );
}
);
this.modelmanager = new ModelManagerVR();
this.modelmanager.loadpromise(TrainRescueStatic,mixers);
let timer=setInterval(function(){ let timer=setInterval(function(){
@ -133,7 +163,7 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
document.addEventListener( "mousedown", onselect, false ); document.addEventListener( "mousedown", onselect, false );
let vrwebworker = new Worker("../../static/workertest/vrwebworker.js"); let vrwebworker = new Worker("/cbtc/static/workertest/vrwebworker.js");
let connectmsg = { let connectmsg = {
type:'init', type:'init',
@ -269,33 +299,7 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
} }
var loader = new THREE.TextureLoader();
var circle;
loader.load(
'../../static/vrtest/ring.png',
// onLoad callback
function ( texture ) {
var material = new THREE.MeshBasicMaterial( {
map: texture,
transparent: true,
} );
var geometry = new THREE.PlaneBufferGeometry( 0.6, 0.6, 32 );
// var geometry = new THREE.CircleBufferGeometry( 0.2, 32 );
circle = new THREE.Mesh( geometry, material );
circle.rotation.x = -Math.PI/2;
scope.scene.add( circle );
},
// onProgress callback currently not supported
undefined,
// onError callback
function ( err ) {
console.error( 'An error happened.' );
}
);
function intersectObjects( controller ) { function intersectObjects( controller ) {
@ -322,10 +326,52 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
intersectObjects( controller1 ); intersectObjects( controller1 );
if (mixers){ if (mixers){
for (let k in mixers) { // for (let k in mixers) {
delta = clock.getDelta(); if(mixers["animatemodel"]._actions[0].isRunning()){
mixers[k].update(delta); delta = clock.getDelta();
if(controlStage == true){
if(animateStage == "0"){
if(TrainRescueStatic.animatemodel.action.time < 2.6){
mixers["animatemodel"].update(delta);
}else{
TrainRescueStatic.animatemodel.action.paused = true;
}
}
if(animateStage == "1"){
if(TrainRescueStatic.animatemodel.action.time >= 2.6 && TrainRescueStatic.animatemodel.action.time <5.2){
mixers["animatemodel"].update(delta);
}else{
TrainRescueStatic.animatemodel.action.paused = true;
}
}
if(animateStage == "2"){
if(TrainRescueStatic.animatemodel.action.time >= 5.2 && TrainRescueStatic.animatemodel.action.time <7.8){
mixers["animatemodel"].update(delta);
}else{
TrainRescueStatic.animatemodel.action.paused = true;
}
}
if(animateStage == "3"){
if(TrainRescueStatic.animatemodel.action.time >= 7.8 && TrainRescueStatic.animatemodel.action.time <20){
mixers["animatemodel"].update(delta);
}else{
TrainRescueStatic.animatemodel.action.paused = true;
}
}
if(animateStage == "4"){
if(TrainRescueStatic.animatemodel.action.time >= 20){
mixers["animatemodel"].update(delta);
}else{
TrainRescueStatic.animatemodel.action.paused = true;
}
}
}
} }
// }
} }
// scope.controls.update(); // scope.controls.update();
updateControlModel(); updateControlModel();
@ -333,14 +379,15 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
} }
// //
let controlStage = 0; let controlStage = false;
//animateStage 动画播放阶段 //animateStage 动画播放阶段
//0两侧千斤顶升降 //0两侧千斤顶升降
//1中间千斤顶平移 //1中间千斤顶平移
//2中间千斤顶升降 //2中间千斤顶升降
let animateStage = 0; let animateStage = "0";
function updateControlModel(){ function updateControlModel(){
if(controlMoveSwitch == true){ if(controlMoveSwitch == true){
console.log(nowControlModel.name);
console.log(TrainRescueStatic.animatemodel.action.time); console.log(TrainRescueStatic.animatemodel.action.time);
// console.log(nowControlModel); // console.log(nowControlModel);
// console.log(TrainRescueStatic.handR.mesh); // console.log(TrainRescueStatic.handR.mesh);
@ -349,38 +396,173 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
// console.log(originPoint); // console.log(originPoint);
// rad *= ( endNorm.cross( startNorm ).dot( eye ) < 0 ? 1 : -1); // rad *= ( endNorm.cross( startNorm ).dot( eye ) < 0 ? 1 : -1);
if(nowControlModel.name == "5"){ if(nowControlModel.name == "5"){
let v1 = new THREE.Vector3(-originPoint.x,5-originPoint.y,-originPoint.z); let v1 = new THREE.Vector3(-originPoint.x,5-originPoint.y,-originPoint.z);
let v2 = new THREE.Vector3(overPoint.z-originPoint.z,overPoint.y-originPoint.y,overPoint.x-originPoint.x); let v2 = new THREE.Vector3(overPoint.z-originPoint.z,overPoint.y-originPoint.y,overPoint.x-originPoint.x);
let rad = v1.angleTo(v2); let rad = v1.angleTo(v2);
console.log(rad); console.log(rad);
if(rad>0.725 && rad<2.37){ if(rad>0.725 && rad<2.37){
if(TrainRescueStatic.animatemodel.action.time >= 7.8 && TrainRescueStatic.animatemodel.action.time <20){
animateStage = "3";
if(rad>1.3){
if(controlStage == false){
TrainRescueStatic.animatemodel.action.timeScale = -1;
TrainRescueStatic.animatemodel.action.paused = false;
TrainRescueStatic.animatemodel.action.play();
controlStage = true;
}
}else if(rad<1.20){
if(controlStage == false){
TrainRescueStatic.animatemodel.action.timeScale = 1;
TrainRescueStatic.animatemodel.action.paused = false;
TrainRescueStatic.animatemodel.action.play();
controlStage = true;
}
}else{
controlStage = false;
TrainRescueStatic.animatemodel.action.paused = true;
rad = 1.25;
}
}
nowControlModel.rotation.x = rad+Math.PI; nowControlModel.rotation.x = rad+Math.PI;
} }
}
}else{
if(nowControlModel.name == "1" || nowControlModel.name == "4"){
let v1 = new THREE.Vector3(-originPoint.x,5-originPoint.y,-originPoint.z); let v1 = new THREE.Vector3(-originPoint.x,5-originPoint.y,-originPoint.z);
let v2 = new THREE.Vector3(overPoint.x-originPoint.x,overPoint.y-originPoint.y,overPoint.z-originPoint.z); let v2 = new THREE.Vector3(overPoint.x-originPoint.x,overPoint.y-originPoint.y,overPoint.z-originPoint.z);
let rad = v1.angleTo(v2); let rad = v1.angleTo(v2);
console.log(rad);
if(rad>0.546 && rad<2.4){ if(rad>0.546 && rad<2.4){
if(TrainRescueStatic.animatemodel.action.time<2.65){
animateStage = "0";
if(rad>1.3){
if(controlStage == false){
if(TrainRescueStatic.animatemodel.action.time>2.6){
TrainRescueStatic.animatemodel.action.reset();
TrainRescueStatic.animatemodel.action.time = 2.599;
}
TrainRescueStatic.animatemodel.action.timeScale = -1;
TrainRescueStatic.animatemodel.action.paused = false;
TrainRescueStatic.animatemodel.action.play();
controlStage = true;
if(rad>1.3){ }
TrainRescueStatic.animatemodel.action.timeScale = -1; }else if(rad<1.20){
TrainRescueStatic.animatemodel.action.paused = false; if(controlStage == false){
TrainRescueStatic.animatemodel.action.play(); TrainRescueStatic.animatemodel.action.timeScale = 1;
}else if(rad<1.20){ TrainRescueStatic.animatemodel.action.paused = false;
TrainRescueStatic.animatemodel.action.timeScale = 1; TrainRescueStatic.animatemodel.action.play();
TrainRescueStatic.animatemodel.action.paused = false; controlStage = true;
TrainRescueStatic.animatemodel.action.play();
}else{ }
TrainRescueStatic.animatemodel.action.paused = true; }else{
rad = 1.25; controlStage = false;
TrainRescueStatic.animatemodel.action.paused = true;
rad = 1.25;
}
}
if(TrainRescueStatic.animatemodel.action.time >= 5.2 && TrainRescueStatic.animatemodel.action.time <7.8){
animateStage = "2";
if(rad>1.3){
if(controlStage == false){
TrainRescueStatic.animatemodel.action.timeScale = 1;
TrainRescueStatic.animatemodel.action.paused = false;
TrainRescueStatic.animatemodel.action.play();
controlStage = true;
}
}else if(rad<1.20){
if(controlStage == false){
TrainRescueStatic.animatemodel.action.timeScale = -1;
TrainRescueStatic.animatemodel.action.paused = false;
TrainRescueStatic.animatemodel.action.play();
controlStage = true;
}
}else{
controlStage = false;
TrainRescueStatic.animatemodel.action.paused = true;
rad = 1.25;
}
} }
nowControlModel.rotation.y = rad-Math.PI/2.5; nowControlModel.rotation.y = rad-Math.PI/2.5;
}
}
if(nowControlModel.name == "2" || nowControlModel.name == "3"){
let v1 = new THREE.Vector3(-originPoint.x,5-originPoint.y,-originPoint.z);
let v2 = new THREE.Vector3(overPoint.x-originPoint.x,overPoint.y-originPoint.y,overPoint.z-originPoint.z);
let rad = v1.angleTo(v2);
if(rad>0.546 && rad<2.4){
if(TrainRescueStatic.animatemodel.action.time>=2.6 && TrainRescueStatic.animatemodel.action.time<5.2){
console.log(animateStage);
animateStage = "1";
if(rad>1.3){
if(controlStage == false){
// if(TrainRescueStatic.animatemodel.action.time<5.2){
// TrainRescueStatic.animatemodel.action.reset();
// TrainRescueStatic.animatemodel.action.time = 2.6;
// }
TrainRescueStatic.animatemodel.action.timeScale = -1;
TrainRescueStatic.animatemodel.action.paused = false;
TrainRescueStatic.animatemodel.action.play();
controlStage = true;
}
}else if(rad<1.20){
if(controlStage == false){
// if(TrainRescueStatic.animatemodel.action.time>2.6){
// TrainRescueStatic.animatemodel.action.reset();
// TrainRescueStatic.animatemodel.action.time = 2.6;
// }
TrainRescueStatic.animatemodel.action.timeScale = 1;
TrainRescueStatic.animatemodel.action.paused = false;
TrainRescueStatic.animatemodel.action.play();
controlStage = true;
}
}else{
controlStage = false;
TrainRescueStatic.animatemodel.action.paused = true;
rad = 1.25;
}
}
if(TrainRescueStatic.animatemodel.action.time >= 20){
animateStage = "4";
if(rad>1.3){
if(controlStage == false){
TrainRescueStatic.animatemodel.action.timeScale = 1;
TrainRescueStatic.animatemodel.action.paused = false;
TrainRescueStatic.animatemodel.action.play();
controlStage = true;
}
}else if(rad<1.20){
if(controlStage == false){
// if(TrainRescueStatic.animatemodel.action.time>2.6){
// TrainRescueStatic.animatemodel.action.reset();
// TrainRescueStatic.animatemodel.action.time = 2.6;
// }
TrainRescueStatic.animatemodel.action.timeScale = -1;
TrainRescueStatic.animatemodel.action.paused = false;
TrainRescueStatic.animatemodel.action.play();
controlStage = true;
}
}else{
controlStage = false;
TrainRescueStatic.animatemodel.action.paused = true;
rad = 1.25;
}
}
nowControlModel.rotation.y = rad-Math.PI/2.5;
} }
} }
@ -429,7 +611,7 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
} }
} }
var beauty = new Image(); var beauty = new Image();
beauty.src = "../../static/texture/scene.png"; beauty.src = "/cbtc/static/texture/scene.png";
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text){ function getTextCanvas(text){

View File

@ -4,36 +4,36 @@ var TrainRescueStatic = {
name: "动画模型", name: "动画模型",
deviceType: "animatemodel", deviceType: "animatemodel",
type: "animatemodel", type: "animatemodel",
url: "../../static/vrtest/trainrescue/DH923.FBX" url: "/cbtc/static/vrtest/trainrescue/DH923.FBX"
},//"https://joylink.club/oss/wx/switch/switch.FBX" },//"https://joylink.club/oss/wx/switch/switch.FBX"
//../../static/MODEL/device/switch.FBX ///cbtc/static/MODEL/device/switch.FBX
floorplane: { floorplane: {
id: "2", id: "2",
name: "行走范围", name: "行走范围",
deviceType: "runplane", deviceType: "runplane",
type: "runplane", type: "runplane",
url: "../../static/vrtest/trainrescue/diban.FBX" url: "/cbtc/static/vrtest/trainrescue/diban.FBX"
}, },
controlmodel: { controlmodel: {
id: "3", id: "3",
name: "控制台", name: "控制台",
deviceType: "controlmodel", deviceType: "controlmodel",
type: "controlmodel", type: "controlmodel",
url: "../../static/vrtest/trainrescue/kongzhigan.FBX" url: "/cbtc/static/vrtest/trainrescue/kongzhigan.FBX"
}, },
other: { other: {
id: "4", id: "4",
name: "其他", name: "其他",
deviceType: "other", deviceType: "other",
type: "other", type: "other",
url: "../../static/vrtest/trainrescue/TK.FBX" url: "/cbtc/static/vrtest/trainrescue/TK.FBX"
}, },
handR: { handR: {
id: "5", id: "5",
name: "handr", name: "handr",
deviceType: "handr", deviceType: "handr",
type: "handr", type: "handr",
url: "../../static/vrtest/trainrescue/handr.FBX" url: "/cbtc/static/vrtest/trainrescue/handr.FBX"
} }
} }

View File

@ -102,7 +102,7 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
//地图模型数据 //地图模型数据
let mapdata = new Jl3ddata(); let mapdata = new Jl3ddata();
this.webwork = new Worker("../../static/workertest/trainworker.js"); this.webwork = new Worker("/cbtc/static/workertest/trainworker.js");
//初始化加载数据和模型getPublishMapDetail //初始化加载数据和模型getPublishMapDetail
getPublishMapDetail(skinCode).then(data => { getPublishMapDetail(skinCode).then(data => {
let mapnetdata = data.data; let mapnetdata = data.data;
@ -124,7 +124,7 @@ export function JLmap3dMaintainer(dom, data,skinCode,storemod,routegroup,project
}else{ }else{
scope.datatype = "new"; scope.datatype = "new";
scope.jsonwebworknew = new Worker("../../static/workertest/maintainerworker.js"); scope.jsonwebworknew = new Worker("/cbtc/static/workertest/maintainerworker.js");
scope.Subscribe = new Maintainerconnect(scope,routegroup,scope.jsonwebworknew,lablecodemap); scope.Subscribe = new Maintainerconnect(scope,routegroup,scope.jsonwebworknew,lablecodemap);
scope.Subscribe.socketon(scope.Subscribe.topic); scope.Subscribe.socketon(scope.Subscribe.topic);
MaintainerLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod); MaintainerLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod);

View File

@ -7,7 +7,7 @@ export function TrainControl(){
// load a sound and set it as the Audio object's buffer // load a sound and set it as the Audio object's buffer
let audioLoader = new THREE.AudioLoader(); let audioLoader = new THREE.AudioLoader();
audioLoader.load( '../../static/audio/trainmove.ogg', function( buffer ) { audioLoader.load( '/cbtc/static/audio/trainmove.ogg', function( buffer ) {
scope.sound.setBuffer( buffer ); scope.sound.setBuffer( buffer );
scope.sound.setLoop( true ); scope.sound.setLoop( true );
scope.sound.setVolume( 3 ); scope.sound.setVolume( 3 );

View File

@ -17,7 +17,7 @@ export function VrGui(){
var geometryPlane = new THREE.PlaneBufferGeometry( 1.4, 2, 16); var geometryPlane = new THREE.PlaneBufferGeometry( 1.4, 2, 16);
var texturePlane = new THREE.TextureLoader().load( '../../static/texture/devicemsgpane.png' ); var texturePlane = new THREE.TextureLoader().load( '/cbtc/static/texture/devicemsgpane.png' );
var materialPlane = new THREE.MeshBasicMaterial( { var materialPlane = new THREE.MeshBasicMaterial( {
map: texturePlane, map: texturePlane,
side: THREE.DoubleSide, side: THREE.DoubleSide,
@ -36,7 +36,7 @@ export function VrGui(){
var geometryButtonPane = new THREE.PlaneBufferGeometry( 0.4, 0.2, 16 ); var geometryButtonPane = new THREE.PlaneBufferGeometry( 0.4, 0.2, 16 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonHome.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/buttonHome.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -48,7 +48,7 @@ export function VrGui(){
buttonHome.position.z = 0.02; buttonHome.position.z = 0.02;
plane.add( buttonHome ); plane.add( buttonHome );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonStationList.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/buttonStationList.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -60,7 +60,7 @@ export function VrGui(){
buttonStationList.position.z = 0.02; buttonStationList.position.z = 0.02;
plane.add( buttonStationList ); plane.add( buttonStationList );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonFaultList.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/buttonFaultList.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -78,7 +78,7 @@ export function VrGui(){
var geometryButtonPage = new THREE.PlaneBufferGeometry( 0.3, 0.1, 16 ); var geometryButtonPage = new THREE.PlaneBufferGeometry( 0.3, 0.1, 16 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonPrevious.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/buttonPrevious.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -90,7 +90,7 @@ export function VrGui(){
buttonPreviousFault.position.z = 0.02; buttonPreviousFault.position.z = 0.02;
scope.faultListGroup.add( buttonPreviousFault ); scope.faultListGroup.add( buttonPreviousFault );
// //
// var texture = new THREE.TextureLoader().load( '../../static/vrtest/nav.png' ); // var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/nav.png' );
// var material = new THREE.MeshBasicMaterial( { // var material = new THREE.MeshBasicMaterial( {
// map: texture, // map: texture,
// transparent: true, // transparent: true,
@ -102,7 +102,7 @@ export function VrGui(){
// buttonPrevious.position.z = 0.02; // buttonPrevious.position.z = 0.02;
// plane.add( buttonPrevious ); // plane.add( buttonPrevious );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonNext.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/buttonNext.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -114,7 +114,7 @@ export function VrGui(){
buttonNextFault.position.z = 0.02; buttonNextFault.position.z = 0.02;
scope.faultListGroup.add( buttonNextFault ); scope.faultListGroup.add( buttonNextFault );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonPrevious.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/buttonPrevious.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -127,7 +127,7 @@ export function VrGui(){
scope.stationListGroup.add( buttonPreviousStation ); scope.stationListGroup.add( buttonPreviousStation );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/buttonNext.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/buttonNext.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -145,7 +145,7 @@ export function VrGui(){
var geometryButtonBox = new THREE.PlaneBufferGeometry( 0.25, 0.25, 16 ); var geometryButtonBox = new THREE.PlaneBufferGeometry( 0.25, 0.25, 16 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/nav.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/nav.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -157,7 +157,7 @@ export function VrGui(){
button1.position.z = 0.02; button1.position.z = 0.02;
scope.deviceGroup.add( button1 ); scope.deviceGroup.add( button1 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/anime.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/anime.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -171,7 +171,7 @@ export function VrGui(){
var texture = new THREE.TextureLoader().load( '../../static/vrtest/reset.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/reset.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -183,7 +183,7 @@ export function VrGui(){
button2.position.z = 0.02; button2.position.z = 0.02;
scope.deviceGroup.add( button2 ); scope.deviceGroup.add( button2 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/repire.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/repire.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -208,7 +208,7 @@ export function VrGui(){
var geometryButtonBox = new THREE.PlaneBufferGeometry( 0.3, 0.3, 16 ); var geometryButtonBox = new THREE.PlaneBufferGeometry( 0.3, 0.3, 16 );
var textureshebei = new THREE.TextureLoader().load( '../../static/vrtest/shebei.png' ); var textureshebei = new THREE.TextureLoader().load( '/cbtc/static/vrtest/shebei.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: textureshebei, map: textureshebei,
transparent: true, transparent: true,
@ -220,7 +220,7 @@ export function VrGui(){
buttonShiBei.position.z = 0.02; buttonShiBei.position.z = 0.02;
plane.add( buttonShiBei ); plane.add( buttonShiBei );
var texturezhankong = new THREE.TextureLoader().load( '../../static/vrtest/zhankong.png' ); var texturezhankong = new THREE.TextureLoader().load( '/cbtc/static/vrtest/zhankong.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texturezhankong, map: texturezhankong,
transparent: true, transparent: true,
@ -234,7 +234,7 @@ export function VrGui(){
var texture = new THREE.TextureLoader().load( '../../static/vrtest/station1.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/station1.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -246,7 +246,7 @@ export function VrGui(){
buttonStation1.position.z = 0.02; buttonStation1.position.z = 0.02;
plane.add( buttonStation1 ); plane.add( buttonStation1 );
var texture = new THREE.TextureLoader().load( '../../static/vrtest/station2.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/vrtest/station2.png' );
var material = new THREE.MeshBasicMaterial( { var material = new THREE.MeshBasicMaterial( {
map: texture, map: texture,
transparent: true, transparent: true,
@ -452,7 +452,7 @@ export function VrGui(){
var beauty = new Image(); var beauty = new Image();
beauty.src = "../../static/texture/scene.png"; beauty.src = "/cbtc/static/texture/scene.png";
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text,type){ function getTextCanvas(text,type){

View File

@ -6,42 +6,42 @@ export function ModelManagerVR(){
// code:"test", // code:"test",
// locateType:"01", // locateType:"01",
// mesh:null, // mesh:null,
// url:"../../static/vrtest/vrtest.FBX" // url:"/cbtc/static/vrtest/vrtest.FBX"
// }; // };
this.stationIn = { this.stationIn = {
code:"stationIn", code:"stationIn",
locateType:"1", locateType:"1",
mesh:null, mesh:null,
url:"../../static/vrtest/stationIn.FBX" url:"/cbtc/static/vrtest/stationIn.FBX"
}; };
this.stationOut = { this.stationOut = {
code:"stationOut", code:"stationOut",
locateType:"2", locateType:"2",
mesh:null, mesh:null,
url:"../../static/vrtest/stationIn.FBX" url:"/cbtc/static/vrtest/stationIn.FBX"
}; };
this.otherDevice = { this.otherDevice = {
code:"otherDevice", code:"otherDevice",
locateType:"3", locateType:"3",
mesh:null, mesh:null,
url:"../../static/vrtest/otherDevice.FBX" url:"/cbtc/static/vrtest/otherDevice.FBX"
}; };
this.train = { this.train = {
code:"train", code:"train",
locateType:"4", locateType:"4",
mesh:null, mesh:null,
url:"../../static/vrtest/vrTrain.FBX" url:"/cbtc/static/vrtest/vrTrain.FBX"
}; };
this.human = { this.human = {
code:"human", code:"human",
locateType:"5", locateType:"5",
mesh:null, mesh:null,
url:"../../static/vrtest/vrHuman.FBX" url:"/cbtc/static/vrtest/vrHuman.FBX"
}; };
this.loadpromise = function (mixers){ this.loadpromise = function (mixers){

View File

@ -5,16 +5,16 @@ var Staticmodel = {
deviceType: "man", deviceType: "man",
type: "man", type: "man",
picUrl: "", picUrl: "",
assetUrl: "../../static/MODEL/passflow/man1.FBX" assetUrl: "/cbtc/static/MODEL/passflow/man1.FBX"
},//"https://joylink.club/oss/wx/switch/switch.FBX" },//"https://joylink.club/oss/wx/switch/switch.FBX"
//../../static/MODEL/device/switch.FBX ///cbtc/static/MODEL/device/switch.FBX
man2: { man2: {
id: "2", id: "2",
name: "人物2", name: "人物2",
deviceType: "man", deviceType: "man",
type: "man", type: "man",
picUrl: "", picUrl: "",
assetUrl: "../../static/MODEL/passflow/man2.FBX" assetUrl: "/cbtc/static/MODEL/passflow/man2.FBX"
}, },
station: { station: {
id: "3", id: "3",
@ -22,7 +22,7 @@ var Staticmodel = {
deviceType: "station", deviceType: "station",
type: "hrb", type: "hrb",
picUrl: "", picUrl: "",
assetUrl: "../../static/MODEL/passflow/station.FBX" assetUrl: "/cbtc/static/MODEL/passflow/station.FBX"
}, },
zhajiin: { zhajiin: {
id: "4", id: "4",
@ -30,7 +30,7 @@ var Staticmodel = {
deviceType: "zhajiin", deviceType: "zhajiin",
type: "hrb", type: "hrb",
picUrl: "", picUrl: "",
assetUrl: "../../static/MODEL/passflow/zhajiin.FBX" assetUrl: "/cbtc/static/MODEL/passflow/zhajiin.FBX"
}, },
zhajiout: { zhajiout: {
id: "5", id: "5",
@ -38,7 +38,7 @@ var Staticmodel = {
deviceType: "zhajiout", deviceType: "zhajiout",
type: "hrb", type: "hrb",
picUrl: "", picUrl: "",
assetUrl: "../../static/MODEL/passflow/zhajiout.FBX" assetUrl: "/cbtc/static/MODEL/passflow/zhajiout.FBX"
}, },
monitor: { monitor: {
id: "6", id: "6",
@ -46,7 +46,7 @@ var Staticmodel = {
deviceType: "monitor", deviceType: "monitor",
type: "hrb", type: "hrb",
picUrl: "", picUrl: "",
assetUrl: "../../static/MODEL/passflow/monitor.FBX" assetUrl: "/cbtc/static/MODEL/passflow/monitor.FBX"
}, },
train: { train: {
id: "7", id: "7",
@ -54,7 +54,7 @@ var Staticmodel = {
deviceType: "train", deviceType: "train",
type: "hrb", type: "hrb",
picUrl: "", picUrl: "",
assetUrl: "../../static/MODEL/train/train.FBX" assetUrl: "/cbtc/static/MODEL/train/train.FBX"
}, },
section: { section: {
id: "8", id: "8",
@ -62,7 +62,7 @@ var Staticmodel = {
deviceType: "section", deviceType: "section",
type: "hrb", type: "hrb",
picUrl: "", picUrl: "",
assetUrl: "../../static/MODEL/passflow/section.FBX" assetUrl: "/cbtc/static/MODEL/passflow/section.FBX"
}, },

View File

@ -52,8 +52,8 @@ let zhajiout = [];
let deviceaction = []; let deviceaction = [];
// let passerwebwork = new Worker("../../static/workertest/passsimulation/passer.js"); // let passerwebwork = new Worker("/cbtc/static/workertest/passsimulation/passer.js");
let stationwebwork = new Worker("../../static/workertest/passsimulation/station.js"); let stationwebwork = new Worker("/cbtc/static/workertest/passsimulation/station.js");
let stationzon = new ZoneManager(); let stationzon = new ZoneManager();
//老版本临时ai控制 //老版本临时ai控制
@ -297,7 +297,7 @@ export function Jl3dpassflow(dom,skinCode,routegroup,viewMap) {
// load a resource // load a resource
loader.load( loader.load(
// resource URL // resource URL
'../../static/jl3d/path/path.obj', '/cbtc/static/jl3d/path/path.obj',
// called when resource is loaded // called when resource is loaded
function ( object ) { function ( object ) {

View File

@ -68,7 +68,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
for(let i=0,leni=event.data.body.length;i<leni;i++){ for(let i=0,leni=event.data.body.length;i<leni;i++){
// console.log(event.data.body[i]); // console.log(event.data.body[i]);
trainrunnew(event.data.body[i]); trainRunNew(event.data.body[i]);
} }
return; return;
} }
@ -152,7 +152,7 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
} }
}; };
function trainrunnew(data){ function trainRunNew(data){
let code = data.code; let code = data.code;
if(trainlisttest.list[code].right != data.right){ if(trainlisttest.list[code].right != data.right){
@ -833,20 +833,20 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
function switchupdate(data) { function switchupdate(data) {
code = data.code; code = data.code;
if (actions[code].normal != data.normal) { if (actions[code].normal != data.normal) {
if (data.normal == '02') { if (data.normal == '1') {
// sectionlist.switchs.modellist[j].normal = data.normal; // sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = 0; actions[code].action.time = 0;
actions[code].action.timeScale = 1; actions[code].action.timeScale = 1;
actions[code].action.play(); actions[code].action.play();
actions[code].normal = "02"; actions[code].normal = "1";
} else if (data.normal == '01') { } else if (data.normal == '0') {
// sectionlist.switchs.modellist[j].normal = data.normal; // sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration; actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1; actions[code].action.timeScale = -1;
actions[code].action.play(); actions[code].action.play();
actions[code].normal = "01"; actions[code].normal = "0";
} }
} }
} }

View File

@ -103,7 +103,7 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
//连接到通信 //连接到通信
//console.log(this.Subscribe.config); //console.log(this.Subscribe.config);
this.webwork = new Worker("../../static/workertest/trainworker.js"); this.webwork = new Worker("/cbtc/static/workertest/trainworker.js");
//初始化加载数据和模型getPublishMapDetail //初始化加载数据和模型getPublishMapDetail
getPublishMapDetail(skinCode).then(data => { getPublishMapDetail(skinCode).then(data => {
let mapnetdata = data.data; let mapnetdata = data.data;
@ -111,14 +111,14 @@ export function JLmap3d(dom, data,skinCode,storemod,routegroup,project) {
let assetsdata = JSON.parse(netdata.data.sections); let assetsdata = JSON.parse(netdata.data.sections);
if(assetsdata.link){ if(assetsdata.link){
scope.datatype = "old"; scope.datatype = "old";
scope.jsonwebwork = new Worker("../../static/workertest/jsonworker.js"); scope.jsonwebwork = new Worker("/cbtc/static/workertest/jsonworker.js");
scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork); scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork);
scope.Subscribe.socketon(scope.Subscribe.topic); scope.Subscribe.socketon(scope.Subscribe.topic);
SimulationLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod); SimulationLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod);
}else{ }else{
scope.datatype = "new"; scope.datatype = "new";
scope.jsonwebworknew = new Worker("../../static/workertest/jsonworkernew.js"); scope.jsonwebworknew = new Worker("/cbtc/static/workertest/jsonworkernew.js");
scope.Subscribe = new Jlmap3dSubscribeNew(scope,routegroup,scope.jsonwebworknew); scope.Subscribe = new Jlmap3dSubscribeNew(scope,routegroup,scope.jsonwebworknew);
scope.Subscribe.socketon(scope.Subscribe.topic); scope.Subscribe.socketon(scope.Subscribe.topic);
SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod); SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod);

View File

@ -184,7 +184,10 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) {
_movemesh.geometry.computeBoundingSphere(); _movemesh.geometry.computeBoundingSphere();
_movemesh.geometry.center(); _movemesh.geometry.center();
// _movemesh.lengthfact = (_movemesh.geometry.attributes.position.array[_movemesh.rightlist[0]] - _movemesh.geometry.attributes.position.array[_movemesh.leftlist[0]])*2+28; // _movemesh.lengthfact = (_movemesh.geometry.attributes.position.array[_movemesh.rightlist[0]] - _movemesh.geometry.attributes.position.array[_movemesh.leftlist[0]])*2+28;
_movemesh.lengthFact = (_movemesh.geometry.attributes.position.array[_movemesh.rightlist[0]*3] - _movemesh.geometry.attributes.position.array[_movemesh.leftlist[0]*3]);
_movemesh.lengthFact = (_movemesh.geometry.attributes.position.array[_movemesh.rightlist[0]*3] - _movemesh.geometry.attributes.position.array[_movemesh.leftlist[0]*3]);
} }
@ -451,10 +454,21 @@ THREE.ScalControls = function ( scene,_camera, _domElement ) {
z:newpointlist[i].z z:newpointlist[i].z
} }
} }
let oldlengthfact = _movemesh.lengthFact;
_movemesh.lengthFact = closedSpline.arcLengthDivisions/4; _movemesh.lengthFact = closedSpline.arcLengthDivisions/4;
if(newpointlist.length>2){ if(newpointlist.length>2){
_movemesh.lengthFact = _movemesh.lengthFact/curvestep; _movemesh.lengthFact = _movemesh.lengthFact/curvestep;
} }
console.log(_movemesh);
if(_movemesh.standTrack == true){
let newleftpoint = _movemesh.leftStopPointOffset/oldlengthfact;
let newrightpoint = _movemesh.rightStopPointOffset/oldlengthfact;
_movemesh.leftStopPointOffset = newleftpoint*_movemesh.lengthFact;
_movemesh.rightStopPointOffset = newrightpoint*_movemesh.lengthFact;
console.log(_movemesh.leftStopPointOffset);
}
let len = _movemesh.lengthFact; let len = _movemesh.lengthFact;
// closedSpline.arcLengthDivisions; // closedSpline.arcLengthDivisions;

View File

@ -11,7 +11,7 @@ let defaultsignal = {
deviceType:"signal", deviceType:"signal",
type:"low", type:"low",
picUrl:"", picUrl:"",
url:"../../static/MODEL/signal/d3d.FBX" url:"/cbtc/static/MODEL/signal/d3d.FBX"
} }
let defaulttrain = { let defaulttrain = {
@ -20,7 +20,7 @@ let defaulttrain = {
deviceType:"train", deviceType:"train",
type:"num4", type:"num4",
picUrl:"", picUrl:"",
url:"../../static/MODEL/train/train.FBX" url:"/cbtc/static/MODEL/train/train.FBX"
} }
@ -30,15 +30,15 @@ let defaultstation = {
deviceType:"stand", deviceType:"stand",
type:"num4", type:"num4",
picUrl:"", picUrl:"",
url:"../../static/MODEL/station/fuzhou.FBX" url:"/cbtc/static/MODEL/station/fuzhou.FBX"
}//"../../static/MODEL/station/fuzhou/fuzhou.FBX" }//"/cbtc/static/MODEL/station/fuzhou/fuzhou.FBX"
let waicestation = { let waicestation = {
id:"10", id:"10",
name:"外侧车站", name:"外侧车站",
deviceType:"standwaice", deviceType:"standwaice",
type:"num4", type:"num4",
picUrl:"", picUrl:"",
url:"../../static/MODEL/station/waicestation.FBX" url:"/cbtc/static/MODEL/station/waicestation.FBX"
} }
let station3 = { let station3 = {
id:"10000", id:"10000",
@ -46,12 +46,12 @@ let station3 = {
deviceType:"station3", deviceType:"station3",
type:"num4", type:"num4",
picUrl:"", picUrl:"",
url:"../../static/MODEL/station/station3.FBX" url:"/cbtc/static/MODEL/station/station3.FBX"
} }
//"../../static/MODEL/station/fuzhou/fuzhou.FBX" //"/cbtc/static/MODEL/station/fuzhou/fuzhou.FBX"
//https://test.joylink.club/oss/station/fuzhou/fuzhou.FBX //https://test.joylink.club/oss/station/fuzhou/fuzhou.FBX
//https://joylink.club/oss/station/fuzhou/fuzhou.FBX //https://joylink.club/oss/station/fuzhou/fuzhou.FBX
//../../static/MODEL/station/zhantai715(2).FBX ///cbtc/static/MODEL/station/zhantai715(2).FBX
let defaultswitch = { let defaultswitch = {
id:"11", id:"11",
@ -59,7 +59,7 @@ let defaultswitch = {
deviceType:"switch", deviceType:"switch",
type:"fuzhou", type:"fuzhou",
picUrl:"", picUrl:"",
url:"../../static/MODEL/daocha/daocha.FBX" url:"/cbtc/static/MODEL/daocha/daocha.FBX"
} }
@ -69,7 +69,7 @@ let defaultsuidao = {
deviceType:"suidao", deviceType:"suidao",
type:"suidao", type:"suidao",
picUrl:"", picUrl:"",
url:"../../static/MODEL/suidao/suidao.FBX" url:"/cbtc/static/MODEL/suidao/suidao.FBX"
} }
let hebsuidao = { let hebsuidao = {
@ -78,7 +78,7 @@ let hebsuidao = {
deviceType:"hebsuidao", deviceType:"hebsuidao",
type:"hebsuidao", type:"hebsuidao",
picUrl:"", picUrl:"",
url:"../../static/MODEL/suidao/hebsuidao.FBX" url:"/cbtc/static/MODEL/suidao/hebsuidao.FBX"
} }
let nbsuidao = { let nbsuidao = {
id:"1010", id:"1010",
@ -86,7 +86,7 @@ let nbsuidao = {
deviceType:"nbsuidao", deviceType:"nbsuidao",
type:"nbsuidao", type:"nbsuidao",
picUrl:"", picUrl:"",
url:"../../static/MODEL/suidao/nbsuidao.FBX" url:"/cbtc/static/MODEL/suidao/nbsuidao.FBX"
} }
let defaultbackground = { let defaultbackground = {
id:"16", id:"16",
@ -94,12 +94,12 @@ let defaultbackground = {
deviceType:"background", deviceType:"background",
type:"background", type:"background",
picUrl:"", picUrl:"",
url:"../../static/MODEL/suidao/background.FBX" url:"/cbtc/static/MODEL/suidao/background.FBX"
} }
//"../../static/MODEL/suidao/suidao.FBX" //"/cbtc/static/MODEL/suidao/suidao.FBX"
//https://test.joylink.club/oss/suidao/suidao.FBX //https://test.joylink.club/oss/suidao/suidao.FBX
//https://joylink.club/oss/suidao/suidao.FBX //https://joylink.club/oss/suidao/suidao.FBX
//../../static/MODEL/suidao/suidao.FBX ///cbtc/static/MODEL/suidao/suidao.FBX
let defaultautorail = { let defaultautorail = {
id:"100", id:"100",
@ -107,7 +107,7 @@ let defaultautorail = {
deviceType:"autorail", deviceType:"autorail",
type:"autorail", type:"autorail",
picUrl:"", picUrl:"",
url:"../../static/MODEL/auto/rail.FBX" url:"/cbtc/static/MODEL/auto/rail.FBX"
} }
let autoswitch = { let autoswitch = {
@ -116,7 +116,7 @@ let autoswitch = {
deviceType:"autoswitch", deviceType:"autoswitch",
type:"fuzhou", type:"fuzhou",
picUrl:"", picUrl:"",
url:"../../static/MODEL/auto/autoswitch.FBX" url:"/cbtc/static/MODEL/auto/autoswitch.FBX"
} }
let autoswitch1 = { let autoswitch1 = {
@ -125,7 +125,7 @@ let autoswitch1 = {
deviceType:"autoswitch1", deviceType:"autoswitch1",
type:"fuzhou", type:"fuzhou",
picUrl:"", picUrl:"",
url:"../../static/MODEL/auto/switch1.FBX" url:"/cbtc/static/MODEL/auto/switch1.FBX"
} }
let autoswitch2 = { let autoswitch2 = {
@ -134,7 +134,7 @@ let autoswitch2 = {
deviceType:"autoswitch2", deviceType:"autoswitch2",
type:"fuzhou", type:"fuzhou",
picUrl:"", picUrl:"",
url:"../../static/MODEL/auto/switch2.FBX" url:"/cbtc/static/MODEL/auto/switch2.FBX"
} }
export function AssetLoader(){ export function AssetLoader(){

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -84,7 +84,7 @@ export function SimulationLoadNew(data,scope,netdata,mapdata,camera,controls,sce
} }
} }
assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList); assetloader.setModelListOver(JSON.parse(netdata.assets).sceneAssetList,3);
// assetloader.setmodellistnew(netdata.assets); // assetloader.setmodellistnew(netdata.assets);

View File

@ -226,7 +226,7 @@ export function StationStandList() {
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
var stationcanvas = new Image(); var stationcanvas = new Image();
stationcanvas.src = "../../static/texture/msgt.png"; stationcanvas.src = "/cbtc/static/texture/msgt.png";
function getTextCanvas(text){ function getTextCanvas(text){
let canvas = document.getElementById('canvastexture'); let canvas = document.getElementById('canvastexture');

View File

@ -213,7 +213,7 @@ let onProgress = function ( xhr ) {
let onError = function () { }; let onError = function () { };
var beauty = new Image(); var beauty = new Image();
beauty.src = "../../static/texture/guide.png"; beauty.src = "/cbtc/static/texture/guide.png";
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text){ function getTextCanvas(text){

View File

@ -147,9 +147,9 @@ export function RailListN(){
for(let i=0;i<section.length;i++){ for(let i=0;i<section.length;i++){
scope.sectionrail[section[i].code].lineleft = new THREE.CatmullRomCurve3(scope.sectionrail[section[i].code].points); scope.sectionrail[section[i].code].lineleft = new THREE.CatmullRomCurve3(scope.sectionrail[section[i].code].points);
scope.sectionrail[section[i].code].lineleft.curveType = "centripetal"; scope.sectionrail[section[i].code].lineleft.curveType = "chordal";
scope.sectionrail[section[i].code].lineleft.tension = 0.15;
scope.sectionrail[section[i].code].lineleft.name = section[i].code; scope.sectionrail[section[i].code].lineleft.name = section[i].code;
// scope.sectionrail[section[i].code].lineleft.tension = 0.2;
let rightpoints = []; let rightpoints = [];
scope.sectionrail[section[i].code].points.forEach(item=>{ scope.sectionrail[section[i].code].points.forEach(item=>{
rightpoints.push(item); rightpoints.push(item);
@ -157,7 +157,8 @@ export function RailListN(){
); );
rightpoints.reverse(); rightpoints.reverse();
scope.sectionrail[section[i].code].lineright = new THREE.CatmullRomCurve3(rightpoints); scope.sectionrail[section[i].code].lineright = new THREE.CatmullRomCurve3(rightpoints);
scope.sectionrail[section[i].code].lineright.curveType = "centripetal"; scope.sectionrail[section[i].code].lineright.curveType = "chordal";
scope.sectionrail[section[i].code].lineright.tension = 0.15;
scope.sectionrail[section[i].code].lineright.name = section[i].code; scope.sectionrail[section[i].code].lineright.name = section[i].code;
if(section[i].standTrack == true){ if(section[i].standTrack == true){
scope.sectionrail[section[i].code].standTrack = true; scope.sectionrail[section[i].code].standTrack = true;
@ -240,37 +241,37 @@ export function RailListN(){
scope.sectionrail[sectioncode].lineright.closed = false; scope.sectionrail[sectioncode].lineright.closed = false;
scope.sectionrail[sectioncode].lineright.name = sectioncode; scope.sectionrail[sectioncode].lineright.name = sectioncode;
// for(let n=0,nm=scope.sectionrail[sectioncode].lineleft.points.length;n<nm;n++){ for(let n=0,nm=scope.sectionrail[sectioncode].lineleft.points.length;n<nm;n++){
// var geometry = new THREE.CircleGeometry( 0.05, 16 ); var geometry = new THREE.CircleGeometry( 0.05, 16 );
// var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
// var circle = new THREE.Mesh( geometry, material ); var circle = new THREE.Mesh( geometry, material );
// // console.log(n); // console.log(n);
// // console.log(scope.sectionrail[section[i].code].lineleft.points[n]); // console.log(scope.sectionrail[section[i].code].lineleft.points[n]);
// circle.position.x = scope.sectionrail[sectioncode].lineleft.points[n].x; circle.position.x = scope.sectionrail[sectioncode].lineleft.points[n].x;
// circle.position.y = scope.sectionrail[sectioncode].lineleft.points[n].y; circle.position.y = scope.sectionrail[sectioncode].lineleft.points[n].y;
// circle.position.z = scope.sectionrail[sectioncode].lineleft.points[n].z; circle.position.z = scope.sectionrail[sectioncode].lineleft.points[n].z;
// circle.rotation.x = -Math.PI/2; circle.rotation.x = -Math.PI/2;
// scene.add( circle ); scene.add( circle );
// } }
// // scope.sectionrail[section[i].code].lineright.tension = 0.11; // scope.sectionrail[section[i].code].lineright.tension = 0.11;
// var points = scope.sectionrail[sectioncode].lineleft.getPoints( 50 ); var points = scope.sectionrail[sectioncode].lineleft.getPoints( 50 );
// var geometry = new THREE.BufferGeometry().setFromPoints( points ); var geometry = new THREE.BufferGeometry().setFromPoints( points );
// var material; var material;
// if(scope.sectionrail[sectioncode].type == "a"){ if(scope.sectionrail[sectioncode].type == "a"){
// material = new THREE.LineBasicMaterial( { color : 0xff0000 } ); material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
// } }
// if(scope.sectionrail[sectioncode].type == "b"){ if(scope.sectionrail[sectioncode].type == "b"){
// material = new THREE.LineBasicMaterial( { color : 0x00ff00 } ); material = new THREE.LineBasicMaterial( { color : 0x00ff00 } );
// } }
// if(scope.sectionrail[sectioncode].type == "c"){ if(scope.sectionrail[sectioncode].type == "c"){
// material = new THREE.LineBasicMaterial( { color : 0x0000ff } ); material = new THREE.LineBasicMaterial( { color : 0x0000ff } );
// } }
//
//
// // Create the final object to add to the scene // Create the final object to add to the scene
// var curveObject = new THREE.Line( geometry, material ); var curveObject = new THREE.Line( geometry, material );
//
// curveObject.position.y = Math.random(); curveObject.position.y = Math.random();
// scene.add(curveObject); scene.add(curveObject);
} }
} }

View File

@ -19,7 +19,7 @@ export function SectionListN() {
var autorail; var autorail;
this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){
var texture = new THREE.TextureLoader().load( '../../static/test/z0251.png' ); var texture = new THREE.TextureLoader().load( '/cbtc/static/test/z0251.png' );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping; texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 1,1); texture.repeat.set( 1,1);
@ -99,16 +99,30 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){
if(newsection.railpoint.length>=3){ if(newsection.railpoint.length>=3){
// console.log(newsection); // console.log(newsection);
let height = Math.random()/1000; let height = Math.random()/1000;
var closedSpline = new THREE.CatmullRomCurve3( [ var closedSpline;
new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[0].y,newsection.railpoint[0].z), if(Math.abs(newsection.railpoint[0].y-newsection.railpoint[2].y)>0.01){
new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[1].y,newsection.railpoint[1].z+0.0001), console.log(newsection.railpoint);
new THREE.Vector3(newsection.railpoint[2].x,newsection.railpoint[2].y,newsection.railpoint[2].z) closedSpline = new THREE.CatmullRomCurve3( [
] ); new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[0].y,newsection.railpoint[0].z),
new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[1].y,newsection.railpoint[1].z+0.001),
new THREE.Vector3(newsection.railpoint[2].x,newsection.railpoint[2].y,newsection.railpoint[2].z)
] );
}else{
closedSpline = new THREE.CatmullRomCurve3( [
new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[0].y,newsection.railpoint[0].z),
new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[0].y,newsection.railpoint[1].z+0.001),
new THREE.Vector3(newsection.railpoint[2].x,newsection.railpoint[0].y,newsection.railpoint[2].z)
] );
}
closedSpline.type = 'catmullrom';
// closedSpline.type = 'catmullrom';
closedSpline.curveType = "chordal";
closedSpline.tension = 0.15;
closedSpline.closed = false; closedSpline.closed = false;
var extrudeSettings = { var extrudeSettings = {
steps : 5, steps : 6,
curveSegments : 1, curveSegments : 1,
bevelSegments : 1, bevelSegments : 1,
bevelEnabled : false, bevelEnabled : false,
@ -117,7 +131,9 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){
var shape = new THREE.Shape(); var shape = new THREE.Shape();
len = closedSpline.getLength(); len = closedSpline.getLength();
if(newsection.railpoint[0].y != newsection.railpoint[2].y){
if(Math.abs(newsection.railpoint[0].y - newsection.railpoint[2].y)>0.001){
shape.moveTo( -2, 0 ); shape.moveTo( -2, 0 );
shape.lineTo( 2, 0 ); shape.lineTo( 2, 0 );
}else{ }else{
@ -133,16 +149,16 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){
if(i%2 != 0){ if(i%2 != 0){
mesh.geometry.attributes.uv.array[ui] = 0; mesh.geometry.attributes.uv.array[ui] = 0;
mesh.geometry.attributes.uv.array[ui+1] = 1; mesh.geometry.attributes.uv.array[ui+1] = 1;
mesh.geometry.attributes.uv.array[ui+2] = len/5; mesh.geometry.attributes.uv.array[ui+2] = len/6;
mesh.geometry.attributes.uv.array[ui+3] = 1; mesh.geometry.attributes.uv.array[ui+3] = 1;
mesh.geometry.attributes.uv.array[ui+4] = len/5; mesh.geometry.attributes.uv.array[ui+4] = len/6;
mesh.geometry.attributes.uv.array[ui+5] = 0; mesh.geometry.attributes.uv.array[ui+5] = 0;
}else{ }else{
mesh.geometry.attributes.uv.array[ui] = 0; mesh.geometry.attributes.uv.array[ui] = 0;
mesh.geometry.attributes.uv.array[ui+1] = 0; mesh.geometry.attributes.uv.array[ui+1] = 0;
mesh.geometry.attributes.uv.array[ui+2] = 0; mesh.geometry.attributes.uv.array[ui+2] = 0;
mesh.geometry.attributes.uv.array[ui+3] = 1; mesh.geometry.attributes.uv.array[ui+3] = 1;
mesh.geometry.attributes.uv.array[ui+4] = len/5; mesh.geometry.attributes.uv.array[ui+4] = len/6;
mesh.geometry.attributes.uv.array[ui+5] = 0; mesh.geometry.attributes.uv.array[ui+5] = 0;
} }
} }
@ -158,7 +174,9 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){
new THREE.Vector3(newsection.railpoint[1].x,height,newsection.railpoint[0].z), new THREE.Vector3(newsection.railpoint[1].x,height,newsection.railpoint[0].z),
] ); ] );
closedSpline.type = 'catmullrom'; // closedSpline.type = 'catmullrom';
closedSpline.curveType = "chordal";
closedSpline.tension = 0.15;
closedSpline.closed = false; closedSpline.closed = false;
// Set up settings for later extrusion // Set up settings for later extrusion
var extrudeSettings = { var extrudeSettings = {

View File

@ -401,7 +401,7 @@ export function StationStandListN() {
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
var stationcanvas = new Image(); var stationcanvas = new Image();
stationcanvas.src = "../../static/texture/msgtnew.png"; stationcanvas.src = "/cbtc/static/texture/msgtnew.png";
function getTextCanvas(text){ function getTextCanvas(text){
let canvas = document.getElementById('canvastexture'); let canvas = document.getElementById('canvastexture');

View File

@ -77,11 +77,11 @@ export function TrainListN() {
// //
// fclip = new THREE.AnimationClip("four",2,ntracks2); // fclip = new THREE.AnimationClip("four",2,ntracks2);
ntracks2 = assetloader.modellist[n].animations.slice(6,13); ntracks2 = assetloader.modellist[n].animations.slice(6,14);
fclip = new THREE.AnimationClip("four",2,ntracks2); fclip = new THREE.AnimationClip("four",2,ntracks2);
ntracks1 = assetloader.modellist[n].animations.slice(0,5); ntracks1 = assetloader.modellist[n].animations.slice(0,6);
tclip = new THREE.AnimationClip("three",2,ntracks1); tclip = new THREE.AnimationClip("three",2,ntracks1);
@ -218,11 +218,11 @@ export function TrainListN() {
// //
// fclip = new THREE.AnimationClip("four",2,ntracks2); // fclip = new THREE.AnimationClip("four",2,ntracks2);
ntracks2 = assetloader.modellist[n].animations.slice(6,13); ntracks2 = assetloader.modellist[n].animations.slice(6,14);
fclip = new THREE.AnimationClip("four",2,ntracks2); fclip = new THREE.AnimationClip("four",2,ntracks2);
ntracks1 = assetloader.modellist[n].animations.slice(0,5); ntracks1 = assetloader.modellist[n].animations.slice(0,6);
tclip = new THREE.AnimationClip("three",2,ntracks1); tclip = new THREE.AnimationClip("three",2,ntracks1);
n = 0; n = 0;
@ -281,33 +281,33 @@ export function TrainListN() {
} }
}else{ }else{
for(let n=0,lenn = newmesh.children[j].children.length;n<lenn;n++){ for(let n=0,lenn = newmesh.children[j].children.length;n<lenn;n++){
if(newmesh.children[j].children[n].name == "top"){ if(newmesh.children[j].children[n].name == "top"){
newmesh.children[j].children[n].animations = []; newmesh.children[j].children[n].animations = [];
newmesh.children[j].children[n].animations.push(fclip.clone()); newmesh.children[j].children[n].animations.push(fclip.clone());
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] ); let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
newmesh.mixer.push(mixer); newmesh.mixer.push(mixer);
newmesh.mixerpush = false; newmesh.mixerpush = false;
// mixers.push(mixer); // mixers.push(mixer);
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] ); let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
//action.play(); //action.play();
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
actionss[data[i].groupNumber].top.push(action); actionss[data[i].groupNumber].top.push(action);
} }
if(newmesh.children[j].children[n].name == "down"){ if(newmesh.children[j].children[n].name == "down"){
newmesh.children[j].children[n].animations = []; newmesh.children[j].children[n].animations = [];
newmesh.children[j].children[n].animations.push(fclip.clone()); newmesh.children[j].children[n].animations.push(fclip.clone());
let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] ); let mixer = new THREE.AnimationMixer( newmesh.children[j].children[n] );
newmesh.mixer.push(mixer); newmesh.mixer.push(mixer);
newmesh.mixerpush = false; newmesh.mixerpush = false;
// mixers.push(mixer); // mixers.push(mixer);
let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] ); let action = mixer.clipAction( newmesh.children[j].children[n].animations[ 0 ] );
//action.play(); //action.play();
action.setLoop(THREE.LoopOnce); action.setLoop(THREE.LoopOnce);
action.clampWhenFinished = true; action.clampWhenFinished = true;
actionss[data[i].groupNumber].down.push(action); actionss[data[i].groupNumber].down.push(action);
} }
} }
} }
//newmesh.children[j].name = data[i].code; //newmesh.children[j].name = data[i].code;
@ -415,7 +415,7 @@ let onProgress = function ( xhr ) {
let onError = function () { }; let onError = function () { };
var beauty = new Image(); var beauty = new Image();
beauty.src = "../../static/texture/guidenew.png"; beauty.src = "/cbtc/static/texture/guidenew.png";
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text){ function getTextCanvas(text){

View File

@ -13,19 +13,21 @@ class KeyboardController extends Eventful {
initHandler(zr) { initHandler(zr) {
if (zr) { if (zr) {
var keydownHandle = this.keydown.bind(this); var keydownHandle = this.keydown.bind(this);
var keyupHandle = this.keyup.bind(this); var keyupHandle = this.keyup.bind(this);
var dom = this.$zr.dom;
this.enable = function (opts) { this.enable = function (opts) {
opts = opts || {}; opts = opts || {};
this._keyOnDownUp = opts.keyOnDownUp || true; this._keyOnDownUp = opts.keyOnDownUp || true;
window.addEventListener('keydown', keydownHandle, false); dom.addEventListener('keydown', keydownHandle, false);
window.addEventListener('keyup', keyupHandle, false); dom.addEventListener('keyup', keyupHandle, false);
dom.focus();
}; };
this.disable = function () { this.disable = function () {
window.removeEventListener('keydown', keydownHandle, false); dom.removeEventListener('keydown', keydownHandle, false);
window.removeEventListener('keyup', keyupHandle, false); dom.removeEventListener('keyup', keyupHandle, false);
}; };
this.dispose = function() { this.dispose = function() {

View File

@ -44,7 +44,7 @@ class Jlmap {
this.zoomOnMouseWheel = opts.options.zoomOnMouseWheel; this.zoomOnMouseWheel = opts.options.zoomOnMouseWheel;
this.$zr = zrender.init(opts.dom, deepAssign({ renderer, devicePixelRatio, width, height }, opts.config)); this.$zr = zrender.init(opts.dom, deepAssign({ renderer, devicePixelRatio, width, height }, opts.config));
this.$zr.dom.setAttribute('tabIndex', -1);
this.$options = new Options(deepAssign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放 this.$options = new Options(deepAssign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放
this.$painter = new Painter(this); this.$painter = new Painter(this);
this.$painter.updateZrSize({width: this.$zr.getWidth(), height: this.$zr.getHeight()}); this.$painter.updateZrSize({width: this.$zr.getWidth(), height: this.$zr.getHeight()});

View File

@ -84,7 +84,9 @@ class MouseController extends Eventful {
mousedown(e) { mousedown(e) {
// if (eventTool.notLeftMouse(e)) { // if (eventTool.notLeftMouse(e)) {
// return; // return;
// } // }
this.$zr.dom.focus();
if (e.which == 1 || e.which == 3) { if (e.which == 1 || e.which == 3) {
var x = e.offsetX; var x = e.offsetX;
var y = e.offsetY; var y = e.offsetY;

View File

@ -756,6 +756,7 @@ class SkinCode extends defaultStyle {
} }
}; };
this[deviceType.FloodGate] = {}; this[deviceType.FloodGate] = {};
this[deviceType.DirectionRod] = {};
} }
} }

View File

@ -683,6 +683,7 @@ class SkinCode extends defaultStyle {
} }
}; };
this[deviceType.FloodGate] = {}; this[deviceType.FloodGate] = {};
this[deviceType.DirectionRod] = {};
} }
} }

View File

@ -872,6 +872,7 @@ class SkinCode extends defaultStyle {
} }
}; };
this[deviceType.FloodGate] = {}; this[deviceType.FloodGate] = {};
this[deviceType.DirectionRod] = {};
} }
} }

View File

@ -710,6 +710,7 @@ class SkinCode extends defaultStyle {
} }
}; };
this[deviceType.FloodGate] = {}; this[deviceType.FloodGate] = {};
this[deviceType.DirectionRod] = {};
} }
} }

View File

@ -718,6 +718,7 @@ class SkinCode extends defaultStyle {
} }
}; };
this[deviceType.FloodGate] = {}; this[deviceType.FloodGate] = {};
this[deviceType.DirectionRod] = {};
} }
} }

View File

@ -249,7 +249,7 @@ class SkinCode extends defaultStyle {
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色 andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色 detainTrainTextColor: '#E4EF50', // 车站扣除文字颜色
fontSize: 18, // 字体大小 fontSize: 18, // 字体大小
fontWeight: 'bold', fontWeight: 'bolder',
textVerticalAlign: 'middle' // 车站扣车 文字垂直对齐方式 textVerticalAlign: 'middle' // 车站扣车 文字垂直对齐方式
}, },
// 运行等级 // 运行等级
@ -781,6 +781,18 @@ class SkinCode extends defaultStyle {
} }
}; };
this[deviceType.FloodGate] = {}; this[deviceType.FloodGate] = {};
this[deviceType.DirectionRod] = {
displayCondition: '01', // 显示条件 01所有模式下显示 02 行调显示 03现地显示
fillColor: '#0F0',
fontColor: '#FFF',
rodLength: 90,
rodHeight: 10,
triangleLength: 25,
triangleHeight: 20,
fontSize: 14,
fontOffsetX: 45,
fontOffsetY: 24
};
} }
} }

View File

@ -775,6 +775,7 @@ class SkinCode extends defaultStyle {
} }
}; };
this[deviceType.FloodGate] = {}; this[deviceType.FloodGate] = {};
this[deviceType.DirectionRod] = {};
} }
} }

View File

@ -845,6 +845,7 @@ class SkinCode extends defaultStyle {
allowCloseFillColor: '#FF0000', // 允许关门填充颜色 allowCloseFillColor: '#FF0000', // 允许关门填充颜色
allowCLoseStrokeColor: '#FFFF00' // 允许关门描边颜色 allowCLoseStrokeColor: '#FFFF00' // 允许关门描边颜色
}; };
this[deviceType.DirectionRod] = {};
} }
} }

View File

@ -783,6 +783,7 @@ class SkinCode extends defaultStyle {
} }
}; };
this[deviceType.FloodGate] = {}; this[deviceType.FloodGate] = {};
this[deviceType.DirectionRod] = {};
} }
} }

View File

@ -866,6 +866,7 @@ class SkinCode extends defaultStyle {
} }
}; };
this[deviceType.FloodGate] = {}; this[deviceType.FloodGate] = {};
this[deviceType.DirectionRod] = {};
} }
} }

View File

@ -260,8 +260,14 @@ deviceRender[deviceType.OverAp] = {
_type: deviceType.OverAp, _type: deviceType.OverAp,
zlevel: 1 zlevel: 1
}; };
/** 防淹门 */
deviceRender[deviceType.FloodGate] = { deviceRender[deviceType.FloodGate] = {
_type: deviceType.FloodGate, _type: deviceType.FloodGate,
zlevel: 1 zlevel: 1
}; };
/** 方向杆 */
deviceRender[deviceType.DirectionRod] = {
_type: deviceType.DirectionRod,
zlevel: 1
};
export default deviceRender; export default deviceRender;

View File

@ -140,6 +140,9 @@ deviceState[deviceType.StationStand] = {
deviceState[deviceType.FloodGate] = { deviceState[deviceType.FloodGate] = {
/** 防淹门状态 */ /** 防淹门状态 */
}; };
deviceState[deviceType.DirectionRod] = {
/** 方向杆状态 */
};
deviceState[deviceType.Train] = { deviceState[deviceType.Train] = {
// /** 列车类型*/ // /** 列车类型*/
// type: { // type: {

View File

@ -46,7 +46,8 @@ const deviceType = {
Power: 'Power', Power: 'Power',
StationTurnBack: 'StationTurnBack', StationTurnBack: 'StationTurnBack',
OverAp: 'OverAp', OverAp: 'OverAp',
FloodGate: 'FloodGate' FloodGate: 'FloodGate',
DirectionRod: 'DirectionRod'
}; };
export default deviceType; export default deviceType;

View File

@ -124,6 +124,9 @@ class Status {
handleFloodGate(device) { handleFloodGate(device) {
this.statusObj = { }; this.statusObj = { };
} }
handleDirectionRod(device) {
this.statusObj = { };
}
getStatus() { getStatus() {
return this.statusObj; return this.statusObj;
} }

View File

@ -14,12 +14,14 @@ class KeyboardController extends Eventful {
initHandler(zr) { initHandler(zr) {
if (zr) { if (zr) {
var keydownHandle = this.keydown.bind(this); var keydownHandle = this.keydown.bind(this);
// var dom = this.$zr.dom;
this.enable = function (opts) { this.enable = function (opts) {
opts = opts || {}; opts = opts || {};
this._keyOnDownUp = opts.keyOnDownUp || true; this._keyOnDownUp = opts.keyOnDownUp || true;
window.addEventListener('keyup', keydownHandle, false); window.addEventListener('keyup', keydownHandle, false);
// dom.focus();
}; };
this.disable = function () { this.disable = function () {

Some files were not shown because too many files have changed in this diff Show More