private void Rev_proc()
 {
     j -= 1;
     if (j <= 0)
     {
         j = max;
     }
     this.Invoke((MethodInvoker) delegate
     {
         Time_Preview.Text = (CO_TIME.Value * j / max).ToString();
     });
     PreviewDisplay.Populate((double)CO_TIME.Value * C_Sound() / (max * 1000), SmartParticles);
     Rhino.RhinoDoc.ActiveDoc.Views.Redraw();
 }
Exemplo n.º 2
0
            private void Show_Field()
            {
                List <int> X = new List <int>(), Y = new List <int>(), Z = new List <int>();

                foreach (CutPlane p in Map_Planes.Items)
                {
                    if (p.axis == 0)
                    {
                        X.Add(p.pos);
                    }
                    else if (p.axis == 1)
                    {
                        Y.Add(p.pos);
                    }
                    else if (p.axis == 2)
                    {
                        Z.Add(p.pos);
                    }
                }

                FDTD.Pressure_Points(ref Pts, ref Pressure, X.ToArray(), Y.ToArray(), Z.ToArray(), 0.00002 * Math.Pow(10, (double)Param_Min.Value / 20), false, false, true, Magnitude.Checked);
                P.Populate(X.ToArray(), Y.ToArray(), Z.ToArray(), FDTD.dx, Pressure, M, Magnitude.Checked);

                Rhino.RhinoDoc.ActiveDoc.Views.Redraw();
            }
Exemplo n.º 3
0
            private void Step_Forward()
            {
                t_lo = t * (double)Step_Select.Value;
                t_hi = t * (double)Step_Select.Value + (double)Integration_select.Value;
                if (t_hi > Map[0].CutOffTime)
                {
                    t_lo = t = 0;
                    t_hi = t + (double)Integration_select.Value;
                }

                this.Invoke((MethodInvoker) delegate { oct = PachTools.OctaveStr2Int(Octave.Text); });
                this.Invoke((MethodInvoker) delegate { Update_T(); });

                Mesh Mesh_Map = PachMapReceiver.Get_SPL_Map(Map, new double[] { Current_SPLMin, Current_SPLMax }, new double[] { t_hi, t_lo }, c_scale, oct, SelectedSources(), Coherent.Checked, ZeroAtDirect.Checked, false);

                if (WC == null)
                {
                    return;
                }
                WC.Populate(Mesh_Map);

                //////////////////////////////
                if (Folder_Status.Text != "")
                {
                    string number;
                    if (t < 100)
                    {
                        if (t < 10)
                        {
                            number = "00" + t.ToString();
                        }
                        else
                        {
                            number = "0" + t.ToString();
                        }
                    }
                    else
                    {
                        number = t.ToString();
                    }

                    this.Invoke((MethodInvoker) delegate { Rhino.RhinoApp.RunScript("-ViewCaptureToFile " + Folder_Status.Text + "\\"[0] + "frame" + number + ".jpg Width=1280 Height=720 DrawGrid=No Enter", true); });
                }
                //////////////////////////////
                t++;

                Rhino.RhinoDoc.ActiveDoc.Views.Redraw();
            }
            private void Show_Field()
            {
                List <int> X = new List <int>(), Y = new List <int>(), Z = new List <int>();

                foreach (CutPlane p in Map_Planes.Items)
                {
                    if (p.axis == 0)
                    {
                        X.Add(p.pos);
                    }
                    else if (p.axis == 1)
                    {
                        Y.Add(p.pos);
                    }
                    else if (p.axis == 2)
                    {
                        Z.Add(p.pos);
                    }
                }

                List <List <Hare.Geometry.Point> > hpts = new List <List <Hare.Geometry.Point> >();

                FDTD.Pressure_Points(ref hpts, ref Pressure, X.ToArray(), Y.ToArray(), Z.ToArray(), 0.00002 * Math.Pow(10, (double)Param_Min.Value / 20), false, false, true, Magnitude.Checked);
                List <List <Rhino.Geometry.Point3d> > Pts = new List <List <Rhino.Geometry.Point3d> >();

                for (int i = 0; i < hpts.Count; i++)
                {
                    Pts.Add(new List <Rhino.Geometry.Point3d>());
                    for (int j = 0; j < hpts[i].Count; j++)
                    {
                        Pts[i].Add(RC_PachTools.HPttoRPt(hpts[i][j]));
                    }
                }

                P.Populate(X.ToArray(), Y.ToArray(), Z.ToArray(), FDTD.dx, Pressure, M, Magnitude.Checked);

                Rhino.RhinoDoc.ActiveDoc.Views.Redraw();
            }