2024-05-07 16:33:38 +08:00
|
|
|
extends Node3D
|
|
|
|
|
|
|
|
class_name TotalScene
|
|
|
|
|
2024-05-10 11:34:01 +08:00
|
|
|
##车来且开屏蔽门和车门
|
2024-05-08 17:45:48 +08:00
|
|
|
func trainComeAndOpenScreenDoor ()-> void:
|
2024-06-20 10:28:46 +08:00
|
|
|
$AllTimer/trainComeDelay.start()
|
2024-05-30 11:14:04 +08:00
|
|
|
$trainComing.play()
|
2024-05-23 14:24:33 +08:00
|
|
|
|
|
|
|
func _on_train_come_delay_timeout() -> void:
|
|
|
|
$train.trainCome()
|
2024-06-20 10:28:46 +08:00
|
|
|
$AllTimer/BeginTimer.start()
|
2024-05-07 18:06:54 +08:00
|
|
|
|
2024-05-10 11:34:01 +08:00
|
|
|
##关屏蔽门和车门且车走
|
|
|
|
func closeScreenDoorAndTrainLeave ()-> void:
|
|
|
|
closeScreenDoor()
|
2024-06-20 10:28:46 +08:00
|
|
|
$AllTimer/EndTimer.start()
|
2024-05-10 11:34:01 +08:00
|
|
|
|
|
|
|
func _on_end_timer_timeout() -> void:
|
|
|
|
trainLeave()
|
|
|
|
|
2024-05-24 16:24:15 +08:00
|
|
|
##开屏蔽门和车门
|
|
|
|
func openScreenDoor() -> void:
|
|
|
|
$train.openLeftTrainDoorALL()
|
|
|
|
$platform.openScreenDoorALL()
|
|
|
|
|
2024-05-08 17:45:48 +08:00
|
|
|
##关屏蔽门和车门
|
|
|
|
func closeScreenDoor() -> void:
|
2024-05-07 18:06:54 +08:00
|
|
|
$train.closeLeftTrainDoorALL()
|
|
|
|
$platform.closeScreenDoorALL()
|
|
|
|
|
2024-05-29 15:18:03 +08:00
|
|
|
##只关屏蔽门
|
|
|
|
func closeOnlyScreenDoor() -> void:
|
|
|
|
$platform.closeScreenDoorALL()
|
|
|
|
|
|
|
|
##只关车门
|
|
|
|
func closeOnlyTrainDoor() -> void:
|
|
|
|
$train.closeLeftTrainDoorALL()
|
|
|
|
|
2024-05-08 17:45:48 +08:00
|
|
|
##车走
|
2024-05-16 17:43:12 +08:00
|
|
|
func trainLeave(ActionGestureCommandDeparture = false) -> bool:
|
|
|
|
var InterlockReleaseSwitch=NodeUtils.find_child_by_name($platform.get_node('psl'),'InterlockReleaseSwitch')
|
|
|
|
var isOpenLight = NodeUtils.find_child_by_name(InterlockReleaseSwitch,'openLight').visible
|
|
|
|
if $platform.allScreenDoorClose() or isOpenLight or ActionGestureCommandDeparture :
|
2024-06-20 10:28:46 +08:00
|
|
|
$AllTimer/trainLeaveDelay.start()
|
2024-05-16 17:43:12 +08:00
|
|
|
return true
|
|
|
|
return false
|
2024-05-07 18:06:54 +08:00
|
|
|
|
2024-05-22 15:28:19 +08:00
|
|
|
func _on_train_leave_delay_timeout() -> void:
|
|
|
|
$train.trainLeave()
|
|
|
|
|
2024-05-28 15:40:46 +08:00
|
|
|
## 车门名字的枚举
|
|
|
|
enum TrainDoor_name{
|
|
|
|
trainDoor1=1,
|
|
|
|
trainDoor2,
|
|
|
|
trainDoor3,
|
|
|
|
trainDoor4,
|
|
|
|
}
|
|
|
|
|
|
|
|
##设置指定车门不开门
|
|
|
|
func setAssignTrainDoorsOpenFault (trainDoorNames:Array)-> void:
|
2024-05-29 15:18:03 +08:00
|
|
|
setAssignTrainDoorsFault(trainDoorNames,TrainDoor.TrainDoor_Fault_State.openFault)
|
|
|
|
|
|
|
|
##设置指定车门不关门
|
|
|
|
func setAssignTrainDoorsCloseFault (trainDoorNames:Array)-> void:
|
|
|
|
setAssignTrainDoorsFault(trainDoorNames,TrainDoor.TrainDoor_Fault_State.closeFault)
|
|
|
|
|
|
|
|
func setAssignTrainDoorsFault (trainDoorNames:Array,faultType:TrainDoor.TrainDoor_Fault_State)-> void:
|
|
|
|
for child in $train.leftTrainDoorALL:
|
|
|
|
var trainDoorName=String(child.name)
|
|
|
|
var trainDoorIndex=int(trainDoorName[trainDoorName.length() - 1])
|
|
|
|
if trainDoorIndex in trainDoorNames:
|
2024-06-04 09:15:28 +08:00
|
|
|
child.setTrainDoorFault(faultType)
|
2024-05-29 15:18:03 +08:00
|
|
|
|
|
|
|
##移除车设置的故障
|
|
|
|
func removeAssignTrainDoorsFault (trainDoorNames:Array)-> void:
|
2024-05-28 15:40:46 +08:00
|
|
|
for child in $train.leftTrainDoorALL:
|
|
|
|
var trainDoorName=String(child.name)
|
|
|
|
var trainDoorIndex=int(trainDoorName[trainDoorName.length() - 1])
|
|
|
|
if trainDoorIndex in trainDoorNames:
|
2024-05-29 15:18:03 +08:00
|
|
|
child.removeTrainDoorFault()
|
|
|
|
|
|
|
|
##车开关门到位信号
|
|
|
|
signal trainDoorOpenConfirmSignal(trainDoor:TrainDoor)
|
|
|
|
signal trainDoorCloseConfirmSignal(trainDoor:TrainDoor)
|
|
|
|
|
|
|
|
func emitTrainDoorOpenSignal(trainDoor:TrainDoor) -> void:
|
|
|
|
trainDoorOpenConfirmSignal.emit(trainDoor)
|
|
|
|
|
|
|
|
func emitTrainDoorCloseSignal(trainDoor:TrainDoor) -> void:
|
|
|
|
trainDoorCloseConfirmSignal.emit(trainDoor)
|
|
|
|
|
2024-05-28 15:40:46 +08:00
|
|
|
|
2024-05-07 16:33:38 +08:00
|
|
|
## 屏蔽门名字的枚举
|
|
|
|
enum ScreenDoor_name{
|
|
|
|
screenDoor1=1,
|
|
|
|
screenDoor2,
|
|
|
|
screenDoor3,
|
|
|
|
screenDoor4,
|
|
|
|
}
|
|
|
|
|
|
|
|
##设置指定屏蔽门开门故障
|
|
|
|
func setAssignScreenDoorsOpenFault (screenDoorNames:Array)-> void:
|
2024-05-08 16:15:27 +08:00
|
|
|
setAssignScreenDoorsFault(screenDoorNames,ScreenDoor.ScreenDoor_Fault_State.openFault)
|
2024-05-07 16:33:38 +08:00
|
|
|
|
|
|
|
##设置指定屏蔽门关门故障
|
|
|
|
func setAssignScreenDoorsCloseFault (screenDoorNames:Array)-> void:
|
2024-05-08 16:15:27 +08:00
|
|
|
setAssignScreenDoorsFault(screenDoorNames,ScreenDoor.ScreenDoor_Fault_State.closeFault)
|
|
|
|
|
|
|
|
##设置指定屏蔽门玻璃破碎故障
|
|
|
|
func setAssignScreenDoorsGlassBreakageFault (screenDoorNames:Array)-> void:
|
|
|
|
setAssignScreenDoorsFault(screenDoorNames,ScreenDoor.ScreenDoor_Fault_State.glassBreakage)
|
|
|
|
|
2024-05-10 16:53:03 +08:00
|
|
|
##设置指定屏蔽门夹人故障
|
|
|
|
func setAssignScreenDoorsPinchPeopleFault (screenDoorNames:Array)-> void:
|
|
|
|
setAssignScreenDoorsFault(screenDoorNames,ScreenDoor.ScreenDoor_Fault_State.pinchPeople)
|
|
|
|
|
2024-05-29 15:18:03 +08:00
|
|
|
##移除屏蔽门设置的故障
|
2024-05-24 16:24:15 +08:00
|
|
|
func removeAssignScreenDoorsFault (screenDoorNames:Array)-> void:
|
|
|
|
for child in $platform.screenDoorALL:
|
|
|
|
var screenDoorName=String(child.name)
|
|
|
|
var screenDoorIndex=int(screenDoorName[screenDoorName.length() - 1])
|
|
|
|
if screenDoorIndex in screenDoorNames:
|
|
|
|
child.removeScreenDoorFault()
|
|
|
|
|
2024-05-08 16:15:27 +08:00
|
|
|
|
|
|
|
func setAssignScreenDoorsFault (screenDoorNames:Array,faultType:ScreenDoor.ScreenDoor_Fault_State)-> void:
|
2024-05-07 16:33:38 +08:00
|
|
|
for child in $platform.screenDoorALL:
|
|
|
|
var screenDoorName=String(child.name)
|
|
|
|
var screenDoorIndex=int(screenDoorName[screenDoorName.length() - 1])
|
|
|
|
if screenDoorIndex in screenDoorNames:
|
2024-05-08 16:15:27 +08:00
|
|
|
child.setScreenDoorFault(faultType)
|
2024-05-11 10:08:48 +08:00
|
|
|
|
2024-05-22 11:10:03 +08:00
|
|
|
##屏蔽门开关门到位信号和lcb状态变化信号
|
2024-05-11 16:51:19 +08:00
|
|
|
signal screenDoorOpenConfirmSignal(screenDoor:ScreenDoor)
|
|
|
|
signal screenDoorCloseConfirmSignal(screenDoor:ScreenDoor)
|
2024-05-22 11:10:03 +08:00
|
|
|
signal screenDoorLcbStateChangeSignal(screenDoor:ScreenDoor,knob_state: LcbWindow.KNOB_STATE)
|
2024-05-11 16:51:19 +08:00
|
|
|
|
|
|
|
func emitScreenDoorOpenSignal(screenDoor:ScreenDoor) -> void:
|
|
|
|
screenDoorOpenConfirmSignal.emit(screenDoor)
|
|
|
|
|
|
|
|
func emitScreenDoorCloseSignal(screenDoor:ScreenDoor) -> void:
|
|
|
|
screenDoorCloseConfirmSignal.emit(screenDoor)
|
2024-05-22 11:10:03 +08:00
|
|
|
|
|
|
|
func emitScreenDoorLcbStateChangeSignal(currenScreenDoor: ScreenDoor, knob_state: LcbWindow.KNOB_STATE) -> void:
|
|
|
|
screenDoorLcbStateChangeSignal.emit(currenScreenDoor,knob_state)
|
2024-05-11 10:08:48 +08:00
|
|
|
|
2024-05-12 17:08:52 +08:00
|
|
|
## 实训模式枚举
|
|
|
|
enum Training_Mode{
|
|
|
|
Teach,#教学模式
|
|
|
|
Practice,# 练习模式
|
|
|
|
Exam,# 考试模式
|
|
|
|
}
|
|
|
|
|
|
|
|
var trainingMode = Training_Mode.Teach
|
|
|
|
|
|
|
|
##当前点击和需要点击节点以及校验是否点击正确
|
|
|
|
var currentClickNode = null
|
|
|
|
var currenNeedClickNode = null
|
|
|
|
|
|
|
|
signal currentClickCheckSignal(isCorrect:bool)
|
|
|
|
|
2024-05-13 17:05:19 +08:00
|
|
|
var allLCBKeys = ['LCB_Key1','LCB_Key2','LCB_Key3','LCB_Key4']
|
2024-05-12 17:08:52 +08:00
|
|
|
func checkCurrentClick() -> bool:
|
|
|
|
if trainingMode == Training_Mode.Exam:
|
|
|
|
return true
|
|
|
|
else :
|
2024-05-13 17:05:19 +08:00
|
|
|
if currentClickNode == currenNeedClickNode or (currentClickNode in allLCBKeys and currenNeedClickNode in allLCBKeys):
|
2024-05-12 17:08:52 +08:00
|
|
|
return true
|
|
|
|
else :
|
|
|
|
return false
|
|
|
|
|
2024-05-11 10:08:48 +08:00
|
|
|
func _on_platform_all_click_platform_signal(equipmentName: String,equipmentInfo=null) -> void:
|
2024-05-12 17:08:52 +08:00
|
|
|
currentClickNode = equipmentName
|
|
|
|
var isClickCorrect = checkCurrentClick()
|
|
|
|
currentClickCheckSignal.emit(isClickCorrect)
|
2024-05-13 16:48:48 +08:00
|
|
|
equipmentInfo.allowHandle = isClickCorrect
|
2024-05-12 17:08:52 +08:00
|
|
|
|
2024-05-15 11:14:14 +08:00
|
|
|
|
|
|
|
const NodeUtils = preload("res://util/NodeUtils.gd")
|
2024-05-14 15:58:28 +08:00
|
|
|
##所有交互操作平面坐标
|
|
|
|
func allClickEquipmentPostion(equipmentName: String) -> Vector2:
|
2024-05-15 11:14:14 +08:00
|
|
|
if equipmentName in ['LCB_Key1','LCB_Key2','LCB_Key3','LCB_Key4','JJTC_Key','PSL_Key','HSJC_Key','SDJS_Key','confirmUseKey'] : ##钥匙面板
|
|
|
|
var keysWindow = $platform.get_node('stationKeys')
|
|
|
|
var lcbWindowPos = keysWindow.position
|
|
|
|
if equipmentName == 'confirmUseKey':
|
|
|
|
var confirmUseKeyPos=NodeUtils.find_child_by_name(keysWindow,'Button').get_global_position()
|
2024-05-16 15:47:02 +08:00
|
|
|
return Vector2(lcbWindowPos.x+confirmUseKeyPos.x+30,lcbWindowPos.y+confirmUseKeyPos.y)
|
2024-05-15 11:14:14 +08:00
|
|
|
var LCB_KeyPos=NodeUtils.find_child_by_name(keysWindow,equipmentName).get_global_position()
|
2024-05-16 15:25:28 +08:00
|
|
|
return Vector2(lcbWindowPos.x+LCB_KeyPos.x+70,lcbWindowPos.y+LCB_KeyPos.y+20)
|
2024-05-15 11:14:14 +08:00
|
|
|
elif equipmentName == 'LCB1' : ##LCB以及LCB面板
|
2024-05-14 15:58:28 +08:00
|
|
|
return getScreenPosition($platform.get_node('screenDoor1').get_node('LCB').get_node('LCB_body'))
|
|
|
|
elif equipmentName == 'LCB2' :
|
|
|
|
return getScreenPosition($platform.get_node('screenDoor2').get_node('LCB').get_node('LCB_body'))
|
|
|
|
elif equipmentName == 'LCB3' :
|
|
|
|
return getScreenPosition($platform.get_node('screenDoor3').get_node('LCB').get_node('LCB_body'))
|
|
|
|
elif equipmentName == 'LCB4' :
|
|
|
|
return getScreenPosition($platform.get_node('screenDoor4').get_node('LCB').get_node('LCB_body'))
|
2024-05-14 17:42:46 +08:00
|
|
|
elif equipmentName in ['LCB1LeftRotate','LCB2LeftRotate','LCB3LeftRotate','LCB4LeftRotate'] :
|
|
|
|
var lcbPos = $platform.get_node('LCB').position
|
|
|
|
var leftRotatePos = $platform.get_node('LCB').get_node('LCB2_Left_Rotate').get_global_position()
|
|
|
|
return Vector2(lcbPos.x+leftRotatePos.x,lcbPos.y+leftRotatePos.y)
|
|
|
|
elif equipmentName in ['LCB1RightRotate','LCB2RightRotate','LCB3RightRotate','LCB4RightRotate'] :
|
|
|
|
var lcbPos = $platform.get_node('LCB').position
|
2024-05-14 17:46:03 +08:00
|
|
|
var rightRotatePos = $platform.get_node('LCB').get_node('LCB2_Right_Rotate').get_global_position()
|
|
|
|
return Vector2(lcbPos.x+rightRotatePos.x,lcbPos.y+rightRotatePos.y)
|
|
|
|
elif equipmentName in ['removeKeyOfWindowLCB1','removeKeyOfWindowLCB2','removeKeyOfWindowLCB3','removeKeyOfWindowLCB4'] :
|
|
|
|
var lcbPos = $platform.get_node('LCB').position
|
|
|
|
var removePos = $platform.get_node('LCB').get_node('TextureRect2').get_global_position()
|
2024-05-16 15:47:02 +08:00
|
|
|
return Vector2(lcbPos.x+removePos.x-25,lcbPos.y+removePos.y-5)
|
2024-05-15 11:14:14 +08:00
|
|
|
elif equipmentName == 'PSL' : ##PSL以及PSL面板
|
2024-05-14 15:58:28 +08:00
|
|
|
return getScreenPosition($platform.get_node('PSL').get_node('PSL_body'))
|
2024-05-29 15:18:03 +08:00
|
|
|
elif equipmentName in ['PSLAllowLeftRotate','PSLAllowRightRotate','InterlockReleaseSwitchLeftRotate','InterlockReleaseSwitchRightRotate','CloseDoorButton','OpenDoorButton','LightTestButton','trainDepartsButton','interconnectedCloseButton','interconnectedOpenButton','removePSLKeyOfWindowPsl','removeHSJCKeyOfWindowPsl'] :
|
2024-05-15 11:14:14 +08:00
|
|
|
var pslWindow = $platform.get_node('psl')
|
|
|
|
var pslWindowPos = pslWindow.position
|
2024-05-29 15:18:03 +08:00
|
|
|
if equipmentName in ['PSLAllowLeftRotate','PSLAllowRightRotate']:
|
|
|
|
var keySwitch=NodeUtils.find_child_by_name(pslWindow,'PSLAllow')
|
|
|
|
if equipmentName == 'PSLAllowLeftRotate' :
|
|
|
|
var leftRotatePos = NodeUtils.find_child_by_name(keySwitch,'Left_Rotate').get_global_position()
|
|
|
|
return Vector2(pslWindowPos.x+leftRotatePos.x,pslWindowPos.y+leftRotatePos.y)
|
|
|
|
else :
|
|
|
|
var rightRotatePos = NodeUtils.find_child_by_name(keySwitch,'Right_Rotate').get_global_position()
|
|
|
|
return Vector2(pslWindowPos.x+rightRotatePos.x,pslWindowPos.y+rightRotatePos.y)
|
|
|
|
elif equipmentName in ['InterlockReleaseSwitchLeftRotate','InterlockReleaseSwitchRightRotate']:
|
|
|
|
var keySwitch=NodeUtils.find_child_by_name(pslWindow,'InterlockReleaseSwitch')
|
|
|
|
if equipmentName == 'InterlockReleaseSwitchLeftRotate' :
|
|
|
|
var leftRotatePos = NodeUtils.find_child_by_name(keySwitch,'Left_Rotate').get_global_position()
|
|
|
|
return Vector2(pslWindowPos.x+leftRotatePos.x,pslWindowPos.y+leftRotatePos.y)
|
|
|
|
else :
|
|
|
|
var rightRotatePos = NodeUtils.find_child_by_name(keySwitch,'Right_Rotate').get_global_position()
|
|
|
|
return Vector2(pslWindowPos.x+rightRotatePos.x,pslWindowPos.y+rightRotatePos.y)
|
2024-05-15 11:14:14 +08:00
|
|
|
elif equipmentName == 'removePSLKeyOfWindowPsl':
|
|
|
|
var PSLAllow=NodeUtils.find_child_by_name(pslWindow,'PSLAllow')
|
|
|
|
var removeKeyPos = NodeUtils.find_child_by_name(PSLAllow,'Keyhole').get_global_position()
|
|
|
|
return Vector2(pslWindowPos.x+removeKeyPos.x,pslWindowPos.y+removeKeyPos.y)
|
|
|
|
elif equipmentName == 'removeHSJCKeyOfWindowPsl':
|
|
|
|
var InterlockReleaseSwitch=NodeUtils.find_child_by_name(pslWindow,'InterlockReleaseSwitch')
|
|
|
|
var removeKeyPos = NodeUtils.find_child_by_name(InterlockReleaseSwitch,'Keyhole').get_global_position()
|
|
|
|
return Vector2(pslWindowPos.x+removeKeyPos.x,pslWindowPos.y+removeKeyPos.y)
|
2024-05-28 17:50:24 +08:00
|
|
|
var Psl_KeyPos=NodeUtils.find_child_by_name(pslWindow,equipmentName).get_global_position()
|
|
|
|
return Vector2(pslWindowPos.x+Psl_KeyPos.x+50,pslWindowPos.y+Psl_KeyPos.y+20)
|
2024-05-15 11:14:14 +08:00
|
|
|
elif equipmentName == 'JJTC' : ##JJTC以及JJTC面板
|
2024-05-14 15:58:28 +08:00
|
|
|
return getScreenPosition($platform.get_node('JJTC').get_node('JJTC_body'))
|
2024-05-15 11:14:14 +08:00
|
|
|
elif equipmentName in ['JJTCLeftRotate','JJTCRightRotate','JJTCButton','JJTCCloseBox'] :
|
|
|
|
var jjtcWindow = $platform.get_node('jjtc')
|
|
|
|
var jjtcWindowPos = jjtcWindow.position
|
|
|
|
if equipmentName == 'JJTCLeftRotate':
|
|
|
|
var Close_Click_Area_pos=NodeUtils.find_child_by_name(jjtcWindow,'JJTC_Left_Rotate').get_global_position()
|
|
|
|
return Vector2(jjtcWindowPos.x+Close_Click_Area_pos.x,jjtcWindowPos.y+Close_Click_Area_pos.y)
|
|
|
|
elif equipmentName == 'JJTCRightRotate':
|
|
|
|
var Close_Click_Area_pos=NodeUtils.find_child_by_name(jjtcWindow,'JJTC_Right_Rotate').get_global_position()
|
|
|
|
return Vector2(jjtcWindowPos.x+Close_Click_Area_pos.x,jjtcWindowPos.y+Close_Click_Area_pos.y)
|
|
|
|
elif equipmentName == 'JJTCButton':
|
|
|
|
var Close_Click_Area_pos=NodeUtils.find_child_by_name(jjtcWindow,'JJTC_Button').get_global_position()
|
2024-05-24 16:24:15 +08:00
|
|
|
return Vector2(jjtcWindowPos.x+Close_Click_Area_pos.x+45,jjtcWindowPos.y+Close_Click_Area_pos.y+3)
|
2024-05-15 11:14:14 +08:00
|
|
|
else :
|
|
|
|
var Close_Click_Area_pos=NodeUtils.find_child_by_name(jjtcWindow,'Close_Click_Area').get_global_position()
|
2024-05-24 16:24:15 +08:00
|
|
|
return Vector2(jjtcWindowPos.x+Close_Click_Area_pos.x+30,jjtcWindowPos.y+Close_Click_Area_pos.y+100)
|
2024-05-15 11:14:14 +08:00
|
|
|
elif equipmentName == 'screenDoor1RightClick' : ##屏蔽门右键以及屏蔽门右键面板
|
2024-05-28 15:40:46 +08:00
|
|
|
var pos = getScreenPosition($platform.get_node('screenDoor1').get_node('dimiantishi'))
|
|
|
|
return Vector2(pos.x-50,pos.y-200)
|
2024-05-14 15:58:28 +08:00
|
|
|
elif equipmentName == 'screenDoor2RightClick' :
|
2024-05-28 15:40:46 +08:00
|
|
|
var pos = getScreenPosition($platform.get_node('screenDoor2').get_node('dimiantishi'))
|
|
|
|
return Vector2(pos.x-50,pos.y-200)
|
2024-05-14 15:58:28 +08:00
|
|
|
elif equipmentName == 'screenDoor3RightClick' :
|
2024-05-28 15:40:46 +08:00
|
|
|
var pos = getScreenPosition($platform.get_node('screenDoor3').get_node('dimiantishi'))
|
|
|
|
return Vector2(pos.x-200,pos.y-200)
|
2024-05-14 15:58:28 +08:00
|
|
|
elif equipmentName == 'screenDoor4RightClick' :
|
2024-05-28 15:40:46 +08:00
|
|
|
var pos = getScreenPosition($platform.get_node('screenDoor4').get_node('dimiantishi'))
|
|
|
|
return Vector2(pos.x-50,pos.y-200)
|
2024-05-15 11:14:14 +08:00
|
|
|
elif equipmentName in ['clickAdhesiveTapeOfscreenDoor1','clickAdhesiveTapeOfscreenDoor2','clickAdhesiveTapeOfscreenDoor3','clickAdhesiveTapeOfscreenDoor4'] :
|
|
|
|
var ScreenDoorOperateWindow = $platform.get_node('ScreenDoorOperate')
|
|
|
|
var ScreenDoorOperateWindowPos = ScreenDoorOperateWindow.position
|
|
|
|
var AdhesiveTapePos = NodeUtils.find_child_by_name(ScreenDoorOperateWindow,'AdhesiveTape').get_global_position()
|
2024-05-28 15:40:46 +08:00
|
|
|
return Vector2(ScreenDoorOperateWindowPos.x+AdhesiveTapePos.x+50,ScreenDoorOperateWindowPos.y+AdhesiveTapePos.y)
|
2024-06-21 16:30:29 +08:00
|
|
|
elif equipmentName in ['clickIsolationStripOfscreenDoor1','clickIsolationStripOfscreenDoor2','clickIsolationStripOfscreenDoor3','clickIsolationStripOfscreenDoor4'] :
|
2024-05-15 11:14:14 +08:00
|
|
|
var ScreenDoorOperateWindow = $platform.get_node('ScreenDoorOperate')
|
|
|
|
var ScreenDoorOperateWindowPos = ScreenDoorOperateWindow.position
|
|
|
|
var IsolationStripPos=NodeUtils.find_child_by_name(ScreenDoorOperateWindow,'IsolationStrip').get_global_position()
|
2024-05-28 15:40:46 +08:00
|
|
|
return Vector2(ScreenDoorOperateWindowPos.x+IsolationStripPos.x+50,ScreenDoorOperateWindowPos.y+IsolationStripPos.y)
|
2024-06-21 16:30:29 +08:00
|
|
|
elif equipmentName in ['escalatorKey','handheldRadio','hoarding','picketline','metalBarrier','noticeSigns'] :
|
|
|
|
var shortcutToolNode = $platform.get_node('ShortcutTool')
|
|
|
|
var shortcutToolPos=NodeUtils.find_child_by_name(shortcutToolNode,equipmentName).get_global_position()
|
|
|
|
return Vector2(shortcutToolPos.x+25,shortcutToolPos.y)
|
2024-07-05 18:22:52 +08:00
|
|
|
elif equipmentName in ['escalatorKeyModel','handheldRadioModel','hoardingModel','picketlineModel','metalBarrierModel','noticeSignsModel'] :
|
|
|
|
return getScreenPosition($platform.get_node('ShortcutToolModel').get_node(equipmentName))
|
2024-07-09 17:27:43 +08:00
|
|
|
elif equipmentName in ['hoardingAtEscalatorUp','hoardingAtEscalatorDown','picketlineModelAtB','picketlineModelAtA','picketlineModelAtGateB','picketlineModelAtGateA','noticeSignsModelAtAEntrance','noticeSignsModelAtBEntrance','noticeSignsModelAtCEntrance','noticeSignsModelAtDEntrance','metalBarrierModelAtCEntrance','metalBarrierModelAtStationHallCExit','metalBarrierModelAtDEntrance','metalBarrierModelAtStationHallDExit'] :
|
|
|
|
if equipmentName in ['metalBarrierModelAtCEntrance','metalBarrierModelAtDEntrance'] :
|
|
|
|
return Vector2(960,540)
|
|
|
|
var equipmentPos = getScreenPosition($platform.get_node('ShortcutToolModel2').get_node(equipmentName))
|
|
|
|
return Vector2(equipmentPos.x,equipmentPos.y-50)
|
2024-06-21 16:30:29 +08:00
|
|
|
else :
|
2024-07-05 18:22:52 +08:00
|
|
|
if equipmentName == 'StaionHallBack' :
|
|
|
|
return Vector2(1400,80)
|
|
|
|
else :
|
|
|
|
var cameraSwitchUi = $platform.get_node('CameraSwitchUi')
|
|
|
|
var cameraSwitchUiPos=NodeUtils.find_child_by_name(cameraSwitchUi,equipmentName).get_global_position()
|
|
|
|
return Vector2(cameraSwitchUiPos.x+40,cameraSwitchUiPos.y-20)
|
2024-06-21 16:30:29 +08:00
|
|
|
|
2024-05-14 15:58:28 +08:00
|
|
|
|
2024-06-21 16:30:29 +08:00
|
|
|
@onready var currentActiveCamera = $Camera3D
|
2024-05-14 15:58:28 +08:00
|
|
|
func getScreenPosition(node):
|
2024-06-21 16:30:29 +08:00
|
|
|
var screenPostion = currentActiveCamera.unproject_position(node.global_transform.origin)
|
2024-05-14 15:58:28 +08:00
|
|
|
return screenPostion
|
|
|
|
|
|
|
|
|
2024-05-12 17:08:52 +08:00
|
|
|
##所有交互操作汇总
|
2024-05-11 10:08:48 +08:00
|
|
|
const allClickEquipmentInfo = {
|
2024-05-13 16:48:48 +08:00
|
|
|
"LCB_Key1": "请选择LCB钥匙", ##钥匙面板
|
|
|
|
"LCB_Key2": "请选择LCB钥匙",
|
|
|
|
"LCB_Key3": "请选择LCB钥匙",
|
|
|
|
"LCB_Key4": "请选择LCB钥匙",
|
2024-05-15 11:14:14 +08:00
|
|
|
"JJTC_Key": "请选择紧急停车钥匙",
|
|
|
|
"PSL_Key": "请选择PSL钥匙",
|
|
|
|
"HSJC_Key": "请选择互锁解除钥匙",
|
|
|
|
"SDJS_Key": "请选择手动解锁钥匙",
|
2024-05-13 09:58:19 +08:00
|
|
|
"confirmUseKey": "请确认使用钥匙",
|
|
|
|
"LCB1": "请点击打开屏蔽门1的LCB面板", ##LCB以及LCB面板
|
|
|
|
"LCB2": "请点击打开屏蔽门2的LCB面板",
|
|
|
|
"LCB3": "请点击打开屏蔽门3的LCB面板",
|
|
|
|
"LCB4": "请点击打开屏蔽门4的LCB面板",
|
|
|
|
"LCB1LeftRotate": "请向左旋转LCB钥匙",
|
|
|
|
"LCB1RightRotate": "请向右旋转LCB钥匙",
|
|
|
|
"LCB2LeftRotate": "请向左旋转LCB钥匙",
|
|
|
|
"LCB2RightRotate": "请向右旋转LCB钥匙",
|
|
|
|
"LCB3LeftRotate": "请向左旋转LCB钥匙",
|
|
|
|
"LCB3RightRotate": "请向右旋转LCB钥匙",
|
|
|
|
"LCB4LeftRotate": "请向左旋转LCB钥匙",
|
|
|
|
"LCB4RightRotate": "请向右旋转LCB钥匙",
|
|
|
|
"removeKeyOfWindowLCB1": "请移除LCB钥匙",
|
|
|
|
"removeKeyOfWindowLCB2": "请移除LCB钥匙",
|
|
|
|
"removeKeyOfWindowLCB3": "请移除LCB钥匙",
|
|
|
|
"removeKeyOfWindowLCB4": "请移除LCB钥匙",
|
|
|
|
"PSL": "请打开PSL面板", ##PSL以及PSL面板
|
2024-05-29 15:18:03 +08:00
|
|
|
"PSLAllowLeftRotate": "请向左旋转",
|
|
|
|
"PSLAllowRightRotate": "请向右旋转",
|
|
|
|
"InterlockReleaseSwitchLeftRotate": "请向左旋转",
|
|
|
|
"InterlockReleaseSwitchRightRotate": "请向右旋转",
|
2024-05-13 09:58:19 +08:00
|
|
|
"CloseDoorButton": "请点击关门按钮",
|
|
|
|
"OpenDoorButton": "请点击开门按钮",
|
|
|
|
"LightTestButton": "请点击灯测试按钮",
|
|
|
|
"trainDepartsButton": "请点击发车按钮",
|
|
|
|
"interconnectedCloseButton": "请点击联动关门按钮",
|
2024-05-24 16:24:15 +08:00
|
|
|
"interconnectedOpenButton": "请点击联动开门按钮",
|
2024-05-13 09:58:19 +08:00
|
|
|
"removePSLKeyOfWindowPsl": "请移除PSK钥匙",
|
|
|
|
"removeHSJCKeyOfWindowPsl": "请移除互锁解除钥匙",
|
|
|
|
"JJTC": "请打开紧急停车面板", ##JJTC以及JJTC面板
|
2024-05-15 11:14:14 +08:00
|
|
|
"JJTCLeftRotate": "请向左旋转打开紧急停车按钮盒",
|
|
|
|
"JJTCRightRotate": "请向右旋转拔出紧急停车钥匙",
|
2024-05-13 09:58:19 +08:00
|
|
|
"JJTCButton": "请点击紧急停车按钮",
|
|
|
|
"JJTCCloseBox": "请点击盒子边框关闭紧急停车按钮盒",
|
|
|
|
"screenDoor1RightClick": "请右键点击屏蔽门1", ##屏蔽门右键以及屏蔽门右键面板
|
|
|
|
"screenDoor2RightClick": "请右键点击屏蔽门2",
|
|
|
|
"screenDoor3RightClick": "请右键点击屏蔽门3",
|
|
|
|
"screenDoor4RightClick": "请右键点击屏蔽门4",
|
|
|
|
"clickAdhesiveTapeOfscreenDoor1": "请选择粘贴胶带",
|
|
|
|
"clickIsolationStripOfscreenDoor1": "请选择放置隔离带",
|
|
|
|
"clickAdhesiveTapeOfscreenDoor2": "请选择粘贴胶带",
|
|
|
|
"clickIsolationStripOfscreenDoor2": "请选择放置隔离带",
|
|
|
|
"clickAdhesiveTapeOfscreenDoor3": "请选择粘贴胶带",
|
|
|
|
"clickIsolationStripOfscreenDoor3": "请选择放置隔离带",
|
|
|
|
"clickAdhesiveTapeOfscreenDoor4": "请选择粘贴胶带",
|
|
|
|
"clickIsolationStripOfscreenDoor4": "请选择放置隔离带",
|
2024-06-21 16:30:29 +08:00
|
|
|
"escalatorKey": "请选择电扶梯钥匙", ##快捷工具
|
|
|
|
"handheldRadio": "请选择手提广播",
|
|
|
|
"hoarding": "请选择围挡",
|
|
|
|
"picketline": "请选择警戒线",
|
|
|
|
"metalBarrier": "请选择铁马",
|
|
|
|
"noticeSigns": "请选择警示牌",
|
2024-07-05 18:22:52 +08:00
|
|
|
"escalatorKeyModel": "请选择电扶梯钥匙", ##快捷工具对应的模型
|
|
|
|
"handheldRadioModel": "请选择手提广播",
|
|
|
|
"hoardingModel": "请选择围挡",
|
|
|
|
"picketlineModel": "请选择警戒线",
|
|
|
|
"metalBarrierModel": "请选择铁马",
|
|
|
|
"noticeSignsModel": "请选择警示牌",
|
|
|
|
"hoardingAtEscalatorUp": "请选择围挡", ##快捷工具对应的模型2
|
|
|
|
"hoardingAtEscalatorDown": "请选择围挡",
|
|
|
|
"picketlineModelAtB": "请选择警戒线",
|
|
|
|
"picketlineModelAtA": "请选择警戒线",
|
|
|
|
"picketlineModelAtGateB": "请选择警戒线",
|
|
|
|
"picketlineModelAtGateA": "请选择警戒线",
|
|
|
|
"noticeSignsModelAtAEntrance": "请选择警示牌",
|
|
|
|
"noticeSignsModelAtBEntrance": "请选择警示牌",
|
|
|
|
"noticeSignsModelAtCEntrance": "请选择警示牌",
|
|
|
|
"noticeSignsModelAtDEntrance": "请选择警示牌",
|
|
|
|
"metalBarrierModelAtCEntrance": "请选择铁马",
|
2024-07-09 17:27:43 +08:00
|
|
|
"metalBarrierModelAtStationHallCExit": "请选择铁马",
|
2024-07-05 18:22:52 +08:00
|
|
|
"metalBarrierModelAtDEntrance": "请选择铁马",
|
2024-07-09 17:27:43 +08:00
|
|
|
"metalBarrierModelAtStationHallDExit": "请选择铁马",
|
2024-06-21 16:30:29 +08:00
|
|
|
"VehicleControlRoom": "请选择车控室视口", ##相机
|
|
|
|
"SparePartsCabinet": "请选择备品柜视口",
|
|
|
|
"PartsArea": "请选择备品区视口",
|
|
|
|
"StationHall": "请选择站厅视口",
|
|
|
|
"UpPlatform": "请选择上行站台视口",
|
|
|
|
"DownPlatform": "请选择下行站台视口",
|
2024-07-05 18:22:52 +08:00
|
|
|
"APassageway": "请选择A出入口视口",
|
2024-06-21 16:30:29 +08:00
|
|
|
"StationHallAExit": "请选择站厅A出口视口",
|
|
|
|
"AEntrance": "请选择A入口视口",
|
|
|
|
"APassage": "请选择A口通道视口",
|
2024-07-05 18:22:52 +08:00
|
|
|
"BPassageway": "请选择B出入口视口",
|
2024-06-21 16:30:29 +08:00
|
|
|
"StationHallBExit": "请选择站厅B出口视口",
|
|
|
|
"BEntrance": "请选择B入口视口",
|
|
|
|
"BPassage": "请选择B口通道视口",
|
|
|
|
"CPassageway": "请选择C出入口视口",
|
|
|
|
"StationHallCExit": "请选择站厅C出口视口",
|
|
|
|
"CEntrance": "请选择C入口视口",
|
|
|
|
"CPassage": "请选择C口通道视口",
|
|
|
|
"DPassageway": "请选择D出入口视口",
|
|
|
|
"StationHallDExit": "请选择站厅D出口视口",
|
|
|
|
"DEntrance": "请选择D入口视口",
|
|
|
|
"DPassage": "请选择D口通道视口",
|
|
|
|
"StaionHallA": "请选择站厅A端视口",
|
|
|
|
"ALowerStepSwitch": "请选择A端扶梯下部开关视口",
|
|
|
|
"ATVM": "请选择A端TVM视口",
|
|
|
|
"AInboundGate": "请选择A端进站闸机视口",
|
|
|
|
"AExitGate": "请选择A端出站闸机视口",
|
|
|
|
"AUpperStep": "请选择A端扶梯上部视口",
|
|
|
|
"ALowerStep": "请选择A端扶梯下部视口",
|
|
|
|
"AGangway": "请选择A端站厅步梯口视口",
|
|
|
|
"StationHallB": "请选择站厅B端视口",
|
|
|
|
"BLowerStepSwitch": "请选择B端扶梯下部开关视口",
|
|
|
|
"BTVM": "请选择B端TVM视口",
|
|
|
|
"BInboundGate": "请选择B端进站闸机视口",
|
|
|
|
"BExitGate": "请选择B端出站闸机视口",
|
|
|
|
"BUpperStep": "请选择B端扶梯上部视口",
|
|
|
|
"BLowerStep": "请选择B端扶梯下部视口",
|
|
|
|
"BGangway": "请选择B端站厅步梯口视口",
|
|
|
|
"Back": "请选择返回上级视口",
|
2024-07-05 18:22:52 +08:00
|
|
|
"StaionHallBack": "请选择返回上级视口",
|
2024-05-11 10:08:48 +08:00
|
|
|
}
|
2024-05-16 15:25:28 +08:00
|
|
|
|
|
|
|
func _ready():
|
|
|
|
var stationKeys = $platform.get_node('stationKeys')
|
|
|
|
var psl = $platform.get_node('psl')
|
|
|
|
stationKeys.visible = true
|
|
|
|
stationKeys.position = Vector2(2100,1100)
|
|
|
|
psl.visible = true
|
|
|
|
psl.position = Vector2(2100,1100)
|
2024-06-20 10:28:46 +08:00
|
|
|
$AllTimer/openAllwindow.start()
|
2024-05-16 15:25:28 +08:00
|
|
|
|
|
|
|
|
|
|
|
func _on_open_allwindow_timeout() -> void:
|
|
|
|
var stationKeys = $platform.get_node('stationKeys')
|
|
|
|
var psl = $platform.get_node('psl')
|
|
|
|
stationKeys.visible = false
|
|
|
|
stationKeys.position = Vector2(1133,325)
|
|
|
|
psl.visible = false
|
|
|
|
psl.position = Vector2(568,190)
|