Esempio n. 1
0
 public void Executive_can_be_started_and_stopped()
 {
     executive.Start().Wait();
     Assert.AreEqual(State.Running, executive.State);
     executive.Stop().Wait();
     Assert.AreEqual(State.Stopped, executive.State);
 }
Esempio n. 2
0
 /// <summary>
 /// Aborts the model.
 /// </summary>
 public virtual void Abort()
 {
     if (s_diagnostics)
     {
         _Debug.WriteLine("Model.Abort() requested.");
     }
     Exec.Stop();
     m_stateMachine.DoTransition(GetAbortEnum());
     if (!IsReady)
     {
         IsRunning   = false;
         IsReady     = false;
         IsPaused    = false;
         IsCompleted = true;
     }
 }
Esempio n. 3
0
        private void StopAndRestartExec(object obj)
        {
            System.Threading.Thread.Sleep(1000);
            IExecutive exec = (IExecutive)obj;

            Debug.WriteLine("\r\n" + "Pausing for two seconds..." + "\r\n");
            Debug.WriteLine("Before pause, Exec state is " + exec.State);
            exec.Stop();
            System.Threading.Thread.Sleep(2000);
            Debug.WriteLine("After pause, Exec state is " + exec.State);
            Debug.WriteLine("\r\n" + "Resuming..." + "\r\n");
            exec.Start();
            Debug.WriteLine("Exec state is now " + exec.State);
        }
Esempio n. 4
0
 public void Stop()
 {
     executive.Stop().Wait();
 }