diff --git a/Assets/training_speech/trainingTotalCloseDoorFault/zlgzmhfzc.mp3 b/Assets/training_speech/trainingTotalCloseDoorFault/zlgzmhfzc.mp3 new file mode 100644 index 0000000..a2730e0 Binary files /dev/null and b/Assets/training_speech/trainingTotalCloseDoorFault/zlgzmhfzc.mp3 differ diff --git a/Assets/training_speech/trainingTotalCloseDoorFault/zlgzmhfzc.mp3.import b/Assets/training_speech/trainingTotalCloseDoorFault/zlgzmhfzc.mp3.import new file mode 100644 index 0000000..99dfb20 --- /dev/null +++ b/Assets/training_speech/trainingTotalCloseDoorFault/zlgzmhfzc.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://davy4joh1hxjq" +path="res://.godot/imported/zlgzmhfzc.mp3-75704ef52c89043d189a6001a17cf5d2.mp3str" + +[deps] + +source_file="res://Assets/training_speech/trainingTotalCloseDoorFault/zlgzmhfzc.mp3" +dest_files=["res://.godot/imported/zlgzmhfzc.mp3-75704ef52c89043d189a6001a17cf5d2.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/README.md b/README.md index 9184c66..fe1cb2b 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,12 @@ - scene_loader.tscn: 作为入口场景,主要用于根据URL参数加载对应的实训场景 - /trainings: 目录下为实训场景 - /addons: 目录为第三方插件/工具 + +## 发布到线上工作流 +1. 本地使用导出功能导出Web到target/index.html +2. 本地使用如7z压缩工具将导出的target目录添加到压缩文件(格式选tar)为target.tar +3. 在gitea项目管理界面版本发布处发布新版 +![alt text](image.png) +标签名称、发布标题和版本描述按实际填写,然后将打包的target.tar拖拽上传,完成后点击发布版本 +![alt text](image-1.png) +4. 上面发布版本后会触发gitea action工作流执行发不到线上 diff --git a/image-1.png b/image-1.png new file mode 100644 index 0000000..dc36e73 Binary files /dev/null and b/image-1.png differ diff --git a/image-1.png.import b/image-1.png.import new file mode 100644 index 0000000..9f5c651 --- /dev/null +++ b/image-1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bje4ghm8jm6k2" +path="res://.godot/imported/image-1.png-dbab14dd40403047ee602a1bb16c5f26.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://image-1.png" +dest_files=["res://.godot/imported/image-1.png-dbab14dd40403047ee602a1bb16c5f26.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/image.png b/image.png new file mode 100644 index 0000000..30febf9 Binary files /dev/null and b/image.png differ diff --git a/image.png.import b/image.png.import new file mode 100644 index 0000000..1811196 --- /dev/null +++ b/image.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cbggvmes7qsi3" +path="res://.godot/imported/image.png-2de165adb17dfebcee8a7cd6c9833936.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://image.png" +dest_files=["res://.godot/imported/image.png-2de165adb17dfebcee8a7cd6c9833936.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/sceen/total.gd b/sceen/total.gd index 6cb32fb..a964b6b 100644 --- a/sceen/total.gd +++ b/sceen/total.gd @@ -4,9 +4,8 @@ class_name TotalScene ##车来且开屏蔽门和车门 func trainComeAndOpenScreenDoor ()-> void: - if $platform.allScreenDoorClose() : - $trainComeDelay.start() - $trainComing.play() + $trainComeDelay.start() + $trainComing.play() func _on_train_come_delay_timeout() -> void: $train.trainCome() diff --git a/trainings/trainingManyCloseDoorFault/trainingManyCloseDoorFault.gd b/trainings/trainingManyCloseDoorFault/trainingManyCloseDoorFault.gd new file mode 100644 index 0000000..6498c56 --- /dev/null +++ b/trainings/trainingManyCloseDoorFault/trainingManyCloseDoorFault.gd @@ -0,0 +1,269 @@ +extends Node + +## 实训名称 +@export var trainingName: String = "实训" +## 场景描述 +@export var trainingDesc: String = "场景描述" + +var stepOperation = [] + +var handleStep = [ + { + "stepName": "发现故障 步骤一:站务员手指:上行2号、3号故障门门头灯。步骤二:站务员口呼:多门关门故障。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "多门关门故障。" + }, + { + "stepName": "现场处置 步骤一:站务员用对讲机汇报值班员:值班员,上行多门关门故障,操作PSL互锁解除发车。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "值班员,上行多门关门故障,操作PSL互锁解除发车。" + }, + { + "stepName": "步骤二:值班员回复:收到。", + "stepOperation": [], + "next": false, + "play": true, + "playPath": "res://Assets/training_speech/sd.mp3", + "stepTip": false, + "checkVoice": "", + }, + { + "stepName": "步骤三:站务员用对讲机汇报值班站长:值班站长,上行多门关门故障,请派人看护故障站台门。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "值班站长,上行多门关门故障,请派人看护故障站台门。" + }, + { + "stepName": "步骤四:值班站长(机器人)自动回复:收到。", + "stepOperation": [], + "next": false, + "play": true, + "playPath": "res://Assets/training_speech/sd.mp3", + "stepTip": false, + "checkVoice": "", + }, + { + "stepName": "步骤五:站务员使用互锁解除发车:将上行PSL互锁解除开关钥匙旋转至互锁解除位,互锁解除指示灯点亮,并保持互锁解除位。", + "stepOperation": ["PSL","HSJC_Key","confirmUseKey","InterlockReleaseSwitchRightRotate"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤六:确认列车车尾超过站台安全门端门。站务员口呼:列车已发出。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "列车已发出。" + }, + { + "stepName": "步骤七:站务员松开上行PSL互锁解除开关钥匙,并取出钥匙,互锁解除指示灯熄灭。", + "stepOperation": ["InterlockReleaseSwitchLeftRotate","removeHSJCKeyOfWindowPsl"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤八:站务员用两套LCB钥匙分别将2号、3号故障门LCB转至“关门”位置。", + "stepOperation": ["LCB2","LCB_Key2","confirmUseKey","LCB2RightRotate","LCB3","LCB_Key3","confirmUseKey","LCB3RightRotate"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤九:确认故障门关闭。站务员口呼:关门成功。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "关门成功。" + }, + { + "stepName": "步骤十:系统提示“维修人员通知现场故障已修复", + "stepOperation": [], + "next": false, + "checkVoice": "", + "play": true, + "playPath": "res://Assets/training_speech/trainingTotalPlatformDoorFault/gzmyxf.mp3", + "stepTip": false, + }, + { + "stepName": "步骤十一:站务员口呼:故障门处置完毕。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "故障门处置完毕。" + }, + { + "stepName": "步骤十二:站务员用LCB钥匙将2号故障门LCB转至“自动”位置,并取出钥匙。", + "stepOperation": ["LCB2","LCB2LeftRotate","removeKeyOfWindowLCB2"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤十三:站务员用LCB钥匙将3号故障门LCB转至“自动”位置,并取出钥匙。", + "stepOperation": ["LCB3","LCB3LeftRotate","removeKeyOfWindowLCB3"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤十四:站务员用对讲机汇报值班员、值班站长:值班员、值班站长,上行多门故障已处理完毕。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "值班员、值班站长,上行多门故障已处理完毕。" + }, + { + "stepName": "步骤十五:值班员回复:收到。步骤十六:值班站长(机器人)自动回复:收到。", + "stepOperation": [], + "next": false, + "checkVoice": "", + "play": true, + "playPath": "res://Assets/training_speech/sd.mp3", + "stepTip": false, + }, + { + "stepName": "实训已完成!", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "", + }, +] + +## 步骤操作执行index +var stepOperationIndex = 0 + +## 步骤执行index +var handleStepIndex = 0 + +func _ready(): + $TrainingDescDialog.title = trainingName + $TrainingDescDialog.updateSceneDesc(trainingDesc) + $TrainingDescDialog.grab_focus() + stepOperationIndex = 0 + handleStepIndex = 0 + + +func _on_training_desc_dialog_start_training(): + $total.trainComeAndOpenScreenDoor() + $total.setAssignScreenDoorsCloseFault([TotalScene.ScreenDoor_name.screenDoor2,TotalScene.ScreenDoor_name.screenDoor3]) + + +func nextStep(): + if handleStepIndex < handleStep.size(): + var step = handleStep[handleStepIndex] + handleStepIndex = handleStepIndex + 1 + if step.stepTip == true and $total.trainingMode != TotalScene.Training_Mode.Exam: + $StepTip.updateOperationTip(step.stepName) + if step.stepOperation.size() > 0: + initStepOperation() + if step.next == true: + $StepTimer.connect("timeout", nextStep) + $StepTimer.start() + if step.checkVoice: + await $VoiceCommunication.speech_record_check(step.checkVoice) + if step.stepName != "步骤九:确认故障门关闭。站务员口呼:关门成功。": + nextStep() + else : + $maintainerTimer.start() + if step.play: + var sound = load(step.playPath) + await $VoiceCommunication.play_reply(sound) + if step.stepName != "步骤十:系统提示“维修人员通知现场故障已修复": + nextStep() + if step.stepName == "实训已完成!": + $total.trainLeave() + +func setOperationNodeAndTip(): + $total.currenNeedClickNode = stepOperation[stepOperationIndex] + if $total.trainingMode == TotalScene.Training_Mode.Teach: + $TrainTip.setTrainingTip($total.allClickEquipmentInfo[stepOperation[stepOperationIndex]]) + +func initStepOperation(): + stepOperation = handleStep[handleStepIndex-1].stepOperation + stepOperationIndex = 0 + setOperationNodeAndTip() + +##与站台交互点击信号 +func _on_total_current_click_check_signal(isCorrect): + if isCorrect: + if $total.currentClickNode == 'InterlockReleaseSwitchRightRotate' : + $total.trainLeave(true) + stepOperationIndex = stepOperationIndex + 1 + $StepJudgment.hideError() + if stepOperationIndex < stepOperation.size(): + setOperationNodeAndTip() + elif $total.currentClickNode != 'LCB3RightRotate' : + $TrainTip.setTrainingTip('') + nextStep() + else : + $TrainTip.setTrainingTip('') + else: + if $total.trainingMode != TotalScene.Training_Mode.Exam: + $StepJudgment.showError() + + +##开门信号 +func _on_total_screen_door_open_confirm_signal(screenDoor): + if screenDoor.name == "screenDoor1" : + $CloseScreenDoorTimer.start() + +##关门信号 +func _on_total_screen_door_close_confirm_signal(screenDoor): + if screenDoor.name == "screenDoor1" or screenDoor.name == "screenDoor3": + nextStep() + + +func _on_close_screen_door_timer_timeout() -> void: + $total.closeScreenDoor() + + +func _on_fault_tip_dialog_comfirm_signal() -> void: + nextStep() + + +func _on_maintainer_timer_timeout() -> void: + nextStep() + $FaultTipDialog.show() + + +func _on_confirm_dialog_two_cancel(): + get_tree().paused = false + + +func _on_confirm_dialog_two_confirm(): + get_tree().paused = false + get_tree().reload_current_scene() diff --git a/trainings/trainingManyCloseDoorFault/trainingManyCloseDoorFault.tscn b/trainings/trainingManyCloseDoorFault/trainingManyCloseDoorFault.tscn new file mode 100644 index 0000000..547b1a7 --- /dev/null +++ b/trainings/trainingManyCloseDoorFault/trainingManyCloseDoorFault.tscn @@ -0,0 +1,58 @@ +[gd_scene load_steps=10 format=3 uid="uid://nkjskkkwlbc5"] + +[ext_resource type="Script" path="res://trainings/trainingManyCloseDoorFault/trainingManyCloseDoorFault.gd" id="1_1ymk7"] +[ext_resource type="PackedScene" uid="uid://qh8b3g6n3k2u" path="res://trainings/training_desc_dialog.tscn" id="2_qfrwf"] +[ext_resource type="PackedScene" uid="uid://btcksdsburk7t" path="res://sceen/total.tscn" id="3_28hir"] +[ext_resource type="PackedScene" uid="uid://b055j66siytth" path="res://trainings/faultTip/fault_tip_dialog.tscn" id="3_hjh3m"] +[ext_resource type="PackedScene" uid="uid://6lortgihx5jy" path="res://Communication/voice_communication.tscn" id="4_scxms"] +[ext_resource type="PackedScene" uid="uid://ckoxw6kgpjyhd" path="res://trainings/trainTip.tscn" id="5_u0i85"] +[ext_resource type="PackedScene" uid="uid://b41vwoibfy5c6" path="res://trainings/stepJudgment.tscn" id="6_vr0l8"] +[ext_resource type="PackedScene" uid="uid://b3whbe3mau53w" path="res://trainings/confirmDialog/confirmDialog.tscn" id="7_34up4"] +[ext_resource type="PackedScene" uid="uid://yhr1n6e2m2b6" path="res://trainings/stepTip/stepTip.tscn" id="8_qv08t"] + +[node name="trainingManyCloseDoorFault" type="Node"] +script = ExtResource("1_1ymk7") +trainingName = "站台多档滑动门关门故障处置" +trainingDesc = "列车关门时遇2个以上多节列车对应站台门无法正常关闭,故障门门头灯常亮。" + +[node name="TrainingDescDialog" parent="." instance=ExtResource("2_qfrwf")] + +[node name="FaultTipDialog" parent="." instance=ExtResource("3_hjh3m")] +visible = false +tipDesc = "维修人员通知现场故障已修复" + +[node name="total" parent="." instance=ExtResource("3_28hir")] + +[node name="CloseScreenDoorTimer" type="Timer" parent="."] +wait_time = 15.0 +one_shot = true + +[node name="VoiceCommunication" parent="." instance=ExtResource("4_scxms")] + +[node name="TrainTip" parent="." instance=ExtResource("5_u0i85")] + +[node name="StepJudgment" parent="." instance=ExtResource("6_vr0l8")] + +[node name="ConfirmDialog" parent="." instance=ExtResource("7_34up4")] +visible = false + +[node name="StepTip" parent="." instance=ExtResource("8_qv08t")] + +[node name="StepTimer" type="Timer" parent="."] +wait_time = 3.0 +one_shot = true + +[node name="maintainerTimer" type="Timer" parent="."] +wait_time = 3.0 +one_shot = true + +[connection signal="StartTraining" from="TrainingDescDialog" to="." method="_on_training_desc_dialog_start_training"] +[connection signal="close_requested" from="TrainingDescDialog" to="TrainingDescDialog" method="_on_close_requested"] +[connection signal="comfirmSignal" from="FaultTipDialog" to="." method="_on_fault_tip_dialog_comfirm_signal"] +[connection signal="currentClickCheckSignal" from="total" to="." method="_on_total_current_click_check_signal"] +[connection signal="screenDoorCloseConfirmSignal" from="total" to="." method="_on_total_screen_door_close_confirm_signal"] +[connection signal="screenDoorOpenConfirmSignal" from="total" to="." method="_on_total_screen_door_open_confirm_signal"] +[connection signal="timeout" from="CloseScreenDoorTimer" to="." method="_on_close_screen_door_timer_timeout"] +[connection signal="two_cancel" from="ConfirmDialog" to="." method="_on_confirm_dialog_two_cancel"] +[connection signal="two_confirm" from="ConfirmDialog" to="." method="_on_confirm_dialog_two_confirm"] +[connection signal="timeout" from="maintainerTimer" to="." method="_on_maintainer_timer_timeout"] diff --git a/trainings/trainingTotalCloseDoorFault/trainingTotalCloseDoorFault.gd b/trainings/trainingTotalCloseDoorFault/trainingTotalCloseDoorFault.gd new file mode 100644 index 0000000..b99a240 --- /dev/null +++ b/trainings/trainingTotalCloseDoorFault/trainingTotalCloseDoorFault.gd @@ -0,0 +1,294 @@ +extends Node + +## 实训名称 +@export var trainingName: String = "实训" +## 场景描述 +@export var trainingDesc: String = "场景描述" + +var stepOperation = [] + +var handleStep = [ + { + "stepName": "发现故障 步骤一:站务员手指:上行整列故障门门头灯亮,列车已关门。步骤二:站务员口呼:上行整列关门故障,列车已关门。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "上行整列关门故障,列车已关门。" + }, + { + "stepName": "现场处置 步骤一:用对讲机汇报值班员:值班员,上行整列站台门关门故障,操作PSL互锁解除,使列车尽快发出。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "值班员,上行整列站台门关门故障,操作PSL互锁解除,使列车尽快发出。" + }, + { + "stepName": "步骤二:值班员回复:收到。", + "stepOperation": [], + "next": false, + "play": true, + "playPath": "res://Assets/training_speech/sd.mp3", + "stepTip": false, + "checkVoice": "", + }, + { + "stepName": "步骤三:用对讲机汇报值班站长:值班站长,上行整列站台门关门故障,请派人看护故障门。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "值班站长,上行整列站台门关门故障,请派人看护故障门。" + }, + { + "stepName": "步骤四:值班站长(机器人)自动回复:收到。", + "stepOperation": [], + "next": false, + "play": true, + "playPath": "res://Assets/training_speech/sd.mp3", + "stepTip": false, + "checkVoice": "", + }, + { + "stepName": "步骤五:站务员使用互锁解除发车:将上行PSL互锁解除开关钥匙旋转至互锁解除位,互锁解除指示灯点亮,并保持互锁解除位。", + "stepOperation": ["PSL","HSJC_Key","confirmUseKey","InterlockReleaseSwitchRightRotate"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤六:确认列车车尾超过站台安全门端门。站务员口呼:列车已发出。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "列车已发出。" + }, + { + "stepName": "步骤七:站务员松开上行PSL互锁解除开关钥匙,并取出钥匙,互锁解除指示灯熄灭。", + "stepOperation": ["InterlockReleaseSwitchLeftRotate","removeHSJCKeyOfWindowPsl"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤八:故障未能修复,口呼:故障未修复,使用互锁解除接入进站列车。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "故障未修复,使用互锁解除接入进站列车。" + }, + { + "stepName": "步骤九:继续在PSL处。口呼:列车即将进站。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "列车即将进站。" + }, + { + "stepName": "步骤十:站务员使用互锁解除接车:将上行PSL互锁解除钥匙开关旋转至互锁解除位,互锁解除指示灯点亮,并保持互锁解除位。", + "stepOperation": ["PSL","HSJC_Key","confirmUseKey","InterlockReleaseSwitchRightRotate"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤十一:确认列车停稳后,口呼:整列列车进站停稳。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "列车即将进站。" + }, + { + "stepName": "步骤十二:站务员松开上行PSL互锁解除开关钥匙,并取出钥匙,互锁解除指示灯熄灭。", + "stepOperation": ["InterlockReleaseSwitchLeftRotate","removeHSJCKeyOfWindowPsl"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤十三:整列故障门恢复正常:系统提示“整列故障门恢复正常”。", + "stepOperation": [], + "next": false, + "play": true, + "playPath": "res://Assets/training_speech/trainingTotalCloseDoorFault/zlgzmhfzc.mp3", + "stepTip": false, + "checkVoice": "", + }, + { + "stepName": "步骤十四:口呼:故障门处置完毕。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "故障门处置完毕。" + }, + { + "stepName": "步骤十五:列车正常发出,用对讲机汇报值班员、值班站长:值班员、值班站长,上行整列故障门已处理完毕。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "值班员、值班站长,上行整列故障门已处理完毕。" + }, + { + "stepName": "步骤十六:值班员回复:收到。步骤十七:值班站长(机器人)自动回复:收到。", + "stepOperation": [], + "next": false, + "checkVoice": "", + "play": true, + "playPath": "res://Assets/training_speech/sd.mp3", + "stepTip": false, + }, + { + "stepName": "实训已完成!", + "stepOperation": [], + "next": false, + "checkVoice": "", + "play": false, + "playPath": "", + "stepTip": true, + }, +] + +## 步骤操作执行index +var stepOperationIndex = 0 + +## 步骤执行index +var handleStepIndex = 0 + +func _ready(): + $TrainingDescDialog.title = trainingName + $TrainingDescDialog.updateSceneDesc(trainingDesc) + $TrainingDescDialog.grab_focus() + stepOperationIndex = 0 + handleStepIndex = 0 + +var allScreenDoor = [TotalScene.ScreenDoor_name.screenDoor1,TotalScene.ScreenDoor_name.screenDoor2,TotalScene.ScreenDoor_name.screenDoor3,TotalScene.ScreenDoor_name.screenDoor4] +func _on_training_desc_dialog_start_training(): + $total.trainComeAndOpenScreenDoor() + $total.setAssignScreenDoorsCloseFault(allScreenDoor) + + +func nextStep(): + if handleStepIndex < handleStep.size(): + var step = handleStep[handleStepIndex] + handleStepIndex = handleStepIndex + 1 + if step.stepTip == true and $total.trainingMode != TotalScene.Training_Mode.Exam: + $StepTip.updateOperationTip(step.stepName) + if step.stepOperation.size() > 0: + initStepOperation() + if step.next == true: + $StepTimer.connect("timeout", nextStep) + $StepTimer.start() + if step.checkVoice: + await $VoiceCommunication.speech_record_check(step.checkVoice) + nextStep() + if step.stepName == "步骤十四:口呼:故障门处置完毕。" : + $total.removeAssignScreenDoorsFault(allScreenDoor) + $total.closeScreenDoorAndTrainLeave() + if step.play: + var sound = load(step.playPath) + await $VoiceCommunication.play_reply(sound) + if step.stepName != "步骤十三:整列故障门恢复正常:系统提示“整列故障门恢复正常”。": + nextStep() + + +func setOperationNodeAndTip(): + $total.currenNeedClickNode = stepOperation[stepOperationIndex] + if $total.trainingMode == TotalScene.Training_Mode.Teach: + $TrainTip.setTrainingTip($total.allClickEquipmentInfo[stepOperation[stepOperationIndex]]) + +func initStepOperation(): + stepOperation = handleStep[handleStepIndex-1].stepOperation + stepOperationIndex = 0 + setOperationNodeAndTip() + +##与站台交互点击信号 +func _on_total_current_click_check_signal(isCorrect): + if isCorrect: + if $total.currentClickNode == 'InterlockReleaseSwitchRightRotate' and handleStepIndex<9 : + $total.trainLeave(true) + nextStep() + elif $total.currentClickNode == 'InterlockReleaseSwitchRightRotate' : + $total.trainComeAndOpenScreenDoor() + $playOpenDoorMusicTimer.start() + elif $total.currentClickNode == 'removeHSJCKeyOfWindowPsl' and handleStepIndex<9 : + nextStep() + elif $total.currentClickNode == 'removeHSJCKeyOfWindowPsl' : + $maintainerTimer.start() + stepOperationIndex = stepOperationIndex + 1 + $StepJudgment.hideError() + if stepOperationIndex < stepOperation.size(): + setOperationNodeAndTip() + else : + $TrainTip.setTrainingTip('') + else: + if $total.trainingMode != TotalScene.Training_Mode.Exam: + $StepJudgment.showError() + + +##车门开门信号 +var firstOpen = true +func _on_total_train_door_open_confirm_signal(trainDoor: TrainDoor) -> void: + if trainDoor.name == "trainDoor1" and firstOpen: + $CloseScreenDoorTimer.start() + firstOpen = false + elif trainDoor.name == "trainDoor1" : + nextStep() + +##车门关门信号 +var firstClose = true +func _on_total_train_door_close_confirm_signal(trainDoor: TrainDoor) -> void: + if trainDoor.name == "trainDoor1" and firstClose: + $FaultTipDialog.show() + firstClose = false + + +func _on_close_screen_door_timer_timeout() -> void: + $total.closeScreenDoor() + $AudioStreamPlayer.play() + + +func _on_fault_tip_dialog_comfirm_signal() -> void: + nextStep() + + +func _on_maintainer_timer_timeout() -> void: + nextStep() + $FaultTipDialog.show() + $FaultTipDialog.updateSceneDesc('整列故障门恢复正常!') + + +func _on_play_open_door_music_timer_timeout() -> void: + $AudioStreamPlayer.play() + + +func _on_confirm_dialog_two_cancel(): + get_tree().paused = false + + +func _on_confirm_dialog_two_confirm(): + get_tree().paused = false + get_tree().reload_current_scene() diff --git a/trainings/trainingTotalCloseDoorFault/trainingTotalCloseDoorFault.tscn b/trainings/trainingTotalCloseDoorFault/trainingTotalCloseDoorFault.tscn new file mode 100644 index 0000000..a0416f2 --- /dev/null +++ b/trainings/trainingTotalCloseDoorFault/trainingTotalCloseDoorFault.tscn @@ -0,0 +1,70 @@ +[gd_scene load_steps=11 format=3 uid="uid://nkjskkkwlbc5"] + +[ext_resource type="Script" path="res://trainings/trainingTotalCloseDoorFault/trainingTotalCloseDoorFault.gd" id="1_2opb8"] +[ext_resource type="PackedScene" uid="uid://qh8b3g6n3k2u" path="res://trainings/training_desc_dialog.tscn" id="2_qfrwf"] +[ext_resource type="PackedScene" uid="uid://btcksdsburk7t" path="res://sceen/total.tscn" id="3_28hir"] +[ext_resource type="PackedScene" uid="uid://b055j66siytth" path="res://trainings/faultTip/fault_tip_dialog.tscn" id="3_w7ff0"] +[ext_resource type="PackedScene" uid="uid://6lortgihx5jy" path="res://Communication/voice_communication.tscn" id="4_scxms"] +[ext_resource type="PackedScene" uid="uid://ckoxw6kgpjyhd" path="res://trainings/trainTip.tscn" id="5_u0i85"] +[ext_resource type="PackedScene" uid="uid://b41vwoibfy5c6" path="res://trainings/stepJudgment.tscn" id="6_vr0l8"] +[ext_resource type="PackedScene" uid="uid://b3whbe3mau53w" path="res://trainings/confirmDialog/confirmDialog.tscn" id="7_34up4"] +[ext_resource type="PackedScene" uid="uid://yhr1n6e2m2b6" path="res://trainings/stepTip/stepTip.tscn" id="8_qv08t"] +[ext_resource type="AudioStream" uid="uid://cro2lflu8b2ai" path="res://Assets/music/地铁关门警示音.mp3" id="10_pxil1"] + +[node name="trainingTotalCloseDoorFault" type="Node"] +script = ExtResource("1_2opb8") +trainingName = "站台整侧滑动门关门故障处置" +trainingDesc = "列车出站关门时,整列站台门无法正常关闭,门头灯常亮,通知司机,得知司机操作PSL关门后整列站台门仍不能关闭。" + +[node name="TrainingDescDialog" parent="." instance=ExtResource("2_qfrwf")] + +[node name="FaultTipDialog" parent="." instance=ExtResource("3_w7ff0")] +visible = false +tipDesc = "PSL关闭站台门无效。" + +[node name="total" parent="." instance=ExtResource("3_28hir")] + +[node name="CloseScreenDoorTimer" type="Timer" parent="."] +wait_time = 15.0 +one_shot = true + +[node name="VoiceCommunication" parent="." instance=ExtResource("4_scxms")] + +[node name="TrainTip" parent="." instance=ExtResource("5_u0i85")] + +[node name="StepJudgment" parent="." instance=ExtResource("6_vr0l8")] + +[node name="ConfirmDialog" parent="." instance=ExtResource("7_34up4")] +visible = false + +[node name="StepTip" parent="." instance=ExtResource("8_qv08t")] + +[node name="StepTimer" type="Timer" parent="."] +wait_time = 3.0 +one_shot = true + +[node name="maintainerTimer" type="Timer" parent="."] +wait_time = 3.0 +one_shot = true + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource("10_pxil1") +volume_db = -5.0 + +[node name="playOpenDoorMusicTimer" type="Timer" parent="."] +wait_time = 8.0 +one_shot = true + +[connection signal="StartTraining" from="TrainingDescDialog" to="." method="_on_training_desc_dialog_start_training"] +[connection signal="close_requested" from="TrainingDescDialog" to="TrainingDescDialog" method="_on_close_requested"] +[connection signal="comfirmSignal" from="FaultTipDialog" to="." method="_on_fault_tip_dialog_comfirm_signal"] +[connection signal="currentClickCheckSignal" from="total" to="." method="_on_total_current_click_check_signal"] +[connection signal="screenDoorCloseConfirmSignal" from="total" to="." method="_on_total_screen_door_close_confirm_signal"] +[connection signal="screenDoorOpenConfirmSignal" from="total" to="." method="_on_total_screen_door_open_confirm_signal"] +[connection signal="trainDoorCloseConfirmSignal" from="total" to="." method="_on_total_train_door_close_confirm_signal"] +[connection signal="trainDoorOpenConfirmSignal" from="total" to="." method="_on_total_train_door_open_confirm_signal"] +[connection signal="timeout" from="CloseScreenDoorTimer" to="." method="_on_close_screen_door_timer_timeout"] +[connection signal="two_cancel" from="ConfirmDialog" to="." method="_on_confirm_dialog_two_cancel"] +[connection signal="two_confirm" from="ConfirmDialog" to="." method="_on_confirm_dialog_two_confirm"] +[connection signal="timeout" from="maintainerTimer" to="." method="_on_maintainer_timer_timeout"] +[connection signal="timeout" from="playOpenDoorMusicTimer" to="." method="_on_play_open_door_music_timer_timeout"] diff --git a/trainings/trainingTotalOpenDoorFault/trainingTotalOpenDoorFault.gd b/trainings/trainingTotalOpenDoorFault/trainingTotalOpenDoorFault.gd index 582ea26..5f00bc7 100644 --- a/trainings/trainingTotalOpenDoorFault/trainingTotalOpenDoorFault.gd +++ b/trainings/trainingTotalOpenDoorFault/trainingTotalOpenDoorFault.gd @@ -179,9 +179,9 @@ func nextStep(): $StepTimer.connect("timeout", nextStep) $StepTimer.start() if step.checkVoice: - #await $VoiceCommunication.speech_record_check(step.checkVoice) + await $VoiceCommunication.speech_record_check(step.checkVoice) if step.stepName != "步骤四:站台门打开后,口呼:请您抓紧在此门上下车。" : - #nextStep() + nextStep() $StepTimer.connect("timeout", nextStep) $StepTimer.start() elif step.stepName == "步骤四:站台门打开后,口呼:请您抓紧在此门上下车。" :