//private void addConfs(int zoom, int iterations, string path)
        //{
        //    prog_pri.Maximum = 257;
        //    prog_jobs.Maximum = (int)Math.Pow(2, 2 * zoom);
        //    prog_jobs.Value = 0;

        //    Job j = new Job(zoom, iterations, path);
        //    _ConfAdder.RunWorkerAsync(j);
        //}

        void lyap_LayerCompleted(object src, LyapunovGenerator.LayerCompletedEventArgs e)
        {
            //LyapunovGenerator sender = (LyapunovGenerator)src;
            //try
            //{
            //    if (!System.IO.Directory.Exists(sender.Conf._path + "\\" + sender.Conf._z)) System.IO.Directory.CreateDirectory(sender.Conf._path + "\\" + sender.Conf._z);
            if (e.Z == -1)
            {
                MessageBox.Show("Recons all blue");
            }
            //}
            //catch
            //{
            //    //MessageBox.Show("File Error");
            //    if (fileError < 5)
            //    {
            //        fileError++;
            //        Confs.Add(sender.Conf);
            //    }
            //    else
            //    {
            //        Confs.Clear();
            //        if (fileError == 5) MessageBox.Show("Could not save");
            //        fileError = 0;
            //        btn_start.Text = "Start";
            //    }
            //}
        }
 void lyap_LayerCompleted(object src, LyapunovGenerator.LayerCompletedEventArgs e)
 {
     e.Layer.Save(folderBrowserDialog1.SelectedPath + "\\" + GetFilename((LyapunovGenerator)src) + ".jpg");
     if (progressBar2.Value < progressBar2.Maximum)
     {
         progressBar2.Value = e.Z + 1;
         for (int i = 0; i < picsdur.Length - 1; i++)
         {
             picsdur[i] = picsdur[i + 1];
         }
         picsdur[picsdur.Length - 1] = DateTime.Now - LastPic;
         LastPic = DateTime.Now;
         if (e.Z < picsdur.Length)
         {
             return;
         }
         TimeSpan sum = TimeSpan.FromSeconds(0);
         foreach (TimeSpan picdur in picsdur)
         {
             sum += picdur;
         }
         double ave = (sum.TotalSeconds / picsdur.Length);
         //System.Diagnostics.Debugger.Log(1, "", ave.ToString() + "\n");
         TimeSpan togo   = TimeSpan.FromSeconds(ave * (Lyaps[0].EndLayer - Lyaps[0].LastLayer));
         DateTime finish = DateTime.Now + togo;
         label17.Text = "Estimated Time Left: " + togo.ToString();
         label8.Text  = "Estimated Finish Time: " + finish.ToString();
     }
 }
Exemple #3
0
        void lyap_LayerCompleted(object src, LyapunovGenerator.LayerCompletedEventArgs e)
        {
            LyapunovGenerator sender = (LyapunovGenerator)src;

            try
            {
                if (!System.IO.Directory.Exists(sender.Conf._path + "\\" + sender.Conf._z))
                {
                    System.IO.Directory.CreateDirectory(sender.Conf._path + "\\" + sender.Conf._z);
                }
                if (e.Z != -1)
                {
                    //System.IO.File.Delete(sender.Conf._path + "\\" + sender.Conf._z + "\\" + sender.Conf._x + "_" + sender.Conf._y + ".png");
                    e.Layer.Save(sender.Conf._path + "\\" + sender.Conf._z + "\\" + sender.Conf._x + "_" + sender.Conf._y + ".png", System.Drawing.Imaging.ImageFormat.Png);
                }
            }
            catch
            {
                Confs.Clear();
                //MessageBox.Show("Problem with: " + sender.Conf._z + "x (" + sender.Conf._x + ", " + sender.Conf._y + ") please sort out!!!");

                //MessageBox.Show("File Error");
                if (fileError < 5)
                {
                    fileError++;
                    Confs.Add(sender.Conf);
                }
                else
                {
                    //Confs.Clear();
                    foreach (LyapunovGenerator lyap in Lyaps)
                    {
                        lyap.Stop();
                    }
                    if (fileError == 5)
                    {
                        MessageBox.Show("Could not save");
                    }
                    fileError      = 0;
                    btn_start.Text = "Start";
                }
            }
        }