StartAsync() public method

Start asyncron computing with parameters mParameterDict.
public StartAsync ( ) : void
return void
コード例 #1
0
 /// <summary>
 /// Neuzeichnen.
 /// </summary>
 protected virtual void StartDrawing()
 {
     _forceRedraw = false;
     lock (_inDrawingMutex)
         _inDrawing = true;
     System.Diagnostics.Debug.WriteLine("_inDrawing = true (6)");
     SetPictureBoxSize();
     _iterate = new Iterate(_maxx, _maxy, this, IsRightView);
     AssignParameters();
     _iterate.StartAsync(_parameter,
                         ParameterDict.Current.GetInt("Formula.Static.Cycles"),
                         1,
                         ParameterDict.Current.GetBool("Formula.Static.Julia"),
                         !ParameterDict.Current.GetBool("Transformation.Camera.IsometricProjection"));
 }
コード例 #2
0
ファイル: PaintJob.cs プロジェクト: benpicco-tmp/Gestaltlupe
 /// <summary>
 /// Start Computing. Is called while rendering an animation. 
 /// </summary>
 public void Run(int updateSteps)
 {
     _currentProgress = 0;
     _master.Progress(_currentProgress);
     System.Diagnostics.Debug.WriteLine("PaintJob.Run " + updateSteps.ToString());
     _parameters = ParameterDict.Current.Clone();
     _updateSteps = updateSteps;
     _currentProgressd = 100.0 / (double)(_updateSteps);
     for (int i = 0; i < _updateSteps; i++)
     {
         if (_abort)
             return;
         _iterate = new Iterate(_parameters, this, false);
         if (_lastIterate != null)
         {
             _iterate.SetOldData(_lastIterate.GraphicInfo,_lastIterate.PictureData,i);
         }
         if (_abort)
             return;
         _iterate.StartAsync();
         _iterate.Wait();
         if (_abort)
             return;
         _lastIterate = _iterate;
         _currentProgress += _currentProgressd;
         _master.Progress(_currentProgress);
     }
     Renderer renderer = PictureArtFactory.Create(_iterate.PictureData, _iterate.LastUsedFormulas);
     renderer.Paint(_graphics);
     if (_abort)
         return;
     _master.Progress(0);
 }
コード例 #3
0
 /// <summary>
 /// Create surface model.
 /// </summary>
 public void ComputeOneStep()
 {
     ImageCreationStarts();
     if (_paras != null)
         _paras.InComputing = true;
     this.WindowState = FormWindowState.Normal;
     if (Scheduler.GrandScheduler.Exemplar.inComputeOneStep)
         return;
     try
     {
         Scheduler.GrandScheduler.Exemplar.inComputeOneStep = true;
         SetPictureBoxSize();
         string tempParameterHash = GetParameterHashWithoutPictureArt();
         _paras.Assign();
         if (_oldParameterHashWithoutPictureArt == tempParameterHash)
         {
             // Update last render for better quality
             _currentUpdateStep++;
             DataTypes.GraphicData oldData = null;
             DataTypes.PictureData oldPictureData = null;
             if (_iterate != null && !_iterate.InAbort)
             {
                 oldData = _iterate.GraphicInfo;
                 oldPictureData = _iterate.PictureData;
             }
             _iterate = new Iterate(_width, _height, this, false);
             _updateCount++;
             _iterate.SetOldData(oldData, oldPictureData, _updateCount);
             if (!ParameterDict.Current.GetBool("View.Pipeline.UpdatePreview"))
                 _iterate._oneStepProgress = _inPreview;
             else
                 _iterate._oneStepProgress = false;
             if (_updateCount > ParameterDict.Current.GetDouble("View.UpdateSteps") + 1)
                 _iterate._oneStepProgress = true;
             _iterate.StartAsync(_paras.Parameter, _paras.Cycles, _paras.ScreenSize, _paras.Formula==-2, !ParameterDict.Current.GetBool("Transformation.Camera.IsometricProjection"));
         }
         else
         {
             // Initiate new rendering
             {
                 // Stop subrendering, if some formula parameters changed
                 if (_currentUpdateStep > 0)
                 {
                     _currentUpdateStep = 0;
                     if (_paras != null)
                         _paras.InComputing = false;
                     Scheduler.GrandScheduler.Exemplar.inComputeOneStep = false;
                     _oldParameterHashWithoutPictureArt = "";
                     _updateCount = 1;
                 }
                 _oldParameterHashWithoutPictureArt = tempParameterHash;
                 _paras.Assign();
                 _updateCount = 1;
                 _iterate = new Iterate(_width, _height, this, false);
                 _iterate._oneStepProgress = false;
                 _iterate.StartAsync(_paras.Parameter, _paras.Cycles, _paras.ScreenSize, _paras.Formula==-2, !ParameterDict.Current.GetBool("Transformation.Camera.IsometricProjection"));
             }
         }
     }
     catch (System.Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.ToString());
         if (_paras != null)
             _paras.InComputing = false;
         Scheduler.GrandScheduler.Exemplar.inComputeOneStep = false;
     }
 }
コード例 #4
0
 /// <summary>
 /// Neuzeichnen.
 /// </summary>
 protected virtual void StartDrawing()
 {
     _forceRedraw = false;
     _inDrawing = true;
     SetPictureBoxSize();
     _iterate = new Iterate(_maxx, _maxy, this, IsRightView);
     AssignParameters();
     _iterate.StartAsync(_parameter,
             ParameterDict.Current.GetInt("Formula.Static.Cycles"),
             1,
             ParameterDict.Current.GetInt("Formula.Static.Formula"),
             ParameterDict.Current.GetBool("View.Perspective"));
 }
コード例 #5
0
 /// <summary>
 /// Create surface model.
 /// </summary>
 public void ComputeOneStep()
 {
     ImageCreationStarts();
     if (_paras != null)
     {
         _paras.InComputing = true;
     }
     this.WindowState = FormWindowState.Normal;
     if (Scheduler.GrandScheduler.Exemplar.inComputeOneStep)
     {
         return;
     }
     try
     {
         Scheduler.GrandScheduler.Exemplar.inComputeOneStep = true;
         SetPictureBoxSize();
         string tempParameterHash = GetParameterHashWithoutPictureArt();
         _paras.Assign();
         if (_oldParameterHashWithoutPictureArt == tempParameterHash)
         {
             // Update last render for better quality
             _currentUpdateStep++;
             DataTypes.GraphicData oldData        = null;
             DataTypes.PictureData oldPictureData = null;
             if (_iterate != null && !_iterate.InAbort)
             {
                 oldData        = _iterate.GraphicInfo;
                 oldPictureData = _iterate.PictureData;
             }
             _iterate = new Iterate(_width, _height, this, false);
             _updateCount++;
             _iterate.SetOldData(oldData, oldPictureData, _updateCount);
             if (!ParameterDict.Current.GetBool("View.Pipeline.UpdatePreview"))
             {
                 _iterate._oneStepProgress = _inPreview;
             }
             else
             {
                 _iterate._oneStepProgress = false;
             }
             if (_updateCount > ParameterDict.Current.GetDouble("View.UpdateSteps") + 1)
             {
                 _iterate._oneStepProgress = true;
             }
             _iterate.StartAsync(_paras.Parameter, _paras.Cycles, _paras.ScreenSize, _paras.Formula == -2, !ParameterDict.Current.GetBool("Transformation.Camera.IsometricProjection"));
         }
         else
         {
             // Initiate new rendering
             {
                 // Stop subrendering, if some formula parameters changed
                 if (_currentUpdateStep > 0)
                 {
                     _currentUpdateStep = 0;
                     if (_paras != null)
                     {
                         _paras.InComputing = false;
                     }
                     Scheduler.GrandScheduler.Exemplar.inComputeOneStep = false;
                     _oldParameterHashWithoutPictureArt = "";
                     _updateCount = 1;
                 }
                 _oldParameterHashWithoutPictureArt = tempParameterHash;
                 _paras.Assign();
                 _updateCount = 1;
                 _iterate     = new Iterate(_width, _height, this, false);
                 _iterate._oneStepProgress = false;
                 _iterate.StartAsync(_paras.Parameter, _paras.Cycles, _paras.ScreenSize, _paras.Formula == -2, !ParameterDict.Current.GetBool("Transformation.Camera.IsometricProjection"));
             }
         }
     }
     catch (System.Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.ToString());
         if (_paras != null)
         {
             _paras.InComputing = false;
         }
         Scheduler.GrandScheduler.Exemplar.inComputeOneStep = false;
     }
 }
コード例 #6
0
ファイル: RenderImage.cs プロジェクト: trafassel/Gestaltlupe
 /// <summary>
 /// Neuzeichnen.
 /// </summary>
 protected virtual void StartDrawing()
 {
     _forceRedraw = false;
     lock (_inDrawingMutex)
         _inDrawing = true;
     System.Diagnostics.Debug.WriteLine("_inDrawing = true (6)");
     SetPictureBoxSize();
     _iterate = new Iterate(_maxx, _maxy, this, IsRightView);
     AssignParameters();
     _iterate.StartAsync(_parameter,
             ParameterDict.Current.GetInt("Formula.Static.Cycles"),
             1,
             ParameterDict.Current.GetBool("Formula.Static.Julia"),
             !ParameterDict.Current.GetBool("Transformation.Camera.IsometricProjection"));
 }