Changeset 685 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Dec 13, 1999, 12:19:25 AM (26 years ago)
Author:
ercodmgr
Message:

FileChooser multiples ds PIStdImgApp, Correction Ndisp ds PINTuple, Fenetre NObjMgrWind non bloquant desormais ds piapp - Reza 12/12/99

Location:
trunk/SophyaPI/PIext
Files:
8 edited

Legend:

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

    r594 r685  
    368368list<string>::iterator ii;
    369369for(ii=odel.begin(); ii != odel.end(); ii++)  DelObj(*ii,true);
     370if (myImgApp) 
     371  (myImgApp->ObjMgrW())->UpdateList(did);
    370372}
    371373
     
    466468(*itr).second.nobj++;
    467469
     470if ( (myImgApp != NULL) && (myImgApp->ObjMgrW())->Visible() ) {
     471  string oln = nobj + "  (T= " + typeid(*obj).name() + ")" ;
     472  (myImgApp->ObjMgrW())->AddObjList(did, oln.c_str(), no.oid);
     473  }
    468474if (verbeux) cout << "NamedObjMgr::AddObj()  Object " << nom << " ( " 
    469475     << typeid(*obj).name() << " ) added (Total= " << myObjs->size() << ")" << endl; 
     
    512518itr = myDirs->find(r2);
    513519(*itr).second.nobj++;
     520
     521if ( (myImgApp != NULL) && (myImgApp->ObjMgrW())->Visible() ) {
     522  (myImgApp->ObjMgrW())->DelObjList(dids, no.oid);
     523  string oln = n2 + "  (T= " + typeid(*(no.obj)).name() + ")" ;
     524  (myImgApp->ObjMgrW())->AddObjList(did, oln.c_str(), no.oid);
     525}
    514526if (verbeux)
    515527  cout << "NamedObjMgr::RenameObj() - Object " << nom << " renamed to " << nomnew << endl;
     
    537549{
    538550string n1,r1;
    539 ParseObjectName(nom, r1, n1);
     551int did = ParseObjectName(nom, r1, n1);
    540552nom = '/' + r1 + '/' + n1;
    541553NObjList::iterator it = myObjs->find(nom);
     
    555567if (fgd) delete (*it).second.obj;
    556568
     569if ( (myImgApp != NULL) && (myImgApp->ObjMgrW())->Visible() ) {
     570  int olid = (*it).second.oid;
     571  (myImgApp->ObjMgrW())->DelObjList(did, olid);
     572}
    557573myObjs->erase(it);
    558574(*itr).second.nobj--;
     575
    559576
    560577if (!verbeux) return(true); 
     
    707724if (nobj.length()<1)  nobj = servnobjm->FileName2Name(flnm);
    708725AddObj(ppobj->DataObj(), nobj, true);
     726cout << "NamedObjMgr::ReadObj(...) object " << nobj << " read from file " << endl;
    709727return;
    710728}
     
    12671285{
    12681286if (!myImgApp)  return;
    1269 (myImgApp->ObjMgrW())->ClearHelpList();
     1287(myImgApp->ObjMgrW())->ClearObjList();
    12701288
    12711289NObjList::iterator it; 
     
    12751293  cn = (*it).first.substr(1);
    12761294  cn = cn.substr(cn.find('/')+1) + "  (T= " + typeid(*((*it).second.obj)).name() + ")" ;
    1277   (myImgApp->ObjMgrW())->AddObj(cn.c_str());
     1295  (myImgApp->ObjMgrW())->AddObj(cn.c_str(), (*it).second.oid);
    12781296  }
    12791297}
  • trunk/SophyaPI/PIext/pawexecut.cc

    r562 r685  
    193193  string nameproj = "/autoc/paw_n_plot1D";
    194194  AnyDataObj* mobj = omg.GetObj(nameproj);
    195   if(mobj!=NULL) omg.DelObj(nameproj);
     195  //  if(mobj!=NULL) omg.DelObj(nameproj);  $CHECK$ Reza 12/12/99 - clean auto
    196196  srvo->ProjectH1(nameobj,expx,expwt,expcut,nameproj,dopt,loop);
    197197} else if(nvar==2) { // c'est un plot 2D
     
    368368Histo* h1p = NULL; string nametoplot = "/autoc/h_plot_2d_h1";
    369369AnyDataObj* mobjh1 = omg.GetObj(nametoplot);
    370 if(mobjh1!=NULL) omg.DelObj(nametoplot);
     370// if(mobjh1!=NULL) omg.DelObj(nametoplot);  $CHECK$ Reza 12/12/99 - Ne pas faire - autoclean
    371371
    372372string dopt = ""; if(tokens.size()>=3) dopt = tokens[2];
  • trunk/SophyaPI/PIext/pintuple.cc

    r548 r685  
    162162g->SelMarker(msz, mrk);
    163163
     164PIGrCoord uxmin, uxmax, uymin, uymax;
     165g->GetGrSpace(uxmin, uxmax, uymin, uymax);
     166double xmin2 = uxmin;
     167double ymin2 = uymin;
     168double xmax2 = uxmax;
     169double ymax2 = uymax;
     170
    164171nok = 0; 
    165172xp = yp = xl = yl = 0;
     
    169176  yp = mNT->GetCell(i, yK);
    170177  if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) )  continue;
     178  if ( (xp < xmin2) || (xp > xmax2) || (yp < ymin2) || (yp > ymax2) )  continue;
    171179  if ( (i > 0) && (mLAtt != PI_NotDefLineAtt) )   // On relie les points ...
    172180    g->DrawLine(xl, yl, xp, yp);
  • trunk/SophyaPI/PIext/pisiadw.cc

    r584 r685  
    2323/* --Methode-- */
    2424ObjMgrWind::ObjMgrWind(PIStdImgApp *par)
    25 : PIWindow((PIMsgHandler *)par, "objmgr", PIWK_dialog,
     25: PIWindow((PIMsgHandler *)par, "objmgr", PIWK_normal,
    2626           400, 300, 250, 250)
    2727{
     
    4545int py = spy;
    4646int px = 2*spx+3*bsx;
    47 mBut[0] = new PIButton(this, "SetCurDir", 10, bsx, bsy, px, py);   py += (bsy+spy);
     47mBut[0] = new PIButton(this, "SetCurObj", 10, bsx, bsy, px, py);   py += (bsy+spy);
    4848mBut[1] = new PIButton(this, "Display", 20, bsx, bsy, px, py);   py += (bsy+spy);
    4949mBut[2] = new PIButton(this, "Print",   30, bsx, bsy, px, py);   py += (bsy+spy);
     
    7070void ObjMgrWind::Show()
    7171{
    72 dap->SetBlocked();
     72// dap->SetBlocked();  Ce n'est plus necessaire - Reza 11/12/99
    7373string cdir;
    7474dap->ObjMgr()->GetCurrentDir(cdir);
     
    8080}
    8181
     82
    8283/* --Methode-- */
    8384void ObjMgrWind::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
     
    9596  return;
    9697  }
    97 else if (msg == 10) {
     98/*
     99 else if (msg == 10) {
    98100  string cdir = dirlist->GetValueStr();
    99101  dap->ObjMgr()->SetCurrentDir(cdir);
    100102  return;
    101103  }
     104*/
    102105
    103106string nom = "";
    104 if ( (msg == 20) || (msg == 30) || (msg == 40) || (msg == 50) ) {
    105   string sel = objlist->GetSelectionStr();
     107string sel = "";
     108if ( (msg == 10) || (msg == 20) || (msg == 30) || (msg == 40) || (msg == 50) ) {
     109  sel = objlist->GetSelectionStr();
    106110  //  size_t p = sel.find_first_not_of(" \t");
    107111  //  if (p<0) p = 0;
     
    114118NamedObjMgr* om = dap->ObjMgr();
    115119if (om == NULL)  return;
     120if (sel.length() < 1)  return;
    116121if (nom.length() < 1)  return;
    117122
    118123switch (msg)
    119124  {
     125  case 10:
     126    {
     127    string cmd = "set cobj " + nom ;
     128    cout << " Setting current object ($cobj) to " << nom << endl;
     129    dap->CmdInterpreter()->Interpret(cmd);
     130    }
     131    break;
    120132  case 20:
    121133    om->DisplayObj(nom);
     
    129141  case 50:
    130142    om->DelObj(nom);
    131     objlist->DeleteItemMsg(objlist->GetSelection());
     143    //    objlist->DeleteItemMsg(objlist->GetSelection());
    132144    //    dap->ObjMgr()->UpdateObjMgrWindow(dirlist->GetValue()-30000);
    133145    break;
     
    141153}
    142154
     155/* --Methode-- */
     156void ObjMgrWind::UpdateList(int did)
     157{
     158if (!Visible()) return;
     159if (did != (dirlist->GetValue()-30000) )  return;
     160dap->ObjMgr()->UpdateObjMgrWindow(did);
     161return;
     162}
     163
     164/* --Methode-- */
     165void ObjMgrWind::AddObjList(int did, const char * objn, int oid)
     166{
     167if (!Visible()) return;
     168if (did != (dirlist->GetValue()-30000) )  return;
     169mNitem++;  objlist->AppendItem(objn, oid);
     170}
     171
     172/* --Methode-- */
     173void ObjMgrWind::DelObjList(int did, int oid)
     174{
     175if (!Visible()) return;
     176//DBG printf("DBG-DelObjList %d , %d , (%d) \n", did, dirlist->GetValue()-30000, oid);
     177if (did != (dirlist->GetValue()-30000) )  return;
     178objlist->DeleteItemMsg(oid);
     179}
    143180
    144181/* ........................................................... */
  • trunk/SophyaPI/PIext/pisiadw.h

    r333 r685  
    3434  inline  void  DelDirectory(int did)
    3535                    { dirlist->Menu()->DeleteItemMsg(30000+did); }
    36   inline  void  ClearHelpList()
     36  inline  void  ClearObjList()
    3737                    { mNitem=0; objlist->DeleteAllItems(); }
    38   inline  void  AddObj(const char * objn)
    39                     { mNitem++;  objlist->AppendItem(objn, 100+mNitem); }
     38  inline  void  AddObj(const char * objn, int oid)
     39                    { mNitem++;  objlist->AppendItem(objn, oid); }
     40
     41  virtual void  UpdateList(int did);
     42  virtual void  AddObjList(int did, const char * objn, int oid);
     43  virtual void  DelObjList(int did, int oid);
     44
    4045private:
    4146  PIStdImgApp* dap;
  • trunk/SophyaPI/PIext/pistdimgapp.cc

    r600 r685  
    153153if ( (varenv=getenv("PEIDA_WORK")) != NULL )  strncpy(WorkDir, varenv, 256);
    154154
    155 pfc = new PIFileChooser(this,"FileChooser", 5000);
     155pfc_fits = new PIFileChooser(this,"FITS-FileChooser", 10125);
     156pfc_ppf = new PIFileChooser(this,"PPF-FileChooser", 10135);
     157pfc_ps = new PIFileChooser(this,"PS-FileChooser", 10525);
    156158
    157159mObjmgrw = new ObjMgrWind(this);
     
    217219// PrintPeidaVersion();
    218220
     221pfc_fits->SetPath(ImgDir);
     222pfc_ppf->SetPath(WorkDir);
     223pfc_ps->SetPath(WorkDir);
     224
    219225SetReady();
    220226}
     
    243249delete cmapv;
    244250
    245 delete pfc;
     251delete pfc_fits;
     252delete pfc_ppf;
     253delete pfc_ps;
    246254
    247255delete mCons;
     
    907915
    908916    case 10120 :
    909       pfc->SetPath(ImgDir);
    910       pfc->AcceptNewFile(false);
     917      pfc_fits->AcceptNewFile(false);
    911918      mFCMsg = 10125;
    912       pfc->SetMsg(mFCMsg);
     919      pfc_fits->SetMsg(mFCMsg);
    913920      SetBlocked();
    914       pfc->Show();
     921      pfc_fits->Show();
    915922      break;
    916923
     
    919926      if (data)  {
    920927        string nomobj="";
    921         ObjMgr()->ReadFits(pfc->GetFileName(), nomobj);
     928        ObjMgr()->ReadFits(pfc_fits->GetFileName(), nomobj);
    922929        ObjMgr()->DisplayObj(nomobj, "win");
    923930      }
     
    927934
    928935    case 10130 :
    929       pfc->SetPath(WorkDir);
    930       pfc->AcceptNewFile(false);
     936      pfc_ppf->AcceptNewFile(false);
    931937      mFCMsg = 10135;
    932       pfc->SetMsg(mFCMsg);
     938      pfc_ppf->SetMsg(mFCMsg);
    933939      SetBlocked();
    934       pfc->Show();
     940      pfc_ppf->Show();
    935941      break;
    936942
     
    938944      mFCMsg = 0;
    939945      if (data)  {
    940         PPInMgrW()->SetFile(pfc->GetFileName());
     946        PPInMgrW()->SetFile(pfc_ppf->GetFileName());
    941947        PPInMgrW()->Show();
    942948      }
     
    976982
    977983  case 10220 :
    978      pfc->SetPath(WorkDir);
    979      pfc->AcceptNewFile(true);
     984     pfc_ppf->AcceptNewFile(true);
    980985     mFCMsg = 10225;
    981      pfc->SetMsg(mFCMsg);
     986     pfc_ppf->SetMsg(mFCMsg);
    982987     SetBlocked();
    983      pfc->Show();
     988     pfc_ppf->Show();
    984989     break;
    985990
     
    991996         delete mPpfout; 
    992997       }
    993        name_outppf = pfc->GetFileName();
     998       name_outppf = pfc_ppf->GetFileName();
    994999       mPpfout = NULL;
    9951000       printf("PIStdImg/Info: Opening POutPersist-File %s \n", name_outppf.c_str());
     
    11581163  {
    11591164  case 10501 :
    1160      pfc->SetPath(WorkDir);
    1161      pfc->AcceptNewFile(true);
     1165     pfc_ps->AcceptNewFile(true);
    11621166     mFCMsg = 10525;
    1163      pfc->SetMsg(mFCMsg);
     1167     pfc_ps->SetMsg(mFCMsg);
    11641168     SetBlocked();
    1165      pfc->Show();
     1169     pfc_ps->Show();
    11661170     break;
    11671171
     
    11731177         delete mpsfile; 
    11741178         }
    1175         name_ps = pfc->GetFileName();
     1179        name_ps = pfc_ps->GetFileName();
    11761180        printf("PIStdImg/Info: Opening PS-File %s \n", name_ps.c_str());
    11771181        mpsfile = new PSFile(name_ps.c_str(), PI_Portrait, PI_A4, 2., 2.);
  • trunk/SophyaPI/PIext/pistdimgapp.h

    r558 r685  
    140140    PICMapView* cmapv;
    141141
    142     PIFileChooser * pfc;
     142    PIFileChooser * pfc_fits;   // Pour les fichiers FITS
     143    PIFileChooser * pfc_ppf;    //  Pour les PPF
     144    PIFileChooser * pfc_ps;     // Pour les PostScript
    143145
    144146    PIConsole* mCons;
  • trunk/SophyaPI/PIext/pistlist.cc

    r544 r685  
    106106if (!mStL) return;
    107107
     108PIGrCoord uxmin, uxmax, uymin, uymax;
     109g->GetGrSpace(uxmin, uxmax, uymin, uymax);
     110double xmin2 = uxmin;
     111double ymin2 = uymin;
     112double xmax2 = uxmax;
     113double ymax2 = uymax;
     114
    108115int msz = mMSz;
    109116if (msz < 1) msz = 1;
     
    118125  xp = sti->PosX();   yp = sti->PosY();
    119126  if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) )  continue;
     127  if ( (xp < xmin2) || (xp > xmax2) || (yp < ymin2) || (yp > ymax2) )  continue;
    120128  nok++;
    121129  sz = (int)((log10((double)flx/mF0))/mDLgF*(double)nl2-0.01) + msz;
     
    148156char buff[128];
    149157int ncnt = 0;
    150 sprintf(buff,"PIStarList: NStars \n", mStL->NbStars() );
     158sprintf(buff,"PIStarList: NStars %d \n", mStL->NbStars() );
    151159info += buff;
    152160info += "  Num:   XPos       YPos     Flux      Fond \n";
Note: See TracChangeset for help on using the changeset viewer.