调整成都三显示

This commit is contained in:
fan 2020-03-13 15:06:14 +08:00
parent 6c52c3b56f
commit 264310f28e
7 changed files with 243 additions and 244 deletions

View File

@ -133,9 +133,9 @@ class SkinCode extends defaultStyle {
endColor: '#FFFFFF', // 尽头分隔符颜色
color: '#FFFFFF' // 区段边界符颜色
},
shuttleBack: { // 折返进路 (存在此对象 显示折返箭头)
distance: 5 // 限速线距离区段距离
},
// shuttleBack: { // 折返进路 (存在此对象 显示折返箭头)
// distance: 5 // 限速线距离区段距离
// },
block: {
special: false // 区段特殊显示
},

View File

@ -2,41 +2,41 @@ import Path from 'zrender/src/graphic/Path';
// 成都三号线 折返进路
export const EBackArrow = Path.extend({
type: 'EBackArrow',
shape: {
points: null
},
buildPath: function (ctx, shape) {
const points = shape.points;
var r = shape.height;
var x = points.x + shape.drict * shape.width / 2;
var y = points.y;
ctx.moveTo(points.x - shape.drict * shape.width, points.y + shape.height);
ctx.lineTo(points.x + shape.drict * shape.width / 2, points.y + shape.height);
if (shape.drict) {
ctx.arc(x, y, r, Math.PI / 2, Math.PI * 3 / 2, true);
} else {
ctx.arc(x, y, r, Math.PI / 2, Math.PI * 3 / 2, false);
}
ctx.moveTo(points.x + shape.drict * shape.width / 2, points.y - shape.height);
ctx.lineTo(points.x - shape.drict * (shape.width - 5), points.y - shape.height);
}
type: 'EBackArrow',
shape: {
points: null
},
buildPath: function (ctx, shape) {
const points = shape.points;
var r = shape.height;
var x = points.x + shape.drict * shape.width / 2;
var y = points.y;
ctx.moveTo(points.x - shape.drict * shape.width, points.y + shape.height);
ctx.lineTo(points.x + shape.drict * shape.width / 2, points.y + shape.height);
if (shape.drict) {
ctx.arc(x, y, r, Math.PI / 2, Math.PI * 3 / 2, true);
} else {
ctx.arc(x, y, r, Math.PI / 2, Math.PI * 3 / 2, false);
}
ctx.moveTo(points.x + shape.drict * shape.width / 2, points.y - shape.height);
ctx.lineTo(points.x - shape.drict * (shape.width - 5), points.y - shape.height);
}
});
// 箭头
export const EBackArrowTriangle = Path.extend({
type: 'EBackArrowTriangle',
shape: {
points: null
},
buildPath: function (ctx, shape) {
const points = shape.points;
ctx.moveTo(points.x - shape.drict * (shape.width - 5), points.y - shape.height - 3);
if (shape.drict) {
ctx.lineTo(points.x - shape.drict * shape.width, points.y - shape.height);
} else {
ctx.lineTo(points.x - shape.drict * shape.width, points.y - shape.height);
}
ctx.lineTo(points.x - shape.drict * (shape.width - 5), points.y - shape.height + 3);
}
type: 'EBackArrowTriangle',
shape: {
points: null
},
buildPath: function (ctx, shape) {
const points = shape.points;
ctx.moveTo(points.x - shape.drict * (shape.width - 5), points.y - shape.height - 3);
if (shape.drict) {
ctx.lineTo(points.x - shape.drict * shape.width, points.y - shape.height);
} else {
ctx.lineTo(points.x - shape.drict * shape.width, points.y - shape.height);
}
ctx.lineTo(points.x - shape.drict * (shape.width - 5), points.y - shape.height + 3);
}
});

View File

@ -77,141 +77,141 @@ import Vue from 'vue';
// });
export default class ELimitLines extends Group {
constructor(model) {
super();
this.model = model;
this.zlevel = model.zlevel;
this.z = model.z;
this.create(model);
}
constructor(model) {
super();
this.model = model;
this.zlevel = model.zlevel;
this.z = model.z;
this.create(model);
}
create(model) {
/** 创建区段*/
if (model && model.points.length > 1) {
if (model.isCurve) {
const shape = {};
for (let i = 1; i < (model.points.length - 1); i++) {
shape[`cpx${i}`] = model.points[i].x;
shape[`cpy${i}`] = model.points[i].y;
}
create(model) {
/** 创建区段*/
if (model && model.points.length > 1) {
if (model.isCurve) {
const shape = {};
for (let i = 1; i < (model.points.length - 1); i++) {
shape[`cpx${i}`] = model.points[i].x;
shape[`cpy${i}`] = model.points[i].y;
}
shape[`x1`] = model.points[0].x;
shape[`y1`] = model.points[0].y;
shape[`x2`] = model.points[model.points.length - 1].x;
shape[`y2`] = model.points[model.points.length - 1].y;
shape[`x1`] = model.points[0].x;
shape[`y1`] = model.points[0].y;
shape[`x2`] = model.points[model.points.length - 1].x;
shape[`y2`] = model.points[model.points.length - 1].y;
this.add(new BezierCurve({
isLine: true,
zlevel: this.zlevel,
progressive: model.progressive,
z: this.z,
culling: true,
shape: shape,
position: model.position,
style: {
lineWidth: model.style.Section.speedLimit.width,
stroke: model.style.Section.speedLimit.lineColor,
fillOpacity: 0
}
}));
} else {
const swPadding = model.style.Switch.core.length; // 定位和反位时区段距离岔芯的距离
var switchWidth = model.style.Section.line.width + model.style.Section.line.beyondWidth; // 道岔宽度
const beg = Object.assign({}, model.points[0]);
const end = Object.assign({}, model.points[model.points.length - 1]);
if (model.isSwitchSection && beg.y !== end.y) {
const swch = Vue.prototype.$jlmap.mapDevice[model.switch.code]; // 获取道岔model 及状态数据
this.add(new BezierCurve({
isLine: true,
zlevel: this.zlevel,
progressive: model.progressive,
z: this.z,
culling: true,
shape: shape,
position: model.position,
style: {
lineWidth: model.style.Section.speedLimit.width,
stroke: model.style.Section.speedLimit.lineColor,
fillOpacity: 0
}
}));
} else {
const swPadding = model.style.Switch.core.length; // 定位和反位时区段距离岔芯的距离
var switchWidth = model.style.Section.line.width + model.style.Section.line.beyondWidth; // 道岔宽度
const beg = Object.assign({}, model.points[0]);
const end = Object.assign({}, model.points[model.points.length - 1]);
if (model.isSwitchSection && beg.y !== end.y) {
const swch = Vue.prototype.$jlmap.mapDevice[model.switch.code]; // 获取道岔model 及状态数据
if (swch && swch.instance) {
const traingle = new JTriangle(swch.intersection, swch.skew);
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && !swch.normalPosition && swch.sectionCCode == model.code) {
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
}
if (swch && swch.instance) {
const traingle = new JTriangle(swch.intersection, swch.skew);
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && !swch.normalPosition && swch.sectionCCode == model.code) {
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
}
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.normalPosition && swch.sectionCCode == model.code) {
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
}
}
}
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.normalPosition && swch.sectionCCode == model.code) {
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
}
}
}
if (model.points.length == 2) {
this.add(new Line({
isLine: true,
zlevel: this.zlevel,
progressive: model.progressive,
z: this.z,
position: model.position,
shape: {
x1: beg.x,
y1: beg.y,
x2: end.x,
y2: end.y
},
style: {
lineWidth: model.style.Section.speedLimit.width,
stroke: model.style.Section.speedLimit.lineColor
}
}));
} else {
this.add(new Line({
isLine: true,
zlevel: this.zlevel,
progressive: model.progressive,
z: this.z,
position: model.position,
shape: {
x1: beg.x,
y1: beg.y,
x2: model.points[1].x,
y2: model.points[1].y
},
style: {
lineWidth: model.style.Section.speedLimit.width,
stroke: model.style.Section.speedLimit.lineColor
}
}));
if (model.points.length == 2) {
this.add(new Line({
isLine: true,
zlevel: this.zlevel,
progressive: model.progressive,
z: this.z,
position: model.position,
shape: {
x1: beg.x,
y1: beg.y,
x2: end.x,
y2: end.y
},
style: {
lineWidth: model.style.Section.speedLimit.width,
stroke: model.style.Section.speedLimit.lineColor
}
}));
} else {
this.add(new Line({
isLine: true,
zlevel: this.zlevel,
progressive: model.progressive,
z: this.z,
position: model.position,
shape: {
x1: beg.x,
y1: beg.y,
x2: model.points[1].x,
y2: model.points[1].y
},
style: {
lineWidth: model.style.Section.speedLimit.width,
stroke: model.style.Section.speedLimit.lineColor
}
}));
for (let i = 1; i < (model.points.length - 2); i++) {
this.add(new Line({
isLine: true,
zlevel: this.zlevel,
z: this.z,
progressive: model.progressive,
position: model.position,
shape: {
x1: model.points[i].x,
y1: model.points[i].y,
x2: model.points[i + 1].x,
y2: model.points[i + 1].y
},
style: {
lineWidth: model.style.Section.speedLimit.width,
stroke: model.style.Section.speedLimit.lineColor
}
}));
}
for (let i = 1; i < (model.points.length - 2); i++) {
this.add(new Line({
isLine: true,
zlevel: this.zlevel,
z: this.z,
progressive: model.progressive,
position: model.position,
shape: {
x1: model.points[i].x,
y1: model.points[i].y,
x2: model.points[i + 1].x,
y2: model.points[i + 1].y
},
style: {
lineWidth: model.style.Section.speedLimit.width,
stroke: model.style.Section.speedLimit.lineColor
}
}));
}
this.add(new Line({
isLine: true,
zlevel: this.zlevel,
z: this.z,
position: model.position,
progressive: model.progressive,
shape: {
x1: model.points[model.points.length - 2].x,
y1: model.points[model.points.length - 2].y,
x2: end.x,
y2: end.y
},
style: {
lineWidth: model.style.Section.speedLimit.width,
stroke: model.style.Section.speedLimit.lineColor
}
}));
}
}
}
}
this.add(new Line({
isLine: true,
zlevel: this.zlevel,
z: this.z,
position: model.position,
progressive: model.progressive,
shape: {
x1: model.points[model.points.length - 2].x,
y1: model.points[model.points.length - 2].y,
x2: end.x,
y2: end.y
},
style: {
lineWidth: model.style.Section.speedLimit.width,
stroke: model.style.Section.speedLimit.lineColor
}
}));
}
}
}
}
}

View File

@ -3,70 +3,70 @@ import Line from 'zrender/src/graphic/shape/Line';
/** 延时释放*/
export default class ERelease extends Group {
constructor(model) {
super();
this.model = model;
this.isNew = false;
constructor(model) {
super();
this.model = model;
this.isNew = false;
}
}
create() {
if (!this.isNew) {
const model = this.model;
create() {
if (!this.isNew) {
const model = this.model;
this.isNew = true;
this.lines = new Line({
zlevel: model.zlevel,
z: model.z,
shape: model.shape,
progressive: model.progressive,
style: {
lineWidth: model.lineWidth,
stroke: model.stroke
}
});
this.add(this.lines);
}
}
this.isNew = true;
this.lines = new Line({
zlevel: model.zlevel,
z: model.z,
shape: model.shape,
progressive: model.progressive,
style: {
lineWidth: model.lineWidth,
stroke: model.stroke
}
});
this.add(this.lines);
}
}
setStyle(model) {
this.create();
this.lines.setStyle(model);
}
setStyle(model) {
this.create();
this.lines.setStyle(model);
}
hide() {
this.create();
this.lines.hide();
}
hide() {
this.create();
this.lines.hide();
}
show() {
this.create();
this.lines.show();
}
show() {
this.create();
this.lines.show();
}
// 开始动画
animateStyle(loop, animates) {
this.create();
if (animates && animates.length) {
this.eachChild((child) => {
if (child.animateStyle) {
let an = child.animateStyle(loop);
animates.forEach(elem => {
an = an.when(elem.time, elem.styles);
});
an.start();
}
});
}
}
// 开始动画
animateStyle(loop, animates) {
this.create();
if (animates && animates.length) {
this.eachChild((child) => {
if (child.animateStyle) {
let an = child.animateStyle(loop);
animates.forEach(elem => {
an = an.when(elem.time, elem.styles);
});
an.start();
}
});
}
}
// 结束动画
stopAnimation(flag) {
this.create();
this.eachChild((child) => {
if (child.stopAnimation) {
child.stopAnimation(flag);
}
});
}
// 结束动画
stopAnimation(flag) {
this.create();
this.eachChild((child) => {
if (child.stopAnimation) {
child.stopAnimation(flag);
}
});
}
}

View File

@ -49,8 +49,8 @@ export default class ELines extends Group {
this.add(this.section);
} else {
if (model.points.length == 2) {
const spaceX= (model.points[1].x - model.points[0].x) / 3;
const spaceY= (model.points[1].y - model.points[0].y) / 3;
const spaceX = (model.points[1].x - model.points[0].x) / 3;
const spaceY = (model.points[1].y - model.points[0].y) / 3;
this.sectionM = new Line({
isLine: true,
zlevel: this.zlevel,
@ -130,8 +130,7 @@ export default class ELines extends Group {
(isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),
(isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)
];
}
else {
} else {
return [
(isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),
(isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)
@ -141,7 +140,7 @@ export default class ELines extends Group {
// 重新计算居中距离点
couvert(shape) {
let out = [];
const out = [];
var x1 = shape.x1;
var y1 = shape.y1;
var x2 = shape.x2;
@ -172,16 +171,16 @@ export default class ELines extends Group {
var p = this.someVectorAt(shape, 0.5, true);
var v = vec2.normalize(p, p);
var x0 = Math.sqrt((Math.pow(cpx1-x1, 2)+Math.pow(x2-cpx2, 2))/2, 2);
var y0 = Math.sqrt((Math.pow(cpy1-y1, 2)+Math.pow(y2-cpy2, 2))/2, 2);
var x0 = Math.sqrt((Math.pow(cpx1 - x1, 2) + Math.pow(x2 - cpx2, 2)) / 2, 2);
var y0 = Math.sqrt((Math.pow(cpy1 - y1, 2) + Math.pow(y2 - cpy2, 2)) / 2, 2);
return {
x1: n_x1,
y1: n_y1,
x2: n_x2,
y2: n_y2,
cpx1: (cpx1+cpx2)/2 + v[1]*x0*0.128,
cpy1: (cpy1+cpy2)/2 + v[0]*y0*0.128
cpx1: (cpx1 + cpx2) / 2 + v[1] * x0 * 0.128,
cpy1: (cpy1 + cpy2) / 2 + v[0] * y0 * 0.128
};
}
}

View File

@ -76,12 +76,12 @@
<button :id="MixinCommand.functionButton.button.domId" class="button_box" :style="{width: width+'px', backgroundColor:buttonUpColor}" @click="buttonDown(MixinCommand.functionButton.button.operation, 'MixinCommand')">
<span style="color: black">
<center>
<b style="color:deepskyblue"></b>
<b style="color:burlywood"></b>
<b style="color:#4B4B99"></b>
<b style="color:#943E3E"></b>
</center>
<center>
<b style="color: red"></b>
<b style="color:forestgreen"></b>
<b style="color:#E64BE6"></b>
<b style="color:#4C994C"></b>
</center>
</span>
</button>

View File

@ -3,9 +3,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';