public override void ExecuteSimple()
            {
                // TODO: Implement the workstep logic here.
                SeismicCube       cube = arguments.Cube;
                SeismicCollection sc   = cube.SeismicCollection;
                SeismicProject    proj = null;
                SeismicRoot       sroot;

                sroot = SeismicRoot.Get(PetrelProject.PrimaryProject);
                if (!sroot.HasSeismicProject)
                {
                    return;
                }
                proj = sroot.SeismicProject;
                using (ITransaction t = DataManager.NewTransaction()) {
                    t.Lock(proj);
                    InterpretationCollection             aaa            = proj.CreateInterpretationCollection("aaa");
                    HorizonInterpretation                h              = aaa.CreateHorizonInterpretation("surface", cube.Domain);
                    HorizonInterpretation3D              h3d            = h.CreateHorizonInterpretation3D(sc);
                    List <HorizonInterpretation3DSample> horizonsamples = new List <HorizonInterpretation3DSample>();
                    for (int i = 0; i < cube.NumSamplesIJK.I; i++)
                    {
                        for (int j = 0; j < cube.NumSamplesIJK.J; j++)
                        {
                            horizonsamples.Add(new HorizonInterpretation3DSample(i, j, -2000));
                        }
                    }
                    h3d.Samples = horizonsamples;
                    t.Commit();
                }
            }
Exemple #2
0
        public void StartServer()
        {
            if (ChatClient.ClientForm.serverBusy == true)
            {
                return;
            }
            try
            {
                ChatClient.ClientForm.serverBusy = true;
                listener.Start();
                TcpClient     client    = listener.AcceptTcpClient();
                NetworkStream stream    = client.GetStream();
                IFormatter    formatter = new BinaryFormatter();
                switch (objType)
                {
                case OBJTYPE.SIESMIC_CUBE:
                    SerializableSeismicCube scube = (SerializableSeismicCube)formatter.Deserialize(stream);
                    using (ITransaction t = DataManager.NewTransaction())
                    {
                        t.Lock(parent);
                        SeismicCollection c = (SeismicCollection)parent;
                        if (scube == null)
                        {
                            MessageBox.Show("Error in transmission!");
                        }
                        else
                        {
                            SeismicCube cube = scube.cube;

                            if (c.CanCreateSeismicCube(cube))
                            {
                                c.CreateSeismicCube(cube, cube.PropertyVersion);
                            }
                            else
                            {
                                MessageBox.Show("Unable to create the Seismic Cube");
                            }
                        }
                    }
                    break;
                }
                client.Close();
                listener.Stop();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Object Recieving Failed!" + ex.Message, "File Transfer",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            ChatClient.ClientForm.serverBusy = false;
        }
        public void convertToSeismic(string fileName)
        {
            // Check if parent collection contains any 2D data
            SeismicCollection coll = (SeismicCollection)FTReciever.parent;

            while (coll.MemberType == typeof(SeismicLine2DCollection))
            {
                MessageBox.Show("The Seismic Collection you selected was of SeismicLine2DCollection");
                List <SeismicCollection> cols  = Discuss.getAllSeismicCollections();
                List <string>            names = new List <string>();
                foreach (SeismicCollection col in cols)
                {
                    names.Add(col.Name);
                }
                objSelect selector = new objSelect("Select a Seismic collection to add the cube to", names);
                if (selector.ShowDialog() == DialogResult.Cancel)
                {
                    return;
                }
                coll = cols[objSelect.SelectedIndex];
            }
            // Get Service

            ISegyFormat segyFormat = CoreSystem.GetService <ISegyFormat>();
            // Find property version
            IPropertyVersionService pvService = PetrelSystem.PropertyVersionService;
            ITemplate       seisTemplate      = PetrelUnitSystem.TemplateGroupSeismicColor.SeismicDefault;
            PropertyVersion pv   = pvService.FindOrCreate(PetrelSystem.GetGlobalPropertyVersionContainer(), seisTemplate);
            SeismicCube     cube = SeismicCube.NullObject;

            // Lock the parent
            using (ITransaction txn = DataManager.NewTransaction())
            {
                try
                {
                    txn.Lock(coll);
                    cube = segyFormat.ImportSeismic3D(fileName, (SeismicCollection)FTReciever.parent, "", Domain.ELEVATION_DEPTH, pv);
                }
                catch (InvalidOperationException e)
                {
                    MessageBox.Show(e.Message);
                }
                finally
                {
                    txn.Commit();
                }
            }
        }
            public OceanSeismicMultithreaded(int n, int m)
            {
                // Create new output cube
                SeismicCube       outputCube = SeismicCube.NullObject;
                SeismicCollection coll       = SeismicCollection.NullObject;
                SeismicRoot       seisRoot;

                seisRoot = SeismicRoot.Get(PetrelProject.PrimaryProject);
                if (!seisRoot.HasSeismicProject)
                {
                    using (ITransaction tr = DataManager.NewTransaction())
                    {
                        tr.Lock(seisRoot);
                        seisRoot.CreateSeismicProject();
                        tr.Commit();
                    }
                }
                SeismicProject proj = seisRoot.SeismicProject;

                using (ITransaction tr = DataManager.NewTransaction())
                {
                    tr.Lock(proj);
                    coll = proj.CreateSeismicCollection("Test Survey Async " + n.ToString() + "x" + m.ToString());
                    tr.Lock(coll);
                    Index3  size             = new Index3(n, n, m);
                    Point3  origin           = new Point3(13579.75, 24680.08, 0.0);
                    Vector3 iSpacing         = new Vector3(100.0, 0.0, 0.000);
                    Vector3 jSpacing         = new Vector3(0.0, 100.0, 0.000);
                    Vector3 kSpacing         = new Vector3(0.0, 0.0, -100.0);
                    Index2  annotationOrigin = new Index2(0, 0);
                    Index2  annotationInc    = new Index2(1, 1);
                    if (coll.CanCreateSeismicCube(size, origin, iSpacing, jSpacing, kSpacing))
                    {
                        Type     dataType = typeof(float);
                        Domain   vDomain  = Domain.ELEVATION_DEPTH;
                        Template tmpl     = PetrelProject.WellKnownTemplates
                                            .SeismicColorGroup.SeismicDefault;
                        Range1 <double> r = new Range1 <double>(0.0, 140.0);
                        _cube = coll.CreateSeismicCube(size, origin, iSpacing, jSpacing, kSpacing, annotationOrigin, annotationInc, dataType, vDomain, tmpl, r);
                    }
                    if (_cube.IsWritable)
                    {
                        MakeCube(_cube);
                    }
                    tr.Commit();
                }
            }
 public Reservoir(SeismicCube cubeDensity, SeismicCube cubeSonic)
 {
     this.cubeDensity = cubeDensity;
     this.cubeSonic   = cubeSonic;
     this.scol        = cubeDensity.SeismicCollection;
 }