1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-03 11:24:10 +01:00

GCS GPS Display: Noticed redrawing got real slow if I left the GPS

Display running for a while. I'm blaming that on the text area filling
with a million lines, though that still needs to be confirmed.
So I added a arbritrary 200 line limit, after which lines at the top
start disapearing. Seems sensible anyways :)


git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1730 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
cranphin 2010-09-23 22:19:40 +00:00 committed by cranphin
parent 1472b342c1
commit 1758f55f1c

View File

@ -96,6 +96,13 @@ void GpsDisplayWidget::setFixType(const QString &fixtype)
void GpsDisplayWidget::dumpPacket(const QString &packet)
{
textBrowser->append(packet);
if(textBrowser->document()->lineCount() > 200) {
QTextCursor tc = textBrowser->textCursor();
tc.movePosition(QTextCursor::Start);
tc.movePosition(QTextCursor::Down, QTextCursor::KeepAnchor);
tc.movePosition(QTextCursor::StartOfLine, QTextCursor::KeepAnchor);
tc.removeSelectedText();
}
}
void GpsDisplayWidget::setSVs(int sv)