- retrieving home dir and create FsTrack folder
- added adjustable KML update interval - prepared for .kmz git-svn-id: http://moon:8086/svn/software/trunk/projects/FsTrack@125 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
//[/MiscUserDefs]
|
||||
|
||||
//==============================================================================
|
||||
MainComponent::MainComponent ()
|
||||
MainComponent::MainComponent (String const &homeDir)
|
||||
{
|
||||
addAndMakeVisible (m_fsuipcStatus = new Label ("FSUIP Status",
|
||||
TRANS("Unknown")));
|
||||
@@ -45,6 +45,12 @@ MainComponent::MainComponent ()
|
||||
m_flightStatus->setColour (TextEditor::textColourId, Colours::black);
|
||||
m_flightStatus->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
|
||||
|
||||
addAndMakeVisible (m_kmlUpdInterval_s = new Slider ("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);
|
||||
|
||||
|
||||
//[UserPreSize]
|
||||
//[/UserPreSize]
|
||||
@@ -53,14 +59,21 @@ MainComponent::MainComponent ()
|
||||
|
||||
|
||||
//[Constructor] You can add your own custom stuff here..
|
||||
m_kml = new Kml("C:\\Users\\jens");
|
||||
static String workDir(homeDir + String("\\FsTrack"));
|
||||
|
||||
m_fsLink = new FsLink("C:\\Users\\jens");
|
||||
File file(workDir);
|
||||
file.createDirectory();
|
||||
|
||||
m_kml = new Kml(workDir.getCharPointer());
|
||||
|
||||
m_fsLink = new FsLink(workDir.getCharPointer());
|
||||
m_fsLink->addListener(this);
|
||||
m_fsLink->setKml(m_kml);
|
||||
|
||||
m_httpServer = new HttpServer("C:\\Users\\jens");
|
||||
m_httpServer = new HttpServer(5001, workDir.getCharPointer());
|
||||
m_httpServer->addListener(m_kml);
|
||||
|
||||
m_kmlUpdInterval_s->setValue(1.0, juce::NotificationType::sendNotification);
|
||||
//[/Constructor]
|
||||
}
|
||||
|
||||
@@ -71,6 +84,7 @@ MainComponent::~MainComponent()
|
||||
|
||||
m_fsuipcStatus = nullptr;
|
||||
m_flightStatus = nullptr;
|
||||
m_kmlUpdInterval_s = nullptr;
|
||||
|
||||
|
||||
//[Destructor]. You can add your own custom destruction code here..
|
||||
@@ -98,10 +112,27 @@ void MainComponent::resized()
|
||||
{
|
||||
m_fsuipcStatus->setBounds (16, 256, 150, 24);
|
||||
m_flightStatus->setBounds (216, 256, 150, 24);
|
||||
m_kmlUpdInterval_s->setBounds (16, 216, 184, 24);
|
||||
//[UserResized] Add your own custom resize handling here..
|
||||
//[/UserResized]
|
||||
}
|
||||
|
||||
void MainComponent::sliderValueChanged (Slider* sliderThatWasMoved)
|
||||
{
|
||||
//[UsersliderValueChanged_Pre]
|
||||
//[/UsersliderValueChanged_Pre]
|
||||
|
||||
if (sliderThatWasMoved == m_kmlUpdInterval_s)
|
||||
{
|
||||
//[UserSliderCode_m_kmlUpdInterval_s] -- add your slider handling code here..
|
||||
m_fsLink->setUpdateInterval(sliderThatWasMoved->getValue());
|
||||
//[/UserSliderCode_m_kmlUpdInterval_s]
|
||||
}
|
||||
|
||||
//[UsersliderValueChanged_Post]
|
||||
//[/UsersliderValueChanged_Post]
|
||||
}
|
||||
|
||||
|
||||
|
||||
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
|
||||
@@ -128,7 +159,7 @@ void MainComponent::onDataChanged(IFsLink &obj)
|
||||
BEGIN_JUCER_METADATA
|
||||
|
||||
<JUCER_COMPONENT documentType="Component" className="MainComponent" componentName=""
|
||||
parentClasses="public Component, public IFsLinkListener" constructorParams=""
|
||||
parentClasses="public Component, public IFsLinkListener" constructorParams="String const &homeDir"
|
||||
variableInitialisers="" snapPixels="8" snapActive="1" snapShown="1"
|
||||
overlayOpacity="0.330" fixedSize="1" initialWidth="400" initialHeight="300">
|
||||
<BACKGROUND backgroundColour="ffffffff"/>
|
||||
@@ -142,6 +173,10 @@ BEGIN_JUCER_METADATA
|
||||
edBkgCol="0" labelText="Unknown" editableSingleClick="0" editableDoubleClick="0"
|
||||
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
|
||||
bold="0" italic="0" justification="33"/>
|
||||
<SLIDER name="KML Update Interval" id="c4434642fabdd31c" memberName="m_kmlUpdInterval_s"
|
||||
virtualName="" explicitFocusOrder="0" pos="16 216 184 24" min="0.10000000000000001"
|
||||
max="10" int="0.10000000000000001" style="LinearHorizontal" textBoxPos="TextBoxLeft"
|
||||
textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
|
||||
</JUCER_COMPONENT>
|
||||
|
||||
END_JUCER_METADATA
|
||||
|
||||
Reference in New Issue
Block a user