//// 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; } }
protected virtual void OnProgramEnded(ProgramEventArgs e) { if (ProgramEnded != null) { ProgramEnded(this, e); } }
void _programExecutor_ProgramStarted(object sender, ProgramEventArgs e) { OnContextStarted(EventArgs.Empty); if (ProgramStarted != null) { ProgramStarted(this, e); } }
void _programExecutor_ProgramEnded(object sender, ProgramEventArgs e) { if (ProgramEnded != null) { ProgramEnded(this, e); } OnContextEnded(EventArgs.Empty); }
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); } }
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; } }
private void _ProgramExecutorProgramEnded(object sender, ProgramEventArgs e) { OnProgramEnded(e); OnContextEnded(EventArgs.Empty); }
private void ProgramContextProgramStarted(object sender, ProgramEventArgs e) { Start(); }
private void ProgramContextProgramEnded(object sender, ProgramEventArgs e) { Stop(); }
public void InvokeProgramEvent(ProgramEventArgs e) { }
private void ProgramContextProgramStarted(object sender, ProgramEventArgs e) { ResetColors(true); Start(); }
private void ProgramContextProgramEnded(object sender, ProgramEventArgs e) { ResetColors(false); Stop(); }
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(); } }
private void ProgramContextProgramStarted(object sender, ProgramEventArgs e) { Console.WriteLine("ProgramContextProgramStarted"); Start(); }
private void ProgramContextProgramEnded(object sender, ProgramEventArgs e) { //ResetColors(false); Console.WriteLine("Stopped"); Stop(); }