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
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
include(../../openpilotgcsplugin.pri)
include(../../plugins/coreplugin/coreplugin.pri)
include(../../libs/qextserialport/qextserialport.pri)
include(../../libs/qymodem/qymodem.pri)
HEADERS += uploadergadget.h \
uploadergadgetconfiguration.h \
uploadergadgetfactory.h \
@ -15,11 +17,5 @@ SOURCES += uploadergadget.cpp \
uploadergadgetwidget.cpp \
uploaderplugin.cpp
OTHER_FILES += uploader.pluginspec
LIBS += -l$$qtLibraryTarget(QExtSerialPort)
LIBS += -l$$qtLibraryTarget(QYmodem)
#CONFIG(debug, debug|release):LIBS += -lqextserialportd
#else:LIBS += -lqextserialport
#CONFIG(debug, debug|release):LIBS += -lqymodemd
#else:LIBS += -lqymodem
#LIBS += -l$$qtLibraryTarget(QExtSerialPort)
#LIBS += -l$$qtLibraryTarget(QYmodem)

View File

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

View File

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