- fixed flightstate in disconnected mode
- added heading to description git-svn-id: http://moon:8086/svn/software/trunk/projects/FsTrack@176 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+3
-1
@@ -252,6 +252,9 @@ void FsLink::timerCallback()
|
|||||||
switch(m_flightState)
|
switch(m_flightState)
|
||||||
{
|
{
|
||||||
case fs_suspend:
|
case fs_suspend:
|
||||||
|
if (m_linkState == ls_disconnected)
|
||||||
|
break;
|
||||||
|
|
||||||
if (!m_flightData.isFsDialog && !m_flightData.isReplay)
|
if (!m_flightData.isFsDialog && !m_flightData.isReplay)
|
||||||
{
|
{
|
||||||
m_flightStateNext = fs_ground;
|
m_flightStateNext = fs_ground;
|
||||||
@@ -311,7 +314,6 @@ void FsLink::timerCallback()
|
|||||||
m_listeners.call(&IFsLinkListener::onDataChanged, *this);
|
m_listeners.call(&IFsLinkListener::onDataChanged, *this);
|
||||||
|
|
||||||
m_pKml->updateFlightData(m_flightData);
|
m_pKml->updateFlightData(m_flightData);
|
||||||
// m_pKml->updatePlane(m_flightData);
|
|
||||||
if (m_kmlUpdateCount > 0)
|
if (m_kmlUpdateCount > 0)
|
||||||
{
|
{
|
||||||
m_kmlUpdateCount--;
|
m_kmlUpdateCount--;
|
||||||
|
|||||||
+1
-1
@@ -156,7 +156,7 @@ XmlElement* Kml::createPlane()
|
|||||||
|
|
||||||
// Description
|
// Description
|
||||||
pDescr = pPlacemark->createNewChildElement("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));
|
sprintf(temp_str, "Altitude: %d ft<br/>Ground speed: %d kts<br/>Heading: %d degrees", (int)(m_flightData.alt_feet+0.5), (int)(m_flightData.gs_knots+0.5), (int)(m_flightData.hdgTrue_deg+0.5));
|
||||||
pDescr->addTextElement(temp_str);
|
pDescr->addTextElement(temp_str);
|
||||||
|
|
||||||
// Style
|
// Style
|
||||||
|
|||||||
+62
-26
@@ -33,8 +33,9 @@ MainComponent::MainComponent (String const &homeDir, String const &hostIp)
|
|||||||
TRANS("Unknown")));
|
TRANS("Unknown")));
|
||||||
m_fsuipcStatus->setTooltip (TRANS("FSUIP Status"));
|
m_fsuipcStatus->setTooltip (TRANS("FSUIP Status"));
|
||||||
m_fsuipcStatus->setFont (Font (15.00f, Font::plain));
|
m_fsuipcStatus->setFont (Font (15.00f, Font::plain));
|
||||||
m_fsuipcStatus->setJustificationType (Justification::centredLeft);
|
m_fsuipcStatus->setJustificationType (Justification::centred);
|
||||||
m_fsuipcStatus->setEditable (false, false, false);
|
m_fsuipcStatus->setEditable (false, false, false);
|
||||||
|
m_fsuipcStatus->setColour (Label::backgroundColourId, Colour (0x00000000));
|
||||||
m_fsuipcStatus->setColour (TextEditor::textColourId, Colours::black);
|
m_fsuipcStatus->setColour (TextEditor::textColourId, Colours::black);
|
||||||
m_fsuipcStatus->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
|
m_fsuipcStatus->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
|
||||||
|
|
||||||
@@ -42,7 +43,7 @@ MainComponent::MainComponent (String const &homeDir, String const &hostIp)
|
|||||||
TRANS("Unknown")));
|
TRANS("Unknown")));
|
||||||
m_flightStatus->setTooltip (TRANS("Flight Status"));
|
m_flightStatus->setTooltip (TRANS("Flight Status"));
|
||||||
m_flightStatus->setFont (Font (15.00f, Font::plain));
|
m_flightStatus->setFont (Font (15.00f, Font::plain));
|
||||||
m_flightStatus->setJustificationType (Justification::centredLeft);
|
m_flightStatus->setJustificationType (Justification::centred);
|
||||||
m_flightStatus->setEditable (false, false, false);
|
m_flightStatus->setEditable (false, false, false);
|
||||||
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));
|
||||||
@@ -161,13 +162,13 @@ void MainComponent::paint (Graphics& g)
|
|||||||
g.setColour (Colours::black);
|
g.setColour (Colours::black);
|
||||||
g.setFont (Font (15.00f, Font::plain));
|
g.setFont (Font (15.00f, Font::plain));
|
||||||
g.drawText (TRANS("[m]"),
|
g.drawText (TRANS("[m]"),
|
||||||
265, 32, 23, 24,
|
257, 32, 23, 24,
|
||||||
Justification::centredLeft, true);
|
Justification::centredLeft, true);
|
||||||
|
|
||||||
g.setColour (Colours::black);
|
g.setColour (Colours::black);
|
||||||
g.setFont (Font (15.00f, Font::plain));
|
g.setFont (Font (15.00f, Font::plain));
|
||||||
g.drawText (CharPointer_UTF8 ("[\xc2\xb0]"),
|
g.drawText (CharPointer_UTF8 ("[\xc2\xb0]"),
|
||||||
265, 64, 23, 24,
|
257, 64, 23, 24,
|
||||||
Justification::centredLeft, true);
|
Justification::centredLeft, true);
|
||||||
|
|
||||||
//[UserPaint] Add your own custom painting code here..
|
//[UserPaint] Add your own custom painting code here..
|
||||||
@@ -176,15 +177,15 @@ void MainComponent::paint (Graphics& g)
|
|||||||
|
|
||||||
void MainComponent::resized()
|
void MainComponent::resized()
|
||||||
{
|
{
|
||||||
m_fsuipcStatus->setBounds (16, 256, 120, 24);
|
m_fsuipcStatus->setBounds (24, 232, 104, 40);
|
||||||
m_flightStatus->setBounds (160, 256, 120, 24);
|
m_flightStatus->setBounds (168, 232, 104, 40);
|
||||||
m_cameraAltitude->setBounds (24, 32, 144, 24);
|
m_cameraAltitude->setBounds (24, 32, 144, 24);
|
||||||
m_CameraTilt->setBounds (24, 64, 144, 24);
|
m_CameraTilt->setBounds (24, 64, 144, 24);
|
||||||
m_cameraAutoHeadingEnable->setBounds (24, 104, 176, 24);
|
m_cameraAutoHeadingEnable->setBounds (24, 112, 176, 24);
|
||||||
m_cameraAutoRollEnable->setBounds (24, 136, 176, 24);
|
m_cameraAutoRollEnable->setBounds (24, 144, 176, 24);
|
||||||
m_cameraAutoFlyToView->setBounds (24, 168, 176, 24);
|
m_cameraAutoFlyToView->setBounds (24, 176, 176, 24);
|
||||||
m_labelCameraAltitude->setBounds (176, 32, 88, 24);
|
m_labelCameraAltitude->setBounds (168, 32, 88, 24);
|
||||||
m_labelCameraTilt->setBounds (176, 64, 88, 24);
|
m_labelCameraTilt->setBounds (168, 64, 88, 24);
|
||||||
//[UserResized] Add your own custom resize handling here..
|
//[UserResized] Add your own custom resize handling here..
|
||||||
//[/UserResized]
|
//[/UserResized]
|
||||||
}
|
}
|
||||||
@@ -197,14 +198,14 @@ void MainComponent::sliderValueChanged (Slider* sliderThatWasMoved)
|
|||||||
if (sliderThatWasMoved == m_cameraAltitude)
|
if (sliderThatWasMoved == m_cameraAltitude)
|
||||||
{
|
{
|
||||||
//[UserSliderCode_m_cameraAltitude] -- add your slider handling code here..
|
//[UserSliderCode_m_cameraAltitude] -- add your slider handling code here..
|
||||||
String s = String((int)std::pow(10.0, sliderThatWasMoved->getValue()));
|
String s = String((int)(0.5+std::pow(10.0, sliderThatWasMoved->getValue())));
|
||||||
m_labelCameraAltitude->setText(s, juce::NotificationType::sendNotification);
|
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..
|
||||||
String s = String((int)sliderThatWasMoved->getValue());
|
String s = String((int)(0.5+sliderThatWasMoved->getValue()));
|
||||||
m_labelCameraTilt->setText(s, juce::NotificationType::sendNotification);
|
m_labelCameraTilt->setText(s, juce::NotificationType::sendNotification);
|
||||||
//[/UserSliderCode_m_CameraTilt]
|
//[/UserSliderCode_m_CameraTilt]
|
||||||
}
|
}
|
||||||
@@ -272,6 +273,41 @@ void MainComponent::onStateChanged(IFsLink &obj)
|
|||||||
{
|
{
|
||||||
m_fsuipcStatus->setText(obj.getLinkState(), juce::sendNotification);
|
m_fsuipcStatus->setText(obj.getLinkState(), juce::sendNotification);
|
||||||
m_flightStatus->setText(obj.getFlightState(), juce::sendNotification);
|
m_flightStatus->setText(obj.getFlightState(), juce::sendNotification);
|
||||||
|
|
||||||
|
Colour c = juce::Colours::red;
|
||||||
|
float alpha = 0.5f;
|
||||||
|
if (String(obj.getLinkState()) == String("Connected"))
|
||||||
|
{
|
||||||
|
c = juce::Colours::blue;
|
||||||
|
}
|
||||||
|
else if (String(obj.getLinkState()) == String("Paused"))
|
||||||
|
{
|
||||||
|
c = juce::Colours::orange;
|
||||||
|
}
|
||||||
|
else if (String(obj.getLinkState()) == String("Recording"))
|
||||||
|
{
|
||||||
|
c = juce::Colours::limegreen;
|
||||||
|
}
|
||||||
|
m_fsuipcStatus->setColour (Label::backgroundColourId, c.withAlpha(alpha));
|
||||||
|
|
||||||
|
c = juce::Colours::red;
|
||||||
|
if (String(obj.getFlightState()) == String("Ground"))
|
||||||
|
{
|
||||||
|
c = juce::Colours::brown;
|
||||||
|
}
|
||||||
|
else if (String(obj.getFlightState()) == String("Touch down"))
|
||||||
|
{
|
||||||
|
c = juce::Colours::brown;
|
||||||
|
}
|
||||||
|
else if (String(obj.getFlightState()) == String("Take off"))
|
||||||
|
{
|
||||||
|
c = juce::Colours::skyblue;
|
||||||
|
}
|
||||||
|
else if (String(obj.getFlightState()) == String("Enroute"))
|
||||||
|
{
|
||||||
|
c = juce::Colours::skyblue;
|
||||||
|
}
|
||||||
|
m_flightStatus->setColour (Label::backgroundColourId, c.withAlpha(alpha));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainComponent::onDataChanged(IFsLink &obj)
|
void MainComponent::onDataChanged(IFsLink &obj)
|
||||||
@@ -301,21 +337,21 @@ BEGIN_JUCER_METADATA
|
|||||||
variableInitialisers="" snapPixels="8" snapActive="1" snapShown="1"
|
variableInitialisers="" snapPixels="8" snapActive="1" snapShown="1"
|
||||||
overlayOpacity="0.330" fixedSize="1" initialWidth="300" 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]"
|
<TEXT pos="257 32 23 24" fill="solid: ff000000" hasStroke="0" text="[m]"
|
||||||
fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
|
fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
|
||||||
<TEXT pos="265 64 23 24" fill="solid: ff000000" hasStroke="0" text="[°]"
|
<TEXT pos="257 64 23 24" fill="solid: ff000000" hasStroke="0" text="[°]"
|
||||||
fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
|
fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/>
|
||||||
</BACKGROUND>
|
</BACKGROUND>
|
||||||
<LABEL name="FSUIP Status" id="a891503ff0f699d7" memberName="m_fsuipcStatus"
|
<LABEL name="FSUIP Status" id="a891503ff0f699d7" memberName="m_fsuipcStatus"
|
||||||
virtualName="" explicitFocusOrder="0" pos="16 256 120 24" tooltip="FSUIP Status"
|
virtualName="" explicitFocusOrder="0" pos="24 232 104 40" tooltip="FSUIP Status"
|
||||||
edTextCol="ff000000" edBkgCol="0" labelText="Unknown" editableSingleClick="0"
|
bkgCol="0" edTextCol="ff000000" edBkgCol="0" labelText="Unknown"
|
||||||
editableDoubleClick="0" focusDiscardsChanges="0" fontname="Default font"
|
editableSingleClick="0" editableDoubleClick="0" focusDiscardsChanges="0"
|
||||||
fontsize="15" bold="0" italic="0" justification="33"/>
|
fontname="Default font" fontsize="15" bold="0" italic="0" justification="36"/>
|
||||||
<LABEL name="Flight Status" id="2a046c84c0638c1f" memberName="m_flightStatus"
|
<LABEL name="Flight Status" id="2a046c84c0638c1f" memberName="m_flightStatus"
|
||||||
virtualName="" explicitFocusOrder="0" pos="160 256 120 24" tooltip="Flight Status"
|
virtualName="" explicitFocusOrder="0" pos="168 232 104 40" 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="36"/>
|
||||||
<SLIDER name="Camera Altitude" id="3352cbc6aebbcc9e" memberName="m_cameraAltitude"
|
<SLIDER name="Camera Altitude" id="3352cbc6aebbcc9e" memberName="m_cameraAltitude"
|
||||||
virtualName="" explicitFocusOrder="0" pos="24 32 144 24" tooltip="Camera Altitude"
|
virtualName="" explicitFocusOrder="0" pos="24 32 144 24" tooltip="Camera Altitude"
|
||||||
min="0.10000000000000001" max="7" int="0.01" style="LinearHorizontal"
|
min="0.10000000000000001" max="7" int="0.01" style="LinearHorizontal"
|
||||||
@@ -326,24 +362,24 @@ BEGIN_JUCER_METADATA
|
|||||||
min="0" max="90" int="5" style="LinearHorizontal" textBoxPos="NoTextBox"
|
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="24 104 176 24" tooltip="Camera Auto Heading"
|
virtualName="" explicitFocusOrder="0" pos="24 112 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="24 136 176 24" tooltip="Camera Auto Roll"
|
virtualName="" explicitFocusOrder="0" pos="24 144 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"
|
<TOGGLEBUTTON name="Camera Auto FlyToView" id="7c8f89a74ece3ccb" memberName="m_cameraAutoFlyToView"
|
||||||
virtualName="" explicitFocusOrder="0" pos="24 168 176 24" tooltip="Camera Auto FlyToView"
|
virtualName="" explicitFocusOrder="0" pos="24 176 176 24" tooltip="Camera Auto FlyToView"
|
||||||
buttonText="Camera Auto FlyToView" connectedEdges="0" needsCallback="1"
|
buttonText="Camera Auto FlyToView" connectedEdges="0" needsCallback="1"
|
||||||
radioGroupId="0" state="0"/>
|
radioGroupId="0" state="0"/>
|
||||||
<LABEL name="Camera Altitude" id="22b0982961c62c7f" memberName="m_labelCameraAltitude"
|
<LABEL name="Camera Altitude" id="22b0982961c62c7f" memberName="m_labelCameraAltitude"
|
||||||
virtualName="" explicitFocusOrder="0" pos="176 32 88 24" tooltip="Camera Altitude in meter"
|
virtualName="" explicitFocusOrder="0" pos="168 32 88 24" tooltip="Camera Altitude in meter"
|
||||||
edTextCol="ff000000" edBkgCol="0" labelText="0" editableSingleClick="1"
|
edTextCol="ff000000" edBkgCol="0" labelText="0" editableSingleClick="1"
|
||||||
editableDoubleClick="1" focusDiscardsChanges="0" fontname="Default font"
|
editableDoubleClick="1" focusDiscardsChanges="0" fontname="Default font"
|
||||||
fontsize="15" bold="0" italic="0" justification="34"/>
|
fontsize="15" bold="0" italic="0" justification="34"/>
|
||||||
<LABEL name="Camera Tilt" id="a2fedc79e61668d0" memberName="m_labelCameraTilt"
|
<LABEL name="Camera Tilt" id="a2fedc79e61668d0" memberName="m_labelCameraTilt"
|
||||||
virtualName="" explicitFocusOrder="0" pos="176 64 88 24" tooltip="Camera Tilt in degrees"
|
virtualName="" explicitFocusOrder="0" pos="168 64 88 24" tooltip="Camera Tilt in degrees"
|
||||||
edTextCol="ff000000" edBkgCol="0" labelText="0" editableSingleClick="1"
|
edTextCol="ff000000" edBkgCol="0" labelText="0" editableSingleClick="1"
|
||||||
editableDoubleClick="1" focusDiscardsChanges="0" fontname="Default font"
|
editableDoubleClick="1" focusDiscardsChanges="0" fontname="Default font"
|
||||||
fontsize="15" bold="0" italic="0" justification="34"/>
|
fontsize="15" bold="0" italic="0" justification="34"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user