This commit is contained in:
joylink_fanyuhong 2024-05-23 16:10:52 +08:00
commit 415b21123d
7 changed files with 87 additions and 57 deletions

View File

@ -13,7 +13,7 @@ dest_files=["res://.godot/imported/sd.mp3-c6dc8a540e4c3c58e60586436e316423.mp3st
[params]
loop=false
loop_offset=0
bpm=0
loop_offset=0.0
bpm=0.0
beat_count=0
bar_beats=4

Binary file not shown.

View File

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://b0xnag8ndp8eg"
path="res://.godot/imported/trainComing.mp3-410a3ec4cc0e90b01724ec91085d2145.mp3str"
[deps]
source_file="res://Assets/training_speech/trainComing.mp3"
dest_files=["res://.godot/imported/trainComing.mp3-410a3ec4cc0e90b01724ec91085d2145.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@ -4,8 +4,13 @@ class_name TotalScene
##车来且开屏蔽门和车门
func trainComeAndOpenScreenDoor ()-> void:
if $platform.allScreenDoorClose() :
$trainComeDelay.start()
$trainComing.play()
func _on_train_come_delay_timeout() -> void:
$train.trainCome()
$BeginTimer.start()
$BeginTimer.start()
func _on_beginTimer_timeout() -> void:
$train.openLeftTrainDoorALL()
@ -29,10 +34,13 @@ 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 :
$train.trainLeave()
$trainLeaveDelay.start()
return true
return false
func _on_train_leave_delay_timeout() -> void:
$train.trainLeave()
## 屏蔽门名字的枚举
enum ScreenDoor_name{
screenDoor1=1,

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=9 format=3 uid="uid://btcksdsburk7t"]
[gd_scene load_steps=10 format=3 uid="uid://btcksdsburk7t"]
[ext_resource type="PackedScene" uid="uid://cmnsn2joxo68l" path="res://sceen/platform/platform.tscn" id="1_rjva4"]
[ext_resource type="Script" path="res://sceen/total.gd" id="1_s45rl"]
[ext_resource type="AudioStream" uid="uid://b0xnag8ndp8eg" path="res://Assets/training_speech/trainComing.mp3" id="4_6ctdm"]
[ext_resource type="PackedScene" uid="uid://nx6xnwcuq8cf" path="res://sceen/train/train.tscn" id="14_g0uwl"]
[sub_resource type="Environment" id="Environment_ux83q"]
@ -23,7 +24,7 @@ tracks/0/keys = {
[sub_resource type="Animation" id="Animation_he04d"]
resource_name = "trainCome"
length = 2.0
length = 4.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
@ -31,15 +32,15 @@ tracks/0/path = NodePath("../train:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 2),
"transitions": PackedFloat32Array(1, 1),
"times": PackedFloat32Array(0, 4),
"transitions": PackedFloat32Array(0.5, 1),
"update": 0,
"values": [Vector3(20, 0, 0), Vector3(0, 0, 0)]
}
[sub_resource type="Animation" id="Animation_fssoy"]
resource_name = "trainLeave"
length = 15.0
length = 10.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
@ -47,8 +48,8 @@ tracks/0/path = NodePath("../train:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 15),
"transitions": PackedFloat32Array(1, 1),
"times": PackedFloat32Array(0, 10),
"transitions": PackedFloat32Array(2, 1),
"update": 0,
"values": [Vector3(0, 0, 0), Vector3(-120, 0, 0)]
}
@ -85,20 +86,33 @@ libraries = {
"": SubResource("AnimationLibrary_lf7ox")
}
[node name="trainComing" type="AudioStreamPlayer" parent="."]
stream = ExtResource("4_6ctdm")
[node name="BeginTimer" type="Timer" parent="."]
wait_time = 3.0
wait_time = 6.0
one_shot = true
[node name="EndTimer" type="Timer" parent="."]
wait_time = 3.0
wait_time = 5.0
one_shot = true
[node name="openAllwindow" type="Timer" parent="."]
one_shot = true
[node name="trainComeDelay" type="Timer" parent="."]
wait_time = 3.0
one_shot = true
[node name="trainLeaveDelay" type="Timer" parent="."]
wait_time = 2.0
one_shot = true
[connection signal="allClickPlatformSignal" from="platform" to="." method="_on_platform_all_click_platform_signal"]
[connection signal="allScreenDoorLcbStateSignal" from="platform" to="." method="emitScreenDoorLcbStateChangeSignal"]
[connection signal="animation_finished" from="trainAnimationPlayer" to="train" method="_on_train_animation_player_animation_finished"]
[connection signal="timeout" from="BeginTimer" to="." method="_on_beginTimer_timeout"]
[connection signal="timeout" from="EndTimer" to="." method="_on_end_timer_timeout"]
[connection signal="timeout" from="openAllwindow" to="." method="_on_open_allwindow_timeout"]
[connection signal="timeout" from="trainComeDelay" to="." method="_on_train_come_delay_timeout"]
[connection signal="timeout" from="trainLeaveDelay" to="." method="_on_train_leave_delay_timeout"]

View File

@ -9,23 +9,14 @@ var stepOperation = []
var handleStep = [
{
"stepName": "发现故障 步骤一站务员手指上行3号门门头灯。",
"stepName": "发现故障 步骤一站务员手指上行3号门门头灯。步骤二站务员口呼上行3号门门头灯不亮开门故障。",
"stepOperation": [],
"next": true,
"next": false,
"waitTime": 3,
"play": false,
"playPath": "",
"notip": true,
"checkVoice": ""
},
{
"stepName": "步骤二站务员口呼上行3号门门头灯不亮开门故障。",
"stepOperation": [],
"next": false,
"checkVoice": "上行3号门门头灯不亮开门故障",
"play": false,
"playPath": "",
"notip": true,
"stepTip": true,
"checkVoice": "上行3号门门头灯不亮开门故障。"
},
{
"stepName": "现场处置 步骤一站务员用对讲机汇报值班员值班员上行3号门开门故障使用LCB开启站台门。",
@ -34,7 +25,7 @@ var handleStep = [
"checkVoice": "值班员上行3号门开门故障使用LCB开启站台门。",
"play": false,
"playPath": "",
"notip": true,
"stepTip": true,
},
{
"stepName": "步骤二:值班员回复:收到。",
@ -43,7 +34,7 @@ var handleStep = [
"checkVoice": "",
"play": true,
"playPath": "res://Assets/training_speech/sd.mp3",
"notip": false,
"stepTip": false,
},
{
"stepName": "步骤三站务员用LCB打开3号故障门用 LCB钥匙1号将故障门3号门的LCB转至“开门”位置。",
@ -52,7 +43,7 @@ var handleStep = [
"checkVoice": "",
"play": false,
"playPath": "",
"notip": true,
"stepTip": true,
},
{
"stepName": "步骤四:站台门打开后,站务员口呼:请有序下车。",
@ -61,7 +52,7 @@ var handleStep = [
"checkVoice": "请有序下车。",
"play": false,
"playPath": "",
"notip": true,
"stepTip": true,
},
{
"stepName": "步骤五站务员用LCB关闭3号故障门停站时间到乘客乘降完毕后用 LCB钥匙1号将故障门3号门的LCB转至“关门”位置。",
@ -70,7 +61,7 @@ var handleStep = [
"checkVoice": "",
"play": false,
"playPath": "",
"notip": true,
"stepTip": true,
},
{
"stepName": "步骤六:站务员口呼:故障门处置完毕。",
@ -79,7 +70,7 @@ var handleStep = [
"checkVoice": "故障门处置完毕。",
"play": false,
"playPath": "",
"notip": true,
"stepTip": true,
},
{
"stepName": "步骤七:列车出清站台后,站务员用 LCB钥匙1号将故障门3号门的LCB转至“自动”位置取出钥匙。",
@ -88,7 +79,7 @@ var handleStep = [
"checkVoice": "",
"play": false,
"playPath": "",
"notip": true,
"stepTip": true,
},
{
"stepName": "步骤八站务员用对讲机汇报值班员值班员上行3号门故障已处理完毕。",
@ -97,16 +88,26 @@ var handleStep = [
"checkVoice": "值班员上行3号门故障已处理完毕。",
"play": false,
"playPath": "",
"notip": true,
"stepTip": true,
},
{
"stepName": "步骤九:值班员回复:收到。",
"stepOperation": [],
"next": false,
"next": true,
"waitTime": 2,
"checkVoice": "",
"play": true,
"playPath": "res://Assets/training_speech/sd.mp3",
"notip": false,
"stepTip": false,
},
{
"stepName": "实训已完成!",
"stepOperation": [],
"next": false,
"checkVoice": "",
"play": false,
"playPath": "",
"stepTip": true,
},
]
@ -120,7 +121,6 @@ func _ready():
$TrainingDescDialog.title = trainingName
$TrainingDescDialog.updateSceneDesc(trainingDesc)
$TrainingDescDialog.grab_focus()
$StepTip.visible = false
stepOperationIndex = 0
handleStepIndex = 0
@ -134,7 +134,7 @@ func nextStep():
if handleStepIndex < handleStep.size():
var step = handleStep[handleStepIndex]
handleStepIndex = handleStepIndex + 1
if step.notip == true and $total.trainingMode != TotalScene.Training_Mode.Exam:
if step.stepTip == true and $total.trainingMode != TotalScene.Training_Mode.Exam:
$StepTip.updateOperationTip(step.stepName)
if step.stepOperation.size() > 0:
initStepOperation()
@ -143,10 +143,7 @@ func nextStep():
$StepTimer.start()
if step.checkVoice:
await $VoiceCommunication.speech_record_check(step.checkVoice)
if step.stepName == "步骤四:站台门打开后,站务员口呼:请有序下车。":
$DepartTimer.connect("timeout", closeScreenDoor)
$DepartTimer.start()
else :
if step.stepName != "步骤四:站台门打开后,站务员口呼:请有序下车。":
nextStep()
if step.play:
var sound = load(step.playPath)
@ -184,27 +181,23 @@ func _on_total_current_click_check_signal(isCorrect):
##开门信号
func _on_total_screen_door_open_confirm_signal(screenDoor):
if screenDoor.name == "screenDoor1":
if $total.trainingMode != TotalScene.Training_Mode.Exam:
$StepTip.visible = true
handleStepIndex = 0
nextStep()
elif screenDoor.name == "screenDoor3":
handleStepIndex = 5
$DepartTimer.connect("timeout", closeScreenDoor)
$DepartTimer.start()
handleStepIndex = 4
nextStep()
##关门信号
func _on_total_screen_door_close_confirm_signal(screenDoor):
if screenDoor.name == "screenDoor3":
$total.trainLeave()
handleStepIndex = 7
nextStep()
elif screenDoor.name == "screenDoor1":
handleStepIndex = 6
nextStep()
##屏蔽门lcb状态变化信号
func _on_total_screen_door_lcb_state_change_signal(screenDoor: ScreenDoor,knob_state: LcbWindow.KNOB_STATE) -> void:
pass
elif screenDoor.name == "screenDoor1":
handleStepIndex = 5
nextStep()
##待解决

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=3 uid="uid://nkjskkkwlbc5"]
[gd_scene load_steps=9 format=3 uid="uid://nkjskkkwlbc5"]
[ext_resource type="Script" path="res://trainings/trainingOpenDoorFault/trainingOpenDoorFault.gd" id="1_2u0o8"]
[ext_resource type="PackedScene" uid="uid://qh8b3g6n3k2u" path="res://trainings/training_desc_dialog.tscn" id="2_qfrwf"]
@ -7,7 +7,6 @@
[ext_resource type="PackedScene" uid="uid://ckoxw6kgpjyhd" path="res://trainings/trainTip.tscn" id="5_c62p3"]
[ext_resource type="PackedScene" uid="uid://b41vwoibfy5c6" path="res://trainings/stepJudgment.tscn" id="6_32733"]
[ext_resource type="PackedScene" uid="uid://b3whbe3mau53w" path="res://trainings/confirmDialog/confirmDialog.tscn" id="7_nkclh"]
[ext_resource type="PackedScene" uid="uid://bsb3nyi8xaqwh" path="res://trainings/trainingPanel/trainingPanel.tscn" id="8_lfro2"]
[ext_resource type="PackedScene" uid="uid://yhr1n6e2m2b6" path="res://trainings/stepTip/stepTip.tscn" id="9_i1htc"]
[node name="trainingOpenDoorFault" type="Node"]
@ -32,8 +31,6 @@ one_shot = true
[node name="ConfirmDialog" parent="." instance=ExtResource("7_nkclh")]
visible = false
[node name="TrainingPanel" parent="." instance=ExtResource("8_lfro2")]
[node name="StepTip" parent="." instance=ExtResource("9_i1htc")]
[node name="StepTimer" type="Timer" parent="."]
@ -44,7 +41,6 @@ one_shot = true
[connection signal="close_requested" from="TrainingDescDialog" to="TrainingDescDialog" method="_on_close_requested"]
[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="screenDoorLcbStateChangeSignal" from="total" to="." method="_on_total_screen_door_lcb_state_change_signal"]
[connection signal="screenDoorOpenConfirmSignal" from="total" to="." method="_on_total_screen_door_open_confirm_signal"]
[connection signal="speech_recognition_successed" from="VoiceCommunication" to="." method="_on_voice_communication_speech_recognition_successed"]
[connection signal="two_cancel" from="ConfirmDialog" to="." method="_on_confirm_dialog_two_cancel"]