Subversion Repositories public

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
88 andreas 1
/***************************************************************************
119 andreas 2
 *   Copyright (C) 2007, 2008 by Andreas Theofilu                          *
3
 *   andreas@theosys.at                                                    *
88 andreas 4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
6
 *   it under the terms of the GNU General Public License as published by  *
7
 *   the Free Software Foundation version 3 of the License.                *
8
 *                                                                         *
9
 *   This program is distributed in the hope that it will be useful,       *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 *   GNU General Public License for more details.                          *
13
 *                                                                         *
14
 *   You should have received a copy of the GNU General Public License     *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 ***************************************************************************/
19
 
20
#ifndef SPORTWATCHERWIDGET_H
21
#define SPORTWATCHERWIDGET_H
22
 
23
#include <qlabel.h>
24
#include <qdatetime.h>
25
#include <qpixmap.h>
26
#include <qimage.h>
27
#include <qpainter.h>
28
#include <qpen.h>
29
#include <qpoint.h>
30
#include <qpointarray.h>
31
#include <qrect.h>
104 andreas 32
#include <qstring.h>
132 andreas 33
#include <qtimer.h>
88 andreas 34
 
155 andreas 35
#if defined HAVE_GDAL && HAVE_LIBGDAL1_5_0
151 andreas 36
   #include <gdal/gdal_priv.h>
37
#endif
38
 
88 andreas 39
#include "garmin.h"
40
#include "managefile.h"
41
#include "disassemble.h"
42
 
43
#include "sportwatcherwidgetbase.h"
44
 
45
typedef struct INDEX
46
{
47
	QString path;
48
	QString activ;
49
	INDEX *next;
50
} INDEX;
51
 
52
class sportwatcherWidget : public sportwatcherWidgetBase
53
{
54
  Q_OBJECT
55
 
56
public:
57
  sportwatcherWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
58
  ~sportwatcherWidget();
59
  /*$PUBLIC_FUNCTIONS$*/
60
 
61
public slots:
62
  /*$PUBLIC_SLOTS$*/
63
  virtual void          btFullscreenSlot();
64
  virtual void          btGlasMinusSlot();
65
  virtual void          btGlasPlusSlot();
66
  virtual void          btHandSlot();
67
  virtual void          btGlasSlot();
68
  virtual void          btFlagSlot();
69
  virtual void          liLapsSlot(QListViewItem *item);
70
  virtual void          liActivitiesSlot(QListViewItem *item);
71
  virtual void          helpAbout();
72
  virtual void          helpContents();
73
  virtual void          helpIndex();
74
  virtual void          fileExit();
75
  virtual void          filePrint();
76
  virtual void          fileSaveAs();
77
  virtual void          fileSave();
78
  virtual void          fileOpen();
79
  virtual void          fileNew();
80
  virtual void		extrasSaveHR();
81
  virtual void		extrasSettings();
152 andreas 82
  virtual void		extrasWMSSettings();
88 andreas 83
 
84
protected:
85
  /*$PROTECTED_FUNCTIONS$*/
100 andreas 86
  void destroy();
88 andreas 87
  void showLaps();
100 andreas 88
  void showTrack();
104 andreas 89
  void showTrack(int zoom);
132 andreas 90
  void showTrack(int zoom, const QRect &pan, LAP *lap);
88 andreas 91
  void showCurves();
148 andreas 92
  void showCurves(LAP *lap);
88 andreas 93
  void resizeEvent(QResizeEvent *e);
94
  void paintEvent(QPaintEvent *e);
132 andreas 95
  void mouseMoveEvent(QMouseEvent *e);
96
  void mousePressEvent(QMouseEvent *e);
97
  void mouseReleaseEvent(QMouseEvent *e);
88 andreas 98
 
132 andreas 99
protected:
100
  QTimer timer;
101
 
88 andreas 102
protected slots:
103
  /*$PROTECTED_SLOTS$*/
104
 
105
private:
106
    QDateTime *garmin_dtime (uint32 t);
107
    void getActivities();
104 andreas 108
    bool writeTag(const QFile &fn, const QString &str, int indent);
132 andreas 109
    bool findIndex(const QString &key);
155 andreas 110
#if defined HAVE_GDAL && HAVE_LIBGDAL1_5_0
151 andreas 111
    bool writeWMSTag(double llat, double llon, double rlat, double rlon, int width, int height);
157 andreas 112
    bool transCoords (double *x1, double *y1, double *x2, double *y2, int code, int width, int height, bool square);
151 andreas 113
#endif
88 andreas 114
 
115
private:
116
  QWidget *mama;
100 andreas 117
  QPixmap pmProfile, pmMap;
88 andreas 118
  QDateTime StartTime;
119
  QStringList files;
132 andreas 120
  QRect mapPan;
88 andreas 121
  manageFile spw;
122
  disassemble ds;
123
  garmin_data *gmn;
124
  int min_hr, max_hr, avg_hr;
104 andreas 125
  int zfactor;
88 andreas 126
  double min_height, max_height;
104 andreas 127
  double total_distance;
132 andreas 128
  double oldTransX, oldTransY;
88 andreas 129
  unsigned long max_time;
132 andreas 130
  bool stateHand, stateFlag, stateGlas;
131
  int lmbPressed;
132
  LAP *mapLap;
88 andreas 133
  INDEX *index;
155 andreas 134
#if defined HAVE_GDAL && HAVE_LIBGDAL1_5_0
151 andreas 135
  GDALDataset *poDataset;
157 andreas 136
  int mFactor;
151 andreas 137
#endif
88 andreas 138
 
139
private:
140
  /* Config Parameters */
141
  int lower1, lower2, lower3;
142
  int upper1, upper2, upper3;
143
  int MaxHr, restHr;
144
  int vo2max, weight, sampleTime;
149 andreas 145
  int Units;
146
  bool Serial;
143 andreas 147
  QString Device, Data, HRM, MAP;
88 andreas 148
};
149
 
150
#endif
151