mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 18:50:44 +00:00
Fixed gLineChart clipping. Restored graph links. Can now use non-square graphs without uglies
This commit is contained in:
parent
128190eb99
commit
1421d12199
@ -8304,7 +8304,7 @@
|
|||||||
<sleeplib/machine.h>
|
<sleeplib/machine.h>
|
||||||
<list>
|
<list>
|
||||||
|
|
||||||
1307681539 /home/mark/projects/git/sleepyhead/src/version.h
|
1307704847 /home/mark/projects/git/sleepyhead/src/version.h
|
||||||
|
|
||||||
1307627540 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.h
|
1307627540 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.h
|
||||||
"machine.h"
|
"machine.h"
|
||||||
@ -8322,7 +8322,7 @@
|
|||||||
"preferences.h"
|
"preferences.h"
|
||||||
"tinyxml/tinyxml.h"
|
"tinyxml/tinyxml.h"
|
||||||
|
|
||||||
1307671169 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp
|
1307698043 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp
|
||||||
"wx_pch.h"
|
"wx_pch.h"
|
||||||
"version.h"
|
"version.h"
|
||||||
<wx/app.h>
|
<wx/app.h>
|
||||||
@ -8342,10 +8342,11 @@
|
|||||||
"sleeplib/profiles.h"
|
"sleeplib/profiles.h"
|
||||||
"sleeplib/machine_loader.h"
|
"sleeplib/machine_loader.h"
|
||||||
|
|
||||||
1307681527 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp
|
1307704772 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp
|
||||||
<wx/settings.h>
|
<wx/settings.h>
|
||||||
<wx/dcbuffer.h>
|
<wx/dcbuffer.h>
|
||||||
<wx/log.h>
|
<wx/log.h>
|
||||||
|
<math.h>
|
||||||
"graph.h"
|
"graph.h"
|
||||||
"sleeplib/profiles.h"
|
"sleeplib/profiles.h"
|
||||||
|
|
||||||
|
@ -11,13 +11,13 @@
|
|||||||
<Cursor position="1042" topLine="7" />
|
<Cursor position="1042" topLine="7" />
|
||||||
</File>
|
</File>
|
||||||
<File name="../../src/SleepyHeadMain.cpp" open="1" top="0" tabpos="2">
|
<File name="../../src/SleepyHeadMain.cpp" open="1" top="0" tabpos="2">
|
||||||
<Cursor position="24637" topLine="631" />
|
<Cursor position="27102" topLine="704" />
|
||||||
</File>
|
</File>
|
||||||
<File name="../../src/SleepyHeadMain.h" open="1" top="0" tabpos="3">
|
<File name="../../src/SleepyHeadMain.h" open="1" top="0" tabpos="3">
|
||||||
<Cursor position="2209" topLine="51" />
|
<Cursor position="2209" topLine="51" />
|
||||||
</File>
|
</File>
|
||||||
<File name="../../src/graphs/graph.cpp" open="1" top="0" tabpos="7">
|
<File name="../../src/graphs/graph.cpp" open="1" top="1" tabpos="7">
|
||||||
<Cursor position="17536" topLine="634" />
|
<Cursor position="43817" topLine="1620" />
|
||||||
</File>
|
</File>
|
||||||
<File name="../../src/graphs/graph.h" open="1" top="0" tabpos="8">
|
<File name="../../src/graphs/graph.h" open="1" top="0" tabpos="8">
|
||||||
<Cursor position="7161" topLine="200" />
|
<Cursor position="7161" topLine="200" />
|
||||||
@ -31,7 +31,7 @@
|
|||||||
<File name="../../src/libs/sleeplib/loader_plugins/cms50_loader.h" open="0" top="0" tabpos="5">
|
<File name="../../src/libs/sleeplib/loader_plugins/cms50_loader.h" open="0" top="0" tabpos="5">
|
||||||
<Cursor position="579" topLine="0" />
|
<Cursor position="579" topLine="0" />
|
||||||
</File>
|
</File>
|
||||||
<File name="../../src/libs/sleeplib/loader_plugins/zeo_loader.cpp" open="1" top="0" tabpos="14">
|
<File name="../../src/libs/sleeplib/loader_plugins/zeo_loader.cpp" open="1" top="0" tabpos="13">
|
||||||
<Cursor position="1662" topLine="27" />
|
<Cursor position="1662" topLine="27" />
|
||||||
</File>
|
</File>
|
||||||
<File name="../../src/libs/sleeplib/machine.cpp" open="1" top="0" tabpos="5">
|
<File name="../../src/libs/sleeplib/machine.cpp" open="1" top="0" tabpos="5">
|
||||||
@ -40,7 +40,7 @@
|
|||||||
<File name="../../src/libs/sleeplib/machine.h" open="1" top="0" tabpos="4">
|
<File name="../../src/libs/sleeplib/machine.h" open="1" top="0" tabpos="4">
|
||||||
<Cursor position="5047" topLine="119" />
|
<Cursor position="5047" topLine="119" />
|
||||||
</File>
|
</File>
|
||||||
<File name="../../src/libs/sleeplib/machine_loader.h" open="1" top="1" tabpos="15">
|
<File name="../../src/libs/sleeplib/machine_loader.h" open="1" top="0" tabpos="14">
|
||||||
<Cursor position="222" topLine="0" />
|
<Cursor position="222" topLine="0" />
|
||||||
</File>
|
</File>
|
||||||
<File name="../../src/libs/sleeplib/profiles.cpp" open="1" top="0" tabpos="10">
|
<File name="../../src/libs/sleeplib/profiles.cpp" open="1" top="0" tabpos="10">
|
||||||
|
@ -664,7 +664,7 @@ Daily::Daily(wxWindow *win,Profile *p)
|
|||||||
LEAK->AddLayer(new gXAxis(wxBLACK));
|
LEAK->AddLayer(new gXAxis(wxBLACK));
|
||||||
LEAK->AddLayer(new gYAxis(wxBLACK));
|
LEAK->AddLayer(new gYAxis(wxBLACK));
|
||||||
LEAK->AddLayer(new gFooBar());
|
LEAK->AddLayer(new gFooBar());
|
||||||
LEAK->AddLayer(new gLineChart(leakdata,wxPURPLE,4096,false,false,true));
|
LEAK->AddLayer(new gLineChart(leakdata,wxPURPLE,4096,false,false,false));
|
||||||
|
|
||||||
AddCPAPData(pressure_iap=new EventData(CPAP_IAP));
|
AddCPAPData(pressure_iap=new EventData(CPAP_IAP));
|
||||||
AddCPAPData(pressure_eap=new EventData(CPAP_EAP));
|
AddCPAPData(pressure_eap=new EventData(CPAP_EAP));
|
||||||
@ -674,7 +674,7 @@ Daily::Daily(wxWindow *win,Profile *p)
|
|||||||
PRD->AddLayer(new gXAxis(wxBLACK));
|
PRD->AddLayer(new gXAxis(wxBLACK));
|
||||||
PRD->AddLayer(new gYAxis(wxBLACK));
|
PRD->AddLayer(new gYAxis(wxBLACK));
|
||||||
PRD->AddLayer(new gFooBar());
|
PRD->AddLayer(new gFooBar());
|
||||||
PRD->AddLayer(new gLineChart(prd,wxDARK_GREEN,4096,false,false,true));
|
PRD->AddLayer(new gLineChart(prd,wxDARK_GREEN,4096,false,false,false));
|
||||||
PRD->AddLayer(new gLineChart(pressure_iap,wxBLUE,4096,false,true,true));
|
PRD->AddLayer(new gLineChart(pressure_iap,wxBLUE,4096,false,true,true));
|
||||||
PRD->AddLayer(new gLineChart(pressure_eap,wxRED,4096,false,true,true));
|
PRD->AddLayer(new gLineChart(pressure_eap,wxRED,4096,false,true,true));
|
||||||
|
|
||||||
@ -713,7 +713,7 @@ Daily::Daily(wxWindow *win,Profile *p)
|
|||||||
// SF->SetMargins(10,15,20,80);
|
// SF->SetMargins(10,15,20,80);
|
||||||
|
|
||||||
// #if defined(__UNIX__)
|
// #if defined(__UNIX__)
|
||||||
/* FRW->LinkZoom(SF);
|
FRW->LinkZoom(SF);
|
||||||
FRW->LinkZoom(PRD);
|
FRW->LinkZoom(PRD);
|
||||||
FRW->LinkZoom(LEAK);
|
FRW->LinkZoom(LEAK);
|
||||||
FRW->LinkZoom(SNORE);
|
FRW->LinkZoom(SNORE);
|
||||||
@ -732,7 +732,7 @@ Daily::Daily(wxWindow *win,Profile *p)
|
|||||||
SNORE->LinkZoom(SF);
|
SNORE->LinkZoom(SF);
|
||||||
SNORE->LinkZoom(FRW);
|
SNORE->LinkZoom(FRW);
|
||||||
SNORE->LinkZoom(PRD);
|
SNORE->LinkZoom(PRD);
|
||||||
SNORE->LinkZoom(LEAK); */
|
SNORE->LinkZoom(LEAK);
|
||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ License: LGPL
|
|||||||
#include <wx/settings.h>
|
#include <wx/settings.h>
|
||||||
#include <wx/dcbuffer.h>
|
#include <wx/dcbuffer.h>
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
|
#include <math.h>
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
#include "sleeplib/profiles.h"
|
#include "sleeplib/profiles.h"
|
||||||
|
|
||||||
@ -1451,87 +1452,87 @@ gLineChart::~gLineChart()
|
|||||||
// Time Domain Line Chart
|
// Time Domain Line Chart
|
||||||
void gLineChart::Plot(wxDC & dc, gGraphWindow & w)
|
void gLineChart::Plot(wxDC & dc, gGraphWindow & w)
|
||||||
{
|
{
|
||||||
int dp;
|
|
||||||
double px,py;
|
|
||||||
|
|
||||||
|
|
||||||
if (!m_visible) return;
|
if (!m_visible) return;
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
if (!data->IsReady()) return;
|
if (!data->IsReady()) return;
|
||||||
//if (!data->NP()) return;
|
|
||||||
|
|
||||||
int scrx = w.GetScrX();
|
int scrx = w.GetScrX(), scry = w.GetScrY();
|
||||||
int scry = w.GetScrY();
|
|
||||||
//wxString label=wxString::Format(wxT("%i %i"),scrx,scry);
|
|
||||||
//dc.DrawText(label,0,0);
|
|
||||||
|
|
||||||
int start_px=w.GetLeftMargin();
|
int start_px=w.GetLeftMargin(), start_py=w.GetTopMargin();
|
||||||
int start_py=w.GetTopMargin();
|
|
||||||
int width=scrx-(w.GetLeftMargin()+w.GetRightMargin())-1;
|
int width=scrx-(w.GetLeftMargin()+w.GetRightMargin());
|
||||||
int height=scry-(w.GetTopMargin()+w.GetBottomMargin());
|
int height=scry-(w.GetTopMargin()+w.GetBottomMargin());
|
||||||
|
|
||||||
double minx=w.min_x,miny=w.min_y;
|
wxRect bounds(start_px+1,start_py,width-1,height);
|
||||||
double maxx=w.max_x,maxy=w.max_y;
|
|
||||||
double xx=maxx-minx;
|
double minx=w.min_x, miny=w.min_y, maxx=w.max_x, maxy=w.max_y;
|
||||||
double yy=maxy-miny;
|
double xx=maxx-minx, yy=maxy-miny;
|
||||||
double xmult=width/xx;
|
double xmult=width/xx, ymult=height/yy; // time to pixel conversion multiplier
|
||||||
double ymult=height/yy;
|
|
||||||
|
// Return on screwy min/max conditions
|
||||||
if ((xx<0) || (yy<0)) return;
|
if ((xx<0) || (yy<0)) return;
|
||||||
if ((yy==0) && (w.min_y==0)) return;
|
if ((yy==0) && (miny==0)) return;
|
||||||
// assert(xx>=0);
|
|
||||||
|
|
||||||
static wxPen pen1(*wxLIGHT_GREY, 1, wxDOT);
|
int num_points=0;
|
||||||
|
for (int z=0;z<data->VC();z++) num_points+=data->np[z]; // how many points all up?
|
||||||
dc.SetPen( *wxBLACK_PEN );
|
|
||||||
dc.DrawLine(start_px,start_py,start_px,start_py+height);
|
|
||||||
dc.DrawLine(start_px,start_py+height,start_px+width+1,start_py+height);
|
|
||||||
// dc.DrawLine(start_px,start_py,start_px+width,start_py);
|
|
||||||
dc.DrawLine(start_px+width+1,start_py,start_px+width+1,start_py+height);
|
|
||||||
|
|
||||||
|
|
||||||
//foobar->Plot(dc,w);
|
// Draw bounding box if something else will be drawn.
|
||||||
|
if (!(!m_report_empty && !num_points)) {
|
||||||
|
dc.SetPen( *wxBLACK_PEN );
|
||||||
|
dc.DrawLine(start_px,start_py,start_px,start_py+height); // Left Border
|
||||||
|
dc.DrawLine(start_px,start_py+height,start_px+width+1,start_py+height); // Bottom Border
|
||||||
|
dc.DrawLine(start_px+width+1,start_py,start_px+width+1,start_py+height+1); // Right Border
|
||||||
|
// dc.DrawLine(start_px,start_py,start_px+width,start_py);
|
||||||
|
}
|
||||||
|
|
||||||
/*if (!m_hide_axes) {
|
width--;
|
||||||
Yaxis->Plot(dc,w);
|
if (!num_points) { // No Data?
|
||||||
} */
|
if (m_report_empty) {
|
||||||
|
|
||||||
wxPen pen(*color[0], 1, wxSOLID);
|
|
||||||
dc.SetPen(pen);
|
|
||||||
bool accel=m_accelerate;
|
|
||||||
|
|
||||||
double s1,s2,sr;
|
|
||||||
double sfit,sam;
|
|
||||||
|
|
||||||
if (m_report_empty) {
|
|
||||||
int cnt=0;
|
|
||||||
for (int z=0;z<data->VC();z++) cnt+=data->np[z];
|
|
||||||
|
|
||||||
if (!cnt) {
|
|
||||||
wxString msg=_("No Waveform Available");
|
wxString msg=_("No Waveform Available");
|
||||||
wxCoord x,y;
|
wxCoord x,y;
|
||||||
dc.SetTextForeground(*wxDARK_GREY);
|
dc.SetTextForeground(*wxDARK_GREY);
|
||||||
|
|
||||||
dc.SetFont(*bigfont);
|
dc.SetFont(*bigfont);
|
||||||
dc.GetTextExtent(msg,&x,&y);
|
dc.GetTextExtent(msg,&x,&y);
|
||||||
dc.DrawText(msg,start_px+(width/2.0)-(x/2.0),start_py+(height/2.0)-(y/2.0));
|
dc.DrawText(msg,start_px+(width/2.0)-(x/2.0),start_py+(height/2.0)-(y/2.0));
|
||||||
|
|
||||||
|
// Restore the default font in case we screw up somewhere else
|
||||||
dc.SetTextForeground(*wxBLACK);
|
dc.SetTextForeground(*wxBLACK);
|
||||||
dc.SetFont(*wxNORMAL_FONT);
|
dc.SetFont(*wxNORMAL_FONT);
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dc.SetClippingRegion(start_px+1,start_py,width,height);
|
|
||||||
|
// Selected the plot line color
|
||||||
|
wxPen pen(*color[0], 1, wxSOLID);
|
||||||
|
dc.SetPen(pen);
|
||||||
|
|
||||||
|
bool accel=m_accelerate;
|
||||||
|
double px,py;
|
||||||
|
double s1,s2,sr;
|
||||||
|
double sfit,sam;
|
||||||
|
int dp;
|
||||||
|
|
||||||
|
//dc.SetClippingRegion(bounds); //start_px+1,start_py,width,height);
|
||||||
|
|
||||||
|
|
||||||
|
// Now, run through the list of plot segments and draw them
|
||||||
|
|
||||||
for (int n=0;n<data->VC();n++) {
|
for (int n=0;n<data->VC();n++) {
|
||||||
dp=0;
|
dp=0;
|
||||||
int siz=data->np[n];
|
int & siz=data->np[n];
|
||||||
if (!siz) continue;
|
// Don't bother drawing 1 point or less.
|
||||||
|
if (siz<=1) continue;
|
||||||
|
|
||||||
bool done=false;
|
bool done=false;
|
||||||
bool first=true;
|
bool first=true;
|
||||||
wxRealPoint * point=data->point[n];
|
wxRealPoint * point=data->point[n];
|
||||||
|
|
||||||
|
// Calculate the number of points to skip when too much data.
|
||||||
if (accel) {
|
if (accel) {
|
||||||
s1=point[0].x;
|
sr=point[1].x-point[0].x; // Time distance between points
|
||||||
s2=point[1].x;
|
|
||||||
sr=s2-s1;
|
|
||||||
sfit=xx/sr;
|
sfit=xx/sr;
|
||||||
sam=sfit/width;
|
sam=sfit/width;
|
||||||
if (sam<=8) { // Don't accelerate if threshold less than this.
|
if (sam<=8) { // Don't accelerate if threshold less than this.
|
||||||
@ -1541,12 +1542,13 @@ void gLineChart::Plot(wxDC & dc, gGraphWindow & w)
|
|||||||
sam/=25; // lower this number the more data is skipped over (and the faster things run)
|
sam/=25; // lower this number the more data is skipped over (and the faster things run)
|
||||||
if (sam<=1) {
|
if (sam<=1) {
|
||||||
sam=1;
|
sam=1;
|
||||||
//accel=false;
|
accel=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else sam=1;
|
} else sam=1;
|
||||||
|
|
||||||
|
// Prepare the min max y values if we still are accelerating this plot
|
||||||
if (accel) {
|
if (accel) {
|
||||||
for (int i=0;i<width;i++) {
|
for (int i=0;i<width;i++) {
|
||||||
m_drawlist[i].x=height;
|
m_drawlist[i].x=height;
|
||||||
@ -1555,57 +1557,84 @@ void gLineChart::Plot(wxDC & dc, gGraphWindow & w)
|
|||||||
}
|
}
|
||||||
int minz=width,maxz=0;
|
int minz=width,maxz=0;
|
||||||
|
|
||||||
bool reverse=false;
|
// Technically shouldn't never ever get fed reverse data. So I'm disabling this stuff.
|
||||||
if (point[0].x>point[siz-1].x) reverse=true;
|
// Leaving the code here just in case.
|
||||||
|
|
||||||
|
//bool reverse=false;
|
||||||
|
//if (point[0].x > point[siz-1].x) reverse=true;
|
||||||
|
|
||||||
|
// Here is a test to make sure for now anyway.
|
||||||
|
assert(point[0].x < point[siz-1].x);
|
||||||
|
|
||||||
for (int i=0;i<siz;i+=sam) { //,done==false
|
for (int i=0;i<siz;i+=sam) { //,done==false
|
||||||
if (!reverse) {
|
|
||||||
if (point[i].x < minx) continue;
|
|
||||||
|
//if (!reverse) {
|
||||||
|
|
||||||
|
if (point[i].x < minx) continue; // Skip stuff before the start of our data window
|
||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
first=false;
|
first=false;
|
||||||
if (i>=sam) i-=sam;
|
if (i>=sam) i-=sam; // Start with the previous sample (which will be in clipping area)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (point[i].x > maxx) done=true;
|
if (point[i].x > maxx) done=true; // Let this iteration finish.. (This point will be in far clipping)
|
||||||
} else {
|
|
||||||
|
/*} else {
|
||||||
if (point[i].x > maxx) continue;
|
if (point[i].x > maxx) continue;
|
||||||
if (first) {
|
|
||||||
|
if (first) { //For the first plot of each segment..
|
||||||
first=false;
|
first=false;
|
||||||
if (i>=sam) i-=sam;
|
if (i>=sam) i-=sam; // start with the previous sample (which is in the clipping range)
|
||||||
}
|
}
|
||||||
if (point[i].x < minx) done=true;
|
if (point[i].x < minx) done=true;
|
||||||
|
|
||||||
}
|
} */
|
||||||
|
|
||||||
|
px=1+(point[i].x - minx) * xmult; // Scale the time scale X to pixel scale X
|
||||||
|
py=height-1 - ((point[i].y - miny) * ymult); // Same for Y scale, but reverse (0 at the bottom)
|
||||||
|
|
||||||
px=(point[i].x - minx) * xmult;
|
|
||||||
py=height - ((point[i].y - miny) * ymult);
|
|
||||||
|
|
||||||
// Can't avoid this.. SetClippingRegion does not work without crashing.. need to find a workaround:(
|
|
||||||
if (px<0) {
|
|
||||||
px=0;
|
|
||||||
}
|
|
||||||
if (px>width) {
|
|
||||||
px=width;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (accel) {
|
if (accel) {
|
||||||
|
// Just clip ugly in accel mode.. Too darn complicated otherwise
|
||||||
|
if (px<0) {
|
||||||
|
px=0;
|
||||||
|
}
|
||||||
|
if (px>width) {
|
||||||
|
px=width;
|
||||||
|
}
|
||||||
|
// In accel mode, each pixel has a min/max Y value.
|
||||||
|
// m_drawlist's index is the pixel index for the X pixel axis.
|
||||||
|
|
||||||
int z=round(px);
|
int z=round(px);
|
||||||
if (z<minz) minz=z;
|
if (z<minz) minz=z; // minz=First pixel
|
||||||
if (z>maxz) maxz=z;
|
if (z>maxz) maxz=z; // maxz=Last pixel
|
||||||
|
|
||||||
|
// Update the Y pixel bounds.
|
||||||
if (py<m_drawlist[z].x) m_drawlist[z].x=py;
|
if (py<m_drawlist[z].x) m_drawlist[z].x=py;
|
||||||
if (py>m_drawlist[z].y) m_drawlist[z].y=py;
|
if (py>m_drawlist[z].y) m_drawlist[z].y=py;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (m_square_plot && (dp>0)) { // twice as many points needed
|
|
||||||
m_drawlist[dp].x=start_px+px;
|
// Square plot mode adds the extra points to convert the graph to a square wave.
|
||||||
m_drawlist[dp].y=m_drawlist[dp-1].y;
|
// Twice as many points are needed to do this.
|
||||||
|
if (m_square_plot && (dp>0)) {
|
||||||
|
|
||||||
|
m_drawlist[dp].x=start_px+px; // This points X position
|
||||||
|
m_drawlist[dp].y=m_drawlist[dp-1].y; // But with last points Y position
|
||||||
|
|
||||||
if (++dp>=m_drawlist_size) {
|
if (++dp>=m_drawlist_size) {
|
||||||
wxLogWarning(wxT("gLineChart: m_drawlist is too small"));
|
wxLogWarning(wxT("gLineChart: m_drawlist is too small"));
|
||||||
done=true;
|
done=true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
m_drawlist[dp].x=start_px+px;
|
m_drawlist[dp].x=start_px+px;
|
||||||
m_drawlist[dp].y=start_py+py;
|
m_drawlist[dp].y=start_py+py;
|
||||||
|
|
||||||
if (++dp>=m_drawlist_size) {
|
if (++dp>=m_drawlist_size) {
|
||||||
wxLogWarning(wxT("gLineChart: m_drawlist is too small"));
|
wxLogWarning(wxT("gLineChart: m_drawlist is too small"));
|
||||||
done=true;
|
done=true;
|
||||||
@ -1615,12 +1644,15 @@ void gLineChart::Plot(wxDC & dc, gGraphWindow & w)
|
|||||||
if (done) break;
|
if (done) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (accel) {
|
if (accel) {
|
||||||
// dc.DrawLine(1, 1, 1, height);
|
// dc.DrawLine(1, 1, 1, height); // a little marker for debugging when in accel mode.
|
||||||
dp=0;
|
dp=0;
|
||||||
for (int i=minz;i<maxz;i++) {
|
for (int i=minz;i<maxz;i++) {
|
||||||
int y1=m_drawlist[i].x;
|
int y1=m_drawlist[i].x; // x= Min y pixel in this case.
|
||||||
int y2=m_drawlist[i].y;
|
int y2=m_drawlist[i].y; // y= Max y pixel
|
||||||
|
|
||||||
//if (i>width) break;
|
//if (i>width) break;
|
||||||
screen[dp].x=start_px+i+1;
|
screen[dp].x=start_px+i+1;
|
||||||
screen[dp].y=start_py+y1;
|
screen[dp].y=start_py+y1;
|
||||||
@ -1632,11 +1664,51 @@ void gLineChart::Plot(wxDC & dc, gGraphWindow & w)
|
|||||||
}
|
}
|
||||||
if (dp>1) dc.DrawLines(dp,screen); // need at least two points
|
if (dp>1) dc.DrawLines(dp,screen); // need at least two points
|
||||||
|
|
||||||
} else {
|
} else if (dp>1) {
|
||||||
|
// Only the first point and last point should be in clipping range.
|
||||||
|
|
||||||
|
if (m_drawlist[0].x<=start_px) { // in clipping range?
|
||||||
|
// if (!m_square_plot) {
|
||||||
|
double x1=m_drawlist[0].x - (start_px+1);
|
||||||
|
double x2=m_drawlist[1].x - (start_px+1);
|
||||||
|
|
||||||
|
double y1=m_drawlist[0].y;
|
||||||
|
double y2=m_drawlist[1].y;
|
||||||
|
|
||||||
|
y1+=-x1 * ((y2-y1)/(x2-x1));
|
||||||
|
m_drawlist[0].y=y1;
|
||||||
|
m_drawlist[0].x=start_px+1;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
int endpx=scrx-w.GetRightMargin();
|
||||||
|
if (m_drawlist[dp-1].x > endpx) {
|
||||||
|
if (!m_square_plot) {
|
||||||
|
double x1=m_drawlist[dp-2].x;
|
||||||
|
double x2=m_drawlist[dp-1].x;
|
||||||
|
|
||||||
|
double y1=m_drawlist[dp-2].y;
|
||||||
|
double y2=m_drawlist[dp-1].y;
|
||||||
|
|
||||||
|
y2-=(x2-endpx) * ((y2-y1)/(x2-x1));
|
||||||
|
|
||||||
|
m_drawlist[dp-1].y=y2;
|
||||||
|
} else {
|
||||||
|
m_drawlist[dp-1].y=m_drawlist[dp-2].y;
|
||||||
|
m_drawlist[dp-2].x=endpx;
|
||||||
|
}
|
||||||
|
m_drawlist[dp-1].x=endpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
assert(siz>1);
|
||||||
if (dp>1) dc.DrawLines(dp,m_drawlist); // need at least two points
|
if (dp>1) dc.DrawLines(dp,m_drawlist); // need at least two points
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dc.DestroyClippingRegion();
|
// dc.DestroyClippingRegion();
|
||||||
}
|
}
|
||||||
|
|
||||||
gLineOverlayBar::gLineOverlayBar(gPointData *d,const wxColor * col,wxString _label,LO_Type _lot)
|
gLineOverlayBar::gLineOverlayBar(gPointData *d,const wxColor * col,wxString _label,LO_Type _lot)
|
||||||
|
@ -16,14 +16,14 @@ namespace AutoVersion{
|
|||||||
//Standard Version Type
|
//Standard Version Type
|
||||||
static const long MAJOR = 0;
|
static const long MAJOR = 0;
|
||||||
static const long MINOR = 7;
|
static const long MINOR = 7;
|
||||||
static const long BUILD = 4245;
|
static const long BUILD = 4393;
|
||||||
static const long REVISION = 6382;
|
static const long REVISION = 7184;
|
||||||
|
|
||||||
//Miscellaneous Version Types
|
//Miscellaneous Version Types
|
||||||
static const long BUILDS_COUNT = 2756;
|
static const long BUILDS_COUNT = 3052;
|
||||||
#define RC_FILEVERSION 0,7,4245,6382
|
#define RC_FILEVERSION 0,7,4393,7184
|
||||||
#define RC_FILEVERSION_STRING "0, 7, 4245, 6382\0"
|
#define RC_FILEVERSION_STRING "0, 7, 4393, 7184\0"
|
||||||
static const char FULLVERSION_STRING[] = "0.7.4245.6382";
|
static const char FULLVERSION_STRING[] = "0.7.4393.7184";
|
||||||
|
|
||||||
//These values are to keep track of your versioning state, don't modify them.
|
//These values are to keep track of your versioning state, don't modify them.
|
||||||
static const long BUILD_HISTORY = 0;
|
static const long BUILD_HISTORY = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user