Exemplo n.º 1
0
        private void _btnStep_Click(object sender, EventArgs e)
        {
            if (_simulatorEngine == null)
            {
                _simulatorEngine = new SimulatorEngine(_trafficManager);
            }

            _simulatorEngine.Step(10);

            WriteLog();
            UpdateLog();
        }
Exemplo n.º 2
0
        private void SimulationThreadFunc(object seconds)
        {
            if (_simulatorEngine == null)
            {
                _simulatorEngine = new SimulatorEngine(_trafficManager);
            }

            _simulationFlag = true;
            while (_simulationFlag)
            {
                _simulatorEngine.Step((double)seconds);

                WriteLog();
                //UpdateLog();
                _tbxLog.Invoke(new UpdateLogFromSimulationThreadDelegate(UpdateLogFromSimulationThread));

                Thread.Sleep(100);
            }
        }