Index: trunk/MagicSoft/Cosy/Changelog
===================================================================
--- trunk/MagicSoft/Cosy/Changelog	(revision 9494)
+++ trunk/MagicSoft/Cosy/Changelog	(revision 9495)
@@ -1,3 +1,14 @@
                                                                   -*-*- END -*-*-
+
+ 2009/08/17 Thomas Bretz
+
+   * tpoint/TPointGui.[h,cc]:
+     - keep different paths in memory for collections and models
+     - show kept collection in window title
+     - added option to set a limiting magnitude for the fit
+     - setup a new default for the coefficients
+     - set new icon and window names
+
+
 
  2009/05/12 Thomas Bretz (La Palma)
Index: trunk/MagicSoft/Cosy/tpoint/TPointGui.cc
===================================================================
--- trunk/MagicSoft/Cosy/tpoint/TPointGui.cc	(revision 9494)
+++ trunk/MagicSoft/Cosy/tpoint/TPointGui.cc	(revision 9495)
@@ -34,5 +34,5 @@
 
 TPointGui::TPointGui(const char *fname, const char *mod) : TGMainFrame(gClient->GetRoot(), 750, 435, kHorizontalFrame), fExitLoopOnClose(kFALSE),
-   fAzMin(-180), fAzMax(180), fZdMin(0), fZdMax(90), fLimit(0.05)
+   fAzMin(-180), fAzMax(180), fZdMin(0), fZdMax(90), fMagMin(0), fLimit(0.05)
 {
     fCoordinates.SetOwner();
@@ -192,5 +192,5 @@
     TGLabel *label1 = new TGLabel(v1, "Az min/°");
     TGLabel *label2 = new TGLabel(v2, "Az max/°");
-    TGLabel *label3 = new TGLabel(v3, "Limit/°");
+    TGLabel *label3 = new TGLabel(v3, "Mag min");
     TGLabel *label4 = new TGLabel(v1, "Zd min/°");
     TGLabel *label5 = new TGLabel(v2, "Zd max/°");
@@ -209,13 +209,13 @@
     fList->Add(label6);
 
-    TGTextEntry *entry1 = new TGTextEntry(v1, Form("%.1f", fAzMin), kIdAzMin);
-    TGTextEntry *entry2 = new TGTextEntry(v2, Form("%.1f", fAzMax), kIdAzMax);
-    TGTextEntry *entry3 = new TGTextEntry(v3, " ", -1);
-    TGTextEntry *entry4 = new TGTextEntry(v1, Form("%.1f", fZdMin), kIdZdMin);
-    TGTextEntry *entry5 = new TGTextEntry(v2, Form("%.1f", fZdMax), kIdZdMax);
-    TGTextEntry *entry6 = new TGTextEntry(v3, Form("%.3f", fLimit), kIdLimit);
-    entry3->SetEnabled(kFALSE);
+    TGTextEntry *entry1 = new TGTextEntry(v1, Form("%.1f", fAzMin),  kIdAzMin);
+    TGTextEntry *entry2 = new TGTextEntry(v2, Form("%.1f", fAzMax),  kIdAzMax);
+    TGTextEntry *entry3 = new TGTextEntry(v3, Form("%.1f", fMagMin), kIdMagMin);
+    TGTextEntry *entry4 = new TGTextEntry(v1, Form("%.1f", fZdMin),  kIdZdMin);
+    TGTextEntry *entry5 = new TGTextEntry(v2, Form("%.1f", fZdMax),  kIdZdMax);
+    TGTextEntry *entry6 = new TGTextEntry(v3, Form("%.3f", fLimit),  kIdLimit);
     entry1->SetToolTipText("TPoints with a real star located at Az<Az min are ignored in the fit.");
     entry2->SetToolTipText("TPoints with a real star located at Az>Az max are ignored in the fit.");
+    entry2->SetToolTipText("TPoints with a artifiical magnitude Mag<Mag min are ignored in the fit.");
     entry4->SetToolTipText("TPoints with a real star located at Zd<Zd min are ignored in the fit.");
     entry5->SetToolTipText("TPoints with a real star located at Zd>Zd max are ignored in the fit.");
@@ -251,7 +251,10 @@
     ((TGCheckButton*)fList->FindWidget(0))->SetState(kButtonDown);
     ((TGCheckButton*)fList->FindWidget(1))->SetState(kButtonDown);
+    ((TGCheckButton*)fList->FindWidget(5))->SetState(kButtonDown);
     ((TGCheckButton*)fList->FindWidget(6))->SetState(kButtonDown);
-    ((TGCheckButton*)fList->FindWidget(10))->SetState(kButtonDown);
-    ((TGCheckButton*)fList->FindWidget(12))->SetState(kButtonDown);
+    ((TGCheckButton*)fList->FindWidget(9))->SetState(kButtonDown);
+    ((TGCheckButton*)fList->FindWidget(11))->SetState(kButtonDown);
+    ((TGCheckButton*)fList->FindWidget(15))->SetState(kButtonDown);
+    ((TGCheckButton*)fList->FindWidget(16))->SetState(kButtonDown);
     ((TGCheckButton*)fList->FindWidget(17))->SetState(kButtonDown);
 
@@ -266,6 +269,6 @@
     ((TGCheckButton*)fList->FindWidget(22+2*MPointing::GetNumPar()))->SetState(kButtonDisabled);
 
-    SetWindowName("TPoint Fitting Window");
-    SetIconName("TPoint++");
+    SetWindowName("Telesto");
+    SetIconName("Telesto");
 
     Layout();
@@ -306,5 +309,6 @@
 
         if (set.GetStarZd()<fZdMin || set.GetStarZd()>fZdMax ||
-            set.GetStarAz()<fAzMin || set.GetStarAz()>fAzMax)
+            set.GetStarAz()<fAzMin || set.GetStarAz()>fAzMax ||
+            set.GetMag()   <fMagMin)
             continue;
 
@@ -582,5 +586,5 @@
 }
 
-TString TPointGui::OpenDialog(EFileDialogMode mode)
+TString TPointGui::OpenDialog(TString &dir, EFileDialogMode mode)
 {
     static const char *gOpenTypes[] =
@@ -593,5 +597,5 @@
     };
 
-    static TString dir("tpoint/");
+    //static TString dir("tpoint/");
 
     TGFileInfo fi; // fFileName and fIniDir deleted in ~TGFileInfo
@@ -648,4 +652,5 @@
         LoadCollection(fname);
         fFileNameStars = fname;
+        SetWindowName(Form("Telesto (%s)", fFileNameStars.Data()));
         return;
     }
@@ -683,4 +688,5 @@
 
     fFileNameStars = fname;
+    SetWindowName(Form("Telesto (%s)", fFileNameStars.Data()));
 }
 
@@ -694,4 +700,8 @@
     // cout << "Msg: " << hex << GET_MSG(msg) << endl;
     // cout << "SubMsg: " << hex << GET_SUBMSG(msg) << dec << endl;
+
+    static TString dirmod("tpoint/");
+    static TString dircol("tpoint/");
+
     switch (GET_MSG(msg))
     {
@@ -713,12 +723,12 @@
                 return kTRUE;
             case kTbLoad:
-                fBending.Load(OpenDialog());
+                fBending.Load(OpenDialog(dirmod));
                 DisplayBending();
                 return kTRUE;
             case kTbSave:
-                fBending.Save(OpenDialog(kFDSave));
+                fBending.Save(OpenDialog(dirmod, kFDSave));
                 return kTRUE;
             case kTbLoadStars:
-                LoadStars(OpenDialog());
+                LoadStars(OpenDialog(dircol));
                 DisplayData();
                 return kTRUE;
@@ -762,4 +772,7 @@
             case kIdZdMax:
                 fZdMax = GetFloat(kIdZdMax);
+                return kTRUE;
+            case kIdMagMin:
+                fMagMin = GetFloat(kIdMagMin);
                 return kTRUE;
             case kIdLimit:
Index: trunk/MagicSoft/Cosy/tpoint/TPointGui.h
===================================================================
--- trunk/MagicSoft/Cosy/tpoint/TPointGui.h	(revision 9494)
+++ trunk/MagicSoft/Cosy/tpoint/TPointGui.h	(revision 9495)
@@ -33,4 +33,5 @@
         kIdZdMin,
         kIdZdMax,
+        kIdMagMin,
         kIdLimit,
     };
@@ -54,4 +55,5 @@
     Float_t fZdMin;
     Float_t fZdMax;
+    Float_t fMagMin;
 
     Float_t fLimit;
@@ -74,5 +76,5 @@
     void DrawHorizon(TVirtualPad *pad, const char *fname="horizon.dat") const;
 
-    TString OpenDialog(EFileDialogMode mode=kFDOpen);
+    TString OpenDialog(TString &dir, EFileDialogMode mode=kFDOpen);
 
     void LoadCollection(TString fname);
Index: trunk/MagicSoft/Cosy/tpoint/bending090817_m1.mod
===================================================================
--- trunk/MagicSoft/Cosy/tpoint/bending090817_m1.mod	(revision 9495)
+++ trunk/MagicSoft/Cosy/tpoint/bending090817_m1.mod	(revision 9495)
@@ -0,0 +1,28 @@
+MAGIC1 17.08.2009 11:15:33.160
+S   00   000000   000000  0000000
+     IA    0.12429309    0.13301784
+     IE    0.23696519    0.18882972
+   FLOP             0             0
+     AN             0             0
+     AW             0             0
+   NPAE -0.0034428541     0.1686113
+     CA  0.0025550584    0.20141901
+     TF             0             0
+     TX             0             0
+   ECES  -0.019507125    0.15798758
+   ACES             0             0
+   ECEC  -0.038765865    0.12539916
+   ACEC             0             0
+    NRX             0             0
+    NRY             0             0
+    CRX  0.0036401265   0.012820151
+    CRY 0.00039034693   0.011615058
+ MAGIC1  -0.016622635    0.01379485
+ MAGIC2             0             0
+     PX             0             0
+     PY             0             0
+     DX             0             0
+     DY             0             0
+END
+
+# done from tpoints20090802_m1.col (Mag>0.7)
Index: trunk/MagicSoft/Cosy/tpoint/bending090817_m2.mod
===================================================================
--- trunk/MagicSoft/Cosy/tpoint/bending090817_m2.mod	(revision 9495)
+++ trunk/MagicSoft/Cosy/tpoint/bending090817_m2.mod	(revision 9495)
@@ -0,0 +1,28 @@
+MAGIC1 17.08.2009 10:51:35.346
+S   00   000000   000000  0000000
+     IA -0.0099760523    0.15235687
+     IE  -0.041884547    0.23893159
+   FLOP             0             0
+     AN             0             0
+     AW   0.002351269   0.020374144
+   NPAE 0.00073107911    0.18007962
+     CA  -0.012988737    0.22356307
+     TF             0             0
+     TX             0             0
+   ECES  0.0095746679     0.1912064
+   ACES             0             0
+   ECEC   -0.02319238    0.16395297
+   ACEC             0             0
+    NRX             0             0
+    NRY             0             0
+    CRX  0.0076695166   0.012865118
+    CRY  0.0027777622    0.01340962
+ MAGIC1  -0.013164675   0.023391056
+ MAGIC2             0             0
+     PX             0             0
+     PY             0             0
+     DX             0             0
+     DY             0             0
+END
+
+# done from tpoints20090611_m2.col
