Fixed problems.

This commit is contained in:
sancho11
2019-02-08 01:19:54 -06:00
parent 1f8247c945
commit 2162df1111
3 changed files with 63 additions and 43 deletions

View File

@@ -41,8 +41,8 @@ void draw_boxes()
line(x, y - 20, xEdge, y - 20);
line(x, y + 10, xEdge, y + 10);
stroke(#EF7F1A);
dashline(xEdge, y - 23, width, y - 23, spacing);
dashline(xEdge, y + 13, width, y + 13, spacing);
dashline(xEdge, y - 23, width, y - 23, spacinggrid);
dashline(xEdge, y + 13, width, y + 13, spacinggrid);
stroke(white);
if (board == "STM32F1")
{
@@ -68,17 +68,19 @@ void draw_boxes()
}
y += 36;
}
text(" ALL ", x, 610);
text("EVENTS", x, 625);
}
void drawCursorChannel(boolean CursorEnable)
{
if (CursorEnable)
{
{
fill(50);
stroke(75);
if (ChannelCursor1CurrentEvent0[1] == 16) // This variable is used to define the channel on which we move or have marked, in this part we draw the rectangle that emphasizes a channel.
{
rect(0, yBottom - 12, width - xEdge, 34);
rect(0, yBottom - 36, width - xEdge, 34);
}
else
{
@@ -145,10 +147,8 @@ void DrawChannelSignals()
}
// finally we draw the lines
stroke(green);
line(xPos[n] + xShift, yPos, xTime[i] + xShift, yPos); // straight line
line(xTime[i] + xShift, yPos, xTime[i] + xShift, yDiff); // vertical line
xPos[n] = xTime[i]; // save last position of the line for the pin
yPos = ySave; // load the initial value of the y
}
@@ -172,6 +172,7 @@ void DrawChannelSignals()
textCovered = !textCovered;
dashline(xTime[i] + xShift, firstchange, xTime[i] + xShift, yBottom, spacing);
text(round(usTime[i]), xTime[i] + xShift + 2, (textCovered == true) ? yBottom : yBottom - 10); //write on different height
stroke(green);
}
}
}
@@ -182,7 +183,7 @@ void ScrollingBarPressed()
{
scroll_bar.from_left = mouseX - scroll_bar.width / 2;
if (scroll_bar.from_left < xEdge)
scroll_bar.from_left = int(xEdge);
scroll_bar.from_left = xEdge;
if (scroll_bar.from_left > width - scroll_bar.width)
scroll_bar.from_left = width - scroll_bar.width;
updatepos();
@@ -190,7 +191,8 @@ void ScrollingBarPressed()
}
}
float[] spacing = {1, 50}; //used for the dashline function, pixels
float[] spacing = {5, 8}; //used for the dashline function, pixels
float[] spacinggrid = {1, 50}; //used for the background reference lines
void dashline(float x0, float y0, float x1, float y1, float[] spacing)
{
float distance = dist(x0, y0, x1, y1);