Commit Graph

66 Commits

Author SHA1 Message Date
Joern
a6eabb73d7 Autoimport Stealth/Background Mode
... new Feature to Autoimport without Dialog (with same timeframe option like the Dialog version)
... in case "Dates/Time" is missing - the Dialog Window appears and waits for input -
    if entered and "Save" presses no further input action is required
... malformed activity files are silently ignored

... to avoid inconsistencies closing of the Athlete for which Background Import is running
   is blocked until the Import is finalized (Info on import complete is sent to UI)

.. UI is not blocked by Autoimport - but a bit less reactive as long as the import is executed
2015-10-25 13:04:19 +01:00
Joern
e7e6e0bd70 RideImport/Autoimport
... don't force focus on the import dialog window
... bring dialog to front only if user interaction is required
2015-10-23 21:05:21 +02:00
Joern
98cb17b124 Make Date Formats locale independent (for special cases)
... fix problems when dates are converted back/forth with fromString/toString to avoid Locale related mismatches
... use ISO 8601 format (YYYY-MM-DD) in such cases (Qt::ISODate)
... applied to "RideImport" and "ComparePane"
2015-10-21 18:38:03 +02:00
Mark Liversedge
e74ecc1f09 DataProcessor 'Auto' runs on import only
.. since, generally, if it has been run once there is no
   value in running it every time you open a ride.

.. it now only runs during import.
2015-10-08 08:46:54 +01:00
Joern
d71aa8c0a2 Autoimport - new configuration option(s)
... select only files for import which are created or changed of the last 90/180/360 days
... thus limiting the number of files which are considered for import in the source directory
   (without changing/deleting the source files - and without the need to track indexes,...
    of what has already been imported).
2015-09-24 18:55:00 +02:00
grauser
e0b16bd32e FitRideFile: Remove warnings for global_msg_nums 8 & 9 2015-09-01 20:59:00 +02:00
Joern
b317e5aec2 UI Nit - RideImportWizard 2015-07-17 19:24:17 +02:00
Mark Liversedge
805772a2c4 Revert "Add support for reading multi sport FIT files."
This reverts commit 7fdedf0bfe.

.. we will come back to look at multisport FIT files in v4.0
   The main problem is related to the position of the SESSION
   header within the file.
2015-07-04 18:15:01 +01:00
Mark Liversedge
573adb1ef2 Merge pull request #1397 from alex-hhh/multisport-import-2
Import multisport FIT files
2015-06-09 19:54:25 +01:00
Claus Assmann
9c057191b5 Fix comment typos 2015-06-07 16:31:56 +01:00
Alex Harsanyi
7fdedf0bfe Add support for reading multi sport FIT files.
Multisport FIT files are imported as separate activities, one for each session
in the file.

The internal storage format for multisport files was also changed form TCX to
JSON, as the TCX file would not store advanced metrics, like the left-right
balance from the Garmin Vector power meter.
2015-06-03 20:47:24 +08:00
Mark Liversedge
fb994fa5e7 Rename Ride to Activity
.. across the code, except where it clearly is a ride
   e.g. importing PowerTap or SRM
2015-01-30 10:59:56 +00:00
Joern
5f6cfe278a Fix - .JSON not updated with manual changes immediately after Import or Download
... correct the path in RideItem after updating RideCache to the final
path (since RideItem has a local buffer for the path - which is e.g.
used at "Save Ride") any manual changes after the import will create a
new .JSON in /tmpActivities and not update the original .JSON in
/activities

(Problem only occurs when using the in-memory data after an Import or
Downlaod)
2015-01-11 18:33:54 +01:00
Joern
f655dbdde8 Introducing /quarantine for acvitities cause RideCache to crash/dump
... for RideImport and RideDownload the created .JSON files are firstly
stored in /tempActivities and only moved to /activities after
successfull updating RideCache (with this files with "bad data" cause
RideCache calculations to crash can be identified when starting GC again

... in GC CrashDialog the /tempActivities are documented in the Crash
Log and moved to /quarantine for further analysis

... small addition - the existence of the new directory structure is
verified when opening an Athlete - missing directories are added to
ensure a consistent structure being in place at all times
2015-01-11 13:22:47 +01:00
Mark Liversedge
55928938ef RideImportWizard XXXREFRESH cleanse
.. no need to uplift the code that used to call for a metric
   refresh after rides were imported since the addRide function
   will now refresh for individual rides.
2014-12-30 11:05:32 +00:00
Mark Liversedge
e7399ba4f2 Lucene empty index optimisation
.. rather than check if lucene index contains every ride
   upon startup just force a rebuild of the index is missing.

.. if the index gets out of sync its because people are copying
   data and so they should delete the index when they do so
   to make sure it stays in sync
2014-12-29 10:24:10 +00:00
Mark Liversedge
44aea09d97 Deprecate SQL metricDB
.. removes across the code base

.. need to fixup RideFileCache and Lucene refresh
   within the RideItem/RideCache framework, they will
   NOT be refreshed at present

.. need to look at how charts get refreshed on data
   changes now RideItem provides a more granular
   mechanism (look for XXXREFRESH in code)

.. New Intervals code will definitely NOT compile
   and needs to be redesigned/reimplemented to fit
   in with the ride cache
2014-12-24 20:24:34 +00:00
Joern
0610575a7c Enable Context Help (Shift+F1) using "QT's - What's This"
... adds "What's this" to (hopefully) most of the widgets (please report
on missing ones)
... defines draft "Whats' this" texts including a
context specific WikiLink

.. Help Key for all platforms is <Shift>+<F1> + in some widgets
"RightMouse - Click"

... Tested on Win and Mac (On Mac QtMacButton seems not supporting
"What's this") - so here <Shift>+<F1> has no result.

... ToDo: Create final texts and links based on the to be updated 3.11
Wiki
2014-12-14 18:55:42 +01:00
Joern
1683ae9e2e Athlete Subdirs - improvements
.. added /BAK subdir where all actvities .BAK files are stored
.. do not delete any original files in /imports /downloads when deleting
activity
.. copy deleted activity .JSON as .BAK into /BAK subfolder
.. adjust upgrade procedure to copy .BAK files to /BAK
2014-12-05 18:44:11 +01:00
Joern
87cfa6d1dc Autoimport - do not process if no files determined
... do not process the popup if no files with the correct extensions
were found / the directories were empty
... (this does not address to skip files which were already imported !)
2014-11-26 19:20:16 +01:00
Claus Assmann
52408ad1b5 More spelling errors
.. Mark cannot spell for tofu.
2014-11-25 11:42:08 +00:00
Claus Assmann
35eb416bd2 Fix comment spelling errors
.. lots of them !
2014-11-24 15:37:56 +00:00
Joern
dcb2dcf59a Auto-Import - "no files selected" UI improved
... do not show "files table" and progress bar
... only provided "Finish" button to close the window
2014-11-15 11:28:26 +01:00
Joern
a73d5df95c AutoImport - 2nd version
... multiple pathes per Athlete (on Athlete-Preferences - AutoImport
TAB) - option per Path if Import shall be done or not (e.g. for
temporary de-activation without removig a path)
... configuration stored in XML file in /config subdir
... no "stealth" mode any more - but full log of Rides to be imported
with option to "Abort" the import process at any time
2014-11-09 10:58:23 +01:00
Joern
230f028037 AthleteDirectory - Folder Structure Part 2 of 2 + Always create .JSON
... create folder structure for existing and new athletes
... upgrade existing athlete to new structure when opening / incl.
logging and error handling
... convert any "Downloaded" file to .JSON directly - store source file
in /downloads
... convert any "Imported" file to .JSON directly - store source file in
/imports
2014-11-02 19:55:01 +01:00
Joern
f1447d2664 AthleteDirectory - Folder Structure Part 1
... introduce new "home" Folder structure object representing the
previous flat-folder
... adjust relevant QDir home - access to use the sub-folder method of
the new object

Note: the new structure is not yet active ! - everything is written to
the main folder still

To Do:
... add upgrade procedure for existing folder content to merge to the
new folders
2014-10-25 19:08:27 +02:00
Joern
809696d9b3 Auto/Stealth Ride Import when opening an Athlete
...  import Ride Files automatically from a defined Directory per
Athlete
...  runs silently/without "Import Rides" Widget if the files can be
imported/copied/... without error or warning
...  Preferences->Athlete- defines
... the directory - per Athlete and- if the function is active at all
(default is OFF)
... the error handling
... report back ALL errors and warnings by opening the RideImportWizard
popup
... report back Errors and Warnings - but ignore the "File exists"
warning (so that the import directory can be continously supplied with
new files, without the need to remove the already imported ones)
2014-10-12 19:28:16 +02:00
Joern
312e5b0f03 Remove AM/PM from time formatting (to be Locale neutral)
... sync all format strings for time input/output to 'hh:mm:ss'
... remove any 'AM/PM' time formats
... remove tr() commands from time formats (since 'hh:mm:ss' is
reasonable around the globe)

... main reason: QT5 does not follow the pure formatting rules any more
(like QT4), but considers the system.locale in formatting as well (so
for system which have no AM/PM, even if the format string is set, the QT
routines ignore that - having some side effect on GC)
2014-06-29 11:24:56 +02:00
Mark Liversedge
ee76e6769a Compromise on import
.. signal when importing a relatively small number
   of items (less than 20)

.. don't signal when importing a lot of items (more
   than 20).
2014-01-11 10:55:23 +00:00
Mark Liversedge
f10f1cbabf Fix Mass Import Memory Exhaustion
.. don't signal when adding a ride, which kicks off
   all manner of updates across the code, instead
   we let the metric refresh kick in at the end.

.. this is great for an initial load and mass import
   of large numbers of rides, but sucks for a small number
   of rides when maybe downloading

.. we could make the signalling dependent on the number of
   rides being imported, so small number still updates the
   CP charts etc.

THIS IS A TEMPORARY FIX TO THE MORE SIGNIFICANT PERFORMANCE
ISSUE -- BUT WE DO NEED TO CONSIDER THE ISSUE OF CHART UPDATES
2014-01-10 22:02:46 +00:00
Mark Liversedge
a2a962120c A lot less assert
There still some assert left in the code, but removed
a fair number of the examples where, its just as easy
to handle the condition gracefully, without crashing.

By 3.1 we will have eradicated assert from the code.
2013-08-04 11:06:07 +01:00
Mark Liversedge
d21ca376be MainWindow Refactor Part 3 of 5
Slowly migrating code  and data from the MainWindow
class to Athlete and Context classes.

This update moves the ride and interval lists and
data structures from MainWindow to Athlete.
2013-07-13 19:46:03 +01:00
Mark Liversedge
d639411f24 Move isclean from MainWindow to Athlete
.. rather unfortunate use of English as it leads
   to athlete->isclean == false :)
2013-07-12 18:15:14 +01:00
Mark Liversedge
05f1d577db Refactor MainWindow Part 2 of 5
Decoupled classes from MainWindow to reference Context
and Athlete (and introduced a couple of new headers).

We no longer pass around a MainWindow pointer to children
but pass a context instead.

There are still a few pieces left in MainWindow that need
to move to a better place;
    * Setting/clearing filter selection
    * Working with Intervals
    * Adding/Deleting Rides
    * Save on Exit

As mentioned previously there are lots of other parts to
this refactor left to do;
    * break MainWindow Gui elements into Toolbar and Views

    * migrate from RideItem and Ridelist to ActivityCollection
      and Activity classes that are not tied into gui elements.

    * introduce Application Context and AthleteCollection
2013-07-11 14:02:02 +01:00
Mark Liversedge
e407237ac0 MainWindow Refactor Part 1 of 5
Breaking the MainWindow 'god object' into
separate classes for Athlete and Context.

Further updates will need to;
- break MainWindow Gui elements into Toolbar and Views

- migrate from RideItem and Ridelist to ActivityCollection
  and Activity classes that are not tied into gui elements.

- introduce Application Context and AthleteCollection

Once these are done we will be in a position to decouple
most classes from mainwindow and also introduce tabbed
athletes.
2013-07-07 15:50:28 +01:00
Mark Liversedge
3c62ac98b4 Deprecate overwrite existing files on import
.. just for release 3.0 until the major bugs are fixed.

Fixes #620
2013-05-30 11:42:52 +01:00
Mark Liversedge
1389530cd5 RideImport MUST notify charts
Essentially reverting the commit 0ba93fe61
2013-04-10 12:43:20 +01:00
Mark Liversedge
0ba93fe619 Defer metric refresh till end RideImportWizard
.. speeds up large imports considerably.
2013-03-30 20:33:36 +00:00
Mark Liversedge
3235233791 Code Cleanup: ? and + operator precedence warnings
.. in RideImportWizard resizing .. nasty bit of code.
2013-02-13 09:09:39 +00:00
Mark Liversedge
cd2fca9346 Code Cleanup: Remove #if 0 code
As a personal habit I tend to use the C pre-processor to
comment out code blocks I don't want to remove. This is in
case the code will be required in the future.

I think it is now safe to say the code commented out is not
required -- most of it is legacy and marks the transition from
earlier designs or legacy code.

I've done this in one big commit since in theory it has no
functional change, and in future can look in this commit for any
code we may want to reinstate.
2013-02-11 15:00:00 +00:00
Mark Liversedge
e256d3fa6a UI Nits: Importing GTC Export screen updates
When importing a GTC export (which contains multiple ride
files in a single .TCX) the screen update stalls whilst the
file is split. The import dialog is half drawn and looks
ugly to the user for a split second.

We now delay updates until the export has been expanded
into separate files, which means there is a slightly longer
delay as the file is initially processed, but the screen
updates are cleaner.
2012-12-02 08:16:35 +00:00
Damien
8eee2ddb25 Choose Metric/Imperial units in New Athlete dialog
fixes #34
2012-11-26 23:35:35 +01:00
Mark Liversedge
cc0fbdf47d File Export (part 1 of 2)
The export functions in mainwindow are getting quite
cumbersome with multiple menu options.

This patch creates a single menu option "Export.." which
allows the user to select a supported format and a filename.

To support this the ridefile reader code needed to be adjusted
to allow registered readers to declare capability to write and
use a consistent (virtual) method to do so.

By modifying the base class for ride file reader we now allow
new readers to register both read and write capability.
2011-10-12 14:19:14 +01:00
Mark Liversedge
e55ed50418 Check Duplicates when importing rides
When importing a ridefile we have never checked that the
same ride (date/time) does not already exist but in a
different ridefile format.

For example, importing a TCX file when a .RAW file already
exists for the same date/time causes conflicts with the
.cpx and .notes file (it is not possible to distinguish
which ridefile the notes/cpx file belong to).

Fixes #389.
2011-08-21 14:43:13 +01:00
Mark Liversedge
4970c07910 Free Memory in Ride Import
... after reading a GTC export. Also zapped
the boost dependency.
2011-08-05 22:31:31 +01:00
Mark Liversedge
2909e09373 Missed off previous commit
An errant git rebase lost these changes, this is
to support the GTC export file support and updates
the Json parser to use the new call semantics and
gets the Import wizard to clear up temporary files
when it closes.
2011-08-05 21:37:28 +01:00
Mark Liversedge
03b0dea597 Support Garmin Training Center Export Files
GTC will export all rides as a single TCX file so they
can be imported en-masse into another application.

We did not support >1 rides in a single ride file. This
patch adds support for reading multiple rides (if the ride
file reader supports it).

The ride import wizard will now extract and parse files from
a GTC export.  Many thanks to Damien for writing the TCX file writer.

Fixes #371.
2011-08-05 20:53:13 +01:00
Mark Liversedge
cd86521abb Fix date/time handling when importing rides
The ride import wizard would only allow the user to
change the ride date/time if it was a .gc .json or
.csv file. This was because (wrongly) it was because
we could not update the date/time defined within the
ride file itself.

Of course, we encode the ride date/time in the filename
and so it could be changed. However, not all the RideFile
readers supported this.

To get around this, the import wizard now does let you
change the date and time for any file type and the ride
file factory method openRideFile() will override whatever
date and time is returned by examining the filename. The
user needs to double click the date or time to edit it.

Additionally, the select date... combo would only register
when you changed the selection, it now defaults back to
the 'select date..' option after each selection.

Lastly, the 'choose date' function now works as advertised
and triggers editing the date for the ride selected.

This patch needs plenty of testing and is potentially going
to resolve the 'misleading UI' bug numer 11, but will need
to be cherry-picked back to v2 master once it has been
adequately tested.
2011-08-01 21:45:00 +01:00
Mark Liversedge
a48f7c00d1 Clean compile time nits
Lots of nitty fixups, largely for uninitialised temporary
variables.

I have left the use of boost::function and boost::bind in the
DownloadRideDialog alone, so it will vomit when compiled
with boost 1.46 and gcc 4.5 or higher. Will look into this
more carefully at a later stage.

I am working up to resolving issues identified from -pedantic next.
2011-05-12 22:12:36 +01:00
Mark Liversedge
6af6b347bf Version 3 - No Ridefiles Bugs Bonanza
When no ridefiles are available (new cyclist) or the last ridefile
is deleted the current ride will be null. In addition the ride
importer deletes the memory for a ride imported to ensure VM is not
exhausted on large imports.

This patch fixes a whole host of null errors across the codebase. They
were identified by creating a new cyclist, executing every menu option
and tab/chart and then importing a file choosing everything and then
deleting the file and choosing every option again.

This negative testing should be performed before every stable release since
it has identified at least 6 bugs which are almost certainly present in the
current V2 code.
2011-04-09 11:24:40 +01:00