mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
divesummary: add DiveSummary class to shared and backend
Create DiveSummary class in backend-shared and make the DiveSummary calculation results available to QML. This adds a loop over all dives (could have been done with a model, but the models available to mobile are very limited, so use the basic way). [Dirk Hohndel: renamed the results variable and combined a couple of commits] Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
bb13065a75
commit
6cd46bee06
6 changed files with 222 additions and 1 deletions
28
backend-shared/divesummary.h
Normal file
28
backend-shared/divesummary.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#ifndef DIVESUMMARY_H
|
||||
#define DIVESUMMARY_H
|
||||
#include <QStringList>
|
||||
#include "core/dive.h"
|
||||
|
||||
|
||||
class diveSummary {
|
||||
|
||||
public:
|
||||
static void summaryCalculation(int primaryPeriod, int secondaryPeriod);
|
||||
|
||||
static QStringList diveSummaryText;
|
||||
|
||||
private:
|
||||
diveSummary() {}
|
||||
|
||||
static void loopDives(timestamp_t primaryStart, timestamp_t secondaryStart);
|
||||
static void calculateDive(int inx, struct dive *dive);
|
||||
static void buildStringList(int inx);
|
||||
|
||||
static timestamp_t firstDive, lastDive;
|
||||
static int dives[2], divesEAN[2], divesDeep[2], diveplans[2];
|
||||
static long divetime[2], depth[2], sac[2];
|
||||
static long divetimeMax[2], depthMax[2], sacMin[2];
|
||||
static long divetimeAvg[2], depthAvg[2], sacAvg[2];
|
||||
};
|
||||
#endif // DIVESUMMARY_H
|
Loading…
Add table
Add a link
Reference in a new issue