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


Ignore:
Timestamp:
Jul 2, 2006, 7:20:56 PM (19 years ago)
Author:
ansari
Message:

1/ Ajout methode Services2NObjMgr::DisplayPoints3DW() et commande plot3dw
2/ Ajout et utilisation methode de verification de nom NamedObjMgr::CheckName()
3/ Changement methode NObjMgrAdapter::GetInfoString() et son utilisation
a travers la methdoe PIACmd::GetVarApp() pour acces de type $objname
4/ Ajout methode NObjMgrAdapter::PerformOperation() , implemente pour
adaptateur TMatrix<T> et TArray<T> pour extraction de ligne/colonne
(des matrices) et plan (slice) des TArray pour Rank()>3 Et mise en place
de la commande objaoper pour appel a PerformOperation()
5/ Petites corrections pour ntline2var vec2var

Reza 2 Juillet 2006

File:
1 edited

Legend:

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

    r2975 r2999  
    444444  }
    445445 
    446   mObjMgr->SetVar(tokens[1], v2str);
     446  mpiac->SetVar(tokens[1], v2str);
    447447}
    448448// Une ligne du NTuple/NTupleInterface -> variable interpreteur
     
    509509    }
    510510  }
    511   mObjMgr->SetVar(tokens[2], v2str);
     511  mpiac->SetVar(tokens[2], v2str);
    512512  if (adel) delete nti;
     513}
     514// Operation sur objets a travers l'adaptateur NObjMgrAdapter::PerformOperation()
     515else if (kw == "objaoper") {
     516  if (tokens.size() < 2) {
     517    cout << "Usage: objaoper objname operation [args ...]" << endl;
     518    return(0);
     519  }
     520  NObjMgrAdapter* oa = mObjMgr->GetObjAdapter(tokens[0]);
     521  if(oa == NULL) {
     522    cerr << "objaoper Error , No such object " << tokens[0] << endl;
     523    return(0);
     524  }
     525  tokens.erase(tokens.begin());
     526  return oa->PerformOperation(tokens);
    513527}
    514528
     
    626640  srvo->DisplayPoints3D(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]);
    627641  }
     642else if (kw == "plot3dw" ) { 
     643  if (tokens.size() < 5) {
     644    cout << "Usage: plot3dw nomobj expx expy expz expwt [expcut opt loop_par]" << endl;
     645    return(0);
     646    }
     647  if (tokens.size() < 6) tokens.push_back("1");
     648  while (tokens.size() < 8) tokens.push_back("");
     649  srvo->DisplayPoints3DW(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5],
     650                         tokens[6], tokens[7]);
     651}
    628652
    629653else if (kw == "projh1d" ) {
     
    10861110usage += "  Related commands: vec2var ntline2var"; 
    10871111mpiac->RegisterCommand(kw, usage, this, "Objects");
     1112kw = "objaoper";
     1113usage = "Perform an operation through the object adapter NObjMgrAdapter::PerformOperation()\n";
     1114usage += "  Usage: objaoper objname operation [arg1 ...] \n";
     1115usage += "  Examples of defined operations : \n";
     1116usage += "  Matrices: row indx_row , col indx_col \n"; 
     1117usage += "  Arrays: slicexy indx_Z , slicexz indx_Y, sliceyz indxX \n"; 
     1118mpiac->RegisterCommand(kw, usage, this, "Objects");
    10881119
    10891120//------- Commandes trace de fonctions
     
    11321163usage += "\nLoop parameters can be specified as I1[:I2[:DI]] for(int i=I1; i<I2; i+=DI)";
    11331164usage += "\nThe default Cut() expression in true (=1) for all";
    1134 usage += "\n\n  Related commands: plot2d plot2de plot2dw plot3d ";
    1135 usage += "\n        projh1d projh2d  projprof fillvec fillmtx ";
    1136 usage += "\n        fillnt fillgd1 fillgd2 ntloop exptovec ... ";
     1165usage += "\n\n Related commands: plot2d plot2de plot2dw plot3d plot3dw";
     1166usage += "\n         projh1d projh2d  projprof fillvec fillmtx ";
     1167usage += "\n         fillnt fillgd1 fillgd2 ntloop exptovec ... ";
    11371168grp = "Expr. Plotting";
    11381169mpiac->RegisterHelp(kw, usage, grp);
     
    11401171usage = "Plots (2D) Y=g(Object) vs. X=f(Object) --- Object Variable names (double) :";
    11411172usage += "\n Usage: plot2d nameobj f_X() g_Y() [f_Cut() graphic_attributes loop_param]";
    1142 usage += "\n  Related commands: plot2de plot2dw plot3d ObjectExpressions ...";
     1173usage += "\n  Related commands: plot2de plot2dw plot3d plot3dw ObjectExpressions ...";
    11431174mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    11441175kw = "plot2de";
     
    11531184mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    11541185kw = "plot3d";
    1155 usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) vs ";
     1186usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object)";
    11561187usage += "\n Usage: plot3d nameobj f_X() g_Y() h_Z() [Cut() graphic_attributes loop_param]";
    1157 usage += "\n  Related commands: plot2d plot2dw plot2de plot3d ObjectExpressions ...";
     1188usage += "\n  Related commands: plot2d plot2de plot3dw ObjectExpressions ...";
     1189mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
     1190kw = "plot3dw";
     1191usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) with Weight W=k(Object)  ";
     1192usage += "\n Usage: plot3d nameobj f_X() g_Y() h_Z() k_Wt() [Cut() graphic_attributes loop_param]";
     1193usage += "\n  Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
    11581194mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    11591195
Note: See TracChangeset for help on using the changeset viewer.