OceanForStudio Developers Guide 2020
OceanForStudio Developers Guide 2020
1 About Schlumberger
Contents
1 Schlumberger product documentation....................................................................... 1-1
Contents i
Schlumberger Private - Customer Use
Ocean for Studio 2020.1 About Schlumberger
Contents iii
Schlumberger Private - Customer Use
Ocean for Studio 2020.1 About Schlumberger
6 Develop Studio Manager plug-ins with the Studio Manager API ............................... 6-1
Contents v
Schlumberger Private - Customer Use
Ocean for Studio 2020.1 About Schlumberger
UI controls ..........................................................................................................................C-2
Buttons .........................................................................................................................C-2
Check boxes ..................................................................................................................C-2
Contents vii
Schlumberger Private - Customer Use
1 Schlumberger product
documentation
In this chapter
About Schlumberger ............................................................................................................ 1-2
Online documentation .......................................................................................................... 1-2
Typestyle conventions .......................................................................................................... 1-2
Alert statements .................................................................................................................. 1-2
Third-party products ............................................................................................................ 1-3
Contacting Schlumberger ..................................................................................................... 1-3
About Schlumberger
Schlumberger is the leading oilfield services provider, trusted to deliver superior
results and improved E&P performance for oil and gas companies around the world.
Through our well site operations and in our research and engineering facilities, we
develop products, services, and solutions that optimize customer performance in a
safe and environmentally sound manner.
Online documentation
Documentation is provided in these electronic formats:
• Compiled HTML online help (.chm) files
• Online Adobe® Acrobat® PDF files
• Sample code project with comments
Note: You can use Adobe® Reader to read the PDF file. Adobe Reader installation
programs for common operating systems are available for a free download
from the Adobe Web site at www.adobe.com.
Typestyle conventions
These conventions are observed throughout this guide:
• Bold text designates a file and folder names, dialog titles, names of buttons,
icons, and menus, and terms that are objects of a user selection.
• Italic text emphasizes words, defined terms, and manual titles.
• Monospaced text (Courier) shows literal text as you would enter it or as it would
appear in code or on screen.
Alert statements
The alerting statements are Notes, Cautions, and Warnings. These statements are
formatted in these styles:
Note: Information that is incidental to the main text flow, or to an important point or
tip provided in addition to the previous statement or instruction.
Caution: Advises of computer or data error that could occur should the user fail to
take or avoid a specified action.
Warning: Requires immediate action by the user to prevent actual loss of data or
where an action is irreversible, or when physical damage to the computer or devices is
possible.
Third-party products
This product uses the following third-party products:
• IQToolkit: This product is distributed under the Microsoft® Public License (MsPL)
(http://iqtoolkit.codeplex.com/license) and is available at
http://iqtoolkit.codeplex.com/.
Contacting Schlumberger
Schlumberger has sales and support offices around the world. For information on
contacting Schlumberger, please refer to the information below.
For Technical Support for SIS software:
• Schlumberger Support Portal: http://support.software.slb.com
• Customer Care Center e-mail: [email protected]
• Support Contact Details - Select your country to view support phone numbers. If
your country is not listed, select the nearest location.
In this chapter
Overview ............................................................................................................................. 2-2
Ocean for Studio Software Development Framework ........................................................ 2-2
Ocean for Studio package content ........................................................................................ 2-3
Folder content ............................................................................................................... 2-3
Binaries folder ......................................................................................................... 2-3
Documentation folder ............................................................................................... 2-3
Getting Started folder ............................................................................................... 2-3
Samples folder ......................................................................................................... 2-4
System requirements ........................................................................................................... 2-5
Development ................................................................................................................. 2-5
Distribution.................................................................................................................... 2-5
Licensing ............................................................................................................................. 2-6
Commercial implications ................................................................................................. 2-6
Software requirements ................................................................................................... 2-6
License types ................................................................................................................. 2-6
Scenario 1: Developer license ................................................................................... 2-8
Scenario 2: Commercial license ................................................................................. 2-8
Scenario 3: Both types of licenses ............................................................................. 2-8
Ocean for Studio* and Ocean for Petrel* ............................................................................. 2-10
About Ocean for Petrel ................................................................................................. 2-10
Differences .................................................................................................................. 2-10
Ocean for Studio documentation ......................................................................................... 2-12
Online help .................................................................................................................. 2-12
PDF files ...................................................................................................................... 2-12
Sample code ................................................................................................................ 2-12
Ocean for Petrel developer resources .................................................................................. 2-13
Ocean for Studio API updates ............................................................................................. 2-14
Overview 2-1
Overview
Ocean for Studio* is an extensible and integrated framework for Studio that shares the
objectives of the Ocean for Petrel* development environment by providing data
access, indexing tools, and plug-in convenience functions for Studio rather than Petrel.
With Ocean for Studio, developers can create custom plug-ins for Studio Manager that
incorporate proprietary ideas or software while still participating fully in the Studio
platform with respect to data access and interoperability with other aspects of Studio.
If a plug-in solution does not meet a client’s needs, standalone applications can also be
developed with Ocean for Studio to take advantage of data access and indexing
functionality.
Note: This document does not include information about the Studio Find API, which
has separate documentation and training materials.
Folder content
Binaries folder
This folder contains one .dll file and one .zip file:
Documentation folder
Overview 2-3
• The Ocean for Studio Developer’s Guide is the most recent version of this
document.
Note: The Ocean for Studio release notes, which contains information about
changes to the product from release to release and documents any known
issues you should be aware of, is now merged into the Studio Manager
Release Notes.
Samples folder
Each subfolder contains example code that you can study and adapt to create your
own plug-in or application. Highlights include:
• The dessert example indexes custom domain objects in Petrel so they can be
viewed in Find Index results.
• The GeoreferencedImage example extends Find Indexing to external files (in
this case, EXIF-tagged image files).
• The GeoreferencedImageLoader example extends Find Index loading into a
Petrel application.
• The SDK Samples subfolder contains two examples:
− DomainObjectSample contains sample code for a standalone application
using the Studio SDK API that performs basic data loading into an empty
Studio repository by using the sample data provided.
− SDK Plugin Sample provides a similar example program for data loading,
but it is in the form of a Studio Manager plug-in instead of a standalone
application.
System requirements
Ocean for Studio has separate system requirements for development and distribution.
Development
When you develop applications and plug-ins, your development system must meet
these minimum requirements:
• Microsoft Visual Studio® 2015
• Microsoft .NET Framework 4.7.2 on Windows 10 Pro or Enterprise (64-bit)
• A license for Ocean Development Framework
Distribution
When you distribute an application or plug-in, you must ensure that the target
computer has the Microsoft Visual C++ Redistributable for Visual Studio 2010, 2012,
2013, 2019 installed. They are installed along with Runtime for Studio.
Overview 2-5
Licensing
Commercial implications
In general, the license model is the same as Ocean for Petrel. A fee is charged for the
Ocean Development Framework which includes Ocean framework for Studio, Ocean
framework for Petrel and Ocean framework for Techlog. This fee includes a run-time
license for Studio Manager and a run-time license for third-party application accessing
the Studio database, which allows development work to proceed without purchasing
additional Studio commercial licenses for the applications.
The restriction is that Studio repositories created with an Ocean development license
cannot be used in commercial deployments, and they are internally stamped as
Development. Essentially, these restrictions require the commercial license features
for Studio to deploy a commercial solution written using Ocean for Studio.
For additional details about the commercial terms of Ocean for Studio, contact the SIS
Ocean team or your SIS account manager.
Software requirements
Ensure that your system meets these software requirements:
• Run the latest commercial version of the Schlumberger Licensing Manager.
• Define the SLBSLS_LICENSE_FILE environment variable so that it points to the
Ocean for Studio license server as shown in the following figure.
License types
There are two types of licenses for applications developed using Ocean for Studio:
• Commercial (Studio Third-Party Access license with feature name
Studio_Runtime, feature name Studio_Knowledge_Runtime has been
Obsolete since 2015.1)
For a standalone application developed using the Studio SDK API, a license is checked
out when a repository is opened. As illustrated in the matrix below, the license type,
combined with the repository access level, determines your ability to access repository
data.
Overview 2-7
License Type
Here are example scenarios of different combinations of license types and repository
access levels.
You have an Ocean development framework license that allows you to launch a
standalone application with Runtime for Studio. Your application opens a repository
that has a Commercial access level. The result is that your application can open the
repository as read-only. If it tries to save changes, you will be notified that the
repository is read-only.
You have a Studio third-party access license that allows you to launch a standalone
application with Runtime for Studio. Your application opens a repository that has a
Development access level. As a result, the request to open the repository is denied.
You have both types of licenses and you open a repository that has a Commercial
access level.
• Ocean for Studio first tries to open the repository by checking out a Studio
third-party access license. If this is successful, the result is that you have
read/write permissions to the repository.
• Otherwise Ocean for Studio then tries to open the repository by checking out a
Ocean development framework license. The result is that you have read-only
access to the repository.
Overview 2-9
Differences
Although the Studio SDK API is based on the Ocean for Petrel API, there are some
important differences:
• Ocean for Petrel API: Designed to extend Petrel by applications that interact with
the users through the Petrel interface.
• Studio SDK API: Flows data in and out of the Studio Database without interacting
with the Petrel interface or the Studio Manager interface.
This table summarizes the differences between the Studio SDK API and the Ocean for
Petrel API.
Feature Ocean for Petrel Ocean for Studio (Studio SDK API)
Locking ITransaction.Lock NA
Events Supported NA
Overview 2-11
Online help
The Ocean for Studio domain objects is documented in these files:
• Slb.Ocean.Studio.Data.Petrel.chm
• StudioFindFull.chm
• StudioManagerAPI.chm
These files contain information about all the Ocean for Studio classes, objects, and
functions.
PDF files
These manuals, provided in PDF format, contain valuable Ocean for Studio
information:
• Ocean for Studio Developer’s Guide provides overview and getting started
information related to the SDK distribution. The developer’s guide is included with
the Ocean for Studio distribution.
• Ocean for Petrel Developer’s Guide provides conceptual and development
information related to the Ocean for Petrel API, therefore helps to understand the
Studio SDK API. This 11-volume set is not included with the Ocean for Studio
distribution.
Ocean information is available on the Developer section of the Ocean store at
https://www.ocean.slb.com/en/developer.
Sample code
Ocean for Studio includes sample code that you can use to test your configuration. The
sample code includes comments that document how you should use the sample code.
Additional sample code is available on the Developer section of the Ocean store.
Note: The Ocean for Petrel Developer’s Guide is the documentation that you may
find most helpful.
These sections of the Ocean for Petrel Developer’s Guide apply to using the Studio SDK
API. Although the content is written with a different purpose in mind, the information
can be very valuable.
• Ocean Core and Services
• Basic Concepts of Ocean Plug-ins
• Shapes Objects
• Seismic Data and Seismic Interpretation Data
• Wells, Well Logs, Markers and Geologic Data
Overview 2-13
Note: Ensure that licenses are set up and that you have a valid license server, and
Runtime for Studio is installed.
Note: To run the sample program you must be connected to the Studio database as
a Petrel super user or a repository administrator. If you use Windows
authentication to connect, the user ID and the password are ignored.
Preliminary steps
Before you can run the sample program to test your environment, create an empty
repository in Studio. You will use the sample program to populate the repository with
data. Refer to the Studio documentation for information about how to create a
repository.
Note: The suggested storage CRS for the empty repository can be set to WGS84.
The recommended project CRS can be set to ED50-UTM31.
Note: If you use Ocean development framework license to run the program, make
sure the Studio repository is created at Development access level. If the
Studio repository is created at Commercial access level, you will need
Runtime for Studio license to run the program.
<add key="UserWellSymbolsFile"
value="Data\UserSymbolFile.xml" />
<add key ="ActiveGroup" value ="UserSymbols"/>
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
Figure 3-2 Slb.Ocean.Studio.Data.Petrel.Sample.exe.config for SQL
server
Note: Ensure that the licenses are set up and that you have a valid license server,
and Runtime for Studio is installed.
Preliminary steps
Before you can build and run the sample program to test your development
environment, you must create an empty repository in Studio. You will use the sample
program to populate the repository with data.
Refer to the Studio documentation for information about how to create a repository.
Note: The suggested storage CRS for the empty repository can be set to WGS84.
The project CRS can be set to ED50-UTM31.
Note: If you use Ocean development framework license to run the program, make
sure the Studio repository is created at Development access level. If the
Studio repository is created at Commercial access level, you will need
Runtime for Studio license to run the program.
Note: You can use the same configuration file that you used to run the prebuilt
sample application.
5. If you can build and run the sample application, you are ready to create your own
applications.
Note: See the Ocean and Studio documentation for more information about other
assemblies that your application may require.
Note: Alternatively, you can redirect the log file to your user profile:
%USERPROFILE%\AppData\Roaming\Schlumberger\Studio\...\PdbSdkSql.log
Note: Because you are developing the application with Ocean for Studio 2020,
Runtime for Studio 2020 must be installed on the target computer.
In this chapter
LINQ
This section provides a high-level description of Language-Integrated Query (LINQ) in
the context of the Studio SDK API. For more detailed information about LINQ, refer to
the Microsoft Developer Network (http://msdn.microsoft.com).
What is LINQ?
LINQ is a Microsoft .NET component that extends .NET languages to include native
data-query capabilities. LINQ enables you to use the same data-query language
regardless of the database type (XML, SQL, etc.).
This example shows how you can use LINQ with the Studio SDK API:
public static void Main(string[] args)
{
String repositoryName;
DataConnectionContext dataConnectionContext;
GetConnectionInfo(args, out dataConnectionContext, out
repositoryName);
RepositoryService ps = DatabaseSystem.RepositoryService;
using (Repository project =
ps.OpenRepository(dataConnectionContext, repositoryName))
{
LinqExample(project);
}
}
||
!uwis.Contains(b.UWI)
orderby b.Cost descending
orderby b.Name ascending
select new Projection() {Name = b.Name, UWI = b.UWI};
resultsUsingLinqToObject = queryUsingLinqToObject
.ToList();
}
resultsUsingLinqToSql = queryUsingLinqToSql.ToList();
}
}
BoreholeCollection bc = boreholeCollections.Dequeue();
foreach (BoreholeCollection childBC in
bc.BoreholeCollections)
boreholeCollections.Enqueue(childBC);
boreholes.AddRange(bc.Boreholes);
}
}
return boreholes.AsQueryable();
}
LINQ techniques
To use LINQ successfully, you should understand these concepts and techniques:
• Deferred execution
• IQueryable and IEnumerable
• Lazy loading
• Compiled queries
Deferred execution
During deferred execution, a database query is parsed and the parameters are bound
and set before the query is actually executed. Deferred execution can greatly improve
performance when you work with large amounts of data. Instead of multiple passes
through the data to query information, deferred execution can allow a single iteration
through the data to query the same information.
Ensure you understand the concept of deferred execution and how queries are actually
generated and executed before you use LINQ. Composable queries and deferred
execution work together to make LINQ a rich query language. If you understand these
features of LINQ you will be able to write fewer lines of code that are more efficient.
Two extension methods enable LINQ to access data in a data table. One method
exposes the data as IQueryable and the other exposes data as IEnumerable.
When it comes to composing LINQ queries, understanding how IQueryable works is
essential. Discussions about LINQ include many references to IEnumerable because
it is the base from which everything else draws. As long as you have something that
implements IEnumerable, you can use LINQ.
IEnumerable doesn’t have the concept of moving between items; it is a forward only
collection. For example, if you want to use LINQ to find duplicates in a large collection
and perform a join on this same collection, using the forward-only model of
IEnumerable will become expensive, especially if you start to combine operations.
However, IQueryable adds two methods that make this much easier:
• CreateQuery
• Execute
These methods accept an expression, which is basically a new set of classes that allow
you to express things like method calls, operations, lambda functions, etc. as a tree of
expressions. This is not just for simple expressions but for the entire LINQ query. You
can look inside the LINQ query and complete tasks with the expression tree.
.NET guidelines
Lazy loading
By default, LINQ to SQL loads related entities and entity sets that use lazy loading.
This means that if you retrieve a list of entities in a query that references other
entities, these other entities are not actually loaded unless they are accessed.
Compiled queries
Repository.Queryables
Database columns
The database contains columns. Some columns are indexed and some are not.
Table 4-1 Database column status
Name Indexed
UniqueID No
The following table shows the LINQ query operators that Ocean for Studio supports.
Table 4-2 LINQ query operators
Remember that links are not pre-fetched for LINQ query executions. For example,
accessing the borehole property for a checkshot involves fetching the specific borehole
object. If this operation takes place in a loop, then the boreholes are fetched one at a
time, which could lead to slower performance.
Follow these recommended best practices when executing LINQ queries:
• Fetch items in batches.
• Properties of domain objects used in LINQ queries must be LINQ enabled. (Check
for [LinqEnabledAttribute] on properties.)
• Use Projection for needed properties where possible. Properties that are links to
other domain objects cannot be projected, e.g. the borehole property for a
checkshot. (These properties can be used in constraints.)
• Remember that the default behavior is a case-insensitive comparison for all string
data types.
IExtension
Every object that supports custom attributes or properties has an Extension
property of type IExtension (for example, Borehole.Extension).
The IExtension interface provides generic access on custom properties and
attributes through property Features:
public interface IExtension
{
IEnumerable<IFeature> Features { get; }
IFeature this[string uniqueId] { get; }
}
IAttributeExtension
Every object that supports only customized attributes has an Extension property of
type IAttributeExtension (for example, BoreholeCollection.Extension).
The IAttributeExtension interface replaces the ICustomAttributeService
interface (become Obsolete since 2014.1). It provides generic access for CRUD
operations on custom attributes:
public interface IAttributeExtension : IExtension
{
void DeleteAttribute(string ns, string name);
IEnumerable<IAttribute> Attributes { get; }
ITypedFeature<T> ResolveAttribute<T>(string uniqueId);
ITypedFeature<T> FindAttribute<T>(string ns, string name);
ITypedFeature<T> CreateAttribute<T>(string ns,
string name);
}
IPropertyExtension
Every object that supports customized properties has an Extension property of type
IPropertyExtension (for example, Borehole.Extension).
These domain objects support the IPropertyExtension type:
• SeismicCube
• SeismicLine2DCollection
• Seismic2DCollection
• Seismic3DCollection
• HorizonInterpretation2D
• HorizonInterpretation3D
• FaultInterpretation
• WellLog
• DictionaryWellLog
• BitmapWellLog
• MultiTraceWellLog
• BoreholeSeismogram
• CommentWellLog
• Borehole
• Marker
The IPropertyExtension interface inherits from the IAttributeExtension
interface. It provides generic access for CRUD operations on custom attributes and
custom properties.
public interface IPropertyExtension : IAttributeExtension
{
IEnumerable<IProperty> Properties { get; }
IEnumerable<IPrototype> Prototypes { get; }
ITypedFeature<T> ResolveProperty<T>(string uniqueId);
IEnumerable<IFeature> FindProperties(string name);
ITypedFeature<T> FindProperty<T>(string name);
ITypedFeature<T> CreateProperty<T>(string name);
ITypedFeature<T> CreateProperty<T>(string name,
string uniqueId);
ITypedFeature<T> CreateProperty<T>(string name,
string uniqueId,
string templateId);
void DeleteProperty(string uniqueId);
}
IPropertyManager
IPropertyManager and PropertyDefinition are introduced in Ocean for Studio
2016.2 to enhance the extension API. It is used to solve two problems of the extension
API:
• An instance of a domain object is required to create properties.
• Property value can only be set one at a time.
The IPropertyManager interface provides generic access and creation of
PropertyDefinition.
public interface IPropertyManager
{
PropertyDefinition CreatePropertyDefinition(Type dataType,
string propertyName);
PropertyDefinition CreatePropertyDefinition(Type dataType,
string propertyName,
string templateId);
PropertyDefinition CreatePropertyDefinition(string uniqueId,
Type dataType,
string propertyName);
PropertyDefinition CreatePropertyDefinition(string uniqueId,
Type dataType,
string propertyName,
string templateId);
IEnumerable<PropertyDefinition> GetPropertyDefinitions();
}
The PropertyDefinition class represents both custom and well-known properties
and supports reading and updating property values in batch.
public class PropertyDefinition
{
string UniqueId { get; private set; }
string Name { get; private set; }
Type DataType { get; private set; }
string TemplateUniqueId { get; private set; }
DomainObjectBase Owner { get; private set; }
Dictionary<string, object> GetValues(IList<string> parentIds);
void SetValues(Dictionary<string, object> new Values);
}
Examples
These examples use the extension API.
These examples use the generic extension API to access an existing string property.
• Get a property by UniqueId
ITypedFeature<string> customResolveProperty =
borehole.Extension.ResolveProperty<string>
("CustomPropertyUniqueId");
• Get a property by Name
ITypedFeature<string> customFindProperty =
borehole.Extension.FindProperty<string> ("PropertyName");
Note: Name is not unique for object properties, so this method returns the first
property or it returns null if no properties are found. To find all properties
assigned to the object with the specified name, use:
IEnumerable<IFeature> properties =
borehole.Extension.FindProperties("PropertyName");
This example uses the generic extension API to unset value for a custom property:
borehole.Extension.DeleteProperty("CustomPropertyUniqueId");
Note: The DeleteProperty method only unset property value for this borehole,
the property definition still exists.
This example uses the generic extension API to create a custom attribute:
ITypedFeature<string> customAttribute =
borehole.Extension.CreateAttribute<string>
("namespaceName", "attributeName");
customAttribute.Value = "Value";
This example uses the generic extension API to read a custom string attribute and set
the value:
ITypedFeature<string> attribute = ex.FindAttribute<string>
("customAttributeNamespace", "customAttributeName");
This example uses the generic extension API to delete a custom attribute:
borehole.Extension.DeleteAttribute("namespaceName",
"attributeName");
This example uses IPropertyManager to get all the property definitions for domain
object Borehole, including custom and well-known, also including properties created
using the old property access API. It also retrieves value of each property for all the
boreholes under a specific well folder:
IEnumerable<PropertyDefinition> propDefs =
bcDWells.GetPropertyDefinitions();
IList<string> parentIds = new List<string>();
foreach (Borehole b in bcDWells)
parentIds.Add(b.UniqueId);
Interface properties and generic property access both behave as expected. However,
use interface properties to access well-known properties is preferred instead of using a
generic property access, as this example shows:
using (Repository project =
DatabaseSystem.RepositoryService.OpenRepository
(dataConnectionContext, repositoryName))
{
WellRoot wellRoot = WellRoot.Get(project);
BoreholeCollection boreholeCollection =
wellRoot.GetOrCreateBoreholeCollection();
Borehole bh =
boreholeCollection.CreateBorehole("TestBorehole");
//Preferred method
String property1Val = bh.Extension.SimulationName;
DateTime property2Val = bh.Extension.SimulationExportDate;
//Generic method
ITypedFeature<string> property1 =
bh.Extension.ResolveProperty<string>("Simulation Name");
ITypedFeature<DateTime> property2 =
bh.Extension.ResolveProperty<DateTime>
("Simulation Export Date");
property1Val = property1.Value;
property2Val = property2.Value;
DatabaseSystem.RepositoryService.SaveRepository(project);
}
[PropertyDefinition("UserDefinedBoreholeProperty",
"UserDefinedBoreholeProperty",
"141D3D6322C84398AFD58284A3ADC136")]
string BoreholeUserDefinedCustomProperty { get; set; }
}
}
[PropertyDefinition("UserDefinedMarkerProperty",
"UserDefinedMarkerProperty",
"F1A23E8F932148F7B244F4FAEF4ADEDA ")]
string UserDefinedWellKnownMarkerProperty { get; set; }
}
}
(Repository repository);
protected TemplateCollection
CreateWellKnownTemplateCollection(Repository repository,
string name, string uniqueId);
protected void CreateWellKnownTemplate
(TemplateCollection collection, string name,
IUnitMeasurement unitMeasurement, IUnit unit,
string uniqueId);
protected void CreateWellKnownTemplate
(TemplateCollection collection, string name,
IUnitMeasurement unitMeasurement, string uniqueId);
}
}
}
You must register a custom repository extender class before you can use it.
Note: You must register the repository extension during the application initialization.
Note: Always check if a property with the given name already exisits using the
generic extension API, only create a new property if it returns null.
Do not use the new extension API and the old API together
Do not create a property with the old property access API and then access the
properties with the new extension API in the scope of one session. This example
shows the invalid and valid access methods:
using (Repository project =
DatabaseSystem.RepositoryService.OpenRepository
(dataConnectionContext, repositoryName))
{
WellRoot wellRoot = WellRoot.Get(project);
BoreholeCollection boreholeCollection =
wellRoot.GetOrCreateBoreholeCollection();
BoreholePropertyCollection bpc =
boreholeCollection.BoreholePropertyCollection;
Borehole borehole =
boreholeCollection.CreateBorehole("TestBorehole");
DatabaseSystem.RepositoryService.SaveRepository(project);
}
In this chapter
Unit support
Unit support in Ocean for Studio is provided by the Ocean Services modules.
Unit types
The Slb.Ocean.Units assembly provides these unit types.
• Unit
• Unit measurement
• Unit system
• Unit catalog
Unit
A unit is a fundamental item that is a standard for the basis of measurement. A simple
unit measures one value. For example, meters, feet, pounds, and kilograms are simple
units. Compound units measure one value in relation to another value. For example,
meters per second or pounds per square inch are compound units. To be meaningful,
a measurement must have a unit label. For example, 12 and 55 have no meaning as
measurements without the corresponding units (12 inches and 55 MPH).
Unit measurement
Unit system
A unit system is a mapping between units and unit measurements. In the English unit
system, a unit measurement of distance is expressed in units of feet. This is one
reason for the subcategories of unit measurement. For example, a big distance might
be expressed in miles, while a small distance might be expressed in inches.
Unit catalog
Unit conversion
Unit conversion is not performed directly by the Unit object. The CanConvert
method of the IUnit interface indicates if the particular unit belongs to the same base
UnitMeasurement category as the parameter unit and if the particular unit is
convertible to the parameter unit.
To convert the units, you must have an instance of an IUnitConverter object that
is retrieved from the unit catalog. An IUnitConverter object converts one pair of
units in one direction. For example, an IUnitConverter will convert from feet to
meters but not from meters to feet. If you require two-way conversion, you must have
two separate IUnitConverter objects.
You can access the unit catalog from the IUnitService interface, which has a
collection of all available catalogs. (Currently, there is only the Oilfield Services Data
Dictionary (OSDD) unit catalog.) You can also access the unit catalog through an
IUnitServiceSettings object, which returns the current active unit catalog used
by the application. Both of these can be retrieved with a call to the
CoreSystem.GetService<T>() method.
This code demonstrates a simple unit conversion between IUnit objects oldUnit and
newUnit:
IUnitCatalog UnitCatalog = CoreSystem.GetService
<IUnitServiceSettings>().CurrentCatalog;
IUnitConverter converter =
UnitCatalog.GetConverter(oldUnit, newUnit);
double dOriginalValue = 123.45;
double dNewValue = converter.Convert(dOriginalValue);
Unit service
Many of the Ocean for Studio routines rely heavily on the Ocean Core and Ocean
Services implementations, which provide a common framework for a wide range of
Schlumberger applications including Studio and Petrel. Using these common services
ensures compatibility and rapid development while providing you with a consistent
foundation. The Ocean foundation is used for units, coordinates, and geometry in the
Ocean for Studio.
The Unit service is accessed with code similar to this example:
IUnitService unitService =
CoreSystem.GetService<IUnitService>();
Note: Ocean for Studio does not state that the unit can be set through this object,
but it is settable. You must check your template’s IsWritable property
before attempting to modify it, or an InvalidOperationException will be
thrown. This behavior could change in future releases.
Assembly references
All required Ocean and Studio assemblies are installed in the Runtime for Studio
directory. As with all added assembly references, they should not be copied to a local
directory. The DomainObjectSetup component manages the locating and loading of
the assemblies at runtime.
The required assemblies for working with units include these references:
• Slb.Ocean.Core.dll: Provides CoreSystem, used for retrieving references to
IUnitService and IUnitServiceSettings for accessing current catalogs.
• Slb.Ocean.Units.dll: Used for retrieving references to:
− IUnitService
− IUnitServiceSettings
− IUnitCatalog
− IUnitSystem
− IUnitMeasurement
− IUnitConverter
− IUnit
The reference to Slb.Ocean.Studio.Data.Petrel.dll is assumed, and although it is
not strictly necessary to use the Ocean unit services, it is required for the
DomainObjectSetup component and any other Studio data access-related
workflows.
OSDD
The OSDD unit catalog is the source of the unit systems, unit measurements, and units
used in the Ocean core. The Curve Mnemonic Dictionary is the publicly accessible
version of the OSDD. The database delivers descriptions of more than 50,000
Schlumberger logging tools, analytical software, and log curves with parameters. It
also provides definitions of physical property measurements and relevant units of
measurement. Special tables enumerate mineral properties and depositional
environments.
The Curve Mnemonic Dictionary is accessible at this URL:
http://www.apps.slb.com/cmd/
Ocean documentation
The Ocean Core and Services documentation (can be accessed through Ocean for
Petrel Developer’s Guide) has information about the interfaces themselves, but the
actual contents of the OSDD unit catalog are not directly documented. You can write a
simple program to exercise the interfaces of the Ocean unit service and make a data
dump of all of the available systems, measurements, and units.
Example
This code sample shows several different examples of working with units in Ocean for
Studio.
using System;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Security;
using Slb.Ocean.Core;
using Slb.Ocean.Units;
using Slb.Ocean.Studio.Data.Petrel;
using Slb.Ocean.Studio.Data.Petrel.UI;
namespace UnitExamples
{
class Program
{
private Repository Project { get; set; }
private static DataConnectionContext dataConnectionContext;
void Execute()
{
string userId = "BaseUser";
string password = "BaseUser";
string repositoryName = "BaseRepository";
dataConnectionContext =
DataConnectionContext.Create("BaseHost:1521/sds2008",
userId, ToSecuredString(password));
Console.WriteLine("Opening repository...");
Project = DatabaseSystem.RepositoryService.
OpenRepository(dataConnectionContext, repositoryName);
Console.WriteLine("Describing unit systems...");
DescribeUnitSystems();
Console.WriteLine("Enumerating templates...");
GetTemplateCollections();
DatabaseSystem.RepositoryService.
SaveRepository(Project);
}
{
if (string.IsNullOrEmpty(unsecuredString))
return null;
var secureString = new SecureString();
foreach (var symbol in unsecuredString)
{
secureString.AppendChar(symbol);
}
secureString.MakeReadOnly();
return secureString;
}
void DescribeUnitSystems()
{
IUnitService unitService =
CoreSystem.GetService<IUnitService>();
foreach (var catalog in unitService.Catalogs)
{
Console.WriteLine("Unit catalog {0}", catalog.Name);
foreach (var system in catalog.Systems)
{
Console.WriteLine("\tUnit System: {0}", system.Name);
}
}
IUnitSystem unitSystem =
unitService.GetCatalog("OSDD").GetSystem("English");
}
void GetTemplateCollections()
{
foreach (var tc in Project.TemplateCollections)
{
Console.WriteLine("Template Collection {0}", tc.Name);
if (tc.Name == "Well log templates")
{
AddATemplate(tc);
DoSomethingWithTemplateCollection(tc);
}
}
}
void DoSomethingWithTemplateCollection
(TemplateCollection tc)
{
IUnitCatalog canonicalUnitCatalog = CoreSystem
.GetService<IUnitServiceSettings>().CurrentCatalog;
foreach (var t in tc.Templates)
{
if (t.Name == "MyTemplate")
{
TemplateSettingsInfo info = CoreSystem.GetService
<ITemplateSettingsInfoFactory>(typeof(Template))
.GetTemplateSettingsInfo(t);
Console.WriteLine("[{0}] [{1}] [{2}]", t.Name,
t.UnitMeasurement.Name, info.Unit.Name);
foreach (var newUnit in t.UnitMeasurement.Units)
{
IUnitConverter converter = canonicalUnitCatalog.
GetConverter(info.Unit, newUnit);
double dOrigVal = 123.45;
double dNewVal = converter.Convert(dOrigVal);
Console.WriteLine(" [{0}] {1} converts to [{2}]{3}",
dOrigVal,info.Unit.Symbol,dNewVal,newUnit.Symbol);
if (t.IsWritable)
{
info.Unit = newUnit;
}
}
}
}
}
}
}
In this chapter
Overview ............................................................................................................................. 6-2
About Studio Manager plug-ins ............................................................................................. 6-2
The Studio Manager sample plug-in ...................................................................................... 6-2
Overview ....................................................................................................................... 6-2
Studio Manager sample plug-in ....................................................................................... 6-2
Installing the sample plug-in........................................................................................... 6-3
Creating a Studio Manager plug-in ........................................................................................ 6-5
Prerequisites.................................................................................................................. 6-5
Set up the Visual Studio project ...................................................................................... 6-5
Add an App-derived class ............................................................................................... 6-5
Add a ViewModelBase-derived class ................................................................................ 6-6
Add an XAML UserControl-derived view ........................................................................... 6-7
Add a ViewFactory-derived class ..................................................................................... 6-7
Create a .plugininfo file .................................................................................................. 6-7
Use Ocean for Studio to access a repository .......................................................................... 6-9
Add basic Studio assembly references ............................................................................. 6-9
Modify the code to use the current repository .................................................................. 6-9
Handle events when Studio Manager changes the current repository .............................. 6-10
Enable and disable the application dynamically .............................................................. 6-10
Keep the application responsive .................................................................................... 6-10
Develop Studio Manager plug-ins with the Studio Manager API 6-1
Overview
This chapter describes Studio Manager plug-ins, the Studio Manager sample plug-in,
how to create a Studio Manager plug-in with Ocean for Studio, and how to access a
Studio repository with a Studio Manager plug-in.
Note: Batch-oriented applications that use Runtime for Studio must include the
Runtime for Studio setup Slb.Ocean.Studio.Data.Petrel.Setup.dll
with their package. Runtime for Studio is installed separately and is not
redistributed with the application.
Overview
Deploying a Studio Manager plug-in requires:
• The plug-in assembly. Place the assembly in the Studio Manager plug-in
installation folder.
• A .plugininfo file for the plug-in. Place this file in the Studio Manager plug-in
installation folder, also.
• The Plug-in Manager (StudioPluginManager.exe). The Plug-in manager is
used to register the plug-in. When Studio Manager starts, it automatically detects
the registered plug-in and loads it into the environment.
In some instances, plug-ins require more advanced installation.
Note: You need Administrative privileges if Studio Manager is installed in the default
location.
Note: The sample plug-in will be enabled if you are connected to a project.
Develop Studio Manager plug-ins with the Studio Manager API 6-3
You may have to create an empty repository using the Repositories App.
Note: The storage coordinate system of the repository should be compatible with
the Sphere_Vertical_Perspective coordinate system.
11. Click the SDK Sample Application icon to open the sample application.
The sample application opens in Studio Manager:
Note: If you are using an SQL server and you do not have sufficient privileges to
write Blob data through the file stream, you may not be able to successfully
insert the data to the repository. You may receive error messages related to
incorrect values or other exceptions.
14. Use other apps such as the Data Table app in Studio Manager to work with the
data loaded into the repository.
Prerequisites
Creating a Studio Manager plug-in requires:
• Visual Studio 2015
• Microsoft .NET 4.7.2
• Studio Manager 2020
• Setting the StudioManager2020Home environment variable
Note: The Studio Manager installer automatically sets the system environment
variable StudioManager2020Home to the Studio Manager installation
directory.
Develop Studio Manager plug-ins with the Studio Manager API 6-5
− System.ComponentModel.Composition
− Slb.Studio.Manager.Apps
− Slb.Studio.Manager.Presentation
− Slb.Studio.Manager.Components
3. Derive your class from the SimpleApp class. In your constructor, call the
SimpleApp constructor with these values:
− Id provides your plug-in’s UniqueId.
− Category provides the AppCategory in the App Gallery where this application
should appear. WellKnownAppCategories supplies several default
categories: Monitor, Organize, Correct, Load, Administer, and Browse.
− A CanRunInfo-derived object that Studio Manager will use to determine
whether your plug-in should be enabled or disabled in the App Gallery. The
DatabaseContextCanRunInfo class is very useful here, or you can derive
your own.
Develop Studio Manager plug-ins with the Studio Manager API 6-7
Develop Studio Manager plug-ins with the Studio Manager API 6-9
Note: Include clean-up code in your ViewModel’s Dispose override if you retain a
reference to the Repository object.
Additionally, status updates and progress messages are displayed by the GUI only
when the system has a chance to react to your updates. To show messages (including
writing to the Studio Manager message log) during your operations, you must start the
operations on a background thread.
1. Add a using statement for:
using System.Threading.Tasks;
2. In the delegate’s handler, start a new thread:
Task.Factory.StartNew(action, this);
3. From within the thread, remember to use the Dispatcher to update user
interface properties:
Dispatcher.BeginInvoke(new Action<ViewModel>(sender =>
{ Mouse.OverrideCursor = Cursors.Wait; }), this);
Note: You must access the Repository object from the thread on that you create
it on. That is, if you activate a background thread to do work on the
repository, you must use OpenCurrentProject on that thread to obtain a
Repository object that is valid on that thread. Failure to do so will result in
an exception.
Develop Studio Manager plug-ins with the Studio Manager API 6-11
In this chapter
Overview ............................................................................................................................. 7-3
Compliance.................................................................................................................... 7-3
[Rule] ..................................................................................................................... 7-3
[Guideline] .............................................................................................................. 7-3
[Option] .................................................................................................................. 7-3
Anatomy of a Studio Manager plug-in ................................................................................... 7-4
App Gallery titles............................................................................................................ 7-4
App views...................................................................................................................... 7-4
Settings dialog box ........................................................................................................ 7-5
Dialog boxes .................................................................................................................. 7-5
Studio Manager plug-in guidelines ........................................................................................ 7-6
View layout design ......................................................................................................... 7-6
Grouping ................................................................................................................. 7-6
Alignment ................................................................................................................ 7-7
Resolution ............................................................................................................... 7-7
Resizing .................................................................................................................. 7-7
Testing .................................................................................................................... 7-7
Font .............................................................................................................................. 7-7
Decoration............................................................................................................... 7-7
Color and contrast ................................................................................................... 7-7
Color ............................................................................................................................. 7-7
Studio Manager Palette ............................................................................................ 7-8
Studio Light Theme .................................................................................................. 7-8
Studio Dark Theme .................................................................................................. 7-8
Icons ............................................................................................................................ 7-8
Raster icons............................................................................................................. 7-8
Vector Icons ............................................................................................................ 7-9
Tone ............................................................................................................................. 7-9
Language ................................................................................................................ 7-9
Overview
This chapter describes the standards and best practices for designing Studio Manager
plug-ins. These guidelines ensure the consistency of the user interface and improve
the user experience of Studio Manager and the plug-ins.
Although this information is primarily intended to serve as a reference for developers,
it can be used by anyone involved in the user interface and user experience of Studio
Manager.
All Studio Manager developers should read these guidelines and refer to them during
the development process as a reference to create consistent Studio Manager
interfaces.
Compliance
Throughout this chapter these keys indicate the required level of compliance:
• [Rule]
• [Guideline]
• [Option]
[Rule]
Rules are absolute requirements for compliance. Many of the rules are enforced
through the API.
[Guideline]
[Option]
App views
The app view is the base of the UI. The view contains the content and controls.
Whenever possible, keep all UI elements within the base app view. Views can be
docked and undocked from the main application window. If you open additional
windows or dialog boxes from your app view that are not clearly related to your
application, it could be confusing to users. You can create as many views as you need
within a plug-in to support your user workflows. This figure shows a typical app view.
Dialog boxes
If your application requires additional dialog boxes, the Studio Manager API provides
services that generate basic dialog boxes. This figure shows a dialog box created with
the Studio Manager API services.
Grouping
Alignment
UI elements should be aligned horizontally on the left. In the previous example, the
labels for each section of this UI are left-aligned with each other. The text boxes,
drop-down lists, and date controls are also left-aligned with each another in a separate
column. The fewer alignment lines in your view, the easier groupings are to read.
Resolution
A view must support a minimum resolution of 1024x768 pixels. Views are contained
within the Studio Manager application and are sized appropriately to fit within it.
Although it may not be avoidable at some application window sizes, scrolling should be
avoided whenever possible.
Resizing
All views must be resizable because the views can be undocked and resized as
separate windows.
A default window size can be set for undocked views and should be set to encourage
users to use your view at this size. However, this is not strictly enforced.
Some dialog boxes do not need to be resizable. If the dialog box does not benefit from
being resized, disable resizing.
Testing
Font
Studio Manager uses the Segoe UI font, which is the MS Windows system typeface.
The standard font size used is 9 point.
Decoration
You must not abuse bold, italics, underlining, strike through, or any other font
decoration or attribute. These tools should be used sparingly and only when they are
appropriate to emphasize important text within a UI element. You do not need to
make headers or other specialized element text bold. Emphasis of text is taken care of
by the UI element itself.
You should use a dark font color on a light background and a light font color on a dark
background. In this section on color, specific values are provided to assist you.
Color
This section describes the standard colors and themes used for Studio Manager.
The primary color of Studio Manager is gray. Color is used sparingly and usually only to
highlight information or for branding. The Studio branding is green. There are also two
color themes used for Studio Manager, dark and light.
The light theme is used within views. This provides a more familiar color environment
for users with light backgrounds and dark text.
The dark theme is used within dialogs and the App Gallery. This creates a contrast that
makes important messages are more visible.
Icons
Studio Manager icons are in two formats: raster and vector. Raster icons are used for
toolbars and other fixed-size menus. Vector icons are more scalable and are used
within controls such as buttons or app catalog tiles.
Raster icons
All Studio Manager raster icons must be in PNG format. Raster icons must not be
scaled. You must provide an icon for each size of that image to be used in the app.
Naming conventions
Studio Manager icon files use this naming convention:
<icon_name>_<size>.png
<icon_name> is a name that describes the function of the icon, in lowercase with each
word in the name separated with an underscore (_).
<size> is the size of the icon in pixels. Common sizes are 16, 24, or 48 pixels square.
For example, if you create a data loading icon, the file name could look like this
example:
data_loading_16.png
Icon size
The most common icon size in Studio Manager is 16 pixels. This is the icon size used
for toolbars, tree view items, and most other controls that need an icon to mark
identity.
Modifiers
Modifiers are small repeated portions of icons used to communicate a usage. These
can include such things as a plus sign in the corner of an icon used to add items or an
x in the corner of an icon to denote deletion. Studio Manager provides a list of icon
modifiers and templates to reuse to maintain consistency across apps.
Guidelines
Icons should follow templates to match the style of other icons within the application,
and icons should be simple. You should pay special attention to the smaller icons.
Icons must not be resized photos. Most small images become hard to interpret unless
they are simplified.
Rounded tile or candy style icons, like those found in iOS, should not be used. In
Studio Manager, most icons are flat in color and style.
Use an icon to convey a single concept. You must not reuse the same icon to convey
multiple meanings. Using a single icon to denote deleting an item across multiple
views in your app is fine. Using the same icon for both delete and cancel is not.
Vector Icons
Studio Manager also uses vector-based icons in controls. The top menu, app catalog
icons, and button icons are all vector-based icons. Unlike raster icons, vector icons are
built to be scalable to any size. All Studio Manager icons must be in path markup
syntax. (See http://msdn.microsoft.com/en-us/library/ms752293.aspx for details.)
Guidelines
In addition to the rules for raster icons, vector icons have other special considerations:
• Vector icons must be only one color. This color is detailed for the control listing
that this icon will be associated with in the UI controls geometry and color
appendix.
• Vector icons must be a single path markup string. This does not mean the icon
cannot be composed of multiple figures within the markup, but a single geometry
must be used for each raster icon.
Tone
The tone of Studio Manager is simplicity. You should aim to reduce any unnecessary
wording, use simple sentences, and use consistent wordings throughout your app.
Language
The default language of Studio Manager is American English (English-US) in both the
interfaces and the user guide. You must not use British English (English-UK) in your
applications.
Guidelines
Be clear.
A phrase like: “You cannot use this type of input” is ambiguous. Clarify what that type
of input was and possibly why it couldn’t be used, as this example does:
The SeismicCube ‘Top’ could not be deleted. It is in use by seismic interpretation
‘Top Interp.’
Be concise.
You should use simple sentence structure. Keep information brief and topical. Help can
be suggested for longer and more detailed explanations.
Be consistent.
Terms like well or borehole may be interchangeable. This does not mean you should
ever interchange them. You must pick a term when referring to a concept and stick to
that term. You can check other applications in Studio Manager. You should also try to
keep your language consistent with the rest of the application.
Speak the language of the users.
Phrases like “null reference exception” may be meaningful to those supporting your
application. However, these messages can confuse users. You should present the
users with a more readable message like: “An error occurred processing workflow
‘Workflow 1.’ Please contact your system administrator if you need assistance to
resolve this problem. A more detailed message has been added to this log.”
Do not be patronizing.
Questions like: “Are you sure?”, or “Do you really want to exit?” can sound annoying or
even hostile to a frustrated person. You should remove adjectives or qualifiers from
your language. This will leave the language neutral: “Do you want to exit?”
Use an ellipsis mark.
Use an ellipsis mark (...) to indicate truncated text or commands that require
additional input.
Use sentence case capitalization.
Here are directions for implementing sentence case capitalization:
• Capitalize the first word.
• Use lowercase for everything else except proper nouns.
Controls
This section describes the requirements for controls.
Label
Button
Check boxes
Radio Buttons
Radio buttons are used to select between multiple mutually exclusive options or states.
If your control needs to execute an action it may be better to use a group of toggle
buttons. Radio buttons should apply these rules:
• Radio buttons must have an associated label. Follow the language guidelines in
“Tone” on page 7-9 to keep your labels clear and consistent.
• Radio buttons must be ordered by importance and frequency of use.
• Multiple radio buttons in a group should be aligned vertically.
• If the options users are selecting between are not mutually exclusive, you must
use check boxes.
Combo boxes
Combo boxes should be expected to contain three or more items. If you have fewer
items, use radio buttons instead. Combo boxes should apply these rules:
• Combo boxes must be for single selection only. They can only display one selected
item at a time once collapsed. Users will find having to open the combo box just to
see their selections inconvenient.
• Combo boxes should have content organized on some sort of logical order. For
larger sets, this may be something like alphabetical order. If there is a hierarchy to
the data or data that is commonly selected that may also be good to organize at
the top of the list of available items.
• Combo boxes should have a default selection. This may be something like the last
option used or the most used item. Users will appreciate the convenience of not
having to select an item from this control every time it is displayed.
This example shows a combo box:
Tabs
Tabs should have names that are nouns. Verbs denote an action and actions are more
commonly associated with buttons and commands. Tabs should apply these rules:
• Tabs must be used when multiple pages of data are kept within the same view.
• Tabs are used only if there are two or more pages. A single page of data can be
labeled or given a header.
• Tabs must be organized on a single row if they pertain to the same group of
pages.
• Tabs can be nested, but only if there is a strong but related separation between
the pages they separate. In many cases this separation can be better handled by
filtering the pages you want to view via another control like a combo box.
• Tabs on the same level should be dependent on one another.
• Tabs must be single selection. You can see only one page at a time within your
view.
• Tabs must not execute actions upon selection. They are used only to change
pages within a view.
• Tabs can be disabled. If a tab is disabled, it must have a tool tip that gives a clear
explanation as to why the tab is disabled. If this explanation cannot be told in only
a few words, it may be better to enable the column and disable the view within the
column. This will give you space to provide an adequate explanation about why
this page is unavailable.
This example shows a tab:
Group box
Group boxes in Studio Manager are labeled sets of controls. Group boxes should apply
these rules:
• Group boxes should separate related controls into understandable units.
• Group boxes must always have a label.
• Group boxes that contain only controls are indicated with a header.
• Group boxes must never be nested. Two headers back to back will look distracting
to users. Try to combine the categories if possible. If you cannot, make those
groupings into separate pages if possible using tabs or filters.
• Group boxes themselves must never be disabled. Disable individual controls within
the group or consider replacing the content of the group with a label explaining
why all the content is missing. If the group box should not be present at all in a
given state, consider collapsing it and only displaying it when users need it.
This example shows a group box:
List view
If you have a single column of data to display to users and this column has no
hierarchy, you should use a list view. List views should apply these rules:
Tree view
If you have a column of data to display to users and this column has hierarchy, you
should use a tree view. Tree views should apply these rules:
• A tree view should have limited depth. Keep structures simple so users do not
have to perform too many clicks to browse the data within the control. If your data
is deep or complex, you must make the tree view searchable or filterable.
• Tree views should have a title unless it is completely redundant.
This example shows a tree view:
Grid view
Grid views are table views of data. Grid views should apply these rules:
• Grid views must sort data. Users must be able to sort their data in alphanumeric,
number or some other logical order.
• Grid views must not scroll if there is enough space. Users will appreciate not
having to jog the control back and forth while viewing the data.
• Grid views must not execute actions when users change the current selection.
• Cell content must not be wrapped. Use ellipsis marks when cell content is long.
This example shows a grid view:
Toolbar
• Windows and dialog box controls should be laid out in a top-down, left-to-right
order.
This example shows a typical dialog box:
In this chapter
Data validation
This section lists the data validation that Studio SDK API performs. Some validation is
performed explicitly, and some is provided implicitly by design of the API as noted.
Quality tags
These rules apply to all of the data types except Marker.
• Check for Mandatory Quality Tags: Ensures that all the quality tags marked
mandatory by Studio Repository Admin are not null.
• Check for Valid Quality Tags: Ensures that all the quality tags meet the
condition set by Studio Repository Admin.
General
This rule applies to all data types:
• The user must not write to non-writeable properties
Borehole
These internal formats are related to Wellhead and
WorkingReferenceLevel.Offset:
• X_Y_TVDSS
• X_Y_TVDSS_MD
• DX_DY_TVDSS
• DX_DY_TVDSS_MD
These rules apply to the Borehole data type:
• Borehole must always contain:
− Wellhead.X value
− Wellhead.Y value
− WorkingReferenceLevel.Offset value
− Name
• The source CRS must:
− Have a projection and a datum.
− Be present in the Studio Database Server.
• If a borehole position is shown as infinity, not a number, Double.MaxValue,
Double.MinValue, or greater than 1E35f, borehole is marked as invalid.
• If a borehole does not have a TrajectoryCollection, then the borehole can
have only a single trajectory.
• If a borehole has a TrajectoryCollection, then it can have multiple
trajectories. The trajectories can be either Surveys or Plans.
• Borehole can have a definitive survey out of all its trajectories of Survey type; it
can have an active plan out of all its trajectories of Plan type.
• Borehole must have a working trajectory to be saved. The working trajectory is
either the definitive survey or the active plan in this order of priority.
Note: Starting from Ocean for Studio 2015.1, a borehole will always have a
TrajectoryCollection no matter it has a single trajectory or have
multiple trajectories.
Trajectory
These rules apply to the Trajectory data type:
• Trajectory.ExplicitRecords must have two or more points.
• MD values of Trajectory.ExplicitRecords must be increasing with no
duplicate values.
• Trajectory maximum depth must be equal to or must not be outside the given
tolerance compared to the borehole’s MDRange.Max.
Note: Starting from Ocean for Studio 2015.1, most properties and methods of
Trajectory become Obsolete, except for access to
TrajectoryCollection and OriginalCRS.
CheckShot
These rules apply to the CheckShot data type:
• CheckShot time values must always be present.
• This must be the only PointWellLog that exists for its combination of
Borehole and PointWellLogVersion or CheckShotVersion.
• SrdReference must be set for all CheckShot.
WellLog
These rules apply to the WellLog data type:
• The depth array must be increasing and must not have duplicate depth values.
• SrdReference must be set for all WellLog that are OneWayTime or
TwoWayTime.
MarkerCollection
These rules apply to the MarkerCollection data type:
• Zones:
− A zone must have an absolute top horizon and an absolute bottom horizon.
− Zones can have at most two horizons (absolute top and bottom) that have
only one zone attached to them.
• Horizons:
Marker
These rules apply to the Marker data type:
• The parent Borehole must be present.
• Marker depth must be present.
• The MDRange.Max of the parent Borehole must be deeper than the marker depth.
PointSet
This rule applies to the PointSet data type:
• SrdReference must be set for all PointSet created in ELEVATION_TIME.
PolylineSet
This rule applies to the PolylineSet data type:
• SrdReference must be set for all PolylineSet created in ELEVATION_TIME.
RegularHeightFieldSurface
These rules apply to the RegularHeightFieldSurface data type:
• SpatialLattice must be present.
• Lattice size must be valid.
• Lattice must be orthogonal.
• Name must always be present.
• Mandatory attributes (grid values, lattice information, CRS) must be present.
• CRS must be present in the Studio Database Server.
• SrdReference must be set for all RegularHeightFieldSurface created in
ELEVATION_TIME.
Template
This rule applies to the Template data type:
• If template does not exist in the target, no validation is required.
• The template name must be globally unique as two templates cannot have the
same name within a Studio repository.
HorizonInterpretation2D
These rules apply to the HorizonInterpretation2D data type:
• SeismicCollection:
− Must be present.
− Member type must be SeismicLine2DCollection.
• Mandatory attributes (horizon values, domain) must be present.
• Domain must be Depth or Time.
• Must have at least one valid (transferrable) line interpretation.
• Must have interpretation references to at least one 2D seismic line of geometry.
• SrdReference must be set for all HorizonInterpretation2D created in
ELEVATION_TIME.
HorizonInterpretation3D
These rules apply to the HorizonInterpretation3D data type:
• SeismicCollection:
− Must be present.
− Member type must be SeismicCube.
− Must not have any other HorizonInterpretation3D.
• Mandatory attributes (horizon values, domain) must be present.
• Domain must be Depth or Time.
• SrdReference must be set for all HorizonInterpretation3D created in
ELEVATION_TIME.
HorizonInterpretation
These rules apply to the HorizonInterpretation data type:
• Domain must be Depth or Time.
• Must have a name.
FaultInterpretation
These rules apply to the FaultInterpretation data type:
• FaultInterpretation must always contain:
− Name
− Domain
− Fault values
• Domain must be Depth or Time.
• SrdReference must be set for all FaultInterpretation created in
ELEVATION_TIME.
Seismic3DCollection
These rules apply to the Seismic3DCollection data type:
• Seismic3DCollection must:
− Have a name
− Be the same size or smaller than the survey
− Can be decimated relative to the survey
− Contain only 3D seismic
• Seismic3DCollection origin must be close to a survey trace position.
• Seismic3DCollection inline and crossline axes must be almost parallel to the
corresponding axis survey.
Seismic2DCollection
These rules apply to the Seismic2DCollection data type:
• Seismic2DCollection must:
− Have a name.
− Contain only 2D seismic.
• CDP numbers count, ShotPoint numbers count, and LineNavigation count
must be equal in Seismic2DCollection.
SeismicCube
These rules apply to the SeismicCube data type:
• A SeismicCube must:
− Have an external file reference
− Have an external file at the given path
− Be ZGY
• Number of samples in internal index space must be greater than:
− 1 in the Y axis
− 1 in the X axis
• Always contain:
− Origin
− iUnitVector
− jUnitVector
− kUnitVector
− Annotation at origin
− Annotation increment
− Storage type
− Vertical domain of either Depth or Time
− Template
− Clipping range
• kUnitVector in the vertical domain direction must not be positive.
• SrdReference must be set for all SeismicCube created in ELEVATION_TIME.
SeismicLine2DCollection
These rules apply to the SeismicLine2DCollection data type:
• A SeismicLine2DCollection must:
− Have an external file reference
− Have an external file at the given path
− Be SEG-Y
• Always contain:
− Name
− Line navigation with valid values
− Shot point numbers with valid values
− CDP numbers with valid values
− Size J values (number of traces)
− Size K values (number of samples per trace)
− Vertical start
− Vertical sampling interval as a positive value
− Storage type
− Vertical domain of either Depth or Time
− Template
− Clipping range
− Correct size restrictions
− At least one SeismicLine2D that is not virtually cropped
• SrdReference must be set for all SeismicLine2DCollection created in
ELEVATION_TIME.
In this chapter
Overview ............................................................................................................................. B-2
Multiple solutions for planned trajectory calculations .............................................................. B-2
Use the minimum-curvature and DLS equations ............................................................... B-2
The ambiguity ............................................................................................................... B-3
Provide an azimuth value that disambiguates the calculation .................................................. B-4
Data-loading workflow ................................................................................................... B-4
Interactive workflow ...................................................................................................... B-4
Overview
This appendix explains a potentially confusing aspect of the Studio SDK API. This
appendix does not provide a complete explanation of well path computation.
where:
Ai Initial azimuth (given)
Af Final azimuth (unknown)
Ii Initial inclination (given)
If Final inclination (given)
DLS Dogleg severity in degrees per 30 meters (given)
MD Measured depth (unknown)
Assume that all angle measurements are represented in the range 0 to 360°.
The ambiguity
The function shows an ambiguity in the term that contains cos(A f - Ai) because for any
given value of (Ai) there are two values of (Af) that yield the same result.
For example, with these values:
Ai = 45
Af = 55
Ii = 5
If = 10
MD = 100
the result is that DLS = 0.5398°/30m.
This same DLS result can also be obtained by setting A f = 35 instead. This is easily
verified because cos(10°) = cos(-10°).
Thus, for any given set of input values for the initial azimuth, initial and final
inclinations, TVD, and DLS, exactly two final azimuth values can be calculated by the
calculation engine.
Data-loading workflow
In this workflow, the program populates a Studio repository with data from another
source.
In this case, the complete Planned Trajectory data should be available. The software
can use the unambiguous SetTvdInclinationDlsAzimuth method, which takes
four parameters and can completely specify the details of the curved section in one
step. (If the supplied values are not valid for the trajectory engine’s calculations, an
error is returned.)
Interactive workflow
In this workflow, a user may construct a Planned Trajectory in pieces without knowing
which value to supply for the azimuth.
In this case, the user should use the three-parameter SetTvdInclinationDls
method. After calculating the trajectory, a return code will indicate that the user must
select from one of two possible azimuth values. These values can be accessed via the
SuggestedValues property.
Setting the Azimuth property to one of these two values yields a complete computation
for that section. This achieves the same result as using the four-parameter
SetTvdInclinationDlsAzimuth method, because all four required parameters
are now known.
In this chapter
UI controls ..........................................................................................................................C-2
Buttons .........................................................................................................................C-2
Check boxes ..................................................................................................................C-2
Radio buttons ................................................................................................................C-3
Combo boxes.................................................................................................................C-3
Scroll bar .......................................................................................................................C-4
Tooltips .........................................................................................................................C-4
UI controls
This appendix shows the standard geometry and color for Studio Manager user
interface controls.
Buttons
Check boxes
Radio buttons
Combo boxes
Scroll bar
Tooltips