* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
+
#include "accelerationstart.h"
#include "ui_accelerationstartdialog.h"
#include <QMessageBox>
#include <QDebug>
+/**
+ * Constructor of this class.
+ */
accelerationstart::accelerationstart(QWidget *parent) :
QDialog(parent),
ui(new Ui::accelerationstart)
stopMeasureSpeed = 0;
ui->categorComboBox->addItem("Select category");
- //ui->categorComboBox->addItem("-");
ui->categorComboBox->addItem("0 - 20 km/h",20);
ui->categorComboBox->addItem("0 - 40 km/h");
ui->categorComboBox->addItem("0 - 100 km/h");
ui->pushButtonInfo->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
}
+/**
+ * Destructor of this class.
+ * Deletes all dynamic objects and sets them to NULL.
+ */
accelerationstart::~accelerationstart()
{
delete ui;
delete accRealTimeDialog;
}
+/**
+ *
+ */
void accelerationstart::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
}
}
+/**
+ * This slot function called when ever calibration button clicked
+ */
void accelerationstart::on_buttonCalib_clicked()
{
if(accRealTimeDialog == NULL)
ui->buttonStart->setEnabled(true);
}
+/**
+ * This slot function called when ever start button clicked
+ */
void accelerationstart::on_buttonStart_clicked()
{
if( stopMeasureSpeed == 0 )
accRealTimeDialog->show();
}
+/**
+ * This slot function called when ever category combobox index changed.
+ *
+ * @param int index
+ */
void accelerationstart::on_categorComboBox_currentIndexChanged( int index )
{
stopMeasureSpeed = 0;
}
}
-
+/**
+ * Get measure categoty function.
+ *
+ * @return QString measure category
+ */
QString accelerationstart::getMeasureCategory()
{
return measureCategory;
/**
*This slot function emit mainwindow sendresult.
*
- **/
+ * @param double result
+ */
void accelerationstart::sendResult(double result)
{
emit sendresult(measureCategory, result);
* @author Rikhard Kuutti <rikhard.kuutti@fudeco.com>
* @author Kai Rasilainen <kai.rasilainen@fudeco.com>
* @author Jukka Kurttila <jktla@suomi24.fi>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
#define kIterations 100
/**
- * Default constructor for Accelerometer class
- *
- */
+ * Default constructor for Accelerometer class.
+ *
+ */
Accelerometer::Accelerometer()
{
initValues();
}
/**
- * Default destructor for Accelerometer class
- *
- */
+ * Default destructor for Accelerometer class.
+ * Deletes all dynamic objects and sets them to NULL.
+ */
Accelerometer::~Accelerometer()
{
if(calibrateDialog)
}
/**
- * Init class members
- *
- */
+ * Init class members.
+ *
+ */
void Accelerometer::initValues()
{
previousAccelerationX = 0;
}
/**
- * Smooths Accelerometer data by applying a low pass filter to data
- *
- * @param x accelerometer's x-axis input
- * @param y accelerometer's y-axis input
- * @param z accelerometer's z-axis input
- */
+ * Smooths Accelerometer data by applying a low pass filter to data.
+ *
+ * @param x accelerometer's x-axis input
+ * @param y accelerometer's y-axis input
+ * @param z accelerometer's z-axis input
+ */
void Accelerometer::smoothData(qreal &x, qreal &y, qreal &z)
{
x = (previousAccelerationX * (1 - kFilteringFactor)) + (x * kFilteringFactor);
}
/**
- * Gets the raw acceleration data from accelerometer
- *
- * @param x accelerometer's x-axis input
- * @param y accelerometer's y-axis input
- * @param z accelerometer's z-axis input
- */
+ * Gets the raw acceleration data from accelerometer.
+ *
+ * @param x accelerometer's x-axis input
+ * @param y accelerometer's y-axis input
+ * @param z accelerometer's z-axis input
+ */
void Accelerometer::getAcceleration(qreal &x, qreal &y, qreal &z)
{
#ifdef FROM_FILE
}
/**
- * Get the x calibration component
- *
- * @return calibrationX x calibration component
- */
+ * Get the x calibration component.
+ *
+ * @return calibrationX x calibration component
+ */
qreal Accelerometer::getCalibrationX()
{
return calibrationX;
}
/**
- * Get the y calibration component
- *
- * @return calibrationY y calibration component
- */
+ * Get the y calibration component.
+ *
+ * @return calibrationY y calibration component
+ */
qreal Accelerometer::getCalibrationY()
{
return calibrationY;
}
/**
- * Get the z calibration component
- *
- * @return calibrationZ z calibration component
- */
+ * Get the z calibration component.
+ *
+ * @return calibrationZ z calibration component
+ */
qreal Accelerometer::getCalibrationZ()
{
return calibrationZ;
#include "ui_accrealtimedialog.h"
#include <math.h>
+/**
+ * Default constructor for AccRealTimeDialog class.
+ *
+ */
AccRealTimeDialog::AccRealTimeDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AccRealTimeDialog)
resultDialog = NULL;
}
+/**
+ * Default destructor for AccRealTimeDialog class.
+ * Deletes all dynamic objects and sets them to NULL.
+ */
AccRealTimeDialog::~AccRealTimeDialog()
{
delete ui;
delete resultDialog;
}
+/**
+ *
+ */
void AccRealTimeDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
break;
}
}
+
/**
- *This function is called to read (and process) data from the accelerometer
+ * This function is called to read (and process) data from the accelerometer
*/
void AccRealTimeDialog::readAccelerometerData()
{
accelerometer->getAcceleration(x, y, z);
- // keep the following line as close to the SetKinematicsProperties method as possible
+ // keep the following line as close to the SetKinematicsProperties method as possible
currentTime = elapsedTime.elapsed();
- //accelerometer->smoothData(x, y, z);
-
- //Calculate average for Z
+ // Calculate average for Z
movingAverageZ->Enqueue(z);
z = movingAverageZ->Average();
- //Calculate average for Y
+ // Calculate average for Y
movingAverageY->Enqueue(y);
y = movingAverageY->Average();
if(calZ < 0)
calZ = -calZ;
- //Take acceleration from more affecting axel
+ // Take acceleration from more affecting axel
if(calZ < calY)
{
z = z*(1+calZ/2);
//screen up: y = 0, z = -1
//screen front: y = -1, z = 0
-// QString str = QString("acc x: " + QString::number(x) + "\n" +
-// "acc y: " + QString::number(y) + "\n" +
-// "acc z: " + QString::number(z) + "\n");
+ //QString str = QString("acc x: " + QString::number(x) + "\n" +
+ // "acc y: " + QString::number(y) + "\n" +
+ // "acc z: " + QString::number(z) + "\n");
//currentAcceleration = z;//sqrt(x*x + y*y + z*z);
//qDebug("y: %f, calibZ: %f, calibY: %f\n",y,accelerometer->getCalibrationZ(),accelerometer->getCalibrationY());
stopMeasureSpeed = 0;
}
+/**
+ *
+ */
void AccRealTimeDialog::Calibrate()
{
accelerometer->calibrate();
}
+/**
+ * This slot function called when ever abort button clicked.
+ */
void AccRealTimeDialog::on_buttonAbort_clicked()
{
accelerometerTimer->stop();
this->close();
}
+/**
+ *
+ */
void AccRealTimeDialog::startAccelerationMeasure()
{
double temp = stopMeasureSpeed;
accelerometerTimer->start(40);
}
+/**
+ *
+ * @param double speed
+ */
void AccRealTimeDialog::SetStopMeasureSpeed(double speed)
{
stopMeasureSpeed = speed;
/**
*This slot function emit accelerationstart sendresult.
*
- **/
+ * @param double result
+ */
void AccRealTimeDialog::sendResult(double result)
{
emit sendresult(result);
/*
* Calculate class to process accelerometer data
*
- * @author Kai Rasilainen
+ * @author Kai Rasilainen <kai.rasilainen@fudeco.com>
* @author Jukka Kurttila <jukka.kurttila@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
#include "calculate.h"
#include <math.h>
-
#include <QFile>
#include <QString>
#include <QTimer>
const double SECONDS_IN_HOUR = 3600;
const double AIR_DENSITY = 1.225;
const double WATTS_PER_HORSEPOWER = 745.69987158227025;
-
const double carFrontalArea = 1.5;
const double dragCoefficient = 0.31;
const int carWeight = 850;
+/**
+ * Default constructor for Calculate class.
+ */
Calculate::Calculate()
{
this->reset();
}
+/**
+ * Default destructor for Calculate class.
+ * Deletes all dynamic objects and sets them to NULL.
+ */
Calculate::~Calculate()
{
}
+/**
+ * This function reset all variables.
+ */
void Calculate::reset()
{
averageSpeed = 0;
speedCheckPoints.append(90);
speedCheckPoints.append(100);
}
-
checkPointCounter = 0;
checkPoint = speedCheckPoints[checkPointCounter];
valuesMap.clear();
-
}
-
/**
* This is a main function for calculating various parameters. Accelerometer
* provides currentAcceleration and calling function measures time (seconds).
* This function should be called 20-30 times/second to minimize
* calculation error.
-
- * To be added: ---
+ *
+ * @param double current acceleration
+ * @param double seconds
*/
void Calculate::calculateParameters(double currentAcceleration, double seconds)
{
* This function checks if acceleration has stopped for
* a short period of time. Velocity is set to zero to avoid
* distance errors.
+ *
+ * @param double current acceleration
*/
void Calculate::accelStoppedCheck(double currentAcceleration)
{
}
}
-// Getters and setters
-
+/**
+ * Get average speed.
+ *
+ * @return double average speed
+ */
double Calculate::getAverageSpeed()
{
return averageSpeed;
}
+/**
+ * Set average speed.
+ *
+ * @param double average speed
+ */
void Calculate::setAverageSpeed(double value)
{
averageSpeed = value;
}
+/**
+ * Get current speed.
+ *
+ * @return double current speed
+ */
double Calculate::getCurrentSpeed()
{
return currentSpeed;
}
+/**
+ * Set current speed.
+ *
+ * @param double current speed
+ */
void Calculate::setCurrentSpeed(double value)
{
currentSpeed = value;
}
+/**
+ * Get travelled distance.
+ *
+ * @return double travelled distance
+ */
double Calculate::getDistanceTraveled()
{
return distanceTraveled;
}
+/**
+ * Set travelled distance.
+ *
+ * @param double travelled distance
+ */
void Calculate::setDistanceTraveled(double value)
{
distanceTraveled = value;
}
+/**
+ * Get last acceleration.
+ *
+ * @return double last acceleration
+ */
double Calculate::getLastAcceleration()
{
return lastAcceleration;
}
+/**
+ * Set last acceleration.
+ *
+ * @param double last acceleration
+ */
void Calculate::setLastAcceleration(double value)
{
lastAcceleration = value;
}
+/**
+ * Get last distance.
+ *
+ * @return double last distance
+ */
double Calculate::getLastDistance()
{
return lastDistance;
}
+/**
+ * Set last distance.
+ *
+ * @param double last distance
+ */
void Calculate::setLastDistance(double value)
{
lastDistance = value;
}
+/**
+ * Get last speed.
+ *
+ * @return double last speed
+ */
double Calculate::getLastSpeed()
{
return lastSpeed;
}
+/**
+ * Set last speed.
+ *
+ * @param double last speed
+ */
void Calculate::setLastSpeed(double value)
{
lastSpeed = value;
}
+/**
+ * Get number of iterations.
+ *
+ * @return long number of iterations
+ */
long Calculate::getNumOfIterations()
{
return numOfIterations;
}
+/**
+ * Set number of iterations.
+ *
+ * @param long number of iterations
+ */
void Calculate::setNumOfIterations(long value)
{
numOfIterations = value;
}
+/**
+ * Get total time.
+ *
+ * @return double total time
+ */
double Calculate::getTotalTime()
{
return totalTime;
}
+/**
+ * Set total time.
+ *
+ * @param double total time
+ */
void Calculate::setTotalTime(double value)
{
totalTime = value;
}
+/**
+ * Get current power.
+ *
+ * @return double current power
+ */
double Calculate::getCurrentPower()
{
return currentPower;
}
+/**
+ * Set current power.
+ *
+ * @param double current power
+ */
void Calculate::setCurrentPower(double value)
{
currentPower = value;
}
+/**
+ * Get peek power.
+ *
+ * @return double peek power
+ */
double Calculate::getPeakPower()
{
return peakPower;
}
+/**
+ * Set peek power.
+ *
+ * @param double peek power
+ */
void Calculate::setPeakPower(double value)
{
peakPower = value;
}
+/**
+ * Get average power.
+ *
+ * @return double average power
+ */
double Calculate::getAveragePower()
{
if (numOfIterations > 0)
}
}
+/**
+ * Set average power.
+ *
+ * @param double average power
+ */
void Calculate::setAveragePower(double value)
{
averagePower = value;
}
+/**
+ * Get max speed.
+ *
+ * @return double max speed
+ */
double Calculate::getMaxSpeed()
{
return maxSpeed;
}
+/**
+ * Set max speed.
+ *
+ * @param double max speed
+ */
void Calculate::setMaxSpeed(double value)
{
maxSpeed = value;
}
+/**
+ * Get values map.
+ *
+ * @return QMap<int,double> values map.
+ */
QMap<int,double> Calculate::getValuesMap()
{
return valuesMap;
/*
* Calibrate dialog
*
- * @author Kai Rasilainen <kai.rasilainen@fudeco.com>
- * @copyright (c) 2010 Speed Freak team
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @author Kai Rasilainen <kai.rasilainen@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
+ * @copyright (c) 2010 Speed Freak team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
#include "calibratedialog.h"
#include "ui_calibratedialog.h"
+/**
+ * Default constructor for Calibrate dialog class.
+ *
+ */
CalibrateDialog::CalibrateDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::CalibrateDialog)
this->setWindowTitle("Calibrating...");
}
+/**
+ * Default destructor for Calibrate dialog class.
+ * Deletes all dynamic objects and sets them to NULL.
+ */
CalibrateDialog::~CalibrateDialog()
{
delete ui;
}
+/**
+ *
+ */
void CalibrateDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
}
}
+/**
+ * Set progressbar value.
+ *
+ * @param int progressbar value.
+ */
void CalibrateDialog::setProgressValue(int value)
{
ui->progressBar->setValue(value);
}
+/**
+ * Reset progressbar value.
+ */
void CalibrateDialog::resetProgressValue()
{
ui->progressBar->reset();
}
+/**
+ * Set max value.
+ *
+ * @param int max
+ */
void CalibrateDialog::setMaxValue(int max)
{
ui->progressBar->setMaximum( max );
}
+/**
+ * Set title.
+ *
+ * @param QString title
+ */
void CalibrateDialog::setTitle(QString title)
{
this->setWindowTitle(title);
#include "categorylist.h"
/**
- *Constructor of this class.
+ * Constructor of this class.
*/
CategoryList::CategoryList()
{
}
/**
- *Destructor of this class. Should be used to release all allocated resources.
+ * Destructor of this class. Should be used to release all allocated resources.
*/
CategoryList::~CategoryList()
{
}
/**
- *This is return function.
- *@return QStringList categoryList
+ * This is return function.
+ *
+ * @return QStringList categoryList
*/
QStringList CategoryList::getCategoryList()
{
}
/**
- *Append an item in the end of the categorylist.
- *@param Item.
+ * Append an item in the end of the categorylist.
+ *
+ * @param Item.
*/
void CategoryList::appendCategoryList(QString item)
{
}
/**
- *Input an item into the categorylist.
- *@param Index.
- *@param Item to be appended.
+ * Input an item into the categorylist.
+ *
+ * @param Index.
+ * @param Item to be appended.
*/
void CategoryList::fillCategoryList(int index, QString item)
{
}
/**
- *Show an item of the categorylist.
- *@param Index.
+ * Show an item of the categorylist.
+ *
+ * @param int Index.
*/
QString CategoryList::itemOfCategoryList(int index)
{
}
/**
- *Clear categorylist.
+ * Clear categorylist.
*/
void CategoryList::clearCategoryList()
{
}
/**
- *Read size of categorylist.
+ * Read size of categorylist.
*/
int CategoryList::sizeOfCategoryList()
{
}
/**
- *Append an item in the end of the categoryelementable.
- *@param Index.
- *@param Description of category.
- *@param Unit.
- *@param Category.
+ * Append an item in the end of the categoryelementable.
+ *
+ * @param int Index.
+ * @param QString Description of category.
+ * @param QString Unit.
+ * @param QString Category.
*/
void CategoryList::appendCats(int ind, QString des, QString uni, QString cat)
{
}
/**
- *Search description for an index af cats table.
- *@param Index.
+ * Search description for an index af cats table.
+ *
+ * @param int Index.
*/
QString CategoryList::getRecentDescription(int ind)
{
}
/**
- *Search category for an index af cats table.
- *@param Index.
+ * Search category for an index af cats table.
+ *
+ * @param int Index.
*/
QString CategoryList::getRecentCategory(int ind)
{
}
/**
- *Clear cats.
+ * Clear cats.
*/
void CategoryList::clearCats()
{
}
/**
- *This function is used to get items to top list of the category that is chosen from combobox.
- *@param QString category
- *@param int size
- *@todo Now there is only one (the latest top10List). Later picking up the requested category.
+ * This function is used to get items to top list of the category that is chosen from combobox.
+ *
+ * @param QString category
+ * @param int size
*/
QString CategoryList::getTopList( QString category, int size)
{
return emptyStr;
}
}
-
/*
* Credits Dialog
*
- * @author Rikhard Kuutti <rikhard.kuutti@fudeco.com>
- * @copyright (c) 2010 Speed Freak team
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @author Rikhard Kuutti <rikhard.kuutti@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
+ * @copyright (c) 2010 Speed Freak team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
#include "creditsdialog.h"
#include "ui_creditsdialog.h"
-
#include <QDesktopServices>
#include <QUrl>
+/**
+ * Constructor of this class.
+ */
CreditsDialog::CreditsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::CreditsDialog)
this->setWindowTitle("Credits");
}
+/**
+ * Destructor of this class. Should be used to release all allocated resources.
+ */
CreditsDialog::~CreditsDialog()
{
delete ui;
}
+/**
+ *
+ */
void CreditsDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
/*
* Custom button class for customized button.
*
- * @author Jukka Kurttila <jktla@suomi24.fi>
- * @copyright (c) 2010 Speed Freak team
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @author Jukka Kurttila <jktla@suomi24.fi>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
+ * @copyright (c) 2010 Speed Freak team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
#include "custombutton.h"
-
#include <QPainter>
#include <QIcon>
/**
- *Constructor of this class.
+ * Constructor of this class.
*/
CustomButton::CustomButton(QWidget *parent, QIcon *icon) : QWidget(parent)
{
bPressed = false;
- //Get size of the icon
+ // Get size of the icon
QList<QSize> list = icon->availableSizes(QIcon::Normal,QIcon::On);
- //If icon is empty, do not create pixmaps and leave
+ // If icon is empty, do not create pixmaps and leave
if(list.isEmpty())
return;
QSize size = list.first();
pict2 = new QPixmap(icon->pixmap(size.width(),size.height(),QIcon::Normal,QIcon::Off));
}
}
+
/**
- *Destructor of this class.
+ * Destructor of this class.
*/
CustomButton::~CustomButton()
{
delete pict2;
}
+/**
+ *
+ */
void CustomButton::paintEvent(QPaintEvent *)
{
QPainter painter(this);
else
painter.drawPixmap(0,0,*pict1);
- //Debug print
- //painter.drawText(50,50,"y: "+QString::number(mY));
+ // Debug print
+ // painter.drawText(50,50,"y: "+QString::number(mY));
}
+
+/**
+ * Mouse press event.
+ *
+ * @param QMouseEvent me
+ */
void CustomButton::mousePressEvent(QMouseEvent* me)
{
bPressed = true;
repaint();
}
+
+/**
+ * Mouse release event.
+ *
+ * @param QMouseEvent me
+ */
void CustomButton::mouseReleaseEvent(QMouseEvent* me)
{
mX = me->x();
mY = me->y();
- //Emit open dialog signal if mouse is still over button
+ // Emit open dialog signal if mouse is still over button
if( mY < this->height() && mY > 0 && mX < this->width() && mX > 0 )
emit OpenDialog();
bPressed = false;
repaint();
}
+
+/**
+ * Mouse move event.
+ *
+ * @param QMouseEvent me
+ */
void CustomButton::mouseMoveEvent(QMouseEvent* me)
{
mX = me->x();
mY = me->y();
- //Is mouse moved outside button?
+ // Is mouse moved outside button?
if( mY > this->height() || mY < 0 || mX > this->width() || mX < 0 )
bPressed = false;
else
/*
* File reader class for reading acceleration data from file.
*
- * @author Jukka Kurttila <jktla@suomi24.fi>
+ * @author Jukka Kurttila <jktla@suomi24.fi>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
#include "filereader.h"
#include <QFileDialog>
+/**
+ * Constructor of this class.
+ */
filereader::filereader()
{
}
+
+/**
+ * Destructor of this class. Should be used to release all allocated resources.
+ */
filereader::~filereader()
{
if(!fileName.isEmpty())
file.close();
}
+/**
+ * Read line.
+ *
+ * @param qreal &x
+ * @param qreal &y
+ * @param qreal &z
+ */
void filereader::ReadLine( qreal &x, qreal &y, qreal &z )
{
if(fileName.isEmpty())
return;
QString line = file.readLine();
- //Get x
+ // Get x
std::string line2(line.toUtf8());
QString temp2( temp.c_str() );
x = temp2.toFloat();
- //Get y
+ // Get y
line2.erase(0,line2.find_first_of("y"));
line2.erase(0,3);
temp2 = temp.c_str();
y = temp2.toFloat();
- //Get z
+ // Get z
line2.erase(0,line2.find_first_of("z"));
line2.erase(0,3);
- //Is there space character?
+ // Is there space character?
if(line2.find_first_of(" ") != std::string::npos)
{
temp = line2.substr(0,line2.find_first_of(" "));
temp2 = temp.c_str();
z = temp2.toFloat();
}
+
+/**
+ * Set file name.
+ *
+ * QString input file name
+ */
void filereader::setFileName(QString inputFileName)
{
fileName = inputFileName;
#include <QDebug>
/**
- *Default constructor of this class.
+ * Default constructor of this class.
*/
GPSData::GPSData(Maemo5Location *maemo5location)
{
}
/**
- *Destructor of this class. Deletes all dynamic objects and sets them to NULL.
+ * Destructor of this class. Deletes all dynamic objects and sets them to NULL.
*/
GPSData::~GPSData()
{
}
/**
- * This function reset all variables
+ * This function reset all variables.
*/
void GPSData::resetAll()
{
}
/**
- *This slot function is called when gprs update location.
+ * This slot function is called when gprs update location.
*/
void GPSData::awcp()
{
-
}
/**
- *This slot function is called when .
+ * This slot function is called when .
*/
void GPSData::locationUpdated()
{
-
}
/**
- *This slot function is called when .
+ * This slot function is called when .
*/
void GPSData::gpsConnected()
{
-
}
/**
- *This slot function is called when .
+ * This slot function is called when .
*/
void GPSData::gpsDisconnected()
{
-
}
/**
- *This slot function is called when .
+ * This slot function is called when .
*/
void GPSData::gpsError()
{
-
}
/**
- *This slot function is called when .
+ * This slot function is called when .
*/
void GPSData::gpsdRunning()
{
-
}
/**
- *This slot function is called when .
+ * This slot function is called when .
*/
void GPSData::gpsdStopped()
{
-
}
/**
- *This function start route recording.
- *@param QString time recording start time.
+ * This function start route recording.
+ *
+ * @param QString time recording start time.
*/
void GPSData::startRouteRecording()
{
}
/**
- *This function stop route recording.
- *@param QString time recording stop time.
+ * This function stop route recording.
+ *
+ * @param QString time recording stop time.
*/
void GPSData::stopRouteRecording()
{
}
/**
- *This function write route to .xml file.
+ * This function write route to .xml file.
+ *
+ * @param QIODevice *device
+ * @param int round
*/
void GPSData::writeRouteXml(QIODevice *device, int round)
{
}
/**
- *This function returns distance traveled since recording started.
+ * This function returns distance traveled since recording started.
+ *
+ * @return double distance
*/
double GPSData::getDistanceTraveled()
{
}
/**
- *This function returns direction of motion in degrees(0-359).
- *@return double track
+ * This function returns direction of motion in degrees(0-359).
+ *
+ * @return double track
*/
double GPSData::getDirection()
{
+/*
+ * Help acceleration dialog.
+ *
+ * @author Toni Jussila <toni.jussila@fudeco.com>
+ * @copyright (c) 2010 Speed Freak team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ */
+
#include "helpaccelerationdialog.h"
#include "ui_helpaccelerationdialog.h"
+/**
+ * Default constructor of this class.
+ */
HelpAccelerationDialog::HelpAccelerationDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::HelpAccelerationDialog)
ui->labelInfo4->hide();
}
+/**
+ * Default destructor of this class.
+ */
HelpAccelerationDialog::~HelpAccelerationDialog()
{
delete ui;
}
+/**
+ *
+ */
void HelpAccelerationDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
}
}
+/**
+ * This slot function called when ever next button clicked.
+ */
void HelpAccelerationDialog::on_pushButtonNext_clicked()
{
pageCounter ++;
}
}
+/**
+ * This slot function called when ever last button clicked.
+ */
void HelpAccelerationDialog::on_pushButtonLast_clicked()
{
pageCounter --;
/*
* Help dialog
*
- * @author Janne Änäkkälä <janne.anakkala@fudeco.com>
+ * @author Janne Änäkkälä <janne.anakkala@fudeco.com>
* @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
#include <QDebug>
/**
- * Constructor
+ * Default constructor of this class.
*/
HelpDialog::HelpDialog(QWidget *parent) :
QDialog(parent),
}
/**
- * Destructor
+ * Default destructor of this class.
*/
HelpDialog::~HelpDialog()
{
}
/**
- *
+ * This slot function called when ever help results button clicked.
*/
void HelpDialog::on_pushButtonHelpResults_clicked()
{
}
/**
- *
+ * This slot function called when ever help accelerate button clicked.
*/
void HelpDialog::on_pushButtonHelpAccelerate_clicked()
{
}
/**
- *
+ * This slot function called when ever help route button clicked.
*/
void HelpDialog::on_pushButtonHelpRoute_clicked()
{
}
/**
- *
+ * This slot function called when ever credits button clicked.
*/
void HelpDialog::on_pushButtonCredits_clicked()
{
}
/**
- *
+ * This slot function called when ever help settings button clicked.
*/
void HelpDialog::on_pushButtonHelpSettings_clicked()
{
/*
* Help dialog
*
- * @author Janne Änäkkälä <janne.anakkala@fudeco.com>
+ * @author Janne Änäkkälä <janne.anakkala@fudeco.com>
* @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
#include <helpresultsdialog.h>
#include <helpaccelerationdialog.h>
#include <helproutingdialog.h>
-#include "creditsdialog.h"
#include <helpsettingsdialog.h>
+#include "creditsdialog.h"
namespace Ui {
class HelpDialog;
+/*
+ * Help result dialog
+ *
+ * @author Janne Änäkkälä <janne.anakkala@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
+ * @copyright (c) 2010 Speed Freak team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ */
+
#include "helpresultsdialog.h"
#include "ui_helpresultsdialog.h"
+/**
+ * Default constructor of this class.
+ */
HelpResultsDialog::HelpResultsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::HelpResultsDialog)
ui->setupUi(this);
}
+/**
+ * Default destructor of this class.
+ */
HelpResultsDialog::~HelpResultsDialog()
{
delete ui;
}
+/**
+ *
+ */
void HelpResultsDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
+/*
+ * Help routing dialog
+ *
+ * @author Janne Änäkkälä <janne.anakkala@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
+ * @copyright (c) 2010 Speed Freak team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ */
+
#include "helproutingdialog.h"
#include "ui_helproutingdialog.h"
+/**
+ * Default constructor of this class.
+ */
HelpRoutingDialog::HelpRoutingDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::HelpRoutingDialog)
ui->labelSavePic->hide();
}
+/**
+ * Default destructor of this class.
+ */
HelpRoutingDialog::~HelpRoutingDialog()
{
delete ui;
}
+/**
+ *
+ */
void HelpRoutingDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
}
}
+/**
+ * This slot function called when ever next button clicked.
+ */
void HelpRoutingDialog::on_pushButtonNext_clicked()
{
pageCounter ++;
}
}
+/**
+ * This slot function called when ever last button clicked.
+ */
void HelpRoutingDialog::on_pushButtonLast_clicked()
{
pageCounter --;
+/*
+ * Help settings dialog
+ *
+ * @author Janne Änäkkälä <janne.anakkala@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
+ * @copyright (c) 2010 Speed Freak team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ */
+
#include "helpsettingsdialog.h"
#include "ui_helpsettingsdialog.h"
+/**
+ * Default constructor of this class.
+ */
HelpSettingsDialog::HelpSettingsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::HelpSettingsDialog)
ui->pushButtonLast->hide();
}
+/**
+ * Default destructor of this class.
+ */
HelpSettingsDialog::~HelpSettingsDialog()
{
delete ui;
}
+/**
+ *
+ */
void HelpSettingsDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
}
}
+/**
+ * This slot function called when ever next button clicked.
+ */
void HelpSettingsDialog::on_pushButtonNext_clicked()
{
pageCounter ++;
}
}
+/**
+ * This slot function called when ever last button clicked.
+ */
void HelpSettingsDialog::on_pushButtonLast_clicked()
{
pageCounter --;
* Http client Connects application to server.
*
* @author Tiina Kivilinna-Korhola <tiina.kivilinna-korhola@fudeco.com>
- * @author Olavi Pulkkinen <olavi.pulkkinen@fudeco.com>
- * @author Toni Jussila <toni.jussila@fudeco.com>
+ * @author Olavi Pulkkinen <olavi.pulkkinen@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
#include "mainwindow.h"
/**
- *@brief Constructor, connects object to GUI
- *@param Pointer to carmainwindow, which is temporarily used during development
+ * Constructor, connects object to GUI
+ *
+ * @param Pointer to carmainwindow, which is temporarily used during development
*/
HttpClient::HttpClient(MainWindow *myCarw)
{
}
/**
- *@brief Destructor
+ * Destructor
*/
HttpClient::~HttpClient()
{
}
/**
- *@brief Sends registration information to the server in xml format.
- *Reads user name, password and emaol address from resuldialogs internal variables.
+ * Sends registration information to the server in xml format.
+ * Reads user name, password and emaol address from resuldialogs internal variables.
*/
void HttpClient::requestRegistration()
{
qDebug() << "carmainwindow: regbuffer->data(): " << regbuffer->data();
- currentDownload = netManager->post(request, ("xml=" + regbuffer->data()));
+ // Registration with picture. Send picture to server
+ if(myMainw->settingsDialog->registerDialog->getPicture() != "" )//&& error == false)
+ {
+ qDebug() << "__Registration with picture";
+ QFile pictureFile( myMainw->settingsDialog->registerDialog->getPicture() );
+ if (!pictureFile.open(QIODevice::ReadOnly))
+ {
+ qDebug() << "__picture read fail";
+ return;
+ }
+ //currentDownload = netManager->post(request, pictureFile.readAll());
+ currentDownload = netManager->post(request, ("xml=" + regbuffer->data(), "avatar=" + pictureFile.readAll()));
+ //connect(currentDownload, SIGNAL(finished()), this, SLOT(ackOfSendingPicture()));
+ pictureFile.close();
+ }
+ // Registration Without picture
+ else
+ {
+ qDebug() << "____Registration without picture";
+ currentDownload = netManager->post(request, ("xml=" + regbuffer->data()));
+ }
+
connect(currentDownload,SIGNAL(finished()),this,SLOT(ackOfRegistration()));
//connect(currentDownload,SIGNAL(error(QNetworkReply::NetworkError)),myMainw,SLOT(errorFromServer(QNetworkReply::NetworkError)));
}
/**
- *@brief Sends result(s) to the server in xml format.
- *Send authentication information in the header.
+ * Sends result(s) to the server in xml format.
+ * Send authentication information in the header.
*/
void HttpClient::sendResultXml(QString category, double result)
{
}
/**
- * @brief Sends route to the server in xml format.
+ * Sends route to the server in xml format.
* Send authentication information in the header.
+ *
* @param QString filename
* @param int 1(send to server) or 0(no send)
- * @todo Check destination URL.
*/
void HttpClient::sendRouteXml(QString oldName, QString newName, int i)
{
}
/**
- *@brief Request the Top10List of certain category from the server.
- *Send authentication information in the header.
- *@param Category of results.
- *@param Limit, the number of results.
+ * Request the Top10List of certain category from the server.
+ * Send authentication information in the header.
+ *
+ * @param Category of results.
+ * @param Limit, the number of results.
*/
void HttpClient::requestTopList(QString category, QString limit)
{
}
/**
- *@brief Request categories list from the server.
- *Send authentication information in the header.
+ * Request categories list from the server.
+ * Send authentication information in the header.
*/
void HttpClient::requestCategories()
{
}
/**
- *@brief Check that username and password exist on the server.
- *Send authentication information in the header.
+ * Check that username and password exist on the server.
+ * Send authentication information in the header.
*/
void HttpClient::checkLogin()
{
}
/**
- *@brief React to servers responce after result has been sent.
+ * React to servers responce after result has been sent.
*/
void HttpClient::ackOfResult()
{
}
/**
- *@brief React to servers responce after route has been sent.
+ * React to servers responce after route has been sent.
*/
void HttpClient::ackOfRoute()
{
}
/**
- *@brief React to servers responce after registration has been sent.
- *@todo Implement consequencies of reply.
+ * React to servers responce after registration has been sent.
*/
void HttpClient::ackOfRegistration()
{
}
/**
- *@brief React to servers responce after request for categories has been sent.
+ * React to servers responce after request for categories has been sent.
*/
void HttpClient::ackOfCategories()
{
}
/**
- *@brief React to servers responce after request of TopList in certain category has been sent.
+ * React to servers responce after request of TopList in certain category has been sent.
*/
void HttpClient::ackOfLogin()
{
}
/**
- *@brief Reports errors, when server has sent error signal.
+ * Reports errors, when server has sent error signal.
*/
void HttpClient::errorFromServer(QNetworkReply::NetworkError errorcode)
{
}
/**
- *@brief React to servers responce after request of TopList in certain category has been sent.
+ * React to servers responce after request of TopList in certain category has been sent.
*/
void HttpClient::ackOfToplist()
{
}
/**
- *@brief Request the user information of certain user from the server.
- *Send authentication information in the header.
- *@param username which information we want.
+ * Request the user information of certain user from the server.
+ * Send authentication information in the header.
+ *
+ * @param QString username which information we want.
*/
void HttpClient::requestUserInfo(QString username)
{
}
/**
- *@brief React to servers responce after request the user information of certain user.
+ * React to servers responce after request the user information of certain user.
*/
void HttpClient::ackOfUserInfo()
{
}
/**
- *@brief Request the users list of all users from the server.
- *Send authentication information in the header.
+ * Request the users list of all users from the server.
+ * Send authentication information in the header.
*/
void HttpClient::requestUsers()
{
}
/**
- *@brief React to servers responce after request the users list of all users.
+ * React to servers responce after request the users list of all users.
*/
void HttpClient::ackOfUsers()
{
qDebug() << "ackUsers";
- /* QString fileName = "jtn.xml";
- QFile file(fileName);
- //file.setFileName( "routetemp.xml");
- if (!file.open(QFile::ReadOnly))
- {
- qDebug() << "_xmlShow fail";
- return;
- }
-
- myXmlreader->xmlReadUsers(&file);
- file.close();
-
- for(int i = 0; i < myXmlreader->usersList->count(); i++)
- {
- myMainw->settingsDialog->sendUsernameToUsersDialog(myXmlreader->usersList->at(i));
- }*/
-
- qDebug() << "ackUsers";
//if(myMainw->topResultDialog)
// myMainw->topResultDialog->setLabelInfoToUser("");
/**
* This slot function called when userInfo signal is emitted from xmlreader.
- *@param usersInfo includes information from certain user.
+ *
+ * @param QStringList usersInfo includes information from certain user.
*/
void HttpClient::sendUsersInfo(QStringList* usersInfo)
{
* Instructions dialog for speedFreak project
*
* @author Rikhard Kuutti <rikhard.kuutti@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
#include "instructionsdialog.h"
#include "ui_instructionsdialog.h"
+/**
+ * Default constructor of this class.
+ */
InstructionsDialog::InstructionsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::InstructionsDialog)
this->setWindowTitle("Help");
}
+/**
+ * Default destructor of this class.
+ */
InstructionsDialog::~InstructionsDialog()
{
delete ui;
}
+/**
+ *
+ */
void InstructionsDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
#include <QDebug>
/**
- *Default constructor of this class.
- *@param QObject pointer to parent object. By default the value is NULL.
+ * Default constructor of this class.
+ *
+ * @param QObject pointer to parent object. By default the value is NULL.
*/
Maemo5Location::Maemo5Location(QObject* parent):QObject(parent)
{
}
/**
- *Destructor of this class. Should be used to release all allocated resources.
+ * Destructor of this class. Should be used to release all allocated resources.
*/
Maemo5Location::~Maemo5Location()
{
}
/**
- *Start polling gps.
+ * Start polling gps.
*/
void Maemo5Location::startPollingGPS()
{
}
/**
- *Stop polling gps.
+ * Stop polling gps.
*/
void Maemo5Location::stopPollingGPS()
{
}
/**
- *Returns number of satellites in use.
+ * Get number of satellites in use.
+ *
+ * @return int satellites in use
*/
int Maemo5Location::getSatellitesInUse()
{
}
/**
- *Returns number of satellites in view.
+ * Get number of satellites in view.
+ *
+ * @return int satellites in view
*/
int Maemo5Location::getSatellitesInView()
{
}
/**
- *Returns average signal strength of satellites which are in use.
+ * Get average signal strength of satellites which are in use.
+ *
+ * @return int signal strength
*/
int Maemo5Location::getSignalStrength()
{
}
/**
- *Returns gps online.
+ * Get gps online.
+ *
+ * @return bool gps online
*/
bool Maemo5Location::getGpsOnline()
{
}
/**
- *Returns latitude.
+ * Get latitude.
+ *
+ * @return double latitude
*/
double Maemo5Location::getLatitude()
{
}
/**
- *Returns longitude.
+ * Get longitude.
+ *
+ * @return double longitude
*/
double Maemo5Location::getLongitude()
{
}
/**
- *Returns timestamp of the update in seconds.
+ * Get timestamp of the update in seconds.
+ *
+ * @return double time
*/
double Maemo5Location::getTime()
{
}
/**
- *Returns time accuracy in seconds.
+ * Get time accuracy in seconds.
+ *
+ * @return double ept
*/
double Maemo5Location::getEpt()
{
}
/**
- *Returns horizontal position accuracy in cm.
+ * Get horizontal position accuracy in cm.
+ *
+ * @return double eph
*/
double Maemo5Location::getEph()
{
}
/**
- *Returns fix altitude in meters.
+ * Get fix altitude in meters.
+ *
+ * @return double altitude
*/
double Maemo5Location::getAltitude()
{
}
/**
- *Returns altitude accuracy in meters.
+ * Get altitude accuracy in meters.
+ *
+ * @return double epv
*/
double Maemo5Location::getEpv()
{
}
/**
- *Returns direction of motion in degrees(0-359).
+ * Get direction of motion in degrees(0-359).
+ *
+ * @return double track
*/
double Maemo5Location::getTrack()
{
}
/**
- *Returns track accuracy in degrees.
+ * Get track accuracy in degrees.
+ *
+ * @return double epd
*/
double Maemo5Location::getEpd()
{
}
/**
- *Returns current speed in km/h.
+ * Get current speed in km/h.
+ *
+ * @return double speed
*/
double Maemo5Location::getSpeed()
{
}
/**
- *Returns speed accuracy in km/h.
+ * Get speed accuracy in km/h.
+ *
+ * @return double eps
*/
double Maemo5Location::getEps()
{
}
/**
- *Returns current rate of climb in m/s.
+ * Get current rate of climb in m/s.
+ *
+ * @return double climb
*/
double Maemo5Location::getClimb()
{
}
/**
- *Returns climb accuracy in m/s.
+ * Get climb accuracy in m/s.
+ *
+ * @return double epc
*/
double Maemo5Location::getEpc()
{
}
/**
- *Returns distance between two points in kilometers.
- *@param latitude of first point
- *@param longitude of first point
- *@param latitude of second point
- *@param longitude of second point
+ * Get distance between two points in kilometers.
+ *
+ * @param double latitude of first point
+ * @param double longitude of first point
+ * @param double latitude of second point
+ * @param double longitude of second point
+ * @return double distance
*/
double Maemo5Location::distance_between_two_points(double latitude_s, double longitude_s, double latitude_f, double longitude_f)
{
#include <QDebug>
/**
- *Default constructor of this class.
- *@param Maemo5Location pointer to public interface.
+ * Default constructor of this class.
+ *
+ * @param Maemo5Location pointer to public interface.
*/
Maemo5LocationPrivate::Maemo5LocationPrivate(Maemo5Location* location):QObject(location)
{
}
/**
- *Destructor of this class. Should be used to release all allocated resources.
+ * Destructor of this class. Should be used to release all allocated resources.
*/
Maemo5LocationPrivate::~Maemo5LocationPrivate()
{
}
/**
- *This function is used to start to poll with gprs
+ * This function is used to start to poll with gprs
*/
void Maemo5LocationPrivate::get_acwp()
{
}
/**
- *This function starts to poll via gps interface
+ * This function starts to poll via gps interface
*/
void Maemo5LocationPrivate::get_agnss()
{
}
/**
- *Stop polling gps
+ * Stop polling gps
*/
void Maemo5LocationPrivate::stop()
{
}
/**
- *Stop and restart polling
+ * Stop and restart polling
*/
void Maemo5LocationPrivate::restart()
{
}
/**
- *This function is called when device managed to connect to the lcoation server.
- *Function emits gps_connected signal.
- *@param Pointer to LocationGPSDevice class
- *@param Pointer to Maemo5LocationPrivate class
+ * This function is called when device managed to connect to the lcoation server.
+ * Function emits gps_connected signal.
+ *
+ * @param Pointer to LocationGPSDevice class
+ * @param Pointer to Maemo5LocationPrivate class
*/
void gps_connected_func(LocationGPSDevice *device, Maemo5LocationPrivate *gps)
{
}
/**
- *This function is called when device is disconnected from the location server.
- *Function emits gps_disconnected signal.
- *Also this function resets all arguments of Maemo5LcoationPrivate class.
- *@param Pointer to LocationGPSDevice class
- *@param Pointer to Maemo5LocationPrivate class
+ * This function is called when device is disconnected from the location server.
+ * Function emits gps_disconnected signal.
+ * Also this function resets all arguments of Maemo5LcoationPrivate class.
+ *
+ * @param Pointer to LocationGPSDevice class
+ * @param Pointer to Maemo5LocationPrivate class
*/
void gps_disconnected_func(LocationGPSDevice *device, Maemo5LocationPrivate *gps)
{
}
/**
- *This function is called after the location_gpsd_control_stop has been called.
- *@param Pointer to LocationGPSDControl class
- *@param Pointer to Maemo5LocationPrivate class
+ * This function is called after the location_gpsd_control_stop has been called.
+ *
+ * @param Pointer to LocationGPSDControl class
+ * @param Pointer to Maemo5LocationPrivate class
*/
void gpsd_stopped_func(LocationGPSDControl *control, Maemo5LocationPrivate *gps)
{
}
/**
- *This function is called when an error has occurred.
- *@param Pointer to LocationGPSDControl class
- *@param error code
- *@param Pointer to Maemo5LocationPrivate class
+ * This function is called when an error has occurred.
+ *
+ * @param Pointer to LocationGPSDControl class
+ * @param error code
+ * @param Pointer to Maemo5LocationPrivate class
*/
void gps_error_func(LocationGPSDControl *control, gint error, Maemo5LocationPrivate *gps)
{
}
/**
- *This function is called after the location_gpsd_control_start has been called.
- *@param Pointer to LocationGPSDControl class
- *@param Pointer to Maemo5LocationPrivate class
+ * This function is called after the location_gpsd_control_start has been called.
+ *
+ * @param Pointer to LocationGPSDControl class
+ * @param Pointer to Maemo5LocationPrivate class
*/
void gpsd_running_func(LocationGPSDControl *control, Maemo5LocationPrivate *gps)
{
}
/**
- *Callback function to catch gps signals.
- *@param Pointer to LocationGPSDControl class
- *@param Pointer to Maemo5LocationPrivate class
+ * Callback function to catch gps signals.
+ *
+ * @param Pointer to LocationGPSDControl class
+ * @param Pointer to Maemo5LocationPrivate class
*/
void gps_data_changed(LocationGPSDevice *device, Maemo5LocationPrivate *gps)
{
}
/**
- *Resets all arguments of Maemo5LocationPrivate class.
+ * Resets all arguments of Maemo5LocationPrivate class.
*/
void Maemo5LocationPrivate::resetAll()
{
}
/**
- *Returns distance between two points in kilometers.
- *@param latitude of first point
- *@param longitude of first point
- *@param latitude of second point
- *@param longitude of second point
+ * Get distance between two points in kilometers.
+ *
+ * @param double latitude of first point
+ * @param double longitude of first point
+ * @param double latitude of second point
+ * @param double longitude of second point
+ * @return double distance
*/
double Maemo5LocationPrivate::distance_between_two_points(double latitude_s, double longitude_s, double latitude_f, double longitude_f)
{
+/*
+ * Main
+ *
+ * @copyright (c) 2010 Speed Freak team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ */
+
#include <QtGui/QApplication>
#include "mainwindow.h"
*
* @author Rikhard Kuutti <rikhard.kuutti@fudeco.com>
* @author Toni Jussila <toni.jussila@fudeco.com>
+ * @author Janne Änäkkälä <janne.anakkala@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
-#include "mainwindow.h"
-#include "ui_mainwindow.h"
-
#include <QDesktopServices>
#include <QUrl>
#include <QSettings>
#include <QDebug>
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
#include "usersettings.h"
/**
- *
+ * Constructor of this class.
*/
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
this->setUsernameToMainPanel();
- //Create icon for acceleration start button
+ // Create icon for acceleration start button
QIcon* icon = new QIcon();
icon->addFile(QString(":/new/prefix1/Graphics/Speedometer.png"), QSize(125,125), QIcon::Normal, QIcon::Off);
icon->addFile(QString(":/new/prefix1/Graphics/Speedometer2.png"), QSize(125,125), QIcon::Normal, QIcon::On);
- //Acceleration start button
+ // Acceleration start button
customButtonAccelerate = new CustomButton(this,icon);
delete icon;
connect(customButtonAccelerate, SIGNAL(OpenDialog()), this, SLOT(OpenAccStartDialog()));
customButtonAccelerate->show();
- //Create icon for route dialog button
+ // Create icon for route dialog button
icon = new QIcon();
icon->addFile(QString(":/new/prefix1/Graphics/route.png"), QSize(125,125), QIcon::Normal, QIcon::Off);
icon->addFile(QString(":/new/prefix1/Graphics/route_selected.png"), QSize(125,125), QIcon::Normal, QIcon::On);
- //Route dialog button
-
+ // Route dialog button
customButtonRoute = new CustomButton(this,icon);
delete icon;
connect(customButtonRoute, SIGNAL(OpenDialog()), this, SLOT(OpenRouteDialog()));
customButtonRoute->show();
- //Create icon for results dialog button
+ // Create icon for results dialog button
icon = new QIcon();
icon->addFile(QString(":/new/prefix1/Graphics/trophy_gold.png"), QSize(125,125), QIcon::Normal, QIcon::Off);
icon->addFile(QString(":/new/prefix1/Graphics/trophy_gold_selected.png"), QSize(125,125), QIcon::Normal, QIcon::On);
- //Results dialog button
-
+ // Results dialog button
customButtonResults = new CustomButton(this,icon);
delete icon;
icon->addFile(QString(":/new/prefix1/Graphics/settings.png"), QSize(125,125), QIcon::Normal, QIcon::Off);
icon->addFile(QString(":/new/prefix1/Graphics/settings_selected.png"), QSize(125,125), QIcon::Normal, QIcon::On);
- //Settings dialog button
-
+ // Settings dialog button
customButtonSettings = new CustomButton(this,icon);
delete icon;
//Users dialog button
customButtonUsers = new CustomButton(this,icon);
+
+ // Create icon for www page button
+ icon = new QIcon();
+ icon->addFile(QString(":/new/prefix1/Graphics/applications_internet.png"), QSize(125,125), QIcon::Normal, QIcon::Off);
+ icon->addFile(QString(":/new/prefix1/Graphics/applications_internet_selected.png"), QSize(125,125), QIcon::Normal, QIcon::On);
+
+ // WWW page button
+ customButtonWWW = new CustomButton(this,icon);
+
delete icon;
buttons_x += 140;
connect(customButtonUsers, SIGNAL(OpenDialog()), this, SLOT(openUsersDialog()));
customButtonUsers->show();
- //Create icon for help dialog button
+ // Create icon for help dialog button
icon = new QIcon();
icon->addFile(QString(":/new/prefix1/Graphics/info.png"), QSize(85,85), QIcon::Normal, QIcon::Off);
icon->addFile(QString(":/new/prefix1/Graphics/info_selected.png"), QSize(85,85), QIcon::Normal, QIcon::On);
- //Help dialog button
-
+ // Help dialog button
customButtonHelp = new CustomButton(this,icon);
delete icon;
}
/**
- *
+ * Destructor of this class
*/
MainWindow::~MainWindow()
{
}
/**
- *This slot function is called when ever mytTopResultDialog emits signal refreshCategoryList button clicked.
+ * This slot function is called when ever mytTopResultDialog emits signal refreshCategoryList button clicked.
*/
void MainWindow::clientRequestCategoryList()
{
}
/**
- *This slot function is called when ever mytTopResultDialog emits signal refreshTopList button clicked.
+ * This slot function is called when ever mytTopResultDialog emits signal refreshTopList button clicked.
+ *
+ * @param int index
*/
void MainWindow::clientRequestTopList(int index)
{
}
/**
- *This function is used to set items to category combobox.
- *@param
+ * This function is used to set items to category combobox.
*/
void MainWindow::setCategoryCompoBox()
{
}
/**
- *This function prcesses UI updating after a new top10List has been received.
- *@todo Check where limitNr is taken, fixed or user input, see on_comboBoxTopCategory_currentIndexChanged.
+ * This function prcesses UI updating after a new top10List has been received.
+ *
+ * @todo Check where limitNr is taken, fixed or user input, see on_comboBoxTopCategory_currentIndexChanged.
*/
void MainWindow::showTop10()
{
}
/**
- *This function is used to set items to labelTopList. Top-tab view.
- *@param Category
- *@param Size, number of results.
+ * This function is used to set items to labelTopList.
+ *
+ * @param QString Category
+ * @param int Size, number of results.
*/
void MainWindow::setListViewTopList(QString category, int size)
{
*/
void MainWindow::clientUserLogin()
{
-
if(httpClient)
{
connect(httpClient, SIGNAL(loginOK()), this, SLOT(setUsernameToMainPanel()));
/**
* This function send route data to server.
+ *
* @param QString oldName, old file name
* @param QString newName, new file name
* @param int i
/**
* This function send acceleration data to server.
+ *
+ * @param QString category
+ * @param double result
*/
void MainWindow::clientSendResult(QString category, double result)
{
}
/**
- *
+ * Set user name to main panel.
*/
void MainWindow::setUsernameToMainPanel()
{
}
/**
- * This slot function save user profile data to server
+ * This slot function save user profile data to server.
*/
void MainWindow::saveProfile()
{
/**
* This slot function calls httpClients requestUserInfo for getting user's information from server.
+ *
+ * @param QString name
*/
void MainWindow::requestGetUserInfo(QString name)
{
}
}
+/**
+ * This slot function open users dialog.
+ */
void MainWindow::openUsersDialog()
{
if(!usersDialog)
*
* @author Rikhard Kuutti <rikhard.kuutti@fudeco.com>
* @author Toni Jussila <toni.jussila@fudeco.com>
+ * @author Janne Änäkkälä <janne.anakkala@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
/*
* Class for moving average of acceleration data.
*
- * @author Kai Rasilainen
+ * @author Kai Rasilainen <kai.rasilainen@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
#include "movingaverage.h"
#include <QList>
+/**
+ * Constructor of this class.
+ *
+ * @param int size limit
+ */
MovingAverage::MovingAverage(int sizeLimit)
{
SizeLimit = sizeLimit;
}
+/**
+ * Average.
+ *
+ * @return double average
+ */
double MovingAverage::Average()
{
double sum = 0;
return sum / queue.count();
}
+/**
+ * Resize.
+ *
+ * @param int size limit
+ */
void MovingAverage::Resize(int sizeLimit)
{
SizeLimit = sizeLimit;
}
}
+/**
+ * Enqueue.
+ *
+ * @param double item
+ */
void MovingAverage::Enqueue(double item)
{
queue.enqueue(item);
if (queue.count() > SizeLimit)
queue.dequeue();
}
-
-
/**
* Constructor of this class.
+ *
* @param QWidget pointer to parent object. By default the value is NULL.
*/
ProfileDialog::ProfileDialog(SettingsDialog *parent) : QDialog(parent), ui(new Ui::ProfileDialog)
/**
* This function load picture.
- * @param QString
+ *
+ * @param QString file name
*/
void ProfileDialog::loadPicture(QString fileName)
{
/**
* This slot function called when save button clicked.
+ *
* @todo server connection
*/
void ProfileDialog::on_buttonSave_clicked()
}
/**
- * This get function return manufacturer
- * @return QString
+ * Get function return manufacturer.
+ *
+ * @return QString manufacturer
*/
QString ProfileDialog::getManufacturer()
{
}
/**
- * This get function return type
- * @return QString
+ * Get function return type.
+ *
+ * @return QString type
*/
QString ProfileDialog::getType()
{
}
/**
- * This get function return model
- * @return QString
+ * Get function return model.
+ *
+ * @return QString model
*/
QString ProfileDialog::getModel()
{
}
/**
- * This get function return description
- * @return QString
+ * Get function return description.
+ *
+ * @return QString description
*/
QString ProfileDialog::getDescription()
{
}
/**
- * This get function return description
- * @return QString
+ * Get function return picture.
+ *
+ * @return QString picture
*/
QString ProfileDialog::getPicture()
{
}
/**
- * This set function set manufacturer
- * @param QString
+ * This function set manufacturer.
+ *
+ * @param QString manufacturer
*/
void ProfileDialog::setManufacturer(QString m)
{
}
/**
- * This set function set type
- * @param QString
+ * This function set type.
+ *
+ * @param QString type
*/
void ProfileDialog::setType(QString t)
{
}
/**
- * This set function set model
- * @param QString
+ * This function set model.
+ *
+ * @param QString model
*/
void ProfileDialog::setModel(QString m)
{
}
/**
- * This set function set description
- * @param QString
+ * This function set description.
+ *
+ * @param QString description
*/
void ProfileDialog::setDescription(QString d)
{
}
/**
- * This set function set description
- * @param QString
+ * This function set description.
+ *
+ * @param QString picture
*/
void ProfileDialog::setPicture(QString p)
{
}
/**
- * This function set label info text to user
- * @param QString
+ * This function set label info text to user.
+ *
+ * @param QString info text
*/
void ProfileDialog::setLabelInfoToUser(QString infoText)
{
-#include "registerdialog.h"
-#include "ui_registerdialog.h"
+/*
+ * Register dialog class.
+ *
+ * @author Toni Jussila <toni.jussila@fudeco.com>
+ * @copyright (c) 2010 Speed Freak team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ */
+
#include <QMessageBox>
#include <QDebug>
#include <QString>
#include <QImage>
#include <QPixmap>
#include <QSize>
+#include "registerdialog.h"
+#include "ui_registerdialog.h"
#include "usersettings.h"
#include "settingsdialog.h"
#include "xmlreader.h"
description="";
picture="";
- ui->buttonImage->setVisible(false);
- ui->labelImage->setVisible(false);
- // Read user profile xml
+ //ui->buttonImage->setVisible(false);
+ //ui->labelImage->setVisible(false);
+
+ // Read user profile xml from file.
/*QString filename = "/home/user/MyDocs/speedfreak/profile/" + parent->getUserName() + "_profile.xml";
QFile file(filename);
this->close();
}
-// Next 6 functions can be removed if Settingsdialog is implemented without
-// own copy of username, password & email
/**
+ * Set username.
*
+ * @param QString username
*/
void RegisterDialog::setRegUserName(QString username)
{
}
/**
+ * Get username.
*
+ * @return QString username
*/
-void RegisterDialog::setRegPassword(QString password)
+QString RegisterDialog::getRegUserName()
{
- this->regPassword = password;
+ return this->regUsername;
}
/**
+ * Set password.
*
+ * @param QString password
*/
-void RegisterDialog::setRegEmail(QString email)
+void RegisterDialog::setRegPassword(QString password)
{
- this->regEmail = email;
+ this->regPassword = password;
}
/**
+ * Get password.
*
+ * @return QString password
*/
-QString RegisterDialog::getRegUserName()
+QString RegisterDialog::getRegPassword()
{
- return this->regUsername;
+ return this->regPassword;
}
/**
+ * Set email.
*
+ * @param QString email
*/
-QString RegisterDialog::getRegPassword()
+void RegisterDialog::setRegEmail(QString email)
{
- return this->regPassword;
+ this->regEmail = email;
}
/**
+ * Get email.
*
+ * @return QString email
*/
QString RegisterDialog::getRegEmail()
{
return this->regEmail;
}
+/**
+ * This slot function called when ever register button clicked.
+ */
void RegisterDialog::on_registratePushButton_clicked()
{
// Save labels data
setModel(ui->lineEditModel->text());
setDescription(ui->textEditDescription->toPlainText());
- // emit settingsdialog --> mainwindow --> httpclient
- //emit saveprofile();
-
-
-
// Send username, password and email to SpeedFreak server
this->regUsername = ui->regUserNameLineEdit->text();
this->regPassword = ui->regPasswordLineEdit->text();
{
QMessageBox::about(this, "One or more of the fields is empty", "Set username (3-12 characters), password (at least 6 characters) and valid email address");
}
-
- //close(); //using close() hides popup-window which reports error from server
}
/**
- * This get function return manufacturer
- * @return QString
+ * This get function return manufacturer.
+ *
+ * @return QString manufacturer
*/
QString RegisterDialog::getManufacturer()
{
}
/**
- * This get function return type
- * @return QString
+ * This function set manufacturer.
+ *
+ * @param QString manufacturer
*/
-QString RegisterDialog::getType()
+void RegisterDialog::setManufacturer(QString m)
{
- return type;
+ manufacturer = m;
+ ui->lineEditManufacturer->setText(m);
}
/**
- * This get function return model
- * @return QString
+ * This get function return type.
+ *
+ * @return QString type
*/
-QString RegisterDialog::getModel()
+QString RegisterDialog::getType()
{
- return model;
+ return type;
}
/**
- * This get function return description
- * @return QString
+ * This function set type.
+ *
+ * @param QString type
*/
-QString RegisterDialog::getDescription()
+void RegisterDialog::setType(QString t)
{
- QString all = manufacturer + ";" + type + ";" + model + ";" + description;
- return all;
+ type = t;
+ ui->lineEditType->setText(t);
}
/**
- * This get function return description
- * @return QString
+ * This get function return model.
+ *
+ * @return QString model
*/
-QString RegisterDialog::getPicture()
+QString RegisterDialog::getModel()
{
- return picture;
+ return model;
}
/**
- * This set function set manufacturer
- * @param QString
+ * This function set model.
+ *
+ * @param QString model
*/
-void RegisterDialog::setManufacturer(QString m)
+void RegisterDialog::setModel(QString m)
{
- manufacturer = m;
- ui->lineEditManufacturer->setText(m);
+ model = m;
+ ui->lineEditModel->setText(m);
}
/**
- * This set function set type
- * @param QString
+ * This get function return description.
+ *
+ * @return QString description
*/
-void RegisterDialog::setType(QString t)
+QString RegisterDialog::getDescription()
{
- type = t;
- ui->lineEditType->setText(t);
+ QString all = manufacturer + ";" + type + ";" + model + ";" + description;
+ return all;
}
/**
- * This set function set model
+ * This function set description.
+ *
* @param QString
*/
-void RegisterDialog::setModel(QString m)
+void RegisterDialog::setDescription(QString d)
{
- model = m;
- ui->lineEditModel->setText(m);
+ description = d;
+ ui->textEditDescription->setText(d);
}
/**
- * This set function set description
- * @param QString
+ * This get function return picture.
+ *
+ * @return QString picture
*/
-void RegisterDialog::setDescription(QString d)
+QString RegisterDialog::getPicture()
{
- description = d;
- ui->textEditDescription->setText(d);
+ return picture;
}
/**
- * This set function set description
- * @param QString
+ * This function set picture.
+ *
+ * @param QString picture
*/
void RegisterDialog::setPicture(QString p)
{
}
/**
- * This function set label info text to user
+ * This function set label info text to user.
+ *
* @param QString
*/
void RegisterDialog::setLabelInfoToUser(QString infoText)
}
/**
- * This slot function called when image button clicked.
+ * This slot function called when ever image button clicked.
*/
void RegisterDialog::on_buttonImage_clicked()
{
/**
* This function load picture.
- * @param QString
+ *
+ * @param QString file name
*/
void RegisterDialog::loadPicture(QString fileName)
{
+/*
+ * Register dialog class.
+ *
+ * @author Toni Jussila <toni.jussila@fudeco.com>
+ * @copyright (c) 2010 Speed Freak team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ */
#ifndef REGISTERDIALOG_H
#define REGISTERDIALOG_H
/**
* Constructor of this class.
+ *
* @param QWidget pointer to parent object. By default the value is NULL.
*/
ResultDialog::ResultDialog(QWidget *parent) :
delete ui;
}
+/**
+ *
+ */
void ResultDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
/**
* Draws speed diagram to the UI
+ *
* @param QPaintEvent
*/
void ResultDialog::paintEvent(QPaintEvent *)
/**
* Change the given speed and time to the point for the diagram.
+ *
* @param aSpeed is speed which need to change, aTime is time in seconds which need to change.
* @return point is calculated from aSpeed and aTime.
*/
/**
* Sets right timeAxelLength value depending the time which
* has spent to reach target speed.
+ *
+ * @param int choice
*/
void ResultDialog::setTimeAxelLength(int pChoice)
{
emit sendresult(timeArray[this->getTargetChoice()]);
}
+/**
+ * Get result.
+ *
+ * @return double result.
+ */
double ResultDialog::getResult()
{
return timeArray[this->getTargetChoice()];
/**
* This public function sets diagram's stem gap
+ *
* @param pValue is the speed value which determines diagram gap's value
*/
void ResultDialog::setEnd(int pValue)
/**
* This public function stores time in timeArray
+ *
* @param pSpeed is the speed value at the time so we know where store time
* @param pTime is the result which needs to be store in timeArray
*/
/**
* Checks which target speed has been choosed
+ *
* @return targetChoice which tells to caller integer value about the target speed
- * e.g. 20 km/h is value 2 and 60 km/h is value 6
+ * e.g. 20 km/h is value 2 and 60 km/h is value 6
*/
int ResultDialog::getTargetChoice()
{
}
return targetChoice;
}
-
+/**
+ * Set label info to user.
+ *
+ * @param QString info text
+ */
void ResultDialog::setLabelInfoToUser(QString infoText)
{
this->ui->labelInfoToUser->setText(infoText);
helpAccelerationDialog = NULL;
}
}
-
};
};
-
+/**
+ * Viewing class.
+ */
class Viewing
{
Vector atPoint, fromPoint, up, a1, a2, a3;
}
/**
+ * Get left.
*
+ * @return int left
*/
int RouteDialog::getLeft()
{
}
/**
+ * Get right.
*
+ * @return int right
*/
int RouteDialog::getRight()
{
}
/**
+ * Get top.
*
+ * @return int top
*/
int RouteDialog::getTop()
{
}
/**
+ * Get bottom.
*
+ * @return int bottom
*/
int RouteDialog::getBottom()
{
}
/**
+ * draw flag
*
+ * @param RouteDialog*
+ * @param QPainter*
+ * @param int x
+ * @param int y
+ * @param QString startFinish
*/
void drawFlag( RouteDialog *rD, QPainter *p, int x, int y, QString startFinish)
{
- /*QPolygon pg;
-
- pg.setPoint(0,x, y-25);
- pg.setPoint(1,x+10,y-20);
- pg.setPoint(2,x, y-15);
- pg.setPoint(3,x,y-20);*/
if (y> (rD->getTop() + 25))
{
// Upside
p->drawText(x+10, y+15, startFinish);
}
}
- //p->drawPolygon();
- // p->drawPolygon( pg,Qt::OddEvenFill);
- //p->drawPolyline( &pg);
- //p->drawPoints( pg);
}
/**
* Draws route to the route dialog.
* Type 0 is 2d viewing and type 1 is for 3d viewing
- * @param QPaintEvent
+ *
+ * @param QPaintEvent*
*/
/* */
void RouteDialog::paintEvent(QPaintEvent *)
painter.setPen(QPen((Qt::white),2));
painter.setBrush(QBrush((Qt::yellow), Qt::SolidPattern));
- // Draw route window frame
- /*painter.drawLine(left,top,right,top);
- painter.drawLine(right,top,right,bottom);
- painter.drawLine(left,top,left,bottom);
- painter.drawLine(left,bottom,right,bottom);*/
-
maxi = vertexList.size();
for (i=0; i<maxi-1; i++)
}
/**
+ * read route from file
*
* @param QString route file
*/
* */
}
-
#define NOEDGE 0x00
#define LEFTEDGE 0x01
#define RIGHTEDGE 0x02
/**
* Returns a code specifying which edge in the viewing pyramid was crossed.
* There may be more than one.
+ *
+ * @param qreal x
+ * @param qreal y
+ * @param qreal z
+ * @return int
*/
int code( qreal x, qreal y, qreal z)
{
int c;
-
c = NOEDGE;
if (x<-z) c |= LEFTEDGE;
if (x>z) c |= RIGHTEDGE;
if (y<-z) c |= BOTTOMEDGE;
if (y>z) c |= TOPEDGE;
-
return c;
}
/**
* Converts clipped world coordinates to screen coordinates.
+ *
+ * @param qreal xWorld
+ * @param qreal yWorld
+ * @param int *xScreen
+ * @param int *yScreen
*/
void WORLDtoSCREEN( qreal xWorld, qreal yWorld, int *xScreen, int *yScreen)
{
/**
* Clips the line segment in three-dimensional coordinates to the
* viewing pyramid.
+ *
+ * @param qreal x1
+ * @param qreal y1
+ * @param qreal z1
+ * @param qreal x2
+ * @param qreal y2
+ * @param qreal z2
+ * @param int *xscreen1
+ * @param int *yscreen1
+ * @param int *xscreen2
+ * @param int *yscreen2
*/
void clip3d( qreal x1, qreal y1, qreal z1, qreal x2, qreal y2, qreal z2, int *xscreen1, int *yscreen1, int *xscreen2, int *yscreen2)
{
/**
* Transform the segment connecting the two vectors into the viewing plane.
* clip3d() clips the line if needed.
+ *
+ * @param Viewing *v
+ * @param Vector *v1
+ * @param Vector *v2
+ * @param int *xscreen1
+ * @param int *yscreen1
+ * @param int *xscreen2
+ * @param int *yscreen2
*/
void transformseg( Viewing *v, Vector *v1, Vector *v2, int *xscreen1, int *yscreen1, int *xscreen2, int *yscreen2)
/**
* This function is set info text to user.
+ *
+ * @param QString info text
*/
void RouteDialog::setLabelInfoToUser(QString infoText)
{
/**
* Draws compass to the UI
+ *
* @param QPaintEvent
*/
void RouteSaveDialog::paintEvent(QPaintEvent *)
/**
* This slot function is called when routeDialog emit sendroute (sendPushButton).
+ *
+ * @param QString new name
+ * @param int i
*/
void RouteSaveDialog::sendRoute(QString newName, int i)
{
/**
* This function return speed average.
+ *
* @return double average speed
*/
double RouteSaveDialog::getAverageSpeed()
/**
* This function return distance traveled in QString.
+ *
* @return QString distance traveled
*/
QString RouteSaveDialog::getDistanceTraveled()
}
/**
- * This function
+ * This function set progressbar
+ *
+ * @param int i
*/
void RouteSaveDialog::setProgressbar(int i)
{
/**
* This function open and show route.
- * @param QString file name
*/
void RouteSaveDialog::openRouteDialog()
{
// Next 4 functions can be removed if Settingsdialog is implemented without
// own copy of username & password
/**
+ * Set username.
*
+ * @param QString username
*/
void SettingsDialog::setUserName(QString username)
{
}
/**
+ * Set password.
*
+ * @param QString password
*/
void SettingsDialog::setPassword(QString password)
{
}
/**
+ * Get username.
*
+ * @return QString username
*/
QString SettingsDialog::getUserName()
{
}
/**
+ * Get password.
*
+ * @return QString password
*/
QString SettingsDialog::getPassword()
{
}
/**
+ * Set label info to user.
*
+ * @param QString info text
*/
void SettingsDialog::setLabelInfoToUser(QString infoText)
{
}
/**
+ * is username ok.
*
+ * @param bool is OK
*/
void SettingsDialog::usernameOk(bool isOk)
{
/**
* This slot function called when
+ * emit sendregistration singnal
*/
void SettingsDialog::registrate()
{
#include "topresultdialog.h"
#include "ui_topresultdialog.h"
+/**
+ * Constructor of this class
+ */
TopResultDialog::TopResultDialog(QWidget *parent) :
QDialog(parent), ui(new Ui::TopResultDialog)
{
ui->labelTopList->setText("");
}
+/**
+ * Destructor of this class
+ */
TopResultDialog::~TopResultDialog()
{
qDebug() << "__~TopResultDialog";
delete ui;
}
+/**
+ *
+ */
void TopResultDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
}
}
-
+/**
+ * This slot function called when ever refresh button clicked.
+ */
void TopResultDialog::on_buttonTopRefresh_clicked()
{
ui->labelTopList->clear();
emit refreshCategoryList();
}
+/**
+ * Set categories compobox.
+ *
+ * @param QStringList list
+ */
void TopResultDialog::setCompoBoxCategories(QStringList list)
{
ui->comboBoxTopCategory->addItems(list);
}
+/**
+ * Show top list.
+ *
+ * @param QString str
+ */
void TopResultDialog::showTopList(QString str)
{
qDebug() << "__showTopList";
ui->labelTopList->setText(str);
}
+/**
+ * Get recent category index.
+ *
+ * @return int category index
+ */
int TopResultDialog::getRecentCategoryIndex()
{
return recentCategoryIndex;
}
+/**
+ * Set limit nr.
+ *
+ * @param int number
+ */
void TopResultDialog::setLimitNr(int number)
{
limitNr = number;
}
+/**
+ * Get limit nr.
+ *
+ * @return int limit nr
+ */
int TopResultDialog::getLimitNr()
{
return limitNr;
}
+/**
+ * This slot function called when ever top category combobox current index changed.
+ *
+ * @param int index
+ */
void TopResultDialog::on_comboBoxTopCategory_currentIndexChanged(int index)
{
ui->labelTopList->clear();
emit refreshTopList(index);
}
+/**
+ * Set label info to user.
+ *
+ * @param QString info text
+ */
void TopResultDialog::setLabelInfoToUser(QString infoText)
{
this->ui->labelInfoToUser->setText(infoText);