18 #include "ObjCryst/wxCryst/wxTrackerGraph.h"
23 WXTrackerGraph::WXTrackerGraph(wxFrame *frame, MainTracker *tracker):
24 WXMultiGraph(frame),mpMainTracker(tracker)
26 this->UpdateDisplay();
29 WXTrackerGraph::~WXTrackerGraph()
31 if(mpMainTracker!=0) mpMainTracker->WXNotifyDelete();
36 VFN_DEBUG_ENTRY(
"WXTrackerGraph::UpdateDisplay()",4)
37 const std::set<Tracker*> *pList=&(mpMainTracker->GetTrackerList());
38 std::set<Tracker*>::const_iterator pos;
41 if(mClockGraphList<mpMainTracker->GetClockTrackerList())
43 std::map<Tracker*,long>::iterator pos1;
44 std::map<Tracker*,long>
id=mvId;
45 for(pos1=
id.begin();pos1!=
id.end();pos1++)
46 if(pList->find(pos1->first)==pList->end())
52 unsigned long nbxMax=0;
54 if( (mClockGraphList <mpMainTracker->GetClockTrackerList())
55 ||(mClockGraphValues<mpMainTracker->GetClockValues()))
57 for(pos=pList->begin();pos!=pList->end();pos++)
59 if(mvId.find(*pos)==mvId.end())
61 mvId[*pos]=this->
AddGraph((*pos)->GetName());
64 const unsigned long nb=(*pos)->GetValues().size();
65 std::map<long,REAL>::const_iterator pos2;
66 valarray<float> vx(nb),vy(nb);
69 for(pos2=(*pos)->GetValues().begin();pos2!=(*pos)->GetValues().end();pos2++)
73 if(pos2->second!=0) allnull=
false;
80 if(nbxMax<vx.size()) nbxMax=vx.size();
84 else this->
AutoScale(-1,
false,
true,
false,
false);
86 this->WXMultiGraph::UpdateDisplay();
87 VFN_DEBUG_EXIT(
"WXTrackerGraph::UpdateDisplay()",4)
93 std::map<Tracker*,long>::iterator pos;
94 for(pos=mvId.begin();pos!=mvId.end();pos++)
96 if((
long)
id==pos->second)
virtual void DeleteGraph(const unsigned long id)
Remove graph.
void SetGraphData(const unsigned long id, const std::valarray< float > &vx, const std::valarray< float > &vy)
Set data for a given graph.
virtual void UpdateDisplay()
reads new values from the MainTracker, and asks for a repaint.
void Click()
Record an event for this clock (generally, the 'time' an object has been modified, or some computation has been made)
RefinableObjClock mClockGraphValues
Last time values were added to the graph.
virtual void DeleteGraph(const unsigned long id)
Remove graph.
RefinableObjClock mClockGraphList
Last time a tracker was added to the graph.
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
unsigned long AddGraph(const std::string &name)
Add a graph.
void AutoScale(const long id=-1, const bool xmin=true, const bool xmax=true, const bool ymin=true, const bool ymax=true)
Auto-scale graph, i.e.