Exemplo n.º 1
0
 /// <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;
     }
 }
Exemplo n.º 2
0
 /// <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 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();
 }
Exemplo n.º 5
0
 /// <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;
     }
 }
Exemplo n.º 6
0
 /// <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();
 }