public override void Execute(Slb.Ocean.Petrel.Contexts.Context context)
        {
            //foreach (object obj in context.GetSelectedObjects())
            //{
            //    DictionaryWellPointPropertyFilter DPF = obj as DictionaryWellPointPropertyFilter;
            //    WellKnownMarkerPropertyTypes wf=new WellKnownMarkerPropertyTypes();
            //
            //    PetrelLogger.InfoOutputWindow(DPF.Name+"--"+ DPF.Droid);
            //
            //}
            WellRoot wellroot = WellRoot.Get(PetrelProject.PrimaryProject);

            PetrelLogger.InfoOutputWindow("-------------------- Well Root Navigation ----------------------");

            if (wellroot.BoreholeCollection != null)
            {
                PrintBoreholeCollection(wellroot.BoreholeCollection);
            }
            else
            {
                PetrelLogger.InfoOutputWindow("No borehole information to print.");
            }
            if (wellroot.MarkerCollectionCount > 0)
            {
                PrintMarkerCollectionDetails(wellroot.MarkerCollections.First());
            }
            else
            {
                PetrelLogger.InfoOutputWindow("No Marker collections to print");
                return;
            }
        }
        public override bool CanExecute(Slb.Ocean.Petrel.Contexts.Context context)
        {
            IEnumerable <object> selectedObjects = context.GetSelectedObjects();

            //
            // return true if there are any boreholes selected
            return(selectedObjects.OfType <Borehole>().Any());
        }
        public override void Execute(Slb.Ocean.Petrel.Contexts.Context context)
        {
            foreach (object obj in context.GetSelectedObjects())
            {
                PetrelLogger.InfoOutputWindow("Object type: " + obj.GetType().ToString());
                PetrelLogger.InfoOutputWindow("Ocean Object type: " + GetPublicDomainObjectTypeName(obj));
                //测试3d cube下的虚拟地震属性和3d cube的差别,用反射扫描所有属性
                foreach (System.Reflection.PropertyInfo p in obj.GetType().GetProperties())
                {
                    PetrelLogger.InfoOutputWindow(p.Name + " Value//" + p.GetValue(obj));
                }
                //return;
                //测试通过线道号读取地震解释
                //HorizonInterpretation hi=new HorizonInterpretation();

                //测试三维地震体线道号 20200306

                SeismicRoot sr = SeismicRoot.Get(PetrelProject.PrimaryProject);

                /*
                 * SeismicCollection sc = new SeismicCollection();
                 * SeismicCube scube = new SeismicCube();
                 * scube.AnnotationAtIndex(0,0,0).I- scube.AnnotationAtIndex(1, 0, 0).I
                 * scube.SampleSpacingIJK
                 * scube.Origin
                 * scube.NumSamplesIJK;
                 * scube.AnnotationAtIndex()
                 */


                //测试2d plane的删除功能



                foreach (SurveyCollection surveyCollection in sr.SeismicProject.SurveyCollections)
                {
                    if (surveyCollection.Name == "All 2D seismic folder")
                    {
                        foreach (SeismicCollection seismicCollection in surveyCollection.SeismicCollections)
                        {
                            if (seismicCollection.Name == "2D Seismic - seismic survey")
                            {
                                foreach (SeismicLine2DCollection seismicLine2DCollection in seismicCollection.SeismicLine2DCollections)
                                {
                                    if (seismicLine2DCollection.Name == "2DInline 520 Time")
                                    {
                                        seismicLine2DCollection.Delete();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        public override void Execute(Slb.Ocean.Petrel.Contexts.Context context)
        {
            IEnumerable <Borehole> selectedBoreHoles = context.GetSelectedObjects().OfType <Borehole>();

            //
            //
            foreach (var borehole in selectedBoreHoles)
            {
                PetrelLogger.InfoOutputWindow($"Well: {borehole.Name} has (Min MD = {borehole.MDRange.Min}) and (Max Md = {borehole.MDRange.Max})");
            }
        }
        public override void Execute(Slb.Ocean.Petrel.Contexts.Context context)
        {
            //TODO: Add command execution logic here

            /*
             * Template twtTemplate = PetrelProject.WellKnownTemplates.GeometricalGroup.TimeTwoWay;
             *
             * ITemplateSettingsInfoFactory factory = CoreSystem.GetService<ITemplateSettingsInfoFactory>(twtTemplate);
             * TemplateSettingsInfo info = factory.GetTemplateSettingsInfo(twtTemplate);
             * //arguments.Label = info.LegendLabel;
             * //arguments.DisplayUnit = info.Unit.Symbol;
             * //arguments.Precision = info.NumericPrecision.PrecisionValue;
             *
             * // create custom template with more detailed info
             * TemplateCollection parent = twtTemplate.TemplateCollection;
             * ITemplateService ts = PetrelSystem.TemplateService;
             * string newName = ts.GetUniqueName("My New Detailed Time");
             * Template newTWT = Template.NullObject;
             *
             * using (ITransaction txn = DataManager.NewTransaction())
             * {
             *  txn.Lock(parent);
             *  newTWT = parent.CreateTemplate(newName, info.DefaultColorTable, twtTemplate.UnitMeasurement);
             *  newTWT.Comments = "New two way time with more digits";
             *  newTWT.TemplateType = twtTemplate.TemplateType.;
             *  txn.Commit();
             * }
             * factory = CoreSystem.GetService<ITemplateSettingsInfoFactory>(newTWT);
             * TemplateSettingsInfo info2 = factory.GetTemplateSettingsInfo(newTWT);
             * info2.NumericPrecision = new NumericPrecision(6, WellKnownPrecisionTypes.DecimalPlaces);
             */

            PetrelLogger.InfoOutputWindow(string.Format("{0} clicked", @"GetTemplateIcon"));
            foreach (object obj in context.GetSelectedObjects())
            {
                Template         g     = obj as Template;
                string           gname = "D:\\test\\" + obj.GetHashCode() + ".bmp";
                ITemplateService imageFact;
                imageFact = CoreSystem.GetService <ITemplateService>();
                Bitmap imageInfo = imageFact.GetTemplateTypeImage(g.TemplateType);
                using (MemoryStream mem = new MemoryStream())
                {
                    //这句很重要,不然不能正确保存图片或出错(关键就这一句)
                    Bitmap bmp = new Bitmap(imageInfo);
                    //保存到磁盘文件
                    bmp.Save(gname, imageInfo.RawFormat);
                    bmp.Dispose();
                    MessageBox.Show("附件另存成功!", "注意", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    MessageBox.Show("附件另存成功a");
                }
            }
        }
        public override void Execute(Slb.Ocean.Petrel.Contexts.Context context)
        {
            PetrelLogger.InfoOutputWindow("Executing " + typeof(DisplaySelectedWellsCommandHandler).Name);
            //
            IEnumerable <object> selectedObjects = context.GetSelectedObjects();

            //
            foreach (Borehole borehole in selectedObjects.OfType <Borehole>())
            {
                PetrelLogger.InfoOutputWindow(borehole.Name);
            }
            //
            PetrelLogger.InfoOutputWindow(Environment.NewLine);
        }
        public override void Execute(Slb.Ocean.Petrel.Contexts.Context context)
        {
            //TODO: Add command execution logic here
            foreach (object obj in context.GetSelectedObjects())
            {
                SeismicCube scube  = obj as SeismicCube;
                Template    t_cube = scube.Template;
                PetrelLogger.InfoOutputWindow(scube.SampleSpacingIJK.Z.ToString());
                ITemplateService service = PetrelSystem.TemplateService;
                Template         t1      = service.FindTemplateByName("Elevation time");
                double           val_UI  = PetrelUnitSystem.ConvertToUI(t1, scube.SampleSpacingIJK.Z);

                //HorizonInterpretation3D h3d0 = Htop.GetHorizonInterpretation3D(args.srcSeisCube.SeismicCollection);
                //foreach (HorizonInterpretation3DSample horSample in h3d0.Samples) {
                //    scube.IndexAtPosition(new Point3(scube.Origin.X,scube.Origin.Y, horSample.Value));
                //}
            }
        }
 public override bool CanExecute(Slb.Ocean.Petrel.Contexts.Context context)
 {
     return(true);
 }
 public override bool CanExecute(Slb.Ocean.Petrel.Contexts.Context context)
 {
     return(context.GetSelectedObjects().OfType <Borehole>().Any());
 }