- added debug switch FS_DEBUG. With FS_DEBUG

- learn and eval Fs statistics
   - extra Gui element
   - lower Sample rate
- try to detect replay mode
- changes to FSM control


git-svn-id: http://moon:8086/svn/software/trunk/projects/FsTrack@188 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2015-02-04 19:54:13 +00:00
parent daefae6a5b
commit 23146c8733
6 changed files with 239 additions and 24 deletions
+57
View File
@@ -102,8 +102,30 @@ MainComponent::MainComponent (String const &homeDir, String const &hostIp)
m_labelAbout->setColour (TextEditor::textColourId, Colours::black);
m_labelAbout->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
addAndMakeVisible (m_labelDumpOffset = new Label ("Label Dump Offset",
TRANS("0")));
m_labelDumpOffset->setFont (Font (15.00f, Font::plain));
m_labelDumpOffset->setJustificationType (Justification::centredRight);
m_labelDumpOffset->setEditable (true, true, false);
m_labelDumpOffset->setColour (TextEditor::textColourId, Colours::black);
m_labelDumpOffset->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
m_labelDumpOffset->addListener (this);
addAndMakeVisible (m_textButtonStatisticsLearn = new TextButton ("Button StatisticsLearn"));
m_textButtonStatisticsLearn->setButtonText (TRANS("Learn"));
m_textButtonStatisticsLearn->addListener (this);
addAndMakeVisible (m_textButtonStatisticsEval = new TextButton ("Button StatisticsEval"));
m_textButtonStatisticsEval->setButtonText (TRANS("Eval"));
m_textButtonStatisticsEval->addListener (this);
//[UserPreSize]
#ifndef FS_DEBUG
m_labelDumpOffset->setVisible(false);
m_textButtonStatisticsLearn->setVisible(false);
m_textButtonStatisticsEval->setVisible(false);
#endif
//[/UserPreSize]
setSize (300, 300);
@@ -155,6 +177,9 @@ MainComponent::~MainComponent()
m_labelCameraAltitude = nullptr;
m_labelCameraTilt = nullptr;
m_labelAbout = nullptr;
m_labelDumpOffset = nullptr;
m_textButtonStatisticsLearn = nullptr;
m_textButtonStatisticsEval = nullptr;
//[Destructor]. You can add your own custom destruction code here..
@@ -197,6 +222,9 @@ void MainComponent::resized()
m_labelCameraAltitude->setBounds (168, 32, 88, 24);
m_labelCameraTilt->setBounds (168, 64, 88, 24);
m_labelAbout->setBounds (272, 0, 24, 24);
m_labelDumpOffset->setBounds (200, 112, 72, 24);
m_textButtonStatisticsLearn->setBounds (224, 144, 64, 24);
m_textButtonStatisticsEval->setBounds (224, 176, 64, 24);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
@@ -248,6 +276,18 @@ void MainComponent::buttonClicked (Button* buttonThatWasClicked)
m_kml->setCameraFlyToView(buttonThatWasClicked->getToggleState());
//[/UserButtonCode_m_cameraAutoFlyToView]
}
else if (buttonThatWasClicked == m_textButtonStatisticsLearn)
{
//[UserButtonCode_m_textButtonStatisticsLearn] -- add your button handler code here..
m_fsLink->statisticsLearnStart(m_labelDumpOffset->getText().getIntValue());
//[/UserButtonCode_m_textButtonStatisticsLearn]
}
else if (buttonThatWasClicked == m_textButtonStatisticsEval)
{
//[UserButtonCode_m_textButtonStatisticsEval] -- add your button handler code here..
m_fsLink->statisticsEval();
//[/UserButtonCode_m_textButtonStatisticsEval]
}
//[UserbuttonClicked_Post]
//[/UserbuttonClicked_Post]
@@ -276,6 +316,12 @@ void MainComponent::labelTextChanged (Label* labelThatHasChanged)
m_CameraTilt->setValue(labelThatHasChanged->getText().getFloatValue());
//[/UserLabelCode_m_labelCameraTilt]
}
else if (labelThatHasChanged == m_labelDumpOffset)
{
//[UserLabelCode_m_labelDumpOffset] -- add your label text handling code here..
m_fsLink->setDumpOffset(labelThatHasChanged->getText().getHexValue32());
//[/UserLabelCode_m_labelDumpOffset]
}
//[UserlabelTextChanged_Post]
//[/UserlabelTextChanged_Post]
@@ -403,6 +449,17 @@ BEGIN_JUCER_METADATA
edBkgCol="0" labelText="" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
bold="0" italic="0" justification="33"/>
<LABEL name="Label Dump Offset" id="8a8ce24b4c3ef02b" memberName="m_labelDumpOffset"
virtualName="" explicitFocusOrder="0" pos="200 112 72 24" edTextCol="ff000000"
edBkgCol="0" labelText="0" editableSingleClick="1" editableDoubleClick="1"
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
bold="0" italic="0" justification="34"/>
<TEXTBUTTON name="Button StatisticsLearn" id="11fb0e356e3867b1" memberName="m_textButtonStatisticsLearn"
virtualName="" explicitFocusOrder="0" pos="224 144 64 24" buttonText="Learn"
connectedEdges="0" needsCallback="1" radioGroupId="0"/>
<TEXTBUTTON name="Button StatisticsEval" id="6acf7f6a370fc3af" memberName="m_textButtonStatisticsEval"
virtualName="" explicitFocusOrder="0" pos="224 176 64 24" buttonText="Eval"
connectedEdges="0" needsCallback="1" radioGroupId="0"/>
</JUCER_COMPONENT>
END_JUCER_METADATA