Ejemplo n.º 1
0
        public void UpdateApplicationProperties(ApplicationPropertiesChangedEventArgs applicationProperties)
        {
            StatusStripValueChanged(this.TargetApplicationStatusStrip, this.TargetStatusToolStripStatus, applicationProperties.LoadedApplicationProperties.TargetStatus.ToString());
            StatusStripValueChanged(this.TargetApplicationStatusStrip, this.AverageTetToolStripStatus, applicationProperties.LoadedApplicationProperties.AverageTeT.ToString("#.######"));
            StatusStripValueChanged(this.TargetApplicationStatusStrip, this.CpuOverloadedToolStripStatus, applicationProperties.LoadedApplicationProperties.CpuOverload.ToString());
            StatusStripValueChanged(this.TargetApplicationStatusStrip, this.ExecutionTimeToolStripStatus, applicationProperties.LoadedApplicationProperties.ExecutionTime.ToString("#.#"));

            RichTextBoxStateChange(this.LoadedModelRichTextBox, this.LoadedModelRichTextBox.Enabled, false, applicationProperties.LoadedApplicationProperties.LoadedModelName.ToString());

            UpdateToolStripStatusColor(applicationProperties.LoadedApplicationProperties.TargetStatus, applicationProperties.LoadedApplicationProperties.CpuOverload);
        }
Ejemplo n.º 2
0
		private void HandleApplicationPropertiesChanged(object sender, ApplicationPropertiesChangedEventArgs args)
		{
			MainScreen.UpdateApplicationProperties(args);

			if(SimulationState.IsSimulationRunning)
			{
				// If target stopped automatically due to time stop or CPU exception, change control states as if the 
				// user had clicked "Stop Simulation"
				bool isValidStopTimeReached = (args.LoadedApplicationProperties.ExecutionTime >= SimulationState.StopTime) &&
					(SimulationState.StopTime != ModelConstants.INFINITE_STOP_TIME);
				if (isValidStopTimeReached || args.LoadedApplicationProperties.CpuOverload)
				{
					MouseEventArgs newArgs = new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0);
					HandleStartSimulationToggleButtonClicked(this, newArgs);
				}
			}
		}
        private void OnApplicationStateChanged(IHasLoadedApplicationState applicationState)
        {
            ApplicationPropertiesChangedEventArgs args = new ApplicationPropertiesChangedEventArgs(applicationState);

            ApplicationPropertiesChanged?.Invoke(this, args);
        }