Changeset 2536 in Sophya for trunk/SophyaPI/PIext


Ignore:
Timestamp:
May 13, 2004, 1:54:02 PM (21 years ago)
Author:
ansari
Message:

Correction bug ds PIACmd : remplacement stack<string> par queue<string> pour empilement de commandes soumises a l'interpreteur et ajout commande bargraph pour drawer PIBarGraph - Reza 13 Mai 2004

Location:
trunk/SophyaPI/PIext
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/basexecut.cc

    r2521 r2536  
    1616#include "nomgadapter.h"
    1717#include "piyfxdrw.h"
     18#include "pibargraph.h"
    1819
    1920#include "histos.h"
     
    739740  while (tokens.size() < 3) tokens.push_back("");
    740741  mObjMgr->DisplayVector(tokens[0], tokens[1], tokens[2]);
     742}
     743else if (kw == "bargraph") {
     744  if (tokens.size() < 2) {
     745    cout << "Usage: bargraph gr_opt v1 [v2 ...]" << endl;
     746    return(0);
     747  }
     748  PIBarGraph* bgd = new PIBarGraph;
     749  for(int k=1; k<tokens.size(); k++)
     750    bgd->AddBar(atof(tokens[k].c_str()));
     751  string grname = "BarGraph";
     752  mImgApp->DispScDrawer(bgd, grname, tokens[0]);
    741753}
    742754
     
    16041616usage += "\n  Related commands: disp nt2d "; 
    16051617mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
     1618kw = "bargraph";
     1619usage = "Bar-Graph view of a sequence of values ";
     1620usage += "\n Usage : bargraph graphic_attributes v1 [v2 v3 ...] ";
     1621usage += "\n  Related commands: disp nt2d vecplot"; 
     1622mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
    16061623
    16071624// Ceci est maintenant obsolete, on garde pour info.
  • trunk/SophyaPI/PIext/piacmd.cc

    r2494 r2536  
    203203{
    204204  mutx_inps.lock();
    205   inputlines.push(line);
     205  inputlines.push(line);   // Ajout d'un element en fin de queue
    206206  mutx_inps.unlock();
    207207  mutx_inps.broadcast();
     
    224224      mutx_inps.wait();
    225225    }
    226     string line = inputlines.top();
    227     inputlines.pop();
     226    string line = inputlines.front();   // On recupere l'element de tete
     227    inputlines.pop();    // On supprime l'element de tete
    228228    fg_threxe = true;
    229229    mutx_inps.unlock();
  • trunk/SophyaPI/PIext/piacmd.h

    r2490 r2536  
    1111#include <string>
    1212#include <vector>
    13 #include <stack>
     13#include <queue>
    1414#include "zthread.h"
    1515
     
    8787  CxxOptionWind* cxxoptwin;
    8888
    89 // Stack d'entree et controle de thread
    90   stack<string> inputlines;
     89// Queue des entrees et controle de thread
     90  queue<string> inputlines;
    9191  bool fg_thrstop;
    9292  ZMutex mutx_inps;
Note: See TracChangeset for help on using the changeset viewer.