Commit 2ee5ca00 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

new plot program

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 2209
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 28277fb6
# ---------------------------------------
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.11 2007-01-31 07:41:35 tforb Exp $
#
# Copyright (c) 2007 by Thomas Forbriger (BFO Schiltach)
#
# waveform plot programs
#
# REVISIONS and CHANGES
# 30/01/2007 V1.0 Thomas Forbriger
#
# ============================================================================
#
# $Header: /home/tforb/svnbuild/cvssource/CVS/thof/src/ts/plot/Makefile,v 1.10 2006-03-23 16:04:20 tforb Exp $
#
# Makefile fuer /server/users/thof/work/src/ts/plot
#
#
# ---------------------------------------
F2CLIB=-lf2c -lm -L${SERVERLIBDIR}
PGPLOTLIB=-lf2cpgplot52 -lX11 -L/usr/X11/lib
......@@ -20,6 +25,27 @@ CFLAGS=-O2
OPTFLAGS=-O2
FC=g77
FLAGS=
CXXFLAGS=-fhonor-std -Wall $(FLAGS)
CXXFLAGS=-Wall $(FLAGS)
LDFLAGS=-L$(LOCLIBDIR)
CPPFLAGS=-I$(LOCINCLUDEDIR) $(FLAGS)
all:
flist: Makefile $(wildcard *.f *.cc)
echo $^ | tr ' ' '\n' | sort > $@
.PHONY: edit
edit: flist; vim $<
.PHONY: clean
clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist
-/bin/rm *.o *.bak *.o77
%.o: %.f
f2c $(F2CFLAGS) $<
$(CC) $(CFLAGS) $(<:.f=.c) -c -I${SERVERINCLUDEDIR} -I$(LOCINCLUDEDIR)
......@@ -28,12 +54,6 @@ FC=g77
%.o77: %.f
$(FC) -o $@ -c $< $(OPTFLAGS) $(G77FLAGS)
clean:
-/bin/rm *.o *.bak *.o77 flist
flist: $(wildcard *.f) Makefile; echo $^ | tr ' ' '\n' | sort > $@
edit: flist; vim $<
susplo: susplo.o
$(CC) $^ -o $@ -ltf -lsff $(PGPLOTLIB) $(F2CLIB) -L$(LOCLIBDIR)
newprog $@
......@@ -78,3 +98,12 @@ damplo: damplo.o
$(CC) damplo.o -o damplo -lsffu -ltime -lsff -ltf\
$(PGPLOTLIB) $(F2CLIB) -L$(LOCLIBDIR)
newprog damplo
stuploxx: %: %.o
$(CXX) -o $@ $^ -I$(LOCINCLUDEDIR) -ldatreadxx \
-ltsxx -ltfxx -lsffxx -lgsexx -ltime++ -laff \
-L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS)
newprog $@
# ----- END OF Makefile -----
/*! \file stuploxx.cc
* \brief Plot SFF waveform data
*
* ----------------------------------------------------------------------------
*
* $Id: stuploxx.cc,v 1.1 2007-01-31 07:41:36 tforb Exp $
* \author Thomas Forbriger
* \date 30/01/2007
*
* Plot SFF waveform data
*
* Copyright (c) 2007 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 30/01/2007 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define STUPLOXX_VERSION \
"STUPLOXX V1.0 Plot SFF waveform data"
#define STUPLOXX_CVSID \
"$Id: stuploxx.cc,v 1.1 2007-01-31 07:41:36 tforb Exp $"
#include <iostream>
#include <tfxx/commandline.h>
using std::cout;
using std::cerr;
using std::endl;
struct Options {
// control verbosity
bool verbose, debug;
}; // struct Options
/*======================================================================*/
// main function
// =============
int main(int iargc, char* argv[])
{
// list of keys for filename specific parameters
static const char* keys[]={"t", 0};
// define usage information
char usage_text[]=
{
STUPLOXX_VERSION "\n"
"usage: stuploxx [-v] [-D] file [file...]" "\n"
" or: stuploxx --help|-h" "\n"
};
// define full help text
char help_text[]=
{
STUPLOXX_CVSID "\n"
" " "\n"
"-v be verbose" "\n"
"-D debug mode" "\n"
"file SFF waveform data file name" "\n"
};
// define commandline options
using namespace tfxx::cmdline;
static Declare options[]=
{
// 0: print help
{"help",arg_no,"-"},
// 1: verbose mode
{"v",arg_no,"-"},
{NULL}
};
// no arguments? print usage...
if (iargc<2)
{
cerr << usage_text << endl;
exit(0);
}
// collect options from commandline
Commandline cmdline(iargc, argv, options);
// help requested? print full help text...
if (cmdline.optset(0))
{
cerr << usage_text << endl;
cerr << help_text << endl;
exit(0);
}
// dummy operation: print option settings
for (int iopt=0; iopt<2; iopt++)
{
cout << "option: '" << options[iopt].opt_string << "'" << endl;
if (cmdline.optset(iopt)) { cout << " option was set"; }
else { cout << "option was not set"; }
cout << endl;
cout << " argument (string): '" << cmdline.string_arg(iopt) << "'" << endl;
cout << " argument (int): '" << cmdline.int_arg(iopt) << "'" << endl;
cout << " argument (long): '" << cmdline.long_arg(iopt) << "'" << endl;
cout << " argument (float): '" << cmdline.float_arg(iopt) << "'" << endl;
cout << " argument (double): '" << cmdline.double_arg(iopt) << "'" << endl;
cout << " argument (bool): '";
if (cmdline.bool_arg(iopt))
{ cout << "true"; } else { cout << "false"; }
cout << "'" << endl;
}
while (cmdline.extra()) { cout << cmdline.next() << endl; }
// dummy operation: print rest of command line
while (cmdline.extra()) { cout << cmdline.next() << endl; }
}
/* ----- END OF stuploxx.cc ----- */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment