private void UpdateUIFormArgs()
 {
     boxWellLog.Text  = "";
     boxWellLog.Image = null;
     boxGrid.Text     = "";
     boxGrid.Image    = null;
     btnApply.Enabled = false;
     btnOK.Enabled    = false;
     btnShow.Enabled  = false;
     ka               = false;
     k                = false;
     boxProp.Text     = "";
     boxProp.Image    = null;
     lblNumCells.Text = "";
     if (tmpargs.NovozhentsevWellLog != null)
     {
         INameInfoFactory nameSvc = CoreSystem.GetService <INameInfoFactory>(tmpargs.NovozhentsevWellLog);
         boxWellLog.Text = string.Format("{0} ({1})", nameSvc.GetNameInfo(tmpargs.NovozhentsevWellLog).Name, tmpargs.NovozhentsevWellLog.Borehole.Description.Name);
         IImageInfoFactory imgSvc = CoreSystem.GetService <IImageInfoFactory>(tmpargs.NovozhentsevWellLog.Borehole);
         boxWellLog.Image = imgSvc.GetImageInfo(tmpargs.NovozhentsevWellLog).TypeImage;
     }
     if (tmpargs.NovozhentsevGrid != null)
     {
         INameInfoFactory nameSvc = CoreSystem.GetService <INameInfoFactory>(tmpargs.NovozhentsevGrid);
         boxGrid.Text = string.Format("{0} - {1}", nameSvc.GetNameInfo(tmpargs.NovozhentsevGrid).Name, Math.Round(tmpargs.NovozhentsevGrid.BoundingBox.Width * tmpargs.NovozhentsevGrid.BoundingBox.Length));
         IImageInfoFactory imgSvc = CoreSystem.GetService <IImageInfoFactory>(tmpargs.NovozhentsevGrid);
         boxGrid.Image = imgSvc.GetImageInfo(tmpargs.NovozhentsevGrid).TypeImage;
     }
     if (tmpargs.NovozhentsevWellLog != null && tmpargs.NovozhentsevGrid != null)
     {
         btnApply.Enabled = true;
         btnOK.Enabled    = true;
     }
     if (tmpargs.NovozhentsevResultProperty != null)
     {
         btnShow.Enabled = true;
         boxProp.Text    = tmpargs.NovozhentsevResultProperty.Description.Name;
         IImageInfoFactory imgSvc = CoreSystem.GetService <IImageInfoFactory>(tmpargs.NovozhentsevResultProperty);
         boxProp.Image = imgSvc.GetImageInfo(tmpargs.NovozhentsevResultProperty).TypeImage;
     }
     if (tmpargs.NovozhentsevNumCells != 0)
     {
         lblNumCells.Text      = tmpargs.NovozhentsevNumCells.ToString();
         lblNumCells.TextAlign = ContentAlignment.MiddleCenter;
     }
 }
Beispiel #2
0
            public override void ExecuteSimple()
            {
                // extract domain object
                var domainObject = arguments.DomainObject;

                //
                if (domainObject == null)
                {
                    return;
                }
                //
                /// Get the Info Factory services from the Core System
                INameInfoFactory    nameInfoFactory    = CoreSystem.GetService <INameInfoFactory>(domainObject);
                IColorInfoFactory   colorInfoFactory   = CoreSystem.GetService <IColorInfoFactory>(domainObject);
                ICommentInfoFactory commentInfoFactory = CoreSystem.GetService <ICommentInfoFactory>(domainObject);

                if (nameInfoFactory != null && colorInfoFactory != null && commentInfoFactory != null)
                {
                    NameInfo    nameInfo    = nameInfoFactory.GetNameInfo(domainObject);
                    ColorInfo   colorInfo   = colorInfoFactory.GetColorInfo(domainObject);
                    CommentInfo commentInfo = commentInfoFactory.GetCommentInfo(domainObject);

                    if (nameInfo != null && colorInfo != null && commentInfo != null)
                    {
                        /// Print the Borehole Domain objects settings data.
                        PetrelLogger.InfoOutputWindow(Environment.NewLine);
                        PetrelLogger.InfoOutputWindow("Settings Info Data Access for    : " + domainObject.GetType().Name);
                        PetrelLogger.InfoOutputWindow("---------------------------------------------------------------------------");
                        PetrelLogger.InfoOutputWindow(" Name                    : " + nameInfo.Name);
                        PetrelLogger.InfoOutputWindow(" Color                   : " + colorInfo.Color.ToString());
                        PetrelLogger.InfoOutputWindow(" TypeName                : " + nameInfo.TypeName);
                        PetrelLogger.InfoOutputWindow(" Comments                : " + commentInfo.Comment);
                        PetrelLogger.InfoOutputWindow(" Can change the Name     : " + nameInfo.CanChangeName.ToString());
                    }
                }

                IHistoryInfoEditor borholeHistoryEditor = HistoryService.GetHistoryInfoEditor(domainObject);

                if (borholeHistoryEditor != null)
                {
                    PetrelLogger.InfoOutputWindow(Environment.NewLine);
                    PetrelLogger.InfoOutputWindow("History Data Access for  : " + domainObject.GetType().Name);
                    PetrelLogger.InfoOutputWindow("---------------------------------------------------------------------------");

                    /// add an History Entry
                    HistoryEntry testHistoryEntry = new HistoryEntry(DateTime.Now, DateTime.Now, Environment.UserName, "Test", "Test Arguments", "Test Version");
                    borholeHistoryEditor.AddHistoryEntry(testHistoryEntry);

                    /// Update the last history record
                    borholeHistoryEditor.UpdateLastHistoryEntry(Environment.UserName, "Test", "Test Arguments", "Test Version");

                    /// access to old history
                    foreach (HistoryEntry entry in borholeHistoryEditor.History)
                    {
                        PetrelLogger.InfoOutputWindow(" User Name               : " + entry.UserName);
                        PetrelLogger.InfoOutputWindow(" Operation               : " + entry.Operation);
                        PetrelLogger.InfoOutputWindow(" Arguments               : " + entry.Arguments);
                        PetrelLogger.InfoOutputWindow(" AppVersion              : " + entry.AppVersion);
                        PetrelLogger.InfoOutputWindow(" Begin Date              : " + entry.BeginDate.ToString());
                        PetrelLogger.InfoOutputWindow(" End Date                : " + entry.EndDate.ToString());
                        PetrelLogger.InfoOutputWindow(Environment.NewLine);
                    }
                }


                //Type type = typeof(argumentPackage.Borehole);
                if (StatisticsService.CanGetStatistics(domainObject.GetType()))
                {
                    Statistics stats = StatisticsService.GetStatistics(domainObject);
                    if (stats != null)
                    {
                        PetrelLogger.InfoOutputWindow("Statistics Data Access for   : " + domainObject.GetType().Name);
                        PetrelLogger.InfoOutputWindow("---------------------------------------------------------------------------");
                        PetrelLogger.InfoOutputWindow(Environment.NewLine);

                        PetrelLogger.InfoOutputWindow("Axis Info items : ");
                        PetrelLogger.InfoOutputWindow(Environment.NewLine);
                        foreach (AxisInfoItem axis in stats.AxisInfo)
                        {
                            PetrelLogger.InfoOutputWindow(" Axis Name               : " + axis.Name);
                            PetrelLogger.InfoOutputWindow(" Axis Min Value          : " + axis.Min);
                            PetrelLogger.InfoOutputWindow(" Axis Max Value          : " + axis.Max);
                            PetrelLogger.InfoOutputWindow(" Axis Delta Value        : " + axis.Delta);
                            PetrelLogger.InfoOutputWindow(" Axis UnitMeasurement    : " + axis.UnitMeasurement.ToString());
                            PetrelLogger.InfoOutputWindow(Environment.NewLine);
                        }

                        PetrelLogger.InfoOutputWindow("Key Value Pair items : ");
                        PetrelLogger.InfoOutputWindow(Environment.NewLine);
                        foreach (KeyValuePair <string, string> keypair in stats.Attributes)
                        {
                            PetrelLogger.InfoOutputWindow(" Key                     : " + keypair.Key);
                            PetrelLogger.InfoOutputWindow(" Value                   : " + keypair.Value);
                            PetrelLogger.InfoOutputWindow(Environment.NewLine);
                        }
                    }
                }
            }