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

proceeding

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: 2427
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 5f51c454
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: stuploxx.cc,v 1.10 2007-11-05 10:41:33 tforb Exp $
* $Id: stuploxx.cc,v 1.11 2007-11-09 07:37:14 tforb Exp $
* \author Thomas Forbriger
* \date 30/01/2007
*
......@@ -89,7 +89,7 @@
#define STUPLOXX_VERSION \
"STUPLOXX V1.0 Plot SFF waveform data"
#define STUPLOXX_CVSID \
"$Id: stuploxx.cc,v 1.10 2007-11-05 10:41:33 tforb Exp $"
"$Id: stuploxx.cc,v 1.11 2007-11-09 07:37:14 tforb Exp $"
#include <iostream>
#include <string>
......@@ -101,6 +101,7 @@
#include <tsxx/sffheaders.h>
#include <tfxx/readtsdata.h>
#include <tfxx/error.h>
#include <tfxx/misc.h>
#include <datreadxx/readany.h>
#include <xpgplotCpp.h>
......@@ -319,8 +320,12 @@ TDataFileList readdata(const TFileParametersList& fpl)
/*----------------------------------------------------------------------*/
// function to set up panels on view surface
TPanelVector setuppanels(const TDataFileList& fpl)
TPanelVector setuppanels(const TDataFileList& fpl,
const bool& verbose=false,
const bool& debug=false)
{
TFXX_debug(debug, "setuppanels",
"create list of panels and distribute traces");
// create target data to be returned by this function
TPanelVector retval;
......@@ -328,6 +333,8 @@ TPanelVector setuppanels(const TDataFileList& fpl)
int nextpanel=Cfirstpanel;
// cycle through fpl list and put each trace into the appropriate panel
TFXX_debug(debug, "setuppanels",
"cycle through input list of data files");
TDataFileList::const_iterator IF=fpl.begin();
while (IF != fpl.end())
{
......@@ -335,12 +342,17 @@ TPanelVector setuppanels(const TDataFileList& fpl)
const FileParameters& para=IF->para;
const TSFile& file=IF->file;
TFXX_debug(debug, "setuppanels",
"file: " << para.filename.name);
// cycle through all traces
TSFile::Tfile::Ttracevector::const_iterator IT=file.data.begin();
while (IT != file.data.end())
{
TFXX_debug(debug, "setuppanels",
"trace: " << IT->header.wid2().station
<< " " << IT->header.wid2().channel);
// local reference to trace data
const Ttimeseries& timeseries=&IT;
const Ttimeseries& timeseries = *IT;
// set panel index to be used and next panel index to be used
int ipanel=para.ipanel;
......@@ -355,23 +367,36 @@ TPanelVector setuppanels(const TDataFileList& fpl)
}
// local reference to output data
Panel& panel=retval[ipanel];
TFXX_debug(debug, "setuppanels",
"create reference to selected panel: " << ipanel);
if (ipanel
TPanelVector::iterator panel=retval.insert(ipanel);
// create data to be added to list of traces
TFXX_debug(debug, "setuppanels",
"copy data to DataTrace object");
DataTrace trace;
trace.para=para;
trace.ts=timeseries;
// copy data to panel
panel.dtl.push_back(trace);
TFXX_debug(debug, "setuppanels",
"copy data to panel");
panel->dtl.push_back(trace);
// go to next trace in this file
TFXX_debug(debug, "setuppanels",
"next trace in this file");
++IT;
}
// go to next file
TFXX_debug(debug, "setuppanels",
"next file");
++IF;
}
TFXX_debug(debug, "setuppanels",
"return list of panels");
return(retval);
} // TPanelVector readdata(const TDataFileList& fpl)
......@@ -525,15 +550,19 @@ int main(int iargc, char* argv[])
filenames=tfxx::cmdline::parse_cmdline(cmdline, keys, opt.verbose);
// fill data file parameter list
TFXX_debug(opt.debug, "main", "create list of file parameters");
TFileParametersList fpl=setparameters(filenames, pgstyle);
// read data from file
TFXX_debug(opt.debug, "main", "read data files");
TDataFileList dfl=readdata(fpl);
// fill data into panels
TPanelVector pl=setuppanels(dfl);
TFXX_debug(opt.debug, "main", "create list of panels and distribute traces");
TPanelVector pl=setuppanels(dfl, opt.verbose, opt.debug);
// screen device
TFXX_debug(opt.debug, "main", "open plot device");
pgplot::device dev(opt.device.c_str());
dev.ask(false);
......
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