mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Merge branch 'master' of github.com:/srhea/GoldenCheetah
This commit is contained in:
@@ -174,6 +174,7 @@ void ConfigDialog::save_Clicked()
|
||||
settings->setValue(GC_ALLRIDES_ASCENDING, configPage->allRidesAscending->checkState());
|
||||
settings->setValue(GC_GARMIN_SMARTRECORD, configPage->garminSmartRecord->checkState());
|
||||
settings->setValue(GC_GARMIN_HWMARK, configPage->garminHWMarkedit->text());
|
||||
settings->setValue(GC_MAP_INTERVAL, configPage->mapIntervaledit->text());
|
||||
settings->setValue(GC_CRANKLENGTH, configPage->crankLengthCombo->currentText());
|
||||
settings->setValue(GC_BIKESCOREDAYS, configPage->BSdaysEdit->text());
|
||||
settings->setValue(GC_BIKESCOREMODE, configPage->bsModeCombo->currentText());
|
||||
|
||||
@@ -347,13 +347,16 @@ string GoogleMapControl::CreatePolyLine()
|
||||
{
|
||||
std::vector<RideFilePoint> intervalPoints;
|
||||
ostringstream oss;
|
||||
int intervalTime = 30; // 30 seconds
|
||||
boost::shared_ptr<QSettings> settings = GetApplicationSettings();
|
||||
QVariant intervalTime = settings->value(GC_MAP_INTERVAL).toInt();
|
||||
if (intervalTime.isNull() || intervalTime.toInt() == 0)
|
||||
intervalTime.setValue(30);
|
||||
|
||||
BOOST_FOREACH(RideFilePoint rfp, rideData)
|
||||
{
|
||||
intervalPoints.push_back(rfp);
|
||||
if((intervalPoints.back().secs - intervalPoints.front().secs) >
|
||||
intervalTime)
|
||||
intervalTime.toInt())
|
||||
{
|
||||
// find the avg power and color code it and create a polyline...
|
||||
AvgPower avgPower = for_each(intervalPoints.begin(),
|
||||
@@ -377,6 +380,10 @@ void GoogleMapControl::CreateSubPolyLine(const std::vector<RideFilePoint> &point
|
||||
std::ostringstream &oss,
|
||||
int avgPower)
|
||||
{
|
||||
boost::shared_ptr<QSettings> settings = GetApplicationSettings();
|
||||
QVariant intervalTime = settings->value(GC_MAP_INTERVAL);
|
||||
if (intervalTime.isNull() || intervalTime.toInt() == 0)
|
||||
intervalTime.setValue(30);
|
||||
oss.precision(6);
|
||||
QColor color = GetColor(avgPower);
|
||||
QString colorstr = color.name();
|
||||
@@ -393,7 +400,7 @@ void GoogleMapControl::CreateSubPolyLine(const std::vector<RideFilePoint> &point
|
||||
oss << "],\"" << colorstr.toStdString() << "\",4);" << endl;
|
||||
|
||||
oss << "GEvent.addListener(polyline, 'mouseover', function() {" << endl
|
||||
<< "var tooltip_text = '30s Power: " << avgPower << "';" << endl
|
||||
<< "var tooltip_text = '" << intervalTime.toInt() << "s Power: " << avgPower << "';" << endl
|
||||
<< "var ss={'weight':8};" << endl
|
||||
<< "this.setStrokeStyle(ss);" << endl
|
||||
<< "this.overlay = new MapTooltip(this,tooltip_text);" << endl
|
||||
|
||||
@@ -149,6 +149,18 @@ ConfigurationPage::ConfigurationPage(MainWindow *main) : main(main)
|
||||
garminLayout->addWidget(garminHWMarkedit,1,1);
|
||||
garminLayout->addWidget(garminHWLabel2,1,2);
|
||||
|
||||
// Map interval period
|
||||
QVariant mapInterval = settings->value(GC_MAP_INTERVAL);
|
||||
if (mapInterval.isNull() || mapInterval.toInt() == 0)
|
||||
mapInterval.setValue(30); // by default its 30 sec
|
||||
QGridLayout *mapIntervalLayout = new QGridLayout;
|
||||
QLabel *mapIntervalLabel1 = new QLabel(tr("Map interval period"));
|
||||
QLabel *mapIntervalLabel2 = new QLabel(tr(" secs."));
|
||||
mapIntervaledit = new QLineEdit(mapInterval.toString(),this);
|
||||
mapIntervaledit->setInputMask("009");
|
||||
mapIntervalLayout->addWidget(mapIntervalLabel1,1,0);
|
||||
mapIntervalLayout->addWidget(mapIntervaledit,1,1);
|
||||
mapIntervalLayout->addWidget(mapIntervalLabel2,1,2);
|
||||
|
||||
warningLabel = new QLabel(tr("Requires Restart To Take Effect"));
|
||||
|
||||
@@ -214,6 +226,7 @@ ConfigurationPage::ConfigurationPage(MainWindow *main) : main(main)
|
||||
configLayout->addWidget(allRidesAscending);
|
||||
configLayout->addLayout(garminLayout);
|
||||
//SmartRecord);
|
||||
configLayout->addLayout(mapIntervalLayout);
|
||||
configLayout->addLayout(crankLengthLayout);
|
||||
configLayout->addLayout(bsDaysLayout);
|
||||
configLayout->addLayout(bsModeLayout);
|
||||
|
||||
@@ -56,6 +56,7 @@ class ConfigurationPage : public QWidget
|
||||
QCheckBox *allRidesAscending;
|
||||
QCheckBox *garminSmartRecord;
|
||||
QLineEdit *garminHWMarkedit;
|
||||
QLineEdit *mapIntervaledit;
|
||||
QLineEdit *BSdaysEdit;
|
||||
QComboBox *bsModeCombo;
|
||||
QLineEdit *workoutDirectory;
|
||||
@@ -85,6 +86,7 @@ class ConfigurationPage : public QWidget
|
||||
QGridLayout *bsDaysLayout;
|
||||
QHBoxLayout *bsModeLayout;
|
||||
QGridLayout *garminLayout;
|
||||
QGridLayout *mapIntervalLayout;
|
||||
};
|
||||
|
||||
class CyclistPage : public QWidget
|
||||
|
||||
@@ -101,6 +101,9 @@
|
||||
#define GC_GARMIN_SMARTRECORD "garminSmartRecord"
|
||||
#define GC_GARMIN_HWMARK "garminHWMark"
|
||||
|
||||
// Map Interval period
|
||||
#define GC_MAP_INTERVAL "mapInterval"
|
||||
|
||||
#include <QSettings>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user