示例#1
0
        //// Sets the time zone
        //public void SetTimeZone(int timeZone)
        //{
        //    SystemMonitor.TimeZoneInformation.TimeZoneNumber = timeZone;
        //}

        /// <summary>
        /// Responds to program change events and triggers the appropriate feedbacks to update
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void SystemMonitor_ProgramChange(Program sender, ProgramEventArgs args)
        {
            Debug.Console(2, this, "Program Change Detected for slot: {0}", sender.Number);
            Debug.Console(2, this, "Event Type: {0}", args.EventType);

            var program = ProgramStatusFeedbackCollection[sender.Number];

            switch (args.EventType)
            {
            case eProgramChangeEventType.OperatingState:
                program.ProgramStartedFeedback.FireUpdate();
                program.ProgramStoppedFeedback.FireUpdate();
                program.ProgramInfo.OperatingState = args.OperatingState;
                if (args.OperatingState == eProgramOperatingState.Start)
                {
                    program.GetProgramInfo();
                }
                else
                {
                    program.AggregatedProgramInfoFeedback.FireUpdate();
                    program.OnProgramInfoChanged();
                }
                break;

            case eProgramChangeEventType.RegistrationState:
                program.ProgramRegisteredFeedback.FireUpdate();
                program.ProgramUnregisteredFeedback.FireUpdate();
                program.ProgramInfo.RegistrationState = args.RegistrationState;
                program.GetProgramInfo();
                break;
            }
        }
示例#2
0
 protected virtual void OnProgramEnded(ProgramEventArgs e)
 {
     if (ProgramEnded != null)
     {
         ProgramEnded(this, e);
     }
 }
示例#3
0
 void _programExecutor_ProgramStarted(object sender, ProgramEventArgs e)
 {
     OnContextStarted(EventArgs.Empty);
     if (ProgramStarted != null)
     {
         ProgramStarted(this, e);
     }
 }
示例#4
0
 void _programExecutor_ProgramEnded(object sender, ProgramEventArgs e)
 {
     if (ProgramEnded != null)
     {
         ProgramEnded(this, e);
     }
     OnContextEnded(EventArgs.Empty);
 }
示例#5
0
        private void context_ProgramEnded(object sender, ProgramEventArgs e)
        {
            ProgramContext context = sender as ProgramContext;

            context.ProgramEnded -= context_ProgramEnded;
            if (!_cachedPrograms.ContainsValue(context))
            {
                Logging.Info("Context wasn't cached, so releasing and cleaning up context.");
                VixenSystem.Contexts.ReleaseContext(context);
            }
            else
            {
                Logging.Info("Context is cached, so not cleaning up; will potentially reuse.");
            }
            ScheduleItem item;

            if (_currentContexts.TryGetValue(context, out item))
            {
                item.IsExecuting = false;
                _currentContexts.Remove(context);
            }
        }
示例#6
0
        void SystemMonitor_ProgramChange(Program sender, ProgramEventArgs args)
        {
            uint ProgNo           = args.ProgramNumber;
            bool ProgState        = args.OperatingState == eProgramOperatingState.Start?true:false;
            bool ProgRegistration = args.RegistrationState == eProgramRegistrationState.Register?true:false;

            switch (args.EventType)
            {
            case eProgramChangeEventType.NoChange:
                break;

            case eProgramChangeEventType.OperatingState:
                UpdateOperatingState(ProgNo, ProgState);
                break;

            case eProgramChangeEventType.RegistrationState:
                UpdateRegistrationState(ProgNo, ProgRegistration);
                break;

            default:
                break;
            }
        }
示例#7
0
 private void _ProgramExecutorProgramEnded(object sender, ProgramEventArgs e)
 {
     OnProgramEnded(e);
     OnContextEnded(EventArgs.Empty);
 }
示例#8
0
 private void ProgramContextProgramStarted(object sender, ProgramEventArgs e)
 {
     Start();
 }
示例#9
0
 private void ProgramContextProgramEnded(object sender, ProgramEventArgs e)
 {
     Stop();
 }
示例#10
0
 public void InvokeProgramEvent(ProgramEventArgs e)
 {
 }
示例#11
0
 private void ProgramContextProgramStarted(object sender, ProgramEventArgs e)
 {
     ResetColors(true);
     Start();
 }
示例#12
0
 private void ProgramContextProgramEnded(object sender, ProgramEventArgs e)
 {
     ResetColors(false);
     Stop();
 }
示例#13
0
        void myCPU_OnProgramDone(object sender, ProgramEventArgs args)
        {
            MethodInvoker method = delegate
            {
                this.fetchLabel.Text = "- - -";
                this.decodeLabel.Text = "- - -";
                this.executeLabel.Text = "- - -";
                this.storeLabel.Text = "- - -";
                this.nextInstructionLabel.Text = "End of program";

            };

            if (this.InvokeRequired)
            {
                this.Invoke(method);
            }
            else
            {
                method.Invoke();
            }
        }
示例#14
0
 private void ProgramContextProgramStarted(object sender, ProgramEventArgs e)
 {
     Console.WriteLine("ProgramContextProgramStarted");
     Start();
 }
示例#15
0
 private void ProgramContextProgramEnded(object sender, ProgramEventArgs e)
 {
     //ResetColors(false);
     Console.WriteLine("Stopped");
     Stop();
 }