aboutsummaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt/CylinderObjectHelper.cpp
blob: 341d30b126b369547daaf7b113ce498765323673 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "CylinderObjectHelper.h"
#include "../helpers.h"

static QString EMPTY_CYLINDER_STRING = QStringLiteral("");
CylinderObjectHelper::CylinderObjectHelper(cylinder_t *cylinder) :
	m_cyl(cylinder) {
}

CylinderObjectHelper::~CylinderObjectHelper() {
}

QString CylinderObjectHelper::description() const {
	if (!m_cyl->type.description)
		return QString(EMPTY_CYLINDER_STRING);
	else
		return QString(m_cyl->type.description);
}

QString CylinderObjectHelper::size() const {
	return get_volume_string(m_cyl->type.size, true);
}

QString CylinderObjectHelper::workingPressure() const {
	return get_pressure_string(m_cyl->type.workingpressure, true);
}

QString CylinderObjectHelper::startPressure() const {
	return get_pressure_string(m_cyl->start, true);
}

QString CylinderObjectHelper::endPressure() const {
	return get_pressure_string(m_cyl->end, true);
}

QString CylinderObjectHelper::gasMix() const {
	return get_gas_string(m_cyl->gasmix);
}