Changeset 685 in Sophya for trunk/SophyaPI
- Timestamp:
- Dec 13, 1999, 12:19:25 AM (26 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nobjmgr.cc
r594 r685 368 368 list<string>::iterator ii; 369 369 for(ii=odel.begin(); ii != odel.end(); ii++) DelObj(*ii,true); 370 if (myImgApp) 371 (myImgApp->ObjMgrW())->UpdateList(did); 370 372 } 371 373 … … 466 468 (*itr).second.nobj++; 467 469 470 if ( (myImgApp != NULL) && (myImgApp->ObjMgrW())->Visible() ) { 471 string oln = nobj + " (T= " + typeid(*obj).name() + ")" ; 472 (myImgApp->ObjMgrW())->AddObjList(did, oln.c_str(), no.oid); 473 } 468 474 if (verbeux) cout << "NamedObjMgr::AddObj() Object " << nom << " ( " 469 475 << typeid(*obj).name() << " ) added (Total= " << myObjs->size() << ")" << endl; … … 512 518 itr = myDirs->find(r2); 513 519 (*itr).second.nobj++; 520 521 if ( (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 } 514 526 if (verbeux) 515 527 cout << "NamedObjMgr::RenameObj() - Object " << nom << " renamed to " << nomnew << endl; … … 537 549 { 538 550 string n1,r1; 539 ParseObjectName(nom, r1, n1);551 int did = ParseObjectName(nom, r1, n1); 540 552 nom = '/' + r1 + '/' + n1; 541 553 NObjList::iterator it = myObjs->find(nom); … … 555 567 if (fgd) delete (*it).second.obj; 556 568 569 if ( (myImgApp != NULL) && (myImgApp->ObjMgrW())->Visible() ) { 570 int olid = (*it).second.oid; 571 (myImgApp->ObjMgrW())->DelObjList(did, olid); 572 } 557 573 myObjs->erase(it); 558 574 (*itr).second.nobj--; 575 559 576 560 577 if (!verbeux) return(true); … … 707 724 if (nobj.length()<1) nobj = servnobjm->FileName2Name(flnm); 708 725 AddObj(ppobj->DataObj(), nobj, true); 726 cout << "NamedObjMgr::ReadObj(...) object " << nobj << " read from file " << endl; 709 727 return; 710 728 } … … 1267 1285 { 1268 1286 if (!myImgApp) return; 1269 (myImgApp->ObjMgrW())->Clear HelpList();1287 (myImgApp->ObjMgrW())->ClearObjList(); 1270 1288 1271 1289 NObjList::iterator it; … … 1275 1293 cn = (*it).first.substr(1); 1276 1294 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); 1278 1296 } 1279 1297 } -
trunk/SophyaPI/PIext/pawexecut.cc
r562 r685 193 193 string nameproj = "/autoc/paw_n_plot1D"; 194 194 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 196 196 srvo->ProjectH1(nameobj,expx,expwt,expcut,nameproj,dopt,loop); 197 197 } else if(nvar==2) { // c'est un plot 2D … … 368 368 Histo* h1p = NULL; string nametoplot = "/autoc/h_plot_2d_h1"; 369 369 AnyDataObj* 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 371 371 372 372 string dopt = ""; if(tokens.size()>=3) dopt = tokens[2]; -
trunk/SophyaPI/PIext/pintuple.cc
r548 r685 162 162 g->SelMarker(msz, mrk); 163 163 164 PIGrCoord uxmin, uxmax, uymin, uymax; 165 g->GetGrSpace(uxmin, uxmax, uymin, uymax); 166 double xmin2 = uxmin; 167 double ymin2 = uymin; 168 double xmax2 = uxmax; 169 double ymax2 = uymax; 170 164 171 nok = 0; 165 172 xp = yp = xl = yl = 0; … … 169 176 yp = mNT->GetCell(i, yK); 170 177 if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) ) continue; 178 if ( (xp < xmin2) || (xp > xmax2) || (yp < ymin2) || (yp > ymax2) ) continue; 171 179 if ( (i > 0) && (mLAtt != PI_NotDefLineAtt) ) // On relie les points ... 172 180 g->DrawLine(xl, yl, xp, yp); -
trunk/SophyaPI/PIext/pisiadw.cc
r584 r685 23 23 /* --Methode-- */ 24 24 ObjMgrWind::ObjMgrWind(PIStdImgApp *par) 25 : PIWindow((PIMsgHandler *)par, "objmgr", PIWK_ dialog,25 : PIWindow((PIMsgHandler *)par, "objmgr", PIWK_normal, 26 26 400, 300, 250, 250) 27 27 { … … 45 45 int py = spy; 46 46 int px = 2*spx+3*bsx; 47 mBut[0] = new PIButton(this, "SetCur Dir", 10, bsx, bsy, px, py); py += (bsy+spy);47 mBut[0] = new PIButton(this, "SetCurObj", 10, bsx, bsy, px, py); py += (bsy+spy); 48 48 mBut[1] = new PIButton(this, "Display", 20, bsx, bsy, px, py); py += (bsy+spy); 49 49 mBut[2] = new PIButton(this, "Print", 30, bsx, bsy, px, py); py += (bsy+spy); … … 70 70 void ObjMgrWind::Show() 71 71 { 72 dap->SetBlocked(); 72 // dap->SetBlocked(); Ce n'est plus necessaire - Reza 11/12/99 73 73 string cdir; 74 74 dap->ObjMgr()->GetCurrentDir(cdir); … … 80 80 } 81 81 82 82 83 /* --Methode-- */ 83 84 void ObjMgrWind::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/) … … 95 96 return; 96 97 } 97 else if (msg == 10) { 98 /* 99 else if (msg == 10) { 98 100 string cdir = dirlist->GetValueStr(); 99 101 dap->ObjMgr()->SetCurrentDir(cdir); 100 102 return; 101 103 } 104 */ 102 105 103 106 string nom = ""; 104 if ( (msg == 20) || (msg == 30) || (msg == 40) || (msg == 50) ) { 105 string sel = objlist->GetSelectionStr(); 107 string sel = ""; 108 if ( (msg == 10) || (msg == 20) || (msg == 30) || (msg == 40) || (msg == 50) ) { 109 sel = objlist->GetSelectionStr(); 106 110 // size_t p = sel.find_first_not_of(" \t"); 107 111 // if (p<0) p = 0; … … 114 118 NamedObjMgr* om = dap->ObjMgr(); 115 119 if (om == NULL) return; 120 if (sel.length() < 1) return; 116 121 if (nom.length() < 1) return; 117 122 118 123 switch (msg) 119 124 { 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; 120 132 case 20: 121 133 om->DisplayObj(nom); … … 129 141 case 50: 130 142 om->DelObj(nom); 131 objlist->DeleteItemMsg(objlist->GetSelection());143 // objlist->DeleteItemMsg(objlist->GetSelection()); 132 144 // dap->ObjMgr()->UpdateObjMgrWindow(dirlist->GetValue()-30000); 133 145 break; … … 141 153 } 142 154 155 /* --Methode-- */ 156 void ObjMgrWind::UpdateList(int did) 157 { 158 if (!Visible()) return; 159 if (did != (dirlist->GetValue()-30000) ) return; 160 dap->ObjMgr()->UpdateObjMgrWindow(did); 161 return; 162 } 163 164 /* --Methode-- */ 165 void ObjMgrWind::AddObjList(int did, const char * objn, int oid) 166 { 167 if (!Visible()) return; 168 if (did != (dirlist->GetValue()-30000) ) return; 169 mNitem++; objlist->AppendItem(objn, oid); 170 } 171 172 /* --Methode-- */ 173 void ObjMgrWind::DelObjList(int did, int oid) 174 { 175 if (!Visible()) return; 176 //DBG printf("DBG-DelObjList %d , %d , (%d) \n", did, dirlist->GetValue()-30000, oid); 177 if (did != (dirlist->GetValue()-30000) ) return; 178 objlist->DeleteItemMsg(oid); 179 } 143 180 144 181 /* ........................................................... */ -
trunk/SophyaPI/PIext/pisiadw.h
r333 r685 34 34 inline void DelDirectory(int did) 35 35 { dirlist->Menu()->DeleteItemMsg(30000+did); } 36 inline void Clear HelpList()36 inline void ClearObjList() 37 37 { 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 40 45 private: 41 46 PIStdImgApp* dap; -
trunk/SophyaPI/PIext/pistdimgapp.cc
r600 r685 153 153 if ( (varenv=getenv("PEIDA_WORK")) != NULL ) strncpy(WorkDir, varenv, 256); 154 154 155 pfc = new PIFileChooser(this,"FileChooser", 5000); 155 pfc_fits = new PIFileChooser(this,"FITS-FileChooser", 10125); 156 pfc_ppf = new PIFileChooser(this,"PPF-FileChooser", 10135); 157 pfc_ps = new PIFileChooser(this,"PS-FileChooser", 10525); 156 158 157 159 mObjmgrw = new ObjMgrWind(this); … … 217 219 // PrintPeidaVersion(); 218 220 221 pfc_fits->SetPath(ImgDir); 222 pfc_ppf->SetPath(WorkDir); 223 pfc_ps->SetPath(WorkDir); 224 219 225 SetReady(); 220 226 } … … 243 249 delete cmapv; 244 250 245 delete pfc; 251 delete pfc_fits; 252 delete pfc_ppf; 253 delete pfc_ps; 246 254 247 255 delete mCons; … … 907 915 908 916 case 10120 : 909 pfc->SetPath(ImgDir); 910 pfc->AcceptNewFile(false); 917 pfc_fits->AcceptNewFile(false); 911 918 mFCMsg = 10125; 912 pfc ->SetMsg(mFCMsg);919 pfc_fits->SetMsg(mFCMsg); 913 920 SetBlocked(); 914 pfc ->Show();921 pfc_fits->Show(); 915 922 break; 916 923 … … 919 926 if (data) { 920 927 string nomobj=""; 921 ObjMgr()->ReadFits(pfc ->GetFileName(), nomobj);928 ObjMgr()->ReadFits(pfc_fits->GetFileName(), nomobj); 922 929 ObjMgr()->DisplayObj(nomobj, "win"); 923 930 } … … 927 934 928 935 case 10130 : 929 pfc->SetPath(WorkDir); 930 pfc->AcceptNewFile(false); 936 pfc_ppf->AcceptNewFile(false); 931 937 mFCMsg = 10135; 932 pfc ->SetMsg(mFCMsg);938 pfc_ppf->SetMsg(mFCMsg); 933 939 SetBlocked(); 934 pfc ->Show();940 pfc_ppf->Show(); 935 941 break; 936 942 … … 938 944 mFCMsg = 0; 939 945 if (data) { 940 PPInMgrW()->SetFile(pfc ->GetFileName());946 PPInMgrW()->SetFile(pfc_ppf->GetFileName()); 941 947 PPInMgrW()->Show(); 942 948 } … … 976 982 977 983 case 10220 : 978 pfc->SetPath(WorkDir); 979 pfc->AcceptNewFile(true); 984 pfc_ppf->AcceptNewFile(true); 980 985 mFCMsg = 10225; 981 pfc ->SetMsg(mFCMsg);986 pfc_ppf->SetMsg(mFCMsg); 982 987 SetBlocked(); 983 pfc ->Show();988 pfc_ppf->Show(); 984 989 break; 985 990 … … 991 996 delete mPpfout; 992 997 } 993 name_outppf = pfc ->GetFileName();998 name_outppf = pfc_ppf->GetFileName(); 994 999 mPpfout = NULL; 995 1000 printf("PIStdImg/Info: Opening POutPersist-File %s \n", name_outppf.c_str()); … … 1158 1163 { 1159 1164 case 10501 : 1160 pfc->SetPath(WorkDir); 1161 pfc->AcceptNewFile(true); 1165 pfc_ps->AcceptNewFile(true); 1162 1166 mFCMsg = 10525; 1163 pfc ->SetMsg(mFCMsg);1167 pfc_ps->SetMsg(mFCMsg); 1164 1168 SetBlocked(); 1165 pfc ->Show();1169 pfc_ps->Show(); 1166 1170 break; 1167 1171 … … 1173 1177 delete mpsfile; 1174 1178 } 1175 name_ps = pfc ->GetFileName();1179 name_ps = pfc_ps->GetFileName(); 1176 1180 printf("PIStdImg/Info: Opening PS-File %s \n", name_ps.c_str()); 1177 1181 mpsfile = new PSFile(name_ps.c_str(), PI_Portrait, PI_A4, 2., 2.); -
trunk/SophyaPI/PIext/pistdimgapp.h
r558 r685 140 140 PICMapView* cmapv; 141 141 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 143 145 144 146 PIConsole* mCons; -
trunk/SophyaPI/PIext/pistlist.cc
r544 r685 106 106 if (!mStL) return; 107 107 108 PIGrCoord uxmin, uxmax, uymin, uymax; 109 g->GetGrSpace(uxmin, uxmax, uymin, uymax); 110 double xmin2 = uxmin; 111 double ymin2 = uymin; 112 double xmax2 = uxmax; 113 double ymax2 = uymax; 114 108 115 int msz = mMSz; 109 116 if (msz < 1) msz = 1; … … 118 125 xp = sti->PosX(); yp = sti->PosY(); 119 126 if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) ) continue; 127 if ( (xp < xmin2) || (xp > xmax2) || (yp < ymin2) || (yp > ymax2) ) continue; 120 128 nok++; 121 129 sz = (int)((log10((double)flx/mF0))/mDLgF*(double)nl2-0.01) + msz; … … 148 156 char buff[128]; 149 157 int ncnt = 0; 150 sprintf(buff,"PIStarList: NStars \n", mStL->NbStars() );158 sprintf(buff,"PIStarList: NStars %d \n", mStL->NbStars() ); 151 159 info += buff; 152 160 info += " Num: XPos YPos Flux Fond \n";
Note:
See TracChangeset
for help on using the changeset viewer.