Wednesday, 26 January 2011

Making Our Own AttributeProvider in OpenDtect

As the default AttributeEngine's Provider class cannot altered as we wish. We need to do some re-routing of it if our plugin wanted to access some protected or read-only members from the original Provider.

Here's the diagram showing what I alter to allow my plugin to do things that the default Provider won't allow it to do:

g7056

Something like that...

Tuesday, 25 January 2011

OpenDtect AttributeEngine Process Flow

In making attribute computation program using OpenDtect we should follow the right flow so that our algorithm will be run nicely.

Process steps:
  1. prepareForComputeData First to be called, and only once
  2. getInputData
  3. computeData a const (called n times; depends on our processor core number ? and if we set allowParallelComputation to yield true)
  4. finalizeCalculation

Again. This is a quite simple problem, but it takes some times for me to figure it out (d'oh)
NOTE: getInputData(), computeData(), and finalizeCalculation() are called n times, where n = number of traces in a line. (Called inside doWork() method of Provider class)

Monday, 24 January 2011

Spoiler Is Dead

After applying a new template.... my spoiler is dead...

Enjoy

Cleaning process for OpenDtect Objects

Previously: there is a pmake configuration to make OpenDtect Plugin...

If there's any change to the SRC.cc list then we should clean some objects created before, or those unused objects will make our plugin malfunctioned. (in other word: OpenDtect couldn't load the plugin)

Now, I just use this script (executed exactly on our plugin folder ? ):


#!/bin/bash
make source1.rmlib
make source2.rmlib

#and so on..


Simple... but without knowing this, making a plugin can give you (a pretty bad) headache!

oh c++...

Friday, 21 January 2011

Everyday Pmake Makefile for OpenDtect Plugin


SRC.cc := source1.cc source2.cc
PLUGIN := yes
PLUGINDEP := MySourcePlugin

OWNC++FLAGS := -DYOURFLAG1 -DYOURFLAG2

MODDEP := uiODMain
include make.od.Defaults
include make.Targets

Tuesday, 18 January 2011

Ubuntu??

Ubuntu is Linux

OpenDtect (Preparing & Deploying Plugin)

Preparing:

1. Always use function below (XXX is your plugin name):

#include "plugins.h"

extern "C" int GetXXXPluginType()
{
return PI_AUTO_INIT_EARLY;
}

extern "C" int GetXXXPluginInfo()
{
static PluginInfo retpi ={
"Plugin Name",
"Author",
"Version Number",
"Description" };
return &retpi;
}



And don't forget the init function!!!!

(Part Of) Deploying:
2. Setting *.alo files
Place your *.alo files on :

  • The plugins/platform_dir of the installation directory ($DTECT_APPL/plugins/$HDIR)

  • The '.od' directory in your 'Personal directory' ($HOME/.od/plugins/$HDIR on Unix)


Example of: odmain.xxx.alo <-- this is the "default" file naming format

Annotations
Madagascar
uiMadagascar
CmdDriver
GMT
uiGMT


3. Distribute your plugin files (those *.dll or *.so files)

Further Resources: