Changeset 1938 in Sophya for trunk/SophyaPI/PIext/basexecut.cc


Ignore:
Timestamp:
Mar 14, 2002, 5:41:09 PM (24 years ago)
Author:
cmv
Message:

npt par defaut pour func funcff cmv 14/3/02

File:
1 edited

Legend:

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

    r1917 r1938  
    476476// >>>>>>>>>>>  Trace de fonctions
    477477else if ( (kw == "func") ) {
    478   if (tokens.size() < 4) { cout << "Usage: func f(x) xmin xmax npt [opt]" << endl; return(0); }
    479   string opt = "";
     478  if(tokens.size()<3) {cout<<"Usage: func f(x) xmin xmax [npt opt]"<<endl; return(0);}
     479  int np = 100;
     480  double xmin=0., xmax=1.;
     481  string opt = "", nom = "";
     482  xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
     483  if (tokens.size() > 3)  np = atoi(tokens[3].c_str());
    480484  if (tokens.size() > 4)  opt = tokens[4];
    481   int np;
    482   double xmin, xmax;
    483   np = 100;
    484   xmin = 0.;  xmax = 1.;
    485   np = atoi(tokens[3].c_str());
    486   xmin = atof(tokens[1].c_str());   xmax = atof(tokens[2].c_str());
    487   string nom = "";
    488485  mObjMgr->GetServiceObj()->PlotFunc(tokens[0], nom, xmin, xmax, np, opt);
    489486  }
    490487else if ( (kw == "funcff") ) {
    491   if (tokens.size() < 5) { cout << "Usage: funcff C-filename f(x)-name xmin xmax npt [opt]" << endl; return(0); }
    492   string opt = "";
    493   if (tokens.size() > 5)  opt = tokens[5];
    494   int np;
    495   double xmin, xmax;
    496   np = 100;
    497   xmin = 0.;  xmax = 1.;
    498   np = atoi(tokens[4].c_str());
    499   xmin = atof(tokens[2].c_str());   xmax = atof(tokens[3].c_str());
    500   string nom = "";
     488  if (tokens.size()<4) {cout<<"Usage: funcff C-filename f(x)-name xmin xmax [npt opt]"<<endl; return(0);}
     489  int np = 100;
     490  double xmin=0., xmax=1.;
     491  string opt = "", nom = "";
     492  xmin = atof(tokens[2].c_str());  xmax = atof(tokens[3].c_str());
     493  if(tokens.size()>4)  np = atoi(tokens[4].c_str());
     494  if(tokens.size()>5)  opt = tokens[5];
    501495  mObjMgr->GetServiceObj()->PlotFuncFrCFile(tokens[0], tokens[1], nom, xmin, xmax, np, opt);
    502496  }
     
    10471041kw = "func";
    10481042usage = "Displays a function y=f(x) (Fills a vector with function values)";
    1049 usage += "\n Usage: func f(x) xmin xmax npt [graphic_attributes]";
     1043usage += "\n Usage: func f(x) xmin xmax [npt graphic_attributes]";
    10501044usage += "\n  Related commands: funcff func2d func2dff "; 
    10511045mpiac->RegisterCommand(kw, usage, this, "Func Plot");
    10521046kw = "funcff";
    10531047usage = "Displays a function y=f(x) from a C-file (Fills a vector with function values)";
    1054 usage += "\n Usage: funcff C-FileName FunctionName xmin xmax npt [graphic_attributes]";
     1048usage += "\n Usage: funcff C-FileName FunctionName xmin xmax [npt graphic_attributes]";
    10551049usage += "\n  Related commands: func func2d func2dff "; 
    10561050mpiac->RegisterCommand(kw, usage, this, "Func Plot");
Note: See TracChangeset for help on using the changeset viewer.