Beispiel #1
0
 public virtual void Resume()
 {
     if (m_stationStatue == StationStatue.Suspend)
     {
         m_SuspendFalg   = false;
         m_stationStatue = StationStatue.Running;
     }
 }
Beispiel #2
0
 /// <summary>
 /// suspend the station task
 /// </summary>
 public virtual void Suspend()
 {
     if (m_stationStatue == StationStatue.Running)
     {
         m_SuspendFalg   = true;
         m_stationStatue = StationStatue.Suspend;
     }
 }
Beispiel #3
0
        /// <summary>
        /// stop the station task
        /// </summary>
        public virtual void Stop()
        {
            if (m_stationStatue == StationStatue.WaitingReady)
            {
                throw new Exception($"{StationName} is on the statue WaitingReady");
            }


            m_SuspendFalg = false;
            cancellationTokenSource.Cancel();
            m_stationStatue = StationStatue.Stoped;
            StepQueue.Clear();
        }
Beispiel #4
0
 private void TaskRun()
 {
     if (m_task.Status == TaskStatus.Created)
     {
         m_task.Start();
     }
     else if (m_task.Status == TaskStatus.Canceled || m_task.Status == TaskStatus.RanToCompletion)
     {
         cancellationTokenSource = new CancellationTokenSource();
         m_task = new Task(ProcessTask, cancellationTokenSource.Token);
         m_task.Start();
     }
     m_stationStatue = StationStatue.Running;
 }