History

invensense horizontal lines for RT indicator

Philip Rosedale committed 13 years ago

Commit f39fa351 parent e85e4441 file · +29 −4Browse files

Showing the changes to interface/src/SerialInterface.cpp (1 of 1 file). Show all

Unified · Split

interface/src/SerialInterface.cpp+29−4
@@ -170,12 +170,37 @@ void SerialInterface::renderLevels(int width, int height) { · 169 unmodified lines
170170 disp_x += GAP;
171171 }
172172 } else {
173+ const int LEVEL_CORNER_X = 10;
174+ const int LEVEL_CORNER_Y = 200;
175+
176+ // Draw the text values
177+ sprintf(val, "Yaw %d", _lastYaw);
178+ drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y, 0.10, 0, 1.0, 1, val, 0, 1, 0);
179+ sprintf(val, "Pitch %d", _lastPitch);
180+ drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 15, 0.10, 0, 1.0, 1, val, 0, 1, 0);
181+ sprintf(val, "Roll %d", _lastRoll);
182+ drawtext(LEVEL_CORNER_X, LEVEL_CORNER_Y + 30, 0.10, 0, 1.0, 1, val, 0, 1, 0);
183+
184+ // Draw the levels as horizontal lines
185+ const int LEVEL_CENTER = 150;
173186 glLineWidth(2.0);
174187 glColor4f(1, 1, 1, 1);
175− //glBegin(GL_LINES);
176− //glVertex2f(disp_x, height*0.95);
177− sprintf(val, "Yaw %d, Pitch %d, Roll %d", _lastYaw, _lastPitch, _lastRoll);
178− drawtext(10, 100, 0.10, 0, 1.0, 0, val, 0, 1, 0);
188+ glBegin(GL_LINES);
189+ glVertex2f(LEVEL_CORNER_X + LEVEL_CENTER, LEVEL_CORNER_Y - 3);
190+ glVertex2f(LEVEL_CORNER_X + LEVEL_CENTER + _lastYaw, LEVEL_CORNER_Y - 3);
191+ glVertex2f(LEVEL_CORNER_X + LEVEL_CENTER, LEVEL_CORNER_Y + 12);
192+ glVertex2f(LEVEL_CORNER_X + LEVEL_CENTER + _lastPitch, LEVEL_CORNER_Y + 12);
193+ glVertex2f(LEVEL_CORNER_X + LEVEL_CENTER, LEVEL_CORNER_Y + 27);
194+ glVertex2f(LEVEL_CORNER_X + LEVEL_CENTER + _lastRoll, LEVEL_CORNER_Y + 27);
195+ glEnd();
196+ // Draw green vertical centerline
197+ glColor4f(0, 1, 0, 0.5);
198+ glBegin(GL_LINES);
199+ glVertex2f(LEVEL_CORNER_X + LEVEL_CENTER, LEVEL_CORNER_Y - 6);
200+ glVertex2f(LEVEL_CORNER_X + LEVEL_CENTER, LEVEL_CORNER_Y + 30);
201+ glEnd();
202+
203+
179204 }
180205 // Display Serial latency block
181206 if (LED) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t