aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlinterface.cpp
AgeCommit message (Collapse)Author
2020-02-08mobile/summary: remove dive summary calculationGravatar Berthold Stoeger
Since we now use a model to calculate the dive summary, there is no need to export recalculation of the dive summary via QMLInterface. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-01-31Cleanup: remove QMLInterface::instance()Gravatar Berthold Stoeger
QMLInterface::instance() is only used in one single place. This makes the whole notion of having a global instance of the object moot, isn't it? Simply make the object static to the function that uses it, which guarantees that the object will be created when the function is called. I.e. the same behavior is retained with less complexity. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-01-31Cleanup: connect QMLInterface signals in constructorGravatar Berthold Stoeger
It appears weird to connect the QMLInterface signal/slot combination in a static helper function. This generates a bunch of lambdas that call the instance() function. Instead, simply do the connections in the constructor as we do it in numerous other places. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-01-27divesummary: add DiveSummary class to shared and backendGravatar jan Iversen
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>
2020-01-25diveplanner: add last gas variables to QMLInterfaceGravatar jan Iversen
Add bottompo2, decopo2 and bestmixend to QMLInterface Bestmixend in gas options changing with meter/feet Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25diveplanner: adjust sac-factor calculation.Gravatar jan Iversen
The real values are 1.0 to 10.0, but QML needs int so mobile gets values 10.0 to 100.0 add sacfactor() to QMLInterface and update QML. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25dive planner: correct bottomsac/decosac calc.Gravatar jan Iversen
Move conversion cuft <-> liter from desktop-widget/diveplanner.cpp to plannerShared, to facilitate the same results in mobile diveplanner Use Backend for bottomsac/decosac and update to check for switch LITER <-> CUFT Add bottomsac/decosac to QMLinterface. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25diveplanner: call planner model directly for simple variables.Gravatar jan Iversen
Variables without conversion, do not need to pass plannerShared (due to the QML interface). Simple variables do not pass plannerShared, but diveplanner in desktop-widgets and qmlinterface in mobile-widgets call the implementation directly. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-24mobile-widgets: add simple part of remaining planner variablesGravatar jan Iversen
Add simple variables, where getter uses prefs. and setters call directly to set function (without using plannerShared). rename last_stop --> last_stop6m Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24mobile: move dive planner notes access to pure interfaceGravatar jan Iversen
Make notes rates available to QML through the Backend interface. Remove the corresponding variables from plannerShared. Getters are from prefs. while setters are linked to diveplan model. Remark: signals from qPrefDivePlanner is used, because the diveplanner model sets qPrefDivePlanner but do not issue special signals. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20mobile-widgets: add asc/desc rates to pure interfaceGravatar jan Iversen
Make ascent/descent rates available to QML through the Backend interface. Remark signals from qPrefDivePlanner is used because the diveplanner model sets qPrefDivePlanner but does not issue its own signals. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20mobile-widgets: allow qPrefUnit strongly typed in QMLGravatar jan Iversen
Add qPrefUnit Q_PROPERTY but using QMLInterface enums, that way all variables become strongly typed in QML. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-18mobile-widgets: make cloud_verification_status type proof in QML.Gravatar jan Iversen
Add CLOUD_STATUS enum to interface. Add cloud_verifification_status variable to interface, and make it strongly typed in QML. using backend.cloud_verification_status = 1 will fail but backend.cloud_verification_status = backend.CS_UNKNOWN is correct. Added note to the original definitions of the enums that they have been duplicated. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-18mobile-widgets: add pure interface for passing values to QMLGravatar jan Iversen
Add a header file that contains a duplicate of the enums, that are needed in QML in one class. the unit enums are added imidiatly, since they are needed or will be neede shortly in Settings and DivePlannerSettings This class will also contain Q_PROPERTY and signal/slot for variables used in QML. This is done to allow e.g. deco_mode qPrefUnits::planner_deco_mode() void qPrefUnits::set_planner_deco_mode(deco_mode) as strongly typed in C++ and DECO_MODE planner_deco_mode() void set_planner_deco_mode(DECO_MODE) as strongly typed in QML Remark: wrong assignments gives errors in QML The advantage over using strings or the value directly is that QML detects typos and flags them as errors/warnings. It is important to note that the class may only contain a) a function call to the implementation b) a reference to a global variable e.g. prefs. Added note to the original definitions of the enums that they have been duplicated. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>