mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
new zonesChanged signal
This commit is contained in:
@@ -19,12 +19,13 @@
|
||||
|
||||
#include "AllPlotWindow.h"
|
||||
#include "AllPlot.h"
|
||||
#include "MainWindow.h"
|
||||
#include "RideFile.h"
|
||||
#include "RideItem.h"
|
||||
#include <qwt_plot_panner.h>
|
||||
#include <qwt_plot_zoomer.h>
|
||||
|
||||
AllPlotWindow::AllPlotWindow(QWidget *parent) : QWidget(parent)
|
||||
AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) : QWidget(mainWindow)
|
||||
{
|
||||
QVBoxLayout *vlayout = new QVBoxLayout;
|
||||
|
||||
@@ -129,6 +130,7 @@ AllPlotWindow::AllPlotWindow(QWidget *parent) : QWidget(parent)
|
||||
this, SLOT(setSmoothingFromSlider()));
|
||||
connect(smoothLineEdit, SIGNAL(editingFinished()),
|
||||
this, SLOT(setSmoothingFromLineEdit()));
|
||||
connect(mainWindow, SIGNAL(zonesChanged()), this, SLOT(zonesChanged()));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <QtGui>
|
||||
|
||||
class AllPlot;
|
||||
class MainWindow;
|
||||
class QwtPlotPanner;
|
||||
class QwtPlotZoomer;
|
||||
class RideItem;
|
||||
@@ -32,14 +33,14 @@ class AllPlotWindow : public QWidget
|
||||
|
||||
public:
|
||||
|
||||
AllPlotWindow(QWidget *parent);
|
||||
AllPlotWindow(MainWindow *mainWindow);
|
||||
void setData(RideItem *ride);
|
||||
void zonesChanged();
|
||||
|
||||
public slots:
|
||||
|
||||
void setSmoothingFromSlider();
|
||||
void setSmoothingFromLineEdit();
|
||||
void zonesChanged();
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -17,13 +17,14 @@
|
||||
*/
|
||||
|
||||
#include "HistogramWindow.h"
|
||||
#include "MainWindow.h"
|
||||
#include "PowerHist.h"
|
||||
#include "RideFile.h"
|
||||
#include "RideItem.h"
|
||||
#include <QtGui>
|
||||
#include <assert.h>
|
||||
|
||||
HistogramWindow::HistogramWindow(QWidget *parent) : QWidget(parent)
|
||||
HistogramWindow::HistogramWindow(MainWindow *mainWindow) : QWidget(mainWindow)
|
||||
{
|
||||
QVBoxLayout *vlayout = new QVBoxLayout;
|
||||
QHBoxLayout *binWidthLayout = new QHBoxLayout;
|
||||
@@ -71,6 +72,7 @@ HistogramWindow::HistogramWindow(QWidget *parent) : QWidget(parent)
|
||||
this, SLOT(setWithZerosFromCheckBox()));
|
||||
connect(histParameterCombo, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(setHistSelection(int)));
|
||||
connect(mainWindow, SIGNAL(zonesChanged()), this, SLOT(zonesChanged()));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class MainWindow;
|
||||
class PowerHist;
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
@@ -34,8 +35,11 @@ class HistogramWindow : public QWidget
|
||||
|
||||
public:
|
||||
|
||||
HistogramWindow(QWidget *parent);
|
||||
HistogramWindow(MainWindow *mainWindow);
|
||||
void setData(RideItem *ride);
|
||||
|
||||
public slots:
|
||||
|
||||
void zonesChanged();
|
||||
|
||||
protected slots:
|
||||
|
||||
@@ -753,24 +753,8 @@ MainWindow::showOptions()
|
||||
{
|
||||
ConfigDialog *cd = new ConfigDialog(home, zones_);
|
||||
cd->exec();
|
||||
|
||||
// update other items in case zones were changed
|
||||
if (ride) {
|
||||
// daily summary
|
||||
rideSummary->setHtml(ride->htmlSummary());
|
||||
|
||||
// weekly summary
|
||||
weeklySummaryWindow->generateWeeklySummary(ride, allRides, zones());
|
||||
|
||||
// all plot
|
||||
allPlotWindow->zonesChanged();
|
||||
|
||||
// histogram
|
||||
histogramWindow->zonesChanged();
|
||||
|
||||
// force-versus-pedal velocity plot
|
||||
pfPvWindow->zonesChanged();
|
||||
}
|
||||
if (ride) rideSummary->setHtml(ride->htmlSummary());
|
||||
zonesChanged();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -832,15 +816,8 @@ MainWindow::setCriticalPower(int cp)
|
||||
arg(cp)
|
||||
);
|
||||
|
||||
// regenerate the ride and weekly summaries associated with the present ride
|
||||
if (ride) {
|
||||
// daily summary
|
||||
rideSummary->setHtml(ride->htmlSummary());
|
||||
|
||||
// weekly summary
|
||||
weeklySummaryWindow->generateWeeklySummary(ride, allRides, zones());
|
||||
}
|
||||
|
||||
if (ride) rideSummary->setHtml(ride->htmlSummary());
|
||||
zonesChanged();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -50,6 +50,8 @@ class MainWindow : public QMainWindow
|
||||
void addRide(QString name, bool bSelect=true);
|
||||
void removeCurrentRide();
|
||||
const RideFile *currentRide();
|
||||
const RideItem *currentRideItem() { return ride; }
|
||||
const QTreeWidgetItem *allRideItems() { return allRides; }
|
||||
void getBSFactors(float &timeBS, float &distanceBS);
|
||||
QDir home;
|
||||
void setCriticalPower(int cp);
|
||||
@@ -68,6 +70,10 @@ class MainWindow : public QMainWindow
|
||||
virtual void dragEnterEvent(QDragEnterEvent *);
|
||||
virtual void dropEvent(QDropEvent *);
|
||||
|
||||
signals:
|
||||
|
||||
void zonesChanged();
|
||||
|
||||
private slots:
|
||||
void rideSelected();
|
||||
void leftLayoutMoved();
|
||||
|
||||
@@ -17,11 +17,12 @@
|
||||
*/
|
||||
|
||||
#include "PfPvWindow.h"
|
||||
#include "MainWindow.h"
|
||||
#include "PfPvPlot.h"
|
||||
#include "RideItem.h"
|
||||
#include <QtGui>
|
||||
|
||||
PfPvWindow::PfPvWindow(QWidget *parent) : QWidget(parent)
|
||||
PfPvWindow::PfPvWindow(MainWindow *mainWindow) : QWidget(mainWindow)
|
||||
{
|
||||
QVBoxLayout *vlayout = new QVBoxLayout;
|
||||
QHBoxLayout *qaLayout = new QHBoxLayout;
|
||||
@@ -65,6 +66,7 @@ PfPvWindow::PfPvWindow(QWidget *parent) : QWidget(parent)
|
||||
this, SLOT(setQaCLFromLineEdit()));
|
||||
connect(shadeZonesPfPvCheckBox, SIGNAL(stateChanged(int)),
|
||||
this, SLOT(setShadeZonesPfPvFromCheckBox()));
|
||||
connect(mainWindow, SIGNAL(zonesChanged()), this, SLOT(zonesChanged()));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class MainWindow;
|
||||
class PfPvPlot;
|
||||
class QCheckBox;
|
||||
class QLineEdit;
|
||||
@@ -32,8 +33,11 @@ class PfPvWindow : public QWidget
|
||||
|
||||
public:
|
||||
|
||||
PfPvWindow(QWidget *parent);
|
||||
PfPvWindow(MainWindow *mainWindow);
|
||||
void setData(RideItem *item);
|
||||
|
||||
public slots:
|
||||
|
||||
void zonesChanged();
|
||||
|
||||
protected slots:
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "WeeklySummaryWindow.h"
|
||||
#include "DaysScaleDraw.h"
|
||||
#include "MainWindow.h"
|
||||
#include "RideItem.h"
|
||||
#include "RideMetric.h"
|
||||
#include "Zones.h"
|
||||
@@ -31,8 +32,10 @@
|
||||
#define FOLDER_TYPE 0
|
||||
#define RIDE_TYPE 1
|
||||
|
||||
WeeklySummaryWindow::WeeklySummaryWindow(bool useMetricUnits, QWidget *parent) :
|
||||
QWidget(parent), useMetricUnits(useMetricUnits)
|
||||
WeeklySummaryWindow::WeeklySummaryWindow(bool useMetricUnits,
|
||||
MainWindow *mainWindow) :
|
||||
QWidget(mainWindow), mainWindow(mainWindow),
|
||||
useMetricUnits(useMetricUnits)
|
||||
{
|
||||
QGridLayout *glayout = new QGridLayout;
|
||||
|
||||
@@ -129,6 +132,16 @@ WeeklySummaryWindow::WeeklySummaryWindow(bool useMetricUnits, QWidget *parent) :
|
||||
glayout->setRowMinimumHeight(1, 120); // minimum height of weekly plots
|
||||
|
||||
setLayout(glayout);
|
||||
|
||||
connect(mainWindow, SIGNAL(zonesChanged()), this, SLOT(zonesChanged()));
|
||||
}
|
||||
|
||||
void
|
||||
WeeklySummaryWindow::zonesChanged()
|
||||
{
|
||||
generateWeeklySummary(mainWindow->currentRideItem(),
|
||||
mainWindow->allRideItems(),
|
||||
mainWindow->zones());
|
||||
}
|
||||
|
||||
void
|
||||
@@ -136,6 +149,8 @@ WeeklySummaryWindow::generateWeeklySummary(const RideItem *ride,
|
||||
const QTreeWidgetItem *allRides,
|
||||
const Zones *zones)
|
||||
{
|
||||
if (!ride)
|
||||
return;
|
||||
QDate wstart = ride->dateTime.date();
|
||||
wstart = wstart.addDays(Qt::Monday - wstart.dayOfWeek());
|
||||
assert(wstart.dayOfWeek() == Qt::Monday);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class MainWindow;
|
||||
class QTextEdit;
|
||||
class QTreeWidgetItem;
|
||||
class QwtPlot;
|
||||
@@ -34,13 +35,18 @@ class WeeklySummaryWindow : public QWidget
|
||||
|
||||
public:
|
||||
|
||||
WeeklySummaryWindow(bool useMetricUnits, QWidget *parent);
|
||||
WeeklySummaryWindow(bool useMetricUnits, MainWindow *parent);
|
||||
void generateWeeklySummary(const RideItem *ride,
|
||||
const QTreeWidgetItem *allRides,
|
||||
const Zones *zones);
|
||||
|
||||
public slots:
|
||||
|
||||
void zonesChanged();
|
||||
|
||||
protected:
|
||||
|
||||
MainWindow *mainWindow;
|
||||
bool useMetricUnits;
|
||||
QwtPlot *weeklyPlot;
|
||||
QwtPlotCurve *weeklyDistCurve;
|
||||
|
||||
Reference in New Issue
Block a user