Esempio n. 1
0
        private void startWork()
        {
            SimulationOptionsCurrentExecution = SimulationOptionsForBinding.GetCopy();
            session = new SimulationSession(SimulationOptionsCurrentExecution);

            MainChart.StartDrawData(simulationResultsDictionary);

            threads = null;
            if (!SimulationOptionsCurrentExecution.RemoteExecutionOnly)
            {
                threads = new Thread[threadSlots];
                for (int i = 0; i < threads.Length; i++)
                {
                    threads[i]      = new Thread(this.performWork);
                    threads[i].Name = "Local Thread " + localThreadNumber++;
                    threads[i].Start();
                }
            }

            foreach (TCPSimulatorProxy proxy in TCPConnections)
            {
                if (proxy.Connected)
                {
                    proxy.startNewSession(session);
                }
            }

            btnSimulate.IsEnabled = false;
            btnAbort.IsEnabled    = true;
        }