1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

Fixes performance issues under windows

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@475 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
zedamota 2010-04-10 23:01:59 +00:00 committed by zedamota
parent 8ba2b0f4bc
commit eb8ad597c3
4 changed files with 9 additions and 30 deletions

View File

@ -60,4 +60,7 @@ plugin_uavobjectbrowser.depends = plugin_coreplugin
plugin_uavobjectbrowser.depends = plugin_uavobjects plugin_uavobjectbrowser.depends = plugin_uavobjects
SUBDIRS += plugin_uavobjectbrowser SUBDIRS += plugin_uavobjectbrowser
#Uploader Gadget
plugin_uploader.subdir = uploader
plugin_uploader.depends = plugin_coreplugin
SUBDIRS += plugin_uploader

View File

@ -2,6 +2,8 @@ TEMPLATE = lib
TARGET = Uploader TARGET = Uploader
include(../../openpilotgcsplugin.pri) include(../../openpilotgcsplugin.pri)
include(../../plugins/coreplugin/coreplugin.pri) include(../../plugins/coreplugin/coreplugin.pri)
include(../../libs/qextserialport/qextserialport.pri)
include(../../libs/qymodem/qymodem.pri)
HEADERS += uploadergadget.h \ HEADERS += uploadergadget.h \
uploadergadgetconfiguration.h \ uploadergadgetconfiguration.h \
uploadergadgetfactory.h \ uploadergadgetfactory.h \
@ -15,11 +17,5 @@ SOURCES += uploadergadget.cpp \
uploadergadgetwidget.cpp \ uploadergadgetwidget.cpp \
uploaderplugin.cpp uploaderplugin.cpp
OTHER_FILES += uploader.pluginspec OTHER_FILES += uploader.pluginspec
#LIBS += -l$$qtLibraryTarget(QExtSerialPort)
LIBS += -l$$qtLibraryTarget(QExtSerialPort) #LIBS += -l$$qtLibraryTarget(QYmodem)
LIBS += -l$$qtLibraryTarget(QYmodem)
#CONFIG(debug, debug|release):LIBS += -lqextserialportd
#else:LIBS += -lqextserialport
#CONFIG(debug, debug|release):LIBS += -lqymodemd
#else:LIBS += -lqymodem

View File

@ -62,33 +62,16 @@ UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent)
layout->addWidget(StatusWidget); layout->addWidget(StatusWidget);
setLayout(layout); setLayout(layout);
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()),
this, SLOT(updatePerc()));
connect(loadfile, SIGNAL(clicked(bool)), connect(loadfile, SIGNAL(clicked(bool)),
this,SLOT(setOpenFileName())); this,SLOT(setOpenFileName()));
connect(sendBt, SIGNAL(clicked(bool)), connect(sendBt, SIGNAL(clicked(bool)),
this,SLOT(send())); this,SLOT(send()));
}
void UploaderGadgetWidget::updatePerc()
{
if(!Ymodem->isRunning())
{
timer->stop();
}
progressBar->setValue(percent);
} }
void UploaderGadgetWidget::send() void UploaderGadgetWidget::send()
{ {
Ymodem->SendFileT(openFileNameLE->text()); Ymodem->SendFileT(openFileNameLE->text());
timer->start(500);
} }
UploaderGadgetWidget::~UploaderGadgetWidget() UploaderGadgetWidget::~UploaderGadgetWidget()
@ -111,7 +94,7 @@ void UploaderGadgetWidget::setPort(QextSerialPort* port)
void UploaderGadgetWidget::updatePercSlot(int i) void UploaderGadgetWidget::updatePercSlot(int i)
{ {
percent=i; progressBar->setValue(i);
} }
void UploaderGadgetWidget::setOpenFileName() void UploaderGadgetWidget::setOpenFileName()

View File

@ -42,7 +42,6 @@
#include <QtGui/QPushButton> #include <QtGui/QPushButton>
#include <QFileDialog> #include <QFileDialog>
#include <QMessageBox> #include <QMessageBox>
#include <QTimer>
//using namespace qmapcontrol; //using namespace qmapcontrol;
@ -68,14 +67,12 @@ private:
QymodemSend * Ymodem; QymodemSend * Ymodem;
QProgressBar *progressBar; QProgressBar *progressBar;
QTimer *timer; QTimer *timer;
int percent;
private slots: private slots:
void setOpenFileName(); void setOpenFileName();
void send(); void send();
void error(QString errorString,int errorNumber); void error(QString errorString,int errorNumber);
void info(QString infoString,int infoNumber); void info(QString infoString,int infoNumber);
void updatePerc();
void updatePercSlot(int); void updatePercSlot(int);
}; };