Changeset 2188 in Sophya


Ignore:
Timestamp:
Sep 9, 2002, 6:48:34 PM (23 years ago)
Author:
ansari
Message:

Ajout commande exitpiapp et possibilite de soumettre une commande a executer a PIStdImgApp (pour execution du script specifie au demarrage) - Reza 9/9/2002

Location:
trunk/SophyaPI/PIext
Files:
3 edited

Legend:

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

    r2180 r2188  
    5050{
    5151Services2NObjMgr* srvo = mObjMgr->GetServiceObj();
     52// ----> Sortie d'application
     53if (kw == "exitpiapp") {
     54  mImgApp->Stop();
     55  return(0);
     56}
    5257// >>>>> Chargement de modules
    53 if (kw == "loadmodule") {
     58else if (kw == "loadmodule") {
    5459  if (tokens.size() < 2) { cout << "Usage: loadmodule fnameso modulename" << endl;  return(0); }
    5560  mpiac->LoadModule(tokens[0], tokens[1]);
     
    742747{
    743748string kw, usage;
     749kw = "exitpiapp";
     750usage = "To end the piapp session";
     751mpiac->RegisterCommand(kw, usage, this, "Commands");
    744752kw = "loadmodule";
    745753usage = "To load and initialize modules \n  Usage: loadmodule fnameso modulename";
  • trunk/SophyaPI/PIext/pistdimgapp.cc

    r2165 r2188  
    4747/*    Classe SIA_RU__Periodic : mise a jour periodique de      */
    4848/*    la fenetre Stat/Ressource info                           */
     49/*    + execution de commande soumis de l'exterieur            */
    4950/* ........................................................... */
    5051
     
    7172void SIA_RU__Periodic::DoPeriodic()
    7273{
    73   if (_app) _app->UpdateStatResourceInfo();
     74  if (_app) {
     75    _app->ExecuteExtCommand();
     76    _app->UpdateStatResourceInfo();
     77  }
    7478}
    7579
     
    210214therm_cpu->SetThreshold(0.75, 0.90);
    211215
     216 fg_exc_cmd = false;
    212217UpdateStatResourceInfo();
    213218resupd_periodic = new SIA_RU__Periodic(this);
     
    775780
    776781/* --Methode-- */
     782int PIStdImgApp::ExecuteExtCommand()
     783{
     784if (!fg_exc_cmd) return(0);
     785else {
     786  fg_exc_cmd = false;
     787  return CmdInterpreter()->Interpret(exc_command);
     788  }
     789}
     790
     791/* --Methode-- */
    777792void PIStdImgApp::AddText(string const & txt, double xp, double yp, string const& sop)
    778793{
  • trunk/SophyaPI/PIext/pistdimgapp.h

    r2165 r2188  
    5959                       string title="", int oid=0);
    6060
     61  //  Specification (de l'exterieur) de commande a executer
     62     inline void SubmitCommand(string const& cmd)
     63            { exc_command = cmd;  fg_exc_cmd = true; }
     64  //  Execution de commande soumis de l'exterieur
     65     int  ExecuteExtCommand();
     66     
    6167  //  Fonction d'ajout de texte (provisoire - Aout 99)
    6268     void AddText(string const & txt, double xp, double yp, string const& opt);
     
    202208    ResourceUsage resusg;
    203209    PIPeriodic* resupd_periodic;
     210
     211  // Commande specifie de l'exterieur a executer
     212  // Pris en charge par resupd_periodic
     213    string exc_command;
     214    bool fg_exc_cmd;
    204215};
    205216
Note: See TracChangeset for help on using the changeset viewer.