Beispiel #1
0
 private void ObserveOverallState(int timeMs)
 {
     EmitterCart.Observe(_master);
     FocusCart.Observe(_master);
     TestEmitter.Observe(_master);
     TestFocus.Observe(_master, timeMs);
     TestLaser.Observe(_master, timeMs);
     TestFieldGenerator.Observe(_master, timeMs);
     TestTemperature.ObserveUpperBound(_master, timeMs);
 }
        private void UpdateFocus(MassTestChamber master, int deltaTime)
        {
            int direction = master.SimulationInput.PollInteger(MassTestChamber.FocusMotorKey);

            if (direction != 0)
            {
                FocusCart.Drive(direction > 0, deltaTime);
            }
            bool field = master.SimulationInput.PollBoolean(MassTestChamber.FieldGeneratorKey);

            Central.ShowAs(Emitter.IsProvidingMass, field, IsDischarging);
            master.SimulationOutput.SetValue(MassTestChamber.FocusFrontKey, FocusCart.FrontPositionReached);
            master.SimulationOutput.SetValue(MassTestChamber.FocusBackKey, FocusCart.BackPositionReached);
        }
 /// <summary>
 /// Called before the simulation is added to the  main tree
 /// </summary>
 public void Setup()
 {
     EmitterCart = GetNode <Cart>("EmitterCart");
     EmitterCart.Setup();
     Emitter = GetNode <EmitterParticles>("EmitterCart/EmitterParticles");
     Emitter.Setup();
     FocusCart = GetNode <Cart>("FocusCart");
     FocusCart.Setup();
     Central = GetNode <CentralParticles>("CentralParticles");
     Central.Setup();
     Discharge       = GetNode <Particles>("DischargeParticles");
     Laser           = GetNode <Particles>("LaserParticles");
     EmergencyActors = GetNode <EmergencyActors>("EmergencyActors");
     EmergencyActors.Setup();
 }