Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2662


Ignore:
Timestamp:
01/20/10 17:25:08 (15 years ago)
Author:
swagner
Message:

Fixed wrong updating of an engine's execution time in EngineBaseView (#95)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/EngineBaseView.cs

    r2655 r2662  
    105105        startButton.Enabled = !Engine.Finished;
    106106        resetButton.Enabled = true;
    107         executionTimeTextBox.Text = Engine.ExecutionTime.ToString();
     107        UpdateExecutionTimeTextBox();
    108108        executionTimeTextBox.Enabled = true;
    109109      }
     
    126126        stopButton.Enabled = false;
    127127        resetButton.Enabled = true;
    128         executionTimeTextBox.Text = Engine.ExecutionTime.ToString();
     128        UpdateExecutionTimeTextBox();
    129129      }
    130130    }
     
    139139        stopButton.Enabled = true;
    140140        resetButton.Enabled = false;
    141         executionTimeTextBox.Text = Engine.ExecutionTime.ToString();
     141        UpdateExecutionTimeTextBox();
    142142      }
    143143    }
     
    151151        stopButton.Enabled = false;
    152152        resetButton.Enabled = true;
    153         executionTimeTextBox.Text = Engine.ExecutionTime.ToString();
     153        UpdateExecutionTimeTextBox();
    154154      }
    155155    }
    156156    private void Engine_ExecutionTimeChanged(object sender, EventArgs e) {
    157157      executionTimeCounter++;
    158       if ((executionTimeCounter == 1000) || !Engine.Running) {
     158      if ((executionTimeCounter == 100) || !Engine.Running) {
    159159        executionTimeCounter = 0;
    160         if (InvokeRequired)
    161           Invoke(new EventHandler(Engine_ExecutionTimeChanged), sender, e);
    162         else
    163           executionTimeTextBox.Text = Engine.ExecutionTime.ToString();
     160        UpdateExecutionTimeTextBox();
    164161      }
    165162    }
     
    183180    }
    184181    #endregion
     182
     183    #region Helpers
     184    private void UpdateExecutionTimeTextBox() {
     185      if (InvokeRequired)
     186        Invoke(new Action(UpdateExecutionTimeTextBox));
     187      else
     188        executionTimeTextBox.Text = Engine.ExecutionTime.ToString();
     189    }
     190    #endregion
    185191  }
    186192}
Note: See TracChangeset for help on using the changeset viewer.