public static void CreateBarColours(SwarmAgentWindow Owner) { BarColours = new Dictionary <string, BarColour>(); for (int Index = 0; Index < ( int )EProgressionState.Num; Index++) { BarColours.Add(Enum.GetName(typeof(EProgressionState), Index), new BarColour(AgentApplication.Options.VisualizerColors[Index])); } // Refresh the key Owner.ExportingBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.InstigatorConnected]; Owner.StartingBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.BeginJob]; Owner.EmitPhotonBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.Preparing0]; Owner.IrradianceCacheBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.Preparing2]; Owner.ProcessingBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.Processing0]; Owner.ExportingResultsBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.ExportingResults]; Owner.ImportingBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.Finished]; BarNames = new Dictionary <string, string>(); BarNames.Add(EProgressionState.TaskTotal.ToString(), "Task total"); BarNames.Add(EProgressionState.TasksInProgress.ToString(), "Tasks in progress"); BarNames.Add(EProgressionState.TasksCompleted.ToString(), "Tasks completed"); BarNames.Add(EProgressionState.Idle.ToString(), "Idle"); BarNames.Add(EProgressionState.InstigatorConnected.ToString(), "Exporting to local cache"); BarNames.Add(EProgressionState.RemoteConnected.ToString(), "Connected to remote, starting job"); BarNames.Add(EProgressionState.Exporting.ToString(), "Exporting to local cache"); BarNames.Add(EProgressionState.BeginJob.ToString(), "Lightmass starting up"); BarNames.Add(EProgressionState.Blocked.ToString(), "Waiting for remote to become available"); BarNames.Add(EProgressionState.Preparing0.ToString(), "Emitting direct photons"); BarNames.Add(EProgressionState.Preparing1.ToString(), "Emitting indirect photons"); BarNames.Add(EProgressionState.Preparing2.ToString(), "Calculating irradiance photons"); BarNames.Add(EProgressionState.Preparing3.ToString(), "Caching irradiance photons"); BarNames.Add(EProgressionState.Processing0.ToString(), "Processing mappings"); BarNames.Add(EProgressionState.FinishedProcessing0.ToString(), "Finished processing mappings"); BarNames.Add(EProgressionState.Processing1.ToString(), "Processing1"); BarNames.Add(EProgressionState.FinishedProcessing1.ToString(), "Finished processing1"); BarNames.Add(EProgressionState.Processing2.ToString(), "Processing2"); BarNames.Add(EProgressionState.FinishedProcessing2.ToString(), "Finished processing2"); BarNames.Add(EProgressionState.Processing3.ToString(), "Processing3"); BarNames.Add(EProgressionState.FinishedProcessing3.ToString(), "Finished processing3"); BarNames.Add(EProgressionState.ExportingResults.ToString(), "Exporting results"); BarNames.Add(EProgressionState.ImportingResults.ToString(), "Importing results"); BarNames.Add(EProgressionState.Finished.ToString(), "Finishing"); BarNames.Add(EProgressionState.RemoteDisconnected.ToString(), "Remote disconnected"); BarNames.Add(EProgressionState.InstigatorDisconnected.ToString(), "Instigator disconnected"); BarNames.Add(EProgressionState.Preparing4.ToString(), "Skylight Radiosity"); }
public static void CreateBarColours( SwarmAgentWindow Owner ) { BarColours = new Dictionary<string, BarColour>(); for( int Index = 0; Index <= ( int )EProgressionState.InstigatorDisconnected; Index++ ) { BarColours.Add( Enum.GetName( typeof( EProgressionState ), Index ), new BarColour( AgentApplication.Options.VisualizerColors[Index] ) ); } // Refresh the key Owner.ExportingBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.InstigatorConnected]; Owner.StartingBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.BeginJob]; Owner.EmitPhotonBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.Preparing0]; Owner.IrradianceCacheBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.Preparing2]; Owner.ProcessingBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.Processing0]; Owner.ExportingResultsBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.ExportingResults]; Owner.ImportingBox.BackColor = AgentApplication.Options.VisualizerColors[( int )EProgressionState.Finished]; BarNames = new Dictionary<string, string>(); BarNames.Add( EProgressionState.TaskTotal.ToString(), "Task total" ); BarNames.Add( EProgressionState.TasksInProgress.ToString(), "Tasks in progress" ); BarNames.Add( EProgressionState.TasksCompleted.ToString(), "Tasks completed" ); BarNames.Add( EProgressionState.Idle.ToString(), "Idle" ); BarNames.Add( EProgressionState.InstigatorConnected.ToString(), "Exporting to local cache" ); BarNames.Add( EProgressionState.RemoteConnected.ToString(), "Connected to remote, starting job" ); BarNames.Add( EProgressionState.Exporting.ToString(), "Exporting to local cache" ); BarNames.Add( EProgressionState.BeginJob.ToString(), "Lightmass starting up" ); BarNames.Add( EProgressionState.Blocked.ToString(), "Waiting for remote to become available" ); BarNames.Add( EProgressionState.Preparing0.ToString(), "Emitting direct photons" ); BarNames.Add( EProgressionState.Preparing1.ToString(), "Emitting indirect photons" ); BarNames.Add( EProgressionState.Preparing2.ToString(), "Calculating irradiance photons" ); BarNames.Add( EProgressionState.Preparing3.ToString(), "Caching irradiance photons" ); BarNames.Add( EProgressionState.Processing0.ToString(), "Processing mappings" ); BarNames.Add( EProgressionState.FinishedProcessing0.ToString(), "Finished processing mappings" ); BarNames.Add( EProgressionState.Processing1.ToString(), "Processing1" ); BarNames.Add( EProgressionState.FinishedProcessing1.ToString(), "Finished processing1" ); BarNames.Add( EProgressionState.Processing2.ToString(), "Processing2" ); BarNames.Add( EProgressionState.FinishedProcessing2.ToString(), "Finished processing2" ); BarNames.Add( EProgressionState.Processing3.ToString(), "Processing3" ); BarNames.Add( EProgressionState.FinishedProcessing3.ToString(), "Finished processing3" ); BarNames.Add( EProgressionState.ExportingResults.ToString(), "Exporting results" ); BarNames.Add( EProgressionState.ImportingResults.ToString(), "Importing results" ); BarNames.Add( EProgressionState.Finished.ToString(), "Finishing" ); BarNames.Add( EProgressionState.RemoteDisconnected.ToString(), "Remote disconnected" ); BarNames.Add( EProgressionState.InstigatorDisconnected.ToString(), "Instigator disconnected" ); }
/** * Main GUI update thread */ private static void ProcessGUIThreadProc() { MainWindow = new SwarmAgentWindow(); LogLines = new ReaderWriterQueue <SwarmAgentWindow.LogLine>(); ProgressionEvents = new ReaderWriterQueue <SwarmAgentWindow.ProgressionEvent>(); StartNewLogFile(); Ticking = true; GUIInit.Set(); TimeSpan LoopIterationTime = TimeSpan.FromMilliseconds(100); while (Ticking) { Stopwatch SleepTimer = Stopwatch.StartNew(); ProcessThreadQueues(LoopIterationTime); if (ShowWindow) { #if !__MonoCS__ SetForegroundWindow(MainWindow.Handle); #endif MainWindow.SelectVisualizerTab(); MainWindow.Show(); ShowWindow = false; } Application.DoEvents(); TimeSpan SleepTime = LoopIterationTime - SleepTimer.Elapsed; if (SleepTime.TotalMilliseconds > 0) { Thread.Sleep(SleepTime); } } MainWindow.Destroy(); }