Commit 5f51c454 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: 2426
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent e426c95a
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: stuploxx.cc,v 1.9 2007-11-02 10:51:59 tforb Exp $
* $Id: stuploxx.cc,v 1.10 2007-11-05 10:41:33 tforb Exp $
* \author Thomas Forbriger
* \date 30/01/2007
*
......@@ -50,10 +50,10 @@
*
* 3. The function
* setuppanels (const TDataFileList &fpl)
* take the definitions together with the trace data and splits the file
* takes the definitions together with the trace data and splits the file
* into traces. These traces will then be associated to plot panels
* depending upon the settings defined by the user. The result of this
* function is a vector of type TPanelList. Each element in this vector is
* function is a vector of type TPanelVector. Each element in this vector is
* of type Panel and contains a list of type TDataTraceList. This list
* contains all traces to be plot within in the specific panel. The
* elements in the object of type TDataTraceList are of type DataTrace.
......@@ -62,7 +62,7 @@
* data in and object to type Ttimeseries.
*
* 4. The function
* plotdata (pgplot::basic_device &dev, const TPanelList &pl, const PGstyle
* plotdata (pgplot::basic_device &dev, const TPanelVector &pl, const PGstyle
* &)
* takes the vector of panels together with a PGPLOT device class and
* PGPLOT style settings and creates the graphical display of the data. It
......@@ -89,7 +89,7 @@
#define STUPLOXX_VERSION \
"STUPLOXX V1.0 Plot SFF waveform data"
#define STUPLOXX_CVSID \
"$Id: stuploxx.cc,v 1.9 2007-11-02 10:51:59 tforb Exp $"
"$Id: stuploxx.cc,v 1.10 2007-11-05 10:41:33 tforb Exp $"
#include <iostream>
#include <string>
......@@ -131,10 +131,16 @@ using std::endl;
// key to select file format
const char formatkey[]="f";
// index of first panel in vector of panels
const int Cfirstpanel=0;
// panel index to be used to indicate that no panel was selected
// on the command line
const int Cnopanelselected=-9999;
/*----------------------------------------------------------------------*/
// struct to store command line options and arguments
// these are general options not directly related to plotting
// these are general options not directly related to PGPLOT styles
struct Options {
// control verbosity
bool verbose, debug;
......@@ -208,7 +214,7 @@ struct Panel {
TDataTraceList dtl;
}; // struct Panel
typedef std::vector<Panel> TPanelList;
typedef std::vector<Panel> TPanelVector;
/*======================================================================*/
......@@ -230,7 +236,7 @@ TFileParametersList setparameters(const tfxx::cmdline::Tparsed& fns,
fp.rgb.set=false;
fp.hls.set=false;
fp.ls=pgs.ls;
fp.ipanel=-1;
fp.ipanel=Cnopanelselected;
// set selected parameters
if (I->haskey(panelkey))
......@@ -313,16 +319,66 @@ TDataFileList readdata(const TFileParametersList& fpl)
/*----------------------------------------------------------------------*/
// function to set up panels on view surface
TPanelList setuppanels(const TDataFileList& fpl)
TPanelVector setuppanels(const TDataFileList& fpl)
{
TPanelList retval;
// create target data to be returned by this function
TPanelVector retval;
// set first panel index to be used
int nextpanel=Cfirstpanel;
// cycle through fpl list and put each trace into the appropriate panel
TDataFileList::const_iterator IF=fpl.begin();
while (IF != fpl.end())
{
// local references to input data
const FileParameters& para=IF->para;
const TSFile& file=IF->file;
// cycle through all traces
TSFile::Tfile::Ttracevector::const_iterator IT=file.data.begin();
while (IT != file.data.end())
{
// local reference to trace data
const Ttimeseries& timeseries=&IT;
// set panel index to be used and next panel index to be used
int ipanel=para.ipanel;
if (ipanel==Cnopanelselected)
{
ipanel=nextpanel;
++nextpanel;
}
else
{
nextpanel=ipanel+1;
}
// local reference to output data
Panel& panel=retval[ipanel];
// create data to be added to list of traces
DataTrace trace;
trace.para=para;
trace.ts=timeseries;
// copy data to panel
panel.dtl.push_back(trace);
// go to next trace in this file
++IT;
}
// go to next file
++IF;
}
return(retval);
} // TPanelList readdata(const TDataFileList& fpl)
} // TPanelVector readdata(const TDataFileList& fpl)
/*----------------------------------------------------------------------*/
// function to plot data
void plotdata(pgplot::basic_device& dev,
const TPanelList& pl,
const TPanelVector& pl,
const PGstyle&)
{
dev.env(pgplot::c_rect1919).arro(float(0.2),float(0.2),float(0.8),float(0.8));
......@@ -475,7 +531,7 @@ int main(int iargc, char* argv[])
TDataFileList dfl=readdata(fpl);
// fill data into panels
TPanelList pl=setuppanels(dfl);
TPanelVector pl=setuppanels(dfl);
// screen device
pgplot::device dev(opt.device.c_str());
......
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