/// <summary> /// Requests a change of the current page to the new page. /// Used to provide the possibility for the user to save or cancel the action. /// </summary> public override void OnUserRequestsChange(IMainNode mainNode, PageCategory nextPage) { Sfc2dEditorNode.Sfc2dEditorControl.ApplyAllEdits(); SaveDiagram(); SerialiseToTemp(); mainNode.ChangePageTo(nextPage); }
/// <summary> /// Initializes the whole page. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { CentralParticles = GetNode <CentralParticles>("CentralParticles"); CentralParticles.Setup(); EmergencyActors = GetNode <EmergencyActors>("EmergencyActors"); EmergencyActors.Setup(); _decoration = GetNode <DecorationNode>("DecorationNode"); _decoration.Initialise(); }
/// <summary> /// Initializes the whole page. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _digitalInputs = GetNode <DigitalInputs>("UI/DigitalInputs"); _digitalOutputs = GetNode <DigitalOutputs>("UI/DigitalOutputs"); _analogueIO = GetNode <AnalogueIO>("UI/AnalogueIO"); _digitalInputs.SetupUi(); _digitalOutputs.SetupUi(); _analogueIO.SetupUi(); }
/// <summary> /// Initializes the whole sfc editor /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _mainNode = mainNode; _processingData = InitialisePlant(openedLesson); InitialiseDiagram(openedLesson); InitialiseSimulation(openedLesson); _breakpoints = new BreakpointManager(_simulationMaster, _sfc2dEditorNode); if (!_isExecutable) { GetNode <Label>(_errorLabelPath).Visible = true; } }
/// <summary> /// Initializes the whole test viewer. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _openedLesson = openedLesson; _regularOperation = GetNode <RegularOperation>("Tests/RegularOperation"); _regularOperation.InitialiseWith(mainNode, openedLesson); _startOpen = GetNode <StartOpen>("Tests/StartOpen"); _startOpen.InitialiseWith(mainNode, openedLesson); _startPassing = GetNode <StartPassing>("Tests/StartPassing"); _startPassing.InitialiseWith(mainNode, openedLesson); _noiseAndBlackout = GetNode <NoiseAndBlackout>("Tests/NoiseAndBlackout"); _noiseAndBlackout.InitialiseWith(mainNode, openedLesson); }
/// <summary> /// Initializes the whole twat viewer. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _simulation = GetNode <MinimalSimulationExample>("MinimalSimulationExample"); _simulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, _simulation); if (_simulationMaster != null) { _simulation.InitialiseWith(mainNode, openedLesson); _isExecutable = _simulationMaster.IsProgramSimulationValid(); } else { _isExecutable = false; } }
/// <summary> /// Initializes the whole page. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _topTrafficLight = GetNode <TrafficControlSystem>("Signalisation/TrafficControlSystemTop"); _topTrafficLight.SetToGreen(SimulationInput.PollBoolean(_topTrafficLightKey)); _botTrafficLight = GetNode <TrafficControlSystem>("Signalisation/TrafficControlSystemBot"); _botTrafficLight.SetToGreen(SimulationInput.PollBoolean(_botTrafficLightKey)); PathController topPath = GetNode <PathController>("DynamicCars/TopPath"); topPath.Setup(_topTrafficLight); PathController botPath = GetNode <PathController>("DynamicCars/BotPath"); botPath.Setup(_botTrafficLight); _trafficController = new TrafficController(topPath, botPath); SpawnTimeGenerator.ResetGenerator(); }
/// <summary> /// Initializes the whole twat viewer. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _openedLesson = openedLesson; Simulation = GetNode <CircularSawModel>("ViewportContainer/Viewport/CircularSawModel"); SimulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, Simulation); if (SimulationMaster != null) { Simulation.InitialiseWith(mainNode, openedLesson); _isExecutable = SimulationMaster.IsProgramSimulationValid(); SetupTestSteps(); } else { _isExecutable = false; } }
/// <summary> /// Initializes the whole test viewer. Called before the node is added to the tree by the lesson controller. /// </summary> public void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _simulation = GetNode <ElectricalBarrier>("Viewport/ElectricalBarrier"); _simulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, _simulation); if (_simulationMaster != null) { _simulation.InitialiseWith(mainNode, openedLesson); _isExecutable = _simulationMaster.IsProgramSimulationValid(); } else { _isExecutable = false; Result = 0; GetNode <Label>("Label").Text = "Program can not be executed"; } }
/// <summary> /// Initializes the whole page. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { MainNode = mainNode; OpenedLesson = openedLesson; LessonView = GetNode <LessonView>(LessonViewPath); LessonView.LoadAndShowInfo(openedLesson); Sfc2dEditorNode = GetNode <Sfc2dEditorNode>(Sfc2dEditorPath); HelpPage = GetNode <HelpPage>(EditorHelpPath); ProcessingData data = new ProcessingData { InputRegisters = new StateTable(LessonView.PlantView.LoadedSimulationNode.SimulationOutput), OutputRegisters = new StateTable(LessonView.PlantView.LoadedSimulationNode.SimulationInput) }; Sfc2dEditorNode.InitializeEditor(data, true); TryLoadDiagram(); }
/// <summary> /// Initializes the whole twat viewer. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _openedLesson = openedLesson; _simulation = GetNode <RoadConstructionSite>("PlantViewportContainer/PlantViewport/RoadConstructionSite"); _simulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, _simulation); if (_simulationMaster != null) { _simulation.InitialiseWith(mainNode, openedLesson); _isExecutable = _simulationMaster.IsProgramSimulationValid(); } if (_simulationMaster == null || !_isExecutable) { _isExecutable = false; _testState = TestState.Done; _openedLesson.SetAndSaveStars(0); } SpawnTimeGenerator.ResetGenerator(); }
/// <summary> /// Initializes the whole test viewer. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _openedLesson = openedLesson; _simulation = GetNode <Lights>("Lights"); _simulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, _simulation); if (_simulationMaster != null) { _simulation.InitialiseWith(mainNode, openedLesson); _isExecutable = _simulationMaster.IsProgramSimulationValid(); } else { _isExecutable = false; } if (!_isExecutable) { _stage = Stages.CreateResult; } }
/// <summary> /// Initializes the whole test viewer. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _openedLesson = openedLesson; Simulation = GetNode <MassTestChamber>(_testChamberPath); SimulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, Simulation); if (SimulationMaster != null) { Simulation.InitialiseWith(mainNode, openedLesson); IsExecutable = SimulationMaster.IsProgramSimulationValid(); } else { IsExecutable = false; } PaperLog = GetNode <PaperLog>("PaperLog"); PaperLog.Setup(); TestController = new TestController(this); TestController.Setup(); }
public override void _Ready() { _mainNode = GetNode <MainNode>(".."); _landingPageButton = GetNode <Button>("LandingPageButton"); _landingPageButton.Connect("toggled", this, nameof(UpdateButtonState), new Array { PageCategory.LandingPage }); _sfcStepButton = GetNode <Button>("SfcStepButton"); _sfcStepButton.Connect("toggled", this, nameof(UpdateButtonState), new Array { PageCategory.LogicEditor }); _simulationStepButton = GetNode <Button>("SimulationStepButton"); _simulationStepButton.Connect("toggled", this, nameof(UpdateButtonState), new Array { PageCategory.Simulation }); _examinationStepButton = GetNode <Button>("ExaminationStepButton"); _examinationStepButton.Connect("toggled", this, nameof(UpdateButtonState), new Array { PageCategory.Examination }); _exitButton = GetNode <Button>("ExitButton"); _exitButton.Connect("toggled", this, nameof(UpdateButtonState), new Array { PageCategory.Exit }); }
/// <summary> /// Requests a change of the current page to the new page. /// Used to provide the possibility for the user to save or cancel the action. /// </summary> public virtual void OnUserRequestsChange(IMainNode mainNode, PageCategory nextPage) { mainNode.ChangePageTo(nextPage); }
/// <summary> /// Initializes the whole page. Called before the node is added to the tree by the lesson controller. /// </summary> public virtual void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { }
/// <summary> /// Initializes the whole page. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { CircularSawNode = GetNode <CircularSawNode>("CircularSawNode"); CircularSawNode.Setup(); }
/// <summary> /// Initializes the whole page. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { Chamber.Setup(); }
public override void _Ready() { _mainNode = GetNode <MainNode>(MainViewPath); }
/// <summary> /// Initializes the whole page. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { Subcontroller.Initialise(); }