Commit Graph

6862 Commits

Author SHA1 Message Date
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
Mark Liversedge
20510eb7dc Fixup BT40 into right section of src.pro
.. with QT5 dependencies.
2016-04-25 16:48:49 +01:00
Mark Liversedge
758de19618 Merge pull request #1936 from viiru-/bt40_conversion
Bt40 conversion
2016-04-25 16:34:12 +01:00
Mark Liversedge
9b4e721d0d R SHLIB RGoldenCheetah
.. to use the R C API for to avoid use of Rcpp and RInside

.. the shlib doesn't do anything and isn't loaded in RTool
   at this point. Need to get this working cross-platform
   and iron out the build time nits.
2016-04-25 15:55:18 +01:00
Arto Jantunen
4d184d3f8c Add support for BTLE speed and cadence sensors 2016-04-25 15:55:15 +03:00
Arto Jantunen
07ee0b4ee3 Add support for BTLE power sensors 2016-04-25 09:57:04 +03:00
Arto Jantunen
7111e8428d Add support for BTLE HR sensors 2016-04-25 09:57:04 +03:00
Arto Jantunen
acae456bb9 Add support for subscribing to BTLE services 2016-04-25 09:57:04 +03:00
Arto Jantunen
34bb8abbb4 Add support for connecting to BTLE devices and scanning for services 2016-04-25 09:57:04 +03:00
Arto Jantunen
f9a5a6a2db Rewrite BT40Controller using Qt BTLE support 2016-04-25 09:56:58 +03:00
Arto Jantunen
0d616561fa Remove WFAPI support 2016-04-25 09:55:57 +03:00
Mark Liversedge
8702188ae6 R Add GC.metrics()
.. to return a data.frame of all metrics
2016-04-23 23:54:25 +01:00
Mark Liversedge
a178a6b886 R apply themes to par() options
.. the GC theme is used to set the graphical parameters
   used by standard plotting commands.
2016-04-23 20:32:51 +01:00
Mark Liversedge
f7059870ee R Parser don't crash on parse more
.. if the R parser is waiting for more input don't crash
.. just keep going waiting for more input.
2016-04-23 18:02:14 +01:00
Mark Liversedge
17195712e3 R Not Supported on Windows
.. so don't even try to build and warn via qmake

.. RInside/Rcpp do not suport MSVC
.. Microsoft Open R may help, but doesn't at this point
.. we can revisit at a later date.
2016-04-23 11:27:20 +01:00
Mark Liversedge
5bf3aae301 Fix Compare Pane Buttons on Mac
.. just use QT buttons instead of Mac.
2016-04-22 22:21:18 +01:00
Mark Liversedge
30a6d32d2f R avoid hang on console messaging
.. RInside is single threaded and hangs the event
   loop on the main thread (grrrr).
2016-04-21 21:48:10 +01:00
Mark Liversedge
07f0c2cdee R Antialias and Text Color
.. enable antialising and honour text colors (instead
   of always black!)
2016-04-21 12:26:46 +01:00
Mark Liversedge
2cc54676f1 R Honour Drawing Colors/Lines etc
.. apply the GEContext settings when drawing on the
   canvas to get proper output (e.g. ggplot2 works)
2016-04-20 20:38:11 +01:00
Mark Liversedge
5ccfef81cc R Plot Zoom Mousewheel
.. and scrollbar styling
2016-04-20 15:30:12 +01:00
Mark Liversedge
2ce6d2903d R Canvas with Basic Primitives
.. not complete, but we now have a canvas (QGraphicsView)
   to plot the R output without needing to use x11() or
   quartz(), window() etc.

.. the primitives do not honour the graphic engine context so
   all lines etc are white on black.

.. will fix and improve in followup commits, need to test
   with QT4.8 and cross-platform.
2016-04-20 14:04:32 +01:00
Mark Liversedge
d479406707 R $$variable substitution
.. since the R runtime is shared by charts we offer the ability
   to prefix variables with $$ to ensure they don't conflict
   across multiple RCharts.

.. $$d <- GC.activity() would actually be parsed within R as
   gc0d <- GC.activity(). The next chart would get gc1 and so
   on.

.. it is optional, so charts could share data structures (but
   wonder why you might do that)

.. we still need to encapsulate the code to plot within a
   script to ensure it is refreshed when the chart is selected
   or underlying data changes.
2016-04-19 20:19:29 +01:00
Mark Liversedge
abca59f696 R GraphicsDevice Circles now work
.. believe it or not the R base code for plot (plot.c)
   skipped plotting circles if they were white on white.

.. took me 4 hours to fix this by setting startcol and
   startfill in DevDesc for the device.

.. But at least the R driver now works properly -- we can
   now integrate with a qt widget.
2016-04-19 19:02:42 +01:00
Joern
baed0fc46d CI - Windows - Back to nmake
... free CI does only offer one core, so no need to install Jom - back to nmake
2016-04-19 08:40:03 +02:00
Mark Liversedge
6f49cc9684 R GraphicsDevice Primitives WIP
.. the R graphics device now gets called for hist() so we can
   work on the interaction with a QT widget now.

.. still have other problems to deal with (!)
2016-04-18 23:26:32 +01:00
grauser
1d733518d1 AllPlot : Point Hover for time of day 2016-04-18 22:13:29 +02:00
Joern
36d4757477 CI - Windows - JOM - Shimgen 3
... wrong path for jom
2016-04-18 21:42:10 +02:00
Joern
f065a3015a CI - Windows - JOM - Shimgen 2 2016-04-18 21:33:17 +02:00
Joern
9d5da8a3d1 CI - Windows - JOM - Shimgen
... jom not working via shimgen, use direct path instead
2016-04-18 21:30:25 +02:00
Joern
90bcc38d99 CI-Windows - use JOM
... use jom not nmake for parallel building
2016-04-18 20:34:53 +02:00
Mark Liversedge
4c268c1d29 R GraphicsDevice WIP
.. GoldenCheetahGD is instantiated

.. GC.display() to create new GD
   GC.activate() to activate the GD

NOTE: a fair amount of qDebug() in at present as
      the graphics functions are being created.
2016-04-18 14:04:02 +01:00
Mark Liversedge
dff5775dd9 R Console Backspace/Left Arrow
.. fix for wrapped lines.
2016-04-17 22:06:14 +01:00
Mark Liversedge
649856c815 R Incorrect Header "RGraphics.h" 2016-04-17 21:36:27 +01:00
Mark Liversedge
7128450bae R Add Skeleton for Graphics Device
.. basic code framework for a graphics device
.. committed to check cross-platform build
2016-04-17 21:12:12 +01:00
Mark Liversedge
588e3b0cb5 R Fix GC.activity()
.. return a valid data.frame
.. use POSIXct UTC

[is now compatible with the trackeR package]
2016-04-17 16:13:03 +01:00
grauser
9210764802 AllPlot : 'msecsSinceStartOfDay' only in recent Qt 2016-04-16 23:10:29 +02:00
grauser
e407a0d433 AllPlot : Clean last commented code 2016-04-16 22:39:50 +02:00
grauser
a8abadf313 AllPlot: Plot by time of day (simplier version) 2016-04-16 22:35:59 +02:00