subsurface/desktop-widgets/profilewidget.h

55 lines
1.3 KiB
C
Raw Normal View History

// SPDX-License-Identifier: GPL-2.0
// The profile and its toolbars.
#ifndef PROFILEWIDGET_H
#define PROFILEWIDGET_H
#include "ui_profilewidget.h"
#include "core/subsurface-qt/divelistnotifier.h"
#include <vector>
struct dive;
class ProfileWidget2;
class EmptyView;
class QStackedWidget;
class ProfileWidget : public QWidget {
Q_OBJECT
public:
ProfileWidget();
~ProfileWidget();
std::unique_ptr<ProfileWidget2> view;
void plotDive(struct dive *d, int dc); // Attempt to keep DC number id dc < 0
void plotCurrentDive();
void setPlanState(const struct dive *d, int dc);
void setEnabledToolbar(bool enabled);
void nextDC();
void prevDC();
Planner: Improve Gas Handling in CCR Mode. This has become a bit of a catch-all overhaul of a large portion of the planner - I started out wanting to improve the CCR mode, but then as I started pulling all the other threads that needed addressing started to come with it. Improve how the gas selection is handled when planning dives in CCR mode, by making the type (OC / CCR) of segments dependent on the gas use type that was set for the selected gas. Add a preference to allow the user to chose to use OC gases as diluent, in a similar fashion to the original implementation. Hide gases that cannot be used in the currently selected dive mode in all drop downs. Include usage type in gas names if this is needed. Hide columns and disable elements in the 'Dive planner points' table if they can they can not be edited in the curently selected dive mode. Visually identify gases and usage types that are not appropriate for the currently selected dive mode. Move the 'Dive mode' selection to the top of the planner view, to accommodate the fact that this is a property of the dive and not a planner setting. Show a warning instead of the dive plan if the plan contains gases that are not usable in the selected dive mode. Fix the data entry for the setpoint in the 'Dive planner points' table. Fix problems with enabling / disabling planner settings when switching between dive modes. Refactor some names to make them more appropriate for their current usage. One point that is still open is to hide gas usage graphs in the planner profile if the gas isn't used for OC, as there is no way to meaningfully interpolate such usage. Signed-off-by: Michael Keller <github@ike.ch>
2024-05-15 05:23:39 +00:00
void exitEditMode();
dive *d;
int dc;
private
slots:
void divesChanged(const QVector<dive *> &dives, DiveField field);
void cylindersChanged(struct dive *changed, int pos);
void unsetProfHR();
void unsetProfTissues();
void stopAdded();
void stopRemoved(int count);
void stopMoved(int count);
void stopEdited();
private:
std::unique_ptr<EmptyView> emptyView;
std::vector<QAction *> toolbarActions;
Ui::ProfileWidget ui;
QStackedWidget *stack;
void setDive(const struct dive *d, int dcNr);
void editDive();
void rotateDC(int dir);
std::unique_ptr<dive> editedDive;
bool placingCommand;
};
#endif // PROFILEWIDGET_H