- reorganized Kml generation
- Kml generation on demand - cleaned up GUI - removed color selector - remove track rate slider - adjusted altitude slider git-svn-id: http://moon:8086/svn/software/trunk/projects/FsTrack@175 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -33,36 +33,22 @@
|
|||||||
isDebug="0" optimisation="2" targetName="FsTrack" headerPath="../../../../../extLib/FSUIPC"/>
|
isDebug="0" optimisation="2" targetName="FsTrack" headerPath="../../../../../extLib/FSUIPC"/>
|
||||||
</CONFIGURATIONS>
|
</CONFIGURATIONS>
|
||||||
<MODULEPATHS>
|
<MODULEPATHS>
|
||||||
<MODULEPATH id="juce_video" path="../../../extLib/JUCE/modules"/>
|
|
||||||
<MODULEPATH id="juce_opengl" path="../../../extLib/JUCE/modules"/>
|
|
||||||
<MODULEPATH id="juce_gui_extra" path="../../../extLib/JUCE/modules"/>
|
<MODULEPATH id="juce_gui_extra" path="../../../extLib/JUCE/modules"/>
|
||||||
<MODULEPATH id="juce_gui_basics" path="../../../extLib/JUCE/modules"/>
|
<MODULEPATH id="juce_gui_basics" path="../../../extLib/JUCE/modules"/>
|
||||||
<MODULEPATH id="juce_graphics" path="../../../extLib/JUCE/modules"/>
|
<MODULEPATH id="juce_graphics" path="../../../extLib/JUCE/modules"/>
|
||||||
<MODULEPATH id="juce_events" path="../../../extLib/JUCE/modules"/>
|
<MODULEPATH id="juce_events" path="../../../extLib/JUCE/modules"/>
|
||||||
<MODULEPATH id="juce_data_structures" path="../../../extLib/JUCE/modules"/>
|
<MODULEPATH id="juce_data_structures" path="../../../extLib/JUCE/modules"/>
|
||||||
<MODULEPATH id="juce_cryptography" path="../../../extLib/JUCE/modules"/>
|
|
||||||
<MODULEPATH id="juce_core" path="../../../extLib/JUCE/modules"/>
|
<MODULEPATH id="juce_core" path="../../../extLib/JUCE/modules"/>
|
||||||
<MODULEPATH id="juce_audio_processors" path="../../../extLib/JUCE/modules"/>
|
|
||||||
<MODULEPATH id="juce_audio_formats" path="../../../extLib/JUCE/modules"/>
|
|
||||||
<MODULEPATH id="juce_audio_devices" path="../../../extLib/JUCE/modules"/>
|
|
||||||
<MODULEPATH id="juce_audio_basics" path="../../../extLib/JUCE/modules"/>
|
|
||||||
</MODULEPATHS>
|
</MODULEPATHS>
|
||||||
</VS2012>
|
</VS2012>
|
||||||
</EXPORTFORMATS>
|
</EXPORTFORMATS>
|
||||||
<MODULES>
|
<MODULES>
|
||||||
<MODULES id="juce_audio_basics" showAllCode="1" useLocalCopy="1"/>
|
|
||||||
<MODULES id="juce_audio_devices" showAllCode="1" useLocalCopy="1"/>
|
|
||||||
<MODULES id="juce_audio_formats" showAllCode="1" useLocalCopy="1"/>
|
|
||||||
<MODULES id="juce_audio_processors" showAllCode="1" useLocalCopy="1"/>
|
|
||||||
<MODULES id="juce_core" showAllCode="1" useLocalCopy="1"/>
|
<MODULES id="juce_core" showAllCode="1" useLocalCopy="1"/>
|
||||||
<MODULES id="juce_cryptography" showAllCode="1" useLocalCopy="1"/>
|
|
||||||
<MODULES id="juce_data_structures" showAllCode="1" useLocalCopy="1"/>
|
<MODULES id="juce_data_structures" showAllCode="1" useLocalCopy="1"/>
|
||||||
<MODULES id="juce_events" showAllCode="1" useLocalCopy="1"/>
|
<MODULES id="juce_events" showAllCode="1" useLocalCopy="1"/>
|
||||||
<MODULES id="juce_graphics" showAllCode="1" useLocalCopy="1"/>
|
<MODULES id="juce_graphics" showAllCode="1" useLocalCopy="1"/>
|
||||||
<MODULES id="juce_gui_basics" showAllCode="1" useLocalCopy="1"/>
|
<MODULES id="juce_gui_basics" showAllCode="1" useLocalCopy="1"/>
|
||||||
<MODULES id="juce_gui_extra" showAllCode="1" useLocalCopy="1"/>
|
<MODULES id="juce_gui_extra" showAllCode="1" useLocalCopy="1"/>
|
||||||
<MODULES id="juce_opengl" showAllCode="1" useLocalCopy="1"/>
|
|
||||||
<MODULES id="juce_video" showAllCode="1" useLocalCopy="1"/>
|
|
||||||
</MODULES>
|
</MODULES>
|
||||||
<JUCEOPTIONS/>
|
<JUCEOPTIONS/>
|
||||||
</JUCERPROJECT>
|
</JUCERPROJECT>
|
||||||
|
|||||||
@@ -0,0 +1,128 @@
|
|||||||
|
#
|
||||||
|
# There exist several targets which are by default empty and which can be
|
||||||
|
# used for execution of your targets. These targets are usually executed
|
||||||
|
# before and after some main targets. They are:
|
||||||
|
#
|
||||||
|
# .build-pre: called before 'build' target
|
||||||
|
# .build-post: called after 'build' target
|
||||||
|
# .clean-pre: called before 'clean' target
|
||||||
|
# .clean-post: called after 'clean' target
|
||||||
|
# .clobber-pre: called before 'clobber' target
|
||||||
|
# .clobber-post: called after 'clobber' target
|
||||||
|
# .all-pre: called before 'all' target
|
||||||
|
# .all-post: called after 'all' target
|
||||||
|
# .help-pre: called before 'help' target
|
||||||
|
# .help-post: called after 'help' target
|
||||||
|
#
|
||||||
|
# Targets beginning with '.' are not intended to be called on their own.
|
||||||
|
#
|
||||||
|
# Main targets can be executed directly, and they are:
|
||||||
|
#
|
||||||
|
# build build a specific configuration
|
||||||
|
# clean remove built files from a configuration
|
||||||
|
# clobber remove all built files
|
||||||
|
# all build all configurations
|
||||||
|
# help print help mesage
|
||||||
|
#
|
||||||
|
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
|
||||||
|
# .help-impl are implemented in nbproject/makefile-impl.mk.
|
||||||
|
#
|
||||||
|
# Available make variables:
|
||||||
|
#
|
||||||
|
# CND_BASEDIR base directory for relative paths
|
||||||
|
# CND_DISTDIR default top distribution directory (build artifacts)
|
||||||
|
# CND_BUILDDIR default top build directory (object files, ...)
|
||||||
|
# CONF name of current configuration
|
||||||
|
# CND_PLATFORM_${CONF} platform name (current configuration)
|
||||||
|
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
|
||||||
|
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
|
||||||
|
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
|
||||||
|
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
|
||||||
|
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
|
||||||
|
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
|
||||||
|
#
|
||||||
|
# NOCDDL
|
||||||
|
|
||||||
|
|
||||||
|
# Environment
|
||||||
|
MKDIR=mkdir
|
||||||
|
CP=cp
|
||||||
|
CCADMIN=CCadmin
|
||||||
|
|
||||||
|
|
||||||
|
# build
|
||||||
|
build: .build-post
|
||||||
|
|
||||||
|
.build-pre:
|
||||||
|
# Add your pre 'build' code here...
|
||||||
|
|
||||||
|
.build-post: .build-impl
|
||||||
|
# Add your post 'build' code here...
|
||||||
|
|
||||||
|
|
||||||
|
# clean
|
||||||
|
clean: .clean-post
|
||||||
|
|
||||||
|
.clean-pre:
|
||||||
|
# Add your pre 'clean' code here...
|
||||||
|
|
||||||
|
.clean-post: .clean-impl
|
||||||
|
# Add your post 'clean' code here...
|
||||||
|
|
||||||
|
|
||||||
|
# clobber
|
||||||
|
clobber: .clobber-post
|
||||||
|
|
||||||
|
.clobber-pre:
|
||||||
|
# Add your pre 'clobber' code here...
|
||||||
|
|
||||||
|
.clobber-post: .clobber-impl
|
||||||
|
# Add your post 'clobber' code here...
|
||||||
|
|
||||||
|
|
||||||
|
# all
|
||||||
|
all: .all-post
|
||||||
|
|
||||||
|
.all-pre:
|
||||||
|
# Add your pre 'all' code here...
|
||||||
|
|
||||||
|
.all-post: .all-impl
|
||||||
|
# Add your post 'all' code here...
|
||||||
|
|
||||||
|
|
||||||
|
# build tests
|
||||||
|
build-tests: .build-tests-post
|
||||||
|
|
||||||
|
.build-tests-pre:
|
||||||
|
# Add your pre 'build-tests' code here...
|
||||||
|
|
||||||
|
.build-tests-post: .build-tests-impl
|
||||||
|
# Add your post 'build-tests' code here...
|
||||||
|
|
||||||
|
|
||||||
|
# run tests
|
||||||
|
test: .test-post
|
||||||
|
|
||||||
|
.test-pre: build-tests
|
||||||
|
# Add your pre 'test' code here...
|
||||||
|
|
||||||
|
.test-post: .test-impl
|
||||||
|
# Add your post 'test' code here...
|
||||||
|
|
||||||
|
|
||||||
|
# help
|
||||||
|
help: .help-post
|
||||||
|
|
||||||
|
.help-pre:
|
||||||
|
# Add your pre 'help' code here...
|
||||||
|
|
||||||
|
.help-post: .help-impl
|
||||||
|
# Add your post 'help' code here...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# include project implementation makefile
|
||||||
|
include nbproject/Makefile-impl.mk
|
||||||
|
|
||||||
|
# include project make variables
|
||||||
|
include nbproject/Makefile-variables.mk
|
||||||
|
|||||||
+4
-2
@@ -207,6 +207,7 @@ void FsLink::timerCallback()
|
|||||||
case ls_connected:
|
case ls_connected:
|
||||||
if (!m_flightData.isFsDialog && m_flightData.isFsReady)
|
if (!m_flightData.isFsDialog && m_flightData.isFsReady)
|
||||||
{
|
{
|
||||||
|
m_pKml->updateFlightData(m_flightData);
|
||||||
if (m_pKml)
|
if (m_pKml)
|
||||||
{
|
{
|
||||||
m_pKml->create();
|
m_pKml->create();
|
||||||
@@ -309,14 +310,15 @@ void FsLink::timerCallback()
|
|||||||
{
|
{
|
||||||
m_listeners.call(&IFsLinkListener::onDataChanged, *this);
|
m_listeners.call(&IFsLinkListener::onDataChanged, *this);
|
||||||
|
|
||||||
m_pKml->updatePlane(m_flightData);
|
m_pKml->updateFlightData(m_flightData);
|
||||||
|
// m_pKml->updatePlane(m_flightData);
|
||||||
if (m_kmlUpdateCount > 0)
|
if (m_kmlUpdateCount > 0)
|
||||||
{
|
{
|
||||||
m_kmlUpdateCount--;
|
m_kmlUpdateCount--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_pKml->updatePath(m_flightData);
|
m_pKml->updateTrack();
|
||||||
m_pKml->exportKml(m_pKml->getPath());
|
m_pKml->exportKml(m_pKml->getPath());
|
||||||
m_kmlUpdateCount = m_kmlUpdateInterval;
|
m_kmlUpdateCount = m_kmlUpdateInterval;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
struct FlightData
|
struct FlightData
|
||||||
{
|
{
|
||||||
|
FlightData() {}
|
||||||
|
~FlightData() {}
|
||||||
bool isFsReady, isFsDialog, isPaused, isParked, isOnGround, isReplay;
|
bool isFsReady, isFsDialog, isPaused, isParked, isOnGround, isReplay;
|
||||||
unsigned long timeZulu;
|
unsigned long timeZulu;
|
||||||
double lat, lon, alt_meter, alt_feet, gl_meter, bank_deg, pitch_deg, hdgTrue_deg, hdgMag_deg, gs_meterPerSec, gs_knots, tas_knots, ias_knots, bpa_knots, vs_feetPerMin, magVar_deg;
|
double lat, lon, alt_meter, alt_feet, gl_meter, bank_deg, pitch_deg, hdgTrue_deg, hdgMag_deg, gs_meterPerSec, gs_knots, tas_knots, ias_knots, bpa_knots, vs_feetPerMin, magVar_deg;
|
||||||
@@ -23,6 +25,43 @@ struct FlightData
|
|||||||
char atcAirlineStr[24];
|
char atcAirlineStr[24];
|
||||||
char atcAircraftTypeStr[24];
|
char atcAircraftTypeStr[24];
|
||||||
|
|
||||||
|
const FlightData& operator=(const FlightData &rhs)
|
||||||
|
{
|
||||||
|
isFsReady = rhs.isFsReady;
|
||||||
|
isFsDialog = rhs.isFsDialog;
|
||||||
|
isPaused = rhs.isPaused;
|
||||||
|
isParked = rhs.isParked;
|
||||||
|
isOnGround = rhs.isOnGround;
|
||||||
|
isReplay = rhs.isReplay;
|
||||||
|
lat = rhs.lat;
|
||||||
|
lon = rhs.lon;
|
||||||
|
alt_meter = rhs.alt_meter;
|
||||||
|
alt_feet = rhs.alt_feet;
|
||||||
|
gl_meter = rhs.gl_meter;
|
||||||
|
bank_deg = rhs.bank_deg;
|
||||||
|
pitch_deg = rhs.pitch_deg;
|
||||||
|
hdgTrue_deg = rhs.hdgTrue_deg;
|
||||||
|
hdgMag_deg = rhs.hdgMag_deg;
|
||||||
|
gs_meterPerSec = rhs.gs_meterPerSec;
|
||||||
|
gs_knots = rhs.gs_knots;
|
||||||
|
tas_knots = rhs.tas_knots;
|
||||||
|
ias_knots = rhs.ias_knots;
|
||||||
|
bpa_knots = rhs.bpa_knots;
|
||||||
|
vs_feetPerMin = rhs.vs_feetPerMin;
|
||||||
|
magVar_deg = rhs.magVar_deg;
|
||||||
|
framerate = rhs.framerate;
|
||||||
|
|
||||||
|
memcpy(aircraftTitle, rhs.aircraftTitle, sizeof(aircraftTitle));
|
||||||
|
memcpy(tcasStr, rhs.tcasStr, sizeof(tcasStr));
|
||||||
|
memcpy(tcasStr2, rhs.tcasStr2, sizeof(tcasStr2));
|
||||||
|
memcpy(flightname, rhs.flightname, sizeof(flightname));
|
||||||
|
memcpy(atcFlightNumStr, rhs.atcFlightNumStr, sizeof(atcFlightNumStr));
|
||||||
|
memcpy(atcFlightIDStr, rhs.atcFlightIDStr, sizeof(atcFlightIDStr));
|
||||||
|
memcpy(atcAirlineStr, rhs.atcAirlineStr, sizeof(atcAirlineStr));
|
||||||
|
memcpy(atcAircraftTypeStr, rhs.atcAircraftTypeStr, sizeof(atcAircraftTypeStr));
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IFsLink
|
struct IFsLink
|
||||||
|
|||||||
+3
-3
@@ -18,9 +18,9 @@ struct IKml
|
|||||||
virtual void create() = 0;
|
virtual void create() = 0;
|
||||||
virtual void destroy() = 0;
|
virtual void destroy() = 0;
|
||||||
virtual const char* getPath() = 0;
|
virtual const char* getPath() = 0;
|
||||||
|
|
||||||
virtual void updatePlane(FlightData const &flightData) = 0;
|
virtual void updateFlightData(FlightData const &flightData) = 0;
|
||||||
virtual void updatePath(FlightData const &flightData) = 0;
|
virtual void updateTrack() = 0;
|
||||||
virtual void exportKml(const char *pPath) = 0;
|
virtual void exportKml(const char *pPath) = 0;
|
||||||
virtual void exportKmz(const char *pPath) = 0;
|
virtual void exportKmz(const char *pPath) = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
+295
-318
@@ -7,9 +7,9 @@
|
|||||||
//#define WITH_FANCY_CAMERA
|
//#define WITH_FANCY_CAMERA
|
||||||
|
|
||||||
Kml::Kml(const char *pDocRoot)
|
Kml::Kml(const char *pDocRoot)
|
||||||
: kml(nullptr)
|
: m_pKml(nullptr)
|
||||||
, m_pPlanePlaceMark(nullptr)
|
, m_pPlanePlaceMark(nullptr)
|
||||||
, m_pPathPlaceMark(nullptr)
|
, m_pTrackPlaceMark(nullptr)
|
||||||
, m_pCameraPlaceMark(nullptr)
|
, m_pCameraPlaceMark(nullptr)
|
||||||
, m_docRoot(pDocRoot)
|
, m_docRoot(pDocRoot)
|
||||||
, m_altitudeModeString("absolute")
|
, m_altitudeModeString("absolute")
|
||||||
@@ -18,6 +18,7 @@ Kml::Kml(const char *pDocRoot)
|
|||||||
, m_cameraTilt(0)
|
, m_cameraTilt(0)
|
||||||
, m_cameraAutoHeading(false)
|
, m_cameraAutoHeading(false)
|
||||||
, m_cameraAutoRoll(false)
|
, m_cameraAutoRoll(false)
|
||||||
|
, m_cameraFlyToView(false)
|
||||||
{
|
{
|
||||||
memset(m_path, 0, sizeof(m_path));
|
memset(m_path, 0, sizeof(m_path));
|
||||||
}
|
}
|
||||||
@@ -25,7 +26,55 @@ Kml::Kml(const char *pDocRoot)
|
|||||||
|
|
||||||
Kml::~Kml(void)
|
Kml::~Kml(void)
|
||||||
{
|
{
|
||||||
kml = nullptr;
|
m_pKml = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kml::updateFlightData(FlightData const &flightData)
|
||||||
|
{
|
||||||
|
const ScopedLock sl (m_lock);
|
||||||
|
m_flightData = flightData;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kml::createNetworkLinkFile(String const &path, String const &hostIp)
|
||||||
|
{
|
||||||
|
File file(path);
|
||||||
|
|
||||||
|
if (file.exists())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ScopedPointer<XmlElement> pKml = new XmlElement("kml");
|
||||||
|
pKml->setAttribute("xmlns", "http://www.opengis.net/kml/2.2");
|
||||||
|
|
||||||
|
XmlElement *pDoc = pKml->createNewChildElement("Document");
|
||||||
|
pDoc->createNewChildElement("visibility")->addTextElement("1");
|
||||||
|
|
||||||
|
XmlElement *pNetworkLink = pDoc->createNewChildElement("NetworkLink");
|
||||||
|
pNetworkLink->setAttribute("id", "NetworkLink_0");
|
||||||
|
pNetworkLink->createNewChildElement("name")->addTextElement("Link");
|
||||||
|
|
||||||
|
|
||||||
|
XmlElement *pFlyToView = pNetworkLink->createNewChildElement("flyToView");
|
||||||
|
if (m_cameraFlyToView)
|
||||||
|
{
|
||||||
|
pFlyToView->addTextElement("1");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pFlyToView->addTextElement("0");
|
||||||
|
}
|
||||||
|
|
||||||
|
XmlElement *pLink = pNetworkLink->createNewChildElement("Link");
|
||||||
|
pLink->createNewChildElement("href")->addTextElement(String("http://") + hostIp + String(":5001/flight.kml"));
|
||||||
|
pLink->createNewChildElement("refreshMode")->addTextElement("onInterval");
|
||||||
|
pLink->createNewChildElement("refreshInterval")->addTextElement("1");
|
||||||
|
pLink->createNewChildElement("viewRefreshMode")->addTextElement("onStop");
|
||||||
|
pLink->createNewChildElement("viewRefreshInterval")->addTextElement("0");
|
||||||
|
pLink->createNewChildElement("viewFormat")->addTextElement("BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth];CAMERA=[lookatLon],[lookatLat],[lookatRange],[lookatTilt],[lookatHeading];VIEW=[horizFov],[vertFov],[horizPixels],[vertPixels],[terrainEnabled]");
|
||||||
|
|
||||||
|
pKml->writeToFile(file, StringRef(""));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* Kml::getPath()
|
const char* Kml::getPath()
|
||||||
@@ -38,114 +87,37 @@ void Kml::create()
|
|||||||
time_t time_departure;
|
time_t time_departure;
|
||||||
struct tm *time_now;
|
struct tm *time_now;
|
||||||
|
|
||||||
if (kml)
|
if (m_pKml)
|
||||||
destroy();
|
destroy();
|
||||||
|
|
||||||
kml = new XmlElement("kml");
|
m_pKml = new XmlElement("kml");
|
||||||
XmlElement *pNetworkLinkControl = kml->createNewChildElement("NetworkLinkControl");
|
XmlElement *pDoc = m_pKml->createNewChildElement("Document");
|
||||||
pNetworkLinkControl->createNewChildElement("LinkName")->addTextElement("FsTrack");
|
|
||||||
XmlElement *pDoc = kml->createNewChildElement("Document");
|
|
||||||
XmlElement *pFile = kml->getChildByName("Document")->createNewChildElement("filename");
|
|
||||||
XmlElement *pSnippet = kml->getChildByName("Document")->createNewChildElement("Snippet");
|
|
||||||
|
|
||||||
time(&time_departure);
|
time(&time_departure);
|
||||||
time_now = localtime(&time_departure);
|
time_now = localtime(&time_departure);
|
||||||
char time_str[256];
|
char time_str[256];
|
||||||
|
|
||||||
// Create an outer XML element..
|
// Create an outer XML element..
|
||||||
kml->setAttribute("xmlns", "http://www.opengis.net/kml/2.2");
|
m_pKml->setAttribute("xmlns", "http://www.opengis.net/kml/2.2");
|
||||||
kml->setAttribute("xmlns:gx", "http://www.google.com/kml/ext/2.2");
|
m_pKml->setAttribute("xmlns:gx", "http://www.google.com/kml/ext/2.2");
|
||||||
sprintf(m_path, "%s\\flight_%4.4d%2.2d%2.2d_%2.2d%2.2d%2.2d.kml", m_docRoot, 1900+time_now->tm_year, time_now->tm_mon+1, time_now->tm_mday, time_now->tm_hour, time_now->tm_min, time_now->tm_sec);
|
sprintf(m_path, "%s\\flight_%4.4d%2.2d%2.2d_%2.2d%2.2d%2.2d.kml", m_docRoot, 1900+time_now->tm_year, time_now->tm_mon+1, time_now->tm_mday, time_now->tm_hour, time_now->tm_min, time_now->tm_sec);
|
||||||
pFile->addTextElement(m_path);
|
pDoc->createNewChildElement("filename")->addTextElement(m_path);
|
||||||
pSnippet->setAttribute("maxLines", "2");
|
|
||||||
|
|
||||||
sprintf(time_str, "Created on %4.4d-%2.2d-%2.2d at %2.2d:%2.2d:%2.2d", 1900+time_now->tm_year, time_now->tm_mon+1, time_now->tm_mday, time_now->tm_hour, time_now->tm_min, time_now->tm_sec);
|
sprintf(time_str, "Created on %4.4d-%2.2d-%2.2d at %2.2d:%2.2d:%2.2d", 1900+time_now->tm_year, time_now->tm_mon+1, time_now->tm_mday, time_now->tm_hour, time_now->tm_min, time_now->tm_sec);
|
||||||
|
XmlElement *pSnippet = pDoc->createNewChildElement("Snippet");
|
||||||
|
pSnippet->setAttribute("maxLines", "2");
|
||||||
pSnippet->addTextElement(time_str);
|
pSnippet->addTextElement(time_str);
|
||||||
|
|
||||||
// Camera
|
m_pTrackPlaceMark = createTrack();
|
||||||
XmlElement *pCamera = pNetworkLinkControl->createNewChildElement("Camera");
|
|
||||||
pCamera->createNewChildElement("longitude")->addTextElement("0");
|
|
||||||
pCamera->createNewChildElement("latitude")->addTextElement("0");
|
|
||||||
pCamera->createNewChildElement("altitude")->addTextElement("0");
|
|
||||||
pCamera->createNewChildElement("heading")->addTextElement("0");
|
|
||||||
pCamera->createNewChildElement("tilt")->addTextElement("0");
|
|
||||||
pCamera->createNewChildElement("roll")->addTextElement("0");
|
|
||||||
pCamera->createNewChildElement("altitudeMode")->addTextElement(m_altitudeModeString);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kml::destroy()
|
XmlElement* Kml::createPlane()
|
||||||
{
|
|
||||||
kml = nullptr;
|
|
||||||
m_pPlanePlaceMark = nullptr;
|
|
||||||
m_pPathPlaceMark = nullptr;
|
|
||||||
m_pCameraPlaceMark = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Kml::setAltitudeMode(String const &modeString)
|
|
||||||
{
|
|
||||||
m_altitudeModeString = modeString;
|
|
||||||
|
|
||||||
if (m_pPlanePlaceMark)
|
|
||||||
{
|
|
||||||
m_pPlanePlaceMark->getChildByName("Point")->getChildByName("altitudeMode")->getFirstChildElement()->setText(modeString);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_pPathPlaceMark)
|
|
||||||
{
|
|
||||||
m_pPathPlaceMark->getChildByName("LineString")->getChildByName("altitudeMode")->getFirstChildElement()->setText(modeString);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Kml::setPathColor(String const &colorString)
|
|
||||||
{
|
{
|
||||||
const ScopedLock sl (m_lock);
|
const ScopedLock sl (m_lock);
|
||||||
|
|
||||||
m_pathColorString = colorString;
|
|
||||||
|
|
||||||
if (m_pPathPlaceMark)
|
|
||||||
{
|
|
||||||
m_pPathPlaceMark->getChildByName("Style")->getChildByName("LineStyle")->getChildByName("color")->getFirstChildElement()->setText(colorString);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Kml::setCameraAltitude(float alt_meters)
|
|
||||||
{
|
|
||||||
m_cameraAlt = alt_meters;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Kml::setCameraTilt(float tilt_deg)
|
|
||||||
{
|
|
||||||
m_cameraTilt = tilt_deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Kml::update(FlightData const &flightData)
|
|
||||||
{
|
|
||||||
updatePlane(flightData);
|
|
||||||
updatePath(flightData);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Kml::setCameraAutoHeading(bool enable)
|
|
||||||
{
|
|
||||||
m_cameraAutoHeading = enable;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Kml::setCameraAutoRoll(bool enable)
|
|
||||||
{
|
|
||||||
m_cameraAutoRoll = enable;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Kml::updatePlane(FlightData const &flightData)
|
|
||||||
{
|
|
||||||
const ScopedLock sl (m_lock);
|
|
||||||
|
|
||||||
char temp_str[1024];
|
char temp_str[1024];
|
||||||
|
|
||||||
XmlElement *pDoc = kml->getChildByName("Document");
|
XmlElement *pPlacemark;
|
||||||
|
|
||||||
XmlElement *pPlacemark = m_pPlanePlaceMark;
|
|
||||||
XmlElement *pName;
|
XmlElement *pName;
|
||||||
XmlElement *pStyle;
|
XmlElement *pStyle;
|
||||||
XmlElement *pIconStyle;
|
XmlElement *pIconStyle;
|
||||||
@@ -161,192 +133,181 @@ void Kml::updatePlane(FlightData const &flightData)
|
|||||||
XmlElement *pAltitudeMode;
|
XmlElement *pAltitudeMode;
|
||||||
XmlElement *pCoords;
|
XmlElement *pCoords;
|
||||||
|
|
||||||
XmlElement *pCamera;
|
// Placemark
|
||||||
|
pPlacemark = new XmlElement("Placemark");
|
||||||
|
pPlacemark->setAttribute("id", "Plane_0");
|
||||||
|
|
||||||
if(pPlacemark == nullptr)
|
// Name
|
||||||
|
sprintf(temp_str, "Unknown flight");
|
||||||
|
if (strlen(m_flightData.atcFlightIDStr))
|
||||||
{
|
{
|
||||||
// Placemark
|
if (strlen(m_flightData.atcFlightNumStr) == 0)
|
||||||
pPlacemark = pDoc->createNewChildElement("Placemark");
|
|
||||||
|
|
||||||
// Name
|
|
||||||
sprintf(temp_str, "Unknown flight");
|
|
||||||
if (strlen(flightData.atcFlightIDStr))
|
|
||||||
{
|
{
|
||||||
if (strlen(flightData.atcFlightNumStr) == 0)
|
sprintf(temp_str, "%s", m_flightData.atcFlightIDStr);
|
||||||
{
|
|
||||||
sprintf(temp_str, "%s", flightData.atcFlightIDStr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sprintf(temp_str, "%s/%s", flightData.atcFlightIDStr, flightData.atcFlightNumStr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
pName = pPlacemark->createNewChildElement("name");
|
|
||||||
pName->addTextElement(temp_str);
|
|
||||||
printf("%s\n", temp_str);
|
|
||||||
|
|
||||||
// Description
|
|
||||||
pDescr = pPlacemark->createNewChildElement("description");
|
|
||||||
sprintf(temp_str, "%s\nAltitude: %d ft, Speed: %d kts", flightData.atcFlightIDStr, (int)(flightData.alt_feet+0.5), (int)(flightData.gs_knots+0.5));
|
|
||||||
pDescr->addTextElement(temp_str);
|
|
||||||
|
|
||||||
// Style
|
|
||||||
pStyle = pPlacemark->createNewChildElement("Style");
|
|
||||||
|
|
||||||
// IconStyle
|
|
||||||
pIconStyle = pStyle->createNewChildElement("IconStyle");
|
|
||||||
pHeading = pIconStyle->createNewChildElement("heading");
|
|
||||||
pHeading->addTextElement(String(flightData.hdgTrue_deg));
|
|
||||||
|
|
||||||
// Icon
|
|
||||||
pIcon = pIconStyle->createNewChildElement("Icon");
|
|
||||||
pHref = pIcon->createNewChildElement("href");
|
|
||||||
pHref->addTextElement("root://icons/palette-2.png");
|
|
||||||
pY = pIcon->createNewChildElement("y");
|
|
||||||
pY->addTextElement("0");
|
|
||||||
pW = pIcon->createNewChildElement("w");
|
|
||||||
pW->addTextElement("32");
|
|
||||||
pH = pIcon->createNewChildElement("h");
|
|
||||||
pH->addTextElement("32");
|
|
||||||
|
|
||||||
// Point
|
|
||||||
pPoint = pPlacemark->createNewChildElement("Point");
|
|
||||||
pPoint->setAttribute("id", "Pointy");
|
|
||||||
pExtrude = pPoint->createNewChildElement("extrude");
|
|
||||||
pExtrude->addTextElement("1");
|
|
||||||
pTesselate = pPoint->createNewChildElement("tesselate");
|
|
||||||
pTesselate->addTextElement("1");
|
|
||||||
pAltitudeMode = pPoint->createNewChildElement("altitudeMode");
|
|
||||||
pAltitudeMode->addTextElement(m_altitudeModeString);
|
|
||||||
pCoords = pPoint->createNewChildElement("coordinates");
|
|
||||||
sprintf(temp_str, "%9.6f,%9.6f,%9.6f", flightData.lon, flightData.lat, flightData.alt_meter);
|
|
||||||
pCoords->addTextElement(temp_str);
|
|
||||||
|
|
||||||
m_pPlanePlaceMark = pPlacemark;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Description
|
|
||||||
sprintf(temp_str, "%s\nAltitude: %d ft, Speed: %d kts", flightData.atcFlightIDStr, (int)(flightData.alt_feet+0.5), (int)(flightData.gs_knots+0.5));
|
|
||||||
pDescr = pPlacemark->getChildByName("description");
|
|
||||||
pDescr->getFirstChildElement()->setText(temp_str);
|
|
||||||
|
|
||||||
// Heading
|
|
||||||
pHeading = pPlacemark->getChildByName("Style")->getChildByName("IconStyle")->getChildByName("heading");
|
|
||||||
pHeading->getFirstChildElement()->setText(String(flightData.hdgTrue_deg));
|
|
||||||
|
|
||||||
// Coordinates
|
|
||||||
sprintf(temp_str, "%9.6f,%9.6f,%9.6f", flightData.lon, flightData.lat, flightData.alt_meter);
|
|
||||||
pCoords = pPlacemark->getChildByName("Point")->getChildByName("coordinates");
|
|
||||||
pCoords->getFirstChildElement()->setText(temp_str);
|
|
||||||
|
|
||||||
pCamera = kml->getChildByName("NetworkLinkControl")->getChildByName("Camera");
|
|
||||||
|
|
||||||
pCamera->getChildByName("longitude")->getFirstChildElement()->setText(String(flightData.lon));
|
|
||||||
pCamera->getChildByName("latitude")->getFirstChildElement()->setText(String(flightData.lat));
|
|
||||||
pCamera->getChildByName("altitude")->getFirstChildElement()->setText(String(flightData.alt_meter+m_cameraAlt));
|
|
||||||
|
|
||||||
if (m_cameraAutoHeading)
|
|
||||||
pCamera->getChildByName("heading")->getFirstChildElement()->setText(String(flightData.hdgTrue_deg));
|
|
||||||
else
|
else
|
||||||
pCamera->getChildByName("heading")->getFirstChildElement()->setText("0");
|
|
||||||
|
|
||||||
pCamera->getChildByName("tilt")->getFirstChildElement()->setText(String(m_cameraTilt));
|
|
||||||
|
|
||||||
if (m_cameraAutoRoll)
|
|
||||||
pCamera->getChildByName("roll")->getFirstChildElement()->setText(String(flightData.bank_deg));
|
|
||||||
else
|
|
||||||
pCamera->getChildByName("roll")->getFirstChildElement()->setText("0");
|
|
||||||
|
|
||||||
pCamera->getChildByName("altitudeMode")->getFirstChildElement()->setText(m_altitudeModeString);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef WITH_FANCY_CAMERA
|
|
||||||
if (m_pCameraPlaceMark == nullptr)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Placemark
|
|
||||||
m_pCameraPlaceMark = pDoc->createNewChildElement("Placemark");
|
|
||||||
m_pCameraPlaceMark->setAttribute("id", "Cam");
|
|
||||||
m_pCameraPlaceMark->createNewChildElement("name")->addTextElement("Camera");
|
|
||||||
pPoint = m_pCameraPlaceMark->createNewChildElement("Point");
|
|
||||||
pPoint->setAttribute("id", "CamPoint");
|
|
||||||
sprintf(temp_str, "%9.6f,%9.6f,%9.6f", flightData.lon, flightData.lat, flightData.alt_meter);
|
|
||||||
pPoint->createNewChildElement("coordinates")->addTextElement(temp_str);
|
|
||||||
pPoint->createNewChildElement("altitudeMode")->addTextElement(m_altitudeModeString);
|
|
||||||
|
|
||||||
// Name
|
|
||||||
pName = m_pCameraPlaceMark->createNewChildElement("name");
|
|
||||||
pName->addTextElement("Loxo");
|
|
||||||
|
|
||||||
// Style
|
|
||||||
pStyle = m_pCameraPlaceMark->createNewChildElement("Style");
|
|
||||||
|
|
||||||
// LineStyle
|
|
||||||
XmlElement *pLineStyle = pStyle->createNewChildElement("LineStyle");
|
|
||||||
XmlElement *pLineColor = pLineStyle->createNewChildElement("color");
|
|
||||||
pLineColor->addTextElement("0xff0000ff");
|
|
||||||
|
|
||||||
XmlElement *pLineWidth = pLineStyle->createNewChildElement("width");
|
|
||||||
pLineWidth->addTextElement("1");
|
|
||||||
|
|
||||||
// LineString
|
|
||||||
XmlElement *pLineString = m_pCameraPlaceMark->createNewChildElement("LineString");
|
|
||||||
pExtrude = pLineString->createNewChildElement("extrude");
|
|
||||||
pExtrude->addTextElement("1");
|
|
||||||
pTesselate = pLineString->createNewChildElement("tesselate");
|
|
||||||
pTesselate->addTextElement("1");
|
|
||||||
pAltitudeMode = pLineString->createNewChildElement("altitudeMode");
|
|
||||||
pAltitudeMode->addTextElement("clampToGround");
|
|
||||||
pCoords = pLineString->createNewChildElement("coordinates");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const double pi = 3.14159265359;
|
|
||||||
double r = flightData.alt_meter;
|
|
||||||
double theta = flightData.lat/180*pi; // 0 = Equator
|
|
||||||
double phi = flightData.lon/180*pi; // 0 = Greenwich
|
|
||||||
double hdg = flightData.hdgTrue_deg/180*pi;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sprintf(temp_str, "%9.6f,%9.6f,%9.6f", phi/pi*180, theta/pi*180, r);
|
|
||||||
pCoords = m_pCameraPlaceMark->getChildByName("Point")->getChildByName("coordinates");
|
|
||||||
pCoords->deleteAllTextElements();
|
|
||||||
pCoords->addTextElement(temp_str);
|
|
||||||
m_pCameraPlaceMark->getChildByName("Point")->getChildByName("altitudeMode")->getFirstChildElement()->setText("clampToGround");
|
|
||||||
|
|
||||||
// Coordinates
|
|
||||||
pCoords = m_pCameraPlaceMark->getChildByName("LineString")->getChildByName("coordinates");
|
|
||||||
if (!pCoords)
|
|
||||||
{
|
{
|
||||||
pCoords = m_pCameraPlaceMark->getChildByName("LineString")->createNewChildElement("coordinates");
|
sprintf(temp_str, "%s/%s", m_flightData.atcFlightIDStr, m_flightData.atcFlightNumStr);
|
||||||
}
|
|
||||||
pCoords->deleteAllTextElements();
|
|
||||||
|
|
||||||
double k = 1.0/tan(hdg);
|
|
||||||
for (int i=0; i < 100; i++)
|
|
||||||
{
|
|
||||||
|
|
||||||
sprintf(temp_str, "%9.6f,%9.6f,%9.6f\n", phi/pi*180, theta/pi*180, r);
|
|
||||||
pCoords->addTextElement(temp_str);
|
|
||||||
theta = asin(tanh(k*phi)) + flightData.lat/180*pi;
|
|
||||||
phi += pi/10000;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
pName = pPlacemark->createNewChildElement("name");
|
||||||
|
pName->addTextElement(temp_str);
|
||||||
|
printf("%s\n", temp_str);
|
||||||
|
|
||||||
|
// Description
|
||||||
|
pDescr = pPlacemark->createNewChildElement("description");
|
||||||
|
sprintf(temp_str, "%s\nAltitude: %d ft, Speed: %d kts", m_flightData.atcFlightIDStr, (int)(m_flightData.alt_feet+0.5), (int)(m_flightData.gs_knots+0.5));
|
||||||
|
pDescr->addTextElement(temp_str);
|
||||||
|
|
||||||
|
// Style
|
||||||
|
pStyle = pPlacemark->createNewChildElement("Style");
|
||||||
|
|
||||||
|
// IconStyle
|
||||||
|
pIconStyle = pStyle->createNewChildElement("IconStyle");
|
||||||
|
pHeading = pIconStyle->createNewChildElement("heading");
|
||||||
|
pHeading->addTextElement(String(m_flightData.hdgTrue_deg));
|
||||||
|
|
||||||
|
// Icon
|
||||||
|
pIcon = pIconStyle->createNewChildElement("Icon");
|
||||||
|
pHref = pIcon->createNewChildElement("href");
|
||||||
|
pHref->addTextElement("root://icons/palette-2.png");
|
||||||
|
pY = pIcon->createNewChildElement("y");
|
||||||
|
pY->addTextElement("0");
|
||||||
|
pW = pIcon->createNewChildElement("w");
|
||||||
|
pW->addTextElement("32");
|
||||||
|
pH = pIcon->createNewChildElement("h");
|
||||||
|
pH->addTextElement("32");
|
||||||
|
|
||||||
|
// Point
|
||||||
|
pPoint = pPlacemark->createNewChildElement("Point");
|
||||||
|
pPoint->setAttribute("id", "Pointy");
|
||||||
|
pExtrude = pPoint->createNewChildElement("extrude");
|
||||||
|
pExtrude->addTextElement("1");
|
||||||
|
pTesselate = pPoint->createNewChildElement("tesselate");
|
||||||
|
pTesselate->addTextElement("1");
|
||||||
|
pAltitudeMode = pPoint->createNewChildElement("altitudeMode");
|
||||||
|
pAltitudeMode->addTextElement(m_altitudeModeString);
|
||||||
|
pCoords = pPoint->createNewChildElement("coordinates");
|
||||||
|
sprintf(temp_str, "%9.6f,%9.6f,%9.6f", m_flightData.lon, m_flightData.lat, m_flightData.alt_meter);
|
||||||
|
pCoords->addTextElement(temp_str);
|
||||||
|
|
||||||
|
return pPlacemark;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kml::updatePath(FlightData const &flightData)
|
XmlElement* Kml::createNetworkLinkControl()
|
||||||
|
{
|
||||||
|
XmlElement *pNetworkLinkControl = new XmlElement("NetworkLinkControl");
|
||||||
|
pNetworkLinkControl->createNewChildElement("LinkName")->addTextElement("Link");
|
||||||
|
|
||||||
|
XmlElement *pCamera = pNetworkLinkControl->createNewChildElement("Camera");
|
||||||
|
|
||||||
|
pCamera->createNewChildElement("longitude")->addTextElement(String(m_flightData.lon));
|
||||||
|
pCamera->createNewChildElement("latitude")->addTextElement(String(m_flightData.lat));
|
||||||
|
pCamera->createNewChildElement("altitude")->addTextElement(String(m_flightData.alt_meter+m_cameraAlt));
|
||||||
|
|
||||||
|
if (m_cameraAutoHeading)
|
||||||
|
pCamera->createNewChildElement("heading")->addTextElement(String(m_flightData.hdgTrue_deg));
|
||||||
|
else
|
||||||
|
pCamera->createNewChildElement("heading")->addTextElement("0");
|
||||||
|
|
||||||
|
pCamera->createNewChildElement("tilt")->addTextElement(String(m_cameraTilt));
|
||||||
|
|
||||||
|
if (m_cameraAutoRoll)
|
||||||
|
pCamera->createNewChildElement("roll")->addTextElement(String(m_flightData.bank_deg));
|
||||||
|
else
|
||||||
|
pCamera->createNewChildElement("roll")->addTextElement("0");
|
||||||
|
|
||||||
|
pCamera->createNewChildElement("altitudeMode")->addTextElement(m_altitudeModeString);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
XmlElement *pUpdate = pNetworkLinkControl->createNewChildElement("Update");
|
||||||
|
pUpdate->createNewChildElement("targetHref")->addTextElement("FsTrack.kml");
|
||||||
|
XmlElement *pChange = pUpdate->createNewChildElement("Change");
|
||||||
|
XmlElement *pNetworkLink = pChange->createNewChildElement("NetworkLink");
|
||||||
|
pNetworkLink->setAttribute("targetId", "NetworkLink_0");
|
||||||
|
XmlElement *pFlyToView = pNetworkLink->createNewChildElement("flyToView");
|
||||||
|
|
||||||
|
if (m_cameraFlyToView)
|
||||||
|
{
|
||||||
|
pFlyToView->addTextElement("0");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pFlyToView->addTextElement("1");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return pNetworkLinkControl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kml::destroy()
|
||||||
|
{
|
||||||
|
m_pKml = nullptr;
|
||||||
|
m_pPlanePlaceMark = nullptr;
|
||||||
|
m_pTrackPlaceMark = nullptr;
|
||||||
|
m_pCameraPlaceMark = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kml::setAltitudeMode(String const &modeString)
|
||||||
|
{
|
||||||
|
m_altitudeModeString = modeString;
|
||||||
|
|
||||||
|
if (m_pPlanePlaceMark)
|
||||||
|
{
|
||||||
|
m_pPlanePlaceMark->getChildByName("Point")->getChildByName("altitudeMode")->getFirstChildElement()->setText(modeString);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_pTrackPlaceMark)
|
||||||
|
{
|
||||||
|
m_pTrackPlaceMark->getChildByName("LineString")->getChildByName("altitudeMode")->getFirstChildElement()->setText(modeString);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kml::setPathColor(String const &colorString)
|
||||||
|
{
|
||||||
|
const ScopedLock sl (m_lock);
|
||||||
|
|
||||||
|
m_pathColorString = colorString;
|
||||||
|
|
||||||
|
if (m_pTrackPlaceMark)
|
||||||
|
{
|
||||||
|
m_pTrackPlaceMark->getChildByName("Style")->getChildByName("LineStyle")->getChildByName("color")->getFirstChildElement()->setText(colorString);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kml::setCameraAltitude(float alt_meters)
|
||||||
|
{
|
||||||
|
m_cameraAlt = alt_meters;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kml::setCameraTilt(float tilt_deg)
|
||||||
|
{
|
||||||
|
m_cameraTilt = tilt_deg;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kml::setCameraFlyToView(bool enable)
|
||||||
|
{
|
||||||
|
m_cameraFlyToView = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kml::setCameraAutoHeading(bool enable)
|
||||||
|
{
|
||||||
|
m_cameraAutoHeading = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kml::setCameraAutoRoll(bool enable)
|
||||||
|
{
|
||||||
|
m_cameraAutoRoll = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
XmlElement* Kml::createTrack()
|
||||||
{
|
{
|
||||||
const ScopedLock sl (m_lock);
|
const ScopedLock sl (m_lock);
|
||||||
|
|
||||||
char temp_str[1024];
|
char temp_str[1024];
|
||||||
|
|
||||||
XmlElement *pDoc = kml->getChildByName("Document");
|
XmlElement *pPlacemark;
|
||||||
|
|
||||||
XmlElement *pPlacemark = m_pPathPlaceMark;
|
|
||||||
XmlElement *pName;
|
XmlElement *pName;
|
||||||
XmlElement *pStyle;
|
XmlElement *pStyle;
|
||||||
XmlElement *pLineStyle;
|
XmlElement *pLineStyle;
|
||||||
@@ -361,63 +322,79 @@ void Kml::updatePath(FlightData const &flightData)
|
|||||||
XmlElement *pAltitudeMode;
|
XmlElement *pAltitudeMode;
|
||||||
XmlElement *pCoords;
|
XmlElement *pCoords;
|
||||||
|
|
||||||
if(pPlacemark == NULL)
|
// Placemark
|
||||||
|
pPlacemark = new XmlElement("Placemark");
|
||||||
|
pPlacemark->setAttribute("id", "Track_0");
|
||||||
|
|
||||||
|
// Name
|
||||||
|
pName = pPlacemark->createNewChildElement("name");
|
||||||
|
pName->addTextElement("Track");
|
||||||
|
|
||||||
|
// Style
|
||||||
|
pStyle = pPlacemark->createNewChildElement("Style");
|
||||||
|
|
||||||
|
// LineStyle
|
||||||
|
pLineStyle = pStyle->createNewChildElement("LineStyle");
|
||||||
|
pLineColor = pLineStyle->createNewChildElement("color");
|
||||||
|
pLineColor->addTextElement(m_pathColorString);
|
||||||
|
|
||||||
|
pLineWidth = pLineStyle->createNewChildElement("width");
|
||||||
|
pLineWidth->addTextElement("4");
|
||||||
|
|
||||||
|
// PolyStyle
|
||||||
|
pPolyStyle = pStyle->createNewChildElement("PolyStyle");
|
||||||
|
pPolyColor = pPolyStyle->createNewChildElement("color");
|
||||||
|
sprintf(temp_str, "%4.4X", 0x7f00ff00);
|
||||||
|
pPolyColor->addTextElement(temp_str);
|
||||||
|
|
||||||
|
// LineString
|
||||||
|
pLineString = pPlacemark->createNewChildElement("LineString");
|
||||||
|
pExtrude = pLineString->createNewChildElement("extrude");
|
||||||
|
pExtrude->addTextElement("1");
|
||||||
|
pTesselate = pLineString->createNewChildElement("tesselate");
|
||||||
|
pTesselate->addTextElement("1");
|
||||||
|
pAltitudeMode = pLineString->createNewChildElement("altitudeMode");
|
||||||
|
pAltitudeMode->addTextElement(m_altitudeModeString);
|
||||||
|
|
||||||
|
sprintf(temp_str, "\n%9.6f,%9.6f,%9.6f", m_flightData.lon, m_flightData.lat, m_flightData.alt_meter);
|
||||||
|
pCoords = pLineString->createNewChildElement("coordinates");
|
||||||
|
pCoords = pPlacemark->getChildByName("LineString")->getChildByName("coordinates");
|
||||||
|
pCoords->addTextElement(temp_str);
|
||||||
|
|
||||||
|
return pPlacemark;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kml::updateTrack()
|
||||||
|
{
|
||||||
|
const ScopedLock sl (m_lock);
|
||||||
|
char temp_str[1024];
|
||||||
|
|
||||||
|
if (!m_pTrackPlaceMark)
|
||||||
{
|
{
|
||||||
// Placemark
|
return;
|
||||||
pPlacemark = pDoc->createNewChildElement("Placemark");
|
|
||||||
|
|
||||||
// Name
|
|
||||||
pName = pPlacemark->createNewChildElement("name");
|
|
||||||
pName->addTextElement("Track");
|
|
||||||
|
|
||||||
// Style
|
|
||||||
pStyle = pPlacemark->createNewChildElement("Style");
|
|
||||||
|
|
||||||
// LineStyle
|
|
||||||
pLineStyle = pStyle->createNewChildElement("LineStyle");
|
|
||||||
pLineColor = pLineStyle->createNewChildElement("color");
|
|
||||||
pLineColor->addTextElement(m_pathColorString);
|
|
||||||
|
|
||||||
pLineWidth = pLineStyle->createNewChildElement("width");
|
|
||||||
pLineWidth->addTextElement("4");
|
|
||||||
|
|
||||||
// PolyStyle
|
|
||||||
pPolyStyle = pStyle->createNewChildElement("PolyStyle");
|
|
||||||
pPolyColor = pPolyStyle->createNewChildElement("color");
|
|
||||||
sprintf(temp_str, "%4.4X", 0x7f00ff00);
|
|
||||||
pPolyColor->addTextElement(temp_str);
|
|
||||||
|
|
||||||
// LineString
|
|
||||||
pLineString = pPlacemark->createNewChildElement("LineString");
|
|
||||||
pExtrude = pLineString->createNewChildElement("extrude");
|
|
||||||
pExtrude->addTextElement("1");
|
|
||||||
pTesselate = pLineString->createNewChildElement("tesselate");
|
|
||||||
pTesselate->addTextElement("1");
|
|
||||||
pAltitudeMode = pLineString->createNewChildElement("altitudeMode");
|
|
||||||
pAltitudeMode->addTextElement(m_altitudeModeString);
|
|
||||||
pCoords = pLineString->createNewChildElement("coordinates");
|
|
||||||
sprintf(temp_str, "%9.6f,%9.6f,%9.6f", flightData.lon, flightData.lat, flightData.alt_meter);
|
|
||||||
pCoords->addTextElement(temp_str);
|
|
||||||
|
|
||||||
m_pPathPlaceMark = pPlacemark;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Coordinates
|
|
||||||
sprintf(temp_str, "\n%9.6f,%9.6f,%9.6f", flightData.lon, flightData.lat, flightData.alt_meter);
|
|
||||||
pCoords = pPlacemark->getChildByName("LineString")->getChildByName("coordinates");
|
|
||||||
pCoords->addTextElement(temp_str);
|
|
||||||
}
|
}
|
||||||
|
// Coordinates
|
||||||
|
sprintf(temp_str, "\n%9.6f,%9.6f,%9.6f", m_flightData.lon, m_flightData.lat, m_flightData.alt_meter);
|
||||||
|
XmlElement *pCoords = m_pTrackPlaceMark->getChildByName("LineString")->getChildByName("coordinates");
|
||||||
|
pCoords->addTextElement(temp_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kml::exportKml(const char *pPath)
|
void Kml::exportKml(const char *pPath)
|
||||||
{
|
{
|
||||||
const ScopedLock sl (m_lock);
|
const ScopedLock sl (m_lock);
|
||||||
|
|
||||||
if (pPath && kml)
|
if (pPath && m_pKml)
|
||||||
{
|
{
|
||||||
File file(pPath);
|
File file(pPath);
|
||||||
kml->writeToFile(file, StringRef(""));
|
ScopedPointer<XmlElement> pPlane = createPlane();
|
||||||
|
ScopedPointer<XmlElement> pNetworkLinkcontrol = createNetworkLinkControl();
|
||||||
|
m_pKml->addChildElement(pNetworkLinkcontrol);
|
||||||
|
m_pKml->getChildByName("Document")->addChildElement(pPlane);
|
||||||
|
m_pKml->getChildByName("Document")->addChildElement(m_pTrackPlaceMark);
|
||||||
|
m_pKml->writeToFile(file, StringRef(""));
|
||||||
|
m_pKml->removeChildElement(pNetworkLinkcontrol, false);
|
||||||
|
m_pKml->getChildByName("Document")->removeChildElement(pPlane, false);
|
||||||
|
m_pKml->getChildByName("Document")->removeChildElement(m_pTrackPlaceMark, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,27 +403,27 @@ void Kml::exportKmz(const char *pPath)
|
|||||||
// ToDo: add Compression if available in Juce
|
// ToDo: add Compression if available in Juce
|
||||||
const ScopedLock sl (m_lock);
|
const ScopedLock sl (m_lock);
|
||||||
|
|
||||||
if (pPath && kml)
|
if (pPath && m_pKml)
|
||||||
{
|
{
|
||||||
File file(pPath);
|
File file(pPath);
|
||||||
|
|
||||||
file.deleteFile();
|
file.deleteFile();
|
||||||
ScopedPointer<OutputStream> pStream = file.createOutputStream();
|
ScopedPointer<OutputStream> pStream = file.createOutputStream();
|
||||||
|
|
||||||
kml->writeToStream(*pStream, StringRef(""));
|
m_pKml->writeToStream(*pStream, StringRef(""));
|
||||||
pStream = nullptr;
|
pStream = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kml::onUpdate(const char *pPath, ViewFormat const &viewFormat)
|
void Kml::onUpdate(const char *pPath, ViewFormat const &viewFormat)
|
||||||
{
|
{
|
||||||
if (kml == nullptr)
|
if (m_pKml == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// LookAt
|
// LookAt
|
||||||
XmlElement *pCamera;
|
// XmlElement *pCamera;
|
||||||
|
|
||||||
pCamera = kml->getChildByName("NetworkLinkControl")->getChildByName("Camera");
|
// pCamera = m_pKml->getChildByName("NetworkLinkControl")->getChildByName("Camera");
|
||||||
|
|
||||||
if (viewFormat.has_camera)
|
if (viewFormat.has_camera)
|
||||||
{
|
{
|
||||||
@@ -462,6 +439,6 @@ void Kml::onUpdate(const char *pPath, ViewFormat const &viewFormat)
|
|||||||
// pCamera->getChildByName("altitudeMode")->getFirstChildElement()->setText(m_altitudeModeString);
|
// pCamera->getChildByName("altitudeMode")->getFirstChildElement()->setText(m_altitudeModeString);
|
||||||
}
|
}
|
||||||
|
|
||||||
exportKmz(pPath);
|
exportKml(pPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+14
-5
@@ -11,18 +11,20 @@ public:
|
|||||||
Kml(const char *pDocRoot);
|
Kml(const char *pDocRoot);
|
||||||
~Kml(void);
|
~Kml(void);
|
||||||
|
|
||||||
|
void createNetworkLinkFile(String const &filename, String const &hostIp);
|
||||||
void setAltitudeMode(String const &modeString);
|
void setAltitudeMode(String const &modeString);
|
||||||
void setPathColor(String const &colorString);
|
void setPathColor(String const &colorString);
|
||||||
void setCameraAltitude(float alt_meters);
|
void setCameraAltitude(float alt_meters);
|
||||||
void setCameraTilt(float tilt_deg);
|
void setCameraTilt(float tilt_deg);
|
||||||
void setCameraAutoHeading(bool enable);
|
void setCameraAutoHeading(bool enable);
|
||||||
void setCameraAutoRoll(bool enable);
|
void setCameraAutoRoll(bool enable);
|
||||||
|
void setCameraFlyToView(bool enable);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CriticalSection m_lock;
|
CriticalSection m_lock;
|
||||||
ScopedPointer<XmlElement> kml;
|
ScopedPointer<XmlElement> m_pKml;
|
||||||
XmlElement *m_pPlanePlaceMark;
|
XmlElement *m_pPlanePlaceMark;
|
||||||
XmlElement *m_pPathPlaceMark;
|
XmlElement *m_pTrackPlaceMark;
|
||||||
XmlElement *m_pCameraPlaceMark;
|
XmlElement *m_pCameraPlaceMark;
|
||||||
char m_path[1024];
|
char m_path[1024];
|
||||||
const char *m_docRoot;
|
const char *m_docRoot;
|
||||||
@@ -32,15 +34,22 @@ private:
|
|||||||
float m_cameraTilt;
|
float m_cameraTilt;
|
||||||
bool m_cameraAutoHeading;
|
bool m_cameraAutoHeading;
|
||||||
bool m_cameraAutoRoll;
|
bool m_cameraAutoRoll;
|
||||||
|
bool m_cameraFlyToView;
|
||||||
|
FlightData m_flightData;
|
||||||
void create();
|
void create();
|
||||||
void destroy();
|
void destroy();
|
||||||
const char* getPath();
|
const char* getPath();
|
||||||
|
void updateFlightData(FlightData const &flightData);
|
||||||
void update(FlightData const &flightData);
|
void update(FlightData const &flightData);
|
||||||
void exportKml(const char *pPath);
|
void exportKml(const char *pPath);
|
||||||
void exportKmz(const char *pPath);
|
void exportKmz(const char *pPath);
|
||||||
void updatePlane(FlightData const &flightData);
|
void updatePlane();
|
||||||
void updatePath(FlightData const &flightData);
|
void updateTrack();
|
||||||
void onUpdate(const char *pPath, ViewFormat const &viewFormat);
|
void onUpdate(const char *pPath, ViewFormat const &viewFormat);
|
||||||
|
|
||||||
|
XmlElement* createNetworkLinkControl();
|
||||||
|
XmlElement* createPlane();
|
||||||
|
XmlElement* createTrack();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !KML_HPP
|
#endif // !KML_HPP
|
||||||
|
|||||||
+6
-3
@@ -23,8 +23,9 @@ public:
|
|||||||
const String getApplicationName() override { return ProjectInfo::projectName; }
|
const String getApplicationName() override { return ProjectInfo::projectName; }
|
||||||
const String getApplicationVersion() override { return ProjectInfo::versionString; }
|
const String getApplicationVersion() override { return ProjectInfo::versionString; }
|
||||||
bool moreThanOneInstanceAllowed() override { return true; }
|
bool moreThanOneInstanceAllowed() override { return true; }
|
||||||
static void getNetworkAdapters()
|
static String getNetworkAdapters()
|
||||||
{
|
{
|
||||||
|
String hostIp("0.0.0.0");
|
||||||
PIP_ADAPTER_INFO pAdapterInfo;
|
PIP_ADAPTER_INFO pAdapterInfo;
|
||||||
pAdapterInfo = (IP_ADAPTER_INFO *) malloc(sizeof(IP_ADAPTER_INFO));
|
pAdapterInfo = (IP_ADAPTER_INFO *) malloc(sizeof(IP_ADAPTER_INFO));
|
||||||
ULONG buflen = sizeof(IP_ADAPTER_INFO);
|
ULONG buflen = sizeof(IP_ADAPTER_INFO);
|
||||||
@@ -51,6 +52,7 @@ public:
|
|||||||
printf("\tDHCP Enabled: Yes\n");
|
printf("\tDHCP Enabled: Yes\n");
|
||||||
printf("\t\tDHCP Server: \t%s\n", pAdapter->DhcpServer.IpAddress.String);
|
printf("\t\tDHCP Server: \t%s\n", pAdapter->DhcpServer.IpAddress.String);
|
||||||
printf("\tLease Obtained: %ld\n", pAdapter->LeaseObtained);
|
printf("\tLease Obtained: %ld\n", pAdapter->LeaseObtained);
|
||||||
|
hostIp = String(pAdapter->IpAddressList.IpAddress.String);
|
||||||
} else {
|
} else {
|
||||||
printf("\tDHCP Enabled: No\n");
|
printf("\tDHCP Enabled: No\n");
|
||||||
}
|
}
|
||||||
@@ -69,6 +71,7 @@ public:
|
|||||||
{
|
{
|
||||||
printf("Call to GetAdaptersInfo failed.\n");
|
printf("Call to GetAdaptersInfo failed.\n");
|
||||||
}
|
}
|
||||||
|
return hostIp;
|
||||||
}
|
}
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
void initialise (const String& commandLine) override
|
void initialise (const String& commandLine) override
|
||||||
@@ -114,7 +117,7 @@ public:
|
|||||||
Colours::lightgrey,
|
Colours::lightgrey,
|
||||||
DocumentWindow::allButtons)
|
DocumentWindow::allButtons)
|
||||||
{
|
{
|
||||||
FsTrackApplication::getNetworkAdapters();
|
String hostIp = FsTrackApplication::getNetworkAdapters();
|
||||||
|
|
||||||
char path[1024];
|
char path[1024];
|
||||||
if (!SUCCEEDED(SHGetFolderPath(nullptr, CSIDL_DESKTOP, nullptr, 0, path)))
|
if (!SUCCEEDED(SHGetFolderPath(nullptr, CSIDL_DESKTOP, nullptr, 0, path)))
|
||||||
@@ -122,7 +125,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
static String pathStr(path);
|
static String pathStr(path);
|
||||||
setContentOwned (new MainComponent(pathStr), true);
|
setContentOwned (new MainComponent(pathStr, hostIp), true);
|
||||||
|
|
||||||
centreWithSize (getWidth(), getHeight());
|
centreWithSize (getWidth(), getHeight());
|
||||||
setVisible (true);
|
setVisible (true);
|
||||||
|
|||||||
+125
-100
@@ -27,7 +27,7 @@
|
|||||||
//[/MiscUserDefs]
|
//[/MiscUserDefs]
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
MainComponent::MainComponent (String const &homeDir)
|
MainComponent::MainComponent (String const &homeDir, String const &hostIp)
|
||||||
{
|
{
|
||||||
addAndMakeVisible (m_fsuipcStatus = new Label ("FSUIP Status",
|
addAndMakeVisible (m_fsuipcStatus = new Label ("FSUIP Status",
|
||||||
TRANS("Unknown")));
|
TRANS("Unknown")));
|
||||||
@@ -47,40 +47,18 @@ MainComponent::MainComponent (String const &homeDir)
|
|||||||
m_flightStatus->setColour (TextEditor::textColourId, Colours::black);
|
m_flightStatus->setColour (TextEditor::textColourId, Colours::black);
|
||||||
m_flightStatus->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
|
m_flightStatus->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
|
||||||
|
|
||||||
addAndMakeVisible (m_kmlUpdInterval_s = new Slider ("KML Update Interval"));
|
|
||||||
m_kmlUpdInterval_s->setTooltip (TRANS("KML Update Interval"));
|
|
||||||
m_kmlUpdInterval_s->setRange (0.1, 10, 0.1);
|
|
||||||
m_kmlUpdInterval_s->setSliderStyle (Slider::LinearHorizontal);
|
|
||||||
m_kmlUpdInterval_s->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
|
|
||||||
m_kmlUpdInterval_s->addListener (this);
|
|
||||||
|
|
||||||
addAndMakeVisible (m_colorSelector = new ColourSelector());
|
|
||||||
m_colorSelector->setName ("Color Selector");
|
|
||||||
|
|
||||||
addAndMakeVisible (m_altitudeMode = new ComboBox ("Altitude Mode"));
|
|
||||||
m_altitudeMode->setTooltip (TRANS("Altitude Mode"));
|
|
||||||
m_altitudeMode->setEditableText (false);
|
|
||||||
m_altitudeMode->setJustificationType (Justification::centredLeft);
|
|
||||||
m_altitudeMode->setTextWhenNothingSelected (String::empty);
|
|
||||||
m_altitudeMode->setTextWhenNoChoicesAvailable (TRANS("(no choices)"));
|
|
||||||
m_altitudeMode->addItem (TRANS("absolute"), 1);
|
|
||||||
m_altitudeMode->addItem (TRANS("relativeToGround"), 2);
|
|
||||||
m_altitudeMode->addItem (TRANS("clampToGround"), 3);
|
|
||||||
m_altitudeMode->addSeparator();
|
|
||||||
m_altitudeMode->addListener (this);
|
|
||||||
|
|
||||||
addAndMakeVisible (m_cameraAltitude = new Slider ("Camera Altitude"));
|
addAndMakeVisible (m_cameraAltitude = new Slider ("Camera Altitude"));
|
||||||
m_cameraAltitude->setTooltip (TRANS("Camera Altitude"));
|
m_cameraAltitude->setTooltip (TRANS("Camera Altitude"));
|
||||||
m_cameraAltitude->setRange (0, 1e+007, 100);
|
m_cameraAltitude->setRange (0.1, 7, 0.01);
|
||||||
m_cameraAltitude->setSliderStyle (Slider::LinearHorizontal);
|
m_cameraAltitude->setSliderStyle (Slider::LinearHorizontal);
|
||||||
m_cameraAltitude->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
|
m_cameraAltitude->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
|
||||||
m_cameraAltitude->addListener (this);
|
m_cameraAltitude->addListener (this);
|
||||||
|
|
||||||
addAndMakeVisible (m_CameraTilt = new Slider ("Camera Tilt"));
|
addAndMakeVisible (m_CameraTilt = new Slider ("Camera Tilt"));
|
||||||
m_CameraTilt->setTooltip (TRANS("Camera Tilt"));
|
m_CameraTilt->setTooltip (TRANS("Camera Tilt"));
|
||||||
m_CameraTilt->setRange (0, 90, 5);
|
m_CameraTilt->setRange (0, 90, 5);
|
||||||
m_CameraTilt->setSliderStyle (Slider::LinearHorizontal);
|
m_CameraTilt->setSliderStyle (Slider::LinearHorizontal);
|
||||||
m_CameraTilt->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20);
|
m_CameraTilt->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
|
||||||
m_CameraTilt->addListener (this);
|
m_CameraTilt->addListener (this);
|
||||||
|
|
||||||
addAndMakeVisible (m_cameraAutoHeadingEnable = new ToggleButton ("Camera Auto Heading"));
|
addAndMakeVisible (m_cameraAutoHeadingEnable = new ToggleButton ("Camera Auto Heading"));
|
||||||
@@ -91,11 +69,35 @@ MainComponent::MainComponent (String const &homeDir)
|
|||||||
m_cameraAutoRollEnable->setTooltip (TRANS("Camera Auto Roll"));
|
m_cameraAutoRollEnable->setTooltip (TRANS("Camera Auto Roll"));
|
||||||
m_cameraAutoRollEnable->addListener (this);
|
m_cameraAutoRollEnable->addListener (this);
|
||||||
|
|
||||||
|
addAndMakeVisible (m_cameraAutoFlyToView = new ToggleButton ("Camera Auto FlyToView"));
|
||||||
|
m_cameraAutoFlyToView->setTooltip (TRANS("Camera Auto FlyToView"));
|
||||||
|
m_cameraAutoFlyToView->addListener (this);
|
||||||
|
|
||||||
|
addAndMakeVisible (m_labelCameraAltitude = new Label ("Camera Altitude",
|
||||||
|
TRANS("0")));
|
||||||
|
m_labelCameraAltitude->setTooltip (TRANS("Camera Altitude in meter"));
|
||||||
|
m_labelCameraAltitude->setFont (Font (15.00f, Font::plain));
|
||||||
|
m_labelCameraAltitude->setJustificationType (Justification::centredRight);
|
||||||
|
m_labelCameraAltitude->setEditable (true, true, false);
|
||||||
|
m_labelCameraAltitude->setColour (TextEditor::textColourId, Colours::black);
|
||||||
|
m_labelCameraAltitude->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
|
||||||
|
m_labelCameraAltitude->addListener (this);
|
||||||
|
|
||||||
|
addAndMakeVisible (m_labelCameraTilt = new Label ("Camera Tilt",
|
||||||
|
TRANS("0")));
|
||||||
|
m_labelCameraTilt->setTooltip (TRANS("Camera Tilt in degrees"));
|
||||||
|
m_labelCameraTilt->setFont (Font (15.00f, Font::plain));
|
||||||
|
m_labelCameraTilt->setJustificationType (Justification::centredRight);
|
||||||
|
m_labelCameraTilt->setEditable (true, true, false);
|
||||||
|
m_labelCameraTilt->setColour (TextEditor::textColourId, Colours::black);
|
||||||
|
m_labelCameraTilt->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
|
||||||
|
m_labelCameraTilt->addListener (this);
|
||||||
|
|
||||||
|
|
||||||
//[UserPreSize]
|
//[UserPreSize]
|
||||||
//[/UserPreSize]
|
//[/UserPreSize]
|
||||||
|
|
||||||
setSize (400, 300);
|
setSize (300, 300);
|
||||||
|
|
||||||
|
|
||||||
//[Constructor] You can add your own custom stuff here..
|
//[Constructor] You can add your own custom stuff here..
|
||||||
@@ -115,14 +117,12 @@ MainComponent::MainComponent (String const &homeDir)
|
|||||||
m_httpServer = new HttpServer(5001, workDir.getCharPointer());
|
m_httpServer = new HttpServer(5001, workDir.getCharPointer());
|
||||||
m_httpServer->addListener(m_kml);
|
m_httpServer->addListener(m_kml);
|
||||||
|
|
||||||
m_kmlUpdInterval_s->setValue(1.0, juce::NotificationType::sendNotification);
|
|
||||||
|
|
||||||
m_colorSelector->addChangeListener(this);
|
|
||||||
m_colorSelector->setCurrentColour(juce::Colours::yellow);
|
|
||||||
|
|
||||||
m_altitudeMode->setSelectedId(1, juce::NotificationType::sendNotification);
|
|
||||||
m_cameraAltitude->setValue(10000, juce::NotificationType::sendNotification);
|
m_cameraAltitude->setValue(10000, juce::NotificationType::sendNotification);
|
||||||
m_CameraTilt->setValue(0, juce::NotificationType::sendNotification);
|
m_CameraTilt->setValue(0, juce::NotificationType::sendNotification);
|
||||||
|
m_cameraAutoFlyToView->setToggleState(true, juce::NotificationType::sendNotification);
|
||||||
|
m_labelCameraAltitude->setText("1000", juce::NotificationType::sendNotification);
|
||||||
|
m_kml->createNetworkLinkFile(workDir + String("\\FsTrack.kml"), hostIp);
|
||||||
|
m_fsLink->setUpdateInterval(1.0);
|
||||||
//[/Constructor]
|
//[/Constructor]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,13 +137,13 @@ MainComponent::~MainComponent()
|
|||||||
|
|
||||||
m_fsuipcStatus = nullptr;
|
m_fsuipcStatus = nullptr;
|
||||||
m_flightStatus = nullptr;
|
m_flightStatus = nullptr;
|
||||||
m_kmlUpdInterval_s = nullptr;
|
|
||||||
m_colorSelector = nullptr;
|
|
||||||
m_altitudeMode = nullptr;
|
|
||||||
m_cameraAltitude = nullptr;
|
m_cameraAltitude = nullptr;
|
||||||
m_CameraTilt = nullptr;
|
m_CameraTilt = nullptr;
|
||||||
m_cameraAutoHeadingEnable = nullptr;
|
m_cameraAutoHeadingEnable = nullptr;
|
||||||
m_cameraAutoRollEnable = nullptr;
|
m_cameraAutoRollEnable = nullptr;
|
||||||
|
m_cameraAutoFlyToView = nullptr;
|
||||||
|
m_labelCameraAltitude = nullptr;
|
||||||
|
m_labelCameraTilt = nullptr;
|
||||||
|
|
||||||
|
|
||||||
//[Destructor]. You can add your own custom destruction code here..
|
//[Destructor]. You can add your own custom destruction code here..
|
||||||
@@ -158,21 +158,33 @@ void MainComponent::paint (Graphics& g)
|
|||||||
|
|
||||||
g.fillAll (Colours::white);
|
g.fillAll (Colours::white);
|
||||||
|
|
||||||
|
g.setColour (Colours::black);
|
||||||
|
g.setFont (Font (15.00f, Font::plain));
|
||||||
|
g.drawText (TRANS("[m]"),
|
||||||
|
265, 32, 23, 24,
|
||||||
|
Justification::centredLeft, true);
|
||||||
|
|
||||||
|
g.setColour (Colours::black);
|
||||||
|
g.setFont (Font (15.00f, Font::plain));
|
||||||
|
g.drawText (CharPointer_UTF8 ("[\xc2\xb0]"),
|
||||||
|
265, 64, 23, 24,
|
||||||
|
Justification::centredLeft, true);
|
||||||
|
|
||||||
//[UserPaint] Add your own custom painting code here..
|
//[UserPaint] Add your own custom painting code here..
|
||||||
//[/UserPaint]
|
//[/UserPaint]
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainComponent::resized()
|
void MainComponent::resized()
|
||||||
{
|
{
|
||||||
m_fsuipcStatus->setBounds (16, 264, 150, 24);
|
m_fsuipcStatus->setBounds (16, 256, 120, 24);
|
||||||
m_flightStatus->setBounds (216, 264, 150, 24);
|
m_flightStatus->setBounds (160, 256, 120, 24);
|
||||||
m_kmlUpdInterval_s->setBounds (24, 232, 160, 24);
|
m_cameraAltitude->setBounds (24, 32, 144, 24);
|
||||||
m_colorSelector->setBounds (24, 24, 168, 192);
|
m_CameraTilt->setBounds (24, 64, 144, 24);
|
||||||
m_altitudeMode->setBounds (216, 32, 160, 24);
|
m_cameraAutoHeadingEnable->setBounds (24, 104, 176, 24);
|
||||||
m_cameraAltitude->setBounds (216, 80, 160, 24);
|
m_cameraAutoRollEnable->setBounds (24, 136, 176, 24);
|
||||||
m_CameraTilt->setBounds (216, 120, 160, 24);
|
m_cameraAutoFlyToView->setBounds (24, 168, 176, 24);
|
||||||
m_cameraAutoHeadingEnable->setBounds (216, 160, 150, 24);
|
m_labelCameraAltitude->setBounds (176, 32, 88, 24);
|
||||||
m_cameraAutoRollEnable->setBounds (216, 192, 150, 24);
|
m_labelCameraTilt->setBounds (176, 64, 88, 24);
|
||||||
//[UserResized] Add your own custom resize handling here..
|
//[UserResized] Add your own custom resize handling here..
|
||||||
//[/UserResized]
|
//[/UserResized]
|
||||||
}
|
}
|
||||||
@@ -182,22 +194,18 @@ void MainComponent::sliderValueChanged (Slider* sliderThatWasMoved)
|
|||||||
//[UsersliderValueChanged_Pre]
|
//[UsersliderValueChanged_Pre]
|
||||||
//[/UsersliderValueChanged_Pre]
|
//[/UsersliderValueChanged_Pre]
|
||||||
|
|
||||||
if (sliderThatWasMoved == m_kmlUpdInterval_s)
|
if (sliderThatWasMoved == m_cameraAltitude)
|
||||||
{
|
|
||||||
//[UserSliderCode_m_kmlUpdInterval_s] -- add your slider handling code here..
|
|
||||||
m_fsLink->setUpdateInterval(sliderThatWasMoved->getValue());
|
|
||||||
//[/UserSliderCode_m_kmlUpdInterval_s]
|
|
||||||
}
|
|
||||||
else if (sliderThatWasMoved == m_cameraAltitude)
|
|
||||||
{
|
{
|
||||||
//[UserSliderCode_m_cameraAltitude] -- add your slider handling code here..
|
//[UserSliderCode_m_cameraAltitude] -- add your slider handling code here..
|
||||||
m_kml->setCameraAltitude(sliderThatWasMoved->getValue());
|
String s = String((int)std::pow(10.0, sliderThatWasMoved->getValue()));
|
||||||
|
m_labelCameraAltitude->setText(s, juce::NotificationType::sendNotification);
|
||||||
//[/UserSliderCode_m_cameraAltitude]
|
//[/UserSliderCode_m_cameraAltitude]
|
||||||
}
|
}
|
||||||
else if (sliderThatWasMoved == m_CameraTilt)
|
else if (sliderThatWasMoved == m_CameraTilt)
|
||||||
{
|
{
|
||||||
//[UserSliderCode_m_CameraTilt] -- add your slider handling code here..
|
//[UserSliderCode_m_CameraTilt] -- add your slider handling code here..
|
||||||
m_kml->setCameraTilt(sliderThatWasMoved->getValue());
|
String s = String((int)sliderThatWasMoved->getValue());
|
||||||
|
m_labelCameraTilt->setText(s, juce::NotificationType::sendNotification);
|
||||||
//[/UserSliderCode_m_CameraTilt]
|
//[/UserSliderCode_m_CameraTilt]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,22 +213,6 @@ void MainComponent::sliderValueChanged (Slider* sliderThatWasMoved)
|
|||||||
//[/UsersliderValueChanged_Post]
|
//[/UsersliderValueChanged_Post]
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainComponent::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
|
|
||||||
{
|
|
||||||
//[UsercomboBoxChanged_Pre]
|
|
||||||
//[/UsercomboBoxChanged_Pre]
|
|
||||||
|
|
||||||
if (comboBoxThatHasChanged == m_altitudeMode)
|
|
||||||
{
|
|
||||||
//[UserComboBoxCode_m_altitudeMode] -- add your combo box handling code here..
|
|
||||||
m_kml->setAltitudeMode(comboBoxThatHasChanged->getItemText(comboBoxThatHasChanged->getSelectedItemIndex()));
|
|
||||||
//[/UserComboBoxCode_m_altitudeMode]
|
|
||||||
}
|
|
||||||
|
|
||||||
//[UsercomboBoxChanged_Post]
|
|
||||||
//[/UsercomboBoxChanged_Post]
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainComponent::buttonClicked (Button* buttonThatWasClicked)
|
void MainComponent::buttonClicked (Button* buttonThatWasClicked)
|
||||||
{
|
{
|
||||||
//[UserbuttonClicked_Pre]
|
//[UserbuttonClicked_Pre]
|
||||||
@@ -238,11 +230,41 @@ void MainComponent::buttonClicked (Button* buttonThatWasClicked)
|
|||||||
m_kml->setCameraAutoRoll(buttonThatWasClicked->getToggleState());
|
m_kml->setCameraAutoRoll(buttonThatWasClicked->getToggleState());
|
||||||
//[/UserButtonCode_m_cameraAutoRollEnable]
|
//[/UserButtonCode_m_cameraAutoRollEnable]
|
||||||
}
|
}
|
||||||
|
else if (buttonThatWasClicked == m_cameraAutoFlyToView)
|
||||||
|
{
|
||||||
|
//[UserButtonCode_m_cameraAutoFlyToView] -- add your button handler code here..
|
||||||
|
m_kml->setCameraFlyToView(buttonThatWasClicked->getToggleState());
|
||||||
|
//[/UserButtonCode_m_cameraAutoFlyToView]
|
||||||
|
}
|
||||||
|
|
||||||
//[UserbuttonClicked_Post]
|
//[UserbuttonClicked_Post]
|
||||||
//[/UserbuttonClicked_Post]
|
//[/UserbuttonClicked_Post]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainComponent::labelTextChanged (Label* labelThatHasChanged)
|
||||||
|
{
|
||||||
|
//[UserlabelTextChanged_Pre]
|
||||||
|
//[/UserlabelTextChanged_Pre]
|
||||||
|
|
||||||
|
if (labelThatHasChanged == m_labelCameraAltitude)
|
||||||
|
{
|
||||||
|
//[UserLabelCode_m_labelCameraAltitude] -- add your label text handling code here..
|
||||||
|
m_kml->setCameraAltitude(labelThatHasChanged->getText().getFloatValue());
|
||||||
|
m_cameraAltitude->setValue(std::log10(1+labelThatHasChanged->getText().getFloatValue()));
|
||||||
|
//[/UserLabelCode_m_labelCameraAltitude]
|
||||||
|
}
|
||||||
|
else if (labelThatHasChanged == m_labelCameraTilt)
|
||||||
|
{
|
||||||
|
//[UserLabelCode_m_labelCameraTilt] -- add your label text handling code here..
|
||||||
|
m_kml->setCameraTilt(labelThatHasChanged->getText().getFloatValue());
|
||||||
|
m_CameraTilt->setValue(labelThatHasChanged->getText().getFloatValue());
|
||||||
|
//[/UserLabelCode_m_labelCameraTilt]
|
||||||
|
}
|
||||||
|
|
||||||
|
//[UserlabelTextChanged_Post]
|
||||||
|
//[/UserlabelTextChanged_Post]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
|
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
|
||||||
@@ -259,11 +281,6 @@ void MainComponent::onDataChanged(IFsLink &obj)
|
|||||||
|
|
||||||
void MainComponent::changeListenerCallback(juce::ChangeBroadcaster *source)
|
void MainComponent::changeListenerCallback(juce::ChangeBroadcaster *source)
|
||||||
{
|
{
|
||||||
if (m_colorSelector == source)
|
|
||||||
{
|
|
||||||
ColourSelector &obj = (ColourSelector&)*source;
|
|
||||||
m_kml->setPathColor(String(obj.getCurrentColour().fromRGBA(obj.getCurrentColour().getBlue(), obj.getCurrentColour().getGreen(), obj.getCurrentColour().getRed(), obj.getCurrentColour().getAlpha()).toString()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//[/MiscUserCode]
|
//[/MiscUserCode]
|
||||||
@@ -280,48 +297,56 @@ BEGIN_JUCER_METADATA
|
|||||||
|
|
||||||
<JUCER_COMPONENT documentType="Component" className="MainComponent" componentName=""
|
<JUCER_COMPONENT documentType="Component" className="MainComponent" componentName=""
|
||||||
parentClasses="public Component, public IFsLinkListener, public ChangeListener"
|
parentClasses="public Component, public IFsLinkListener, public ChangeListener"
|
||||||
constructorParams="String const &homeDir" variableInitialisers=""
|
constructorParams="String const &homeDir, String const &hostIp"
|
||||||
snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
|
variableInitialisers="" snapPixels="8" snapActive="1" snapShown="1"
|
||||||
fixedSize="1" initialWidth="400" initialHeight="300">
|
overlayOpacity="0.330" fixedSize="1" initialWidth="300" initialHeight="300">
|
||||||
<BACKGROUND backgroundColour="ffffffff"/>
|
<BACKGROUND backgroundColour="ffffffff">
|
||||||
|
<TEXT pos="265 32 23 24" fill="solid: ff000000" hasStroke="0" text="[m]"
|
||||||
|
fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
|
||||||
|
<TEXT pos="265 64 23 24" fill="solid: ff000000" hasStroke="0" text="[°]"
|
||||||
|
fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
|
||||||
|
</BACKGROUND>
|
||||||
<LABEL name="FSUIP Status" id="a891503ff0f699d7" memberName="m_fsuipcStatus"
|
<LABEL name="FSUIP Status" id="a891503ff0f699d7" memberName="m_fsuipcStatus"
|
||||||
virtualName="" explicitFocusOrder="0" pos="16 264 150 24" tooltip="FSUIP Status"
|
virtualName="" explicitFocusOrder="0" pos="16 256 120 24" tooltip="FSUIP Status"
|
||||||
edTextCol="ff000000" edBkgCol="0" labelText="Unknown" editableSingleClick="0"
|
edTextCol="ff000000" edBkgCol="0" labelText="Unknown" editableSingleClick="0"
|
||||||
editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
|
editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
|
||||||
fontsize="15" bold="0" italic="0" justification="33"/>
|
fontsize="15" bold="0" italic="0" justification="33"/>
|
||||||
<LABEL name="Flight Status" id="2a046c84c0638c1f" memberName="m_flightStatus"
|
<LABEL name="Flight Status" id="2a046c84c0638c1f" memberName="m_flightStatus"
|
||||||
virtualName="" explicitFocusOrder="0" pos="216 264 150 24" tooltip="Flight Status"
|
virtualName="" explicitFocusOrder="0" pos="160 256 120 24" tooltip="Flight Status"
|
||||||
edTextCol="ff000000" edBkgCol="0" labelText="Unknown" editableSingleClick="0"
|
edTextCol="ff000000" edBkgCol="0" labelText="Unknown" editableSingleClick="0"
|
||||||
editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
|
editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
|
||||||
fontsize="15" bold="0" italic="0" justification="33"/>
|
fontsize="15" bold="0" italic="0" justification="33"/>
|
||||||
<SLIDER name="KML Update Interval" id="c4434642fabdd31c" memberName="m_kmlUpdInterval_s"
|
|
||||||
virtualName="" explicitFocusOrder="0" pos="24 232 160 24" tooltip="KML Update Interval"
|
|
||||||
min="0.10000000000000001" max="10" int="0.10000000000000001"
|
|
||||||
style="LinearHorizontal" textBoxPos="TextBoxLeft" textBoxEditable="1"
|
|
||||||
textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
|
|
||||||
<GENERICCOMPONENT name="Color Selector" id="bccc8a8094997edb" memberName="m_colorSelector"
|
|
||||||
virtualName="" explicitFocusOrder="0" pos="24 24 168 192" class="ColourSelector"
|
|
||||||
params=""/>
|
|
||||||
<COMBOBOX name="Altitude Mode" id="93006349fcf3e57a" memberName="m_altitudeMode"
|
|
||||||
virtualName="" explicitFocusOrder="0" pos="216 32 160 24" tooltip="Altitude Mode"
|
|
||||||
editable="0" layout="33" items="absolute relativeToGround clampToGround "
|
|
||||||
textWhenNonSelected="" textWhenNoItems="(no choices)"/>
|
|
||||||
<SLIDER name="Camera Altitude" id="3352cbc6aebbcc9e" memberName="m_cameraAltitude"
|
<SLIDER name="Camera Altitude" id="3352cbc6aebbcc9e" memberName="m_cameraAltitude"
|
||||||
virtualName="" explicitFocusOrder="0" pos="216 80 160 24" tooltip="Camera Altitude"
|
virtualName="" explicitFocusOrder="0" pos="24 32 144 24" tooltip="Camera Altitude"
|
||||||
min="0" max="10000000" int="100" style="LinearHorizontal" textBoxPos="TextBoxLeft"
|
min="0.10000000000000001" max="7" int="0.01" style="LinearHorizontal"
|
||||||
textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
|
textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
|
||||||
|
textBoxHeight="20" skewFactor="1"/>
|
||||||
<SLIDER name="Camera Tilt" id="4993af2027f11be1" memberName="m_CameraTilt"
|
<SLIDER name="Camera Tilt" id="4993af2027f11be1" memberName="m_CameraTilt"
|
||||||
virtualName="" explicitFocusOrder="0" pos="216 120 160 24" tooltip="Camera Tilt"
|
virtualName="" explicitFocusOrder="0" pos="24 64 144 24" tooltip="Camera Tilt"
|
||||||
min="0" max="90" int="5" style="LinearHorizontal" textBoxPos="TextBoxLeft"
|
min="0" max="90" int="5" style="LinearHorizontal" textBoxPos="NoTextBox"
|
||||||
textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
|
textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
|
||||||
<TOGGLEBUTTON name="Camera Auto Heading" id="97a6fc7c399da63d" memberName="m_cameraAutoHeadingEnable"
|
<TOGGLEBUTTON name="Camera Auto Heading" id="97a6fc7c399da63d" memberName="m_cameraAutoHeadingEnable"
|
||||||
virtualName="" explicitFocusOrder="0" pos="216 160 150 24" tooltip="Camera Auto Heading"
|
virtualName="" explicitFocusOrder="0" pos="24 104 176 24" tooltip="Camera Auto Heading"
|
||||||
buttonText="Camera Auto Heading" connectedEdges="0" needsCallback="1"
|
buttonText="Camera Auto Heading" connectedEdges="0" needsCallback="1"
|
||||||
radioGroupId="0" state="0"/>
|
radioGroupId="0" state="0"/>
|
||||||
<TOGGLEBUTTON name="Camera Auto Roll" id="cc847f94257e9212" memberName="m_cameraAutoRollEnable"
|
<TOGGLEBUTTON name="Camera Auto Roll" id="cc847f94257e9212" memberName="m_cameraAutoRollEnable"
|
||||||
virtualName="" explicitFocusOrder="0" pos="216 192 150 24" tooltip="Camera Auto Roll"
|
virtualName="" explicitFocusOrder="0" pos="24 136 176 24" tooltip="Camera Auto Roll"
|
||||||
buttonText="Camera Auto Roll" connectedEdges="0" needsCallback="1"
|
buttonText="Camera Auto Roll" connectedEdges="0" needsCallback="1"
|
||||||
radioGroupId="0" state="0"/>
|
radioGroupId="0" state="0"/>
|
||||||
|
<TOGGLEBUTTON name="Camera Auto FlyToView" id="7c8f89a74ece3ccb" memberName="m_cameraAutoFlyToView"
|
||||||
|
virtualName="" explicitFocusOrder="0" pos="24 168 176 24" tooltip="Camera Auto FlyToView"
|
||||||
|
buttonText="Camera Auto FlyToView" connectedEdges="0" needsCallback="1"
|
||||||
|
radioGroupId="0" state="0"/>
|
||||||
|
<LABEL name="Camera Altitude" id="22b0982961c62c7f" memberName="m_labelCameraAltitude"
|
||||||
|
virtualName="" explicitFocusOrder="0" pos="176 32 88 24" tooltip="Camera Altitude in meter"
|
||||||
|
edTextCol="ff000000" edBkgCol="0" labelText="0" editableSingleClick="1"
|
||||||
|
editableDoubleClick="1" focusDiscardsChanges="0" fontname="Default font"
|
||||||
|
fontsize="15" bold="0" italic="0" justification="34"/>
|
||||||
|
<LABEL name="Camera Tilt" id="a2fedc79e61668d0" memberName="m_labelCameraTilt"
|
||||||
|
virtualName="" explicitFocusOrder="0" pos="176 64 88 24" tooltip="Camera Tilt in degrees"
|
||||||
|
edTextCol="ff000000" edBkgCol="0" labelText="0" editableSingleClick="1"
|
||||||
|
editableDoubleClick="1" focusDiscardsChanges="0" fontname="Default font"
|
||||||
|
fontsize="15" bold="0" italic="0" justification="34"/>
|
||||||
</JUCER_COMPONENT>
|
</JUCER_COMPONENT>
|
||||||
|
|
||||||
END_JUCER_METADATA
|
END_JUCER_METADATA
|
||||||
|
|||||||
@@ -41,12 +41,12 @@ class MainComponent : public Component,
|
|||||||
public IFsLinkListener,
|
public IFsLinkListener,
|
||||||
public ChangeListener,
|
public ChangeListener,
|
||||||
public SliderListener,
|
public SliderListener,
|
||||||
public ComboBoxListener,
|
public ButtonListener,
|
||||||
public ButtonListener
|
public LabelListener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
MainComponent (String const &homeDir);
|
MainComponent (String const &homeDir, String const &hostIp);
|
||||||
~MainComponent();
|
~MainComponent();
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
@@ -56,8 +56,8 @@ public:
|
|||||||
void paint (Graphics& g);
|
void paint (Graphics& g);
|
||||||
void resized();
|
void resized();
|
||||||
void sliderValueChanged (Slider* sliderThatWasMoved);
|
void sliderValueChanged (Slider* sliderThatWasMoved);
|
||||||
void comboBoxChanged (ComboBox* comboBoxThatHasChanged);
|
|
||||||
void buttonClicked (Button* buttonThatWasClicked);
|
void buttonClicked (Button* buttonThatWasClicked);
|
||||||
|
void labelTextChanged (Label* labelThatHasChanged);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -76,13 +76,13 @@ private:
|
|||||||
//==============================================================================
|
//==============================================================================
|
||||||
ScopedPointer<Label> m_fsuipcStatus;
|
ScopedPointer<Label> m_fsuipcStatus;
|
||||||
ScopedPointer<Label> m_flightStatus;
|
ScopedPointer<Label> m_flightStatus;
|
||||||
ScopedPointer<Slider> m_kmlUpdInterval_s;
|
|
||||||
ScopedPointer<ColourSelector> m_colorSelector;
|
|
||||||
ScopedPointer<ComboBox> m_altitudeMode;
|
|
||||||
ScopedPointer<Slider> m_cameraAltitude;
|
ScopedPointer<Slider> m_cameraAltitude;
|
||||||
ScopedPointer<Slider> m_CameraTilt;
|
ScopedPointer<Slider> m_CameraTilt;
|
||||||
ScopedPointer<ToggleButton> m_cameraAutoHeadingEnable;
|
ScopedPointer<ToggleButton> m_cameraAutoHeadingEnable;
|
||||||
ScopedPointer<ToggleButton> m_cameraAutoRollEnable;
|
ScopedPointer<ToggleButton> m_cameraAutoRollEnable;
|
||||||
|
ScopedPointer<ToggleButton> m_cameraAutoFlyToView;
|
||||||
|
ScopedPointer<Label> m_labelCameraAltitude;
|
||||||
|
ScopedPointer<Label> m_labelCameraTilt;
|
||||||
|
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user