diff options
author | glerch <guido.lerch@gmail.com> | 2015-09-10 17:59:03 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-10 12:32:23 -0700 |
commit | 1aa941e754db29bec61523056366db271861de9b (patch) | |
tree | 5ef20749d43747fe155cf369c9593e1af323bff5 /uemis-downloader.c | |
parent | 8e82e14b1ece64e0ecc87e6ff942605d4ed53ce7 (diff) | |
download | subsurface-1aa941e754db29bec61523056366db271861de9b.tar.gz |
Uemis downloader: remove code not needed anymore
Cleaning up track_uemis_divespot because this function is not needed
anymore.
As I am loading the divespots now within do_uemis_import, I also adjusted
the memory calculation - this is not completed yet.
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r-- | uemis-downloader.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c index ca35a0960..f1f17828d 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -59,7 +59,6 @@ static int filenr; static int number_of_files; static char *mbuf = NULL; static int mbuf_size = 0; -static int nr_divespots = -1; static int max_mem_used = -1; static int next_table_index = 0; @@ -685,15 +684,6 @@ static bool parse_divespot(char *buf) return true; } -static void track_divespot(char *val, int diveid, uint32_t dive_site_uuid) -{ - int id = atoi(val); - if (id >= 0 && id > nr_divespots) - nr_divespots = id; - uemis_mark_divelocation(diveid, id, dive_site_uuid); - return; -} - static char *suit[] = {"", QT_TRANSLATE_NOOP("gettextFromC", "wetsuit"), QT_TRANSLATE_NOOP("gettextFromC", "semidry"), QT_TRANSLATE_NOOP("gettextFromC", "drysuit")}; static char *suit_type[] = {"", QT_TRANSLATE_NOOP("gettextFromC", "shorty"), QT_TRANSLATE_NOOP("gettextFromC", "vest"), QT_TRANSLATE_NOOP("gettextFromC", "long john"), QT_TRANSLATE_NOOP("gettextFromC", "jacket"), QT_TRANSLATE_NOOP("gettextFromC", "full suit"), QT_TRANSLATE_NOOP("gettextFromC", "2 pcs full suit")}; static char *suit_thickness[] = {"", "0.5-2mm", "2-3mm", "3-5mm", "5-7mm", "8mm+", QT_TRANSLATE_NOOP("gettextFromC", "membrane")}; @@ -1014,13 +1004,7 @@ static int get_memory(struct dive_table *td) /* predict based on the max_mem_used value if the set of next 11 divelogs plus details * fit into the memory before we have to disconnect the UEMIS and continuem. To be on * the safe side we calculate using 12 dives. */ - if (max_mem_used * 11 > UEMIS_MAX_FILES - filenr) { - /* the next set of divelogs will most likely not fit into the memory */ - if (nr_divespots * 2 > UEMIS_MAX_FILES - filenr) { - /* if we get here we have a severe issue as the divespots will not fit into - * this run either. */ - return UEMIS_MEM_FULL; - } + if (max_mem_used * 10 > UEMIS_MAX_FILES - filenr) { /* we continue reading the divespots */ return UEMIS_MEM_CRITICAL; } |