Subversion Repositories public

Rev

Rev 232 | Rev 246 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 232 Rev 245
Line 28... Line 28...
28
#include <qpen.h>
28
#include <qpen.h>
29
#include <QPoint>
29
#include <QPoint>
30
#include <qrect.h>
30
#include <qrect.h>
31
#include <qstring.h>
31
#include <qstring.h>
32
#include <qtimer.h>
32
#include <qtimer.h>
33
#include <klocale.h>
33
#include <KLocale>
34
#include <kmainwindow.h>
-
 
35
 
34
 
36
#if defined HAVE_GDAL
35
#if defined HAVE_GDAL
37
   #include <gdal/gdal_priv.h>
36
   #include <gdal/gdal_priv.h>
38
#endif
37
#endif
39
 
38
 
Line 79... Line 78...
79
	struct AVGHEIGHT *prev;
78
	struct AVGHEIGHT *prev;
80
	struct AVGHEIGHT *next;
79
	struct AVGHEIGHT *next;
81
} AVGHEIGHT;
80
} AVGHEIGHT;
82
 
81
 
83
//class sportwatcherWidget : public QWidget, public Ui::sportwatcherWidgetBase
82
//class sportwatcherWidget : public QWidget, public Ui::sportwatcherWidgetBase
84
class sportwatcherWidget : public KMainWindow, public Ui::sportwatcherWidgetBase
83
class sportwatcherWidget : public QWidget, public Ui::sportwatcherWidgetBase
85
{
84
{
86
  Q_OBJECT
85
	Q_OBJECT
87
 
86
 
88
public:
87
	public:
89
  sportwatcherWidget(QWidget* parent = 0);
88
	   sportwatcherWidget(QWidget *parent = 0);
90
  ~sportwatcherWidget();
89
	   ~sportwatcherWidget();
91
  /*$PUBLIC_FUNCTIONS$*/
90
	   /* $PUBLIC_FUNCTIONS$ */
-
 
91
	   void Initialize();
92
 
92
 
93
private:
93
	private:
94
   Ui::sportwatcherWidgetBase ui_sportwatcherWidgetBase;
94
	   Ui::sportwatcherWidgetBase ui_sportwatcherWidgetBase;
95
 
95
 
96
public slots:
96
	public slots:
97
  /*$PUBLIC_SLOTS$*/
97
	   /* $PUBLIC_SLOTS$ */
98
  virtual void          btFullscreenSlot();
98
	   void btFullscreenSlot();
99
  virtual void          btGlasMinusSlot();
99
	   void btGlasMinusSlot();
100
  virtual void          btGlasPlusSlot();
100
	   void btGlasPlusSlot();
101
  virtual void          btHandSlot();
101
	   void btHandSlot();
102
  virtual void          btGlasSlot();
102
	   void btGlasSlot();
103
  virtual void          btFlagSlot();
103
	   void btFlagSlot();
104
  virtual void          liLapsSlot(Q3ListViewItem *item);
104
	   void liLapsSlot(Q3ListViewItem *item);
105
  virtual void          liActivitiesSlot(Q3ListViewItem *item);
105
	   void liActivitiesSlot(Q3ListViewItem *item);
106
  virtual void          helpAbout();
106
	   void helpAbout();
107
  virtual void          helpContents();
107
	   void helpContents();
108
  virtual void          helpIndex();
108
	   void helpIndex();
109
  virtual void          fileExit();
109
	   void fileExit();
110
  virtual void          filePrint();
110
	   void filePrint();
111
  virtual void          fileSaveAs();
111
	   void fileSaveAs();
112
  virtual void          fileSave();
112
	   void fileSave();
113
  virtual void          fileOpen();
113
	   void fileOpen();
114
  virtual void		fileImport();
114
	   void fileImport();
115
  virtual void          fileNew();
115
	   void fileNew();
116
  virtual void		editRename();
116
	   void editRename();
117
  virtual void		extrasSaveHR();
117
	   void extrasSaveHR();
118
  virtual void		extrasSettings();
118
	   void extrasSettings();
119
  virtual void		extrasWMSSettings();
119
	   void extrasWMSSettings();
-
 
120
	   void kcbCurveSlot(int idx);
120
 
121
 
121
protected:
122
	protected:
122
  /*$PROTECTED_FUNCTIONS$*/
123
	   /* $PROTECTED_FUNCTIONS$ */
123
  void destroy();
124
	   void destroy();
124
  void showLaps();
125
	   void showLaps();
125
  void showTrack();
126
	   void showTrack();
126
  void showTrack(int zoom);
127
	   void showTrack(int zoom);
127
  void showTrack(int zoom, const QRect &pan, LAP *lap);
128
	   void showTrack(int zoom, const QRect &pan, LAP *lap);
128
  void showCurves();
129
	   void showCurves();
129
  void showCurves(LAP *lap);
130
	   void showCurves(LAP *lap);
130
  void resizeEvent(QResizeEvent *e);
131
	   void resizeEvent(QResizeEvent *e);
131
  void paintEvent(QPaintEvent *e);
132
	   void paintEvent(QPaintEvent *e);
132
  void mouseMoveEvent(QMouseEvent *e);
133
	   void mouseMoveEvent(QMouseEvent *e);
133
  void mousePressEvent(QMouseEvent *e);
134
	   void mousePressEvent(QMouseEvent *e);
134
  void mouseReleaseEvent(QMouseEvent *e);
135
	   void mouseReleaseEvent(QMouseEvent *e);
135
 
136
 
136
protected:
137
	protected:
137
  QTimer timer;
138
	   QTimer timer;
138
 
-
 
139
protected slots:
-
 
140
  /*$PROTECTED_SLOTS$*/
-
 
141
 
139
 
142
private:
140
	private:
143
    QDateTime *garmin_dtime (uint32 t);
141
	   void getActivities();
144
    void getActivities();
142
	   QDateTime *garmin_dtime (uint32 t);
145
    bool writeTag(const QFile &fn, const QString &str, int indent);
143
	   bool writeTag(const QFile &fn, const QString &str, int indent);
146
    bool findIndex(const QString &key);
144
	   bool findIndex(const QString &key);
147
    double getAvgAlt (AVGHEIGHT *avgHeight, int pos);
145
	   double getAvgAlt (AVGHEIGHT *avgHeight, int pos);
148
    AVGHEIGHT *getAvgPtr (AVGHEIGHT *avgHeight, int pos);
146
	   AVGHEIGHT *getAvgPtr (AVGHEIGHT *avgHeight, int pos);
149
    void saveGPX(const QString &fn);
147
	   void saveGPX(const QString &fn);
150
    void saveOSM(const QString &fn);
148
	   void saveOSM(const QString &fn);
151
#if defined HAVE_GDAL
149
#if defined HAVE_GDAL
152
    bool writeWMSTag(double llat, double llon, double rlat, double rlon, int width, int height);
150
	   bool writeWMSTag(double llat, double llon, double rlat, double rlon, int width, int height);
153
    bool transCoords (double *x1, double *y1, double *x2, double *y2, int code, int width, int height, bool square);
151
	   bool transCoords (double *x1, double *y1, double *x2, double *y2, int code, int width, int height, bool square);
154
    QString *getProjection (int isrs, QString *srs);
152
	   QString *getProjection (int isrs, QString *srs);
155
    bool warpImage(QString fn, QString *fName);
153
	   bool warpImage(QString fn, QString *fName);
156
#endif
154
#endif
157
 
155
 
158
private:
156
	private:
159
  QWidget *mama;
157
	   QWidget *mama;
160
  QPixmap pmProfile, pmMap;
158
	   QPixmap pmProfile, pmMap;
161
  QDateTime StartTime;
159
	   QDateTime StartTime;
162
  QStringList files;
160
	   QStringList files;
163
  QRect mapPan;
161
	   QRect mapPan;
164
  KLocale *kl;		// This is for translating date and time
162
	   KLocale *kl;		// This is for translating date and time
165
  manageFile spw;
163
	   manageFile spw;
166
  disassemble ds;
164
	   disassemble ds;
167
  garmin_data *gmn;
165
	   garmin_data *gmn;
168
  int min_hr, max_hr, avg_hr;
166
	   int min_hr, max_hr, avg_hr;
169
  int zfactor;
167
	   int zfactor;
170
  double min_height, max_height;
168
	   double min_height, max_height;
171
  double min_speed, max_speed;
169
	   double min_speed, max_speed;
172
  double total_distance;
170
	   double total_distance;
173
  double oldTransX, oldTransY;
171
	   double oldTransX, oldTransY;
174
  unsigned long max_time;
172
	   unsigned long max_time;
175
  bool stateHand, stateFlag, stateGlas;
173
	   bool stateHand, stateFlag, stateGlas;
176
  int lmbPressed;
174
	   int lmbPressed;
177
  LAP *mapLap;
175
	   LAP *mapLap;
178
  INDEX *index;
176
	   INDEX *index;
179
#if defined HAVE_GDAL
177
#if defined HAVE_GDAL
180
  GDALDataset *poDataset;
178
	   GDALDataset *poDataset;
181
  int mFactor;
179
	   int mFactor;
182
  GEORECT geoRect;
180
	   GEORECT geoRect;
183
#endif
181
#endif
184
 
182
 
185
private:
183
	private:
186
  /* Config Parameters */
184
	   /* Config Parameters */
187
  int lower1, lower2, lower3;
185
	   int lower1, lower2, lower3;
188
  int upper1, upper2, upper3;
186
	   int upper1, upper2, upper3;
189
  int MaxHr, restHr;
187
	   int MaxHr, restHr;
190
  int vo2max, weight, sampleTime;
188
	   int vo2max, weight, sampleTime;
191
  int Units, MapType;
189
	   int Units, MapType;
192
  bool Serial, Contour, Forerunner;
190
	   bool Serial, Contour, Forerunner;
193
  QString Device, Data, HRM, MAP;
191
	   QString Device, Data, HRM, MAP;
194
};
192
};
195
 
193
 
196
#endif
194
#endif
197
 
-