- 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:
+158
-16
@@ -6,14 +6,27 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "FsLink.hpp"
|
#include "FsLink.hpp"
|
||||||
|
#include "memdump.h"
|
||||||
#define TWO_PWR_16 (65536.0)
|
#define TWO_PWR_16 (65536.0)
|
||||||
#define TWO_PWR_32 (TWO_PWR_16*TWO_PWR_16)
|
#define TWO_PWR_32 (TWO_PWR_16*TWO_PWR_16)
|
||||||
|
#ifdef FS_DEBUG
|
||||||
|
#define TIMER_INTEVAL_MS 1000
|
||||||
|
#else
|
||||||
#define TIMER_INTEVAL_MS 100
|
#define TIMER_INTEVAL_MS 100
|
||||||
|
#endif
|
||||||
const char* FsLink::linkStateString[] = {"Init", "Disconnected", "Connected", "Paused", "Recording"};
|
const char* FsLink::linkStateString[] = {"Init", "Disconnected", "Connected", "Paused", "Recording"};
|
||||||
const char* FsLink::flightStateString[] = {"Init", "Suspend", "Ground", "Take off", "Enroute", "Touch down"};
|
const char* FsLink::flightStateString[] = {"Init", "Suspend", "Ground", "Take off", "Enroute", "Touch down"};
|
||||||
|
|
||||||
|
typedef struct _DumpStatistics
|
||||||
|
{
|
||||||
|
bool isDynamic;
|
||||||
|
|
||||||
|
} DumpStatistics;
|
||||||
|
|
||||||
|
static DumpStatistics dumpStatistics[0x7800];
|
||||||
|
static uint8_t dumpStatisticsDataInitial[0x7800];
|
||||||
|
static uint8_t dumpStatisticsDataCurr[0x7800];
|
||||||
|
|
||||||
FsLink::FsLink(const char *pDocRoot)
|
FsLink::FsLink(const char *pDocRoot)
|
||||||
: m_docRoot(pDocRoot)
|
: m_docRoot(pDocRoot)
|
||||||
, m_pKml(nullptr)
|
, m_pKml(nullptr)
|
||||||
@@ -23,6 +36,8 @@ FsLink::FsLink(const char *pDocRoot)
|
|||||||
, m_flightStateNext(fs_suspend)
|
, m_flightStateNext(fs_suspend)
|
||||||
, m_kmlUpdateInterval(10)
|
, m_kmlUpdateInterval(10)
|
||||||
, m_kmlUpdateCount(0)
|
, m_kmlUpdateCount(0)
|
||||||
|
, m_dumpOffset(0)
|
||||||
|
, m_dumpLearnCount(0)
|
||||||
{
|
{
|
||||||
startTimer(TIMER_INTEVAL_MS);
|
startTimer(TIMER_INTEVAL_MS);
|
||||||
}
|
}
|
||||||
@@ -36,6 +51,97 @@ FsLink::~FsLink()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FsLink::setDumpOffset(uint32_t offset)
|
||||||
|
{
|
||||||
|
m_dumpOffset = offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FsLink::dump()
|
||||||
|
{
|
||||||
|
uint8_t dump[1024];
|
||||||
|
DWORD result;
|
||||||
|
|
||||||
|
printf("---------------------------------------------------\n");
|
||||||
|
FSUIPC_Read(m_dumpOffset, sizeof(dump), dump, &result);
|
||||||
|
if (result == FSUIPC_ERR_OK)
|
||||||
|
FSUIPC_Process(&result);
|
||||||
|
|
||||||
|
if (result == FSUIPC_ERR_OK)
|
||||||
|
{
|
||||||
|
memdump(dump, m_dumpOffset, 16, sizeof(dump));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void FsLink::statisticsLearnStart(uint32_t count)
|
||||||
|
{
|
||||||
|
DWORD result;
|
||||||
|
|
||||||
|
m_dumpLearnCount = count;
|
||||||
|
memset(dumpStatistics, 0, sizeof(dumpStatistics));
|
||||||
|
FSUIPC_Read(0, sizeof(dumpStatisticsDataInitial), dumpStatisticsDataInitial, &result);
|
||||||
|
if (result == FSUIPC_ERR_OK)
|
||||||
|
FSUIPC_Process(&result);
|
||||||
|
else
|
||||||
|
printf("%s: Problem FSUIPC_Read\n", __func__);
|
||||||
|
|
||||||
|
printf("Learning(%d) ", m_dumpLearnCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FsLink::statisticsLearn()
|
||||||
|
{
|
||||||
|
DWORD result;
|
||||||
|
if (m_dumpLearnCount)
|
||||||
|
{
|
||||||
|
FSUIPC_Read(0, sizeof(dumpStatisticsDataCurr), dumpStatisticsDataCurr, &result);
|
||||||
|
if (result == FSUIPC_ERR_OK)
|
||||||
|
FSUIPC_Process(&result);
|
||||||
|
else
|
||||||
|
printf("%s: Problem FSUIPC_Read\n", __func__);
|
||||||
|
|
||||||
|
for (uint32_t i=0; i < sizeof(dumpStatisticsDataInitial); i++)
|
||||||
|
{
|
||||||
|
if (dumpStatisticsDataInitial[i] != dumpStatisticsDataCurr[i])
|
||||||
|
{
|
||||||
|
dumpStatistics[i].isDynamic = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_dumpLearnCount--;
|
||||||
|
if (m_dumpLearnCount)
|
||||||
|
{
|
||||||
|
printf(".");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("done\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void FsLink::statisticsEval()
|
||||||
|
{
|
||||||
|
printf("---------------------------------------------------\n");
|
||||||
|
printf("Dump eval\n");
|
||||||
|
printf("---------------------------------------------------\n");
|
||||||
|
|
||||||
|
DWORD result;
|
||||||
|
FSUIPC_Read(0, sizeof(dumpStatisticsDataCurr), dumpStatisticsDataCurr, &result);
|
||||||
|
if (result == FSUIPC_ERR_OK)
|
||||||
|
FSUIPC_Process(&result);
|
||||||
|
else
|
||||||
|
printf("%s: Problem FSUIPC_Read\n", __func__);
|
||||||
|
|
||||||
|
for (uint32_t i=0; i < sizeof(dumpStatisticsDataCurr); i++)
|
||||||
|
{
|
||||||
|
if (dumpStatisticsDataInitial[i] != dumpStatisticsDataCurr[i])
|
||||||
|
{
|
||||||
|
if (!dumpStatistics[i].isDynamic)
|
||||||
|
{
|
||||||
|
printf("%08X : Initial=%02X, Current=%02X\n", i, dumpStatisticsDataInitial[i], dumpStatisticsDataCurr[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FsLink::addListener(IFsLinkListener *pListener)
|
void FsLink::addListener(IFsLinkListener *pListener)
|
||||||
{
|
{
|
||||||
m_listeners.add(pListener);
|
m_listeners.add(pListener);
|
||||||
@@ -92,9 +198,10 @@ int FsLink::gatherData()
|
|||||||
DWORD result;
|
DWORD result;
|
||||||
unsigned lat_lo, lon_lo, alt_lo;
|
unsigned lat_lo, lon_lo, alt_lo;
|
||||||
char lat[8], lon[8], alt[8], FSRdy2Fly, FSDialog;
|
char lat[8], lon[8], alt[8], FSRdy2Fly, FSDialog;
|
||||||
int lat_hi, lon_hi, alt_hi, radio_alt, bank, pitch, hdg_true, gs, tas, ias, bpa, vs, groundLevel, replay_active;
|
int lat_hi, lon_hi, alt_hi, radio_alt, bank, pitch, hdg_true, gs, tas, ias, bpa, vs, groundLevel;
|
||||||
short mag_var, parking_brake, paused, framerate, plane_on_ground;
|
short mag_var, parking_brake, paused, framerate, plane_on_ground;
|
||||||
|
short replay_active;
|
||||||
|
|
||||||
FSUIPC_Read(0x600C, sizeof(m_flightData.timeZulu), &m_flightData.timeZulu, &result);
|
FSUIPC_Read(0x600C, sizeof(m_flightData.timeZulu), &m_flightData.timeZulu, &result);
|
||||||
FSUIPC_Read(0x20, sizeof(groundLevel), &groundLevel, &result);
|
FSUIPC_Read(0x20, sizeof(groundLevel), &groundLevel, &result);
|
||||||
FSUIPC_Read(0x560, sizeof(lat), lat, &result);
|
FSUIPC_Read(0x560, sizeof(lat), lat, &result);
|
||||||
@@ -125,7 +232,7 @@ int FsLink::gatherData()
|
|||||||
FSUIPC_Read(0x3160, sizeof(m_flightData.atcAircraftTypeStr), m_flightData.atcAircraftTypeStr, &result);
|
FSUIPC_Read(0x3160, sizeof(m_flightData.atcAircraftTypeStr), m_flightData.atcAircraftTypeStr, &result);
|
||||||
FSUIPC_Read(0x366, sizeof(plane_on_ground), &plane_on_ground, &result);
|
FSUIPC_Read(0x366, sizeof(plane_on_ground), &plane_on_ground, &result);
|
||||||
FSUIPC_Read(0xBC8, sizeof(parking_brake), &parking_brake, &result);
|
FSUIPC_Read(0xBC8, sizeof(parking_brake), &parking_brake, &result);
|
||||||
FSUIPC_Read(0x628, sizeof(replay_active), &replay_active, &result);
|
FSUIPC_Read(0x11D4, sizeof(replay_active), &replay_active, &result);
|
||||||
FSUIPC_Process(&result);
|
FSUIPC_Process(&result);
|
||||||
|
|
||||||
if (result != FSUIPC_ERR_OK)
|
if (result != FSUIPC_ERR_OK)
|
||||||
@@ -169,13 +276,46 @@ int FsLink::gatherData()
|
|||||||
m_flightData.bpa_knots = (double)bpa/128.0; // knots
|
m_flightData.bpa_knots = (double)bpa/128.0; // knots
|
||||||
m_flightData.vs_feetPerMin = 100*(double)vs/128.0; // ft/min
|
m_flightData.vs_feetPerMin = 100*(double)vs/128.0; // ft/min
|
||||||
m_flightData.framerate = TWO_PWR_16/(2*framerate);
|
m_flightData.framerate = TWO_PWR_16/(2*framerate);
|
||||||
m_flightData.isFsReady = (FSRdy2Fly == 0);
|
m_flightData.isReady = (FSRdy2Fly == 0) && (FSDialog == 0);
|
||||||
m_flightData.isFsDialog = (FSDialog != 0);
|
m_flightData.isPaused = (paused != 0) && (replay_active != 0xFADE);
|
||||||
m_flightData.isPaused = (paused != 0);
|
|
||||||
m_flightData.isReplay = (replay_active != 0);
|
|
||||||
m_flightData.isParked = (parking_brake != 0);
|
m_flightData.isParked = (parking_brake != 0);
|
||||||
m_flightData.isOnGround = (plane_on_ground != 0);
|
m_flightData.isOnGround = (plane_on_ground != 0);
|
||||||
|
|
||||||
|
#ifdef FS_DEBUG
|
||||||
|
printf("\n");
|
||||||
|
printf("FSRdy2Fly = %08X\n", FSRdy2Fly);
|
||||||
|
printf("FSDialog = %08X\n", FSDialog);
|
||||||
|
printf("paused = %08X\n", paused);
|
||||||
|
printf("replay_active = %08X\n", replay_active);
|
||||||
|
printf("\n");
|
||||||
|
#endif
|
||||||
|
uint32_t x = (FSRdy2Fly == 0) << 3 | (FSDialog == 0) << 2 | (replay_active == 0xfade) << 1 | (paused == 0);
|
||||||
|
|
||||||
|
m_flightData.state = FlightData::State::STATE_INVALID;
|
||||||
|
switch(x)
|
||||||
|
{
|
||||||
|
case 0x0d:
|
||||||
|
m_flightData.state = FlightData::State::STATE_ACTIVE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x09:
|
||||||
|
case 0x0c:
|
||||||
|
m_flightData.state = FlightData::State::STATE_PAUSED;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x00:
|
||||||
|
case 0x05:
|
||||||
|
case 0x08:
|
||||||
|
m_flightData.state = FlightData::State::STATE_STOPPED;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
#ifdef FS_DEBUG
|
||||||
|
printf("State : 0x%02X\n", x);
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,10 +342,12 @@ void FsLink::timerCallback()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dump();
|
||||||
|
statisticsLearn();
|
||||||
switch(m_linkState)
|
switch(m_linkState)
|
||||||
{
|
{
|
||||||
case ls_connected:
|
case ls_connected:
|
||||||
if (!m_flightData.isFsDialog && m_flightData.isFsReady)
|
if (m_flightData.state == FlightData::State::STATE_ACTIVE)
|
||||||
{
|
{
|
||||||
m_pKml->updateFlightData(m_flightData);
|
m_pKml->updateFlightData(m_flightData);
|
||||||
if (m_pKml)
|
if (m_pKml)
|
||||||
@@ -217,13 +359,13 @@ void FsLink::timerCallback()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ls_recording:
|
case ls_recording:
|
||||||
if (m_flightData.isFsDialog && !m_flightData.isFsReady)
|
if (m_flightData.state == FlightData::State::STATE_STOPPED)
|
||||||
{
|
{
|
||||||
m_pKml->destroy();
|
m_pKml->destroy();
|
||||||
m_linkStateNext = ls_connected;
|
m_linkStateNext = ls_connected;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (m_flightData.isPaused || m_flightData.isReplay)
|
if (m_flightData.state == FlightData::State::STATE_PAUSED)
|
||||||
{
|
{
|
||||||
m_linkStateNext = ls_paused;
|
m_linkStateNext = ls_paused;
|
||||||
break;
|
break;
|
||||||
@@ -232,13 +374,13 @@ void FsLink::timerCallback()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ls_paused:
|
case ls_paused:
|
||||||
if (m_flightData.isFsDialog)
|
if (m_flightData.state == FlightData::State::STATE_STOPPED)
|
||||||
{
|
{
|
||||||
m_pKml->destroy();
|
m_pKml->destroy();
|
||||||
m_linkStateNext = ls_connected;
|
m_linkStateNext = ls_connected;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!(m_flightData.isPaused || m_flightData.isReplay))
|
if (m_flightData.state == FlightData::State::STATE_ACTIVE)
|
||||||
{
|
{
|
||||||
m_linkStateNext = ls_recording;
|
m_linkStateNext = ls_recording;
|
||||||
break;
|
break;
|
||||||
@@ -255,7 +397,7 @@ void FsLink::timerCallback()
|
|||||||
if (m_linkState == ls_disconnected)
|
if (m_linkState == ls_disconnected)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!m_flightData.isFsDialog && !m_flightData.isReplay)
|
if (m_flightData.isReady && !m_flightData.isPaused)
|
||||||
{
|
{
|
||||||
m_flightStateNext = fs_ground;
|
m_flightStateNext = fs_ground;
|
||||||
if (!m_flightData.isOnGround)
|
if (!m_flightData.isOnGround)
|
||||||
@@ -293,7 +435,7 @@ void FsLink::timerCallback()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Override flight states
|
// Override flight states
|
||||||
if (m_flightData.isFsDialog || m_flightData.isReplay)
|
if (!m_flightData.isReady || m_flightData.isPaused)
|
||||||
{
|
{
|
||||||
m_flightStateNext = fs_suspend;
|
m_flightStateNext = fs_suspend;
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-2
@@ -43,7 +43,12 @@ public:
|
|||||||
void addListener(IFsLinkListener *pListener);
|
void addListener(IFsLinkListener *pListener);
|
||||||
void setKml(IKml *pKml);
|
void setKml(IKml *pKml);
|
||||||
void setUpdateInterval(double seconds);
|
void setUpdateInterval(double seconds);
|
||||||
|
void setDumpOffset(uint32_t offset);
|
||||||
|
void dump();
|
||||||
|
void statisticsLearnStart(uint32_t count);
|
||||||
|
void statisticsLearn();
|
||||||
|
void statisticsEval();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ListenerList <IFsLinkListener> m_listeners;
|
ListenerList <IFsLinkListener> m_listeners;
|
||||||
const char *m_docRoot;
|
const char *m_docRoot;
|
||||||
@@ -55,10 +60,11 @@ private:
|
|||||||
FlightState m_flightStateNext;
|
FlightState m_flightStateNext;
|
||||||
int m_kmlUpdateInterval;
|
int m_kmlUpdateInterval;
|
||||||
int m_kmlUpdateCount;
|
int m_kmlUpdateCount;
|
||||||
|
uint32_t m_dumpOffset;
|
||||||
|
uint32_t m_dumpLearnCount;
|
||||||
char m_idStr[256];
|
char m_idStr[256];
|
||||||
char m_fsInstallPath[256];
|
char m_fsInstallPath[256];
|
||||||
FlightData m_flightData;
|
FlightData m_flightData;
|
||||||
|
|
||||||
static const char *linkStateString[];
|
static const char *linkStateString[];
|
||||||
static const char *flightStateString[];
|
static const char *flightStateString[];
|
||||||
|
|
||||||
|
|||||||
+13
-5
@@ -10,9 +10,18 @@
|
|||||||
|
|
||||||
struct FlightData
|
struct FlightData
|
||||||
{
|
{
|
||||||
|
enum State
|
||||||
|
{
|
||||||
|
STATE_INVALID = 0,
|
||||||
|
STATE_STOPPED,
|
||||||
|
STATE_PAUSED,
|
||||||
|
STATE_ACTIVE,
|
||||||
|
};
|
||||||
|
|
||||||
FlightData() {}
|
FlightData() {}
|
||||||
~FlightData() {}
|
~FlightData() {}
|
||||||
bool isFsReady, isFsDialog, isPaused, isParked, isOnGround, isReplay;
|
State state;
|
||||||
|
bool isReady, isPaused, isParked, isOnGround;
|
||||||
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;
|
||||||
double framerate;
|
double framerate;
|
||||||
@@ -24,15 +33,14 @@ struct FlightData
|
|||||||
char atcFlightIDStr[12];
|
char atcFlightIDStr[12];
|
||||||
char atcAirlineStr[24];
|
char atcAirlineStr[24];
|
||||||
char atcAircraftTypeStr[24];
|
char atcAircraftTypeStr[24];
|
||||||
|
|
||||||
const FlightData& operator=(const FlightData &rhs)
|
const FlightData& operator=(const FlightData &rhs)
|
||||||
{
|
{
|
||||||
isFsReady = rhs.isFsReady;
|
state = rhs.state;
|
||||||
isFsDialog = rhs.isFsDialog;
|
isReady = rhs.isReady;
|
||||||
isPaused = rhs.isPaused;
|
isPaused = rhs.isPaused;
|
||||||
isParked = rhs.isParked;
|
isParked = rhs.isParked;
|
||||||
isOnGround = rhs.isOnGround;
|
isOnGround = rhs.isOnGround;
|
||||||
isReplay = rhs.isReplay;
|
|
||||||
lat = rhs.lat;
|
lat = rhs.lat;
|
||||||
lon = rhs.lon;
|
lon = rhs.lon;
|
||||||
alt_meter = rhs.alt_meter;
|
alt_meter = rhs.alt_meter;
|
||||||
|
|||||||
@@ -202,7 +202,6 @@ XmlElement* Kml::createPlane()
|
|||||||
}
|
}
|
||||||
pName = pPlacemark->createNewChildElement("name");
|
pName = pPlacemark->createNewChildElement("name");
|
||||||
pName->addTextElement(temp_str);
|
pName->addTextElement(temp_str);
|
||||||
printf("%s\n", temp_str);
|
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
pDescr = pPlacemark->createNewChildElement("description");
|
pDescr = pPlacemark->createNewChildElement("description");
|
||||||
|
|||||||
@@ -102,8 +102,30 @@ MainComponent::MainComponent (String const &homeDir, String const &hostIp)
|
|||||||
m_labelAbout->setColour (TextEditor::textColourId, Colours::black);
|
m_labelAbout->setColour (TextEditor::textColourId, Colours::black);
|
||||||
m_labelAbout->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
|
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]
|
//[UserPreSize]
|
||||||
|
#ifndef FS_DEBUG
|
||||||
|
m_labelDumpOffset->setVisible(false);
|
||||||
|
m_textButtonStatisticsLearn->setVisible(false);
|
||||||
|
m_textButtonStatisticsEval->setVisible(false);
|
||||||
|
#endif
|
||||||
//[/UserPreSize]
|
//[/UserPreSize]
|
||||||
|
|
||||||
setSize (300, 300);
|
setSize (300, 300);
|
||||||
@@ -155,6 +177,9 @@ MainComponent::~MainComponent()
|
|||||||
m_labelCameraAltitude = nullptr;
|
m_labelCameraAltitude = nullptr;
|
||||||
m_labelCameraTilt = nullptr;
|
m_labelCameraTilt = nullptr;
|
||||||
m_labelAbout = nullptr;
|
m_labelAbout = nullptr;
|
||||||
|
m_labelDumpOffset = nullptr;
|
||||||
|
m_textButtonStatisticsLearn = nullptr;
|
||||||
|
m_textButtonStatisticsEval = nullptr;
|
||||||
|
|
||||||
|
|
||||||
//[Destructor]. You can add your own custom destruction code here..
|
//[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_labelCameraAltitude->setBounds (168, 32, 88, 24);
|
||||||
m_labelCameraTilt->setBounds (168, 64, 88, 24);
|
m_labelCameraTilt->setBounds (168, 64, 88, 24);
|
||||||
m_labelAbout->setBounds (272, 0, 24, 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] Add your own custom resize handling here..
|
||||||
//[/UserResized]
|
//[/UserResized]
|
||||||
}
|
}
|
||||||
@@ -248,6 +276,18 @@ void MainComponent::buttonClicked (Button* buttonThatWasClicked)
|
|||||||
m_kml->setCameraFlyToView(buttonThatWasClicked->getToggleState());
|
m_kml->setCameraFlyToView(buttonThatWasClicked->getToggleState());
|
||||||
//[/UserButtonCode_m_cameraAutoFlyToView]
|
//[/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]
|
||||||
//[/UserbuttonClicked_Post]
|
//[/UserbuttonClicked_Post]
|
||||||
@@ -276,6 +316,12 @@ void MainComponent::labelTextChanged (Label* labelThatHasChanged)
|
|||||||
m_CameraTilt->setValue(labelThatHasChanged->getText().getFloatValue());
|
m_CameraTilt->setValue(labelThatHasChanged->getText().getFloatValue());
|
||||||
//[/UserLabelCode_m_labelCameraTilt]
|
//[/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]
|
||||||
//[/UserlabelTextChanged_Post]
|
//[/UserlabelTextChanged_Post]
|
||||||
@@ -403,6 +449,17 @@ BEGIN_JUCER_METADATA
|
|||||||
edBkgCol="0" labelText="" editableSingleClick="0" editableDoubleClick="0"
|
edBkgCol="0" labelText="" editableSingleClick="0" editableDoubleClick="0"
|
||||||
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
|
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
|
||||||
bold="0" italic="0" justification="33"/>
|
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>
|
</JUCER_COMPONENT>
|
||||||
|
|
||||||
END_JUCER_METADATA
|
END_JUCER_METADATA
|
||||||
|
|||||||
@@ -84,6 +84,9 @@ private:
|
|||||||
ScopedPointer<Label> m_labelCameraAltitude;
|
ScopedPointer<Label> m_labelCameraAltitude;
|
||||||
ScopedPointer<Label> m_labelCameraTilt;
|
ScopedPointer<Label> m_labelCameraTilt;
|
||||||
ScopedPointer<Label> m_labelAbout;
|
ScopedPointer<Label> m_labelAbout;
|
||||||
|
ScopedPointer<Label> m_labelDumpOffset;
|
||||||
|
ScopedPointer<TextButton> m_textButtonStatisticsLearn;
|
||||||
|
ScopedPointer<TextButton> m_textButtonStatisticsEval;
|
||||||
|
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user