Merge branch 'master' of https://git.qcloud.com/joylink/jl-nclient
This commit is contained in:
commit
efa91ae5a0
@ -379,142 +379,159 @@ class SkinStyle extends defaultStyle {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this[deviceType.Train] = {
|
this[deviceType.Train] = {
|
||||||
/** 车身line宽 */
|
trainBody: {
|
||||||
trainBodyLineWidth: 0.1,
|
trainBodyLineWidth: 0.1, // 车身line宽
|
||||||
/** 车身鼠标悬浮事件 */
|
trainBodyOnMouseOver: {
|
||||||
trainBodyOnMouseOver: {train: true, textTrainNumber: false, textTrainServer: false, textTrainTarget: false, textTrainTargetNumber: false},
|
train: true,
|
||||||
/** 车身鼠标移出事件 */
|
textTrainNumber: false,
|
||||||
trainBodyOnMouseOut: {train: true, textTrainNumber: false, textTrainServer: false, textTrainTarget: false, textTrainTargetNumber: false},
|
textTrainServer: false,
|
||||||
/** 服务号(表号)前缀 */
|
textTrainTarget: false,
|
||||||
serviceNumberPrefix: '00',
|
textTrainTargetNumber: false
|
||||||
/** 默认服务号(表号) */
|
}, // 车身鼠标悬浮事件
|
||||||
defaultServiceNumber: 'AA',
|
trainBodyOnMouseOut: {
|
||||||
/** 车次号前缀 */
|
train: true,
|
||||||
tripNumberPrefix: '000',
|
textTrainNumber: false,
|
||||||
/** 默认车次号2 */
|
textTrainServer: false,
|
||||||
defaultTripNumber: 'DDD',
|
textTrainTarget: false,
|
||||||
/** 列车车头比车身高出的长度,上下相比车体伸出去的边框*/
|
textTrainTargetNumber: false
|
||||||
trainMoreLength: 0,
|
}, // 车身鼠标移出事件
|
||||||
/** 列车车头三角坐标1偏移量 */
|
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||||
trainHeadTriangleFirst: { x: 7, y: 1},
|
specialTrainType: [], // 特殊列车类型需设置显示格式
|
||||||
/** 列车车头三角坐标2偏移量 */
|
lrPadding: 4, // 两边间隔
|
||||||
trainHeadTriangleSecond: { x: 13, y: 10},
|
upPadding: 4, // 上边距离
|
||||||
/** 列车车头三角坐标3偏移量 */
|
trainBodyFillColor: '#725A64', // 列车车身填充颜色
|
||||||
trainHeadTriangleThird: { x: 7, y: 19},
|
trainNameFormat: 'serviceNumber:tripNumber'// 列车显示格式
|
||||||
/** 列车高度*/
|
},
|
||||||
trainHeight: 20,
|
hsda: {
|
||||||
/** 列车和车头之间的间距*/
|
lrPaddingHSDA: 3, // HSDA两边间隔
|
||||||
trainHeadDistance: 4,
|
upPaddingHSDA: 4, // HSDA上边距离
|
||||||
/** 列车车头矩形高度 */
|
trainHSDATextFontSize: 9, // 列车HDSA字号
|
||||||
trainHeadRectHeight: 20,
|
textHContent: 'H', // textH文本
|
||||||
/** 列车长度*/
|
textSContent: 'S', // textS文本
|
||||||
trainWidth: 40,
|
textDContent: 'D', // textD文本
|
||||||
/** 列车竖杠的宽度*/
|
textAContent: 'A'// textA文本
|
||||||
trainConntWidth: 3,
|
},
|
||||||
/** 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 */
|
trainNumber: {
|
||||||
changeTrainWidth: false,
|
},
|
||||||
/** 是否根据nameFormat去动态加载车组号、服务号、车次号、目的地码 */
|
trainServer: {
|
||||||
dynamicLoadingDisplay: false,
|
serviceNumberPrefix: '00', // 服务号(表号)前缀
|
||||||
/** 特殊列车类型需设置显示格式 */
|
defaultServiceNumber: 'AA', // 默认服务号(表号)
|
||||||
specialTrainType: [],
|
trainServerOffset: { x: 4, y: 4}// 列车服务号偏移
|
||||||
/** 两边间隔 */
|
},
|
||||||
lrPadding: 4,
|
trainTarget: {
|
||||||
/** 上边距离 */
|
tripNumberPrefix: '000', // 车次号前缀
|
||||||
upPadding: 4,
|
defaultTripNumber: 'DDD', // 默认车次号2
|
||||||
/** HSDA两边间隔 */
|
trainTargetOffset: { x: 36, y: 4}, // 列车车次号偏移
|
||||||
lrPaddingHSDA: 3,
|
trainTargetTextAlign: 'right'// 车次号文字显示位置
|
||||||
/** HSDA上边距离 */
|
},
|
||||||
upPaddingHSDA: 4,
|
trainTargetNumber: {
|
||||||
/** 列车字号*/
|
trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量
|
||||||
trainTextFontSize: 12,
|
},
|
||||||
/** 目的地状态 01准点 02早点 03晚点 04头码车 */
|
trainHead: {
|
||||||
destinationStatus: [
|
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||||
{status: '01', showColor: '#FFFFFF'},
|
trainHeadTriangleFirst: { x: 7, y: 1}, // 列车车头三角坐标1偏移量
|
||||||
{status: '02', showColor: '#00FF00'},
|
trainHeadTriangleSecond: { x: 13, y: 10}, // 列车车头三角坐标2偏移量
|
||||||
{status: '03', showColor: '#A0522D'},
|
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
|
||||||
{status: '04', showColor: '#FFFF00'}
|
trainHeadRectHeight: 20, // 列车车头矩形高度
|
||||||
],
|
trainConntWidth: 3, // 列车竖杠的宽度
|
||||||
/** 默认目的地状态显示颜色 */
|
trainHeadFillColor: '#000000'// 列车车头矩形填充颜色
|
||||||
defaultDestinationColor: '#FFFFFF',
|
},
|
||||||
/** 目的地状态设置的对应哪个text的颜色 */
|
common: {
|
||||||
destinationStatusSetText: 'trainTarget',
|
trainHeight: 20, // 列车高度
|
||||||
/** 默认字体 族类*/
|
trainHeadDistance: 4, // 列车和车头之间的间距
|
||||||
textFontFormat: 'consolas',
|
trainWidth: 40, // 列车长度
|
||||||
/** 列车HDSA字号*/
|
trainTextFontSize: 12, // 列车字号
|
||||||
trainHSDATextFontSize: 9,
|
textFontFormat: 'consolas', // 默认字体 族类
|
||||||
/** 服务号状态类型 01显示服务号 计划车 02显示车组号: 头码车与人工车 */
|
haveTextHSDA: true, // 是否需创建textHSDA对象
|
||||||
serverNoType: [
|
haveArrowText: true, // 是否需创建arrowText对象
|
||||||
{type: '01', showColor: '#FFFFFF'},
|
haveTrainBorder: false// 是否需创建trainBorder对象
|
||||||
{type: '02', showColor: '#FFF000'}
|
},
|
||||||
],
|
trainStatusStyle: {
|
||||||
/** 默认服务号状态显示颜色 */
|
destinationStatus: [
|
||||||
defaultServerNoColor: '#FFFFFF',
|
{status: '01', showColor: '#FFFFFF'},
|
||||||
/** 列车运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行*/
|
{status: '02', showColor: '#00FF00'},
|
||||||
directionType: [
|
{status: '03', showColor: '#A0522D'},
|
||||||
{type: '01', lineLShow: true, lineRShow: true, arrowLShow: false, arrowRShow: false },
|
{status: '04', showColor: '#FFFF00'}
|
||||||
{type: '02', lineLShow: false, lineRShow: true, arrowLShow: false, arrowRShow: true },
|
], // 目的地状态 01准点 02早点 03晚点 04头码车
|
||||||
{type: '03', lineLShow: true, lineRShow: false, arrowLShow: true, arrowRShow: false }
|
defaultDestinationColor: '#FFFFFF', // 默认目的地状态显示颜色
|
||||||
],
|
destinationStatusSetText: 'trainTarget', // 目的地状态设置的对应哪个text的颜色
|
||||||
/** 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行 */
|
directionType: [
|
||||||
directionStopType: [
|
{
|
||||||
{type: '01', lineLShow: false, lineRShow: false},
|
type: '01',
|
||||||
{type: '02', lineLShow: false, lineRShow: true},
|
lineLShow: true,
|
||||||
{type: '03', lineLShow: true, lineRShow: false}
|
lineRShow: true,
|
||||||
],
|
arrowLShow: false,
|
||||||
/** 列车运行模式对应车头颜色 01未知 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM
|
arrowRShow: false
|
||||||
* 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM*/
|
},
|
||||||
runModeStatus: [
|
{
|
||||||
{status: '01', trainLColor: '#FFFFFF', trainRColor: '#FFFFFF'},
|
type: '02',
|
||||||
{status: '02', trainLColor: '#00FF00', trainRColor: '#00FF00'},
|
lineLShow: false,
|
||||||
{status: '03', trainLColor: '#FFFF00', trainRColor: '#FFFF00'},
|
lineRShow: true,
|
||||||
{status: '04', trainLColor: '#A0522D', trainRColor: '#A0522D'},
|
arrowLShow: false,
|
||||||
{status: '05', trainLColor: '#A0522D', trainRColor: '#A0522D'}
|
arrowRShow: true
|
||||||
],
|
},
|
||||||
/** 设置运行控制状态类型 01正常 02扣车 03停跳 */
|
{
|
||||||
runControlStatus: [
|
type: '03',
|
||||||
{status: '01', hShow: false, sShow: false},
|
lineLShow: true,
|
||||||
{status: '02', hShow: true, sShow: false},
|
lineRShow: false,
|
||||||
{status: '03', hShow: false, sShow: true}
|
arrowLShow: true,
|
||||||
],
|
arrowRShow: false
|
||||||
/** 设置车门状态类型 01关门 02开门 */
|
}
|
||||||
doorStatus: [
|
], // 列车运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
|
||||||
{status: '01', dShow: false},
|
directionStopType: [
|
||||||
{status: '02', dShow: true}
|
{type: '01', lineLShow: false, lineRShow: false},
|
||||||
],
|
{type: '02', lineLShow: false, lineRShow: true},
|
||||||
/** 设置通信状态 01正常 02故障 */
|
{type: '03', lineLShow: true, lineRShow: false}
|
||||||
communicationStatus: [
|
], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
|
||||||
{status: '01', trainColor: '#725A64'},
|
runModeStatus: [
|
||||||
{status: '02', trainColor: '#C0C0C0'}
|
{
|
||||||
],
|
status: '01',
|
||||||
/** 设置报警状态 01不报警 02报警 */
|
trainLColor: '#FFFFFF',
|
||||||
alarmStatus: [
|
trainRColor: '#FFFFFF'
|
||||||
{status: '01', aShow: false},
|
},
|
||||||
{status: '02', aShow: true}
|
{
|
||||||
],
|
status: '02',
|
||||||
/** 列车车头矩形填充颜色 */
|
trainLColor: '#00FF00',
|
||||||
trainHeadFillColor: '#000000',
|
trainRColor: '#00FF00'
|
||||||
/** 列车车身填充颜色 */
|
},
|
||||||
trainBodyFillColor: '#725A64',
|
{
|
||||||
/** textH文本 */
|
status: '03',
|
||||||
textHContent: 'H',
|
trainLColor: '#FFFF00',
|
||||||
/** textS文本 */
|
trainRColor: '#FFFF00'},
|
||||||
textSContent: 'S',
|
{
|
||||||
/** textD文本 */
|
status: '04',
|
||||||
textDContent: 'D',
|
trainLColor: '#A0522D',
|
||||||
/** textA文本 */
|
trainRColor: '#A0522D'
|
||||||
textAContent: 'A',
|
},
|
||||||
/** 是否需创建textHSDA对象 */
|
{
|
||||||
haveTextHSDA: true,
|
status: '05',
|
||||||
/** 是否需创建arrowText对象 */
|
trainLColor: '#A0522D',
|
||||||
haveArrowText: true,
|
trainRColor: '#A0522D'
|
||||||
/** 是否需创建trainBorder对象 */
|
}
|
||||||
haveTrainBorder: false,
|
], // 列车运行模式对应车头颜色 01未知 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM
|
||||||
/** 列车服务号偏移 */
|
runControlStatus: [
|
||||||
trainServerOffset: { x: 4, y: 4},
|
{status: '01', hShow: false, sShow: false},
|
||||||
/** 列车车次号偏移 */
|
{status: '02', hShow: true, sShow: false},
|
||||||
trainTargetOffset: { x: 36, y: 4},
|
{status: '03', hShow: false, sShow: true}
|
||||||
/** 目的地码文字显示位置 */
|
], // 设置运行控制状态类型 01正常 02扣车 03停跳
|
||||||
trainTargetTextAlign: 'right'
|
doorStatus: [
|
||||||
|
{status: '01', dShow: false},
|
||||||
|
{status: '02', dShow: true}
|
||||||
|
], // 设置车门状态类型 01关门 02开门
|
||||||
|
communicationStatus: [
|
||||||
|
{status: '01', trainColor: '#725A64'},
|
||||||
|
{status: '02', trainColor: '#C0C0C0'}
|
||||||
|
], // 设置通信状态 01正常 02故障
|
||||||
|
alarmStatus: [
|
||||||
|
{status: '01', aShow: false},
|
||||||
|
{status: '02', aShow: true}
|
||||||
|
], // 设置报警状态 01不报警 02报警
|
||||||
|
serverNoType: [
|
||||||
|
{type: '01', showColor: '#FFFFFF'},
|
||||||
|
{type: '02', showColor: '#FFF000'}
|
||||||
|
], // 服务号状态类型 01显示服务号 计划车 02显示车组号: 头码车与人工车
|
||||||
|
defaultServerNoColor: '#FFFFFF' // 默认服务号状态显示颜色
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -340,142 +340,188 @@ class SkinStyle extends defaultStyle {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this[deviceType.Train] = {
|
this[deviceType.Train] = {
|
||||||
/** 车身line宽 */
|
trainBody: {
|
||||||
trainBodyLineWidth: 0.1,
|
trainBodyLineWidth: 1, // 车身line宽
|
||||||
/** 车身鼠标悬浮事件 */
|
trainBodyOnMouseOver: {
|
||||||
trainBodyOnMouseOver: {train: true, textTrainNumber: false, textTrainServer: false, textTrainTarget: false, textTrainTargetNumber: false},
|
train: true,
|
||||||
/** 车身鼠标移出事件 */
|
textTrainNumber: false,
|
||||||
trainBodyOnMouseOut: {train: true, textTrainNumber: false, textTrainServer: false, textTrainTarget: false, textTrainTargetNumber: false},
|
textTrainServer: false,
|
||||||
/** 服务号(表号)前缀 */
|
textTrainTarget: false,
|
||||||
serviceNumberPrefix: '00',
|
textTrainTargetNumber: false
|
||||||
/** 默认服务号(表号) */
|
}, // 车身鼠标悬浮事件
|
||||||
defaultServiceNumber: 'AA',
|
trainBodyOnMouseOut: {
|
||||||
/** 车次号前缀 */
|
train: true,
|
||||||
tripNumberPrefix: '000',
|
textTrainNumber: false,
|
||||||
/** 默认车次号2 */
|
textTrainServer: false,
|
||||||
defaultTripNumber: 'DDD',
|
textTrainTarget: false,
|
||||||
/** 列车车头比车身高出的长度,上下相比车体伸出去的边框*/
|
textTrainTargetNumber: false
|
||||||
trainMoreLength: 0,
|
}, // 车身鼠标移出事件
|
||||||
/** 列车车头三角坐标1偏移量 */
|
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||||
trainHeadTriangleFirst: { x: 7, y: 1},
|
specialTrainType: [], // 特殊列车类型需设置显示格式
|
||||||
/** 列车车头三角坐标2偏移量 */
|
lrPadding: 4, // 两边间隔
|
||||||
trainHeadTriangleSecond: { x: 13, y: 10},
|
upPadding: 4, // 上边距离
|
||||||
/** 列车车头三角坐标3偏移量 */
|
trainBodyFillColor: '#000099', // 列车车身填充颜色
|
||||||
trainHeadTriangleThird: { x: 7, y: 19},
|
trainNameFormat: 'serviceNumber:targetCode'// 列车显示格式
|
||||||
/** 列车高度*/
|
},
|
||||||
trainHeight: 20,
|
hsda: {
|
||||||
/** 列车和车头之间的间距*/
|
lrPaddingHSDA: 3, // HSDA两边间隔
|
||||||
trainHeadDistance: 4,
|
upPaddingHSDA: 4, // HSDA上边距离
|
||||||
/** 列车车头矩形高度 */
|
trainHSDATextFontSize: 9, // 列车HDSA字号
|
||||||
trainHeadRectHeight: 20,
|
textHContent: '扣', // textH文本
|
||||||
/** 列车长度*/
|
textSContent: '跳', // textS文本
|
||||||
trainWidth: 40,
|
textDContent: '门', // textD文本
|
||||||
/** 列车竖杠的宽度*/
|
textAContent: '警' // textA文本
|
||||||
trainConntWidth: 3,
|
},
|
||||||
/** 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 */
|
trainNumber: {
|
||||||
changeTrainWidth: false,
|
targetCodePrefix: '000', // 目的地码前缀
|
||||||
/** 是否根据nameFormat去动态加载车组号、服务号、车次号、目的地码 */
|
defaultTargetCode: 'DDD', // 默认目的地码
|
||||||
dynamicLoadingDisplay: false,
|
trainTargetTextAlign: 'left', // 目的地码文字显示位置
|
||||||
/** 特殊列车类型需设置显示格式 */
|
trainNumberOffset: { x: 24, y: 4}// 目的地码偏移量
|
||||||
specialTrainType: [],
|
},
|
||||||
/** 两边间隔 */
|
trainServer: {
|
||||||
lrPadding: 4,
|
serviceNumberPrefix: '000', // 服务号(表号)前缀
|
||||||
/** 上边距离 */
|
defaultServiceNumber: 'TTT', // 默认服务号(表号)
|
||||||
upPadding: 4,
|
defaultServerNoColor: '#FFFFFF', // 默认服务号状态显示颜色
|
||||||
/** HSDA两边间隔 */
|
trainServerOffset: { x: 4, y: 4} // 列车服务号偏移
|
||||||
lrPaddingHSDA: 3,
|
},
|
||||||
/** HSDA上边距离 */
|
trainTarget: {
|
||||||
upPaddingHSDA: 4,
|
tripNumberPrefix: '000', // 车次号前缀
|
||||||
/** 列车字号*/
|
defaultTripNumber: 'DDD', // 默认车次号2
|
||||||
trainTextFontSize: 11,
|
trainTargetOffset: { x: 36, y: 4}, // 列车车次号偏移
|
||||||
/** 目的地状态 01准点 02早点 03晚点 04头码车 */
|
trainTargetTextAlign: 'right' // 车次号文字显示位置
|
||||||
destinationStatus: [
|
},
|
||||||
{status: '01', showColor: '#FFFFFF'},
|
trainTargetNumber: {
|
||||||
{status: '02', showColor: '#00FF00'},
|
trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量
|
||||||
{status: '03', showColor: '#A0522D'},
|
},
|
||||||
{status: '04', showColor: '#FFFF00'}
|
trainHead: {
|
||||||
],
|
trainMoreLength: 0, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||||
/** 默认目的地状态显示颜色 */
|
trainHeadTriangleFirst: { x: 7, y: 1}, // 列车车头三角坐标1偏移量
|
||||||
defaultDestinationColor: '#FFFFFF',
|
trainHeadTriangleSecond: { x: 13, y: 10}, // 列车车头三角坐标2偏移量
|
||||||
/** 目的地状态设置的对应哪个text的颜色 */
|
trainHeadTriangleThird: { x: 7, y: 19}, // 列车车头三角坐标3偏移量
|
||||||
destinationStatusSetText: 'trainTarget',
|
trainConntWidth: 3, // 列车竖杠的宽度
|
||||||
/** 默认字体 族类*/
|
trainHeadFillColor: '#000000', // 列车车头矩形填充颜色
|
||||||
textFontFormat: 'consolas',
|
trainHeadRectHeight: 20 // 列车车头矩形高度
|
||||||
/** 列车HDSA字号*/
|
},
|
||||||
trainHSDATextFontSize: 9,
|
common: {
|
||||||
/** 服务号状态类型 01显示服务号 计划车 02显示车组号: 头码车与人工车 */
|
trainHeight: 20, // 列车高度
|
||||||
serverNoType: [
|
trainHeadDistance: 4, // 列车和车头之间的间距
|
||||||
{type: '01', showColor: '#FFFFFF'},
|
trainWidth: 48, // 列车长度
|
||||||
{type: '02', showColor: '#FFF000'}
|
trainTextFontSize: 12, // 列车字号
|
||||||
],
|
textFontFormat: 'consolas', // 默认字体 族类
|
||||||
/** 默认服务号状态显示颜色 */
|
haveTextHSDA: true, // 是否需创建textHSDA对象
|
||||||
defaultServerNoColor: '#FFFFFF',
|
haveArrowText: true, // 是否需创建arrowText对象
|
||||||
/** 列车运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行*/
|
haveTrainBorder: false // 是否需创建trainBorder对象
|
||||||
directionType: [
|
},
|
||||||
{type: '01', lineLShow: true, lineRShow: true, arrowLShow: false, arrowRShow: false },
|
trainStatusStyle: {
|
||||||
{type: '02', lineLShow: false, lineRShow: true, arrowLShow: false, arrowRShow: true },
|
defaultDestinationColor: '#FFFFFF', // 默认目的地状态显示颜色
|
||||||
{type: '03', lineLShow: true, lineRShow: false, arrowLShow: true, arrowRShow: false }
|
destinationStatusSetText: 'trainTarget', // 目的地状态设置的对应哪个text的颜色
|
||||||
],
|
destinationStatus: [
|
||||||
/** 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行 */
|
{status: '01', showColor: '#FFFFFF'},
|
||||||
directionStopType: [
|
{status: '02', showColor: '#00FF00'},
|
||||||
{type: '01', lineLShow: false, lineRShow: false},
|
{status: '03', showColor: '#A0522D'},
|
||||||
{type: '02', lineLShow: false, lineRShow: true},
|
{status: '04', showColor: '#FFFF00'}
|
||||||
{type: '03', lineLShow: true, lineRShow: false}
|
], // 目的地状态 01准点 02早点 03晚点 04头码车
|
||||||
],
|
serverNoType: [
|
||||||
/** 列车运行模式对应车头颜色 01未知 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM
|
{type: '01', showColor: '#FFFFFF'},
|
||||||
* 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM*/
|
{type: '02', showColor: '#FFF000'}
|
||||||
runModeStatus: [
|
], // 服务号状态类型 01显示服务号 计划车 02显示车组号: 头码车与人工车
|
||||||
{status: '01', trainLColor: '#FFFFFF', trainRColor: '#FFFFFF'},
|
directionType: [
|
||||||
{status: '02', trainLColor: '#00FF00', trainRColor: '#00FF00'},
|
{
|
||||||
{status: '03', trainLColor: '#FFFF00', trainRColor: '#FFFF00'},
|
type: '01',
|
||||||
{status: '04', trainLColor: '#A0522D', trainRColor: '#A0522D'},
|
lineLShow: true,
|
||||||
{status: '05', trainLColor: '#A0522D', trainRColor: '#A0522D'}
|
lineRShow: true,
|
||||||
],
|
arrowLShow: false,
|
||||||
/** 设置运行控制状态类型 01正常 02扣车 03停跳 */
|
arrowRShow: false
|
||||||
runControlStatus: [
|
},
|
||||||
{status: '01', hShow: false, sShow: false},
|
{
|
||||||
{status: '02', hShow: true, sShow: false},
|
type: '02',
|
||||||
{status: '03', hShow: false, sShow: true}
|
lineLShow: false,
|
||||||
],
|
lineRShow: true,
|
||||||
/** 设置车门状态类型 01关门 02开门 */
|
arrowLShow: false,
|
||||||
doorStatus: [
|
arrowRShow: true
|
||||||
{status: '01', dShow: false},
|
},
|
||||||
{status: '02', dShow: true}
|
{
|
||||||
],
|
type: '03',
|
||||||
/** 设置通信状态 01正常 02故障 */
|
lineLShow: true,
|
||||||
communicationStatus: [
|
lineRShow: false,
|
||||||
{status: '01', trainColor: '#725A64'},
|
arrowLShow: true,
|
||||||
{status: '02', trainColor: '#C0C0C0'}
|
arrowRShow: false
|
||||||
],
|
}
|
||||||
/** 设置报警状态 01不报警 02报警 */
|
], // 列车运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
|
||||||
alarmStatus: [
|
directionStopType: [
|
||||||
{status: '01', aShow: false},
|
{
|
||||||
{status: '02', aShow: true}
|
type: '01',
|
||||||
],
|
lineLShow: false,
|
||||||
/** 列车车头矩形填充颜色 */
|
lineRShow: false
|
||||||
trainHeadFillColor: '#000000',
|
},
|
||||||
/** 列车车身填充颜色 */
|
{
|
||||||
trainBodyFillColor: '#725A64',
|
type: '02',
|
||||||
/** textH文本 */
|
lineLShow: false,
|
||||||
textHContent: 'H',
|
lineRShow: true
|
||||||
/** textS文本 */
|
},
|
||||||
textSContent: 'S',
|
{
|
||||||
/** textD文本 */
|
type: '03',
|
||||||
textDContent: 'D',
|
lineLShow: true,
|
||||||
/** textA文本 */
|
lineRShow: false
|
||||||
textAContent: 'A',
|
}
|
||||||
/** 是否需创建textHSDA对象 */
|
], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
|
||||||
haveTextHSDA: true,
|
runModeStatus: [
|
||||||
/** 是否需创建arrowText对象 */
|
{
|
||||||
haveArrowText: true,
|
status: '01',
|
||||||
/** 是否需创建trainBorder对象 */
|
trainLColor: '#FFFFFF',
|
||||||
haveTrainBorder: false,
|
trainRColor: '#FFFFFF'
|
||||||
/** 列车服务号偏移 */
|
},
|
||||||
trainServerOffset: { x: 4, y: 4},
|
{
|
||||||
/** 列车车次号偏移 */
|
status: '02',
|
||||||
trainTargetOffset: { x: 36, y: 4},
|
trainLColor: '#00FF00',
|
||||||
/** 目的地码文字显示位置 */
|
trainRColor: '#00FF00'
|
||||||
trainTargetTextAlign: 'right'
|
},
|
||||||
|
{
|
||||||
|
status: '03',
|
||||||
|
trainLColor: '#FFFF00',
|
||||||
|
trainRColor: '#FFFF00'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
status: '04',
|
||||||
|
trainLColor: '#A0522D',
|
||||||
|
trainRColor: '#A0522D'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
status: '05',
|
||||||
|
trainLColor: '#A0522D',
|
||||||
|
trainRColor: '#A0522D'
|
||||||
|
}
|
||||||
|
], // 列车运行模式对应车头颜色 01未知 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM
|
||||||
|
runControlStatus: [
|
||||||
|
{
|
||||||
|
status: '01',
|
||||||
|
hShow: false,
|
||||||
|
sShow: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
status: '02',
|
||||||
|
hShow: true,
|
||||||
|
sShow: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
status: '03',
|
||||||
|
hShow: false,
|
||||||
|
sShow: true
|
||||||
|
}
|
||||||
|
], // 设置运行控制状态类型 01正常 02扣车 03停跳
|
||||||
|
doorStatus: [
|
||||||
|
{status: '01', dShow: false},
|
||||||
|
{status: '02', dShow: true}
|
||||||
|
], // 设置车门状态类型 01关门 02开门
|
||||||
|
communicationStatus: [
|
||||||
|
{status: '01', trainColor: '#725A64'},
|
||||||
|
{status: '02', trainColor: '#C0C0C0'}
|
||||||
|
], // 设置通信状态 01正常 02故障
|
||||||
|
alarmStatus: [
|
||||||
|
{status: '01', aShow: false},
|
||||||
|
{status: '02', aShow: true}
|
||||||
|
] // 设置报警状态 01不报警 02报警
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -293,127 +293,152 @@ class SkinStyle extends defaultStyle {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this[deviceType.Train] = {
|
this[deviceType.Train] = {
|
||||||
/** 车身line宽 */
|
trainBody: {
|
||||||
trainBodyLineWidth: 0,
|
trainBodyLineWidth: 0, // 车身line宽
|
||||||
/** 车身鼠标悬浮事件 */
|
trainBodyOnMouseOver: {
|
||||||
trainBodyOnMouseOver: {train: true, textTrainNumber: false, textTrainServer: false, textTrainTarget: false, textTrainTargetNumber: false},
|
train: true,
|
||||||
/** 车身鼠标移出事件 */
|
textTrainNumber: false,
|
||||||
trainBodyOnMouseOut: {train: true, textTrainNumber: false, textTrainServer: false, textTrainTarget: false, textTrainTargetNumber: false},
|
textTrainServer: false,
|
||||||
/** 目的地码前缀*/
|
textTrainTarget: false,
|
||||||
targetCodePrefix: '000',
|
textTrainTargetNumber: false
|
||||||
/** 默认目的地码 */
|
}, // 车身鼠标悬浮事件
|
||||||
defaultTargetCode: 'AAA',
|
trainBodyOnMouseOut: {
|
||||||
/** 服务号(表号)前缀 */
|
train: true,
|
||||||
serviceNumberPrefix: '00',
|
textTrainNumber: false,
|
||||||
/** 默认服务号(表号) */
|
textTrainServer: false,
|
||||||
defaultServiceNumber: 'BB',
|
textTrainTarget: false,
|
||||||
/** 车次号前缀 */
|
textTrainTargetNumber: false
|
||||||
tripNumberPrefix: '0000',
|
}, // 车身鼠标移出事件
|
||||||
/** 默认车次号1 */
|
changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||||
defaultDirectionCode: 'D',
|
specialTrainType: [
|
||||||
/** 默认车次号2 */
|
{
|
||||||
defaultTripNumber: 'CCC',
|
type: '03',
|
||||||
/** 车组号前缀 */
|
serviceNumber: 'MM',
|
||||||
groupNumberPrefix: '000',
|
nameFormat: 'serviceNumber:groupNumber'
|
||||||
/** 默认车组号 */
|
}
|
||||||
defaultGroupNumber: 'EEE',
|
], // 特殊列车类型需设置显示格式
|
||||||
/** 列车车头比车身高出的长度,上下相比车体伸出去的边框*/
|
lrPadding: 1, // 两边间隔
|
||||||
trainMoreLength: 1,
|
upPadding: 1, // 上边距离
|
||||||
/** 列车车头三角坐标1偏移量 */
|
trainBodyFillColor: '#000000', // 列车车身填充颜色
|
||||||
trainHeadTriangleFirst: { x: 0, y: 0},
|
trainNameFormat: 'targetCode:serviceNumber:tripNumber'// 列车显示格式
|
||||||
/** 列车车头三角坐标2偏移量 */
|
},
|
||||||
trainHeadTriangleSecond: { x: 4, y: 8.5},
|
hsda: {
|
||||||
/** 列车车头三角坐标3偏移量 */
|
trainHSDATextFontSize: 8// 列车HDSA字号
|
||||||
trainHeadTriangleThird: { x: 0, y: 15},
|
},
|
||||||
/** 列车高度*/
|
trainNumber: {
|
||||||
trainHeight: 17,
|
targetCodePrefix: '000', // 目的地码前缀
|
||||||
/** 列车和车头之间的间距*/
|
defaultTargetCode: 'AAA', // 默认目的地码
|
||||||
trainHeadDistance: 2,
|
trainTargetTextAlign: 'left', // 车次号文字显示位置
|
||||||
/** 列车车头矩形高度 */
|
trainNumberOffset: { x: 0, y: 1}// 目的地码偏移量
|
||||||
trainHeadRectHeight: 15,
|
},
|
||||||
/** 列车长度*/
|
trainServer: {
|
||||||
trainWidth: 76,
|
serviceNumberPrefix: '00', // 服务号(表号)前缀
|
||||||
/** 列车竖杠的宽度*/
|
defaultServiceNumber: 'BB', // 默认服务号(表号)
|
||||||
trainConntWidth: 4,
|
trainServerOffset: { x: 16, y: 1}// 列车服务号偏移
|
||||||
/** 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度 */
|
},
|
||||||
changeTrainWidth: true,
|
trainTarget: {
|
||||||
/** 是否根据nameFormat去动态加载车组号、服务号、车次号、目的地码 */
|
tripNumberPrefix: '0000', // 车次号前缀
|
||||||
dynamicLoadingDisplay: true,
|
defaultDirectionCode: 'D', // 默认车次号1
|
||||||
/** 特殊列车类型需设置显示格式 */
|
defaultTripNumber: 'CCC', // 默认车次号2
|
||||||
specialTrainType: [{ type: '03', serviceNumber: 'MM', nameFormat: 'serviceNumber:groupNumber'}],
|
trainTargetOffset: { x: 26, y: 1}// 列车车次号偏移
|
||||||
/** 两边间隔 */
|
},
|
||||||
lrPadding: 1,
|
trainTargetNumber: {
|
||||||
/** 上边距离 */
|
groupNumberPrefix: '000', // 车组号前缀
|
||||||
upPadding: 1,
|
defaultGroupNumber: 'EEE', // 默认车组号
|
||||||
/** 列车字号*/
|
trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量
|
||||||
trainTextFontSize: 15,
|
},
|
||||||
/** 目的地状态 01准点 02早点 03严重早点 04晚点 05严重晚点 06头码车 07ATP切除 */
|
trainHead: {
|
||||||
destinationStatus: [
|
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
|
||||||
{status: '01', showColor: '#FFFFFF'},
|
trainHeadTriangleFirst: { x: 0, y: 0}, // 列车车头三角坐标1偏移量
|
||||||
{status: '02', showColor: '#00FF00'},
|
trainHeadTriangleSecond: { x: 4, y: 8.5}, // 列车车头三角坐标2偏移量
|
||||||
{status: '03', showColor: '#3265FF'},
|
trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量
|
||||||
{status: '04', showColor: '#9B4A09'},
|
trainHeadRectHeight: 15, // 列车车头矩形高度
|
||||||
{status: '05', showColor: '#EF0C08'},
|
trainConntWidth: 4, // 列车竖杠的宽度
|
||||||
{status: '06', showColor: '#FFFFFF'},
|
trainHeadFillColor: '#EF0C08'// 列车车头矩形填充颜色
|
||||||
{status: '07', showColor: '#FFFF00'}
|
},
|
||||||
],
|
common: {
|
||||||
/** 目的地状态设置的对应哪个text的颜色 */
|
trainHeight: 17, // 列车高度
|
||||||
destinationStatusSetText: 'trainServer',
|
trainHeadDistance: 2, // 列车和车头之间的间距
|
||||||
/** 默认字体 族类*/
|
trainWidth: 76, // 列车长度
|
||||||
textFontFormat: '宋体',
|
trainTextFontSize: 15, // 列车字号
|
||||||
/** 列车HDSA字号*/
|
textFontFormat: '宋体', // 默认字体 族类
|
||||||
trainHSDATextFontSize: 8,
|
nameFontSize: 10, // 字体大小
|
||||||
/** 服务号状态类型 eg:{type: '01', showColor: '#FFFFFF'} */
|
haveTextHSDA: false, // 是否需创建textHSDA对象
|
||||||
serverNoType: [],
|
haveArrowText: true, // 是否需创建arrowText对象
|
||||||
/** 运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行*/
|
haveTrainBorder: false// 是否需创建trainBorder对象
|
||||||
directionType: [
|
},
|
||||||
{type: '01', lineLShow: false, lineRShow: false, arrowLShow: false, arrowRShow: false },
|
trainStatusStyle: {
|
||||||
{type: '02', lineLShow: false, lineRShow: false, arrowLShow: false, arrowRShow: true },
|
destinationStatus: [
|
||||||
{type: '03', lineLShow: false, lineRShow: false, arrowLShow: true, arrowRShow: false }
|
{status: '01', showColor: '#FFFFFF'},
|
||||||
],
|
{status: '02', showColor: '#00FF00'},
|
||||||
/** 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行 */
|
{status: '03', showColor: '#3265FF'},
|
||||||
directionStopType: [
|
{status: '04', showColor: '#9B4A09'},
|
||||||
{type: '01', lineLShow: false, lineRShow: false},
|
{status: '05', showColor: '#EF0C08'},
|
||||||
{type: '02', lineLShow: false, lineRShow: true},
|
{status: '06', showColor: '#FFFFFF'},
|
||||||
{type: '03', lineLShow: true, lineRShow: false}
|
{status: '07', showColor: '#FFFF00'}
|
||||||
],
|
], // 目的地状态 01准点 02早点 03严重早点 04晚点 05严重晚点 06头码车 07ATP切除
|
||||||
/** 列车运行模式对应车头颜色 01信号中断 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM
|
destinationStatusSetText: 'trainServer', // 目的地状态设置的对应哪个text的颜色
|
||||||
* 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM*/
|
directionType: [
|
||||||
runModeStatus: [
|
{
|
||||||
{status: '01', trainLColor: '#EF0C08', trainRColor: '#EF0C08'},
|
type: '01',
|
||||||
{status: '02', trainLColor: '#00FF00', trainRColor: '#00FF00'},
|
lineLShow: false,
|
||||||
{status: '03', trainLColor: '#FFFF00', trainRColor: '#FFFF00'},
|
lineRShow: false,
|
||||||
{status: '04', trainLColor: '#EA700D', trainRColor: '#EA700D'},
|
arrowLShow: false,
|
||||||
{status: '05', trainLColor: '#A0522D', trainRColor: '#A0522D'}
|
arrowRShow: false
|
||||||
],
|
},
|
||||||
/** 设置运行控制状态类型 eg:{status: '01', hShow: false, sShow: false}, */
|
{
|
||||||
runControlStatus: [],
|
type: '02',
|
||||||
/** 设置车门状态类型 eg:{status: '01', dShow: false}, */
|
lineLShow: false,
|
||||||
doorStatus: [],
|
lineRShow: false,
|
||||||
/** 设置通信状态 eg:{status: '01', trainColor:'#725A64'}, */
|
arrowLShow: false,
|
||||||
communicationStatus: [],
|
arrowRShow: true
|
||||||
/** 设置报警状态 eg:{status: '01', aShow: false}, */
|
},
|
||||||
alarmStatus: [],
|
{
|
||||||
/** 列车车头矩形填充颜色 */
|
type: '03',
|
||||||
trainHeadFillColor: '#EF0C08',
|
lineLShow: false,
|
||||||
/** 列车车身填充颜色 */
|
lineRShow: false,
|
||||||
trainBodyFillColor: '#000000',
|
arrowLShow: true,
|
||||||
/** 列车服务号偏移 */
|
arrowRShow: false
|
||||||
trainServerOffset: { x: -1, y: 1},
|
}
|
||||||
/** 列车车次号偏移 */
|
], // 运行方向状态类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
|
||||||
trainTargetOffset: { x: -1, y: 1},
|
directionStopType: [
|
||||||
/** 列车显示格式 */
|
{type: '01', lineLShow: false, lineRShow: false},
|
||||||
trainNameFormat: 'targetCode:serviceNumber:tripNumber',
|
{type: '02', lineLShow: false, lineRShow: true},
|
||||||
/** 字体大小 */
|
{type: '03', lineLShow: true, lineRShow: false}
|
||||||
nameFontSize: 10,
|
], // 列车停止方向类型对应车头显示状态 01未知方向 02从左往右 上行 03从右往左 下行
|
||||||
/** 目的地码文字显示位置 */
|
runModeStatus: [
|
||||||
trainTargetTextAlign: 'left',
|
{
|
||||||
/** 是否需创建textHSDA对象 */
|
status: '01',
|
||||||
haveTextHSDA: false,
|
trainLColor: '#EF0C08',
|
||||||
/** 是否需创建arrowText对象 */
|
trainRColor: '#EF0C08'
|
||||||
haveArrowText: true,
|
},
|
||||||
/** 是否需创建trainBorder对象 */
|
{
|
||||||
haveTrainBorder: false
|
status: '02',
|
||||||
|
trainLColor: '#00FF00',
|
||||||
|
trainRColor: '#00FF00'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
status: '03',
|
||||||
|
trainLColor: '#FFFF00',
|
||||||
|
trainRColor: '#FFFF00'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
status: '04',
|
||||||
|
trainLColor: '#EA700D',
|
||||||
|
trainRColor: '#EA700D'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
status: '05',
|
||||||
|
trainLColor: '#A0522D',
|
||||||
|
trainRColor: '#A0522D'
|
||||||
|
}
|
||||||
|
], // 列车运行模式对应车头颜色 01信号中断 02 ATO自动驾驶模式AM 03 ATP监控下的人工驾驶模式CM 04 限制人工驾驶模式RM 05 非限制人工驾驶模式RM
|
||||||
|
runControlStatus: [], // 设置运行控制状态类型 eg:{status: '01', hShow: false, sShow: false}
|
||||||
|
doorStatus: [], // 设置车门状态类型 eg:{status: '01', dShow: false}
|
||||||
|
communicationStatus: [], // 设置通信状态 eg:{status: '01', trainColor:'#725A64'}
|
||||||
|
alarmStatus: [], // 设置报警状态 eg:{status: '01', aShow: false}
|
||||||
|
serverNoType: []// 服务号状态类型 eg:{type: '01', showColor: '#FFFFFF'}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,9 +12,9 @@ export default class TextTrainServer extends Group {
|
|||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z+1,
|
z: this.model.z+1,
|
||||||
style: {
|
style: {
|
||||||
x: parseInt(this.model.point.x + this.model.style.Train.trainServerOffset.y),
|
x: parseInt(this.model.point.x + this.model.style.Train.trainServer.trainServerOffset.x),
|
||||||
y: parseInt(this.model.point.y + this.model.style.Train.trainServerOffset.y),
|
y: parseInt(this.model.point.y + this.model.style.Train.trainServer.trainServerOffset.y),
|
||||||
text: this.model.serviceNumber.substring(this.model.serviceNumber.length - 2),
|
text: this.model.serviceNumber.substring(this.model.serviceNumber.length - this.model.style.Train.trainServer.serviceNumberPrefix.length),
|
||||||
textFill: this.model.trainBrownColor,
|
textFill: this.model.trainBrownColor,
|
||||||
textFont: this.model.textFont,
|
textFont: this.model.textFont,
|
||||||
textAlign: 'left',
|
textAlign: 'left',
|
||||||
|
@ -12,12 +12,12 @@ export default class TextTrainTarget extends Group {
|
|||||||
zlevel: this.model.zlevel,
|
zlevel: this.model.zlevel,
|
||||||
z: this.model.z+1,
|
z: this.model.z+1,
|
||||||
style: {
|
style: {
|
||||||
x: parseInt(this.model.point.x + this.model.style.Train.trainTargetOffset.x),
|
x: parseInt(this.model.point.x + this.model.style.Train.trainTarget.trainTargetOffset.x),
|
||||||
y: parseInt(this.model.point.y + this.model.style.Train.trainTargetOffset.y),
|
y: parseInt(this.model.point.y + this.model.style.Train.trainTarget.trainTargetOffset.y),
|
||||||
text: this.model.tripNumber.substring(this.model.tripNumber.length - 3),
|
text: this.model.tripNumber.substring(this.model.tripNumber.length - 3),
|
||||||
textFill: this.model.trainYellowColor,
|
textFill: this.model.trainYellowColor,
|
||||||
textFont: this.model.textFont,
|
textFont: this.model.textFont,
|
||||||
textAlign: this.model.style.Train.trainTargetTextAlign,
|
textAlign: this.model.style.Train.trainTarget.trainTargetTextAlign,
|
||||||
textVerticalAlign: 'top',
|
textVerticalAlign: 'top',
|
||||||
onmouseover: this.model.onmouseover,
|
onmouseover: this.model.onmouseover,
|
||||||
onmouseout: this.model.onmouseout
|
onmouseout: this.model.onmouseout
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import Group from 'zrender/src/container/Group';
|
import Group from 'zrender/src/container/Group';
|
||||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||||
import store from '@/store';
|
|
||||||
|
|
||||||
export default class Train extends Group {
|
export default class Train extends Group {
|
||||||
constructor(model) {
|
constructor(model) {
|
||||||
|
@ -18,8 +18,8 @@ export default class TrainBody extends Group {
|
|||||||
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.common.textFontFormat;
|
||||||
const TextFontHSDA = style.Train.trainHSDATextFontSize + 'px ' + style.Train.textFontFormat;
|
const TextFontHSDA = style.Train.hsda.trainHSDATextFontSize + 'px ' + style.Train.common.textFontFormat;
|
||||||
|
|
||||||
let destinationText = '';
|
let destinationText = '';
|
||||||
switch (model.destinationStatus) {
|
switch (model.destinationStatus) {
|
||||||
@ -31,7 +31,7 @@ export default class TrainBody extends Group {
|
|||||||
default: destinationText = '未知'; break;
|
default: destinationText = '未知'; break;
|
||||||
}
|
}
|
||||||
const textContain = `列车类型: 计划车\n表\0\0\0\0号: ${model.serviceNumber}\n车\0次\0号: ${model.tripNumber}\n目的地号: ${model.targetCode ? model.targetCode : ''}\n车\0组\0号: ${model.groupNumber}\n早\0晚\0点: ${destinationText}\n运行方向: ${model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${model.sectionModel ? model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${model.runControlStatus == '01' ? '正常' : model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${model.speed || 0} km/h\n列车移动授权距离: ${model.maLen || 0} m`;
|
const textContain = `列车类型: 计划车\n表\0\0\0\0号: ${model.serviceNumber}\n车\0次\0号: ${model.tripNumber}\n目的地号: ${model.targetCode ? model.targetCode : ''}\n车\0组\0号: ${model.groupNumber}\n早\0晚\0点: ${destinationText}\n运行方向: ${model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${model.sectionModel ? model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${model.runControlStatus == '01' ? '正常' : model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${model.speed || 0} km/h\n列车移动授权距离: ${model.maLen || 0} m`;
|
||||||
this.arrowText = style.Train.haveArrowText ? new ArrowText({
|
this.arrowText = style.Train.common.haveArrowText ? new ArrowText({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: model.z,
|
||||||
x: model.point.x+50,
|
x: model.point.x+50,
|
||||||
@ -49,24 +49,24 @@ export default class TrainBody extends Group {
|
|||||||
shape: {
|
shape: {
|
||||||
x: model.point.x,
|
x: model.point.x,
|
||||||
y: model.point.y,
|
y: model.point.y,
|
||||||
width: style.Train.trainWidth,
|
width: style.Train.common.trainWidth,
|
||||||
height: style.Train.trainHeight
|
height: style.Train.common.trainHeight
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: style.Train.trainBodyLineWidth,
|
lineWidth: style.Train.trainBody.trainBodyLineWidth,
|
||||||
stroke: style.trainSidelineColor,
|
stroke: style.trainSidelineColor,
|
||||||
fill: style.Train.trainBodyFillColor
|
fill: style.Train.trainBody.trainBodyFillColor
|
||||||
},
|
},
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
arrowText: this.arrowText,
|
arrowText: this.arrowText,
|
||||||
onmouseover: () => { style.Train.trainBodyOnMouseOver.train?this.arrowText.getArrowText().show():''; },
|
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.train?this.arrowText.getArrowText().show():''; },
|
||||||
onmouseout: () => { style.Train.trainBodyOnMouseOut.train?this.arrowText.getArrowText().hide():''; }
|
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.train?this.arrowText.getArrowText().hide():''; }
|
||||||
});
|
});
|
||||||
|
|
||||||
const beginX = (model.point.x + style.Train.lrPadding);
|
const beginX = (model.point.x + style.Train.trainBody.lrPadding);
|
||||||
const beginY = (model.point.y - style.Train.trainHSDATextFontSize - style.Train.upPaddingHSDA);
|
const beginY = (model.point.y - style.Train.hsda.trainHSDATextFontSize - style.Train.hsda.upPaddingHSDA);
|
||||||
const margin = (style.Train.trainWidth - style.Train.lrPaddingHSDA * 2) / 4;
|
const margin = (style.Train.common.trainWidth - style.Train.hsda.lrPaddingHSDA * 2) / 4;
|
||||||
this.textHSDA = style.Train.haveTextHSDA ? new TextHSDA({
|
this.textHSDA = style.Train.common.haveTextHSDA ? new TextHSDA({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: model.z,
|
||||||
beginX: beginX,
|
beginX: beginX,
|
||||||
@ -79,12 +79,12 @@ export default class TrainBody extends Group {
|
|||||||
textVerticalAlign: 'top'
|
textVerticalAlign: 'top'
|
||||||
}) : '';
|
}) : '';
|
||||||
|
|
||||||
let serviceNumber = style.Train.serviceNumberPrefix + (model.serviceNumber || style.Train.defaultServiceNumber) + '';// 服务号(表号)
|
let serviceNumber = style.Train.trainServer.serviceNumberPrefix + (model.serviceNumber || style.Train.trainServer.defaultServiceNumber) + '';// 服务号(表号)
|
||||||
const tripNumber = style.Train.tripNumberPrefix + (style.Train.defaultDirectionCode
|
const tripNumber = style.Train.trainTarget.tripNumberPrefix + (style.Train.trainTarget.defaultDirectionCode
|
||||||
?(model.directionCode||style.Train.defaultDirectionCode) + (model.tripNumber || style.Train.defaultTripNumber)
|
?(model.directionCode||style.Train.trainTarget.defaultDirectionCode) + (model.tripNumber || style.Train.trainTarget.defaultTripNumber)
|
||||||
:model.tripNumber || style.Train.defaultTripNumber) + ''; // 车次号
|
:model.tripNumber || style.Train.trainTarget.defaultTripNumber) + ''; // 车次号
|
||||||
const targetCode = style.Train.targetCodePrefix + (model.targetCode || style.Train.defaultTargetCode) + ''; // 目的地码
|
const targetCode = style.Train.trainNumber.targetCodePrefix + (model.targetCode || style.Train.trainNumber.defaultTargetCode) + ''; // 目的地码
|
||||||
const groupNumber = style.Train.groupNumberPrefix + (model.groupNumber || style.Train.defaultGroupNumber) + ''; // 车组号
|
const groupNumber = style.Train.trainTargetNumber.groupNumberPrefix + (model.groupNumber || style.Train.trainTargetNumber.defaultGroupNumber) + ''; // 车组号
|
||||||
|
|
||||||
this.textTrainServer = new TextTrainServer({
|
this.textTrainServer = new TextTrainServer({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
@ -94,34 +94,34 @@ export default class TrainBody extends Group {
|
|||||||
serviceNumber: serviceNumber,
|
serviceNumber: serviceNumber,
|
||||||
trainBrownColor: style.trainTextColor,
|
trainBrownColor: style.trainTextColor,
|
||||||
textFont: textFont,
|
textFont: textFont,
|
||||||
onmouseover: () => { style.Train.trainBodyOnMouseOver.textTrainServer?this.arrowText.getArrowText().show():''; },
|
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.textTrainServer?this.arrowText.getArrowText().show():''; },
|
||||||
onmouseout: () => { style.Train.trainBodyOnMouseOut.textTrainServer?this.arrowText.getArrowText().hide():''; }
|
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.textTrainServer?this.arrowText.getArrowText().hide():''; }
|
||||||
});
|
});
|
||||||
|
|
||||||
this.textTrainTarget = new TextTrainTarget({
|
this.textTrainTarget = new TextTrainTarget({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: model.z,
|
||||||
point: model.point,
|
point: model.point,
|
||||||
trainWidth: model.style.Train.trainWidth,
|
trainWidth: model.style.Train.common.trainWidth,
|
||||||
style: style,
|
style: style,
|
||||||
tripNumber: tripNumber,
|
tripNumber: tripNumber,
|
||||||
trainYellowColor: style.trainTextColor,
|
trainYellowColor: style.trainTextColor,
|
||||||
textFont: textFont,
|
textFont: textFont,
|
||||||
onmouseover: () => { style.Train.trainBodyOnMouseOver.textTrainTarget?this.arrowText.getArrowText().show():''; },
|
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.textTrainTarget?this.arrowText.getArrowText().show():''; },
|
||||||
onmouseout: () => { style.Train.trainBodyOnMouseOut.textTrainTarget?this.arrowText.getArrowText().hide():''; }
|
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.textTrainTarget?this.arrowText.getArrowText().hide():''; }
|
||||||
});
|
});
|
||||||
|
|
||||||
this.textTrainNumber = new TextTrainNumber({
|
this.textTrainNumber = new TextTrainNumber({
|
||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: model.z,
|
||||||
point: model.point,
|
point: model.point,
|
||||||
lrPadding: style.Train.lrPadding,
|
lrPadding: style.Train.trainBody.lrPadding,
|
||||||
upPadding: style.Train.upPadding,
|
upPadding: style.Train.trainBody.upPadding,
|
||||||
targetCode: targetCode,
|
targetCode: targetCode,
|
||||||
trainTextColor: style.trainTextColor,
|
trainTextColor: style.trainTextColor,
|
||||||
textFont: textFont,
|
textFont: textFont,
|
||||||
onmouseover: () => { style.Train.trainBodyOnMouseOver.textTrainNumber?this.arrowText.getArrowText().show():''; },
|
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.textTrainNumber?this.arrowText.getArrowText().show():''; },
|
||||||
onmouseout: () => { style.Train.trainBodyOnMouseOut.textTrainNumber?this.arrowText.getArrowText().hide():''; }
|
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.textTrainNumber?this.arrowText.getArrowText().hide():''; }
|
||||||
});
|
});
|
||||||
|
|
||||||
this.textTrainTargetNumber = new TextTrainTargetNumber({
|
this.textTrainTargetNumber = new TextTrainTargetNumber({
|
||||||
@ -133,29 +133,23 @@ export default class TrainBody extends Group {
|
|||||||
groupNumber: groupNumber,
|
groupNumber: groupNumber,
|
||||||
trainTextColor: style.trainTextColor,
|
trainTextColor: style.trainTextColor,
|
||||||
textFont: textFont,
|
textFont: textFont,
|
||||||
onmouseover: () => { style.Train.trainBodyOnMouseOver.textTrainTargetNumber?this.arrowText.getArrowText().show():''; },
|
onmouseover: () => { style.Train.trainBody.trainBodyOnMouseOver.textTrainTargetNumber?this.arrowText.getArrowText().show():''; },
|
||||||
onmouseout: () => { style.Train.trainBodyOnMouseOut.textTrainTargetNumber?this.arrowText.getArrowText().hide():''; }
|
onmouseout: () => { style.Train.trainBody.trainBodyOnMouseOut.textTrainTargetNumber?this.arrowText.getArrowText().hide():''; }
|
||||||
});
|
});
|
||||||
// 根据列车类型设置显示格式
|
// 根据列车类型设置显示格式
|
||||||
if ( style.Train.specialTrainType.length > 0) {
|
if ( style.Train.trainBody.specialTrainType.length > 0) {
|
||||||
style.Train.specialTrainType.some((item) =>{
|
style.Train.trainBody.specialTrainType.some((item) =>{
|
||||||
if (model.type === item.type) {
|
if (model.type === item.type) {
|
||||||
serviceNumber = item.serviceNumber;
|
serviceNumber = item.serviceNumber;
|
||||||
style.Train.nameFormat = item.nameFormat;
|
style.Train.trainBody.nameFormat = item.nameFormat;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if ( style.Train.dynamicLoadingDisplay ) {
|
this.formatChangePosition(model, style);
|
||||||
this.formatChangePosition(model, style);
|
|
||||||
} else {
|
|
||||||
this.add(this.textTrainServer);
|
|
||||||
this.add(this.textTrainTarget);
|
|
||||||
this.add(this.textHSDA);
|
|
||||||
}
|
|
||||||
this.add(this.train);
|
this.add(this.train);
|
||||||
this.add(this.arrowText);
|
this.add(this.arrowText);
|
||||||
|
this.add(this.textHSDA);
|
||||||
}
|
}
|
||||||
|
|
||||||
removeTrainDetail() {
|
removeTrainDetail() {
|
||||||
@ -190,51 +184,23 @@ export default class TrainBody extends Group {
|
|||||||
this.arrowText.getArrowText().show();
|
this.arrowText.getArrowText().show();
|
||||||
}
|
}
|
||||||
formatChangePosition(model, style) {
|
formatChangePosition(model, style) {
|
||||||
if (style.Train.trainNameFormat) {
|
if (style.Train.trainBody.trainNameFormat) {
|
||||||
const arr = style.Train.trainNameFormat.split(':');
|
const arr = style.Train.trainBody.trainNameFormat.split(':');
|
||||||
arr.forEach(ele => {
|
arr.forEach(ele => {
|
||||||
if (ele == 'targetCode') {
|
if (ele == 'targetCode') {
|
||||||
|
this.textTrainNumber.setShapeStyle('x', parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x));
|
||||||
this.add(this.textTrainNumber);
|
this.add(this.textTrainNumber);
|
||||||
} else if (ele == 'serviceNumber') {
|
} else if (ele == 'serviceNumber') {
|
||||||
const show = arr.includes('targetCode');
|
this.textTrainServer.setShapeStyle('x', parseInt(model.point.x + style.Train.trainServer.trainServerOffset.x));
|
||||||
if (show) {
|
|
||||||
this.textTrainServer.setShapeStyle('x', parseInt(model.point.x + (3 * model.fontSize * (2 / 3)) - 3 - style.Train.lrPadding));
|
|
||||||
}
|
|
||||||
this.add(this.textTrainServer);
|
this.add(this.textTrainServer);
|
||||||
} else if (ele == 'tripNumber') {
|
} else if (ele == 'tripNumber') {
|
||||||
const show = arr.includes('targetCode');
|
this.textTrainTarget.setShapeStyle('x', parseInt(model.point.x + style.Train.trainTarget.trainTargetOffset.x));
|
||||||
const serverNoShow = arr.includes('serviceNumber');
|
|
||||||
if (show) {
|
|
||||||
this.textTrainTarget.setShapeStyle('x', parseInt(model.point.x + (3 * model.fontSize * (2 / 3)) - 3 - style.Train.lrPadding));
|
|
||||||
}
|
|
||||||
if (serverNoShow) {
|
|
||||||
this.textTrainTarget.setShapeStyle('x', parseInt(model.point.x + (2 * model.fontSize * (2 / 3)) - 3 - style.Train.lrPadding));
|
|
||||||
}
|
|
||||||
if (serverNoShow && show) {
|
|
||||||
this.textTrainTarget.setShapeStyle('x', parseInt(model.point.x + (5 * model.fontSize * (2 / 3)) - 6.5 - style.Train.lrPadding));
|
|
||||||
}
|
|
||||||
this.add(this.textTrainTarget);
|
this.add(this.textTrainTarget);
|
||||||
} else if (ele == 'groupNumber') {
|
} else if (ele == 'groupNumber') {
|
||||||
const show = arr.includes('targetCode');
|
this.textTrainTargetNumber.setShapeStyle('x', parseInt(model.point.x + style.Train.textTrainTargetNumber.trainTargetNumberOffset.x));
|
||||||
const serverNoShow = arr.includes('serviceNumber');
|
|
||||||
if (show) {
|
|
||||||
this.textTrainTargetNumber.setShapeStyle('x', parseInt(model.point.x + (3 * model.fontSize * (2 / 3)) - 3 - style.Train.lrPadding));
|
|
||||||
}
|
|
||||||
if (serverNoShow) {
|
|
||||||
this.textTrainTargetNumber.setShapeStyle('x', parseInt(model.point.x + (2 * model.fontSize * (2 / 3)) - 3 - style.Train.lrPadding));
|
|
||||||
}
|
|
||||||
if (serverNoShow && show) {
|
|
||||||
this.textTrainTargetNumber.setShapeStyle('x', parseInt(model.point.x + (5 * model.fontSize * (2 / 3)) - 6.5 - style.Train.lrPadding));
|
|
||||||
}
|
|
||||||
this.add(this.textTrainTargetNumber);
|
this.add(this.textTrainTargetNumber);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
this.textTrainServer.setShapeStyle('x', parseInt(model.point.x + 27 - style.Train.lrPadding));
|
|
||||||
this.textTrainTarget.setShapeStyle('x', parseInt(model.point.x + 43 - style.Train.lrPadding));
|
|
||||||
this.add(this.textTrainServer);
|
|
||||||
this.add(this.textTrainTarget);
|
|
||||||
this.add(this.textTrainNumber);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,15 +17,15 @@ export default class TrainHead extends Group {
|
|||||||
zlevel: model.zlevel,
|
zlevel: model.zlevel,
|
||||||
z: model.z,
|
z: model.z,
|
||||||
shape: {
|
shape: {
|
||||||
x: model.point.x - baseMargin * (style.trainConntWidth),
|
x: model.point.x - baseMargin * (style.Train.trainHead.trainConntWidth),
|
||||||
y: model.point.y,
|
y: model.point.y,
|
||||||
width: style.trainConntWidth * model.scale,
|
width: style.Train.trainHead.trainConntWidth * model.scale,
|
||||||
height: style.Train.trainHeadRectHeight
|
height: style.Train.trainHead.trainHeadRectHeight
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: 0.1,
|
lineWidth: 0.1,
|
||||||
stroke: style.trainSidelineColor,
|
stroke: style.trainSidelineColor,
|
||||||
fill: style.Train.trainHeadFillColor
|
fill: style.Train.trainHead.trainHeadFillColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.arrow = new Polygon({
|
this.arrow = new Polygon({
|
||||||
@ -33,15 +33,15 @@ export default class TrainHead extends Group {
|
|||||||
z: model.z,
|
z: model.z,
|
||||||
shape: {
|
shape: {
|
||||||
points: [
|
points: [
|
||||||
[model.point.x + model.drect * (style.Train.trainHeadTriangleFirst.x), model.point.y + style.Train.trainHeadTriangleFirst.y],
|
[model.point.x + model.drect * (style.Train.trainHead.trainHeadTriangleFirst.x), model.point.y + style.Train.trainHead.trainHeadTriangleFirst.y],
|
||||||
[model.point.x + model.drect * (style.Train.trainHeadTriangleSecond.x), model.point.y + style.Train.trainHeadTriangleSecond.y],
|
[model.point.x + model.drect * (style.Train.trainHead.trainHeadTriangleSecond.x), model.point.y + style.Train.trainHead.trainHeadTriangleSecond.y],
|
||||||
[model.point.x + model.drect * (style.Train.trainHeadTriangleThird.x), model.point.y + style.Train.trainHeadTriangleThird.y]
|
[model.point.x + model.drect * (style.Train.trainHead.trainHeadTriangleThird.x), model.point.y + style.Train.trainHead.trainHeadTriangleThird.y]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
lineWidth: 0.1,
|
lineWidth: 0.1,
|
||||||
stroke: style.trainSidelineColor,
|
stroke: style.trainSidelineColor,
|
||||||
fill: style.Train.trainHeadFillColor
|
fill: style.Train.trainHead.trainHeadFillColor
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -16,8 +16,8 @@ export default class Train extends Group {
|
|||||||
this.z = 40;
|
this.z = 40;
|
||||||
this.size = 0;
|
this.size = 0;
|
||||||
this.section = null;
|
this.section = null;
|
||||||
this.fontSize = style.Train.nameFontSize || style.Train.trainTextFontSize;
|
this.fontSize = style.Train.common.nameFontSize || style.Train.common.trainTextFontSize;
|
||||||
this.newScale = this.fontSize / style.Train.trainTextFontSize;
|
this.newScale = this.fontSize / style.Train.common.trainTextFontSize;
|
||||||
this.create();
|
this.create();
|
||||||
this.setState(model);
|
this.setState(model);
|
||||||
}
|
}
|
||||||
@ -30,16 +30,15 @@ export default class Train extends Group {
|
|||||||
x: model.trainWindowModel.point.x,
|
x: model.trainWindowModel.point.x,
|
||||||
y: model.trainWindowModel.point.y
|
y: model.trainWindowModel.point.y
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (model.directionType) {
|
switch (model.directionType) {
|
||||||
case '01': // 未知方向
|
case '01': // 未知方向
|
||||||
this.point.x = this.point.x + model.trainWindowModel.width / 2 + Math.abs((style.Train.trainWidth - model.trainWindowModel.width) / 2);
|
this.point.x = this.point.x + model.trainWindowModel.width / 2 + Math.abs((style.Train.common.trainWidth - model.trainWindowModel.width) / 2);
|
||||||
break;
|
break;
|
||||||
case '02': // 从左向右
|
case '02': // 从左向右
|
||||||
this.point.x = this.point.x + model.trainWindowModel.width / 2 - style.Train.trainConntWidth * this.newScale - style.Train.trainWidth;
|
this.point.x = this.point.x + model.trainWindowModel.width / 2 - style.Train.trainHead.trainConntWidth * this.newScale - style.Train.common.trainWidth;
|
||||||
break;
|
break;
|
||||||
case '03': // 从右向左
|
case '03': // 从右向左
|
||||||
this.point.x = this.point.x - model.trainWindowModel.width / 2 + style.Train.trainConntWidth * this.newScale;
|
this.point.x = this.point.x - model.trainWindowModel.width / 2 + style.Train.trainHead.trainConntWidth * this.newScale;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -77,7 +76,7 @@ export default class Train extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: this.point.x - style.Train.trainHeadDistance,
|
x: this.point.x - style.Train.common.trainHeadDistance,
|
||||||
y: this.point.y
|
y: this.point.y
|
||||||
},
|
},
|
||||||
drect: -1,
|
drect: -1,
|
||||||
@ -89,7 +88,7 @@ export default class Train extends Group {
|
|||||||
zlevel: this.zlevel,
|
zlevel: this.zlevel,
|
||||||
z: this.z,
|
z: this.z,
|
||||||
point: {
|
point: {
|
||||||
x: this.point.x + style.Train.trainWidth + style.Train.trainHeadDistance,
|
x: this.point.x + style.Train.common.trainWidth + style.Train.common.trainHeadDistance,
|
||||||
y: this.point.y
|
y: this.point.y
|
||||||
},
|
},
|
||||||
drect: 1,
|
drect: 1,
|
||||||
@ -100,7 +99,7 @@ export default class Train extends Group {
|
|||||||
this.add(this.trainL);
|
this.add(this.trainL);
|
||||||
this.add(this.trainR);
|
this.add(this.trainR);
|
||||||
}
|
}
|
||||||
if (style.Train.haveTrainBorder) {
|
if (style.Train.common.haveTrainBorder) {
|
||||||
this.createTrainBorder();
|
this.createTrainBorder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,25 +126,25 @@ export default class Train extends Group {
|
|||||||
|
|
||||||
// 设置服务号状态类型
|
// 设置服务号状态类型
|
||||||
setServerNoType(type) {
|
setServerNoType(type) {
|
||||||
if (this.style.Train.serverNoType.length>0) {
|
if (this.style.Train.trainStatusStyle.serverNoType.length>0) {
|
||||||
const flag = this.style.Train.serverNoType.some((item) =>{
|
const flag = this.style.Train.trainStatusStyle.serverNoType.some((item) =>{
|
||||||
if (type === item.type) {
|
if (type === item.type) {
|
||||||
this.trainB.setTextTrainServerColor(item.showColor);
|
this.trainB.setTextTrainServerColor(item.showColor);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (this.style.Train.defaultServerNoColor && !flag) {
|
if (this.style.Train.trainStatusStyle.defaultServerNoColor && !flag) {
|
||||||
this.trainB.setTextTrainServerColor(this.style.Train.defaultServerNoColor);
|
this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultServerNoColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置目的地状态
|
// 设置目的地状态
|
||||||
setDestinationStatus(status) {
|
setDestinationStatus(status) {
|
||||||
if (this.style.Train.destinationStatus.length>0) {
|
if (this.style.Train.trainStatusStyle.destinationStatus.length>0) {
|
||||||
const flag = this.style.Train.destinationStatus.some((item) =>{
|
const flag = this.style.Train.trainStatusStyle.destinationStatus.some((item) =>{
|
||||||
if (status === item.status) {
|
if (status === item.status) {
|
||||||
switch (this.style.Train.destinationStatusSetText) {
|
switch (this.style.Train.trainStatusStyle.destinationStatusSetText) {
|
||||||
case 'trainTarget':
|
case 'trainTarget':
|
||||||
this.trainB.setTextTrainTargetColor(item.showColor);
|
this.trainB.setTextTrainTargetColor(item.showColor);
|
||||||
break;
|
break;
|
||||||
@ -158,16 +157,16 @@ export default class Train extends Group {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (this.style.Train.defaultDestinationColor && !flag) {
|
if (this.style.Train.trainStatusStyle.defaultDestinationColor && !flag) {
|
||||||
switch (this.style.Train.destinationStatusSetText) {
|
switch (this.style.Train.trainStatusStyle.destinationStatusSetText) {
|
||||||
case 'trainTarget':
|
case 'trainTarget':
|
||||||
this.trainB.setTextTrainTargetColor(this.style.Train.defaultDestinationColor);
|
this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||||
break;
|
break;
|
||||||
case 'trainServer':
|
case 'trainServer':
|
||||||
this.trainB.setTextTrainServerColor(this.style.Train.defaultDestinationColor);
|
this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this.trainB.setTextTrainTargetColor(this.style.Train.defaultDestinationColor);
|
this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -175,8 +174,8 @@ export default class Train extends Group {
|
|||||||
|
|
||||||
// 设置运行方向状态类型
|
// 设置运行方向状态类型
|
||||||
setDirectionType(type) {
|
setDirectionType(type) {
|
||||||
if (this.style.Train.directionType.length > 0) {
|
if (this.style.Train.trainStatusStyle.directionType.length > 0) {
|
||||||
this.style.Train.directionType.some((item) => {
|
this.style.Train.trainStatusStyle.directionType.some((item) => {
|
||||||
if (type === item.type) {
|
if (type === item.type) {
|
||||||
this.trainL.setLineShow(item.lineLShow);
|
this.trainL.setLineShow(item.lineLShow);
|
||||||
this.trainL.setArrowShow(item.arrowLShow);
|
this.trainL.setArrowShow(item.arrowLShow);
|
||||||
@ -189,8 +188,8 @@ export default class Train extends Group {
|
|||||||
}
|
}
|
||||||
// 设置列车停止方向类型
|
// 设置列车停止方向类型
|
||||||
setDirectionStopType(type) {
|
setDirectionStopType(type) {
|
||||||
if (this.style.Train.directionStopType.length > 0) {
|
if (this.style.Train.trainStatusStyle.directionStopType.length > 0) {
|
||||||
this.style.Train.directionStopType.some((item) => {
|
this.style.Train.trainStatusStyle.directionStopType.some((item) => {
|
||||||
if (type === item.type) {
|
if (type === item.type) {
|
||||||
this.trainL.setLineShow(item.lineLShow);
|
this.trainL.setLineShow(item.lineLShow);
|
||||||
this.trainR.setLineShow(item.lineRShow);
|
this.trainR.setLineShow(item.lineRShow);
|
||||||
@ -213,8 +212,8 @@ export default class Train extends Group {
|
|||||||
}
|
}
|
||||||
// 设置运行模式
|
// 设置运行模式
|
||||||
setRunMode(status) {
|
setRunMode(status) {
|
||||||
if (this.style.Train.runModeStatus.length > 0) {
|
if (this.style.Train.trainStatusStyle.runModeStatus.length > 0) {
|
||||||
this.style.Train.runModeStatus.some((item) => {
|
this.style.Train.trainStatusStyle.runModeStatus.some((item) => {
|
||||||
if (status === item.status) {
|
if (status === item.status) {
|
||||||
this.trainL.setColor(item.trainLColor);
|
this.trainL.setColor(item.trainLColor);
|
||||||
this.trainR.setColor(item.trainRColor);
|
this.trainR.setColor(item.trainRColor);
|
||||||
@ -225,8 +224,8 @@ export default class Train extends Group {
|
|||||||
}
|
}
|
||||||
// 设置运行控制状态类型
|
// 设置运行控制状态类型
|
||||||
setRunControlStatus(status) {
|
setRunControlStatus(status) {
|
||||||
if (this.style.Train.runControlStatus.length > 0) {
|
if (this.style.Train.trainStatusStyle.runControlStatus.length > 0) {
|
||||||
this.style.Train.runControlStatus.some((item) => {
|
this.style.Train.trainStatusStyle.runControlStatus.some((item) => {
|
||||||
if (status === item.status) {
|
if (status === item.status) {
|
||||||
this.trainB.setHShow(item.hShow);
|
this.trainB.setHShow(item.hShow);
|
||||||
this.trainB.setSShow(item.sShow);
|
this.trainB.setSShow(item.sShow);
|
||||||
@ -237,8 +236,8 @@ export default class Train extends Group {
|
|||||||
}
|
}
|
||||||
// 设置车门状态类型
|
// 设置车门状态类型
|
||||||
setDoorStatus(status) {
|
setDoorStatus(status) {
|
||||||
if (this.style.Train.doorStatus.length > 0) {
|
if (this.style.Train.trainStatusStyle.doorStatus.length > 0) {
|
||||||
this.style.Train.doorStatus.some((item) => {
|
this.style.Train.trainStatusStyle.doorStatus.some((item) => {
|
||||||
if (status === item.status) {
|
if (status === item.status) {
|
||||||
this.trainB.setDShow(item.dShow);
|
this.trainB.setDShow(item.dShow);
|
||||||
return true;
|
return true;
|
||||||
@ -248,8 +247,8 @@ export default class Train extends Group {
|
|||||||
}
|
}
|
||||||
// 设置通信状态类型
|
// 设置通信状态类型
|
||||||
setCommunicationStatus() {
|
setCommunicationStatus() {
|
||||||
if (this.style.Train.communicationStatus.length > 0) {
|
if (this.style.Train.trainStatusStyle.communicationStatus.length > 0) {
|
||||||
this.style.Train.doorStatus.some((item) => {
|
this.style.Train.trainStatusStyle.communicationStatus.some((item) => {
|
||||||
if (status === item.status) {
|
if (status === item.status) {
|
||||||
this.trainB.setTrainColor(item.trainColor);
|
this.trainB.setTrainColor(item.trainColor);
|
||||||
return true;
|
return true;
|
||||||
@ -259,8 +258,8 @@ export default class Train extends Group {
|
|||||||
}
|
}
|
||||||
// 设置报警状态
|
// 设置报警状态
|
||||||
setAlarmStatus(status) {
|
setAlarmStatus(status) {
|
||||||
if (this.style.Train.alarmStatus.length >0) {
|
if (this.style.Train.trainStatusStyle.alarmStatus.length >0) {
|
||||||
this.style.Train.alarmStatus.some((item) => {
|
this.style.Train.trainStatusStyle.alarmStatus.some((item) => {
|
||||||
if (status === item.status) {
|
if (status === item.status) {
|
||||||
this.trainB.setAShow(item.aShow);
|
this.trainB.setAShow(item.aShow);
|
||||||
return true;
|
return true;
|
||||||
@ -286,25 +285,25 @@ export default class Train extends Group {
|
|||||||
}
|
}
|
||||||
// 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
// 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||||
isChangeTrainWidth(model, style) {
|
isChangeTrainWidth(model, style) {
|
||||||
if (!style.Train.changeTrainWidth) { return; }
|
if (!style.Train.trainBody.changeTrainWidth) { return; }
|
||||||
if (style.Train.trainNameFormat) {
|
if (style.Train.trainBody.trainNameFormat) {
|
||||||
const arr = style.Train.trainNameFormat.split(':');
|
const arr = style.Train.trainBody.trainNameFormat.split(':');
|
||||||
arr.forEach(ele => {
|
arr.forEach(ele => {
|
||||||
switch (ele) {
|
switch (ele) {
|
||||||
case 'targetCode': {
|
case 'targetCode': {
|
||||||
this.size += 3;
|
this.size += style.Train.trainNumber.targetCodePrefix.length || 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'serviceNumber': {
|
case 'serviceNumber': {
|
||||||
this.size += 2;
|
this.size += style.Train.trainServer.serviceNumberPrefix.length || 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'tripNumber': {
|
case 'tripNumber': {
|
||||||
this.size += 4;
|
this.size += style.Train.trainTarget.tripNumberPrefix.length || 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'groupNumber': {
|
case 'groupNumber': {
|
||||||
this.size += 3;
|
this.size += style.Train.trainTargetNumber.groupNumberPrefix.length || 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -312,8 +311,7 @@ export default class Train extends Group {
|
|||||||
} else {
|
} else {
|
||||||
this.size = 9;
|
this.size = 9;
|
||||||
}
|
}
|
||||||
|
this.style.Train.common.trainWidth = this.size * this.fontSize * (2 / 3) -16;
|
||||||
this.style.Train.trainWidth = this.size * this.fontSize * (2 / 3) - 16;
|
|
||||||
}
|
}
|
||||||
removeTrainDetail() {
|
removeTrainDetail() {
|
||||||
this.trainB.removeTrainDetail();
|
this.trainB.removeTrainDetail();
|
||||||
@ -340,9 +338,9 @@ export default class Train extends Group {
|
|||||||
}
|
}
|
||||||
createTrainBorder() {
|
createTrainBorder() {
|
||||||
const rect = Object.assign({}, this.getBoundingRect());
|
const rect = Object.assign({}, this.getBoundingRect());
|
||||||
rect.x -= this.style.Train.trainWidth / 2;
|
rect.x -= this.style.Train.common.trainWidth / 2;
|
||||||
rect.y -= 5;
|
rect.y -= 5;
|
||||||
rect.width += this.style.Train.trainWidth;
|
rect.width += this.style.Train.common.trainWidth;
|
||||||
rect.height += 10;
|
rect.height += 10;
|
||||||
|
|
||||||
this.trainBorder = new Rect({
|
this.trainBorder = new Rect({
|
||||||
|
Loading…
Reference in New Issue
Block a user