Commit Graph

6900 Commits

Author SHA1 Message Date
Mark Liversedge
9d7f115f76 R OSX bundle dylib fixing tool
.. see util/osx_bundle_fix.sh

.. couldn't quite get it fully automated, for some reason
   you may need to run it multiple times.
2016-05-02 19:00:19 +01:00
Mark Liversedge
457b3e70d0 R compare date range signals
.. refresh when compare state changes
2016-05-02 11:23:23 +01:00
Mark Liversedge
ab5354e008 R Compare DateRange
.. GC.metrics(compare=TRUE) added

.. you can now plot metrics for different date ranges in the
   same way you can plot different intervals/activities.
2016-05-02 10:01:55 +01:00
Mark Liversedge
3f2f0b8b60 R nits
.. use opengl on Linux/Mac, its worth it for speed

.. new chart comment mentions activity(compare=TRUE)
2016-05-01 22:08:59 +01:00
Mark Liversedge
f322af31b9 R Support Compare Mode
.. GC.activity(compare=TRUE) will return a list of compares

.. If you are not in compare mode it will be 1 element long
   and represent the currently selected ride

.. otherwise it will have one entry for each activity dropped
   into the compare pane

.. each element has a $activity and a $color

Example:

df <- GC.activity()
.. do plot ..

Now:

compares <- GC.activity(compare=TRUE)
for (compare in compares) {
   df <- compare$activity
   col <- compare$color

   .. do plot ...
}
2016-05-01 21:08:41 +01:00
Mark Liversedge
8fb1d51dfd OSX Release Build R libs into Bundle
.. a script to copy the R dylibs to the app bundle and
   update the paths to the libs
2016-04-30 21:44:37 +01:00
Mark Liversedge
7bc92303c1 Development Build DEV-1604
.. update version macros
2016-04-30 18:25:17 +01:00
Mark Liversedge
7ba7708cd9 Merge pull request #1942 from Joern-R/R-Win1
R-Windows - Includes
2016-04-30 16:24:34 +01:00
Mark Liversedge
3b69d81f39 Merge pull request #1939 from erikboto/monark_fix_for_restarts
Monark: Fix out of sync issue when restarting bike when connected
2016-04-30 14:30:04 +01:00
Joern
06965f7c5d R-Windows - Includes
.. don't use R command function to find the includes. but R_HOME
2016-04-30 12:29:18 +02:00
Mark Liversedge
deccef46a6 R GC.metrics(all=TRUE) and Trend Chart
.. you can pass all=TRUE|FALSE to GC.metrics if you want to
   override the date range selection

.. also added connect to daterange select so a trend chart
   will refresh when you select a date range
2016-04-30 09:17:15 +01:00
Mark Liversedge
0620b42866 R Command Line Option --no-r
.. to disable embedded R - useful if startup is causing
   issues or crashes.
2016-04-29 20:44:19 +01:00
Mark Liversedge
4d9a59b271 R nits / tidy ups
.. highlighter and default script
2016-04-29 19:52:25 +01:00
Mark Liversedge
04ee09c285 R Script syntax highlighter
.. basic stuff, no completer.
2016-04-29 19:12:25 +01:00
Mark Liversedge
3a6b60316d R Script on Ride Selected
.. set a script to run when an activity is selected

.. this allows a plot to be generated and displayed when
   you select a ride in analysis view

.. the script is stored with the chart settings
2016-04-29 14:06:25 +01:00
Mark Liversedge
4f7bf7f9a2 R Multi-line commands
.. >> prompt for a continuation line

.. ^C to kill wherever we are and start again
2016-04-29 10:25:38 +01:00
Mark Liversedge
746bfd5240 R pull in OpenGL for hardware acceleration
.. although its disabled in RCanvas for now, it will
   be re-enabled when settings are allowed.
2016-04-29 09:58:08 +01:00
Mark Liversedge
2b4b9ceb3a Windows Fix Scrollbar Style
.. add-page/sub-page were not styled correctly (!!)
2016-04-29 09:52:43 +01:00
Mark Liversedge
9c1c7f560d R remove out of date docs/utils
.. since we don't need RInside/Rcpp now.

[skip ci]
2016-04-29 09:14:59 +01:00
Mark Liversedge
4d4e26edda R set default repo at startup
.. so install.packages() works without user having to
   set or select a mirror.
2016-04-29 09:03:49 +01:00
Mark Liversedge
c1869fa7a6 R Plot Acceleration via OpenGL
.. plot canvas now uses OpenGL to accelerate painting
2016-04-28 23:05:22 +01:00
Mark Liversedge
b78e3a7b7c R argv/verbose clean up
.. didn't use argc/argv in R initialisation
.. accidentally enabled verbosity
2016-04-28 19:20:43 +01:00
Mark Liversedge
6f85718c85 R Windows Fixup
.. Embedded R now supports on Windows
2016-04-28 17:49:28 +01:00
Mark Liversedge
ba843b6151 R Windows Build Support
.. it now builds and runs on Windows

.. there is a runtime crash when embedded  R is initialised
   that needs to be reolved

                    ** NOTE **

R is not distributed with a .lib that can be linked to
with the MS VC linker. Instead, we need to generate a
lib and exp file from the dll:

1. dumpbin /exports R.dll > R.def
2. edit the .def output to have EXPORTS at the top and
   a list of functions only (last column, delete the rest)
3. lib /machine:x64 /def:R.def

After linking remember to copy the DLLs to the GoldenCheetah
build directory from the $R_HOME/bin/x64/*.dll
2016-04-28 17:04:40 +01:00
Mark Liversedge
549df5e549 R boolean. 2016-04-28 08:58:41 +01:00
Mark Liversedge
a94bb433ab R Another workaround for QT4 TRUE/FALSE conflict
.. resolving compile time issues with CI that don't
   occur on your own builds is horrible.
2016-04-28 08:28:13 +01:00
Mark Liversedge
b370cf745e R More Rboolean enums nonsense
.. sigh.
2016-04-28 08:11:17 +01:00
Mark Liversedge
7cdd82d9ea Rboolean::FALSE not FALSE
.. and a few more tidy ups.

.. never cease to be amazed at how some developers
   will feel its OK to define generic symbols like
   TRUE and FALSE in their code (!!)

.. R is a mess.
2016-04-28 07:53:14 +01:00
Mark Liversedge
57d5e13908 Rboolean::TRUE not TRUE
.. since TRUE is #defined in QT4. sigh.
2016-04-28 07:47:56 +01:00
Mark Liversedge
441838b4cb Use Rinternals.h not Rdefines.h
.. Rdefines is ancient.
2016-04-27 22:36:23 +01:00
Mark Liversedge
d25a362737 <stdexcept> for std::runtime_error
.. missing header.
2016-04-27 22:08:26 +01:00
Mark Liversedge
8c2d0816af CI GC_WANT_R retry without RInside/Rcpp
.. reactrivate building with R support now we do not
   have RInside and Rcpp
2016-04-27 21:52:43 +01:00
Mark Liversedge
76686d8128 R OSX fixups for no RInside/Rcpp
.. mostly startup issues when R_HOME is not known

.. need to think carefully about how we get the user to
   register the R home. We could let them select the R
   binary so we can run `R RHOME` and apply that (?)
2016-04-27 20:55:02 +01:00
Mark Liversedge
abe99b87d1 R Fix Version
.. in version dialog etc
2016-04-27 19:59:11 +01:00
Mark Liversedge
5321787543 R Trap Console i/o
.. and redirect to rtool
2016-04-27 19:34:38 +01:00
Mark Liversedge
21cc8acb80 R Replace RInside
.. we no longer need RInside or Rcpp as we use
   100% R API calls to embed

.. the following need to be resolved:

   1. R_HOME / Options *must* be set to startup
      embedded R but we don't check / restart or
      default via system("R HOME")

   2. Output is not trapped - all output is sent
      directly to the console you started GC on

.. will fixup the 2 above before finally:

   3. Build for Windows using MSVC !
2016-04-27 18:39:08 +01:00
Mark Liversedge
cc3a449d2a R Preferences set R_HOME
.. allow the user to browse and set the home directory for
   the R install -- in preparation for replacing Rinside with
   our own code to embed R
2016-04-27 12:31:23 +01:00
Mark Liversedge
9608830908 R DLL/SO not required (!)
.. we can register routines when embedding via the
   R_getEmbeddingDLLInfo()

.. so we just register our functions directly now
   in RTool rather than needing a dynamic library.

.. its cleaner and there are no nasty casts and build
   settings required
2016-04-27 08:11:01 +01:00
Mark Liversedge
e73858b2fa R GC.metrics()
.. no longer needs Rcpp, we now have no code that
   is directly dependant upon Rcpp being installed.

.. we can now look at replacing RInside.
2016-04-26 21:33:49 +01:00
Mark Liversedge
bd53a810a3 R GC.activity()
.. uses native R API to create the dataframe, removing Rcpp.
2016-04-26 19:27:13 +01:00
Mark Liversedge
806b6498f5 R GC.activities()
.. remove need for Rinside/Rcpp
2016-04-26 17:29:09 +01:00
Mark Liversedge
d13c131b2f R GC.athlete and athlete.home
.. reimplemented with native R API

.. switched to .Call in R function since .C means all functions
   return void and must return by a pass by reference parameter.
2016-04-26 15:58:03 +01:00
Mark Liversedge
081320d43d R Restructure src
.. and fix Linux build of R shared library
2016-04-26 12:23:13 +01:00
Mark Liversedge
9274a7d62f Remove RTool.cpp -fpermissive from src.pro
.. its not needed as the workaround of using an extern "C" function
   to perform the function pointer cast conforms to standard.

.. this just simplifies src.pro that was getting heavy
2016-04-26 08:03:54 +01:00
gcoco
40f5d0e4d8 windows.h not Windows.h 2016-04-25 19:39:18 -04:00
Mark Liversedge
c0bbbc44e4 R Use Rf_PrintValue not Rcpp::print
.. slowly removing all the Rcpp dependencies.
2016-04-25 23:07:42 +01:00
Mark Liversedge
5ac9599485 R OSX qmake cp RGoldenCheetah.so post link
.. to address warnign in previous commit.
2016-04-25 23:01:20 +01:00
Mark Liversedge
f5601c9a2c R SHLIB OSX Fixups (SEE WARNING IN COMMIT MSG)
.. fixup R SHLIB build and integration to work on OSX

                  **** WARNING ****

If you build for OSX with GC_WANT_R You will need to
manually copy RGoldenCheetah.so into the app bundle.

$ cp RGoldenCheetah.so ./GoldenCheetah.app/Contents/MacOS

                  *****************
2016-04-25 22:48:22 +01:00
Mark Liversedge
de2d7dcce0 R GC.version() build() not using Rcpp
.. just declare them as normal R functions.

.. only 3 more functions to convert; activity/ies and metrics.
2016-04-25 20:36:43 +01:00
Mark Liversedge
313dffeb11 R SHLIB GC.display()
.. phew. that was hard.

.. To register routines with R you need to place them in a shared
   library.

.. The routines we want to register are part of  the GC codebase so
   cannot be linked into that shared library (it would be the whole
   of GC).

.. So; we have a shared library (RGoldenCheetah.cpp) which has stubs
   for all the registered functions and an array of pointers to the
   actual functions.

.. We load the library (once R is embedded it is loaded in main.cpp)

.. After the library is loaded we then call one of its public
   functions (GCInitialiseFunctions) to tell it where all the GC
   functions are (we only have GCdisplay at present for this proof
   of the concept).

.. Along the way we need to deref/cast DL_FUNC in RTool.cpp which
   is not permitted in ISO C, so we also update qmake to add a
   special rule to compile `dodgy' sources with -fpermissive. And
   the only dodgy source is RTool.cpp.

.. This commmit will break GC_WANT_R builds on OSX, and will be
   fixed up shortly.

.. The motivation behind this is to avoid RInside/Rcpp for Windows
   builds -- enabling R support (which is not currently possible).
2016-04-25 20:11:03 +01:00