mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Update tank model with custom tanks used in XML files
Fixes #377 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a375159e6a
commit
90ff8e672b
2 changed files with 11 additions and 1 deletions
11
equipment.c
11
equipment.c
|
@ -13,11 +13,20 @@
|
|||
void add_cylinder_description(cylinder_type_t *type)
|
||||
{
|
||||
const char *desc;
|
||||
int i;
|
||||
|
||||
desc = type->description;
|
||||
if (!desc)
|
||||
return;
|
||||
/* now do something with it... */
|
||||
for (i = 0; i < 100 && tank_info[i].name != NULL; i++) {
|
||||
if (strcmp(tank_info[i].name, desc) == 0)
|
||||
return;
|
||||
}
|
||||
if (i < 100) {
|
||||
tank_info[i].name = desc;
|
||||
tank_info[i].ml = type->size.mliter;
|
||||
tank_info[i].bar = type->workingpressure.mbar / 1000;
|
||||
}
|
||||
}
|
||||
void add_weightsystem_description(weightsystem_t *weightsystem)
|
||||
{
|
||||
|
|
|
@ -75,6 +75,7 @@ MainWindow::MainWindow() : helpView(0)
|
|||
void MainWindow::refreshDisplay(bool recreateDiveList)
|
||||
{
|
||||
ui.InfoWidget->reload();
|
||||
TankInfoModel::instance()->update();
|
||||
ui.ProfileWidget->refresh();
|
||||
ui.globe->reload();
|
||||
if (recreateDiveList)
|
||||
|
|
Loading…
Add table
Reference in a new issue