Merge branch 'master' of https://git.qcloud.com/joylink/jl-nclient
# Conflicts: # src/jmap/shape/Section/index.js # src/jmap/shape/Switch/index.js
This commit is contained in:
commit
cfbb21b9bb
@ -24,15 +24,6 @@ export default class defaultStyle {
|
|||||||
/** 默认字体阴影颜色*/
|
/** 默认字体阴影颜色*/
|
||||||
this.textShadowColor = '#FFFF00';
|
this.textShadowColor = '#FFFF00';
|
||||||
|
|
||||||
/** 默认border文字背景色*/
|
|
||||||
this.borderContextBackgroundColor = '#00FFFF';
|
|
||||||
|
|
||||||
/** 默认border颜色*/
|
|
||||||
this.borderColor = '#fff';
|
|
||||||
|
|
||||||
/** 默认border线宽*/
|
|
||||||
this.borderWidth = 1;
|
|
||||||
|
|
||||||
/** 默认名称和设备的距离*/
|
/** 默认名称和设备的距离*/
|
||||||
this.nameDistance = 2;
|
this.nameDistance = 2;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
const mapDeviceStyle = {
|
const mapDeviceStyle = {
|
||||||
'02': 'fuzhou_01',
|
'02': 'fuzhou_01',
|
||||||
'03': 'bejing_01',
|
// '03': 'bejing_01',
|
||||||
'04': 'chengdu_03',
|
'03': 'chengdu_03',
|
||||||
'05': 'batong_01'
|
'05': 'batong_01'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -75,24 +75,30 @@ class SkinStyle extends defaultStyle {
|
|||||||
signalLampStandardWidth: 1.5
|
signalLampStandardWidth: 1.5
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
|
/** 文字和灯杆的距离*/
|
||||||
|
distance: 3,
|
||||||
/** 是否禁止旋转*/
|
/** 是否禁止旋转*/
|
||||||
isNoRotation: true,
|
isNoRotation: true,
|
||||||
|
/** 信号字体对其方式*/
|
||||||
|
isAlignCenter: false,
|
||||||
/** 信号机名称字体大小*/
|
/** 信号机名称字体大小*/
|
||||||
signalTextFontSize: 10,
|
signalTextFontSize: 10,
|
||||||
/** 信号灯字体默认色*/
|
/** 信号灯字体默认色*/
|
||||||
signalDefaultTextColor: '#C0C0C0',
|
signalDefaultTextColor: '#C0C0C0',
|
||||||
/** 信号灯字体锁定颜色*/
|
/** 信号灯字体锁定颜色*/
|
||||||
signalTextBlockColor: '#EF0C08'
|
signalTextBlockColor: '#EF0C08',
|
||||||
|
/** 信号字体*/
|
||||||
|
signalTextblock: '#00FF00'
|
||||||
},
|
},
|
||||||
lamp: {
|
lamp: {
|
||||||
/** 禁止线宽度*/
|
/** 禁止线宽度*/
|
||||||
signalStopWidth: 2,
|
signalStopWidth: 2,
|
||||||
/** 信号灯边框线宽度*/
|
/** 信号灯边框线宽度*/
|
||||||
signalBorderWidth: 0.5,
|
signalBorderWidth: 1,
|
||||||
/** 信号灯边框线颜色*/
|
/** 信号灯边框线颜色*/
|
||||||
signalBorderColor: '#3149C3',
|
signalBorderColor: '#3149C3',
|
||||||
/** 信号机宽度 */
|
/** 信号机宽度 */
|
||||||
signalR: 6,
|
signalR: 5,
|
||||||
/** 信号灯锁闭*/
|
/** 信号灯锁闭*/
|
||||||
signalBlockColor: '#EF0C08',
|
signalBlockColor: '#EF0C08',
|
||||||
/** 信号灯灰色*/
|
/** 信号灯灰色*/
|
||||||
@ -145,6 +151,13 @@ class SkinStyle extends defaultStyle {
|
|||||||
signalButtonColor: 'darkgreen',
|
signalButtonColor: 'darkgreen',
|
||||||
/** 信号灯按钮闪烁颜色*/
|
/** 信号灯按钮闪烁颜色*/
|
||||||
signalButtonLightenColor: '#E4EF50'
|
signalButtonLightenColor: '#E4EF50'
|
||||||
|
},
|
||||||
|
mouseEvent: true,
|
||||||
|
mouse: {
|
||||||
|
borderLineColor: '#FFFFFF',
|
||||||
|
borderLineDash: [3, 3],
|
||||||
|
nameBackgroundColor: '#22DFDF',
|
||||||
|
lampBorderLineColor: '#22DFDF'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -194,6 +207,11 @@ class SkinStyle extends defaultStyle {
|
|||||||
direction: 1, // 运行等级方向
|
direction: 1, // 运行等级方向
|
||||||
offset: {x: -8, y: 22}, // 运行等级偏移量
|
offset: {x: -8, y: 22}, // 运行等级偏移量
|
||||||
textColor: '#FFFFFF' // 停站等级字体颜色
|
textColor: '#FFFFFF' // 停站等级字体颜色
|
||||||
|
},
|
||||||
|
mouseEvent: true,
|
||||||
|
mouse: {
|
||||||
|
borderLineColor: '#FFFFFF',
|
||||||
|
borderLineDash: [3, 3]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7,209 +7,212 @@ class SkinStyle extends defaultStyle {
|
|||||||
this[deviceType.Link] = {
|
this[deviceType.Link] = {
|
||||||
/** line 颜色*/
|
/** line 颜色*/
|
||||||
lineWidthColor: '#FFFFFF',
|
lineWidthColor: '#FFFFFF',
|
||||||
|
|
||||||
/** link 宽度*/
|
/** link 宽度*/
|
||||||
linkWidth: 4.4,
|
linkWidth: 4.4,
|
||||||
|
|
||||||
/** link 线条颜色*/
|
/** link 线条颜色*/
|
||||||
linkColor: '#3F3F3F',
|
linkColor: '#3F3F3F',
|
||||||
|
|
||||||
/** link 字体颜色*/
|
/** link 字体颜色*/
|
||||||
linkTextColor: '#FFFFFF'
|
linkTextColor: '#FFFFFF'
|
||||||
};
|
};
|
||||||
this[deviceType.Section] = {
|
this[deviceType.Section] = {
|
||||||
sectionTextPosition: 1, // 区段名称位置 1 上行 -1 下面 0 默认
|
text: { // 区段文字属性
|
||||||
/** 区段 宽度*/
|
fontSize: 10, // 字体大小
|
||||||
sectionWidth: 5,
|
fontFormat: 'consolas', // 字体族类
|
||||||
/** 区段宽超出宽度*/
|
fontColor: '#FFFFFF', // 字体颜色
|
||||||
sectionBeyondWidth: 0,
|
textAlign: 'center', // 水平对齐方式
|
||||||
/** 计轴 半径*/
|
textPosition: 'inside', // 文字位置
|
||||||
sectionAxleR: 3,
|
textVerticalAlign: 'middle', // 文字垂直对齐方式
|
||||||
/** 计轴和区段之间的距离*/
|
position: 1 // 区段名称位置 1 上面 -1 下面 0 默认
|
||||||
sectionAxleDistance: 5,
|
},
|
||||||
/** 限速线的宽度*/
|
line: {
|
||||||
sectionSpeedLimitLinewidth: 1,
|
width: 5, // 区段宽度
|
||||||
/** 限速线距离区段距离*/
|
beyondWidth: 0, // 区段宽超出宽度
|
||||||
sectionSpeedLimitDistance: 5,
|
invadeColor: '#FFFFFF', // 区段侵入颜色
|
||||||
/** 分隔符宽度*/
|
spareColor: '#5578B6', // 区段空闲颜色
|
||||||
sectionSeparatorWidth: 1.2,
|
communicationOccupiedColor: '#FF00FF', // 区段通信车占用颜色
|
||||||
sectionEndSeparatorWidth: 1.2, // 尽头分隔符宽度
|
unCommunicationOccupiedColor: '#DE310C', // 区段非通讯车占用颜色
|
||||||
sectionEndSeparatorStroke: '#C0C0C0', // 尽头分隔符颜色
|
routeLockColor: '#FFFFFF', // 区段路由锁定颜色
|
||||||
/** 区段侵入颜色*/
|
faultLockColor: '#006400', // 区段故障锁定颜色
|
||||||
sectionInvadeColor: '#C00808',
|
undefinedColor: '#0071C1', // 区段未定义颜色
|
||||||
/** 限速线颜色*/
|
protectionLockedColor: '#FFFFFF', // 保护区段锁闭
|
||||||
sectionSpeedLimitColor: '#C0C000',
|
blockColor: '#00FF00', // 区段封锁颜色
|
||||||
/** 逻辑区段颜色*/
|
atcExcisionColor: '#A0522D', // 区段atc切除颜色
|
||||||
sectionLogicalBackgroundColor: '#C0C000',
|
atsExcisionColor: '#A0522D', // 区段ats切除颜色
|
||||||
/** 区段计轴颜色*/
|
timeReleaseColor: '#3F3F3F', // 区段延时释放颜色
|
||||||
sectionAxleColor: '#C0C0C0',
|
protectiveLockColor: '#FFFF00', // 区段保护锁闭
|
||||||
/** 区段边界符颜色*/
|
protectiveTimeReleaseColor: '#0071C1', // 区段保护延时解锁
|
||||||
sectionSeparatorColor: '#C0C0C0',
|
logicalColor: '#FFFF00', // 逻辑区段颜色 (未用)
|
||||||
/** 区段空闲颜色*/
|
logicalTextColor: '#C0C0C0' // 逻辑区段名称颜色 (未用)
|
||||||
sectionSpareColor: '#5B5893',
|
},
|
||||||
/** 逻辑区段名称颜色*/
|
axle: {
|
||||||
sectionLogicalTextColor: '#FFFFFF',
|
radius: 3, // 计轴 半径
|
||||||
/** 区段通信车占用颜色**/
|
distance: 5, // 计轴和区段之间的距离 (未用)
|
||||||
sectionCommunicationOccupiedColor: '#FF00FF',
|
color: '#C0C0C0', // 区段计轴颜色
|
||||||
/** 区段非通讯车占用颜色*/
|
resetColor: '#00FFFF', // 区段计轴预复位颜色
|
||||||
sectionUnCommunicationOccupiedColor: '#DE310C',
|
Failure: '#E6A23C' // #FFFF00 计轴失效
|
||||||
/** 区段路由锁定颜色*/
|
},
|
||||||
sectionRouteLockColor: '#00FF00',
|
speedLimit: { // 限速元素
|
||||||
/** 区段故障锁定颜色*/
|
width: 1, // 限速线的宽度
|
||||||
sectionFaultLockColor: '#FFFFFF',
|
Distance: 5, // 限速线距离区段距离
|
||||||
/** 区段未定义颜色*/
|
lineColor: '#FFFF00' // 限速线颜色
|
||||||
sectionUndefinedColor: '#0071C1',
|
},
|
||||||
/** 保护区段锁闭*/
|
separator: {
|
||||||
sectionProtectionSectionLockedColor: '#00FF00',
|
width: 1.5, // 分隔符宽度
|
||||||
/** 区段计轴预复位*/
|
endWidth: 1.5, // 尽头分隔符宽度
|
||||||
sectionAxleResetColor: '#00FFFF',
|
endColor: '#FFFFFF', // 尽头分隔符颜色
|
||||||
/** 区段封锁颜色*/
|
color: '#FFFFFF' // 区段边界符颜色
|
||||||
sectionBlockColor: '#00FFFF',
|
}
|
||||||
/** 区段atc切除颜色*/
|
|
||||||
sectionAtcExcisionColor: '#A0522D',
|
|
||||||
/** 区段ats切除颜色*/
|
|
||||||
sectionAtsExcisionColor: '#A0522D',
|
|
||||||
/** 区段延时释放颜色*/
|
|
||||||
sectionTimeReleaseColor: '#3F3F3F',
|
|
||||||
/** 区段保护锁闭*/
|
|
||||||
sectionProtectiveLockColor: '#00C957',
|
|
||||||
/** 区段保护延时解锁*/
|
|
||||||
sectionProtectiveTimeReleaseColor: '#0071C1',
|
|
||||||
/** 计轴失效*/
|
|
||||||
sectionAxleFailure: '#B18F38'
|
|
||||||
};
|
};
|
||||||
this[deviceType.Signal] = {
|
this[deviceType.Signal] = {
|
||||||
/** 信号机宽度 */
|
|
||||||
signalR: 6.5,
|
|
||||||
/** 自动信号宽度*/
|
|
||||||
signalAutoWidth: 5,
|
|
||||||
/** 延迟解锁字体大小*/
|
|
||||||
signalDelayTextFontSize: 10,
|
|
||||||
/** 信号机名称字体大小*/
|
|
||||||
signalTextFontSize: 12,
|
|
||||||
/** 灯柱宽度*/
|
|
||||||
signalLampStandardWidth: 1.2,
|
|
||||||
/** 设备距离区段的距离*/
|
/** 设备距离区段的距离*/
|
||||||
signalDistance: 0,
|
signalDistance: 10,
|
||||||
/** 信号灯按钮距离区段的距离*/
|
post: {
|
||||||
signalButtonDistance: 5,
|
signalLampStandardColor: '#FFFFFF',
|
||||||
/** 自动进路方向*/
|
signalLampStandardWidth: 2
|
||||||
signalSigRouteDirection: false,
|
},
|
||||||
/** 自动进路偏移量*/
|
text: {
|
||||||
signalSigRouteOffset: { x: 4, y: -2 },
|
/** 文字和灯杆的距离*/
|
||||||
/** 自动通过方向*/
|
distance: 0,
|
||||||
signalSigPassDirection: true,
|
/** 是否禁止旋转*/
|
||||||
/** 自动通过偏移量*/
|
isNoRotation: true,
|
||||||
signalSigPassOffset: { x: 4, y: 0},
|
/** 信号字体对其方式*/
|
||||||
/** 延时解锁方向*/
|
isAlignCenter: false,
|
||||||
signalSigDelayDirection: false,
|
/** 信号机名称字体大小*/
|
||||||
/** 延时解锁偏移量*/
|
signalTextFontSize: 10,
|
||||||
signalSigDelayOffset: { x: 0, y: -5},
|
/** 信号灯字体默认色*/
|
||||||
/** 信号灯按钮边线*/
|
signalDefaultTextColor: '#FFFFFF',
|
||||||
signalButtonDashColor: '#C0C0C0',
|
/** 信号灯字体锁定颜色*/
|
||||||
/** 信号灯按钮颜色*/
|
signalTextBlockColor: '#EF0C08',
|
||||||
signalButtonColor: 'darkgreen',
|
/** 信号字体*/
|
||||||
/** 信号灯按钮闪烁颜色*/
|
signalTextblock: '#00FF00'
|
||||||
signalButtonLightenColor: '#E4EF50',
|
},
|
||||||
/** 信号灯字体颜色*/
|
lamp: {
|
||||||
signalTextRed: '#EF0C08',
|
/** 禁止线宽度*/
|
||||||
/** 信号机字体绿色*/
|
signalStopWidth: 2,
|
||||||
signalTextGreen: '#00FF00',
|
/** 信号灯边框线宽度*/
|
||||||
/** 信号灯灯柱颜色*/
|
signalBorderWidth: 2,
|
||||||
signalLampStandardColor: '#FFFFFF',
|
/** 信号灯边框线颜色*/
|
||||||
/** 信号灯锁闭*/
|
signalBorderColor: '#3149C3',
|
||||||
signalBlockColor: '#EF0C08',
|
/** 信号灯半径*/
|
||||||
/** 信号灯灰色*/
|
signalR: 6,
|
||||||
signalLampGrayColor: '#7F7F7F',
|
/** 信号灯锁闭*/
|
||||||
/** 信号灯红色*/
|
signalBlockColor: '#EF0C08',
|
||||||
signalLampRedColor: '#FF0000',
|
/** 信号灯灰色*/
|
||||||
/** 信号灯绿色*/
|
signalLampGrayColor: '#7F7F7F',
|
||||||
signalLampGreenColor: '#00FF00',
|
/** 信号灯红色*/
|
||||||
/** 信号灯黄色*/
|
signalLampRedColor: '#FF0000',
|
||||||
signalLampYellowColor: '#FFFF00',
|
/** 信号灯绿色*/
|
||||||
/** 信号灯白色*/
|
signalLampGreenColor: '#00FF00',
|
||||||
signalLampWhiteColor: '#FFFFFF',
|
/** 信号灯黄色*/
|
||||||
/** 信号灯蓝色*/
|
signalLampYellowColor: '#FFFF00',
|
||||||
signalLampBlueColor: '#0000FF'
|
/** 信号灯白色*/
|
||||||
|
signalLampWhiteColor: '#FFFFFF',
|
||||||
|
/** 信号灯蓝色*/
|
||||||
|
signalLampBlueColor: '#0070C0'
|
||||||
|
},
|
||||||
|
route: {
|
||||||
|
/** 自动进路方向*/
|
||||||
|
signalRouteDirection: false,
|
||||||
|
/** 自动进路偏移量*/
|
||||||
|
signalRouteOffset: { x: -4, y: 0 },
|
||||||
|
/** 自动进路*/
|
||||||
|
signalRouteColor: '#00FF00'
|
||||||
|
},
|
||||||
|
auto: {
|
||||||
|
/** 自动通过方向*/
|
||||||
|
signalAutoDirection: false,
|
||||||
|
/** 自动通过偏移量*/
|
||||||
|
signalAutoOffset: { x: -4, y: 0},
|
||||||
|
/** 人工控制*/
|
||||||
|
signalManual: '#FFFF00',
|
||||||
|
/** 自动进路*/
|
||||||
|
signalAutoRoute: '#00FF00',
|
||||||
|
/** 自动触发*/
|
||||||
|
signalAutoTrigger: '#FFFF00',
|
||||||
|
/** 出车冲突*/
|
||||||
|
signalConflict: '#C00808'
|
||||||
|
},
|
||||||
|
delay: {
|
||||||
|
/** 延迟解锁字体大小*/
|
||||||
|
signalDelayTextFontSize: 9,
|
||||||
|
/** 延时解锁方向*/
|
||||||
|
signalDelayDirection: true,
|
||||||
|
/** 延时解锁偏移量*/
|
||||||
|
signalDelayOffset: { x: 15, y: -10},
|
||||||
|
/** 延迟解锁颜色*/
|
||||||
|
signalDelayTextColor: '#C00808'
|
||||||
|
},
|
||||||
|
button: {
|
||||||
|
/** 信号灯按钮距离区段的距离*/
|
||||||
|
signalButtonDistance: 5,
|
||||||
|
/** 信号灯按钮边线*/
|
||||||
|
signalButtonDashColor: '#FFFFFF',
|
||||||
|
/** 信号灯按钮颜色*/
|
||||||
|
signalButtonColor: 'darkgreen',
|
||||||
|
/** 信号灯按钮闪烁颜色*/
|
||||||
|
signalButtonLightenColor: '#E4EF50'
|
||||||
|
}
|
||||||
};
|
};
|
||||||
this[deviceType.StationStand] = {
|
this[deviceType.StationStand] = {
|
||||||
/** 站台和屏蔽门之间的距离*/
|
common: { // 通用属性
|
||||||
standDistance: 1.5,
|
textFontSize: 10 // 站台默认字体大小
|
||||||
/** 站台屏蔽门高度*/
|
},
|
||||||
standSafeHeight: 4,
|
safetyDoor: { // 屏蔽门
|
||||||
/** 站台首端字体大小*/
|
height: 3, // 站台屏蔽门高度
|
||||||
standHeadFontSize: 8,
|
distance: 8, // 站台和屏蔽门之间的距离
|
||||||
/** 站台默认字体大小*/
|
defaultColor: '#00FF00', // 屏蔽门默认颜色
|
||||||
standTextFontSize: 8,
|
splitDoorColor: '#F61107' // 屏蔽门切除颜色
|
||||||
/** 站台紧急关闭半径*/
|
},
|
||||||
standEmergentR: 4,
|
stand: { // 站台
|
||||||
/** 站台紧急关闭偏移量*/
|
headFontSize: 10, // 站台首端字体大小
|
||||||
standEmergentOffset: {x: 0, y: -15},
|
spareColor: '#606060', // 站台空闲颜色
|
||||||
/** 扣车方向*/
|
stopColor: '#FEFE00', // 站台列车停站颜色
|
||||||
standDetainDirection: -1,
|
jumpStopColor: '#9A99FF', // 站台跳停颜色
|
||||||
/** 扣车偏移量*/
|
designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色
|
||||||
standDetainOffset: {x: -12, y: -20},
|
},
|
||||||
/** 运行时间方向*/
|
standEmergent: { // 紧急关闭
|
||||||
standTimeDirection: 1,
|
mergentR: 4, // 站台紧急关闭半径
|
||||||
/** 运行时间偏移量*/
|
offset: {x: 0, y: 40}, // 站台紧急关闭偏移量
|
||||||
standTimeOffset: {x: -12, y: 5},
|
closeColor: '#F61107' // 站台紧急关闭颜色
|
||||||
/** 运行等级方向*/
|
},
|
||||||
standLevelDirection: 1,
|
reentry: { // 站台折返策略
|
||||||
/** 运行等级偏移量*/
|
direction: 0, // 折返方向
|
||||||
standLevelOffset: {x: -12, y: 20},
|
offset: {x: -16, y: 20}, // 折返偏移量
|
||||||
/** 折返方向*/
|
noHumanColor: '#0F16DA', // 站台无人折返
|
||||||
standReentryDirection: 0,
|
AutoChangeEndsColor: '#0BF400' // 站台自动换端
|
||||||
/** 折返偏移量*/
|
},
|
||||||
standReentryOffset: {x: -16, y: 18},
|
detainCar: { // 扣车
|
||||||
/** 扣车显示内容*/
|
text: 'H', // 扣车显示内容
|
||||||
standDetainText: '扣',
|
direction: -1, // 扣车方向
|
||||||
/** 跳停显示内容*/
|
offset: {x: -8, y: -6}, // 扣车偏移量
|
||||||
standJumpText: '跳',
|
trainColor: '#E4EF50', // 车站扣车颜色
|
||||||
/** 站台无人折返*/
|
centerTrainColor: '#FFFFFF', // 中心扣车颜色
|
||||||
standNoHumanReentryColor: '#0F16DA',
|
andCenterTrainColor: '#F61107', // 车站+中心扣车颜色
|
||||||
/** 站台自动换端*/
|
detainTrainTextColor: '#E4EF50' // 车站扣除文字颜色
|
||||||
standAutoChangeEndsColor: '#0BF400',
|
},
|
||||||
/** 站台空闲颜色*/
|
stopTime: { // 停站时间
|
||||||
standSpareColor: '#606060',
|
direction: 1, // 运行时间方向
|
||||||
/** 站台列车停站颜色*/
|
offset: {x: -8, y: 26}, // 运行时间偏移量
|
||||||
standStopColor: '#FEFE00',
|
textColor: '#FFFFFF' // 停站时间字体颜色
|
||||||
/** 站台跳停颜色*/
|
},
|
||||||
standJumpStopColor: '#9A99FF',
|
level: { // 运行等级
|
||||||
/** 站台指定列车跳停颜色*/
|
direction: 1, // 运行等级方向
|
||||||
standDesignatedJumpStopColor: 'lightSkyBlue',
|
offset: {x: -8, y: 6}, // 运行等级偏移量
|
||||||
/** 站台紧急关闭颜色*/
|
textColor: '#FFFFFF' // 停站等级字体颜色
|
||||||
standEmergentCloseColor: '#F61107',
|
}
|
||||||
/** 停站时间字体颜色*/
|
|
||||||
standTimeTextColor: '#FFFFFF',
|
|
||||||
/** 停站等级字体颜色*/
|
|
||||||
standLevelTextColor: '#FFFFFF',
|
|
||||||
/** 车站扣车颜色*/
|
|
||||||
standDetainTrainColor: '#E4EF50',
|
|
||||||
/** 中心扣车颜色*/
|
|
||||||
standCenterDetainTrainColor: '#FFFFFF',
|
|
||||||
/** 车站+中心扣车颜色*/
|
|
||||||
standAndCenterDetainTrainColor: '#F61107',
|
|
||||||
/** 屏蔽门默认颜色*/
|
|
||||||
standDoorDefaultColor: '#00FF00',
|
|
||||||
/** 屏蔽门切除颜色*/
|
|
||||||
standSplitDoorColor: '#F61107',
|
|
||||||
/** 车站扣除文字颜色*/
|
|
||||||
standDetainTrainTextColor: '#E4EF50',
|
|
||||||
/** 计数器字体颜色*/
|
|
||||||
stationCounterTextColor: '#FFFFFF',
|
|
||||||
/** 计数器边框颜色*/
|
|
||||||
stationCounterBorderColor: '#E4EF50',
|
|
||||||
/** 延迟解锁倒计时和设备文字之间的距离*/
|
|
||||||
stationDelayUnlockDistance: 3,
|
|
||||||
/** 延时解锁字体颜色*/
|
|
||||||
stationDelayUnlockTextColor: '#FFFFFF',
|
|
||||||
/** 延迟解锁边框颜色*/
|
|
||||||
stationDelayUnlockBorderColor: '#FFFFFF'
|
|
||||||
};
|
};
|
||||||
this[deviceType.StationControl] = {
|
this[deviceType.StationControl] = {
|
||||||
singleControlNum: 3,
|
text: {
|
||||||
stationOffset: {x: 20, y: 0},
|
fontSize: 10,
|
||||||
arrowsShow: false, // 控制模式箭头显隐
|
fontFormat: 'consolas',
|
||||||
|
fontColor: '#ffffff',
|
||||||
|
fontWeight: 'normal',
|
||||||
|
textAlign: 'middle',
|
||||||
|
textVerticalAlign: 'top'
|
||||||
|
},
|
||||||
|
singleControlNum: 2,
|
||||||
|
stationOffset: {x: 0, y: 0},
|
||||||
|
arrowsShow: true, // 控制模式箭头显隐
|
||||||
/** 控制模式字体大小*/
|
/** 控制模式字体大小*/
|
||||||
stationControlTextSize: 10,
|
stationControlTextSize: 10,
|
||||||
/** 控制模式灯的半径 */
|
/** 控制模式灯的半径 */
|
||||||
@ -226,86 +229,136 @@ class SkinStyle extends defaultStyle {
|
|||||||
stationControlYellowColor: '#FFFF00'
|
stationControlYellowColor: '#FFFF00'
|
||||||
};
|
};
|
||||||
this[deviceType.Station] = {
|
this[deviceType.Station] = {
|
||||||
kilometerPosition: 'down' // 公里标位置
|
kilometerPosition: 'up'
|
||||||
};
|
};
|
||||||
this[deviceType.Switch] = {
|
this[deviceType.Switch] = {
|
||||||
/** 道岔单边长度 */
|
text: {
|
||||||
switchLen: 6,
|
/** 道岔名称与区段距离*/
|
||||||
/** 道岔名称与区段距离*/
|
switchNameDistance: 2,
|
||||||
switchNameDistance: 2,
|
/** 道岔边框颜色*/
|
||||||
/** 道岔边框颜色*/
|
switchTextBorderColor: '#FE0000',
|
||||||
switchTextBorderColor: '#FE0000',
|
/** 道岔失去颜色*/
|
||||||
/** 道岔失去颜色*/
|
switchTextLossColor: '#C00808',
|
||||||
switchTextLossColor: '#C00808',
|
/** 道岔定位颜色*/
|
||||||
/** 道岔定位颜色*/
|
switchTextLocateColor: '#00FF00',
|
||||||
switchTextLocateColor: '#08C008',
|
/** 道岔反位颜色*/
|
||||||
/** 道岔反位颜色*/
|
switchInversionColor: '#FFFF00',
|
||||||
switchInversionColor: '#C0C000',
|
/** 道岔单锁颜色*/
|
||||||
/** 道岔单锁颜色*/
|
switchMonolockColor: '#FFFFFF'
|
||||||
switchMonolockColor: '#FFFFFF'
|
},
|
||||||
|
core: {
|
||||||
|
/** 道岔单边长度 */
|
||||||
|
switchLen: 6
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this[deviceType.LcControl] = {
|
||||||
|
text: {
|
||||||
|
fontSize: 10,
|
||||||
|
distance: 5 // 灯跟文字距离
|
||||||
|
},
|
||||||
|
lamp: {
|
||||||
|
radiusR: 6,
|
||||||
|
controlColor: '#FFFF00'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this[deviceType.ZcControl] = {
|
||||||
|
text: {
|
||||||
|
fontSize: 10,
|
||||||
|
distance: 5 // 灯跟文字距离
|
||||||
|
},
|
||||||
|
lamp: {
|
||||||
|
radiusR: 6,
|
||||||
|
controlColor: '#00FF00'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this[deviceType.LimitControl] = {
|
||||||
|
text: {
|
||||||
|
fontSize: 10,
|
||||||
|
distance: 5 // 灯跟文字距离
|
||||||
|
},
|
||||||
|
lamp: {
|
||||||
|
radiusR: 6,
|
||||||
|
controlColor: '#ECE9D8'
|
||||||
|
}
|
||||||
};
|
};
|
||||||
this[deviceType.Train] = {
|
this[deviceType.Train] = {
|
||||||
/** 车身line宽 */
|
/** 车身line宽 */
|
||||||
trainBodyLineWidth: 0.5,
|
trainBodyLineWidth: 0,
|
||||||
/** 车身鼠标悬浮事件 */
|
/** 车身鼠标悬浮事件 */
|
||||||
trainBodyOnMouseOver: {train: false, textTrainNumber: false, textTrainServer: false, textTrainTarget: false, textTrainTargetNumber: false},
|
trainBodyOnMouseOver: {train: true, textTrainNumber: false, textTrainServer: false, textTrainTarget: false, textTrainTargetNumber: false},
|
||||||
/** 车身鼠标移出事件 */
|
/** 车身鼠标移出事件 */
|
||||||
trainBodyOnMouseOut: {train: false, textTrainNumber: false, textTrainServer: false, textTrainTarget: false, textTrainTargetNumber: false},
|
trainBodyOnMouseOut: {train: true, textTrainNumber: false, textTrainServer: false, textTrainTarget: false, textTrainTargetNumber: false},
|
||||||
|
/** 目的地码前缀*/
|
||||||
|
targetCodePrefix: '000',
|
||||||
|
/** 默认目的地码 */
|
||||||
|
defaultTargetCode: 'AAA',
|
||||||
/** 服务号(表号)前缀 */
|
/** 服务号(表号)前缀 */
|
||||||
serviceNumberPrefix: '00',
|
serviceNumberPrefix: '00',
|
||||||
/** 默认服务号(表号) */
|
/** 默认服务号(表号) */
|
||||||
defaultServiceNumber: 'AA',
|
defaultServiceNumber: 'BB',
|
||||||
/** 车次号前缀 */
|
/** 车次号前缀 */
|
||||||
tripNumberPrefix: '000',
|
tripNumberPrefix: '0000',
|
||||||
|
/** 默认车次号1 */
|
||||||
|
defaultDirectionCode: 'D',
|
||||||
/** 默认车次号2 */
|
/** 默认车次号2 */
|
||||||
defaultTripNumber: 'DDD',
|
defaultTripNumber: 'CCC',
|
||||||
|
/** 车组号前缀 */
|
||||||
|
groupNumberPrefix: '000',
|
||||||
|
/** 默认车组号 */
|
||||||
|
defaultGroupNumber: 'EEE',
|
||||||
/** 列车车头比车身高出的长度,上下相比车体伸出去的边框*/
|
/** 列车车头比车身高出的长度,上下相比车体伸出去的边框*/
|
||||||
trainMoreLength: 1,
|
trainMoreLength: 1,
|
||||||
/** 列车车头三角坐标1偏移量 */
|
/** 列车车头三角坐标1偏移量 */
|
||||||
trainHeadTriangleFirst: { x: 4, y: 0},
|
trainHeadTriangleFirst: { x: 0, y: 0},
|
||||||
/** 列车车头三角坐标2偏移量 */
|
/** 列车车头三角坐标2偏移量 */
|
||||||
trainHeadTriangleSecond: { x: 10, y: 9.5},
|
trainHeadTriangleSecond: { x: 4, y: 8.5},
|
||||||
/** 列车车头三角坐标3偏移量 */
|
/** 列车车头三角坐标3偏移量 */
|
||||||
trainHeadTriangleThird: { x: 4, y: 18},
|
trainHeadTriangleThird: { x: 0, y: 15},
|
||||||
/** 列车高度*/
|
/** 列车高度*/
|
||||||
trainHeight: 18,
|
trainHeight: 17,
|
||||||
/** 列车和车头之间的间距*/
|
/** 列车和车头之间的间距*/
|
||||||
trainHeadDistance: 2,
|
trainHeadDistance: 2,
|
||||||
/** 列车车头矩形高度 */
|
/** 列车车头矩形高度 */
|
||||||
trainHeadRectHeight: 18,
|
trainHeadRectHeight: 15,
|
||||||
/** 列车长度*/
|
/** 列车长度*/
|
||||||
trainWidth: 60,
|
trainWidth: 76,
|
||||||
/** 列车竖杠的宽度*/
|
/** 列车竖杠的宽度*/
|
||||||
trainConntWidth: 2,
|
trainConntWidth: 4,
|
||||||
/** 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 */
|
/** 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 */
|
||||||
changeTrainWidth: false,
|
changeTrainWidth: true,
|
||||||
/** 是否根据nameFormat去动态加载车组号、服务号、车次号、目的地码 */
|
/** 是否根据nameFormat去动态加载车组号、服务号、车次号、目的地码 */
|
||||||
dynamicLoadingDisplay: false,
|
dynamicLoadingDisplay: true,
|
||||||
/** 特殊列车类型需设置显示格式 */
|
/** 特殊列车类型需设置显示格式 */
|
||||||
specialTrainType: [],
|
specialTrainType: [{ type: '03', serviceNumber: 'MM', nameFormat: 'serviceNumber:groupNumber'}],
|
||||||
/** 两边间隔 */
|
/** 两边间隔 */
|
||||||
lrPadding: 4,
|
lrPadding: 1,
|
||||||
/** 上边距离 */
|
/** 上边距离 */
|
||||||
upPadding: 4,
|
upPadding: 1,
|
||||||
/** HSDA两边间隔 */
|
|
||||||
lrPaddingHSDA: 4,
|
|
||||||
/** HSDA上边距离 */
|
|
||||||
upPaddingHSDA: 4,
|
|
||||||
/** 列车字号*/
|
/** 列车字号*/
|
||||||
trainTextFontSize: 12,
|
trainTextFontSize: 15,
|
||||||
/** 目的地状态 eg:{status: '01',showColor: '#FFFFFF'} */
|
/** 目的地状态 01准点 02早点 03严重早点 04晚点 05严重晚点 06头码车 07ATP切除 */
|
||||||
destinationStatus: [],
|
destinationStatus: [
|
||||||
|
{status: '01', showColor: '#FFFFFF'},
|
||||||
|
{status: '02', showColor: '#00FF00'},
|
||||||
|
{status: '03', showColor: '#3265FF'},
|
||||||
|
{status: '04', showColor: '#9B4A09'},
|
||||||
|
{status: '05', showColor: '#EF0C08'},
|
||||||
|
{status: '06', showColor: '#FFFFFF'},
|
||||||
|
{status: '07', showColor: '#FFFF00'}
|
||||||
|
],
|
||||||
|
/** 目的地状态设置的对应哪个text的颜色 */
|
||||||
|
destinationStatusSetText: 'trainServer',
|
||||||
/** 默认字体 族类*/
|
/** 默认字体 族类*/
|
||||||
textFontFormat: 'consolas',
|
textFontFormat: '宋体',
|
||||||
/** 列车HDSA字号*/
|
/** 列车HDSA字号*/
|
||||||
trainHSDATextFontSize: 9,
|
trainHSDATextFontSize: 8,
|
||||||
/** 服务号状态类型 eg:{type: '01', showColor: '#FFFFFF'} */
|
/** 服务号状态类型 eg:{type: '01', showColor: '#FFFFFF'} */
|
||||||
serverNoType: [],
|
serverNoType: [],
|
||||||
/** 列车运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行*/
|
/** 运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行*/
|
||||||
directionType: [
|
directionType: [
|
||||||
{type: '01', lineLShow: true, lineRShow: true, arrowLShow: false, arrowRShow: false },
|
{type: '01', lineLShow: false, lineRShow: false, arrowLShow: false, arrowRShow: false },
|
||||||
{type: '02', lineLShow: false, lineRShow: true, arrowLShow: false, arrowRShow: true },
|
{type: '02', lineLShow: false, lineRShow: false, arrowLShow: false, arrowRShow: true },
|
||||||
{type: '03', lineLShow: true, lineRShow: false, arrowLShow: true, arrowRShow: false }
|
{type: '03', lineLShow: false, lineRShow: false, arrowLShow: true, arrowRShow: false }
|
||||||
],
|
],
|
||||||
/** 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行 */
|
/** 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行 */
|
||||||
directionStopType: [
|
directionStopType: [
|
||||||
@ -313,67 +366,56 @@ class SkinStyle extends defaultStyle {
|
|||||||
{type: '02', lineLShow: false, lineRShow: true},
|
{type: '02', lineLShow: false, lineRShow: true},
|
||||||
{type: '03', lineLShow: true, lineRShow: false}
|
{type: '03', lineLShow: true, lineRShow: false}
|
||||||
],
|
],
|
||||||
/** 列车运行模式对应车头颜色 01未知 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM
|
/** 列车运行模式对应车头颜色 01信号中断 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM
|
||||||
* 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM*/
|
* 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM*/
|
||||||
runModeStatus: [
|
runModeStatus: [
|
||||||
{status: '01', trainLColor: '#FFFFFF', trainRColor: '#FFFFFF'},
|
{status: '01', trainLColor: '#EF0C08', trainRColor: '#EF0C08'},
|
||||||
{status: '02', trainLColor: '#00FF00', trainRColor: '#00FF00'},
|
{status: '02', trainLColor: '#00FF00', trainRColor: '#00FF00'},
|
||||||
{status: '03', trainLColor: '#FFFF00', trainRColor: '#FFFF00'},
|
{status: '03', trainLColor: '#FFFF00', trainRColor: '#FFFF00'},
|
||||||
{status: '04', trainLColor: '#A0522D', trainRColor: '#A0522D'},
|
{status: '04', trainLColor: '#EA700D', trainRColor: '#EA700D'},
|
||||||
{status: '05', trainLColor: '#A0522D', trainRColor: '#A0522D'}
|
{status: '05', trainLColor: '#A0522D', trainRColor: '#A0522D'}
|
||||||
],
|
],
|
||||||
/** 设置运行控制状态类型 01正常 02扣车 03停跳 */
|
/** 设置运行控制状态类型 eg:{status: '01', hShow: false, sShow: false}, */
|
||||||
runControlStatus: [
|
runControlStatus: [],
|
||||||
{status: '01', hShow: false, sShow: false},
|
/** 设置车门状态类型 eg:{status: '01', dShow: false}, */
|
||||||
{status: '02', hShow: true, sShow: false},
|
doorStatus: [],
|
||||||
{status: '03', hShow: false, sShow: true}
|
|
||||||
],
|
|
||||||
/** 设置车门状态类型 01关门 02开门 */
|
|
||||||
doorStatus: [
|
|
||||||
{status: '01', dShow: false},
|
|
||||||
{status: '02', dShow: true}
|
|
||||||
],
|
|
||||||
/** 设置通信状态 eg:{status: '01', trainColor:'#725A64'}, */
|
/** 设置通信状态 eg:{status: '01', trainColor:'#725A64'}, */
|
||||||
communicationStatus: [],
|
communicationStatus: [],
|
||||||
/** 设置报警状态 01不报警 02报警 */
|
/** 设置报警状态 eg:{status: '01', aShow: false}, */
|
||||||
alarmStatus: [
|
alarmStatus: [],
|
||||||
{status: '01', aShow: false},
|
|
||||||
{status: '02', aShow: true}
|
|
||||||
],
|
|
||||||
/** 列车车头矩形填充颜色 */
|
/** 列车车头矩形填充颜色 */
|
||||||
trainHeadFillColor: '#000000',
|
trainHeadFillColor: '#EF0C08',
|
||||||
/** 列车车身填充颜色 */
|
/** 列车车身填充颜色 */
|
||||||
trainBodyFillColor: '#3265FF',
|
trainBodyFillColor: '#000000',
|
||||||
/** textH文本 */
|
|
||||||
textHContent: '扣',
|
|
||||||
/** textS文本 */
|
|
||||||
textSContent: '跳',
|
|
||||||
/** textD文本 */
|
|
||||||
textDContent: '门',
|
|
||||||
/** textA文本 */
|
|
||||||
textAContent: '警',
|
|
||||||
/** 是否需创建textHSDA对象 */
|
|
||||||
haveTextHSDA: true,
|
|
||||||
/** 是否需创建arrowText对象 */
|
|
||||||
haveArrowText: false,
|
|
||||||
/** 是否需创建trainBorder对象 */
|
|
||||||
haveTrainBorder: false,
|
|
||||||
/** 列车服务号偏移 */
|
/** 列车服务号偏移 */
|
||||||
trainServerOffset: { x: 4, y: 4},
|
trainServerOffset: { x: -1, y: 1},
|
||||||
/** 列车车次号偏移 */
|
/** 列车车次号偏移 */
|
||||||
trainTargetOffset: { x: 56, y: 4},
|
trainTargetOffset: { x: -1, y: 1},
|
||||||
|
/** 列车显示格式 */
|
||||||
|
trainNameFormat: 'targetCode:serviceNumber:tripNumber',
|
||||||
|
/** 字体大小 */
|
||||||
|
nameFontSize: 10,
|
||||||
/** 目的地码文字显示位置 */
|
/** 目的地码文字显示位置 */
|
||||||
trainTargetTextAlign: 'right'
|
trainTargetTextAlign: 'left',
|
||||||
|
/** 是否需创建textHSDA对象 */
|
||||||
|
haveTextHSDA: false,
|
||||||
|
/** 是否需创建arrowText对象 */
|
||||||
|
haveArrowText: true,
|
||||||
|
/** 是否需创建trainBorder对象 */
|
||||||
|
haveTrainBorder: false
|
||||||
};
|
};
|
||||||
this[deviceType.TrainWindow] = {
|
this[deviceType.TrainWindow] = {
|
||||||
/** 车次窗颜色*/
|
/** 车次窗颜色*/
|
||||||
trainWindowColor: '#C0C0C0',
|
trainWindowColor: '#4DD43F',
|
||||||
/** 车次窗虚线间隔 */
|
/** 车次窗虚线间隔 */
|
||||||
lineDash: [3, 3],
|
lineDash: null,
|
||||||
/** 车次窗线宽 */
|
/** 车次窗线宽 */
|
||||||
trainWindowLineWidth: 1,
|
trainWindowLineWidth: 1.5,
|
||||||
/** 车次窗矩形圆滑程度 */
|
/** 车次窗矩形圆滑程度 */
|
||||||
trainWindowSmooth: 0.01
|
trainWindowSmooth: 0
|
||||||
|
};
|
||||||
|
this[deviceType.Line] = {
|
||||||
|
lineColor: '#FFFFFF'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,14 +70,20 @@ class SkinStyle extends defaultStyle {
|
|||||||
signalLampStandardWidth: 2
|
signalLampStandardWidth: 2
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
|
/** 文字和灯杆的距离*/
|
||||||
|
distance: 0,
|
||||||
/** 是否禁止旋转*/
|
/** 是否禁止旋转*/
|
||||||
isNoRotation: true,
|
isNoRotation: true,
|
||||||
|
/** 信号字体对其方式*/
|
||||||
|
isAlignCenter: true,
|
||||||
/** 信号机名称字体大小*/
|
/** 信号机名称字体大小*/
|
||||||
signalTextFontSize: 10,
|
signalTextFontSize: 10,
|
||||||
/** 信号灯字体默认色*/
|
/** 信号灯字体默认色*/
|
||||||
signalDefaultTextColor: '#FFFFFF',
|
signalDefaultTextColor: '#FFFFFF',
|
||||||
/** 信号灯字体锁定颜色*/
|
/** 信号灯字体锁定颜色*/
|
||||||
signalTextBlockColor: '#EF0C08'
|
signalTextBlockColor: '#EF0C08',
|
||||||
|
/** 信号字体*/
|
||||||
|
signalTextblock: '#00FF00'
|
||||||
},
|
},
|
||||||
lamp: {
|
lamp: {
|
||||||
/** 禁止线宽度*/
|
/** 禁止线宽度*/
|
||||||
|
@ -8,7 +8,6 @@ import deviceState from './constant/deviceState';
|
|||||||
import deviceType from './constant/deviceType';
|
import deviceType from './constant/deviceType';
|
||||||
import { selectSkinStyle } from './config/deviceStyle';
|
import { selectSkinStyle } from './config/deviceStyle';
|
||||||
import { parser, deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser';
|
import { parser, deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser';
|
||||||
import Theme from './theme/factory';
|
|
||||||
|
|
||||||
const renderer = 'canvas';
|
const renderer = 'canvas';
|
||||||
const devicePixelRatio = 1;
|
const devicePixelRatio = 1;
|
||||||
@ -30,9 +29,6 @@ class Jlmap {
|
|||||||
// 皮肤风格
|
// 皮肤风格
|
||||||
this.style = this.loadStyle();
|
this.style = this.loadStyle();
|
||||||
|
|
||||||
// 地图主题
|
|
||||||
this.theme = this.loadTheme();
|
|
||||||
|
|
||||||
// 设备数据
|
// 设备数据
|
||||||
this.mapDevice = {};
|
this.mapDevice = {};
|
||||||
|
|
||||||
@ -67,10 +63,6 @@ class Jlmap {
|
|||||||
return selectSkinStyle(skinStyle);
|
return selectSkinStyle(skinStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadTheme(skinStyle) {
|
|
||||||
return new Theme(skinStyle);
|
|
||||||
}
|
|
||||||
|
|
||||||
loadDefaultState() {
|
loadDefaultState() {
|
||||||
const defaultStateDict = {};
|
const defaultStateDict = {};
|
||||||
|
|
||||||
@ -96,9 +88,6 @@ class Jlmap {
|
|||||||
// 加载对应皮肤
|
// 加载对应皮肤
|
||||||
this.style = this.loadStyle(this.skinStyle);
|
this.style = this.loadStyle(this.skinStyle);
|
||||||
|
|
||||||
// 主题模块
|
|
||||||
this.theme = this.loadTheme(this.skinStyle);
|
|
||||||
|
|
||||||
// 解析地图数据
|
// 解析地图数据
|
||||||
this.mapDevice = parser(map, this);
|
this.mapDevice = parser(map, this);
|
||||||
|
|
||||||
|
@ -13,10 +13,10 @@ export default class ImageControl extends Group {
|
|||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.z = model.zIndex || 1;
|
this.z = model.zIndex || 1;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
this.image = new Image({
|
this.image = new Image({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
@ -42,6 +42,7 @@ export default class ImageControl extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 整体图片
|
// 整体图片
|
||||||
|
@ -13,10 +13,10 @@ export default class LcControl extends Group {
|
|||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
this.control = new EControl({
|
this.control = new EControl({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
@ -50,7 +50,9 @@ export default class LcControl extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 设置状态
|
// 设置状态
|
||||||
setState(model) {}
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
|
}
|
||||||
|
|
||||||
getShapeTipPoint() {
|
getShapeTipPoint() {
|
||||||
if (this.control) {
|
if (this.control) {
|
||||||
|
@ -14,10 +14,10 @@ export default class LimitControl extends Group {
|
|||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.z = 20;
|
this.z = 20;
|
||||||
this._create(model);
|
this.create(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
_create(model) {
|
create(model) {
|
||||||
this.control = new EControl({
|
this.control = new EControl({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
@ -51,6 +51,7 @@ export default class LimitControl extends Group {
|
|||||||
|
|
||||||
// 设置状态
|
// 设置状态
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
getShapeTipPoint() {
|
getShapeTipPoint() {
|
||||||
|
@ -10,11 +10,11 @@ export default class Line2 extends Group {
|
|||||||
this.z = 0;
|
this.z = 0;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this._create();
|
this.create();
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
if (model && model.points.length > 1) {
|
if (model && model.points.length > 1) {
|
||||||
@ -49,6 +49,7 @@ export default class Line2 extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
this.setLineType(model.type);
|
this.setLineType(model.type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@ class Link extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
tipBasePoint() {
|
tipBasePoint() {
|
||||||
|
@ -38,10 +38,10 @@ export const EAxle = Path.extend({
|
|||||||
// this.model = model;
|
// this.model = model;
|
||||||
// this.zlevel = model.zlevel;
|
// this.zlevel = model.zlevel;
|
||||||
// this.z = 5;
|
// this.z = 5;
|
||||||
// this._create(model);
|
// this.create(model);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// _create(model) {
|
// create(model) {
|
||||||
// if (model && model.style && model.traingle) {
|
// if (model && model.style && model.traingle) {
|
||||||
// const axleLength = 2 * model.style.Section.axle.radius;
|
// const axleLength = 2 * model.style.Section.axle.radius;
|
||||||
// const positionx = model.point.x + model.drictx * (model.traingle.getCos(axleLength));
|
// const positionx = model.point.x + model.drictx * (model.traingle.getCos(axleLength));
|
||||||
|
@ -81,10 +81,10 @@ export default class ELimitLines extends Group {
|
|||||||
this.model = model;
|
this.model = model;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.z = model.z;
|
this.z = model.z;
|
||||||
this._create(model);
|
this.create(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
_create(model) {
|
create(model) {
|
||||||
/** 创建区段*/
|
/** 创建区段*/
|
||||||
if (model && model.points.length > 1) {
|
if (model && model.points.length > 1) {
|
||||||
if (model.isCurve) {
|
if (model.isCurve) {
|
||||||
|
@ -9,10 +9,10 @@ export default class ELines extends Group {
|
|||||||
this.model = model;
|
this.model = model;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.z = model.z;
|
this.z = model.z;
|
||||||
this._create(model);
|
this.create(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
_create(model) {
|
create(model) {
|
||||||
/** 创建区段*/
|
/** 创建区段*/
|
||||||
if (model && model.points.length > 1) {
|
if (model && model.points.length > 1) {
|
||||||
if (model.isCurve) {
|
if (model.isCurve) {
|
||||||
|
@ -10,7 +10,7 @@ export default class ERelease extends Group {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
|
|
||||||
@ -30,23 +30,23 @@ export default class ERelease extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setStyle(model) {
|
setStyle(model) {
|
||||||
this._create();
|
this.create();
|
||||||
this.lines.setStyle(model);
|
this.lines.setStyle(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this._create();
|
this.create();
|
||||||
this.lines.hide();
|
this.lines.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this._create();
|
this.create();
|
||||||
this.lines.show();
|
this.lines.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 开始动画
|
// 开始动画
|
||||||
animateStyle(loop, animates) {
|
animateStyle(loop, animates) {
|
||||||
this._create();
|
this.create();
|
||||||
if (animates && animates.length) {
|
if (animates && animates.length) {
|
||||||
this.eachChild((child) => {
|
this.eachChild((child) => {
|
||||||
if (child.animateStyle) {
|
if (child.animateStyle) {
|
||||||
@ -62,7 +62,7 @@ export default class ERelease extends Group {
|
|||||||
|
|
||||||
// 结束动画
|
// 结束动画
|
||||||
stopAnimation(flag) {
|
stopAnimation(flag) {
|
||||||
this._create();
|
this.create();
|
||||||
this.eachChild((child) => {
|
this.eachChild((child) => {
|
||||||
if (child.stopAnimation) {
|
if (child.stopAnimation) {
|
||||||
child.stopAnimation(flag);
|
child.stopAnimation(flag);
|
||||||
|
@ -20,11 +20,11 @@ export default class Section extends Group {
|
|||||||
this.model = model;
|
this.model = model;
|
||||||
this.selected = false;
|
this.selected = false;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this._create();
|
|
||||||
this.createMouseEvent();
|
this.createMouseEvent();
|
||||||
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
// 01:物理区段;02逻辑区段;03道岔区段
|
// 01:物理区段;02逻辑区段;03道岔区段
|
||||||
this.createSectionText(); // 创建区段文字
|
this.createSectionText(); // 创建区段文字
|
||||||
@ -609,11 +609,13 @@ export default class Section extends Group {
|
|||||||
/** 区段切除*/
|
/** 区段切除*/
|
||||||
sectionCutOff() {
|
sectionCutOff() {
|
||||||
const lineWidth = this.style.Section.line.width + (this.model.status != '01' ? this.style.Section.line.beyondWidth : 0);
|
const lineWidth = this.style.Section.line.width + (this.model.status != '01' ? this.style.Section.line.beyondWidth : 0);
|
||||||
this.section.animateStyle(true, [
|
if (this.section) {
|
||||||
{ time: 0, styles: { lineWidth: lineWidth } },
|
this.section.animateStyle(true, [
|
||||||
{ time: 1000, styles: { stroke: this.style.backgroundColor } },
|
{ time: 0, styles: { lineWidth: lineWidth } },
|
||||||
{ time: 2000, styles: { lineWidth: lineWidth } }
|
{ time: 1000, styles: { stroke: this.style.backgroundColor } },
|
||||||
]);
|
{ time: 2000, styles: { lineWidth: lineWidth } }
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置限速*/
|
/** 设置限速*/
|
||||||
@ -646,6 +648,7 @@ export default class Section extends Group {
|
|||||||
|
|
||||||
/** 设置状态*/
|
/** 设置状态*/
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
this.recover();
|
this.recover();
|
||||||
switch (model.status) {
|
switch (model.status) {
|
||||||
case '00': /** 未定义*/
|
case '00': /** 未定义*/
|
||||||
|
59
src/jmap/shape/Signal/EMouse.js
Normal file
59
src/jmap/shape/Signal/EMouse.js
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
import Group from 'zrender/src/container/Group';
|
||||||
|
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||||
|
|
||||||
|
export default class EMouse extends Group {
|
||||||
|
constructor(device) {
|
||||||
|
super();
|
||||||
|
this.device = device;
|
||||||
|
this.zlevel = device.zlevel;
|
||||||
|
this.style = device.style;
|
||||||
|
this.down = true;
|
||||||
|
this.create();
|
||||||
|
}
|
||||||
|
|
||||||
|
create() {
|
||||||
|
this.lampRect = new Rect({
|
||||||
|
silent: true,
|
||||||
|
zlevel: this.zlevel,
|
||||||
|
z: 6,
|
||||||
|
shape: this.device.getBoundingRect(),
|
||||||
|
style: {
|
||||||
|
lineDash: this.style.Signal.mouse.borderLineDash,
|
||||||
|
stroke: this.style.Signal.mouse.borderLineColor,
|
||||||
|
fill: this.style.transparentColor
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.nameRect = new Rect({
|
||||||
|
silent: true,
|
||||||
|
zlevel: this.zlevel,
|
||||||
|
z: 5,
|
||||||
|
shape: this.device.sigName.getBoundingRect(),
|
||||||
|
style: {
|
||||||
|
lineDash: this.style.Signal.mouse.borderLineDash,
|
||||||
|
stroke: this.style.Signal.mouse.borderLineColor,
|
||||||
|
fill: this.style.Signal.mouse.nameBackgroundColor
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.lampRect.hide();
|
||||||
|
this.nameRect.hide();
|
||||||
|
this.add(this.lampRect);
|
||||||
|
this.add(this.nameRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
mouseover(e) {
|
||||||
|
this.nameRect.show();
|
||||||
|
this.lampRect.show();
|
||||||
|
this.device.lamps.forEach(elem => {
|
||||||
|
elem.setBorderColor(this.style.Signal.mouse.lampBorderLineColor);
|
||||||
|
});
|
||||||
|
this.device.sigName.setColor(this.style.backgroundColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
mouseout(e) {
|
||||||
|
this.nameRect.hide();
|
||||||
|
this.lampRect.hide();
|
||||||
|
this.device.setState(this.device.model);
|
||||||
|
}
|
||||||
|
}
|
@ -9,7 +9,7 @@ class ESigPass extends Group {
|
|||||||
this.isNew = false;
|
this.isNew = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
@ -36,19 +36,19 @@ class ESigPass extends Group {
|
|||||||
|
|
||||||
// 停止动画
|
// 停止动画
|
||||||
animationRecover() {
|
animationRecover() {
|
||||||
this._create();
|
this.create();
|
||||||
this.arrows.stopAnimation(false);
|
this.arrows.stopAnimation(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 箭头颜色
|
// 箭头颜色
|
||||||
setColor(color) {
|
setColor(color) {
|
||||||
this._create();
|
this.create();
|
||||||
this.arrows.setStyle('fill', color);
|
this.arrows.setStyle('fill', color);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 箭头闪烁
|
// 箭头闪烁
|
||||||
arrowsAnimation() {
|
arrowsAnimation() {
|
||||||
this._create();
|
this.create();
|
||||||
|
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
const fill = this.arrows.style.Signal.fill;
|
const fill = this.arrows.style.Signal.fill;
|
||||||
@ -63,13 +63,13 @@ class ESigPass extends Group {
|
|||||||
|
|
||||||
// 隐藏
|
// 隐藏
|
||||||
hide() {
|
hide() {
|
||||||
this._create();
|
this.create();
|
||||||
this.arrows.hide();
|
this.arrows.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
// 显示
|
||||||
show() {
|
show() {
|
||||||
this._create();
|
this.create();
|
||||||
this.arrows.show();
|
this.arrows.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ class ESigButton extends Group {
|
|||||||
this.isNew = false;
|
this.isNew = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
@ -98,13 +98,13 @@ class ESigButton extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this._create();
|
this.create();
|
||||||
this.sigNormalButtom.hide();
|
this.sigNormalButtom.hide();
|
||||||
this.sigReentryButton.hide();
|
this.sigReentryButton.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this._create();
|
this.create();
|
||||||
this.sigNormalButtom.show();
|
this.sigNormalButtom.show();
|
||||||
this.sigReentryButton.show();
|
this.sigReentryButton.show();
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ class ESigDelay extends Group {
|
|||||||
this.isNew = false;
|
this.isNew = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
|
|
||||||
@ -36,22 +36,22 @@ class ESigDelay extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setStyle(model) {
|
setStyle(model) {
|
||||||
this._create();
|
this.create();
|
||||||
this.name.setStyle(model);
|
this.name.setStyle(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
setColor(color) {
|
setColor(color) {
|
||||||
this._create();
|
this.create();
|
||||||
this.name.setStyle('textFill', color);
|
this.name.setStyle('textFill', color);
|
||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this._create();
|
this.create();
|
||||||
this.name.hide();
|
this.name.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this._create();
|
this.create();
|
||||||
this.name.show();
|
this.name.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,10 @@ class ESigLamp extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
@ -78,7 +78,11 @@ class ESigLamp extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setColor(color) {
|
setColor(color) {
|
||||||
this.lamp.setStyle({fill: color});
|
this.lamp.setStyle({ stroke: color, fill: color });
|
||||||
|
}
|
||||||
|
|
||||||
|
setBorderColor(color) {
|
||||||
|
this.lamp.setStyle({stroke: color});
|
||||||
}
|
}
|
||||||
|
|
||||||
setStop(has) {
|
setStop(has) {
|
||||||
@ -90,6 +94,10 @@ class ESigLamp extends Group {
|
|||||||
this.rstop.hide();
|
this.rstop.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getBoundingRect() {
|
||||||
|
return this.lamp.getBoundingRect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ESigLamp;
|
export default ESigLamp;
|
||||||
|
@ -5,10 +5,10 @@ class ESigName extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
this.name = new Text({
|
this.name = new Text({
|
||||||
_subType: 'SignalLamp',
|
_subType: 'SignalLamp',
|
||||||
|
@ -5,10 +5,10 @@ class ESigPost extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ class ESigDrict extends Group {
|
|||||||
this.isNew = false;
|
this.isNew = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
@ -34,13 +34,13 @@ class ESigDrict extends Group {
|
|||||||
|
|
||||||
// 隐藏
|
// 隐藏
|
||||||
hide() {
|
hide() {
|
||||||
this._create();
|
this.create();
|
||||||
this.sigDrict.hide();
|
this.sigDrict.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
// 显示
|
||||||
show() {
|
show() {
|
||||||
this._create();
|
this.create();
|
||||||
this.sigDrict.show();
|
this.sigDrict.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import ESigRoute from './ESigRoute';
|
|||||||
import ESigButton from './ESigButton';
|
import ESigButton from './ESigButton';
|
||||||
import ESigDelay from './ESigDelay';
|
import ESigDelay from './ESigDelay';
|
||||||
import ESigName from './ESigName';
|
import ESigName from './ESigName';
|
||||||
|
import EMouse from './EMouse';
|
||||||
import Group from 'zrender/src/container/Group';
|
import Group from 'zrender/src/container/Group';
|
||||||
import BoundingRect from 'zrender/src/core/BoundingRect';
|
import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||||
|
|
||||||
@ -24,6 +25,7 @@ class Signal extends Group {
|
|||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.z = 7;
|
this.z = 7;
|
||||||
this.create();
|
this.create();
|
||||||
|
this.createMouseEvent();
|
||||||
this.transformRotation(this);
|
this.transformRotation(this);
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
@ -65,8 +67,10 @@ class Signal extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 信号机名称
|
// 信号机名称
|
||||||
const sigNameX = model.position.x + model.namePosition.x;
|
const sigNameX = model.position.x - drict * (style.Signal.post.signalLampStandardWidth) + model.namePosition.x;
|
||||||
const sigNameY = model.position.y + posit * (style.Signal.signalDistance + style.Section.line.width + style.Signal.lamp.signalR * 2 + model.namePosition.y);
|
const sigNameY = model.position.y + posit * (style.Signal.signalDistance + style.Section.line.width + style.Signal.lamp.signalR * 2 + model.namePosition.y + style.Signal.text.distance);
|
||||||
|
const textAlign = style.Signal.text.isAlignCenter ? 'middle': this.model.directionType == '01'? 'right': 'left';
|
||||||
|
const textVerticalAlign = posit == 1 ? 'top' : 'bottom';
|
||||||
this.sigName = new ESigName({
|
this.sigName = new ESigName({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
@ -80,8 +84,8 @@ class Signal extends Group {
|
|||||||
fontSize: style.Signal.text.signalTextFontSize,
|
fontSize: style.Signal.text.signalTextFontSize,
|
||||||
fontFamily: style.textFontFormat,
|
fontFamily: style.textFontFormat,
|
||||||
textFill: style.Signal.text.signalDefaultTextColor,
|
textFill: style.Signal.text.signalDefaultTextColor,
|
||||||
textAlign: 'middle',
|
textAlign: textAlign,
|
||||||
textVerticalAlign: posit == 1 ? 'top' : 'bottom'
|
textVerticalAlign: textVerticalAlign
|
||||||
});
|
});
|
||||||
|
|
||||||
// 自动进路
|
// 自动进路
|
||||||
@ -154,6 +158,19 @@ class Signal extends Group {
|
|||||||
// this.add(this.sigButton);
|
// this.add(this.sigButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createMouseEvent() {
|
||||||
|
if (this.style.Signal.mouseEvent) {
|
||||||
|
this.mouseEvent = new EMouse(this);
|
||||||
|
this.add(this.mouseEvent);
|
||||||
|
this.onmouseover = (e) => {
|
||||||
|
this.mouseEvent.mouseover(e);
|
||||||
|
};
|
||||||
|
this.onmouseout = (e) => {
|
||||||
|
this.mouseEvent.mouseout(e);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 整体旋转信号灯
|
// 整体旋转信号灯
|
||||||
transformRotation(device) {
|
transformRotation(device) {
|
||||||
if (this.model.rotate) {
|
if (this.model.rotate) {
|
||||||
@ -321,7 +338,7 @@ class Signal extends Group {
|
|||||||
this.lamps[0].setColor(this.style.Signal.lamp.signalLampRedColor);
|
this.lamps[0].setColor(this.style.Signal.lamp.signalLampRedColor);
|
||||||
// this.siglamp.setNameBorder(1)
|
// this.siglamp.setNameBorder(1)
|
||||||
}
|
}
|
||||||
this.sigName.setColor(this.style.Signal.signalTextBlockColor);
|
this.sigName.setColor(this.style.Signal.text.signalTextBlockColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 功能封锁
|
// 功能封锁
|
||||||
@ -336,7 +353,7 @@ class Signal extends Group {
|
|||||||
signalblock() {
|
signalblock() {
|
||||||
if (this.count == 1) {
|
if (this.count == 1) {
|
||||||
this.lamps[0].setColor(this.style.Signal.lamp.signalLampRedColor);
|
this.lamps[0].setColor(this.style.Signal.lamp.signalLampRedColor);
|
||||||
this.sigName.setColor(this.style.Signal.lamp.signalLampGreenColor);
|
this.sigName.setColor(this.style.Signal.text.signalTextblock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,6 +433,7 @@ class Signal extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
this.recover();
|
this.recover();
|
||||||
/** 设置状态 (点灯类型)*/
|
/** 设置状态 (点灯类型)*/
|
||||||
switch (model.status) {
|
switch (model.status) {
|
||||||
@ -463,7 +481,11 @@ class Signal extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getBoundingRect() {
|
getBoundingRect() {
|
||||||
return this.sigPost.getBoundingRect();
|
const rect = this.sigPost.getBoundingRect();
|
||||||
|
this.lamps.forEach(elem => {
|
||||||
|
rect.union(elem.getBoundingRect());
|
||||||
|
});
|
||||||
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
getShapeTipPoint(opts) {
|
getShapeTipPoint(opts) {
|
||||||
|
@ -13,10 +13,10 @@ export default class Station extends Group {
|
|||||||
this.z = 40;
|
this.z = 40;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
|
|
||||||
@ -72,6 +72,7 @@ export default class Station extends Group {
|
|||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
getShapeTipPoint() {
|
getShapeTipPoint() {
|
||||||
|
@ -5,10 +5,10 @@ class ESigAuto extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
|
|
||||||
this.arrows = new Polygon({
|
this.arrows = new Polygon({
|
||||||
|
@ -10,10 +10,10 @@ export default class ESingleControl extends Group {
|
|||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this._subType = model._subType;
|
this._subType = model._subType;
|
||||||
this.z = 20;
|
this.z = 20;
|
||||||
this._create(model);
|
this.create(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
_create(model) {
|
create(model) {
|
||||||
var _subType = 'ControlSignal';
|
var _subType = 'ControlSignal';
|
||||||
var _val = '0';
|
var _val = '0';
|
||||||
if (model.pop) {
|
if (model.pop) {
|
||||||
|
@ -16,11 +16,11 @@ export default class StationControl extends Group {
|
|||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this._create();
|
this.create();
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
this.emergencyControl = new ESingleControl({
|
this.emergencyControl = new ESingleControl({
|
||||||
_subType: 'emergency',
|
_subType: 'emergency',
|
||||||
@ -86,6 +86,7 @@ export default class StationControl extends Group {
|
|||||||
|
|
||||||
// 设置状态
|
// 设置状态
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
switch (model.status) {
|
switch (model.status) {
|
||||||
case '00': // 无状态
|
case '00': // 无状态
|
||||||
this.emergencyControl.setColor(this.style.StationControl.stationControlGrayColor);
|
this.emergencyControl.setColor(this.style.StationControl.stationControlGrayColor);
|
||||||
|
@ -14,11 +14,11 @@ export default class StationCounter extends Group {
|
|||||||
this.style = style;
|
this.style = style;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.z = 30;
|
this.z = 30;
|
||||||
this._create();
|
this.create();
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
this.counter = new Text({
|
this.counter = new Text({
|
||||||
@ -81,6 +81,7 @@ export default class StationCounter extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
getShapeTipPoint() {
|
getShapeTipPoint() {
|
||||||
|
@ -14,11 +14,11 @@ export default class StationDelayUnlock extends Group {
|
|||||||
this.style = style;
|
this.style = style;
|
||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.z = 1;
|
this.z = 1;
|
||||||
this._create();
|
this.create();
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
this.text = new Text({
|
this.text = new Text({
|
||||||
@ -95,6 +95,7 @@ export default class StationDelayUnlock extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
switch (model.status) {
|
switch (model.status) {
|
||||||
case '01': this.delayClose(); break; // 关闭
|
case '01': this.delayClose(); break; // 关闭
|
||||||
case '02': this.delayUnlock(); break; // 延迟解锁
|
case '02': this.delayUnlock(); break; // 延迟解锁
|
||||||
|
@ -8,7 +8,7 @@ class EDetain extends Group {
|
|||||||
this.isNew = false;
|
this.isNew = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
@ -35,17 +35,17 @@ class EDetain extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setColor(color) {
|
setColor(color) {
|
||||||
this._create();
|
this.create();
|
||||||
this.detain.setStyle('textFill', color);
|
this.detain.setStyle('textFill', color);
|
||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this._create();
|
this.create();
|
||||||
this.detain.hide();
|
this.detain.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this._create();
|
this.create();
|
||||||
this.detain.show();
|
this.detain.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ class EJump extends Group {
|
|||||||
this.isNew = false;
|
this.isNew = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
@ -34,22 +34,22 @@ class EJump extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setName(val) {
|
setName(val) {
|
||||||
this._create();
|
this.create();
|
||||||
this.jump.setStyle('text', val);
|
this.jump.setStyle('text', val);
|
||||||
}
|
}
|
||||||
|
|
||||||
setColor(color) {
|
setColor(color) {
|
||||||
this._create();
|
this.create();
|
||||||
this.jump.setStyle('textFill', color);
|
this.jump.setStyle('textFill', color);
|
||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this._create();
|
this.create();
|
||||||
this.jump.hide();
|
this.jump.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this._create();
|
this.create();
|
||||||
this.jump.show();
|
this.jump.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ class ELevel extends Group {
|
|||||||
this.isNew = false;
|
this.isNew = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
@ -34,22 +34,22 @@ class ELevel extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setName(val) {
|
setName(val) {
|
||||||
this._create();
|
this.create();
|
||||||
this.level.setStyle('text', val);
|
this.level.setStyle('text', val);
|
||||||
}
|
}
|
||||||
|
|
||||||
setColor(color) {
|
setColor(color) {
|
||||||
this._create();
|
this.create();
|
||||||
this.level.setStyle('textFill', color);
|
this.level.setStyle('textFill', color);
|
||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this._create();
|
this.create();
|
||||||
this.level.hide();
|
this.level.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this._create();
|
this.create();
|
||||||
this.level.show();
|
this.level.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
37
src/jmap/shape/StationStand/EMouse.js
Normal file
37
src/jmap/shape/StationStand/EMouse.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import Group from 'zrender/src/container/Group';
|
||||||
|
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||||
|
|
||||||
|
export default class EMouse extends Group {
|
||||||
|
constructor(device) {
|
||||||
|
super();
|
||||||
|
this.device = device;
|
||||||
|
this.zlevel = device.zlevel;
|
||||||
|
this.style = device.style;
|
||||||
|
this.down = true;
|
||||||
|
this.create();
|
||||||
|
}
|
||||||
|
|
||||||
|
create() {
|
||||||
|
this.border = new Rect({
|
||||||
|
silent: true,
|
||||||
|
zlevel: this.zlevel,
|
||||||
|
z: 0,
|
||||||
|
shape: this.device.getBoundingRect(),
|
||||||
|
style: {
|
||||||
|
lineDash: this.style.StationStand.mouse.borderLineDash,
|
||||||
|
stroke: this.style.StationStand.mouse.borderLineColor,
|
||||||
|
fill: this.style.transparentColor
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.border.hide();
|
||||||
|
this.add(this.border);
|
||||||
|
}
|
||||||
|
|
||||||
|
mouseover(e) {
|
||||||
|
this.border.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
mouseout(e) {
|
||||||
|
this.border.hide();
|
||||||
|
}
|
||||||
|
}
|
@ -9,7 +9,7 @@ class EReentry extends Group {
|
|||||||
this.isNew = false;
|
this.isNew = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
|
|
||||||
@ -31,17 +31,17 @@ class EReentry extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setColor(color) {
|
setColor(color) {
|
||||||
this._create();
|
this.create();
|
||||||
this.reentry.setStyle('textFill', color);
|
this.reentry.setStyle('textFill', color);
|
||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this._create();
|
this.create();
|
||||||
this.reentry.hide();
|
this.reentry.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this._create();
|
this.create();
|
||||||
this.reentry.show();
|
this.reentry.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,10 @@ class ESafeDoor extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
const padding = 0.1;
|
const padding = 0.1;
|
||||||
|
@ -8,7 +8,7 @@ class ESafeEmergent extends Group {
|
|||||||
this.isNew = false;
|
this.isNew = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
@ -35,12 +35,12 @@ class ESafeEmergent extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this._create();
|
this.create();
|
||||||
this.emergent.hide();
|
this.emergent.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this._create();
|
this.create();
|
||||||
this.emergent.show();
|
this.emergent.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,10 @@ class ESafeStand extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ class ETime extends Group {
|
|||||||
this.isNew = false;
|
this.isNew = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
if (!this.isNew) {
|
if (!this.isNew) {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
@ -34,22 +34,22 @@ class ETime extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setName(val) {
|
setName(val) {
|
||||||
this._create();
|
this.create();
|
||||||
this.time.setStyle('text', val);
|
this.time.setStyle('text', val);
|
||||||
}
|
}
|
||||||
|
|
||||||
setColor(color) {
|
setColor(color) {
|
||||||
this._create();
|
this.create();
|
||||||
this.time.setStyle('textFill', color);
|
this.time.setStyle('textFill', color);
|
||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
this._create();
|
this.create();
|
||||||
this.time.hide();
|
this.time.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this._create();
|
this.create();
|
||||||
this.time.show();
|
this.time.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import EDetain from './EDetain';
|
|||||||
import ESafeDoor from './ESafeDoor';
|
import ESafeDoor from './ESafeDoor';
|
||||||
import ESafeStand from './ESafeStand';
|
import ESafeStand from './ESafeStand';
|
||||||
import ESafeEmergent from './ESafeEmergent';
|
import ESafeEmergent from './ESafeEmergent';
|
||||||
|
import EMouse from './EMouse';
|
||||||
|
|
||||||
class StationStand extends Group {
|
class StationStand extends Group {
|
||||||
constructor(model, style) {
|
constructor(model, style) {
|
||||||
@ -18,11 +19,12 @@ class StationStand extends Group {
|
|||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.z = 1;
|
this.z = 1;
|
||||||
this.doors = new Group();
|
this.doors = new Group();
|
||||||
this._create();
|
this.create();
|
||||||
|
this.createMouseEvent();
|
||||||
this.setVisible(model.visible);
|
this.setVisible(model.visible);
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.style;
|
const style = this.style;
|
||||||
const drict = model.doorLocationType == '01' ? 1 : -1;
|
const drict = model.doorLocationType == '01' ? 1 : -1;
|
||||||
@ -137,6 +139,19 @@ class StationStand extends Group {
|
|||||||
this.add(this.level);
|
this.add(this.level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createMouseEvent() {
|
||||||
|
if (this.style.StationStand.mouseEvent) {
|
||||||
|
this.mouseEvent = new EMouse(this);
|
||||||
|
this.add(this.mouseEvent);
|
||||||
|
this.onmouseover = (e) => {
|
||||||
|
this.mouseEvent.mouseover(e);
|
||||||
|
};
|
||||||
|
this.onmouseout = (e) => {
|
||||||
|
this.mouseEvent.mouseout(e);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setVisible(visible) {
|
setVisible(visible) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
this.eachChild(elem => { elem.show(); });
|
this.eachChild(elem => { elem.show(); });
|
||||||
@ -262,6 +277,7 @@ class StationStand extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
this.recover();
|
this.recover();
|
||||||
switch (model.status) {
|
switch (model.status) {
|
||||||
case '01': /** 空闲*/
|
case '01': /** 空闲*/
|
||||||
@ -352,12 +368,13 @@ class StationStand extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getBoundingRect() {
|
getBoundingRect() {
|
||||||
return this.safeStand.getBoundingRect();
|
const rect = this.safeStand.getBoundingRect();
|
||||||
|
rect.union(this.safeDoor.getBoundingRect());
|
||||||
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
getShapeTipPoint() {
|
getShapeTipPoint() {
|
||||||
const rect = this.safeStand.getBoundingRect();
|
const rect = this.getBoundingRect();
|
||||||
rect.union(this.safeDoor.getBoundingRect());
|
|
||||||
if (rect) {
|
if (rect) {
|
||||||
return {
|
return {
|
||||||
x: rect.x + rect.width / 2,
|
x: rect.x + rect.width / 2,
|
||||||
|
@ -5,10 +5,10 @@ class ESwCore extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
this.skewLine = new Line({
|
this.skewLine = new Line({
|
||||||
|
@ -5,10 +5,10 @@ class ESwLnversion extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
this.relocShelter = new Polygon({
|
this.relocShelter = new Polygon({
|
||||||
|
@ -5,10 +5,10 @@ class ESwLocal extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@ class ESwName extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ class ESwName extends Group {
|
|||||||
// textAlign: model.triangle.drictx === 1 ? 'left' : 'right',
|
// textAlign: model.triangle.drictx === 1 ? 'left' : 'right',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
textVerticalAlign: model.triangle.dricty === 1 ? 'top' : 'bottom',
|
textVerticalAlign: model.triangle.dricty === 1 ? 'top' : 'bottom',
|
||||||
textFill: style.Switch.text.switchTextLossColor
|
textFill: style.textFontColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -366,6 +366,7 @@ export default class Switch extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
this.setLocateType(model);
|
this.setLocateType(model);
|
||||||
switch (model.status) {
|
switch (model.status) {
|
||||||
case '01':
|
case '01':
|
||||||
|
@ -11,11 +11,11 @@ export default class Text2 extends Group {
|
|||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.z = 6;
|
this.z = 6;
|
||||||
this._create();
|
this.create();
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
var model = this.model;
|
var model = this.model;
|
||||||
var [direction, content] = model.content.split('::');
|
var [direction, content] = model.content.split('::');
|
||||||
if (direction == 'V') {
|
if (direction == 'V') {
|
||||||
@ -40,5 +40,6 @@ export default class Text2 extends Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,9 @@ class ArrowText extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
_create() {
|
create() {
|
||||||
this.arrowText = new Text({
|
this.arrowText = new Text({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z+1,
|
z: this.model.z+1,
|
||||||
|
@ -5,9 +5,9 @@ export default class TextHSDA extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
this.textH = new Text({
|
this.textH = new Text({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
|
@ -5,9 +5,9 @@ export default class TextTrainNumber extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
this.textTrainNumber = new Text({
|
this.textTrainNumber = new Text({
|
||||||
zlevel: model.zlevel+1,
|
zlevel: model.zlevel+1,
|
||||||
|
@ -5,9 +5,9 @@ export default class TextTrainServer extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
_create() {
|
create() {
|
||||||
this.textTrainServer = new Text({
|
this.textTrainServer = new Text({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z+1,
|
z: this.model.z+1,
|
||||||
|
@ -5,9 +5,9 @@ export default class TextTrainTarget extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
_create() {
|
create() {
|
||||||
this.textTrainTarget = new Text({
|
this.textTrainTarget = new Text({
|
||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z+1,
|
z: this.model.z+1,
|
||||||
|
@ -5,9 +5,9 @@ export default class TextTrainTargetNumber extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
this.textTrainTargetNumber = new Text({
|
this.textTrainTargetNumber = new Text({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
|
@ -6,9 +6,9 @@ export default class Train extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
this.train = new Rect({
|
this.train = new Rect({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
|
@ -12,10 +12,10 @@ export default class TrainBody extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
const textFont = model.fontSize + 'px ' + style.Train.textFontFormat;
|
const textFont = model.fontSize + 'px ' + style.Train.textFontFormat;
|
||||||
|
@ -7,9 +7,9 @@ export default class TrainHead extends Group {
|
|||||||
constructor(model) {
|
constructor(model) {
|
||||||
super();
|
super();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
_create() {
|
create() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
const style = this.model.style;
|
const style = this.model.style;
|
||||||
const baseMargin = (model.drect === -1 ? 1 : 0);
|
const baseMargin = (model.drect === -1 ? 1 : 0);
|
||||||
|
@ -14,10 +14,11 @@ export default class Train extends Group {
|
|||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.z = 40;
|
this.z = 40;
|
||||||
|
this.size = 0;
|
||||||
this.section = null;
|
this.section = null;
|
||||||
this.fontSize = style.Train.nameFontSize || style.Train.trainTextFontSize;
|
this.fontSize = style.Train.nameFontSize || style.Train.trainTextFontSize;
|
||||||
this.newScale = this.fontSize / style.Train.trainTextFontSize;
|
this.newScale = this.fontSize / style.Train.trainTextFontSize;
|
||||||
this._create();
|
this.create();
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +47,7 @@ export default class Train extends Group {
|
|||||||
this.traingle = null;
|
this.traingle = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_create() {
|
create() {
|
||||||
this._computed();
|
this._computed();
|
||||||
this.isChangeTrainWidth(this.model, this.style);
|
this.isChangeTrainWidth(this.model, this.style);
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
@ -270,6 +271,7 @@ export default class Train extends Group {
|
|||||||
|
|
||||||
// 设置状态
|
// 设置状态
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
if (model) {
|
if (model) {
|
||||||
this.recover();
|
this.recover();
|
||||||
this.setServerNoType(model.serverNoType); // 设置服务号状态类型
|
this.setServerNoType(model.serverNoType); // 设置服务号状态类型
|
||||||
@ -285,8 +287,8 @@ export default class Train extends Group {
|
|||||||
// 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
// 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||||
isChangeTrainWidth(model, style) {
|
isChangeTrainWidth(model, style) {
|
||||||
if (!style.Train.changeTrainWidth) { return; }
|
if (!style.Train.changeTrainWidth) { return; }
|
||||||
if (model.nameFormat) {
|
if (style.Train.trainNameFormat) {
|
||||||
const arr = model.nameFormat.split(':');
|
const arr = style.Train.trainNameFormat.split(':');
|
||||||
arr.forEach(ele => {
|
arr.forEach(ele => {
|
||||||
switch (ele) {
|
switch (ele) {
|
||||||
case 'targetCode': {
|
case 'targetCode': {
|
||||||
|
@ -13,10 +13,10 @@ class TrainWindow extends Group {
|
|||||||
this.style = style;
|
this.style = style;
|
||||||
this.z = 1;
|
this.z = 1;
|
||||||
this.prdType = store.state.training.prdType;
|
this.prdType = store.state.training.prdType;
|
||||||
this._create(model);
|
this.create(model);
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
_create(model) {
|
create(model) {
|
||||||
if (this.prdType !== '01') {
|
if (this.prdType !== '01') {
|
||||||
this.createTrainWindow();
|
this.createTrainWindow();
|
||||||
}
|
}
|
||||||
@ -62,6 +62,7 @@ class TrainWindow extends Group {
|
|||||||
|
|
||||||
// 设置状态
|
// 设置状态
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
this.setTrainWindowEventShow(model.trainWindowShow);
|
this.setTrainWindowEventShow(model.trainWindowShow);
|
||||||
}
|
}
|
||||||
setTrainWindowEventShow(show) {
|
setTrainWindowEventShow(show) {
|
||||||
|
@ -13,11 +13,11 @@ export default class ZcControl extends Group {
|
|||||||
this.zlevel = model.zlevel;
|
this.zlevel = model.zlevel;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this._create(model);
|
this.create(model);
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
_create(model) {
|
create(model) {
|
||||||
this.control = new EControl({
|
this.control = new EControl({
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
@ -50,7 +50,7 @@ export default class ZcControl extends Group {
|
|||||||
|
|
||||||
// 设置状态
|
// 设置状态
|
||||||
setState(model) {
|
setState(model) {
|
||||||
|
this.model = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
getShapeTipPoint() {
|
getShapeTipPoint() {
|
||||||
|
@ -12,10 +12,10 @@ export default class EControl extends Group {
|
|||||||
this.style = model.style;
|
this.style = model.style;
|
||||||
this.textStyle = model.text;
|
this.textStyle = model.text;
|
||||||
this.arcStyle = model.arc;
|
this.arcStyle = model.arc;
|
||||||
this._create();
|
this.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
_create() {
|
create() {
|
||||||
this.control = new Arc({
|
this.control = new Arc({
|
||||||
_subType: 'Control',
|
_subType: 'Control',
|
||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
|
@ -29,10 +29,10 @@ export default function ETextName(model) {
|
|||||||
// this.model = model;
|
// this.model = model;
|
||||||
// this.zlevel = model.zlevel;
|
// this.zlevel = model.zlevel;
|
||||||
// this.z = model.z;
|
// this.z = model.z;
|
||||||
// this._create();
|
// this.create();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// _create() {
|
// create() {
|
||||||
// this.TextName = new Text({
|
// this.TextName = new Text({
|
||||||
// _subType: this.model._subType,
|
// _subType: this.model._subType,
|
||||||
// zlevel: this.zlevel,
|
// zlevel: this.zlevel,
|
||||||
|
@ -118,6 +118,7 @@ export default {
|
|||||||
if (this.$jlmap) {
|
if (this.$jlmap) {
|
||||||
this.$jlmap.dispose();
|
this.$jlmap.dispose();
|
||||||
}
|
}
|
||||||
|
this.$store.dispatch('training/setPrdType', null);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 初始化jlmap
|
// 初始化jlmap
|
||||||
@ -191,7 +192,9 @@ export default {
|
|||||||
// 地图视图加载完成
|
// 地图视图加载完成
|
||||||
handleViewLoaded() {
|
handleViewLoaded() {
|
||||||
this.$store.dispatch('map/mapViewLoaded');
|
this.$store.dispatch('map/mapViewLoaded');
|
||||||
this.mapViewLoaded(false);
|
if (!this.$store.state.training.prdType) {
|
||||||
|
this.mapViewLoaded(false);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 地图状态加载完成
|
// 地图状态加载完成
|
||||||
handleStateLoaded() {
|
handleStateLoaded() {
|
||||||
@ -205,7 +208,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 视图参数改变
|
// 视图参数改变
|
||||||
handleOptionsUpdate(options) {
|
handleOptionsUpdate(options) {
|
||||||
console.log('optionsUpdate');
|
|
||||||
},
|
},
|
||||||
// 视图缩放事假
|
// 视图缩放事假
|
||||||
onDataZoom(dataZoom) {
|
onDataZoom(dataZoom) {
|
||||||
|
Loading…
Reference in New Issue
Block a user