Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/04/18 22:33:26 (6 years ago)
Author:
abeham
Message:

#1614:

  • reverted r15603 by reverse merging
  • added expert system plugins from #2457
Location:
branches/1614_GeneralizedQAP/HeuristicLab.Optimization.Views/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1614_GeneralizedQAP/HeuristicLab.Optimization.Views/3.3/IOptimizerView.Designer.cs

    r15605 r15721  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.components = new System.ComponentModel.Container();
    4847      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(IOptimizerView));
    4948      this.startButton = new System.Windows.Forms.Button();
     
    5352      this.stopButton = new System.Windows.Forms.Button();
    5453      this.resetButton = new System.Windows.Forms.Button();
    55       this.executionTimer = new System.Windows.Forms.Timer(this.components);
    5654      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5755      this.SuspendLayout();
     
    134132      this.resetButton.Click += new System.EventHandler(this.resetButton_Click);
    135133      //
    136       // executionTimer
    137       //
    138       this.executionTimer.Interval = 200;
    139       this.executionTimer.Tick += new System.EventHandler(this.executionTimer_Tick);
    140       //
    141134      // IOptimizerView
    142135      //
     
    173166    protected System.Windows.Forms.Button pauseButton;
    174167    protected System.Windows.Forms.Button stopButton;
    175     protected System.Windows.Forms.Timer executionTimer;
    176168    protected System.Windows.Forms.Button resetButton;
    177169
  • branches/1614_GeneralizedQAP/HeuristicLab.Optimization.Views/3.3/IOptimizerView.cs

    r15605 r15721  
    4444      Content.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred);
    4545      Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);
     46      Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged);
    4647      Content.Prepared -= new EventHandler(Content_Prepared);
    4748      Content.Started -= new EventHandler(Content_Started);
     
    5455      Content.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred);
    5556      Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);
     57      Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);
    5658      Content.Prepared += new EventHandler(Content_Prepared);
    5759      Content.Started += new EventHandler(Content_Started);
     
    6264    protected override void OnContentChanged() {
    6365      base.OnContentChanged();
    64       if (Content != null) {
     66      if (Content == null) {
     67        executionTimeTextBox.Text = "-";
     68      } else {
    6569        Locked = ReadOnly = Content.ExecutionState == ExecutionState.Started;
     70        executionTimeTextBox.Text = Content.ExecutionTime.ToString();
    6671      }
    67       UpdateExecutionTime();
    6872    }
    6973
     
    8690      else {
    8791        nameTextBox.Enabled = infoLabel.Enabled = true;
    88         UpdateExecutionTime();
    8992        ReadOnly = Locked = false;
    9093        SetEnabledStateOfExecutableButtons();
     
    9598        Invoke(new EventHandler(Content_Started), sender, e);
    9699      else {
    97         executionTimer.Start();
    98100        nameTextBox.Enabled = infoLabel.Enabled = false;
    99101        ReadOnly = Locked = true;
     
    105107        Invoke(new EventHandler(Content_Paused), sender, e);
    106108      else {
    107         executionTimer.Stop();
    108         UpdateExecutionTime();
    109109        nameTextBox.Enabled = infoLabel.Enabled = true;
    110110        ReadOnly = Locked = false;
     
    116116        Invoke(new EventHandler(Content_Stopped), sender, e);
    117117      else {
    118         executionTimer.Stop();
    119         UpdateExecutionTime();
    120118        nameTextBox.Enabled = infoLabel.Enabled = true;
    121119        ReadOnly = Locked = false;
     
    123121      }
    124122    }
     123    protected virtual void Content_ExecutionTimeChanged(object sender, EventArgs e) {
     124      if (InvokeRequired)
     125        Invoke(new EventHandler(Content_ExecutionTimeChanged), sender, e);
     126      else
     127        executionTimeTextBox.Text = Content == null ? "-" : Content.ExecutionTime.ToString();
     128    }
    125129    protected virtual void Content_ExceptionOccurred(object sender, EventArgs<Exception> e) {
    126130      if (InvokeRequired)
    127131        Invoke(new EventHandler<EventArgs<Exception>>(Content_ExceptionOccurred), sender, e);
    128       else {
    129         executionTimer.Stop();
    130         UpdateExecutionTime();
     132      else
    131133        ErrorHandling.ShowErrorDialog(this, e.Value);
    132       }
    133134    }
    134135    #endregion
     
    146147    protected virtual void resetButton_Click(object sender, EventArgs e) {
    147148      Content.Prepare(false);
    148     }
    149     private void executionTimer_Tick(object sender, EventArgs e) {
    150       UpdateExecutionTime();
    151     }
    152 
    153     private void UpdateExecutionTime() {
    154       executionTimeTextBox.Text = (Content == null ? "-" : Content.ExecutionTime.ToString());
    155149    }
    156150    #endregion
Note: See TracChangeset for help on using the changeset viewer.