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()
74 void MainTracker::AddTracker(Tracker *t)
81 void MainTracker::AppendValues(
const long nb)
83 for(std::set<Tracker*>::iterator pos=mvpTracker.begin(); pos!=mvpTracker.end();++pos)
84 (*pos)->AppendValue(nb);
90 std::set<Tracker*>::iterator pos;
91 for(pos=mvpTracker.begin();pos!=mvpTracker.end();++pos)
delete *pos;
99 std::set<Tracker*>::iterator pos;
100 for(pos=mvpTracker.begin();pos!=mvpTracker.end();++pos) (*pos)->Clear();
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
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()
We need to record exactly when refinable objects have been modified for the last time (to avoid re-co...
void Clear()
Removes all stored values.
void UpdateDisplay() const
Update display, if any.
RefinableObjClock mClockTrackerList
Last time a tracker was added.
void Click()
Record an event for this clock (generally, the 'time' an object has been modified, or some computation has been made)
void ClearValues()
Removes all stored values.
const RefinableObjClock & GetClockValues() const
Get last time values were whanged.
const RefinableObjClock & GetClockTrackerList() const
Get last time a tracker was added.
void ClearTrackers()
Removes all Trackers.
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
void SaveAll(std::ostream &out) const
Will save to a single file if all recorded trial numbers are the same Otherwise ? ...
RefinableObjClock mClockValues
Last time values were whanged.