22 #include "ObjCryst/RefinableObj/Tracker.h"
33 Tracker::Tracker(
const string &name)
40 const string& Tracker::GetName()
const{
return mName;}
41 void Tracker::AppendValue(
const long n)
42 {mvValues[n]=this->ReadValue();}
49 const std::map<long,REAL>& Tracker::GetValues()
const{
return mvValues;}
50 std::map<long,REAL>& Tracker::GetValues(){
return mvValues;}
60 MainTracker::MainTracker()
67 MainTracker::~MainTracker()
72 this->ClearTrackers();
74 void MainTracker::AddTracker(Tracker *t)
77 mClockTrackerList.Click();
78 this->UpdateDisplay();
81 void MainTracker::AppendValues(
const long nb)
83 for(std::set<Tracker*>::iterator pos=mvpTracker.begin(); pos!=mvpTracker.end();++pos)
84 (*pos)->AppendValue(nb);
88 void MainTracker::ClearTrackers()
90 std::set<Tracker*>::iterator pos;
91 for(pos=mvpTracker.begin();pos!=mvpTracker.end();++pos)
delete *pos;
93 mClockTrackerList.Click();
94 this->UpdateDisplay();
97 void MainTracker::ClearValues()
99 std::set<Tracker*>::iterator pos;
100 for(pos=mvpTracker.begin();pos!=mvpTracker.end();++pos) (*pos)->Clear();
101 mClockValues.Click();
102 this->UpdateDisplay();
105 void MainTracker::SaveAll(std::ostream &os)
const
107 std::set<Tracker*>::const_iterator posT,posT0;
109 for(posT=mvpTracker.begin();posT!=mvpTracker.end();++posT) os<<(*posT)->GetName()<<
" ";
112 posT0=mvpTracker.begin();
113 std::map<long,REAL>::const_iterator pos0,pos;
114 for(pos0=(*posT0)->GetValues().begin();pos0!=(*posT0)->GetValues().end();++pos0)
116 const long k=pos0->first;
118 for(posT=mvpTracker.begin();posT!=mvpTracker.end();posT++)
120 pos=(*posT)->GetValues().find(k);
121 if(pos==(*posT)->GetValues().end()) os << -1.0 <<
" ";
122 else os << pos->second <<
" ";
128 const std::set<Tracker*> &MainTracker::GetTrackerList()
const
133 void MainTracker::UpdateDisplay()
const
136 if(0!=mpWXTrackerGraph)mpWXTrackerGraph->UpdateDisplay();
144 if(0==mpWXTrackerGraph) mpWXTrackerGraph=
new WXTrackerGraph(frame,
this);
145 return mpWXTrackerGraph;
147 WXTrackerGraph* MainTracker::WXGet(){
return mpWXTrackerGraph;}
148 void MainTracker::WXDelete()
150 if(0!=mpWXTrackerGraph)
152 delete mpWXTrackerGraph;
156 void MainTracker::WXNotifyDelete()
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
We need to record exactly when refinable objects have been modified for the last time (to avoid re-co...