Skip to content
Snippets Groups Projects
Commit 040fdf5b authored by jsiegle's avatar jsiegle
Browse files

Fixed char pointer problems

parent 79bb7197
Branches
Tags
No related merge requests found
...@@ -68,19 +68,24 @@ void SpikeDisplayCanvas::initializeSpikePlots(){ ...@@ -68,19 +68,24 @@ void SpikeDisplayCanvas::initializeSpikePlots(){
int plotWidth = (totalWidth - (nPlots + 1 ) * xBuffer) / nCols + .5; int plotWidth = (totalWidth - (nPlots + 1 ) * xBuffer) / nCols + .5;
int plotHeight = plotWidth / 2 + .5; int plotHeight = plotWidth / 2 + .5;
int rowCount = 0; int rowCount = 0;
for (int i=0; i<nPlots; i++) for (int i=0; i<nPlots; i++)
{ {
String name = "ST";
name+= i;
StereotrodePlot p = StereotrodePlot( StereotrodePlot p = StereotrodePlot(
xBuffer + i%nCols * (plotWidth + xBuffer) , xBuffer + i%nCols * (plotWidth + xBuffer) ,
yBuffer + rowCount * (plotHeight + yBuffer), yBuffer + rowCount * (plotHeight + yBuffer),
plotWidth, plotWidth,
plotHeight, ""); // deprecated conversion from string constant to char plotHeight, name.toUTF8()); // deprecated conversion from string constant to char
plots.push_back(p); plots.push_back(p);
if (i%nCols == nCols-1) if (i%nCols == nCols-1)
rowCount++; rowCount++;
} }
// Set the total height of the Canvas to the top of the top most plot // Set the total height of the Canvas to the top of the top most plot
totalHeight = yBuffer + (rowCount + 1) * (plotHeight + yBuffer); totalHeight = yBuffer + (rowCount + 1) * (plotHeight + yBuffer);
...@@ -180,11 +185,11 @@ void SpikeDisplayCanvas::renderOpenGL() ...@@ -180,11 +185,11 @@ void SpikeDisplayCanvas::renderOpenGL()
SpikeObject tmpSpike; SpikeObject tmpSpike;
for (int i=0; i<plots.size(); i++){ for (int i=0; i<plots.size(); i++){
generateSimulatedSpike(&tmpSpike, 0, 100); generateSimulatedSpike(&tmpSpike, 0, 100);
plots[i].processSpikeObject(tmpSpike); plots[i].processSpikeObject(tmpSpike);
plots[i].redraw(); plots[i].redraw();
} }
//} //}
//std::cout << getHeight()<<" "<< getTotalHeight()<<" "<<std::endl; //std::cout << getHeight()<<" "<< getTotalHeight()<<" "<<std::endl;
......
...@@ -12,7 +12,7 @@ void checkGlError(){ ...@@ -12,7 +12,7 @@ void checkGlError(){
else else
std::cout<<"OpenGL Okay!"<<std::endl; std::cout<<"OpenGL Okay!"<<std::endl;
} }
void drawString(float x, float y, void *f, char *string){ void drawString(float x, float y, void *f, const char *string){
// glRasterPos2f(x, y); // glRasterPos2f(x, y);
// int len = strlen(string); // int len = strlen(string);
// // glColor3f(1.0, 1.0, 1.0); // // glColor3f(1.0, 1.0, 1.0);
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
void checkGlError(); void checkGlError();
void setViewportRange(int xMin,int xMax,int yMin,int yMax); void setViewportRange(int xMin,int xMax,int yMin,int yMax);
void drawString(float x, float y, void *f, char *string); void drawString(float x, float y, void *f, const char *string);
void strokeString(void*f, char *string); void strokeString(void*f, char *string);
void drawViewportEdge(); void drawViewportEdge();
......
...@@ -9,7 +9,7 @@ StereotrodePlot::StereotrodePlot(): ...@@ -9,7 +9,7 @@ StereotrodePlot::StereotrodePlot():
} }
StereotrodePlot::StereotrodePlot(int x, int y, int w, int h, char *n): StereotrodePlot::StereotrodePlot(int x, int y, int w, int h, const char *n):
BaseUIElement(x,y,w,h,1), titleHeight(0), enableTitle(true), limitsChanged(true) BaseUIElement(x,y,w,h,1), titleHeight(0), enableTitle(true), limitsChanged(true)
{ {
plotTitle = n; plotTitle = n;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
class StereotrodePlot : public BaseUIElement{ class StereotrodePlot : public BaseUIElement{
char *plotTitle; const char *plotTitle;
TitleBox titleBox; TitleBox titleBox;
...@@ -50,7 +50,7 @@ class StereotrodePlot : public BaseUIElement{ ...@@ -50,7 +50,7 @@ class StereotrodePlot : public BaseUIElement{
public: public:
StereotrodePlot(); StereotrodePlot();
StereotrodePlot(int x, int y,int w,int h, char *n); StereotrodePlot(int x, int y,int w,int h, const char *n);
~StereotrodePlot(); ~StereotrodePlot();
void initAxes(); void initAxes();
......
...@@ -11,7 +11,7 @@ BaseUIElement(0,0,15,100,0) ...@@ -11,7 +11,7 @@ BaseUIElement(0,0,15,100,0)
title = (char *) "Tetrode:00 abcdefghijkl"; title = (char *) "Tetrode:00 abcdefghijkl";
} }
TitleBox::TitleBox(int x, int y,int w,int h, char *n): TitleBox::TitleBox(int x, int y,int w,int h, const char *n):
BaseUIElement(x,y,w,h,0) BaseUIElement(x,y,w,h,0)
{ {
setColor(.15, .15, .50); setColor(.15, .15, .50);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
class TitleBox : public BaseUIElement{ class TitleBox : public BaseUIElement{
char *title; const char *title;
bool selected; bool selected;
void drawTitle(); void drawTitle();
...@@ -21,7 +21,7 @@ class TitleBox : public BaseUIElement{ ...@@ -21,7 +21,7 @@ class TitleBox : public BaseUIElement{
public: public:
TitleBox(); TitleBox();
TitleBox(int x, int y,int w,int h, char *n); TitleBox(int x, int y,int w,int h, const char *n);
void redraw(); void redraw();
void setTitle(char *n); void setTitle(char *n);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment