#include "basicdrawpane.hpp" #include const wxPen BasicDrawPane::pen[] = { *wxBLACK_PEN, *wxRED_PEN, *wxBLUE_PEN, *wxGREEN_PEN, wxPen(wxColour(255, 128, 0)), wxPen(wxColour(128, 128, 64)), wxPen(wxColour(128, 64, 128)), wxPen(wxColour(64, 128, 128)) }; BasicDrawPane::BasicDrawPane(wxFrame* parent, int ch) : wxPanel(parent){ time = wxGetUTCTimeMillis(); Bind(wxEVT_PAINT, &BasicDrawPane::paintEvent, this); xpos = 0; channels = ch; for (int i = 0; i()); for (int j = 0; j<1024; j++) { data[i].push_back(0); } } } void BasicDrawPane::Clear(){ for (int i = 0; iCreatePath(); gc->SetPen(pen[i]); x = 0; y = h/2; xstep = (double)w/(double)(data[i].size()-1); path.MoveToPoint(x, y); for(auto point : data[i]){ y = h/2-point*h/2; path.AddLineToPoint(x, y); x += xstep; } gc->StrokePath(path); } //center line wxGraphicsPath path = gc->CreatePath(); gc->SetPen(*wxGREY_PEN); path.MoveToPoint(0, h/2); path.AddLineToPoint(w, h/2); path.CloseSubpath(); gc->StrokePath(path); delete gc; } } void BasicDrawPane::plotvalue(float values[]) { for (int i = 0; i