Пример #1
0
 private void OnTimedEvent(object source, System.Timers.ElapsedEventArgs e)
 {
     m_context.IncrementCycle();
     Console.WriteLine("-------------------- Cycle {0} --------------------", m_context.CurrentCycle);
     m_component.Pulse();
     Console.WriteLine("-------------------- End Cycle --------------------\n");
     if (m_context.IsHalted)
     {
         m_timer.Stop();
         m_semStop.Release();
     }
 }
Пример #2
0
        public void Start(IProcessorComponent component, ProcessorContext context)
        {
            component.Initialize(context);

            while (!context.IsHalted)
            {
                context.IncrementCycle();
                Console.WriteLine("-------------------- Cycle {0} --------------------", context.CurrentCycle);
                component.Pulse();
                Console.WriteLine("-------------------- End Cycle --------------------\n");
            }
        }