godot-psd-training/sceen/total.gd

125 lines
3.6 KiB
GDScript3
Raw Normal View History

extends Node3D
class_name TotalScene
##车来且开屏蔽门和车门
func trainComeAndOpenScreenDoor ()-> void:
$train.trainCome()
$BeginTimer.start()
func _on_beginTimer_timeout() -> void:
$train.openLeftTrainDoorALL()
$platform.openScreenDoorALL()
##关屏蔽门和车门且车走
func closeScreenDoorAndTrainLeave ()-> void:
closeScreenDoor()
$EndTimer.start()
func _on_end_timer_timeout() -> void:
trainLeave()
##关屏蔽门和车门
func closeScreenDoor() -> void:
$train.closeLeftTrainDoorALL()
$platform.closeScreenDoorALL()
##车走
func trainLeave() -> void:
$train.trainLeave()
## 屏蔽门名字的枚举
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)
##设置指定屏蔽门关门故障
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-08 16:15:27 +08:00
func setAssignScreenDoorsFault (screenDoorNames:Array,faultType:ScreenDoor.ScreenDoor_Fault_State)-> void:
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)
##所有交互操作汇总
func _on_platform_all_click_platform_signal(equipmentName: String,equipmentInfo=null) -> void:
print(equipmentName,equipmentInfo,6666)
const allClickEquipmentInfo = {
2024-05-11 14:10:07 +08:00
"LCB_Key1": "hhh", ##钥匙面板
"LCB_Key2": "hhh",
"LCB_Key3": "hhh",
"LCB_Key4": "hhh",
"JJTC_Key": "hhh",
"PSL_Key": "hhh",
"HSJC_Key": "hhh",
"SDJS_Key": "hhh",
"confirmUseKey": "hhh",
2024-05-11 14:10:07 +08:00
"LCB1": "hhh", ##LCB以及LCB面板
"LCB2": "hhh",
"LCB3": "hhh",
"LCB4": "hhh",
"LCB1LeftRotate": "hhh",
"LCB1RightRotate": "hhh",
"LCB2LeftRotate": "hhh",
"LCB2RightRotate": "hhh",
"LCB3LeftRotate": "hhh",
"LCB3RightRotate": "hhh",
"LCB4LeftRotate": "hhh",
"LCB4RightRotate": "hhh",
"removeKeyOfWindowLCB1": "hhh",
"removeKeyOfWindowLCB2": "hhh",
"removeKeyOfWindowLCB3": "hhh",
"removeKeyOfWindowLCB4": "hhh",
"PSL": "hhh", ##PSL以及PSL面板
"PSLAllow": "hhh",
"CloseDoorButton": "hhh",
"OpenDoorButton": "hhh",
"InterlockReleaseSwitch": "hhh",
"LightTestButton": "hhh",
"trainDepartsButton": "hhh",
"interconnectedCloseButton": "hhh",
"interconnectedOpenButton": "hhh",
2024-05-11 14:10:07 +08:00
"removePSLKeyOfWindowPsl": "hhh",
"removeHSJCKeyOfWindowPsl": "hhh",
"JJTC": "hhh", ##JJTC以及JJTC面板
"JJTCLeftRotate": "hhh",
"JJTCRightRotate": "hhh",
"JJTCButton": "hhh",
"JJTCCloseBox": "hhh",
"screenDoor1RightClick": "hhh", ##屏蔽门右键以及屏蔽门右键面板
"screenDoor2RightClick": "hhh",
"screenDoor3RightClick": "hhh",
"screenDoor4RightClick": "hhh",
"clickAdhesiveTapeOfscreenDoor1": "hhh",
"clickIsolationStripOfscreenDoor1": "hhh",
"clickAdhesiveTapeOfscreenDoor2": "hhh",
"clickIsolationStripOfscreenDoor2": "hhh",
"clickAdhesiveTapeOfscreenDoor3": "hhh",
"clickIsolationStripOfscreenDoor3": "hhh",
"clickAdhesiveTapeOfscreenDoor4": "hhh",
"clickIsolationStripOfscreenDoor4": "hhh",
}