Changeset 8971 for trunk/MagicSoft/Cosy
- Timestamp:
- 06/17/08 20:12:14 (16 years ago)
- Location:
- trunk/MagicSoft/Cosy
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/Changelog
r8875 r8971 1 1 -*-*- END -*-*- 2 3 2008/06/17 Thomas Bretz 4 5 * tpoint/TPointGui.[h,cc]: 6 - implemented entry fields 7 8 2 9 3 10 2008/02/24 Thomas Bretz (La Palma) -
trunk/MagicSoft/Cosy/tpoint/TPointGui.cc
r8823 r8971 5 5 #include <TGLabel.h> 6 6 #include <TGButton.h> 7 #include <TGTextEntry.h> 7 8 8 9 #include <TView.h> … … 32 33 using namespace std; 33 34 34 TPointGui::TPointGui(const char *fname) : TGMainFrame(gClient->GetRoot(), 750, 435, kHorizontalFrame), fExitLoopOnClose(kFALSE) 35 TPointGui::TPointGui(const char *fname) : TGMainFrame(gClient->GetRoot(), 750, 435, kHorizontalFrame), fExitLoopOnClose(kFALSE), 36 fAzMin(-180), fAzMax(180), fZdMin(0), fZdMax(90), fLimit(0.05) 35 37 { 36 38 fCoordinates.SetOwner(); … … 54 56 AddFrame(grp2, hints1); 55 57 fList->Add(grp2); 58 56 59 57 60 TGLayoutHints *hints4 = new TGLayoutHints(kLHintsExpandX, 5, 5, 3); … … 68 71 69 72 73 74 75 76 77 70 78 TGHorizontalFrame *comp = new TGHorizontalFrame(grp2, 1, 1); 71 79 grp2->AddFrame(comp); … … 132 140 AddLabel(vframe, fBending.GetDescription(i), h); 133 141 142 TGLayoutHints *hints6 = new TGLayoutHints(kLHintsExpandX, 5, 5, 4, 6); 143 fList->Add(hints6); 144 134 145 l = new TGLabel(grp1, "0000000 Data Sets loaded."); 135 grp1->AddFrame(l, hints 5);146 grp1->AddFrame(l, hints6); 136 147 fList->Add(l); 137 148 fLabel.Add(l); … … 139 150 l = new TGLabel(grp1, ""); 140 151 l->SetTextJustify(kTextLeft); 141 grp1->AddFrame(l, hints 5);152 grp1->AddFrame(l, hints6); 142 153 fList->Add(l); 143 154 fLabel.Add(l); … … 145 156 l = new TGLabel(grp1, ""); 146 157 l->SetTextJustify(kTextLeft); 147 grp1->AddFrame(l, hints 5);158 grp1->AddFrame(l, hints6); 148 159 fList->Add(l); 149 160 fLabel.Add(l); … … 151 162 l = new TGLabel(grp1, ""); 152 163 l->SetTextJustify(kTextLeft); 153 grp1->AddFrame(l, hints 5);164 grp1->AddFrame(l, hints6); 154 165 fList->Add(l); 155 166 fLabel.Add(l); 167 168 // ------------------------------------------------------------------ 169 170 TGLayoutHints *hintse1 = new TGLayoutHints(kLHintsExpandX|kLHintsBottom); 171 TGLayoutHints *hintse2 = new TGLayoutHints(kLHintsExpandX, 2, 2); 172 TGLayoutHints *hintse3 = new TGLayoutHints(kLHintsExpandX); 173 TGLayoutHints *hintsl = new TGLayoutHints(kLHintsExpandX, 1, 0, 5); 174 fList->Add(hintse1); 175 fList->Add(hintse2); 176 fList->Add(hintse3); 177 178 TGHorizontalFrame *entries = new TGHorizontalFrame(grp1, 1, 1); 179 grp1->AddFrame(entries, hintse1); 180 fList->Add(entries); 181 182 TGVerticalFrame *v1 = new TGVerticalFrame(entries); 183 TGVerticalFrame *v2 = new TGVerticalFrame(entries); 184 TGVerticalFrame *v3 = new TGVerticalFrame(entries); 185 entries->AddFrame(v1, hintse2); 186 entries->AddFrame(v2, hintse2); 187 entries->AddFrame(v3, hintse2); 188 fList->Add(v1); 189 fList->Add(v2); 190 fList->Add(v3); 191 192 TGLabel *label1 = new TGLabel(v1, "Az min/°"); 193 TGLabel *label2 = new TGLabel(v2, "Az max/°"); 194 TGLabel *label3 = new TGLabel(v3, "Limit/°"); 195 TGLabel *label4 = new TGLabel(v1, "Zd min/°"); 196 TGLabel *label5 = new TGLabel(v2, "Zd max/°"); 197 TGLabel *label6 = new TGLabel(v3, "Limit/°"); 198 label1->SetTextJustify(kTextLeft); 199 label2->SetTextJustify(kTextLeft); 200 label3->SetTextJustify(kTextLeft); 201 label4->SetTextJustify(kTextLeft); 202 label5->SetTextJustify(kTextLeft); 203 label6->SetTextJustify(kTextLeft); 204 fList->Add(label1); 205 fList->Add(label2); 206 fList->Add(label3); 207 fList->Add(label4); 208 fList->Add(label5); 209 fList->Add(label6); 210 211 TGTextEntry *entry1 = new TGTextEntry(v1, Form("%.1f", fAzMin), kIdAzMin); 212 TGTextEntry *entry2 = new TGTextEntry(v2, Form("%.1f", fAzMax), kIdAzMax); 213 TGTextEntry *entry3 = new TGTextEntry(v3, " ", -1); 214 TGTextEntry *entry4 = new TGTextEntry(v1, Form("%.1f", fZdMin), kIdZdMin); 215 TGTextEntry *entry5 = new TGTextEntry(v2, Form("%.1f", fZdMax), kIdZdMax); 216 TGTextEntry *entry6 = new TGTextEntry(v3, Form("%.3f", fLimit), kIdLimit); 217 entry3->SetEnabled(kFALSE); 218 entry1->SetToolTipText("TPoints with a real star located at Az<Az min are ignored in the fit."); 219 entry2->SetToolTipText("TPoints with a real star located at Az>Az max are ignored in the fit."); 220 entry4->SetToolTipText("TPoints with a real star located at Zd<Zd min are ignored in the fit."); 221 entry5->SetToolTipText("TPoints with a real star located at Zd>Zd max are ignored in the fit."); 222 entry6->SetToolTipText("TPoints with an residual after the fit > Limit are output."); 223 entry1->Associate(this); 224 entry2->Associate(this); 225 entry3->Associate(this); 226 entry4->Associate(this); 227 entry5->Associate(this); 228 entry6->Associate(this); 229 v1->AddFrame(label1, hintsl); 230 v1->AddFrame(entry1, hintse3); 231 v1->AddFrame(label4, hintsl); 232 v1->AddFrame(entry4, hintse3); 233 v2->AddFrame(label2, hintsl); 234 v2->AddFrame(entry2, hintse3); 235 v2->AddFrame(label5, hintsl); 236 v2->AddFrame(entry5, hintse3); 237 v3->AddFrame(label3, hintsl); 238 v3->AddFrame(entry3, hintse3); 239 v3->AddFrame(label6, hintsl); 240 v3->AddFrame(entry6, hintse3); 241 fList->Add(entry1); 242 fList->Add(entry2); 243 fList->Add(entry3); 244 fList->Add(entry4); 245 fList->Add(entry5); 246 fList->Add(entry6); 247 248 // ------------------------------------------------------------------ 156 249 157 250 // FIXME: Move this to the rc-file. … … 210 303 TPointStar set = *(TPointStar*)fCoordinates.At(i); 211 304 305 if (set.GetStarZd()<fZdMin || set.GetStarZd()>fZdMax || 306 set.GetStarAz()<fAzMin || set.GetStarAz()>fAzMax) 307 continue; 308 212 309 set.Adjust(bend); 213 310 … … 489 586 "TPoint files", "*.txt", 490 587 "Collection files", "*.col", 588 "Model files", "*.mod", 491 589 "All files", "*", 492 590 NULL, NULL … … 572 670 break; 573 671 672 // if (set.GetRawZd()>60) 673 // continue; 674 574 675 fOriginal.Add(new TPointStar(set)); 575 676 } … … 580 681 581 682 fFileNameStars = fname; 683 } 684 685 Float_t TPointGui::GetFloat(Int_t id) const 686 { 687 return atof(static_cast<TGTextEntry*>(fList->FindWidget(id))->GetText()); 582 688 } 583 689 … … 636 742 } 637 743 return kTRUE; 744 745 case kC_TEXTENTRY: 746 switch (GET_SUBMSG(msg)) 747 { 748 case kTE_TEXTCHANGED: 749 switch (mp1) 750 { 751 case kIdAzMin: 752 fAzMin = GetFloat(kIdAzMin); 753 return kTRUE; 754 case kIdAzMax: 755 fAzMax = GetFloat(kIdAzMax); 756 return kTRUE; 757 case kIdZdMin: 758 fZdMin = GetFloat(kIdZdMin); 759 return kTRUE; 760 case kIdZdMax: 761 fZdMax = GetFloat(kIdZdMax); 762 return kTRUE; 763 case kIdLimit: 764 fLimit = GetFloat(kIdLimit); 765 return kTRUE; 766 } 767 return kTRUE; 768 769 } 770 return kTRUE; 771 638 772 } 639 773 return kTRUE; … … 755 889 b2.SetParameters(par); 756 890 757 gLog << inf << "Sets with Residual exceeding 0.13deg:" << endl;891 gLog << all << endl << "Sets with Residual exceeding " << fLimit << "deg:" << endl; 758 892 759 893 // … … 794 928 grzd.SetPointError(i, 0, err); 795 929 796 if (resi> 0.13)//orig.GetStarAz()>0 && orig.GetStarAz()<50 && set0.GetDZd()<-0.032 && orig.GetStarEl()<80) // 0.13797 gLog << inf<< " " << orig << " <" << resi << ">" << endl;930 if (resi>fLimit) // 0.13 931 gLog << all << " " << orig << " <" << resi << ">" << endl; 798 932 799 933 proaz.Fill(za.Az(), set0.GetResidual(&err)); … … 811 945 } 812 946 } 947 948 gLog << "done." << endl << endl; 813 949 814 950 // -
trunk/MagicSoft/Cosy/tpoint/TPointGui.h
r8823 r8971 27 27 kTbReset, 28 28 kTbResetStars, 29 kTbReloadStars 29 kTbReloadStars, 30 31 kIdAzMin, 32 kIdAzMax, 33 kIdZdMin, 34 kIdZdMax, 35 kIdLimit, 30 36 }; 31 37 … … 43 49 44 50 Bool_t fExitLoopOnClose; 51 52 Float_t fAzMin; 53 Float_t fAzMax; 54 Float_t fZdMin; 55 Float_t fZdMax; 56 57 Float_t fLimit; 45 58 46 59 void Fcn(Int_t &/*npar*/, Double_t */*gin*/, Double_t &f, Double_t *par, Int_t /*iflag*/); … … 70 83 void Fit(Double_t &before, Double_t &after, Double_t &backw); 71 84 85 Float_t GetFloat(Int_t id) const; 86 72 87 public: 73 88 TPointGui(const char *fname=NULL);
Note:
See TracChangeset
for help on using the changeset viewer.