public PressureTank()
        {
            InitializeComponent();

            // Initialize visualization resources
            _pumpingStoryboard = (Storyboard)Resources["RotatePump"];
            _pumpingStoryboard.Begin();

            _pressureLevelStoryboard = (Storyboard)Resources["PressureLevel"];
            _pressureLevelStoryboard.Begin();
            _pressureLevelStoryboard.Pause();

            _timerAlertStoryboard  = (Storyboard)Resources["TimerEvent"];
            _sensorAlertStoryboard = (Storyboard)Resources["SensorEvent"];

            // Initialize the simulation environment
            SimulationControls.ModelStateChanged += (o, e) => UpdateModelState();
            SimulationControls.Reset             += (o, e) => OnModelStateReset();
            SimulationControls.SetModel(new Model());

            // Initialize the visualization state
            UpdateModelState();

            TimerAlert.Opacity          = 0;
            SensorAlert.Opacity         = 0;
            SimulationControls.MaxSpeed = 64;
            SimulationControls.ChangeSpeed(8);
        }
Beispiel #2
0
        public RailroadCrossing()
        {
            InitializeComponent();

            // Initialize the simulation environment
            var model = new Model();

            SimulationControls.ModelStateChanged += (o, e) => UpdateModelState();
            SimulationControls.Reset             += (o, e) => OnModelStateReset();
            SimulationControls.Rewound           += (o, e) => OnRewound();
            SimulationControls.SetModel(model, model.PossibleCollision);

            // Initialize the visualization state
            UpdateModelState();
            SimulationControls.ChangeSpeed(16);
        }
        public HeightControlSystem()
        {
            InitializeComponent();

            // Initialize visualization resources
            _lb1Storyboard = (Storyboard)Resources["EventLb1"];
            _lb2Storyboard = (Storyboard)Resources["EventLb2"];
            _odlStoryboard = (Storyboard)Resources["EventOdl"];
            _odrStoryboard = (Storyboard)Resources["EventOdr"];
            _odfStoryboard = (Storyboard)Resources["EventOdf"];

            // Initialize the simulation environment
            var specification = new Model(
                new PreControlOriginal(),
                new MainControlOriginal(),
                new EndControlOriginal(),
                Enumerable
                .Range(0, 9).Select(_ => new VisualizationVehicle {
                Kind = VehicleKind.HighVehicle
            })
                .Concat(Enumerable.Range(0, 9).Select(_ => new VisualizationVehicle {
                Kind = VehicleKind.OverheightVehicle
            }))
                .ToArray());

            SimulationControls.ModelStateChanged += (o, e) => UpdateModelState();
            SimulationControls.Reset             += (o, e) => OnModelStateReset();
            SimulationControls.Rewound           += (o, e) => OnRewound();
            SimulationControls.SetModel(specification);

            // Initialize the visualization state
            OnModelStateReset();
            UpdateModelState();
            SimulationControls.ChangeSpeed(2);

            AlertLb1.Opacity = 0;
            AlertLb2.Opacity = 0;
            AlertOdl.Opacity = 0;
            AlertOdr.Opacity = 0;
            AlertOdf.Opacity = 0;
        }
        public HdMachine()
        {
            var specification = new Model();

            InitializeComponent();
            InitializeElements();

            // Initialize the simulation environment
            SimulationControls.ModelStateChanged += (o, e) => UpdateModelState();
            SimulationControls.Reset             += (o, e) => OnModelStateReset();
            SimulationControls.Rewound           += (o, e) => OnRewound();
            SimulationControls.SetModel(specification);



            // Initialize the visualization state
            UpdateModelState();

            SimulationControls.MaxSpeed = 64;
            SimulationControls.ChangeSpeed(8);
        }