- added Camera in NetworkLinkControl (need flyToView in Entry kml)
git-svn-id: http://moon:8086/svn/software/trunk/projects/FsTrack@127 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -81,7 +81,7 @@ void HttpServer::run()
|
|||||||
if (!pDoc)
|
if (!pDoc)
|
||||||
{
|
{
|
||||||
pDoc = docname;
|
pDoc = docname;
|
||||||
sprintf(docname, "%s\\FsTrack\\welcome.htm", m_docDir);
|
sprintf(docname, "%s\\welcome.htm", m_docDir);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
+29
-5
@@ -36,6 +36,9 @@ void Kml::create()
|
|||||||
destroy();
|
destroy();
|
||||||
|
|
||||||
kml = new XmlElement("kml");
|
kml = new XmlElement("kml");
|
||||||
|
XmlElement *pNetworkLinkControl = kml->createNewChildElement("NetworkLinkControl");
|
||||||
|
pNetworkLinkControl->createNewChildElement("LinkName")->addTextElement("FsTrack");
|
||||||
|
XmlElement *pCamera = pNetworkLinkControl->createNewChildElement("Camera");
|
||||||
XmlElement *pDoc = kml->createNewChildElement("Document");
|
XmlElement *pDoc = kml->createNewChildElement("Document");
|
||||||
XmlElement *pFile = kml->getChildByName("Document")->createNewChildElement("filename");
|
XmlElement *pFile = kml->getChildByName("Document")->createNewChildElement("filename");
|
||||||
XmlElement *pSnippet = kml->getChildByName("Document")->createNewChildElement("Snippet");
|
XmlElement *pSnippet = kml->getChildByName("Document")->createNewChildElement("Snippet");
|
||||||
@@ -52,7 +55,16 @@ void Kml::create()
|
|||||||
|
|
||||||
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);
|
||||||
pSnippet->addTextElement(time_str);
|
pSnippet->addTextElement(time_str);
|
||||||
|
|
||||||
|
// Camera
|
||||||
|
pCamera->createNewChildElement("longitude")->addTextElement("");
|
||||||
|
pCamera->createNewChildElement("latitude")->addTextElement("");
|
||||||
|
pCamera->createNewChildElement("altitude")->addTextElement("");
|
||||||
|
pCamera->createNewChildElement("heading")->addTextElement("");
|
||||||
|
pCamera->createNewChildElement("tilt")->addTextElement("");
|
||||||
|
pCamera->createNewChildElement("altitudeMode")->addTextElement("");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kml::destroy()
|
void Kml::destroy()
|
||||||
@@ -120,6 +132,9 @@ void Kml::updatePlane(FlightData const &flightData)
|
|||||||
XmlElement *pAltitudeMode;
|
XmlElement *pAltitudeMode;
|
||||||
XmlElement *pCoords;
|
XmlElement *pCoords;
|
||||||
|
|
||||||
|
XmlElement *pCamera;
|
||||||
|
XmlElement *pLookAt;
|
||||||
|
|
||||||
if(pPlacemark == NULL)
|
if(pPlacemark == NULL)
|
||||||
{
|
{
|
||||||
// Placemark
|
// Placemark
|
||||||
@@ -153,8 +168,7 @@ void Kml::updatePlane(FlightData const &flightData)
|
|||||||
// IconStyle
|
// IconStyle
|
||||||
pIconStyle = pStyle->createNewChildElement("IconStyle");
|
pIconStyle = pStyle->createNewChildElement("IconStyle");
|
||||||
pHeading = pIconStyle->createNewChildElement("heading");
|
pHeading = pIconStyle->createNewChildElement("heading");
|
||||||
sprintf(temp_str, "%d", (int)flightData.hdgTrue_deg);
|
pHeading->addTextElement(String(flightData.hdgTrue_deg));
|
||||||
pHeading->addTextElement(temp_str);
|
|
||||||
|
|
||||||
// Icon
|
// Icon
|
||||||
pIcon = pIconStyle->createNewChildElement("Icon");
|
pIcon = pIconStyle->createNewChildElement("Icon");
|
||||||
@@ -169,6 +183,7 @@ void Kml::updatePlane(FlightData const &flightData)
|
|||||||
|
|
||||||
// Point
|
// Point
|
||||||
pPoint = pPlacemark->createNewChildElement("Point");
|
pPoint = pPlacemark->createNewChildElement("Point");
|
||||||
|
pPoint->setAttribute("id", "Pointy");
|
||||||
pExtrude = pPoint->createNewChildElement("extrude");
|
pExtrude = pPoint->createNewChildElement("extrude");
|
||||||
pExtrude->addTextElement("1");
|
pExtrude->addTextElement("1");
|
||||||
pTesselate = pPoint->createNewChildElement("tesselate");
|
pTesselate = pPoint->createNewChildElement("tesselate");
|
||||||
@@ -189,14 +204,23 @@ void Kml::updatePlane(FlightData const &flightData)
|
|||||||
pDescr->getFirstChildElement()->setText(temp_str);
|
pDescr->getFirstChildElement()->setText(temp_str);
|
||||||
|
|
||||||
// Heading
|
// Heading
|
||||||
sprintf(temp_str, "%d", (int)flightData.hdgTrue_deg);
|
|
||||||
pHeading = pPlacemark->getChildByName("Style")->getChildByName("IconStyle")->getChildByName("heading");
|
pHeading = pPlacemark->getChildByName("Style")->getChildByName("IconStyle")->getChildByName("heading");
|
||||||
pHeading->getFirstChildElement()->setText(temp_str);
|
pHeading->getFirstChildElement()->setText(String(flightData.hdgTrue_deg));
|
||||||
|
|
||||||
// Coordinates
|
// Coordinates
|
||||||
sprintf(temp_str, "%9.6f,%9.6f,%9.6f", flightData.lon, flightData.lat, flightData.alt_meter);
|
sprintf(temp_str, "%9.6f,%9.6f,%9.6f", flightData.lon, flightData.lat, flightData.alt_meter);
|
||||||
pCoords = pPlacemark->getChildByName("Point")->getChildByName("coordinates");
|
pCoords = pPlacemark->getChildByName("Point")->getChildByName("coordinates");
|
||||||
pCoords->getFirstChildElement()->setText(temp_str);
|
pCoords->getFirstChildElement()->setText(temp_str);
|
||||||
|
|
||||||
|
// Camera
|
||||||
|
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));
|
||||||
|
pCamera->getChildByName("heading")->getFirstChildElement()->setText(String(flightData.hdgTrue_deg));
|
||||||
|
pCamera->getChildByName("tilt")->getFirstChildElement()->setText("90");
|
||||||
|
pCamera->getChildByName("altitudeMode")->getFirstChildElement()->setText(m_altitudeModeString);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-10
@@ -136,11 +136,11 @@ void MainComponent::paint (Graphics& g)
|
|||||||
|
|
||||||
void MainComponent::resized()
|
void MainComponent::resized()
|
||||||
{
|
{
|
||||||
m_fsuipcStatus->setBounds (16, 256, 150, 24);
|
m_fsuipcStatus->setBounds (16, 264, 150, 24);
|
||||||
m_flightStatus->setBounds (216, 256, 150, 24);
|
m_flightStatus->setBounds (216, 264, 150, 24);
|
||||||
m_kmlUpdInterval_s->setBounds (16, 216, 184, 24);
|
m_kmlUpdInterval_s->setBounds (16, 232, 184, 24);
|
||||||
m_colorSelector->setBounds (24, 32, 168, 152);
|
m_colorSelector->setBounds (24, 24, 168, 192);
|
||||||
m_altitudeMode->setBounds (216, 40, 160, 24);
|
m_altitudeMode->setBounds (216, 32, 160, 24);
|
||||||
//[UserResized] Add your own custom resize handling here..
|
//[UserResized] Add your own custom resize handling here..
|
||||||
//[/UserResized]
|
//[/UserResized]
|
||||||
}
|
}
|
||||||
@@ -219,25 +219,25 @@ BEGIN_JUCER_METADATA
|
|||||||
fixedSize="1" initialWidth="400" initialHeight="300">
|
fixedSize="1" initialWidth="400" initialHeight="300">
|
||||||
<BACKGROUND backgroundColour="ffffffff"/>
|
<BACKGROUND backgroundColour="ffffffff"/>
|
||||||
<LABEL name="FSUIP Status" id="a891503ff0f699d7" memberName="m_fsuipcStatus"
|
<LABEL name="FSUIP Status" id="a891503ff0f699d7" memberName="m_fsuipcStatus"
|
||||||
virtualName="" explicitFocusOrder="0" pos="16 256 150 24" tooltip="FSUIP Status"
|
virtualName="" explicitFocusOrder="0" pos="16 264 150 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 256 150 24" tooltip="Flight Status"
|
virtualName="" explicitFocusOrder="0" pos="216 264 150 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"
|
<SLIDER name="KML Update Interval" id="c4434642fabdd31c" memberName="m_kmlUpdInterval_s"
|
||||||
virtualName="" explicitFocusOrder="0" pos="16 216 184 24" tooltip="KML Update Interval"
|
virtualName="" explicitFocusOrder="0" pos="16 232 184 24" tooltip="KML Update Interval"
|
||||||
min="0.10000000000000001" max="10" int="0.10000000000000001"
|
min="0.10000000000000001" max="10" int="0.10000000000000001"
|
||||||
style="LinearHorizontal" textBoxPos="TextBoxLeft" textBoxEditable="1"
|
style="LinearHorizontal" textBoxPos="TextBoxLeft" textBoxEditable="1"
|
||||||
textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
|
textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
|
||||||
<GENERICCOMPONENT name="Color Selector" id="bccc8a8094997edb" memberName="m_colorSelector"
|
<GENERICCOMPONENT name="Color Selector" id="bccc8a8094997edb" memberName="m_colorSelector"
|
||||||
virtualName="" explicitFocusOrder="0" pos="24 32 168 152" class="ColourSelector"
|
virtualName="" explicitFocusOrder="0" pos="24 24 168 192" class="ColourSelector"
|
||||||
params=""/>
|
params=""/>
|
||||||
<COMBOBOX name="Altitude Mode" id="93006349fcf3e57a" memberName="m_altitudeMode"
|
<COMBOBOX name="Altitude Mode" id="93006349fcf3e57a" memberName="m_altitudeMode"
|
||||||
virtualName="" explicitFocusOrder="0" pos="216 40 160 24" tooltip="Altitude Mode"
|
virtualName="" explicitFocusOrder="0" pos="216 32 160 24" tooltip="Altitude Mode"
|
||||||
editable="0" layout="33" items="absolute relativeToGround clampToGround "
|
editable="0" layout="33" items="absolute relativeToGround clampToGround "
|
||||||
textWhenNonSelected="" textWhenNoItems="(no choices)"/>
|
textWhenNonSelected="" textWhenNoItems="(no choices)"/>
|
||||||
</JUCER_COMPONENT>
|
</JUCER_COMPONENT>
|
||||||
|
|||||||
Reference in New Issue
Block a user