Index: trunk/SophyaPI/PIext/basexecut.cc
===================================================================
--- trunk/SophyaPI/PIext/basexecut.cc	(revision 2263)
+++ trunk/SophyaPI/PIext/basexecut.cc	(revision 2265)
@@ -117,9 +117,9 @@
   double ymax = atof(tokens[3].c_str());
   char buff[128];
-  sprintf(buff, "axesnone xylimits=%g,%g,%g,%g", xmin, xmax, ymin, ymax);
+  sprintf(buff, "axesnone xylimits=%g,%g,%g,%g ", xmin, xmax, ymin, ymax);
   string sop = buff;
   if (tokens.size() > 4) sop += tokens[4];
   string name;
-  if (tokens.size() > 5) sop += tokens[5];
+  if (tokens.size() > 5) name = tokens[5];
   PIFuncDrawer* gdr = new PIFuncDrawer(NULL);
   mImgApp->DispScDrawer(gdr, name, sop); 
@@ -185,4 +185,20 @@
   bool fgfill = (kw == "addcirc") ? false : true;
   mImgApp->AddCircle(xc, yc, rad, sop, fgfill, fgnc);
+  }
+else if ((kw == "addarca") || (kw == "addfarca")) {
+  if (tokens.size() < 5) { 
+    cout << "Usage: addarca/addfarca xc yc r a da [colatt] [fgnc]" << endl;  
+    return(0); 
+  }
+  double xc = atof(tokens[0].c_str());
+  double yc = atof(tokens[1].c_str());
+  double rad = atof(tokens[2].c_str());
+  double ang = atof(tokens[3].c_str());
+  double dang = atof(tokens[4].c_str());
+  string sop;
+  if (tokens.size() > 5) sop = tokens[5];
+  bool fgnc = _CkBoolNC_(6);  
+  bool fgfill = (kw == "addarca") ? false : true;
+  mImgApp->AddArc(xc, yc, rad, ang, dang, sop, fgfill, fgnc);
   }
 else if (kw == "addmarker") {
@@ -1001,5 +1017,5 @@
 usage += "\n at the specified position (+ color/font/pos/dir attributes) ";
 usage += "\n The Base/AxesDrawer is used to handle added text strings" ;
-usage += "\n Alt<Z> to remove added elements";
+usage += "\n Alt<E> to remove the added element";
 usage += "\n  Usage: addtext x y TextString [ColFontPosAtt] [fgnc=false/true]";
 usage += "\n  (use quotes '' for multi word text strings) ";
@@ -1011,5 +1027,5 @@
 usage += "\n  Related commands: addctext addline addarrow addrect addfrect";
 usage += "\n      addcirc addfcirc addarc addfrac addpoly addfpoly settitle graphicatt";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
 
 kw = "addctext";
@@ -1020,5 +1036,5 @@
 usage += "\n  Related commands: addtext addline addrect ...";
 usage += "\n      (See command addtext and graphicatt for more details)";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
 
 kw = "addline";
@@ -1026,10 +1042,10 @@
 usage += "\n at the specified position (+ graphic attribute)";
 usage += "\n The Base/AxesDrawer is used to handle added lines"; 
-usage += "\n Alt<Z> to remove added elements";
+usage += "\n Alt<E> to remove the added element";
 usage += "\n  Usage: addline x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
 usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
 usage += "\n  Related commands: addarrow addtext addrect addfrect ";
 usage += "\n       addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
 
 kw = "addarrow";
@@ -1037,10 +1053,10 @@
 usage += "\n at the specified position (+ graphic attribute)";
 usage += "\n The Base/AxesDrawer is used to handle added lines"; 
-usage += "\n Alt<Z> to remove added elements";
+usage += "\n Alt<E> to remove the added element";
 usage += "\n  Usage: addarrow x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
 usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
 usage += "\n  Related commands: addline addtext addrect addfrect ";
 usage += "\n       addmarker addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
 kw = "addarrow_nc";
 
@@ -1049,10 +1065,10 @@
 usage += "\n between the specified positions (+ graphic attribute)";
 usage += "\n The Base/AxesDrawer is used to handle added rectangle"; 
-usage += "\n Alt<Z> to remove added elements";
+usage += "\n Alt<E> to remove added element";
 usage += "\n  Usage: addrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
 usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
 usage += "\n  Related commands: addtext addline addarrow addfrect";
 usage += "\n       addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
 
 kw = "addfrect";
@@ -1060,10 +1076,10 @@
 usage += "\n between the specified positions (+ graphic attribute)";
 usage += "\n The Base/AxesDrawer is used to handle added rectangle"; 
-usage += "\n Alt<Z> to remove added elements";
+usage += "\n Alt<E> to remove added element";
 usage += "\n  Usage: addfrect x1 y1 x2 y2 [GraphicAtt] [fgnc=false/true]";
 usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
 usage += "\n  Related commands: addtext addline addarrow addrect";
 usage += "\n       addcirc addfcirc addpoly addfpoly graphicatt";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
 
 kw = "addmarker";
@@ -1071,10 +1087,10 @@
 usage += "\n at the specified position (+ graphic attribute)";
 usage += "\n The Base/AxesDrawer is used to handle added circles"; 
-usage += "\n Alt<Z> to remove added elements";
+usage += "\n Alt<E> to remove added element";
 usage += "\n  Usage: addmarker xpos ypos [GraphicAtt] [fgnc=false/true]";
 usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
 usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
 usage += "\n       addcirc addfcirc addarc addfarc addpoly addfpoly graphicatt";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
 
 kw = "addcirc";
@@ -1082,10 +1098,10 @@
 usage += "\n with the specified center and radius (+ graphic attribute)";
 usage += "\n The Base/AxesDrawer is used to handle added circles"; 
-usage += "\n Alt<Z> to remove added elements";
+usage += "\n Alt<E> to remove added element";
 usage += "\n  Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]";
 usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
 usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
 usage += "\n       addfcirc addarc addfarc addpoly addfpoly graphicatt";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
 
 kw = "addfcirc";
@@ -1093,10 +1109,28 @@
 usage += "\n with the specified center and radius (+ graphic attribute)";
 usage += "\n The Base/AxesDrawer is used to handle added circles"; 
-usage += "\n Alt<Z> to remove added elements";
+usage += "\n Alt<E> to remove added element";
 usage += "\n  Usage: addcirc xcenter ycenter radius [GraphicAtt] [fgnc=false/true]";
 usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
 usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
 usage += "\n       addcirc addarc addfarc addpoly addfpoly graphicatt";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
+
+kw = "addarca";
+usage = "Adds an arc to the current graphic object";
+usage += "\n defined by the circle (center+radius), start angle and angular extension";
+usage += "\n Angles are specified in degrees";
+usage += "\n  Usage: addarca xc yc r a0deg dadeg [GraphicAtt] [fgnc=false/true]";
+usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
+usage += "\n  Related commands: addtext addline addfarca addarc ...";
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
+
+kw = "addfarca";
+usage = "Adds a filled arc to the current graphic object";
+usage += "\n defined by the circle (center+radius), start angle and angular extension";
+usage += "\n Angles are specified in degrees";
+usage += "\n  Usage: addfarca xc yc r a0deg dadeg [GraphicAtt] [fgnc=false/true]";
+usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
+usage += "\n  Related commands: addtext addline addarca addarc ...";
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
 
 kw = "addarc";
@@ -1104,21 +1138,21 @@
 usage += "\n defined by 3 points (+ graphic attribute)";
 usage += "\n The Base/AxesDrawer is used to handle added arcs"; 
-usage += "\n Alt<Z> to remove added elements";
+usage += "\n Alt<E> to remove the added element";
+usage += "\n  Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]";
+usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
+usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
+usage += "\n       addcirc addfcirc addfarc addarca addpoly addfpoly graphicatt";  
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
+
+kw = "addfarc";
+usage = "Adds a filled arc to the current graphic object";
+usage += "\n defined by 3 points (+ graphic attribute)";
+usage += "\n The Base/AxesDrawer is used to handle added arcs"; 
+usage += "\n Alt<E> to remove added element";
 usage += "\n  Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]";
 usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
 usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
 usage += "\n       addcirc addfcirc addfarc addpoly addfpoly graphicatt";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
-
-kw = "addfarc";
-usage = "Adds a filled arc to the current graphic object";
-usage += "\n defined by 3 points (+ graphic attribute)";
-usage += "\n The Base/AxesDrawer is used to handle added arcs"; 
-usage += "\n Alt<Z> to remove added elements";
-usage += "\n  Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt] [fgnc=false/true]";
-usage += "\n  if fgnc==true : Normalized 0..1 coordinates specification (def=false)";
-usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
-usage += "\n       addcirc addfcirc addfarc addpoly addfpoly graphicatt";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
 
 kw = "addpoly";
@@ -1129,5 +1163,5 @@
 usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
 usage += "\n       addcirc addfcirc addfarc  graphicatt";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
 
 kw = "addfpoly";
@@ -1138,5 +1172,5 @@
 usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
 usage += "\n       addcirc addfcirc addfarc  graphicatt";  
-mpiac->RegisterCommand(kw, usage, this, "Graphics");
+mpiac->RegisterCommand(kw, usage, this, "Graphic-Elts");
 
 kw = "settitle";
Index: trunk/SophyaPI/PIext/piacmd.cc
===================================================================
--- trunk/SophyaPI/PIext/piacmd.cc	(revision 2263)
+++ trunk/SophyaPI/PIext/piacmd.cc	(revision 2265)
@@ -1233,4 +1233,28 @@
 } 
 
+int Sum_RPNStack_(stack<double>& s, double& sx, double& sx2, string& line) 
+{
+  sx = sx2 = 0.;
+  int nn = 0;
+  double x = 0.;
+  while( !s.empty() ) {
+    x = s.top(); s.pop();
+    sx += x; sx2 += x*x;
+    nn++;
+  } 
+  return(nn);  
+}
+
+int Product_RPNStack_(stack<double>& s, double& px, string& line) 
+{
+  px = 1.;
+  int nn = 0;
+  double x = 0.;
+  while( !s.empty() ) {
+    x = s.top(); s.pop();
+    px *= x;  nn++;
+  } 
+  return(nn);  
+}
   
 /* --Methode-- */
@@ -1329,4 +1353,32 @@
       if ( Check_myRPNStack_(rpnstack, x, y, line) ) return(1);
       rpnstack.top() = atan2(x,y);
+    }
+    // Fonction a N arguments  - Somme, produit, etc ...
+    else if ((args[k] == "sum") || (args[k] == "mean") || 
+	     (args[k] == "sigma") || (args[k] == "sigma2") ) {
+      double sx, sx2;
+      int nn = Sum_RPNStack_(rpnstack, sx, sx2, line);
+      if (args[k] == "sum") rpnstack.push(sx);
+      else { 
+	if (nn == 0) {
+	  cerr << "PIACmd::EvalRPNExpr: mean/sigma error- RPN stack empty: " 
+	       << line << endl; 
+	  return(1);
+	}
+	double fnn = nn;
+	if (args[k] == "mean")  rpnstack.push(sx/fnn);
+	else if (args[k] == "sigma2") rpnstack.push(sx2/fnn-(x*x/(fnn*fnn)));
+	else rpnstack.push(sqrt(sx2/fnn-(x*x/(fnn*fnn))));
+      }
+    }
+    else if (args[k] == "product") { 
+      double px;
+      int nn = Product_RPNStack_(rpnstack, px, line);
+      if (nn == 0) {
+	cerr << "PIACmd::EvalRPNExpr: product error- RPN stack empty: " 
+	     << line << endl; 
+	return(1);
+      }
+      rpnstack.push(px);
     }
     // Fonctions de manipulation de stack
Index: trunk/SophyaPI/PIext/pistdimgapp.cc
===================================================================
--- trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 2263)
+++ trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 2265)
@@ -933,4 +933,24 @@
 eld->Refresh();
 }
+/* --Methode-- */
+void PIStdImgApp::AddArc(double xc, double yc, double r, double a, double da, 
+			 string const& sop, bool fgfill, bool fgcn)
+{
+PIDrawer *eld=CurrentElDrawer();
+if (eld == NULL) return;
+PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
+PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld);
+if ((eld2 == NULL) && (eld3 == NULL)) return;
+PIElDrwMgr* elmgr = NULL;
+if (eld2) elmgr = &(eld2->ElDrwMgr());
+else if (eld3) elmgr = &(eld3->ElDrwMgr());
+
+vector<string> opts;
+ParseDisplayOption(sop, opts);
+PIGraphicAtt gratt(opts);
+if (fgfill) elmgr->ElAddFArc(xc, yc, r, a, da, gratt, fgcn);
+else elmgr->ElAddArc(xc, yc, r, a, da, gratt, fgcn);
+eld->Refresh();
+}
 
 /* --Methode-- */
Index: trunk/SophyaPI/PIext/pistdimgapp.h
===================================================================
--- trunk/SophyaPI/PIext/pistdimgapp.h	(revision 2263)
+++ trunk/SophyaPI/PIext/pistdimgapp.h	(revision 2265)
@@ -77,4 +77,6 @@
      void AddCircle(double xc, double yc, double r, string const& opt, 
 		    bool fgfill=false, bool fgcn=false);
+     void AddArc(double xc, double yc, double r, double a, double da, 
+		 string const& opt, bool fgfill=false, bool fgcn=false);
      void AddArc(double x1, double y1, double x2, double y2,
 		 double x3, double y3, string const& opt, bool fgfill=false, bool fgcn=false);
