Changeset 1440 in Sophya


Ignore:
Timestamp:
Mar 14, 2001, 5:24:23 PM (25 years ago)
Author:
ansari
Message:

documentation piapp.cc pour doxygen - Reza 14/3/2001

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/ProgPI/piapp.cc

    r722 r1440  
    1111#include "skyinit.h"
    1212
     13#include "xntuple.h" // Pour faire le SetTmpDir()
     14
    1315
    1416// ---- Pour charger automatiquement le module sopiamodule
     
    1820}
    1921
     22/*!
     23  \defgroup ProgPI ProgPI module
     24  This module contains programs for interactive data analysis and
     25  visualisation, based on SOPHYA class libray and PI (GUI framework)
     26  and PIext (Interactive data analysis framework).
     27*/
     28
     29/*!
     30  \ingroup ProgPI
     31  \file piapp.cc
     32  \brief \b (s)piapp: Starts the piapp interactive data analysis program.
     33
     34  The current version of the program has a single execution thread. This
     35  creates few limitations (GUI can not be used when computing is being
     36  done, ...). Also the command file executed during start-up (-exec)
     37  cannot contain display (graphic) commands.
     38
     39  \verbatim
     40  csh> spiapp -h
     41  SOPHYA Version  1.1 Revision 0 (V_Fev2001) -- Mar  9 2001 15:45:31 cxx
     42
     43  piapp: Interactive data analysis and visualisation program
     44  Usage: piapp [-nored] [-nosig] [-nosigfpe] [-nosigsegv]
     45               [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]]
     46    -nored : NoRedirect StdOut/StdErr
     47    -nosig : Don't catch SigFPE, SigSEGV
     48    -nosigfpe -nosigsegv: Don t catch SigFPE / SigSEGV
     49    -tmpdir TmpDirectory: defines TMDIR for temporary files
     50    -help2tex: Create a LaTeX help file (piahelp.tex)
     51    -exec file [args] : Execute command file
     52 
     53  \endverbatim
     54 
     55*/
     56
     57void Usage(bool fgerr)
     58{
     59  if (fgerr) {
     60    cout << " piapp : Argument Error ! piapp -h for Usage" << endl;
     61    exit(1);
     62  }
     63  else {
     64    cout << "\n piapp: Interactive data analysis and visualisation program \n"
     65         << " Usage: piapp [-nored] [-nosig] [-nosigfpe] [-nosigsegv] \n"
     66         << "              [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]] \n"
     67         << "  -nored : NoRedirect StdOut/StdErr \n"
     68         << "  -nosig : Don't catch SigFPE, SigSEGV \n"
     69         << "  -nosigfpe -nosigsegv: Don t catch SigFPE / SigSEGV \n"
     70         << "  -tmpdir TmpDirectory: defines TMDIR for temporary files \n"
     71         << "  -help2tex: Create a LaTeX help file (piahelp.tex)\n"
     72         << "  -exec file [args] : Execute command file \n"
     73         << endl;
     74    exit(0);
     75  }
     76}
    2077
    2178/*  ================================ MAIN() =================================  */
     
    3087InitTim();
    3188
    32 ofa = 1;   
    33 if (narg > 1)
    34   {
    35   if (strcmp(arg[1],"-h") == 0)
    36     {
    37     puts("\n piapp: Programme d'analyse interactive ");
    38     puts("Usage: piapp [-nored] [-nosig] [-nosigfpe] [-nosigsegv] [-help2tex] [-exec file [args]]");
    39     puts("  -nored : NoRedirect StdOut/StdErr");
    40     puts("  -nosig : Don't catch SigFPE, SigSEGV");
    41     puts("  -nosigfpe -nosigsegv: Don't catch SigFPE / SigSEGV");
    42     puts("  -help2tex: Create a LaTeX help file (piahelp.tex)");
    43     puts("  -exec file [args] : Execute command file \n");
    44     exit(0);
    45     }
    46   }
     89
     90if ( (narg > 1) && (strcmp(arg[1],"-h") == 0) ) Usage(false);
    4791
    4892ofa = 1;
    4993fgred = fgfpe = fgsegv = true;
    5094fgexec = false;
     95bool fgtmp = false;
     96string tmpdir;
    5197string exfc;
    5298// Pour fabriquer le help
     
    59105  else if (strcmp(arg[ka],"-nosigsegv") == 0)   fgsegv=false;
    60106  else if (strcmp(arg[ka],"-help2tex") == 0) { fgtexh=true; fgred=false; }
     107  else if (strcmp(arg[ka],"-tmpdir") == 0) {
     108    if (ka == narg-1) Usage(true);
     109    fgtmp = true;  ka++;
     110    tmpdir = arg[ka];   
     111  }
    61112  else if (strcmp(arg[ka],"-exec") == 0) {
    62113    if (ka < narg-1) {
     
    69120  }
    70121
     122 
    71123if (fgexec) printf(">>>>> Starting piapp , Executing %s \n", exfc.c_str());
    72124else printf(">>>>> Starting piapp <<<<< \n");
     
    74126              (double)PI_VERSIONNUMBER, (double)skyinit.Version());
    75127
     128char *vcmds;
     129if (fgtmp) {
     130  if (tmpdir[tmpdir.length()-1] != '/') tmpdir += '/';  // Necessaire pour SetSwapPath
     131  string vcmd = "TMPDIR=" + tmpdir;
     132  vcmds = new char[vcmd.length()+1];
     133  strcpy(vcmds, vcmd.c_str());
     134  putenv(vcmds);
     135}
     136
     137// cout << " DBG-TMPDIR= " << getenv("TMPDIR") << endl;
     138
    76139PIStdImgApp * app = new PIStdImgApp(narg, arg);
     140// cout << " DBG-2 " <<  app->ObjMgr()->GetTmpDir() << endl;
     141if (fgtmp) {  // Changement de tmpdir
     142  cout << "  NamedObjMgr::SetTmpDir()+XNTuple::SetSwapPath() " << tmpdir << endl;
     143  app->ObjMgr()->SetTmpDir(tmpdir);
     144  XNTuple::SetSwapPath(const_cast<char *>(tmpdir.c_str()));
     145}
     146
    77147
    78148// Gestion de redirection stdout/err et Signaux
     
    160230sopiamodule_end();
    161231delete app;
     232if (fgtmp) delete[] vcmds;
    162233
    163234cout << "\n------------------------------------------------ \n"
Note: See TracChangeset for help on using the changeset viewer.