- retrieving home dir and create FsTrack folder

- added adjustable KML update interval
- prepared for .kmz

git-svn-id: http://moon:8086/svn/software/trunk/projects/FsTrack@125 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2015-01-11 11:04:51 +00:00
parent 14fc402ff3
commit b138370221
10 changed files with 103 additions and 27 deletions
+23 -6
View File
@@ -62,13 +62,13 @@ void Kml::destroy()
void Kml::update(FlightData const &flightData)
{
const ScopedLock sl (m_lock);
updatePlane(flightData);
updatePath(flightData);
}
void Kml::updatePlane(FlightData const &flightData)
{
const ScopedLock sl (m_lock);
char temp_str[1024];
XmlElement *pDoc = kml->getChildByName("Document");
@@ -241,19 +241,36 @@ void Kml::updatePath(FlightData const &flightData)
}
}
void Kml::export(const char *pPath)
void Kml::exportKml(const char *pPath)
{
const ScopedLock sl (m_lock);
if (pPath && kml)
{
const ScopedLock sl (m_lock);
File file(pPath);
kml->writeToFile(file, StringRef(""));
}
}
void Kml::onUpdate(const char *pPath)
void Kml::exportKmz(const char *pPath)
{
export(pPath);
// ToDo: add Compression if available in Juce
const ScopedLock sl (m_lock);
if (pPath && kml)
{
File file(pPath);
file.deleteFile();
ScopedPointer<OutputStream> pStream = file.createOutputStream();
kml->writeToStream(*pStream, StringRef(""));
pStream = nullptr;
}
}
void Kml::onUpdate(const char *pPath)
{
exportKmz(pPath);
}