diff --git a/Lessons/1/Description.json b/Lessons/1/Description.json index fa63935..4b70315 100644 --- a/Lessons/1/Description.json +++ b/Lessons/1/Description.json @@ -1,6 +1,6 @@ { "Title": "[center]Electrical Road Barrier[/center]", - "Description": "There are various electrical road barriers installed to prevent access to vehicles. As an introduction example we use a simple barrier with a motor to lift or lower the barrier and a sensor when the opened or closed position are reached. A Guard tells the controller when the road should be blocked or passable.", + "Description": "There are various electrical road barriers installed to prevent access to vehicles. As an introduction example we use a simple barrier with a motor to lift or lower the barrier and a sensor when the opened or closed position are reached. A Guard in the right green building next to the barrier signals when the road should be blocked or passable.", "Goal": "Create a sequential function chart to let vehicles pass the checkpoint according to the guards signal.", "Simulation": "res://data/plant_models/electrical_barrier/ElectricalBarrier.tscn", "Test": "res://data/plant_models/electrical_barrier/ElectricalBarrierTest.tscn" diff --git a/data/core/lesson/LessonController.cs b/data/core/lesson/LessonController.cs index 1cdcb06..72772e1 100644 --- a/data/core/lesson/LessonController.cs +++ b/data/core/lesson/LessonController.cs @@ -42,7 +42,7 @@ public void ApplyNewLesson(LessonEntity lesson) /// public void UserRequestsChangeTo(PageCategory page) { - if (_currentPage == null || _currentPage.ScenePage == page) return; + if (_currentPage == null) return; _currentPage.OnUserRequestsChange(_mainNode, page); } diff --git a/data/core/scene_manager/navigation_steps/NavigationSteps.cs b/data/core/scene_manager/navigation_steps/NavigationSteps.cs index 1966b4a..5fc01e9 100644 --- a/data/core/scene_manager/navigation_steps/NavigationSteps.cs +++ b/data/core/scene_manager/navigation_steps/NavigationSteps.cs @@ -16,6 +16,7 @@ public class NavigationSteps : Node private Button _simulationStepButton; private Button _examinationStepButton; private Button _exitButton; + private PageCategory _currentPage; #endregion @@ -40,6 +41,7 @@ public override void _Ready() /// public void VisibleViewIs(PageCategory view) { + _currentPage = view; _landingPageButton.Pressed = view == PageCategory.LandingPage; _sfcStepButton.Pressed = view == PageCategory.LogicEditor; _sfcStepButton.Disabled = view == PageCategory.LandingPage; @@ -83,11 +85,13 @@ private void UpdateButtonState(Button button, PageCategory pages, bool pressed) if (pressed) { _mainNode.UserRequestsChangeTo(pages); - button.MouseFilter = Control.MouseFilterEnum.Ignore; } else { - button.MouseFilter = Control.MouseFilterEnum.Stop; + if (_currentPage == pages) + { + _mainNode.UserRequestsChangeTo(pages); + } } } #endregion diff --git a/data/core/scene_manager/navigation_steps/NavigationSteps.tscn b/data/core/scene_manager/navigation_steps/NavigationSteps.tscn index 4c8a77e..9a83543 100644 --- a/data/core/scene_manager/navigation_steps/NavigationSteps.tscn +++ b/data/core/scene_manager/navigation_steps/NavigationSteps.tscn @@ -20,7 +20,7 @@ hint_tooltip = "Exit the programm" [node name="FillerButton" parent="." instance=ExtResource( 2 )] anchor_top = 0.0 -margin_top = 380.0 +margin_top = 320.0 margin_bottom = -80.0 disabled = true icon = null @@ -28,8 +28,8 @@ icon = null [node name="ExaminationStepButton" parent="." instance=ExtResource( 2 )] anchor_top = 0.0 anchor_bottom = 0.0 -margin_top = 300.0 -margin_bottom = 380.0 +margin_top = 240.0 +margin_bottom = 320.0 hint_tooltip = "Open the test site" disabled = true icon = ExtResource( 3 ) @@ -37,8 +37,8 @@ icon = ExtResource( 3 ) [node name="SimulationStepButton" parent="." instance=ExtResource( 2 )] anchor_top = 0.0 anchor_bottom = 0.0 -margin_top = 220.0 -margin_bottom = 300.0 +margin_top = 160.0 +margin_bottom = 240.0 hint_tooltip = "Open simulation" disabled = true icon = ExtResource( 4 ) @@ -46,8 +46,8 @@ icon = ExtResource( 4 ) [node name="SfcStepButton" parent="." instance=ExtResource( 2 )] anchor_top = 0.0 anchor_bottom = 0.0 -margin_top = 140.0 -margin_bottom = 220.0 +margin_top = 80.0 +margin_bottom = 160.0 hint_tooltip = "Open SFC editor" disabled = true icon = ExtResource( 5 ) @@ -55,18 +55,7 @@ icon = ExtResource( 5 ) [node name="LandingPageButton" parent="." instance=ExtResource( 2 )] anchor_top = 0.0 anchor_bottom = 0.0 -margin_top = 60.0 -margin_bottom = 134.277 -hint_tooltip = "Return to the menu" -icon = ExtResource( 6 ) - -[node name="HeaderButton" parent="." instance=ExtResource( 2 )] -anchor_top = 0.0 -anchor_bottom = 0.0 margin_top = 0.0 -margin_bottom = 60.0 +margin_bottom = 80.0 hint_tooltip = "Return to the menu" -disabled = true -toggle_mode = false -text = "NW" -icon = null +icon = ExtResource( 6 ) diff --git a/data/diagram_models/sfc/editor/SfcEditorNode.cs b/data/diagram_models/sfc/editor/SfcEditorNode.cs index 1c355d8..2122f09 100644 --- a/data/diagram_models/sfc/editor/SfcEditorNode.cs +++ b/data/diagram_models/sfc/editor/SfcEditorNode.cs @@ -76,6 +76,7 @@ public void SerialiseToTemp() /// public override void OnUserRequestsChange(MainNode mainNode, PageCategory nextPage) { + SaveDiagram(); SerialiseToTemp(); mainNode.ChangePageTo(nextPage); } diff --git a/data/plant_models/electrical_barrier/tests/NoiseAndBlackout.cs b/data/plant_models/electrical_barrier/tests/NoiseAndBlackout.cs index 416e49e..ceecc1a 100644 --- a/data/plant_models/electrical_barrier/tests/NoiseAndBlackout.cs +++ b/data/plant_models/electrical_barrier/tests/NoiseAndBlackout.cs @@ -104,12 +104,12 @@ public void CollectResults() if (builder.Length == 0) { Result = 1; - GetNode