diff --git a/Assets/training_speech/pinchPeople.mp3.import b/Assets/training_speech/pinchPeople.mp3.import deleted file mode 100644 index 6804d80..0000000 --- a/Assets/training_speech/pinchPeople.mp3.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="mp3" -type="AudioStreamMP3" -uid="uid://ca2cflgmlx5cp" -path="res://.godot/imported/pinchPeople.mp3-434bd408a9f297641ae3f3de785ab54f.mp3str" - -[deps] - -source_file="res://Assets/training_speech/pinchPeople.mp3" -dest_files=["res://.godot/imported/pinchPeople.mp3-434bd408a9f297641ae3f3de785ab54f.mp3str"] - -[params] - -loop=false -loop_offset=0 -bpm=0 -beat_count=0 -bar_beats=4 diff --git a/Assets/training_speech/pinchPeople.mp3 b/Assets/training_speech/trainingPinchPeopleFault/pinchPeople.mp3 similarity index 100% rename from Assets/training_speech/pinchPeople.mp3 rename to Assets/training_speech/trainingPinchPeopleFault/pinchPeople.mp3 diff --git a/Assets/training_speech/trainingPinchPeopleFault/pinchPeople.mp3.import b/Assets/training_speech/trainingPinchPeopleFault/pinchPeople.mp3.import new file mode 100644 index 0000000..483332a --- /dev/null +++ b/Assets/training_speech/trainingPinchPeopleFault/pinchPeople.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://ca2cflgmlx5cp" +path="res://.godot/imported/pinchPeople.mp3-134682895ed1755bfb4228e5cc0c315e.mp3str" + +[deps] + +source_file="res://Assets/training_speech/trainingPinchPeopleFault/pinchPeople.mp3" +dest_files=["res://.godot/imported/pinchPeople.mp3-134682895ed1755bfb4228e5cc0c315e.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/Assets/training_speech/xt_pslgbztmwx.mp3 b/Assets/training_speech/xt_pslgbztmwx.mp3 deleted file mode 100644 index fc9b2ca..0000000 Binary files a/Assets/training_speech/xt_pslgbztmwx.mp3 and /dev/null differ diff --git a/Assets/training_speech/xt_pslgbztmwx.mp3.import b/Assets/training_speech/xt_pslgbztmwx.mp3.import deleted file mode 100644 index 93ea755..0000000 --- a/Assets/training_speech/xt_pslgbztmwx.mp3.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="mp3" -type="AudioStreamMP3" -uid="uid://iqr672ekex01" -path="res://.godot/imported/xt_pslgbztmwx.mp3-c340c6f2fdc9b84c839f54346780b458.mp3str" - -[deps] - -source_file="res://Assets/training_speech/xt_pslgbztmwx.mp3" -dest_files=["res://.godot/imported/xt_pslgbztmwx.mp3-c340c6f2fdc9b84c839f54346780b458.mp3str"] - -[params] - -loop=false -loop_offset=0 -bpm=0 -beat_count=0 -bar_beats=4 diff --git a/Assets/training_speech/xt_pslibpkmwx.mp3 b/Assets/training_speech/xt_pslibpkmwx.mp3 deleted file mode 100644 index 362e629..0000000 Binary files a/Assets/training_speech/xt_pslibpkmwx.mp3 and /dev/null differ diff --git a/Assets/training_speech/xt_pslibpkmwx.mp3.import b/Assets/training_speech/xt_pslibpkmwx.mp3.import deleted file mode 100644 index f3f9aeb..0000000 --- a/Assets/training_speech/xt_pslibpkmwx.mp3.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="mp3" -type="AudioStreamMP3" -uid="uid://op4mbi1lemrb" -path="res://.godot/imported/xt_pslibpkmwx.mp3-165b8ea64f29779308cdddb6c9efb934.mp3str" - -[deps] - -source_file="res://Assets/training_speech/xt_pslibpkmwx.mp3" -dest_files=["res://.godot/imported/xt_pslibpkmwx.mp3-165b8ea64f29779308cdddb6c9efb934.mp3str"] - -[params] - -loop=false -loop_offset=0 -bpm=0 -beat_count=0 -bar_beats=4 diff --git a/Assets/training_speech/zby_ztmjczc.mp3 b/Assets/training_speech/zby_ztmjczc.mp3 deleted file mode 100644 index dfd482e..0000000 Binary files a/Assets/training_speech/zby_ztmjczc.mp3 and /dev/null differ diff --git a/Assets/training_speech/zby_ztmjczc.mp3.import b/Assets/training_speech/zby_ztmjczc.mp3.import deleted file mode 100644 index ce18036..0000000 --- a/Assets/training_speech/zby_ztmjczc.mp3.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="mp3" -type="AudioStreamMP3" -uid="uid://dr1m5h02s45jf" -path="res://.godot/imported/zby_ztmjczc.mp3-849bbce90b59ebabfadd754a0ccf691a.mp3str" - -[deps] - -source_file="res://Assets/training_speech/zby_ztmjczc.mp3" -dest_files=["res://.godot/imported/zby_ztmjczc.mp3-849bbce90b59ebabfadd754a0ccf691a.mp3str"] - -[params] - -loop=false -loop_offset=0 -bpm=0 -beat_count=0 -bar_beats=4 diff --git a/Assets/training_speech/zbzz_ckcjwb.mp3 b/Assets/training_speech/zbzz_ckcjwb.mp3 deleted file mode 100644 index 71725b0..0000000 Binary files a/Assets/training_speech/zbzz_ckcjwb.mp3 and /dev/null differ diff --git a/Assets/training_speech/zbzz_ckcjwb.mp3.import b/Assets/training_speech/zbzz_ckcjwb.mp3.import deleted file mode 100644 index 24bf5b9..0000000 --- a/Assets/training_speech/zbzz_ckcjwb.mp3.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="mp3" -type="AudioStreamMP3" -uid="uid://b5wej2w00ttnj" -path="res://.godot/imported/zbzz_ckcjwb.mp3-3c85dcaed29528587c7e0c8e32ccee6b.mp3str" - -[deps] - -source_file="res://Assets/training_speech/zbzz_ckcjwb.mp3" -dest_files=["res://.godot/imported/zbzz_ckcjwb.mp3-3c85dcaed29528587c7e0c8e32ccee6b.mp3str"] - -[params] - -loop=false -loop_offset=0 -bpm=0 -beat_count=0 -bar_beats=4 diff --git a/Assets/training_speech/zlgzmhfzc.mp3 b/Assets/training_speech/zlgzmhfzc.mp3 deleted file mode 100644 index a73e483..0000000 Binary files a/Assets/training_speech/zlgzmhfzc.mp3 and /dev/null differ diff --git a/Assets/training_speech/zlgzmhfzc.mp3.import b/Assets/training_speech/zlgzmhfzc.mp3.import deleted file mode 100644 index 63f098f..0000000 --- a/Assets/training_speech/zlgzmhfzc.mp3.import +++ /dev/null @@ -1,19 +0,0 @@ -[remap] - -importer="mp3" -type="AudioStreamMP3" -uid="uid://bv1xfsb4450r1" -path="res://.godot/imported/zlgzmhfzc.mp3-02c91e6200e7ec22dcd1900223f9e0da.mp3str" - -[deps] - -source_file="res://Assets/training_speech/zlgzmhfzc.mp3" -dest_files=["res://.godot/imported/zlgzmhfzc.mp3-02c91e6200e7ec22dcd1900223f9e0da.mp3str"] - -[params] - -loop=false -loop_offset=0 -bpm=0 -beat_count=0 -bar_beats=4 diff --git a/UI/screenDoorOperate/screen_door_operate.tscn b/UI/screenDoorOperate/screen_door_operate.tscn index 8c6a495..71520b6 100644 --- a/UI/screenDoorOperate/screen_door_operate.tscn +++ b/UI/screenDoorOperate/screen_door_operate.tscn @@ -1,7 +1,9 @@ -[gd_scene load_steps=4 format=3 uid="uid://blsv4lgybr3nc"] +[gd_scene load_steps=6 format=3 uid="uid://blsv4lgybr3nc"] [ext_resource type="Script" path="res://UI/screenDoorOperate/screen_door_operate.gd" id="1_2p52y"] +[ext_resource type="Theme" uid="uid://bycedcl2nwwlu" path="res://ui_theme.tres" id="1_5wvuu"] [ext_resource type="Texture2D" uid="uid://c8lwj1sqanx5l" path="res://Assets/screenDoorOperate/胶带.png" id="1_pc0lg"] +[ext_resource type="FontFile" uid="uid://bkbpyidjguavf" path="res://Assets/FeiHuaSongTi-2.ttf" id="2_esllj"] [ext_resource type="Texture2D" uid="uid://co57dk4piito4" path="res://Assets/screenDoorOperate/隔离带.png" id="2_k5cyw"] [node name="ScreenDoorOperate" type="Window"] @@ -9,6 +11,8 @@ title = "屏蔽门操作" position = Vector2i(10, 36) size = Vector2i(153, 111) wrap_controls = true +theme = ExtResource("1_5wvuu") +theme_override_fonts/title_font = ExtResource("2_esllj") script = ExtResource("1_2p52y") [node name="PanelContainer" type="PanelContainer" parent="."] diff --git a/sceen/platform/screenDoor.gd b/sceen/platform/screenDoor.gd index 5e60041..f5c401e 100644 --- a/sceen/platform/screenDoor.gd +++ b/sceen/platform/screenDoor.gd @@ -45,7 +45,7 @@ enum ScreenDoor_State{ ##打开屏蔽门 func openScreenDoor (isUseLCBKey=false)-> void: - if screenDoorState == ScreenDoor_State.close and ((screenDoorFaultState != ScreenDoor_Fault_State.openFault and lcbKey.keyState ==LcbWindow.KNOB_STATE.AUTO ) or isUseLCBKey): + if screenDoorState == ScreenDoor_State.close and ((screenDoorFaultState != ScreenDoor_Fault_State.openFault and screenDoorFaultState != ScreenDoor_Fault_State.glassBreakage and lcbKey.keyState ==LcbWindow.KNOB_STATE.AUTO ) or isUseLCBKey): screenDoorState=ScreenDoor_State.opening $Timer.start(0.3) diff --git a/sceen/platform/screenDoor.tscn b/sceen/platform/screenDoor.tscn index e632fa3..f02c555 100644 --- a/sceen/platform/screenDoor.tscn +++ b/sceen/platform/screenDoor.tscn @@ -16,7 +16,7 @@ [ext_resource type="AudioStream" uid="uid://k0e2shfdjyrq" path="res://Assets/music/glass-breaking.mp3" id="9_kpf37"] [ext_resource type="PackedScene" uid="uid://yvkjjjm5lmeo" path="res://Model/ScreenDoorPinchPeople.blend" id="15_wm4hy"] [ext_resource type="Script" path="res://sceen/platform/PinchPeoplePathFollow3D.gd" id="16_ml4r8"] -[ext_resource type="AudioStream" uid="uid://ca2cflgmlx5cp" path="res://Assets/training_speech/pinchPeople.mp3" id="17_4438x"] +[ext_resource type="AudioStream" uid="uid://ca2cflgmlx5cp" path="res://Assets/training_speech/trainingPinchPeopleFault/pinchPeople.mp3" id="17_4438x"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_4f4ck"] render_priority = 0 @@ -462,6 +462,33 @@ _data = { } point_count = 5 +[sub_resource type="Animation" id="Animation_g8x2q"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("ScreenDoorPinchPeople:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(-6.471, 0, 1.849)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("ScreenDoorPinchPeople:rotation") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(0, 1.77037, 0)] +} + [sub_resource type="Animation" id="Animation_nqqq3"] resource_name = "walkToPlatform" length = 3.0 @@ -490,33 +517,6 @@ tracks/1/keys = { "values": [Vector3(0, 1.77037, 0), Vector3(0, 2.77333, 0)] } -[sub_resource type="Animation" id="Animation_g8x2q"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("ScreenDoorPinchPeople:position") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector3(-6.471, 0, 1.849)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("ScreenDoorPinchPeople:rotation") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector3(0, 1.77037, 0)] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_8pf2j"] _data = { "RESET": SubResource("Animation_g8x2q"), @@ -619,7 +619,7 @@ skeleton = NodePath("") visible = false [node name="ScreenDoorPinchPeople" parent="PinchPeople" instance=ExtResource("15_wm4hy")] -transform = Transform3D(-0.198254, 0, 0.980138, 0, 1, 0, -0.980138, 0, -0.198254, -6.471, 0, 1.849) +transform = Transform3D(-0.198249, 0, 0.980139, 0, 1, 0, -0.980139, 0, -0.198249, -6.471, 0, 1.849) [node name="Path3D" type="Path3D" parent="PinchPeople"] curve = SubResource("Curve3D_1img4") diff --git a/sceen/total.gd b/sceen/total.gd index c1d3e29..47a4927 100644 --- a/sceen/total.gd +++ b/sceen/total.gd @@ -42,6 +42,22 @@ func trainLeave(ActionGestureCommandDeparture = false) -> bool: func _on_train_leave_delay_timeout() -> void: $train.trainLeave() +## 车门名字的枚举 +enum TrainDoor_name{ + trainDoor1=1, + trainDoor2, + trainDoor3, + trainDoor4, +} + +##设置指定车门不开门 +func setAssignTrainDoorsOpenFault (trainDoorNames:Array)-> void: + for child in $train.leftTrainDoorALL: + var trainDoorName=String(child.name) + var trainDoorIndex=int(trainDoorName[trainDoorName.length() - 1]) + if trainDoorIndex in trainDoorNames: + child.setTrainFault(TrainDoor.TrainDoor_Fault_State.openFault) + ## 屏蔽门名字的枚举 enum ScreenDoor_name{ screenDoor1=1, @@ -197,23 +213,27 @@ func allClickEquipmentPostion(equipmentName: String) -> Vector2: var Close_Click_Area_pos=NodeUtils.find_child_by_name(jjtcWindow,'Close_Click_Area').get_global_position() return Vector2(jjtcWindowPos.x+Close_Click_Area_pos.x+30,jjtcWindowPos.y+Close_Click_Area_pos.y+100) elif equipmentName == 'screenDoor1RightClick' : ##屏蔽门右键以及屏蔽门右键面板 - return getScreenPosition($platform.get_node('screenDoor1').get_node('left')) + var pos = getScreenPosition($platform.get_node('screenDoor1').get_node('dimiantishi')) + return Vector2(pos.x-50,pos.y-200) elif equipmentName == 'screenDoor2RightClick' : - return getScreenPosition($platform.get_node('screenDoor2').get_node('left')) + var pos = getScreenPosition($platform.get_node('screenDoor2').get_node('dimiantishi')) + return Vector2(pos.x-50,pos.y-200) elif equipmentName == 'screenDoor3RightClick' : - return getScreenPosition($platform.get_node('screenDoor3').get_node('left')) + var pos = getScreenPosition($platform.get_node('screenDoor3').get_node('dimiantishi')) + return Vector2(pos.x-200,pos.y-200) elif equipmentName == 'screenDoor4RightClick' : - return getScreenPosition($platform.get_node('screenDoor4').get_node('left')) + var pos = getScreenPosition($platform.get_node('screenDoor4').get_node('dimiantishi')) + return Vector2(pos.x-50,pos.y-200) 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() - return Vector2(ScreenDoorOperateWindowPos.x+AdhesiveTapePos.x,ScreenDoorOperateWindowPos.y+AdhesiveTapePos.y) + return Vector2(ScreenDoorOperateWindowPos.x+AdhesiveTapePos.x+50,ScreenDoorOperateWindowPos.y+AdhesiveTapePos.y) else: var ScreenDoorOperateWindow = $platform.get_node('ScreenDoorOperate') var ScreenDoorOperateWindowPos = ScreenDoorOperateWindow.position var IsolationStripPos=NodeUtils.find_child_by_name(ScreenDoorOperateWindow,'IsolationStrip').get_global_position() - return Vector2(ScreenDoorOperateWindowPos.x+IsolationStripPos.x,ScreenDoorOperateWindowPos.y+IsolationStripPos.y) + return Vector2(ScreenDoorOperateWindowPos.x+IsolationStripPos.x+50,ScreenDoorOperateWindowPos.y+IsolationStripPos.y) func getScreenPosition(node): var screenPostion = $Camera3D.unproject_position(node.global_transform.origin) diff --git a/sceen/train/trainDoor.gd b/sceen/train/trainDoor.gd index de190a6..51d6b07 100644 --- a/sceen/train/trainDoor.gd +++ b/sceen/train/trainDoor.gd @@ -8,8 +8,10 @@ class_name TrainDoor ## 车门的状态枚举 enum Train_Door_STATE{ - open,# 开门 - close,# 关门 + opening,# 正在开门 + open,#开到位 + closeing,#正在关门 + close,# 关到位 } ##车门的状态 @@ -27,9 +29,30 @@ enum Train_Door_STATE{ ##打开车门 func openTrainDoor ()-> void: - trainDoorState=Train_Door_STATE.open + if trainDoorState == Train_Door_STATE.close and trainDoorFaultState != TrainDoor_Fault_State.openFault : + trainDoorState=Train_Door_STATE.open ##关闭车门 func closeTrainDoor ()-> void: trainDoorState=Train_Door_STATE.close + +## 车门的故障枚举 +enum TrainDoor_Fault_State{ + noFault,#无故障 + openFault,# 开门故障 +} + +##车门的故障状态 +@onready var trainDoorFaultState : TrainDoor_Fault_State = TrainDoor_Fault_State.noFault : + set(value): + if trainDoorFaultState != value: + trainDoorFaultState = value + +##设置故障 +func setTrainFault (faultType:TrainDoor_Fault_State)-> void: + trainDoorFaultState = faultType + +##恢复故障 +func removeTrainDoorFault ()-> void: + trainDoorFaultState = TrainDoor_Fault_State.noFault diff --git a/trainings/trainingGlassBreakageFault/trainingGlassBreakageFault.gd b/trainings/trainingGlassBreakageFault/trainingGlassBreakageFault.gd index a21022b..5efb428 100644 --- a/trainings/trainingGlassBreakageFault/trainingGlassBreakageFault.gd +++ b/trainings/trainingGlassBreakageFault/trainingGlassBreakageFault.gd @@ -5,14 +5,289 @@ extends Node ## 场景描述 @export var trainingDesc: String = "场景描述" +var stepOperation = [] + +var handleStep = [ + { + "stepName": "发现故障 步骤一:站务员手指:上行2号站台门。步骤二:站务员口呼:上行2号滑动门玻璃破碎。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "上行2号滑动门玻璃破碎。" + }, + { + "stepName": "步骤三:站务员按下上行站台紧急停车按钮(阻止列车进站)。", + "stepOperation": ["JJTC","JJTC_Key","confirmUseKey","JJTCRightRotate","JJTCButton","JJTCCloseBox","JJTCLeftRotate"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤四:站务员用对讲机汇报值班员:值班员,上行2号滑动门玻璃破碎,已按下上行紧急停车按钮。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "值班员,上行2号滑动门玻璃破碎,已按下上行紧急停车按钮。" + }, + { + "stepName": "步骤五:值班员回复站务员:收到。", + "stepOperation": [], + "next": false, + "checkVoice": "", + "play": true, + "playPath": "res://Assets/training_speech/sd.mp3", + "stepTip": false, + }, + { + "stepName": "步骤六:站务员发现有玻璃掉落轨行区影响行车,汇报现场情况:值班员、值班站长,上行2号滑动门玻璃破碎,玻璃掉落轨行区影响行车,请派人处置。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "值班员、值班站长,上行2号滑动门玻璃破碎,玻璃掉落轨行区影响行车,请派人处置。" + }, + { + "stepName": "步骤七:值班站长(机器人)自动回复:收到。步骤八:值班员回复站务员:收到。", + "stepOperation": [], + "next": false, + "checkVoice": "", + "play": true, + "playPath": "res://Assets/training_speech/sd.mp3", + "stepTip": false, + }, + { + "stepName": "现场处置 步骤一:站务员旁路相邻门:将3号门LCB打至“开门”位,泄除隧道风压。", + "stepOperation": ["LCB3","LCB_Key1","confirmUseKey","LCB3RightRotate","LCB3RightRotate"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤二:站务员隔离故障门:将2号门LCB打至“隔离”位。", + "stepOperation": ["LCB2","LCB_Key2","confirmUseKey","LCB2LeftRotate"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤三:站务员口呼:设置安全防护栏。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "设置安全防护栏。" + }, + { + "stepName": "步骤四:站务员设置3号门安全护栏:在3号滑动门处设置安全防护栏。", + "stepOperation": ["screenDoor3RightClick","clickIsolationStripOfscreenDoor3"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤五:站务员设置2号门安全护栏:在2号滑动门处设置安全防护栏。", + "stepOperation": ["screenDoor2RightClick","clickIsolationStripOfscreenDoor2"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤六:站务员口呼:粘贴2号滑动门。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "设置安全防护栏。" + }, + { + "stepName": "步骤七:站务员粘贴破碎站台门:用胶带手动粘贴2号滑动门。", + "stepOperation": ["screenDoor2RightClick","clickAdhesiveTapeOfscreenDoor2"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤八:站务员用LCB钥匙(1号)将3号门的LCB转至“关门”位置。", + "stepOperation": ["LCB3","LCB3LeftRotate"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤九:3号门关闭后站务员用LCB钥匙(1号)将3号门的LCB转至“自动”位置,取出钥匙。", + "stepOperation": ["LCB3LeftRotate","removeKeyOfWindowLCB3"], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "" + }, + { + "stepName": "步骤十:站务员撤出3号门安全护栏:撤除3号滑动门处安全防护栏。", + "stepOperation": ["screenDoor3RightClick","clickIsolationStripOfscreenDoor3"], + "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": true, + "playPath": "res://Assets/training_speech/sd.mp3", + "stepTip": false, + }, + { + "stepName": "联系并恢复 步骤一:站务员用对讲机联系值班员:值班员,上行2号门已粘贴完毕,处于隔离位,现场处置完毕,请恢复上行紧急停车。", + "stepOperation": [], + "next": false, + "play": false, + "playPath": "", + "stepTip": true, + "checkVoice": "值班员,上行2号门已粘贴完毕,处于隔离位,现场处置完毕,请恢复上行紧急停车。" + }, + { + "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 func _on_training_desc_dialog_start_training(): - $Timer.start() + $glassBreakageTimer.start() - -func _on_timer_timeout() -> void: +func _on_glass_breakage_timer_timeout() -> void: $total.setAssignScreenDoorsGlassBreakageFault([TotalScene.ScreenDoor_name.screenDoor2]) + $total.setAssignTrainDoorsOpenFault([TotalScene.ScreenDoor_name.screenDoor2]) + handleStepIndex = 0 + nextStep() + + +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.play: + var sound = load(step.playPath) + await $VoiceCommunication.play_reply(sound) + nextStep() + if step.stepName == "值班员的一系列操作后,实训完成!": + $total.trainComeAndOpenScreenDoor () + +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: + stepOperationIndex = stepOperationIndex + 1 + $StepJudgment.hideError() + if stepOperationIndex < stepOperation.size(): + if stepOperation[stepOperationIndex-1] in ['screenDoor2RightClick','screenDoor3RightClick'] : + $ScreenDoorRightClickTimer.connect("timeout", setOperationNodeAndTip) + $ScreenDoorRightClickTimer.start() + else : + setOperationNodeAndTip() + else: + $TrainTip.setTrainingTip('') + if handleStepIndex != 7 and handleStepIndex != 14: + nextStep() + else: + if $total.trainingMode != TotalScene.Training_Mode.Exam: + $StepJudgment.showError() + +##开门信号 +func _on_total_screen_door_open_confirm_signal(screenDoor): + if screenDoor.name == "screenDoor3" : + nextStep() + +##关门信号 +func _on_total_screen_door_close_confirm_signal(screenDoor): + if screenDoor.name == "screenDoor3" : + nextStep() + + +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/trainingGlassBreakageFault/trainingGlassBreakageFault.tscn b/trainings/trainingGlassBreakageFault/trainingGlassBreakageFault.tscn index ed625fc..cc8a3f5 100644 --- a/trainings/trainingGlassBreakageFault/trainingGlassBreakageFault.tscn +++ b/trainings/trainingGlassBreakageFault/trainingGlassBreakageFault.tscn @@ -1,22 +1,51 @@ -[gd_scene load_steps=4 format=3 uid="uid://2p2vu21jtbtp"] +[gd_scene load_steps=9 format=3 uid="uid://2p2vu21jtbtp"] [ext_resource type="Script" path="res://trainings/trainingGlassBreakageFault/trainingGlassBreakageFault.gd" id="1_gyskf"] [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://6lortgihx5jy" path="res://Communication/voice_communication.tscn" id="4_oh56t"] +[ext_resource type="PackedScene" uid="uid://ckoxw6kgpjyhd" path="res://trainings/trainTip.tscn" id="5_rx4mw"] +[ext_resource type="PackedScene" uid="uid://b41vwoibfy5c6" path="res://trainings/stepJudgment.tscn" id="6_do0gx"] +[ext_resource type="PackedScene" uid="uid://b3whbe3mau53w" path="res://trainings/confirmDialog/confirmDialog.tscn" id="7_jtwv3"] +[ext_resource type="PackedScene" uid="uid://yhr1n6e2m2b6" path="res://trainings/stepTip/stepTip.tscn" id="8_o2duk"] [node name="trainingGlassBreakageFault" type="Node"] script = ExtResource("1_gyskf") -trainingName = "全自动运行线路站台门滑动门玻璃破碎应急处置" -trainingDesc = "全自动运行线路站台门滑动门玻璃破碎应急处置" +trainingName = "全自动运行线路站台门滑动门破碎(下轨行区)应急处置置" +trainingDesc = "列车即将驶入会展中心站上行站台时,站务员发现会展中心站上行2号站台门玻璃突然破裂,立即按下紧急停车按钮阻止列车进站。需现场处置完毕,经值班员确认情况,沟通行调后恢复紧急停车按钮。" [node name="TrainingDescDialog" parent="." instance=ExtResource("2_qfrwf")] [node name="total" parent="." instance=ExtResource("3_28hir")] -[node name="Timer" type="Timer" parent="."] +[node name="glassBreakageTimer" type="Timer" parent="."] wait_time = 2.0 one_shot = true +[node name="VoiceCommunication" parent="." instance=ExtResource("4_oh56t")] + +[node name="TrainTip" parent="." instance=ExtResource("5_rx4mw")] + +[node name="StepJudgment" parent="." instance=ExtResource("6_do0gx")] + +[node name="ConfirmDialog" parent="." instance=ExtResource("7_jtwv3")] +visible = false + +[node name="StepTip" parent="." instance=ExtResource("8_o2duk")] + +[node name="StepTimer" type="Timer" parent="."] +wait_time = 3.0 +one_shot = true + +[node name="ScreenDoorRightClickTimer" type="Timer" parent="."] +wait_time = 0.2 +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="timeout" from="Timer" to="." method="_on_timer_timeout"] +[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="glassBreakageTimer" to="." method="_on_glass_breakage_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"] diff --git a/trainings/trainingOpenDoorFault/trainingOpenDoorFault.gd b/trainings/trainingOpenDoorFault/trainingOpenDoorFault.gd index ce57ce1..7bfa012 100644 --- a/trainings/trainingOpenDoorFault/trainingOpenDoorFault.gd +++ b/trainings/trainingOpenDoorFault/trainingOpenDoorFault.gd @@ -93,8 +93,7 @@ var handleStep = [ { "stepName": "步骤九:值班员回复:收到。", "stepOperation": [], - "next": true, - "waitTime": 2, + "next": false, "checkVoice": "", "play": true, "playPath": "res://Assets/training_speech/sd.mp3", @@ -168,9 +167,7 @@ func _on_total_current_click_check_signal(isCorrect): stepOperationIndex = stepOperationIndex + 1 $StepJudgment.hideError() if stepOperationIndex < stepOperation.size(): - $total.currenNeedClickNode = stepOperation[stepOperationIndex] - if $total.trainingMode == TotalScene.Training_Mode.Teach: - $TrainTip.setTrainingTip($total.allClickEquipmentInfo[stepOperation[stepOperationIndex]]) + setOperationNodeAndTip() else: $TrainTip.setTrainingTip('') else: diff --git a/trainings/trainingPinchPeopleFault/trainingPinchPeopleFault.gd b/trainings/trainingPinchPeopleFault/trainingPinchPeopleFault.gd index d24d3fc..b84143e 100644 --- a/trainings/trainingPinchPeopleFault/trainingPinchPeopleFault.gd +++ b/trainings/trainingPinchPeopleFault/trainingPinchPeopleFault.gd @@ -107,6 +107,15 @@ var handleStep = [ "stepTip": true, "checkVoice": "收到" }, + { + "stepName": "实训已完成!", + "stepOperation": [], + "next": false, + "checkVoice": "", + "play": false, + "playPath": "", + "stepTip": true, + }, ] ## 步骤操作执行index @@ -176,9 +185,7 @@ func _on_total_current_click_check_signal(isCorrect): stepOperationIndex = stepOperationIndex + 1 $StepJudgment.hideError() if stepOperationIndex < stepOperation.size(): - $total.currenNeedClickNode = stepOperation[stepOperationIndex] - if $total.trainingMode == TotalScene.Training_Mode.Teach: - $TrainTip.setTrainingTip($total.allClickEquipmentInfo[stepOperation[stepOperationIndex]]) + setOperationNodeAndTip() else: $TrainTip.setTrainingTip('') else: