Coder Social home page Coder Social logo

karaul / fitalyser Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 2.9 MB

Wrapper to work with *.fit (Garmin) and *.tkl files by using fitplotter

License: MIT License

Batchfile 1.08% HTML 7.89% JavaScript 91.03%
fit garmin suunto suunto-movescount plot tkl navrun ultrasport

fitalyser's Introduction

fitalyser

This is a wrapper to work with the fitplotter.

See screenshots

Motivation

To analyse my own 10 years running experience recorded in several thousands binary files, and just for fun

Installation

Installation for non-programmers who found this program in github

  • Click on the green button, download everything as zip file and unzip.
  • Install nodejs
  • Ιnstall fitplotter side-by-syde
  • click fitalyser.bat and then click Open
  • check if it works with the activies given in myactivities folder
  • close fitalyser
  • remove all files from myactivities
  • copy to myactivities folder your *.fit files
  • click summaryTable.bat and check that the *.csv table is created in myactivities
  • click fitalyser.bat
  • if I did no mistakes and you followed the above items, the table with your data will be opened

Installation for programmers who found it in github

github clone https://github.com/karaul/fitalyser.git

Usage

Υou need a table with the locations of the FIT files to be analysed. This table must be prepared in advance. In the utilities folder there are two utilities: checkFields.js checks fields in the FIT tested file, and summaryTable.js creates the table. If the table is builded correctly, then clicking on the "Plot" button sends the FIT file to the fitplotter form. To use these utilities do the following:

  • open command prompt;
  • move to the program location;
  • make sure you know where is node.exe;
  • open in a plain text editor the needed utlities and read first commented lines there. You should correct paths in this utlities to the directory with your FIT files. The final table will be in the same directory;

summaryTable.bat is to work with table.csv. If it does not exist table.csv will be created, otherwise new *.fit files, absent in the current table.csv, will be added in the existing table.csv.

To format table you can use tableHeaders.js. (To be continued - need how-to)

Read CHANGELOG.md for last changes - there are explanations how to use the program too.

How it works

fitalyser needs a static http-server to read local FIT files. Without the server, each time when you select a FIT file in the table, there will be a dialog asking for file's location and user's confirmation to open the file, alhough the path to the file is already in the table, and fitalyser aim is to avoid unnecessary clicks. Υou may use your own server or to use http-server-static.js, working with node.exe, which has to be installed before, download it from nodejs. All the *.bat files and *.js utlitiies must be preceeded by the node.exe. If something does not work at all, check path in the corresponding *.bat file, and read carefully messages in the command prompt.

License

MIT license

(c) Evgeny Votyakov aka karaul (about me in Russian), Nicosia, Cyprus, 2021

fitalyser's People

Contributors

karaul avatar

Stargazers

 avatar

Watchers

 avatar  avatar

fitalyser's Issues

Sorting summary table

As mentioned already in your fitplotter repo, I am adapting your wonderful projects (fitalyser and fitplotter) to my needs. I am almost done, but one thing drives me nuts, and I hope to get some help from you.

I simply want to have the summary table sorted by date in descending order. Therefore I delete the table every time there is a new activity and changed the code in utilities/summaryTable.js as follows. The idea is to read the files in activitiesFolder and sort them by creation date in the desired order before parsing them:

fs.readdir(activitiesFolder, (err, files) => {
  if (err) {
    console.log("\nDoes not exist: \"" + activitiesFolder + "\n\nCheck path to FIT files\n");
    return;
  } else {
    //START NEW CODE
    files.sort(function(a, b) {
      return fs.statSync(activitiesFolder + "/" + b).birthtime.getTime() - fs.statSync(activitiesFolder + "/" + a).birthtime.getTime();
    });
    // END NEW CODE
    files.forEach(file => {
      if (file.slice(-4) === fileExt) {

But the table is still not sorted by date in descending order. The funny thing is, that if I am starting summaryTable.bat again and agan after deleting the table, the newly generated table is always sorted in a different way, which I do not understand at all.

Can you give me a hint what I am doing wrong here?

node.js and javascript is not my homeground, so maybe my question is silly, but I am always eager to learn. Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.