示例#1
0
 void Lyap_ColumnCompleted(object src, Generator.ProgressedEventArgs e)
 {
     if (src == Lyaps[0] && e.X < prog_pri.Maximum)
     {
         prog_pri.Value = e.X + 1;
     }
 }
示例#2
0
 void Lyap_ColumnCompleted(object src, Generator.ProgressedEventArgs e)
 {
     if (e.X < progressBar1.Maximum)
     {
         progressBar1.Value = e.X + 1;
         for (int i = 0; i < colsdur.Length - 1; i++)
         {
             colsdur[i] = colsdur[i + 1];
         }
         colsdur[colsdur.Length - 1] = DateTime.Now - LastCol;
         LastCol = DateTime.Now;
         if (e.X < colsdur.Length) return;
         TimeSpan sum = TimeSpan.FromSeconds(0);
         foreach (TimeSpan coldur in colsdur)
         {
             sum += coldur;
         }
         double ave = (sum.TotalSeconds / colsdur.Length);
         //System.Diagnostics.Debugger.Log(1, "", ave.ToString() + "\n");
         TimeSpan togo = TimeSpan.FromSeconds(ave * (Lyaps[0].EndCol - Lyaps[0].LastCol));
         DateTime finish = DateTime.Now + togo;
         label14.Text = "Estimated Time Left: " + togo.ToString();
         label15.Text = "Estimated Finish Time: " + finish.ToString();
     }
 }
示例#3
0
 void Lyap_AreaCompleted(object src, Generator.ProgressedEventArgs e)
 {
     if (_Image == null) return;
     progress = e.Progress;
     AddArea(e.X, e.Y, e.Z, e.Image);
     //ImageUpdateEventArgs args = new ImageUpdateEventArgs();
     //args.X = e.X;
     //args.Column = e.Column;
     //pictureBox1.Image = e.Column;
     if (waitrefresh >= refreshrate)
     {
         waitrefresh = 0;
         _output_pb.BackgroundImage = _Image;
         UICallerDelegate dlg = new UICallerDelegate(UpdatePicBox);
         BeginInvoke(dlg, null);
     }
     else
     {
         waitrefresh++;
     }
     try
     {
         UICallerDelegate delg = new UICallerDelegate(UpdateProgBar);
         BeginInvoke(delg, null);
     }
     catch { }
 }
示例#4
0
 private string GetFilename(Generator Lyap)
 {
     string p1 = Lyap.MinX.ToString() + "-" +
         Lyap.MaxX.ToString() + "-" +
         Lyap.PicWidth.ToString() + "-" +
         Lyap.MinY.ToString() + "-" +
         Lyap.MaxY.ToString() + "-" +
         Lyap.PicHeight.ToString() + "-";
     string p2 = Lyap.PicDepth > 1 ? Lyap.MinZ.ToString() + "-" +
         Lyap.MaxZ.ToString() + "-" +
         Lyap.PicDepth.ToString() + "-" : "";
     string p3 = new string(Lyap.Pattern) + "-" +
         Lyap.Iterations.ToString() + "-" +
         Lyap.InitX;
     return p1 + p2 + p3 + ".jpg";
 }
示例#5
0
 private void InitLyap(Generator lyap)
 {
     lyap.Progressed += Lyap_AreaCompleted;
     lyap.Completed += Lyap_PicCompleted;
     lyap.Died += Lyap_Died;
 }