Closed gvanem closed 2 years ago
Took me a bit to come around and implement it, but I have added your changes and tested them with MSVC and clang-cl.
GetTempFile()
is in utils.hpp, while timegm()
and setenv()
got implemented in the new decoding backend, sondedump.
Thank you for the suggestion and the .diff! Let me know if you have any issues compiling the updated codebase.
Let me know if you have any issues compiling the updated codebase.
I have lots! Very confusing to understand where and how e.g. gpx.c
vs gpx.cpp
are used.
In the SDR++ plugin or the sondedump program? Basically they both do the same AFAICS.
IMHO there should be common library for such functionality. Or just do:
--- a/src/gpx.cpp 2022-01-23 05:33:03
+++ b/src/gpx.cpp 2022-01-25 11:16:37
@@ -4,11 +4,18 @@
#include <ctype.h>
#include "gpx.hpp"
+#ifdef USE_sondedump_lib
+#include "sondedump/io/gpx.h"
+#endif
+
#define GPX_TIME_FORMAT "%Y-%m-%dT%H:%M:%SZ"
bool
GPXWriter::init(const char *fname)
{
+#ifdef USE_sondedump_lib
+ return gpx_init (m_GPXFile, fname);
+#else
if (m_fd) deinit();
m_fd = fopen(fname, "wb");
@@ -24,6 +31,7 @@
m_offset = ftell(m_fd);
terminateFile();
return true;
+#endif
}
GetTempFile() is in utils.h
Another issue ; a getTempFile()
is needed for sondedump.exe
too. Add to utils.c
?
Otherwise it crashes good when NDEBUG
is not defined.
This is a great plugin!
Trying to build on Windows (using clang-cl), gave only 2 problems:
timegm()
is not available. But themy_timegm()
is already in the code.setenv()
andunsetenv()
are also missing on Windows."/tmp/radiosonde*"
files.I patched 2 files to fix it:
Hope you could clean it up.
IMHO most of this should go into
utils.c
. Or better yet, intosdrpp_core.dll
.