Commit bad70d93 authored by Matteo Quintiliani's avatar Matteo Quintiliani
Browse files

Start with Earthworm support


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@357 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent 6029f5b6
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
@@ -37,6 +37,11 @@ AC_ARG_WITH([libmseed],
	    [], 
	    [with_libmseed=yes]
	    ) 
AC_ARG_WITH([ew],
	    [AS_HELP_STRING([--without-ew], [disable support for earthworm])],
	    [], 
	    [with_ew=yes]
	    ) 

	    AS_IF([test "x$with_libmseed" != xno], 
		  [AC_CHECK_LIB([mseed], [msr_init],
@@ -63,11 +68,15 @@ AC_ARG_WITH([libmseed],
AC_HEADER_STDC
AC_CHECK_HEADERS([stdint.h stdlib.h string.h])

# Earthworm files
AC_CHECK_HEADERS([earthworm.h kom.h transport.h trace_buf.h],
		 [AC_DEFINE([HAVE_EARTHWORMFILES_H], [1], [Define if you have earthworm header file])],
		 AC_MSG_WARN([earthworm header files not found!]))

# Earthworm check
AS_IF([test "x$with_ew" != xno], 
      [
AS_IF([test "x$EW_HOME" != x], 
      [
# AC_CHECK_HEADERS([earthworm.h kom.h transport.h trace_buf.h],
#		 [AC_DEFINE([HAVE_EARTHWORMFILES_H], [1], [Define if you have earthworm header file])],
#		 AC_MSG_WARN([earthworm header files not found!]))
AC_CHECK_FILES([$EW_HOME/$EW_VERSION/lib/kom.o
		$EW_HOME/$EW_VERSION/lib/getutil.o
		$EW_HOME/$EW_VERSION/lib/logit_mt.o
@@ -82,6 +91,12 @@ AC_CHECK_FILES([$EW_HOME/$EW_VERSION/lib/kom.o
		$EW_HOME/$EW_VERSION/lib/mem_circ_queue.o],
		[AC_DEFINE([HAVE_EARTHWORMOBJS], [1], [Define if you have earthworm object files])],
		AC_MSG_WARN([earthworm object file not found!]))
],
[AC_MSG_WARN([Earthworm files are not available (--without-ew to disable)])]
)
],
[AC_MSG_WARN([Earthworm support has been disabled!])]
)


# Checks for files.
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ bin_PROGRAMS = nmxptool
# TODO optional
seedlinkplugin_sources = seedlink_plugin.c

nmxptool_SOURCES = nmxptool.c nmxptool_getoptlong.c \
nmxptool_SOURCES = nmxptool.c nmxptool_getoptlong.c nmxptool_ew.c \
		   $(seedlinkplugin_sources)

#noinst_HEADERS = gdu.h
+10 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
 * 	Istituto Nazionale di Geofisica e Vulcanologia - Italy
 *	quintiliani@ingv.it
 *
 * $Id: nmxptool.c,v 1.68 2007-09-27 15:08:57 mtheo Exp $
 * $Id: nmxptool.c,v 1.69 2007-09-28 09:47:40 mtheo Exp $
 *
 */

@@ -23,6 +23,7 @@

#include "config.h"
#include "nmxptool_getoptlong.h"
#include "nmxptool_ew.h"

#ifdef HAVE_LIBMSEED
#include <libmseed.h>
@@ -32,6 +33,14 @@
#include "seedlink_plugin.h"
#endif

#ifdef HAVE_EARTHWORMOBJS
/* Earthworm includes */
#include <earthworm.h>
#include <kom.h>
#include <transport.h>
#include <trace_buf.h>
#endif

#define CURRENT_NETWORK (params.network)? params.network : DEFAULT_NETWORK
#define GAP_TOLLERANCE 0.001

src/nmxptool_ew.c

0 → 100644
+57 −0
Original line number Diff line number Diff line
/*! \file
 *
 * \brief Earthworm support for Nanometrics Protocol Tool
 *
 * Author:
 * 	Matteo Quintiliani
 * 	Istituto Nazionale di Geofisica e Vulcanologia - Italy
 *	quintiliani@ingv.it
 *
 * $Id $
 *
 */

#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#include "config.h"
#include "nmxp.h"

#include "nmxptool_ew.h"

#ifdef HAVE_EARTHWORMOBJS

#define MAXMESSAGELEN   160     /* Maximum length of a status or error  */
                                /*   message.                           */
#define MAXRINGNAMELEN  28      /* Maximum length of a ring name.       */
                                /* Should be defined by kom.h           */
#define MAXMODNAMELEN   30      /* Maximum length of a module name      */
                                /* Should be defined by kom.h           */
#define MAXADDRLEN      80      /* Length of SeedLink hostname/address  */

SHM_INFO      regionOut;         /* Shared memory region                 */
pid_t         myPid;             /* Process ID                           */

char  ringName[MAXRINGNAMELEN];  /* Name of destination ring for data    */
long  ringKey;                   /* Key to output shared memory region   */
char  myModName[MAXMODNAMELEN];  /* Name of module instance              */
int   forcetracebuf = 0;         /* Switch to force TRACEBUF             */

unsigned char myModId;           /* ID of this module                    */
unsigned char myInstId;          /* Installation running this module     */
unsigned char typeError;         /* Error message type                   */
unsigned char typeHeartbeat;     /* Heartbeat message type               */
unsigned char typeWaveform;      /* Waveform message type TRACEBUF       */
unsigned char typeWaveform2 = 0; /* Waveform message type TRACEBUF2      */

MSG_LOGO      hrtLogo;           /* Heartbeat message logo               */
MSG_LOGO      waveLogo;          /* Waveform message logo                */
MSG_LOGO      errLogo;           /* Error message logo                   */

int           heartbeatInt;      /* Heartbeat interval (seconds)         */
int           logSwitch;         /* 1 -> write log, 0 -> no log          */
                          /* 2 -> write module log but not stderr/stdout */

#endif

src/nmxptool_ew.h

0 → 100644
+29 −0
Original line number Diff line number Diff line
/*! \file
 *
 * \brief Earthworm support for Nanometrics Protocol Tool
 *
 * Author:
 * 	Matteo Quintiliani
 * 	Istituto Nazionale di Geofisica e Vulcanologia - Italy
 *	quintiliani@ingv.it
 *
 * $Id $
 *
 */

#ifndef NMXPTOOL_EW_H
#define NMXPTOOL_EW_H 1

#ifdef HAVE_EARTHWORMOBJS

/* Earthworm includes */
#include <earthworm.h>
#include <kom.h>
#include <transport.h>
#include <trace_buf.h>


#endif

#endif