Changeset 2945 in Sophya for trunk/SophyaPI/ProgPI/piapp.cc


Ignore:
Timestamp:
Apr 26, 2006, 5:53:18 PM (19 years ago)
Author:
ansari
Message:

1/ Ajout classe de lecture sur stdin (terminal) avec thread separe pour
piapp - incluant la possibilite d'utilisation de la librairie GNU readline
(fichiers piacmdrdr.cc piacmdrdr.h + fichier makfile specifique makefile_wgrdl

pour compil+link avec GNU readline)

2/ MAJ Makefile et modif programme principal piapp.cc avec flag -small
et activation thread de lecture sur terminal

Reza , 26/04/2006

File:
1 edited

Legend:

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

    r2810 r2945  
    77#include "pistdimgapp.h"
    88#include "piacmd.h"
     9#include "piacmdrdr.h"
    910#include "piversion.h"
    1011#include "piaversion.h"
     
    4849  \verbatim
    4950  csh> spiapp -h
    50  SophyaInitiator::SophyaInitiator() BaseTools Init
    51  PIOPersist::Initialize() Starting Sophya Persistence management service
    52 SOPHYA Version  1.9 Revision 0 (V_Mai2005) -- Jun  9 2005 22:01:01
    53 gcc 3.3-fast 20030304 (Apple Computer, Inc. build 1614)
     51 PIOPersist::Initialize() Starting Sophya Persistence management service
     52SOPHYA Version  2.0 Revision 0 (V_Mai2006) -- Apr 26 2006 17:17:22 cxx
    5453
    5554 piapp: Interactive data analysis and visualisation program
    5655 Usage: piapp [-nored] [-nosig] [-nosigfpe] [-nosigsegv] [-hidezswin]
    57               [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]]
    58   -nored : NoRedirect StdOut/StdErr
     56              [-small] [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]]
     57  -nored : Don't redirect stdout/stderr to piapp console
    5958  -nosig : Don't catch SigFPE, SigSEGV
    6059  -nosigfpe -nosigsegv: Don t catch SigFPE / SigSEGV
     60  -small : Create small size main piapp window
    6161  -hidezswin : Hide Zoom/Stat/ColMap window
    6262  -tmpdir TmpDirectory: defines TMDIR for temporary files
    6363  -help2tex: Create a LaTeX help file (piahelp.tex)
    6464  -exec file [args] : Execute command file
    65  
     65
    6666  \endverbatim
    6767 
     
    7777    cout << "\n piapp: Interactive data analysis and visualisation program \n"
    7878         << " Usage: piapp [-nored] [-nosig] [-nosigfpe] [-nosigsegv] [-hidezswin] \n"
    79          << "              [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]] \n"
    80          << "  -nored : NoRedirect StdOut/StdErr \n"
     79         << "              [-small] [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]] \n"
     80         << "  -nored : Don't redirect stdout/stderr to piapp console\n"
    8181         << "  -nosig : Don't catch SigFPE, SigSEGV \n"
    8282         << "  -nosigfpe -nosigsegv: Don t catch SigFPE / SigSEGV \n"
     83         << "  -small : Create small size main piapp window \n"
    8384         << "  -hidezswin : Hide Zoom/Stat/ColMap window \n"
    8485         << "  -tmpdir TmpDirectory: defines TMDIR for temporary files \n"
     
    9596{
    9697int ofa;
    97 bool fgfpe, fgsegv, fgred, fghidezsw, fgexec;
     98bool fgfpe, fgsegv, fgred, fghidezsw, fgexec, fgsmall;
    9899
    99100SkyTInitiator skyinit;
     
    109110fgexec = false;
    110111bool fgtmp = false;
     112fgsmall = false;
    111113string tmpdir;
    112114string exfc;
     
    119121  else if (strcmp(arg[ka],"-nosigfpe") == 0)   fgfpe=false;
    120122  else if (strcmp(arg[ka],"-nosigsegv") == 0)   fgsegv=false;
     123  else if (strcmp(arg[ka],"-small") == 0)     fgsmall=true;
    121124  else if (strcmp(arg[ka],"-hidezswin") == 0)   fghidezsw=true;
    122125  else if (strcmp(arg[ka],"-help2tex") == 0) { fgtexh=true; fgred=false; }
     
    176179// cout << " DBG-TMPDIR= " << getenv("TMPDIR") << endl;
    177180
    178 PIStdImgApp * app = new PIStdImgApp(narg, arg);
     181PIStdImgApp * app = new PIStdImgApp(fgsmall, narg, arg);
    179182// cout << " DBG-2 " <<  app->ObjMgr()->GetTmpDir() << endl;
    180183cout << "  NamedObjMgr::SetTmpDir()+XNTuple::SetSwapPath() " << tmpdir << endl;
     
    213216  exit(0);
    214217}
     218
     219// Creation du lecteur de commande sur terminal (avec GNU readline)
     220PIACmdReader cmdrdr(app);
     221cmdrdr.start();
    215222
    216223int rc = 0;
     
    277284
    278285app->RedirectStdOutErr(false); 
     286cmdrdr.cancel();
     287
    279288// On de-charge le module sopiamodule et fitsbtadapter
    280289sopiamodule_end();
Note: See TracChangeset for help on using the changeset viewer.