/* ======== IGeoS ===== Distribition full ===== IGeoS ========= ** ** templ1t_ep.C : Created by 'seisweb' on Wed Apr 1 17:31:52 2020 ** ** Product : IGeoS - Integrated Geoscience Software ** ** Description : System for seismic, well log, and potential-field data analysis ** ** =================== Limited License: =================================== ** ** This software is provided free under the following terms and conditions: ** ** 1. Permission to use, copy, and modify this software ** for non-commercial purposes without fee is hereby granted, provided ** that this copyright notice, the warranty disclaimer, and this ** permission notice appear in all copies. ** ** 2. Distribution of this software or any part of it "bundled" in with ** any product is considered to be a 'commercial purpose'. ** ** 3. Any new or adapted code developed to operate as a part of this ** software shall be contributed to the authors and distributed under ** the same license. ** ** ================== Warranty Disclaimer: ================================ ** ** This software is provided "as is", with no support and without ** obligation on the part of the author to assist in its use, correction, ** modification, or enhancement. No guarantees or warranties, ** either express or implied, and regarding the accuracy, safety, or ** fitness for any particular purpose are provided by any contributor ** to this software package. ** ** ======== IGeoS ===== Distribition full ===== IGeoS ========= */ /* ========= S - I - A === S - I - A === S - I - A === S - I - A ========== ** ** templ1t_ep.C: Created by 'seisweb' on Fri Oct 20 19:19:51 2006 ** This file is a part of SIA distribution 'full' ** ** Copyright (c) 1995-2006, Igor Morozov, all rights reserved ** ** =================== Limited License: =================================== ** This software is provided free under the following terms and conditions: ** ** 1. Permission to use, copy, and modify this software ** for non-commercial purposes without fee is hereby granted, provided ** that this copyright notice, the warranty disclaimer, and this ** permission notice appear in all copies. ** ** 2. Distribution of this software or any part of it "bundled" in with ** any product is considered to be a 'commercial purpose'. ** ** 3. Any new or adapted code developed to operate as a part of this ** software shall be contributed to the authors and distributed under ** the same license. ** ** ================== Warranty Disclaimer: ================================ ** This software is provided "as is", with no support and without ** obligation on the part of the author to assist in its use, correction, ** modification, or enhancement. No guarantees or warranties, ** either express or implied, and regarding the accuracy, safety, or ** fitness for any particular purpose are provided by any contributor ** to this software package. ** ** ========= S - I - A ========== S - I - A ========== S - I - A ========== */ /* templ1t_ep.C */ //#define DEBUG #include "templ1t.h" extern "C" { void *templ1t_init() { return new TEMPL1T; } } /*=== the name of the program for the GUI ====*/ CHARSTR TEMPL1T::module_name( boolean active ) { return "Sample 1-trace process"; } /*================================================================= Constructor ==================================================================*/ TEMPL1T::TEMPL1T() : SIA_MODULE() { } void TEMPL1T::read_params() { /*--- read the parameters described in .mpar file ----*/ param1.read("PARAM1",REAL,0.0); // input header or constant value out_header.define("OUTHDR",REAL,FROM_JOB); // define an output header // with a user-specified name // example of reading parameter lists: while ( PDF_list("list1") ) // now we are in LIST1 (see .mpar file) { // read text string parameter from field "AMPL": CHARSTR str; if ( str.param("STRPAR") != PARAM_NORMAL ) SIA_err(SIA_abort,"Oops, you forgot to specify AMPL! Bailing out..."); str.edit(); // this resolves all {...} tokens inserted in the string // read integer parameter from PAR1 and floating-point parameter from PAR2: int p1; float p2; if ( READPAR("PAR1",p1) == PARAM_NORMAL ) SIA_message("PAR1 = %d",p1); // note the message to the user READPAR("PAR2",p2); // note that here we ignore the read status // note that READPAR should make automatic type conversions: double p2d; READPAR("PAR2",p2d); // p2d is a double version of p2 // After all parameters in the list are read in, Read its "repeat" groups: while ( PDF_next_repeat() ) { // now we are in the next Repeat group. // Use the same type of access to the parameters of the Repeat line } } } /*========================================================================== Edit phase - called once to load the parameters of the tool ==========================================================================*/ int TEMPL1T::edit() { read_params(); // read all module parameters return NORMAL_MODULE; // return status for a trace-in-trace-out module }