Commit 5ddf02f8 authored by Administrator's avatar Administrator

stryd cadence bug, lap list scrollable, typos in help text, power in lap list

parent 261d9678
......@@ -177,6 +177,12 @@ class Activity extends ChangeNotifier {
db.avgStrideRatio = Lap.calculateAverageStrideRatio(records: records);
db.sdevStrideRatio = Lap.calculateSdevStrideRatio(records: records);
var laps = await this.laps;
for(Lap lap in laps) {
var records = await lap.records;
lap.db.avgPower = Lap.calculateAveragePower(records: records);
await lap.db.save();
}
await db.save();
return true;
}
......
......@@ -24,6 +24,8 @@ class Lap {
}) {
lap.db
..activitiesId = activity.db.id
..avgSpeed = dataMessage.get('avg_speed')
..maxSpeed = dataMessage.get('max_speed')
..timeStamp = dateTimeFromStrava(dataMessage.get('timestamp'))
..startTime = dateTimeFromStrava(dataMessage.get('start_time'))
..startPositionLat = dataMessage.get('start_position_lat')
......@@ -45,8 +47,6 @@ class Lap {
..totalDistance = dataMessage.get('total_distance')?.round()
..totalStrides = dataMessage.get('total_strides')?.round()
..totalCalories = dataMessage.get('total_calories')?.round()
..avgSpeed = dataMessage.get('avg_speed')
..maxSpeed = dataMessage.get('max_speed')
..totalAscent = dataMessage.get('total_ascent')?.round()
..totalDescent = dataMessage.get('total_descent')?.round()
..avgStanceTimePercent = dataMessage.get('avg_stance_time_percent')
......@@ -369,7 +369,9 @@ class Lap {
static double calculateAverageStrideRatio({List<Event> records}) {
var powerRatios = records
.where((record) =>
record.db.speed != null &&
record.db.strydCadence != null &&
record.db.strydCadence != 0 &&
record.db.verticalOscillation != null &&
record.db.verticalOscillation != 0)
.map((record) =>
......@@ -387,7 +389,9 @@ class Lap {
static double calculateSdevStrideRatio({List<Event> records}) {
var powerRatios = records
.where((record) =>
record.db.speed != null &&
record.db.strydCadence != null &&
record.db.strydCadence != 0 &&
record.db.verticalOscillation != null &&
record.db.verticalOscillation != 0)
.map((record) =>
......
......@@ -13,7 +13,7 @@ class IntroductionScreen extends StatelessWidget {
child: Text('''
Encrateia is an mobile application that wants to help you analyse your activity tracking data. In particular Encrateia analyzes .fit-Files that are created by many fitness trackers by default.
Encrateia is quite a sophisticated peace of information with 20+ charts, and 10+ reports, so we thought, we'd share the rationale behind Encrateia and what it actually does:
Encrateia is quite a sophisticated piece of software with 20+ charts, and 10+ reports, so we thought, we'd share the rationale behind Encrateia and what it actually does:
A lot of runners and cyclists upload their activity data to Strava, to be able to share and analyse and because storage capacity on tracking devices is limited. Old tracking data is typically deleted without asking the user for consent.
......@@ -24,7 +24,7 @@ Encrateia helps you download your original tracking data - the .fit-files from S
To get your data, we fetch information about your actitvities via the Strava API. You have to authorize the Encrateia app to do so. As the .fit-files can only be downloaded from the web site (and not via the API) you have to provide your Strava credentials a second time.
Then you can use the [Download from Strava]-Button on the Athlete Screen to download the latest of your actitvties. They are stored on your device (and you could create a backup manually, if you like).
Then tha .fit-files are parsed and the data is stored in a local SQLite database on the device. This takes quite some time, parsing is quick, but storing is 20 to 30 seconds per activtity.
Then the .fit-files are parsed and the data is stored in a local SQLite database on the device. This takes quite some time, parsing is quick, but storing is 20 to 30 seconds per activtity.
That makes later analysis a lot quicker and it has only to be done once.
No data is leaving your device, neither to the developer of Encrateia, nor to any third party service. We believe, your activity data should be stricty yours.
......
......@@ -4,6 +4,7 @@ import 'package:encrateia/models/lap.dart';
import 'package:encrateia/screens/show_lap_screen.dart';
import 'package:encrateia/utils/date_time_utils.dart';
import 'package:encrateia/utils/icon_utils.dart';
import 'package:encrateia/utils/num_utils.dart';
class LapsListWidget extends StatelessWidget {
final Activity activity;
......@@ -16,62 +17,71 @@ class LapsListWidget extends StatelessWidget {
future: Lap.by(activity: activity),
builder: (BuildContext context, AsyncSnapshot<List<Lap>> snapshot) {
if (snapshot.hasData) {
return DataTable(
dataRowHeight: kMinInteractiveDimension * 0.60,
columnSpacing: 1,
columns: <DataColumn>[
DataColumn(
label: MyIcon.repeats,
tooltip: 'Lap',
numeric: true,
),
DataColumn(
label: Text("bpm"),
tooltip: 'heartrate',
numeric: true,
),
DataColumn(
label: Text("min:ss"),
tooltip: 'pace',
numeric: true,
),
DataColumn(
label: Text("km"),
tooltip: 'distance',
numeric: true,
),
DataColumn(
label: MyIcon.ascent,
tooltip: 'ascent',
numeric: true,
),
],
rows: snapshot.data.map((Lap lap) {
return DataRow(
key: Key(lap.db.id.toString()),
onSelectChanged: (bool selected) {
if (selected) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ShowLapScreen(lap: lap),
),
);
}
},
cells: [
DataCell(Text(lap.index.toString())),
DataCell(Text(lap.db.avgHeartRate.toString())),
DataCell(Text(lap.db.avgSpeed.toPace())),
DataCell(
Text((lap.db.totalDistance / 1000).toStringAsFixed(2)),
),
DataCell(
Text((lap.db.totalAscent - lap.db.totalDescent).toString()),
),
],
);
}).toList(),
return SingleChildScrollView(
child: DataTable(
dataRowHeight: kMinInteractiveDimension * 0.60,
columnSpacing: 1,
columns: <DataColumn>[
DataColumn(
label: MyIcon.repeats,
tooltip: 'Lap',
numeric: true,
),
DataColumn(
label: Text("bpm"),
tooltip: 'heartrate',
numeric: true,
),
DataColumn(
label: Text("min:ss"),
tooltip: 'pace',
numeric: true,
),
DataColumn(
label: Text("Watts"),
tooltip: 'power',
numeric: true,
),
DataColumn(
label: Text("km"),
tooltip: 'distance',
numeric: true,
),
DataColumn(
label: MyIcon.ascent,
tooltip: 'ascent',
numeric: true,
),
],
rows: snapshot.data.map((Lap lap) {
return DataRow(
key: Key(lap.db.id.toString()),
onSelectChanged: (bool selected) {
if (selected) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ShowLapScreen(lap: lap),
),
);
}
},
cells: [
DataCell(Text(lap.index.toString())),
DataCell(Text(lap.db.avgHeartRate.toString())),
DataCell(Text(lap.db.avgSpeed.toPace())),
DataCell(Text(lap.db.avgPower.toStringOrDashes(1))),
DataCell(
Text((lap.db.totalDistance / 1000).toStringAsFixed(2)),
),
DataCell(
Text((lap.db.totalAscent - lap.db.totalDescent)
.toString()),
),
],
);
}).toList(),
),
);
} else {
return Center(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment