desc: 修改代码
This commit is contained in:
parent
dd32206ef0
commit
9c743e8bee
@ -1,8 +1,5 @@
|
||||
export default class DefaultSkin {
|
||||
constructor() {
|
||||
// 道岔字体颜色
|
||||
this.switchTextColor = 'lightgreen';
|
||||
|
||||
/** 默认背景 颜色*/
|
||||
this.backgroundColor = '#000000';
|
||||
|
||||
|
@ -21,6 +21,7 @@ export default class EAxle extends Group {
|
||||
this.line = new Line({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: model.progressive,
|
||||
shape: {
|
||||
x1: positionx - model.traingle.getCos(axleLength) - model.dricty * model.traingle.getSin(axleLength),
|
||||
y1: positiony + model.drictx * model.traingle.getSin(axleLength) - model.traingle.getSin(axleLength),
|
||||
@ -35,6 +36,7 @@ export default class EAxle extends Group {
|
||||
this.axle = new Circle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: model.progressive,
|
||||
shape: {
|
||||
cx: positionx - model.dricty * model.traingle.getSin(axleLength),
|
||||
cy: positiony + model.drictx * model.traingle.getSin(axleLength),
|
||||
|
@ -30,6 +30,7 @@ export default class ELimitLines extends Group {
|
||||
this.add(new BezierCurve({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
culling: true,
|
||||
shape: shape,
|
||||
@ -48,6 +49,7 @@ export default class ELimitLines extends Group {
|
||||
this.add(new Line({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
position: model.position,
|
||||
shape: {
|
||||
@ -65,6 +67,7 @@ export default class ELimitLines extends Group {
|
||||
this.add(new Line({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
position: model.position,
|
||||
shape: {
|
||||
@ -84,6 +87,7 @@ export default class ELimitLines extends Group {
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: model.progressive,
|
||||
position: model.position,
|
||||
shape: {
|
||||
x1: model.points[i].x,
|
||||
@ -103,6 +107,7 @@ export default class ELimitLines extends Group {
|
||||
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,
|
||||
|
@ -30,6 +30,7 @@ export default class ELines extends Group {
|
||||
this.add(new BezierCurve({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z + 1,
|
||||
culling: true,
|
||||
shape: shape,
|
||||
@ -44,6 +45,7 @@ export default class ELines extends Group {
|
||||
this.add(new Line({
|
||||
isLine: true,
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
shape: {
|
||||
x1: model.points[i].x,
|
||||
|
@ -17,6 +17,7 @@ export default class ERelease extends Group {
|
||||
zlevel: model.zlevel,
|
||||
z: this.z,
|
||||
shape: model.shape,
|
||||
progressive: model.progressive,
|
||||
style: {
|
||||
lineWidth: model.lineWidth,
|
||||
stroke: model.stroke
|
||||
|
@ -16,6 +16,7 @@ export default class ESeparator extends Group {
|
||||
_create(model) {
|
||||
this.partition = new Polyline({
|
||||
zlevel: this.zlevel,
|
||||
progressive: model.progressive,
|
||||
z: this.z,
|
||||
shape: {
|
||||
points: []
|
||||
@ -29,6 +30,7 @@ export default class ESeparator extends Group {
|
||||
this.circle = new Circle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: model.progressive,
|
||||
shape: {
|
||||
cx: model.point.x,
|
||||
cy: model.point.y,
|
||||
|
@ -49,6 +49,7 @@ export default class Section extends Group {
|
||||
this.section = new ELines({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: 1,
|
||||
isSwitchSection: model.isSwitchSection,
|
||||
isCurve: model.isCurve,
|
||||
points: model.points,
|
||||
@ -60,6 +61,7 @@ export default class Section extends Group {
|
||||
|
||||
this.release = new ERelease({
|
||||
zlevel: model.zlevel,
|
||||
progressive: 6,
|
||||
z: this.z,
|
||||
shape: {
|
||||
x1: model.points[0].x + traingle.getCos(traingle.absz / 3),
|
||||
@ -80,6 +82,7 @@ export default class Section extends Group {
|
||||
this.speedLimitLeft = new ELimitLines({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: 5,
|
||||
position: [x, -y],
|
||||
isCurve: model.isCurve,
|
||||
points: model.points,
|
||||
@ -91,6 +94,7 @@ export default class Section extends Group {
|
||||
this.speedLimitRight = new ELimitLines({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
progressive: 5,
|
||||
position: [-x, y],
|
||||
isCurve: model.isCurve,
|
||||
points: model.points,
|
||||
@ -264,6 +268,7 @@ export default class Section extends Group {
|
||||
traingle = new JTriangle(model.points[0], model.points[1]);
|
||||
this.lUpAxle = new EAxle({
|
||||
style: style,
|
||||
progressive: 4,
|
||||
zlevel: this.zlevel,
|
||||
point: {
|
||||
x: model.points[0].x,
|
||||
@ -275,6 +280,7 @@ export default class Section extends Group {
|
||||
});
|
||||
this.lBottomAxle = new EAxle({
|
||||
style: style,
|
||||
progressive: 4,
|
||||
zlevel: this.zlevel,
|
||||
point: {
|
||||
x: model.points[0].x,
|
||||
@ -288,6 +294,7 @@ export default class Section extends Group {
|
||||
traingle = new JTriangle(model.points[model.points.length - 2], model.points[model.points.length - 1]);
|
||||
this.rUpAxle = new EAxle({
|
||||
style: style,
|
||||
progressive: 4,
|
||||
zlevel: this.zlevel,
|
||||
point: {
|
||||
x: model.points[model.points.length - 1].x,
|
||||
@ -299,6 +306,7 @@ export default class Section extends Group {
|
||||
});
|
||||
this.rBottomAxle = new EAxle({
|
||||
style: style,
|
||||
progressive: 4,
|
||||
zlevel: this.zlevel,
|
||||
point: {
|
||||
x: model.points[model.points.length - 1].x,
|
||||
@ -327,6 +335,7 @@ export default class Section extends Group {
|
||||
traingle = new JTriangle(model.points[0], model.points[1]);
|
||||
this.lPartition = new ESeparator({
|
||||
style: style,
|
||||
progressive: 2,
|
||||
zlevel: this.zlevel,
|
||||
traingle: traingle,
|
||||
point: {
|
||||
@ -341,6 +350,7 @@ export default class Section extends Group {
|
||||
traingle = new JTriangle(model.points[model.points.length - 2], model.points[model.points.length - 1]);
|
||||
this.rPartition = new ESeparator({
|
||||
style: style,
|
||||
progressive: 2,
|
||||
zlevel: this.zlevel,
|
||||
traingle: traingle,
|
||||
point: {
|
||||
|
@ -1,41 +1,44 @@
|
||||
import defaultSkin from '../config/defaultSkin';
|
||||
import deviceType from '../constant/deviceType';
|
||||
|
||||
class Fuzhou extends defaultSkin {
|
||||
class Batong extends defaultSkin {
|
||||
constructor() {
|
||||
super();
|
||||
this.Link = {
|
||||
textFontColor: ''
|
||||
};
|
||||
this[deviceType.Section] = {
|
||||
sectionTextPosition: 0, // 区段名称位置 1 上行 -1 下面 0 默认
|
||||
/** 区段 宽度*/
|
||||
sectionWidth: 5,
|
||||
/** 区段宽超出宽度*/
|
||||
sectionBeyondWidth: 1,
|
||||
/** 计轴 半径*/
|
||||
sectionAxleR: 3,
|
||||
/** 计轴和区段之间的距离*/ /** 需要添加*/
|
||||
/** 计轴和区段之间的距离*/
|
||||
sectionAxleDistance: 5,
|
||||
/** 限速线的宽短*/
|
||||
/** 限速线的宽度*/
|
||||
sectionSpeedLimitLinewidth: 1,
|
||||
/** 限速线距离区段距离*/
|
||||
sectionSpeedLimitDistance: 5,
|
||||
sectionSeparatorWidth: 1.2, // 分隔符宽度
|
||||
sectionEndSeparatorWidth: 3.5, // 尽头分隔符宽度
|
||||
sectionEndSeparatorStroke: '#3F3F3F', // 尽头分隔符颜色
|
||||
/** 分隔符宽度*/
|
||||
sectionSeparatorWidth: 1.2,
|
||||
sectionEndSeparatorWidth: 1.2, // 尽头分隔符宽度
|
||||
sectionEndSeparatorStroke: '#7F7F7F', // 尽头分隔符颜色
|
||||
/** 区段侵入颜色*/
|
||||
sectionInvadeColor: '#EF0C08',
|
||||
/** 限速线颜色*/
|
||||
sectionSpeedLimitColor: '#FFFF00',
|
||||
sectionLogicalBackgroundColor: '#FFFF00', // 逻辑区段颜色
|
||||
/** 逻辑区段颜色*/
|
||||
sectionLogicalBackgroundColor: '#FFFF00',
|
||||
/** 区段计轴颜色*/
|
||||
sectionAxleColor: '#FFFFFF',
|
||||
/** 区段边界符颜色*/
|
||||
sectionSeparatorColor: '#3149C3',
|
||||
sectionSeparatorColor: '#C0C0C0',
|
||||
/** 区段空闲颜色*/
|
||||
sectionSpareColor: '#3F3F3F',
|
||||
sectionSpareColor: '#0000FF',
|
||||
/** 逻辑区段名称颜色*/
|
||||
sectionLogicalTextColor: '#FFFFFF',
|
||||
sectionLogicalTextColor: '#C0C0C0',
|
||||
/** 区段通信车占用颜色**/
|
||||
sectionCommunicationOccupiedColor: '#FF329A',
|
||||
/** 区段非通讯车占用颜色*/
|
||||
@ -62,13 +65,14 @@ class Fuzhou extends defaultSkin {
|
||||
sectionProtectiveLockColor: '#FFFF00',
|
||||
/** 区段保护延时解锁*/
|
||||
sectionProtectiveTimeReleaseColor: '#0071C1',
|
||||
sectionAxleFailure: '#E6A23C' // #FFFF00 计轴失效
|
||||
/** 计轴失效*/
|
||||
sectionAxleFailure: '#E6A23C' // #FFFF00
|
||||
};
|
||||
this[deviceType.Signal] = {
|
||||
/** 信号机宽度 */
|
||||
signalR: 5,
|
||||
/** 自动信号宽度*/
|
||||
signalSigPassWidth: 10,
|
||||
signalSigPassWidth: 6,
|
||||
/** 延迟解锁字体大小*/
|
||||
signalDelayTextFontSize: 10,
|
||||
/** 信号机名称字体大小*/
|
||||
@ -76,9 +80,21 @@ class Fuzhou extends defaultSkin {
|
||||
/** 灯柱宽度*/
|
||||
signalLampStandardWidth: 1.2,
|
||||
/** 设备距离区段的距离*/
|
||||
signalDistance: 3,
|
||||
signalDistance: 19,
|
||||
/** 信号灯按钮距离区段的距离*/
|
||||
signalButtonDistance: 5,
|
||||
/** 自动进路方向*/
|
||||
signalSigRouteDirection: false,
|
||||
/** 自动进路偏移量*/
|
||||
signalSigRouteOffset: { x: 4, y: -2 },
|
||||
/** 自动通过方向*/
|
||||
signalSigPassDirection: true,
|
||||
/** 自动通过偏移量*/
|
||||
signalSigPassOffset: { x: 4, y: 0},
|
||||
/** 延时解锁方向*/
|
||||
signalSigDelayDirection: false,
|
||||
/** 延时解锁偏移量*/
|
||||
signalSigDelayOffset: { x: 0, y: -5},
|
||||
/** 信号灯按钮边线*/
|
||||
signalButtonDashColor: '#FFFFFF',
|
||||
/** 信号灯按钮颜色*/
|
||||
@ -90,51 +106,51 @@ class Fuzhou extends defaultSkin {
|
||||
/** 信号机字体绿色*/
|
||||
signalTextGreen: '#4DD43F',
|
||||
/** 信号灯灯柱颜色*/
|
||||
signalLampStandardColor: '#3149C3',
|
||||
signalLampStandardColor: '#C0C0C0', // #3E44BE,
|
||||
/** 信号灯锁闭*/
|
||||
signalBlockColor: '#EF0C08',
|
||||
/** 信号灯灰色*/
|
||||
signalLampGrayColor: '#7F7F7F',
|
||||
signalLampGrayColor: '#808080',
|
||||
/** 信号灯红色*/
|
||||
signalLampRedColor: '#FF0000',
|
||||
signalLampRedColor: '#EF0C08',
|
||||
/** 信号灯绿色*/
|
||||
signalLampGreenColor: '#00FF00',
|
||||
signalLampGreenColor: '#4DD43F',
|
||||
/** 信号灯黄色*/
|
||||
signalLampYellowColor: '#FFFF00',
|
||||
signalLampYellowColor: '#E4EF50',
|
||||
/** 信号灯白色*/
|
||||
signalLampWhiteColor: '#FFFFFF',
|
||||
/** 信号灯蓝色*/
|
||||
signalLampBlueColor: '#0070C0'
|
||||
signalLampBlueColor: '#3E44BE'
|
||||
};
|
||||
this[deviceType.StationStand] = {
|
||||
/** 站台和屏蔽门之间的距离*/
|
||||
standDistance: 8,
|
||||
standDistance: 9,
|
||||
/** 站台屏蔽门高度*/
|
||||
standSafeHeight: 3,
|
||||
standSafeHeight: 1.6,
|
||||
/** 站台首端字体大小*/
|
||||
standHeadFontSize: 10,
|
||||
standHeadFontSize: 8,
|
||||
/** 站台默认字体大小*/
|
||||
standTextFontSize: 10,
|
||||
standTextFontSize: 8,
|
||||
/** 站台紧急关闭半径*/
|
||||
standEmergentR: 4,
|
||||
/** 站台紧急关闭偏移量*/
|
||||
standEmergentOffset: {x: 0, y: 40},
|
||||
standEmergentOffset: {x: 0, y: 0},
|
||||
/** 扣车方向*/
|
||||
standDetainDirection: -1,
|
||||
standDetainDirection: 1,
|
||||
/** 扣车偏移量*/
|
||||
standDetainOffset: {x: -8, y: -6},
|
||||
standDetainOffset: {x: -8, y: 13},
|
||||
/** 运行时间方向*/
|
||||
standTimeDirection: 1,
|
||||
/** 运行时间偏移量*/
|
||||
standTimeOffset: {x: -8, y: 26},
|
||||
standTimeOffset: {x: -8, y: 3},
|
||||
/** 运行等级方向*/
|
||||
standLevelDirection: 1,
|
||||
/** 运行等级偏移量*/
|
||||
standLevelOffset: {x: -8, y: 6},
|
||||
standLevelOffset: {x: -8, y: 22},
|
||||
/** 折返方向*/
|
||||
standReentryDirection: 0,
|
||||
/** 折返偏移量*/
|
||||
standReentryOffset: {x: -16, y: 20},
|
||||
standReentryOffset: {x: -16, y: 18},
|
||||
/** 扣车显示内容*/
|
||||
standDetainText: 'H',
|
||||
/** 站台无人折返*/
|
||||
@ -142,7 +158,7 @@ class Fuzhou extends defaultSkin {
|
||||
/** 站台自动换端*/
|
||||
standAutoChangeEndsColor: '#0BF400',
|
||||
/** 站台空闲颜色*/
|
||||
standSpareColor: '#606060',
|
||||
standSpareColor: '#ffffff',
|
||||
/** 站台列车停站颜色*/
|
||||
standStopColor: '#FEFE00',
|
||||
/** 站台跳停颜色*/
|
||||
@ -179,27 +195,30 @@ class Fuzhou extends defaultSkin {
|
||||
stationDelayUnlockBorderColor: '#FFFFFF'
|
||||
};
|
||||
this[deviceType.StationControl] = {
|
||||
singleControlNum: 2,
|
||||
arrowsShow: true,
|
||||
singleControlNum: 3,
|
||||
stationOffset: {x: 20, y: 0},
|
||||
arrowsShow: false, // 控制模式箭头显隐
|
||||
/** 控制模式字体大小*/
|
||||
stationControlTextSize: 10,
|
||||
stationControlTextSize: 12,
|
||||
/** 控制模式灯的半径 */
|
||||
stationControlmodeR: 4,
|
||||
stationControlmodeR: 5,
|
||||
/** 控制模式之间灯之间的距离*/
|
||||
stationControlDistance: 36,
|
||||
stationControlDistance: 44,
|
||||
/** 控制模式灰色*/
|
||||
stationControlGrayColor: '#7F7F7F',
|
||||
stationControlGrayColor: '#74747C',
|
||||
/** 控制模式绿色*/
|
||||
stationControlGreenColor: '#00FF00',
|
||||
stationControlGreenColor: '#4DD43F',
|
||||
/** 控制模式红色*/
|
||||
stationControlRedColor: '#FF0000',
|
||||
stationControlRedColor: '#EF0C08',
|
||||
/** 控制模式黄色*/
|
||||
stationControlYellowColor: '#FFFF00'
|
||||
stationControlYellowColor: '#E4EF50'
|
||||
};
|
||||
this[deviceType.Station] = {
|
||||
kilometerPosition: 'up'
|
||||
kilometerPosition: 'down' // 公里标位置
|
||||
};
|
||||
this[deviceType.Switch] = {
|
||||
// 道岔字体颜色
|
||||
switchTextColor: '#FF00C0',
|
||||
/** 道岔单边长度 */
|
||||
switchLen: 6,
|
||||
/** 道岔名称与区段距离*/
|
||||
@ -218,6 +237,6 @@ class Fuzhou extends defaultSkin {
|
||||
}
|
||||
}
|
||||
|
||||
const fuzhouSkin = new Fuzhou();
|
||||
const batongSkin = new Batong();
|
||||
|
||||
export default fuzhouSkin;
|
||||
export default batongSkin;
|
||||
|
@ -52,8 +52,7 @@ class TransformHandle {
|
||||
view.decomposeTransform();
|
||||
this.revisibleView(view);
|
||||
}
|
||||
|
||||
return view;
|
||||
// return view;
|
||||
}
|
||||
|
||||
// 处理所有视图缩放/平移
|
||||
|
@ -41,7 +41,7 @@ export default {
|
||||
viewLoaded() { console.log('viewLoaded'); },
|
||||
stateLoaded() { console.log('stateLoaded'); },
|
||||
viewUpdate() { console.log('viewUpdate'); },
|
||||
stateUpdate() { console.log('stateUpdate'); },
|
||||
stateUpdate() { console.log('stateUpdate'); }
|
||||
// optionsUpdate() { console.log('optionsUpdate'); }
|
||||
}
|
||||
});
|
||||
@ -51,14 +51,14 @@ export default {
|
||||
|
||||
// const list = [];
|
||||
// for (let i = 1; i < 20; i++) {
|
||||
// for (let j = 1; j < 1000; j++) {
|
||||
// for (let j = 1; j < 500; j++) {
|
||||
// list.push({ code: `${(Array(3).join(0) + i).slice(-3)}${(Array(3).join(0) + j).slice(-3)}`, lp: { x: 50 + i * 120, y: 50 + j * 20 }, rp: { x: 150 + i * 120, y: 50 + j * 20 } });
|
||||
// }
|
||||
// }
|
||||
|
||||
// this.jmap.load({ skinVO: { code: '02' }, linkList: list });
|
||||
|
||||
getPublishMapDetail('03').then(resp => {
|
||||
getPublishMapDetail('04').then(resp => {
|
||||
this.jmap.setLevelVisible([deviceType.Link], false);
|
||||
this.jmap.load(resp.data);
|
||||
// this.jmap.setDefaultState();
|
||||
|
Loading…
Reference in New Issue
Block a user