You can subscribe to this list here.
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(28) |
Nov
(193) |
Dec
(199) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2011 |
Jan
(214) |
Feb
(133) |
Mar
(81) |
Apr
(67) |
May
(101) |
Jun
(141) |
Jul
(134) |
Aug
(168) |
Sep
(153) |
Oct
(200) |
Nov
(137) |
Dec
(185) |
| 2012 |
Jan
(168) |
Feb
(153) |
Mar
(155) |
Apr
(183) |
May
(145) |
Jun
(166) |
Jul
(264) |
Aug
(285) |
Sep
(247) |
Oct
(108) |
Nov
(224) |
Dec
(193) |
| 2013 |
Jan
(173) |
Feb
(161) |
Mar
(205) |
Apr
(86) |
May
(81) |
Jun
(115) |
Jul
(115) |
Aug
(89) |
Sep
(83) |
Oct
(155) |
Nov
(123) |
Dec
(111) |
| 2014 |
Jan
(152) |
Feb
(180) |
Mar
(184) |
Apr
(106) |
May
(106) |
Jun
(144) |
Jul
(95) |
Aug
(109) |
Sep
(75) |
Oct
(75) |
Nov
(90) |
Dec
(64) |
| 2015 |
Jan
(59) |
Feb
(114) |
Mar
(64) |
Apr
(73) |
May
(113) |
Jun
(129) |
Jul
(127) |
Aug
(150) |
Sep
(127) |
Oct
(77) |
Nov
(178) |
Dec
(98) |
| 2016 |
Jan
(154) |
Feb
(151) |
Mar
(128) |
Apr
(62) |
May
(185) |
Jun
(120) |
Jul
(105) |
Aug
(91) |
Sep
(90) |
Oct
(165) |
Nov
(299) |
Dec
(203) |
| 2017 |
Jan
(184) |
Feb
(187) |
Mar
(209) |
Apr
(142) |
May
(189) |
Jun
(96) |
Jul
(54) |
Aug
(79) |
Sep
(151) |
Oct
(77) |
Nov
(142) |
Dec
(142) |
| 2018 |
Jan
(194) |
Feb
(175) |
Mar
(111) |
Apr
(85) |
May
(114) |
Jun
(205) |
Jul
(159) |
Aug
(102) |
Sep
(238) |
Oct
(179) |
Nov
(92) |
Dec
(76) |
| 2019 |
Jan
(199) |
Feb
(85) |
Mar
(100) |
Apr
(118) |
May
(80) |
Jun
(69) |
Jul
(91) |
Aug
(91) |
Sep
(137) |
Oct
(59) |
Nov
(82) |
Dec
(70) |
| 2020 |
Jan
(56) |
Feb
(70) |
Mar
(258) |
Apr
(385) |
May
(249) |
Jun
(344) |
Jul
(169) |
Aug
(362) |
Sep
(185) |
Oct
(416) |
Nov
(465) |
Dec
(267) |
| 2021 |
Jan
(279) |
Feb
(312) |
Mar
(378) |
Apr
(230) |
May
(150) |
Jun
(229) |
Jul
(358) |
Aug
(184) |
Sep
(155) |
Oct
(67) |
Nov
(98) |
Dec
(240) |
| 2022 |
Jan
(231) |
Feb
(215) |
Mar
(206) |
Apr
(144) |
May
(71) |
Jun
(18) |
Jul
(27) |
Aug
(66) |
Sep
(95) |
Oct
(65) |
Nov
(95) |
Dec
(76) |
| 2023 |
Jan
(149) |
Feb
(70) |
Mar
(84) |
Apr
(116) |
May
(218) |
Jun
(22) |
Jul
(15) |
Aug
(33) |
Sep
(93) |
Oct
(65) |
Nov
(43) |
Dec
(51) |
| 2024 |
Jan
(87) |
Feb
(84) |
Mar
(64) |
Apr
(33) |
May
(27) |
Jun
(107) |
Jul
(12) |
Aug
(16) |
Sep
(94) |
Oct
(472) |
Nov
(344) |
Dec
(185) |
| 2025 |
Jan
(244) |
Feb
(110) |
Mar
(135) |
Apr
(46) |
May
(50) |
Jun
(73) |
Jul
(74) |
Aug
(63) |
Sep
(55) |
Oct
(82) |
Nov
(39) |
Dec
(22) |
| 2026 |
Jan
(58) |
Feb
(47) |
Mar
(63) |
Apr
(89) |
May
(13) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <fli...@li...> - 2026-05-14 15:56:26
|
unknown user pushed a commit to branch next
in repository simgear.
The following commit(s) were added to refs/heads/next by this push:
new 4f44cdd4 CI: use the C.UTF-8 locale
4f44cdd4 is described below
SF URL: http://sourceforge.net/p/flightgear/simgear/ci/4f44cdd461cd3a6f1c8956e4f1f764054b0ee4d0/
Commit: 4f44cdd461cd3a6f1c8956e4f1f764054b0ee4d0
Author: Florent Rougon
Committer: Florent Rougon
AuthorDate: Thu May 14 14:40:03 2026 +0200
CI: use the C.UTF-8 locale
This is for consistency with FlightGear (cf. [1]).
[1] https://gitlab.com/flightgear/flightgear/-/merge_requests/511
---
.gitlab-ci.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 57f90e45..1d35723f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,6 +10,7 @@ spec:
---
variables:
+ LC_CTYPE: C.UTF-8
BUILD_DIR: "$CI_PROJECT_DIR/build"
PREFIX_DIR: "$CI_PROJECT_DIR/simgear-dist"
# create a root dir *above* the Simgear checkout, otherwise CMake
|
|
From: <fli...@li...> - 2026-05-13 15:56:26
|
unknown user pushed a commit to branch next
in repository flightgear.
The following commit(s) were added to refs/heads/next by this push:
new 496c54857 Expose FGInputDevice to Nasal
496c54857 is described below
SF URL: http://sourceforge.net/p/flightgear/flightgear/ci/496c5485718384fba9918b28607b2804b42389b6/
Commit: 496c5485718384fba9918b28607b2804b42389b6
Author: James Turner
Committer: James Turner
AuthorDate: Wed May 13 14:43:40 2026 +0100
Expose FGInputDevice to Nasal
---
src/Autopilot/route_mgr.cxx | 290 ++++++++++---------
src/Input/FGEventInput.cxx | 11 +-
src/Input/FGEventInput.hxx | 4 +-
src/Input/FGHIDDevice.hxx | 3 +-
src/Input/FGHIDUsage.cxx | 26 +-
src/Input/FGInputDevice.cxx | 124 +++++++-
src/Input/FGInputDevice.hxx | 11 +-
src/Input/FGLinuxEventInput.cxx | 2 +-
src/Input/FGLinuxEventInput.hxx | 3 +-
src/Input/FGReportSetting.cxx | 10 +-
src/Input/FGReportSetting.hxx | 2 +-
src/Scripting/CMakeLists.txt | 2 +
src/Scripting/NasalInput.cxx | 84 ++++++
src/Scripting/NasalInput.hxx | 10 +
src/Scripting/NasalSys.cxx | 25 +-
test_suite/CMakeLists.txt | 5 +-
test_suite/FGTestApi/testGlobals.cxx | 4 +
test_suite/unit_tests/Input/test_inputDevice.cxx | 342 ++++++++++++++++++++++-
test_suite/unit_tests/Input/test_inputDevice.hxx | 8 +
test_suite/unit_tests/Navaids/test_fpNasal.cxx | 2 +
20 files changed, 763 insertions(+), 205 deletions(-)
diff --git a/src/Autopilot/route_mgr.cxx b/src/Autopilot/route_mgr.cxx
index 368fecbde..6516a7f43 100644
--- a/src/Autopilot/route_mgr.cxx
+++ b/src/Autopilot/route_mgr.cxx
@@ -77,7 +77,7 @@ static bool commandActivateFlightPlan(const SGPropertyNode* arg, SGPropertyNode
} else {
self->deactivate();
}
-
+
return true;
}
@@ -95,7 +95,7 @@ static bool commandSetActiveWaypt(const SGPropertyNode* arg, SGPropertyNode *)
if ((index < 0) || (index >= self->numLegs())) {
return false;
}
-
+
self->jumpToIndex(index);
return true;
}
@@ -118,7 +118,7 @@ static bool commandInsertWaypt(const SGPropertyNode* arg, SGPropertyNode *)
pos = SGGeod::fromDeg(arg->getDoubleValue("longitude-deg"),
arg->getDoubleValue("latitude-deg"));
}
-
+
if (arg->hasChild("navaid")) {
if (!pos.isValid()) {
pos = self->flightPlan()->vicinityForInsertIndex(haveIndex ? index : -1 /* append */);
@@ -140,18 +140,17 @@ static bool commandInsertWaypt(const SGPropertyNode* arg, SGPropertyNode *)
SG_LOG( SG_AUTOPILOT, SG_INFO, "Unable to find FGPositioned with ident:" << arg->getStringValue("navaid[1]"));
return false;
}
-
+
double r1 = arg->getDoubleValue("radial"),
r2 = arg->getDoubleValue("radial[1]");
-
+
SGGeod intersection;
bool ok = SGGeodesy::radialIntersection(p->geod(), r1, p2->geod(), r2, intersection);
if (!ok) {
- SG_LOG(SG_AUTOPILOT, SG_INFO, "no valid intersection for:" << p->ident()
- << "," << p2->ident());
- return false;
+ SG_LOG(SG_AUTOPILOT, SG_INFO, "no valid intersection for:" << p->ident() << "," << p2->ident());
+ return false;
}
-
+
std::string name = p->ident() + "-" + p2->ident();
wp = new BasicWaypt(intersection, name, NULL);
} else if (arg->hasChild("offset-nm") && arg->hasChild("radial")) {
@@ -169,13 +168,13 @@ static bool commandInsertWaypt(const SGPropertyNode* arg, SGPropertyNode *)
SG_LOG(SG_AUTOPILOT, SG_INFO, "no such airport" << arg->getStringValue("airport"));
return false;
}
-
+
if (arg->hasChild("runway")) {
if (!apt->hasRunwayWithIdent(arg->getStringValue("runway"))) {
SG_LOG(SG_AUTOPILOT, SG_INFO, "No runway: " << arg->getStringValue("runway") << " at " << apt->ident());
return false;
}
-
+
FGRunway* runway = apt->getRunwayByIdent(arg->getStringValue("runway"));
wp = new RunwayWaypt(runway, NULL);
} else {
@@ -206,11 +205,11 @@ static bool commandInsertWaypt(const SGPropertyNode* arg, SGPropertyNode *)
if (alt >= 0) {
leg->setAltitude(RESTRICT_AT, alt);
}
-
+
if (ias > 0) {
leg->setSpeed(RESTRICT_AT, ias);
}
-
+
return true;
}
@@ -231,11 +230,11 @@ FGRouteMgr::FGRouteMgr() :
listener = new InputListener(this);
input->setStringValue("");
input->addChangeListener(listener);
-
+
SGCommandMgr* cmdMgr = globals->get_commands();
cmdMgr->addCommand("define-user-waypoint", this, &FGRouteMgr::commandDefineUserWaypoint);
cmdMgr->addCommand("delete-user-waypoint", this, &FGRouteMgr::commandDeleteUserWaypoint);
-
+
cmdMgr->addCommand("load-flightplan", commandLoadFlightPlan);
cmdMgr->addCommand("save-flightplan", commandSaveFlightPlan);
cmdMgr->addCommand("activate-flightplan", commandActivateFlightPlan);
@@ -250,7 +249,7 @@ FGRouteMgr::~FGRouteMgr()
{
input->removeChangeListener(listener);
delete listener;
-
+
if (_plan) {
_plan->removeDelegate(this);
}
@@ -270,46 +269,46 @@ FGRouteMgr::~FGRouteMgr()
void FGRouteMgr::init() {
SGPropertyNode_ptr rm(fgGetNode(RM));
-
+
magvar = fgGetNode("/environment/magnetic-variation-deg", true);
-
+
departure = fgGetNode(RM "departure", true);
- departure->tie("airport", SGStringValueMethods<FGRouteMgr>(*this,
- &FGRouteMgr::getDepartureICAO, &FGRouteMgr::setDepartureICAO));
- departure->tie("runway", SGStringValueMethods<FGRouteMgr>(*this,
+ departure->tie("airport", SGStringValueMethods<FGRouteMgr>(*this,
+ &FGRouteMgr::getDepartureICAO, &FGRouteMgr::setDepartureICAO));
+ departure->tie("runway", SGStringValueMethods<FGRouteMgr>(*this,
&FGRouteMgr::getDepartureRunway,
&FGRouteMgr::setDepartureRunway));
- departure->tie("sid", SGStringValueMethods<FGRouteMgr>(*this,
+ departure->tie("sid", SGStringValueMethods<FGRouteMgr>(*this,
&FGRouteMgr::getSID,
&FGRouteMgr::setSID));
-
- departure->tie("name", SGStringValueMethods<FGRouteMgr>(*this,
- &FGRouteMgr::getDepartureName, nullptr));
- departure->tie("field-elevation-ft", SGRawValueMethods<FGRouteMgr, double>(*this,
+
+ departure->tie("name", SGStringValueMethods<FGRouteMgr>(*this,
+ &FGRouteMgr::getDepartureName, nullptr));
+ departure->tie("field-elevation-ft", SGRawValueMethods<FGRouteMgr, double>(*this,
&FGRouteMgr::getDepartureFieldElevation, nullptr));
departure->getChild("etd", 0, true);
departure->getChild("takeoff-time", 0, true);
destination = fgGetNode(RM "destination", true);
destination->getChild("airport", 0, true);
-
- destination->tie("airport", SGStringValueMethods<FGRouteMgr>(*this,
- &FGRouteMgr::getDestinationICAO, &FGRouteMgr::setDestinationICAO));
- destination->tie("runway", SGStringValueMethods<FGRouteMgr>(*this,
- &FGRouteMgr::getDestinationRunway,
- &FGRouteMgr::setDestinationRunway));
- destination->tie("star", SGStringValueMethods<FGRouteMgr>(*this,
+
+ destination->tie("airport", SGStringValueMethods<FGRouteMgr>(*this,
+ &FGRouteMgr::getDestinationICAO, &FGRouteMgr::setDestinationICAO));
+ destination->tie("runway", SGStringValueMethods<FGRouteMgr>(*this,
+ &FGRouteMgr::getDestinationRunway,
+ &FGRouteMgr::setDestinationRunway));
+ destination->tie("star", SGStringValueMethods<FGRouteMgr>(*this,
&FGRouteMgr::getSTAR,
&FGRouteMgr::setSTAR));
- destination->tie("approach", SGStringValueMethods<FGRouteMgr>(*this,
+ destination->tie("approach", SGStringValueMethods<FGRouteMgr>(*this,
&FGRouteMgr::getApproach,
&FGRouteMgr::setApproach));
-
- destination->tie("name", SGStringValueMethods<FGRouteMgr>(*this,
- &FGRouteMgr::getDestinationName, nullptr));
- destination->tie("field-elevation-ft", SGRawValueMethods<FGRouteMgr, double>(*this,
- &FGRouteMgr::getDestinationFieldElevation, nullptr));
-
+
+ destination->tie("name", SGStringValueMethods<FGRouteMgr>(*this,
+ &FGRouteMgr::getDestinationName, nullptr));
+ destination->tie("field-elevation-ft", SGRawValueMethods<FGRouteMgr, double>(*this,
+ &FGRouteMgr::getDestinationFieldElevation, nullptr));
+
destination->getChild("eta", 0, true);
destination->getChild("eta-seconds", 0, true);
destination->getChild("touchdown-time", 0, true);
@@ -339,19 +338,19 @@ void FGRouteMgr::init() {
totalDistance->setDoubleValue(0.0);
distanceToGo = fgGetNode(RM "distance-remaining-nm", true);
distanceToGo->setDoubleValue(0.0);
-
+
ete = fgGetNode(RM "ete", true);
ete->setDoubleValue(0.0);
-
+
elapsedFlightTime = fgGetNode(RM "flight-time", true);
elapsedFlightTime->setDoubleValue(0.0);
-
+
active = fgGetNode(RM "active", true);
active->setBoolValue(false);
-
+
airborne = fgGetNode(RM "airborne", true);
airborne->setBoolValue(false);
-
+
_edited = fgGetNode(RM "signals/edited", true);
_flightplanChanged = fgGetNode(RM "signals/flightplan-changed", true);
_isRoute = fgGetNode(RM "is-route", true);
@@ -360,25 +359,25 @@ void FGRouteMgr::init() {
_currentWpt->setAttribute(SGPropertyNode::LISTENER_SAFE, true);
_currentWpt->tie(SGRawValueMethods<FGRouteMgr, int>
(*this, &FGRouteMgr::currentIndex, &FGRouteMgr::jumpToIndex));
-
+
wp0 = fgGetNode(RM "wp", 0, true);
wp0->getChild("id", 0, true);
wp0->getChild("dist", 0, true);
wp0->getChild("eta", 0, true);
wp0->getChild("eta-seconds", 0, true);
wp0->getChild("bearing-deg", 0, true);
-
+
wp1 = fgGetNode(RM "wp", 1, true);
wp1->getChild("id", 0, true);
wp1->getChild("dist", 0, true);
wp1->getChild("eta", 0, true);
wp1->getChild("eta-seconds", 0, true);
-
+
wpn = fgGetNode(RM "wp-last", 0, true);
wpn->getChild("dist", 0, true);
wpn->getChild("eta", 0, true);
wpn->getChild("eta-seconds", 0, true);
-
+
_pathNode = fgGetNode(RM "file-path", 0, true);
}
@@ -387,13 +386,13 @@ void FGRouteMgr::postinit()
{
setFlightPlan(FlightPlan::create());
_plan->setIdent("default-flightplan");
-
+
SGPath path = SGPath::fromUtf8(_pathNode->getStringValue());
if (!path.isNull()) {
SG_LOG(SG_AUTOPILOT, SG_INFO, "loading flight-plan from: " << path);
loadRoute(path);
}
-
+
_isRoute->setBoolValue(_plan->isRoute());
// this code only matters for the --wp option now - perhaps the option
@@ -409,13 +408,13 @@ void FGRouteMgr::postinit()
SG_LOG(SG_AUTOPILOT, SG_WARN, "Failed to create waypoint from '" << wpStr << "'");
}
}
-
+
update_mirror();
}
weightOnWheels = fgGetNode("/gear/gear[0]/wow", true);
groundSpeed = fgGetNode("/velocities/groundspeed-kt", true);
-
+
// check airbone flag agrees with presets
}
@@ -432,18 +431,17 @@ bool FGRouteMgr::saveRoute(const SGPath& p)
if (!_plan) {
return false;
}
-
+
return _plan->save(p);
}
bool FGRouteMgr::loadRoute(const SGPath& p)
{
- FlightPlan* fp = FlightPlan::create();
- if (!fp->load(p)) {
- delete fp;
- return false;
- }
-
+ FlightPlanRef fp = FlightPlan::create();
+ if (!fp->load(p)) {
+ return false;
+ }
+
setFlightPlan(fp);
return true;
}
@@ -458,22 +456,22 @@ void FGRouteMgr::setFlightPlan(const FlightPlanRef& plan)
if (plan == _plan) {
return;
}
-
+
if (_plan) {
_plan->removeDelegate(this);
if (isRouteActive()) {
_plan->finish();
}
-
+
active->setBoolValue(false);
}
-
+
_plan = plan;
_plan->addDelegate(this);
_isRoute->setBoolValue(_plan->isRoute());
_flightplanChanged->fireValueChanged();
-
+
// fire all the callbacks!
departureChanged();
arrivalChanged();
@@ -505,12 +503,12 @@ void FGRouteMgr::update( double dt )
if (dt <= 0.0) {
return; // paused, nothing to do here
}
-
+
double gs = groundSpeed->getDoubleValue();
if (airborne->getBoolValue()) {
time_t now = globals->get_time_params()->get_cur_time();
elapsedFlightTime->setDoubleValue(difftime(now, _takeoffTime));
-
+
if (weightOnWheels->getBoolValue()) {
// touch down
destination->setIntValue("touchdown-time", now);
@@ -525,7 +523,7 @@ void FGRouteMgr::update( double dt )
departure->setIntValue("takeoff-time", _takeoffTime);
}
}
-
+
if (!active->getBoolValue()) {
return;
}
@@ -537,7 +535,7 @@ void FGRouteMgr::update( double dt )
if (!leg) {
return;
}
-
+
// use RoutePath to compute location of active WP
if (!_routePath) {
_routePath.reset(new RoutePath{_plan});
@@ -553,19 +551,19 @@ void FGRouteMgr::update( double dt )
courseDeg -= magvar->getDoubleValue(); // expose magnetic bearing
wp0->setDoubleValue("bearing-deg", courseDeg);
setETAPropertyFromDistance(wp0, distanceM);
-
+
double totalPathDistanceNm = _plan->totalDistanceNm();
double totalDistanceRemaining = distanceM * SG_METER_TO_NM; // distance to current waypoint
-
+
// total distance to go, is direct distance to wp0, plus the remaining
// path distance from wp0
totalDistanceRemaining += (totalPathDistanceNm - leg->distanceAlongRoute());
-
- wp0->setDoubleValue("distance-along-route-nm",
+
+ wp0->setDoubleValue("distance-along-route-nm",
leg->distanceAlongRoute());
- wp0->setDoubleValue("remaining-distance-nm",
+ wp0->setDoubleValue("remaining-distance-nm",
totalPathDistanceNm - leg->distanceAlongRoute());
-
+
FlightPlan::Leg* nextLeg = _plan->nextLeg();
if (nextLeg) {
wpPos = _routePath->positionForIndex(_plan->currentIndex() + 1);
@@ -575,13 +573,13 @@ void FGRouteMgr::update( double dt )
wp1->setDoubleValue("true-bearing-deg", courseDeg);
courseDeg -= magvar->getDoubleValue(); // expose magnetic bearing
wp1->setDoubleValue("bearing-deg", courseDeg);
- setETAPropertyFromDistance(wp1, distanceM);
- wp1->setDoubleValue("distance-along-route-nm",
+ setETAPropertyFromDistance(wp1, distanceM);
+ wp1->setDoubleValue("distance-along-route-nm",
nextLeg->distanceAlongRoute());
- wp1->setDoubleValue("remaining-distance-nm",
+ wp1->setDoubleValue("remaining-distance-nm",
totalPathDistanceNm - nextLeg->distanceAlongRoute());
}
-
+
distanceToGo->setDoubleValue(totalDistanceRemaining);
wpn->setDoubleValue("dist", totalDistanceRemaining);
ete->setDoubleValue(totalDistanceRemaining / gs * 3600.0);
@@ -601,7 +599,7 @@ Waypt* FGRouteMgr::currentWaypt() const
if (_plan && _plan->currentLeg()) {
return _plan->currentLeg()->waypoint();
}
-
+
return NULL;
}
@@ -610,7 +608,7 @@ int FGRouteMgr::currentIndex() const
if (!_plan) {
return 0;
}
-
+
return _plan->currentIndex();
}
@@ -619,7 +617,7 @@ Waypt* FGRouteMgr::wayptAtIndex(int index) const
if (!_plan) {
throw sg_range_exception("wayptAtindex: no flightplan");
}
-
+
return _plan->legAtIndex(index)->waypoint();
}
@@ -628,7 +626,7 @@ int FGRouteMgr::numLegs() const
if (_plan) {
return _plan->numLegs();
}
-
+
return 0;
}
@@ -643,15 +641,15 @@ void FGRouteMgr::setETAPropertyFromDistance(SGPropertyNode_ptr aProp, double aDi
char eta_str[64];
double eta = aDistance * SG_METER_TO_NM / speed;
aProp->getChild("eta-seconds")->setIntValue( eta * 3600 );
- if ( eta >= 100.0 ) {
+ if (eta >= 100.0) {
eta = 99.999; // clamp
}
-
+
if ( eta < (1.0/6.0) ) {
eta *= 60.0; // within 10 minutes, bump up to min/secs
}
-
- int major = (int)eta,
+
+ int major = (int)eta,
minor = (int)((eta - (int)eta) * 60.0);
snprintf( eta_str, 64, "%d:%02d", major, minor );
aProp->getChild("eta")->setStringValue( eta_str );
@@ -662,10 +660,10 @@ void FGRouteMgr::removeLegAtIndex(int aIndex)
if (!_plan) {
return;
}
-
+
_plan->deleteIndex(aIndex);
}
-
+
void FGRouteMgr::waypointsChanged()
{
update_mirror();
@@ -687,9 +685,9 @@ void FGRouteMgr::update_mirror()
}
return;
}
-
+
int num = _plan->numLegs();
-
+
for (int i = 0; i < num; i++) {
FlightPlan::Leg* leg = _plan->legAtIndex(i);
WayptRef wp = leg->waypoint();
@@ -699,13 +697,13 @@ void FGRouteMgr::update_mirror()
prop->setStringValue("id", wp->ident());
prop->setDoubleValue("longitude-deg", pos.getLongitudeDeg());
prop->setDoubleValue("latitude-deg",pos.getLatitudeDeg());
-
+
// leg course+distance
prop->setDoubleValue("leg-bearing-true-deg", leg->courseDeg());
prop->setDoubleValue("leg-distance-nm", leg->distanceNm());
prop->setDoubleValue("distance-along-route-nm", leg->distanceAlongRoute());
-
+
if (leg->altitudeRestriction() != RESTRICT_NONE) {
double ft = leg->altitudeFt();
prop->setDoubleValue("altitude-m", ft * SG_FEET_TO_METER);
@@ -715,35 +713,35 @@ void FGRouteMgr::update_mirror()
prop->setDoubleValue("altitude-m", -9999.9);
prop->setDoubleValue("altitude-ft", -9999.9);
}
-
+
if (leg->speedRestriction() == SPEED_RESTRICT_MACH) {
prop->setDoubleValue("speed-mach", leg->speedMach());
} else if (leg->speedRestriction() != RESTRICT_NONE) {
prop->setDoubleValue("speed-kts", leg->speedKts());
}
-
+
if (wp->flag(WPT_ARRIVAL)) {
prop->setBoolValue("arrival", true);
}
-
+
if (wp->flag(WPT_DEPARTURE)) {
prop->setBoolValue("departure", true);
}
-
+
if (wp->flag(WPT_MISS)) {
prop->setBoolValue("missed-approach", true);
}
-
+
prop->setBoolValue("generated", wp->flag(WPT_GENERATED));
} // of waypoint iteration
-
+
// set number as listener attachment point
mirror->setIntValue("num", _plan->numLegs());
if (rmDlg) {
rmDlg->updateValues();
}
-
+
totalDistance->setDoubleValue(_plan->totalDistanceNm());
}
@@ -821,12 +819,12 @@ bool FGRouteMgr::activate()
SG_LOG(SG_AUTOPILOT, SG_WARN, "::activate, no flight plan defined");
return false;
}
-
+
if (isRouteActive()) {
SG_LOG(SG_AUTOPILOT, SG_WARN, "duplicate route-activation, no-op");
return false;
}
-
+
_plan->activate();
active->setBoolValue(true);
SG_LOG(SG_AUTOPILOT, SG_INFO, "route-manager, activate route ok");
@@ -838,7 +836,7 @@ void FGRouteMgr::deactivate()
if (!isRouteActive()) {
return;
}
-
+
SG_LOG(SG_AUTOPILOT, SG_INFO, "deactivating flight plan");
active->setBoolValue(false);
}
@@ -856,7 +854,7 @@ void FGRouteMgr::jumpToIndex(int index)
SG_LOG(SG_AUTOPILOT, SG_WARN, "FGRouteMgr::jumpToIndex: ignoring invalid index:" << index);
return;
}
-
+
_plan->setCurrentIndex(index);
}
@@ -867,7 +865,7 @@ void FGRouteMgr::currentWaypointChanged()
wp0->getChild("id")->setStringValue(cur ? cur->ident() : "");
wp1->getChild("id")->setStringValue(next ? next->waypoint()->ident() : "");
-
+
_currentWpt->fireValueChanged();
SG_LOG(SG_AUTOPILOT, SG_INFO, "route manager, current-wp is now " << currentIndex());
}
@@ -877,7 +875,7 @@ std::string FGRouteMgr::getDepartureICAO() const
if (!_plan || !_plan->departureAirport()) {
return "";
}
-
+
return _plan->departureAirport()->ident();
}
@@ -886,7 +884,7 @@ std::string FGRouteMgr::getDepartureName() const
if (!_plan || !_plan->departureAirport()) {
return "";
}
-
+
return _plan->departureAirport()->name();
}
@@ -895,7 +893,7 @@ std::string FGRouteMgr::getDepartureRunway() const
if (_plan && _plan->departureRunway()) {
return _plan->departureRunway()->ident();
}
-
+
return "";
}
@@ -904,7 +902,7 @@ void FGRouteMgr::setDepartureRunway(const std::string& aIdent)
if (!_plan) {
return;
}
-
+
FGAirport* apt = _plan->departureAirport();
if (!apt || aIdent.empty()) {
_plan->setDeparture(apt);
@@ -918,7 +916,7 @@ void FGRouteMgr::setDepartureICAO(const std::string& aIdent)
if (!_plan) {
return;
}
-
+
if (aIdent.length() < 3) {
_plan->setDeparture((FGAirport*) nullptr);
} else {
@@ -931,7 +929,7 @@ std::string FGRouteMgr::getSID() const
if (_plan && _plan->sid()) {
return _plan->sid()->ident();
}
-
+
return "";
}
@@ -947,17 +945,17 @@ flightgear::SID* createDefaultSID(FGRunway* aRunway, double enrouteCourse)
if (!aRunway) {
return NULL;
}
-
+
double runwayElevFt = aRunway->end().getElevationFt();
WayptVec wpts;
std::ostringstream ss;
ss << aRunway->ident() << "-3";
-
+
SGGeod p = aRunway->pointOnCenterline(aRunway->lengthM() + (3.0 * SG_NM_TO_METER));
WayptRef w = new BasicWaypt(p, ss.str(), NULL);
w->setAltitude(runwayElevFt + 3000.0, RESTRICT_AT);
wpts.push_back(w);
-
+
ss.str("");
ss << aRunway->ident() << "-6";
p = aRunway->pointOnCenterline(aRunway->lengthM() + (6.0 * SG_NM_TO_METER));
@@ -989,12 +987,12 @@ flightgear::SID* createDefaultSID(FGRunway* aRunway, double enrouteCourse)
w->setAltitude(runwayElevFt + 9000.0, RESTRICT_AT);
wpts.push_back(w);
}
-
+
for (Waypt* w : wpts) {
w->setFlag(WPT_DEPARTURE);
w->setFlag(WPT_GENERATED);
}
-
+
return flightgear::SID::createTempSID("DEFAULT", aRunway, wpts);
}
@@ -1003,28 +1001,28 @@ void FGRouteMgr::setSID(const std::string& aIdent)
if (!_plan) {
return;
}
-
+
FGAirport* apt = _plan->departureAirport();
if (!apt || aIdent.empty()) {
_plan->setSID((flightgear::SID*) NULL);
return;
- }
-
+ }
+
if (aIdent == "DEFAULT") {
double enrouteCourse = -1.0;
if (_plan->destinationAirport()) {
enrouteCourse = SGGeodesy::courseDeg(apt->geod(), _plan->destinationAirport()->geod());
}
-
+
_plan->setSID(createDefaultSID(_plan->departureRunway(), enrouteCourse));
return;
}
-
+
size_t hyphenPos = aIdent.find('-');
if (hyphenPos != string::npos) {
string sidIdent = aIdent.substr(0, hyphenPos);
string transIdent = aIdent.substr(hyphenPos + 1);
-
+
flightgear::SID* sid = apt->findSIDWithIdent(sidIdent);
Transition* trans = sid ? sid->findTransitionByName(transIdent) : NULL;
_plan->setSID(trans);
@@ -1038,7 +1036,7 @@ std::string FGRouteMgr::getDestinationICAO() const
if (!_plan || !_plan->destinationAirport()) {
return "";
}
-
+
return _plan->destinationAirport()->ident();
}
@@ -1047,7 +1045,7 @@ std::string FGRouteMgr::getDestinationName() const
if (!_plan || !_plan->destinationAirport()) {
return "";
}
-
+
return _plan->destinationAirport()->name();
}
@@ -1056,7 +1054,7 @@ void FGRouteMgr::setDestinationICAO(const std::string& aIdent)
if (!_plan) {
return;
}
-
+
if (aIdent.length() < 3) {
_plan->setDestination((FGAirport*) NULL);
} else {
@@ -1069,7 +1067,7 @@ std::string FGRouteMgr::getDestinationRunway() const
if (_plan && _plan->destinationRunway()) {
return _plan->destinationRunway()->ident();
}
-
+
return "";
}
@@ -1078,7 +1076,7 @@ void FGRouteMgr::setDestinationRunway(const std::string& aIdent)
if (!_plan) {
return;
}
-
+
FGAirport* apt = _plan->destinationAirport();
if (!apt || aIdent.empty()) {
_plan->setDestination(apt);
@@ -1092,7 +1090,7 @@ std::string FGRouteMgr::getApproach() const
if (_plan && _plan->approach()) {
return _plan->approach()->ident();
}
-
+
return "";
}
@@ -1106,7 +1104,7 @@ flightgear::Approach* createDefaultApproach(FGRunway* aRunway, double aEnrouteCo
const double approachHeightFt = 2000.0;
double glideslopeDistanceM = (approachHeightFt * SG_FEET_TO_METER) /
tan(3.0 * SG_DEGREES_TO_RADIANS);
-
+
std::ostringstream ss;
ss << aRunway->ident() << "-12";
WayptVec wpts;
@@ -1116,7 +1114,7 @@ flightgear::Approach* createDefaultApproach(FGRunway* aRunway, double aEnrouteCo
wpts.push_back(w);
// work back form the first point on the centerline
-
+
if (aEnrouteCourse >= 0.0) {
// valid enroute course
int index = 4;
@@ -1133,26 +1131,26 @@ flightgear::Approach* createDefaultApproach(FGRunway* aRunway, double aEnrouteCo
wpts.insert(wpts.begin(), w);
}
}
-
+
p = aRunway->pointOnCenterline(-8.0 * SG_NM_TO_METER);
ss.str("");
ss << aRunway->ident() << "-8";
w = new BasicWaypt(p, ss.str(), NULL);
w->setAltitude(thresholdElevFt + approachHeightFt, RESTRICT_AT);
wpts.push_back(w);
-
- p = aRunway->pointOnCenterline(-glideslopeDistanceM);
+
+ p = aRunway->pointOnCenterline(-glideslopeDistanceM);
ss.str("");
ss << aRunway->ident() << "-GS";
w = new BasicWaypt(p, ss.str(), NULL);
w->setAltitude(thresholdElevFt + approachHeightFt, RESTRICT_AT);
wpts.push_back(w);
-
+
for (Waypt* w : wpts) {
w->setFlag(WPT_APPROACH);
w->setFlag(WPT_GENERATED);
}
-
+
return Approach::createTempApproach("DEFAULT", aRunway, wpts);
}
@@ -1161,18 +1159,18 @@ void FGRouteMgr::setApproach(const std::string& aIdent)
if (!_plan) {
return;
}
-
+
FGAirport* apt = _plan->destinationAirport();
if (aIdent == "DEFAULT") {
double enrouteCourse = -1.0;
if (_plan->departureAirport()) {
enrouteCourse = SGGeodesy::courseDeg(_plan->departureAirport()->geod(), apt->geod());
}
-
+
_plan->setApproach(createDefaultApproach(_plan->destinationRunway(), enrouteCourse));
return;
}
-
+
if (!apt || aIdent.empty()) {
_plan->setApproach(static_cast<Approach*>(nullptr));
} else {
@@ -1185,7 +1183,7 @@ std::string FGRouteMgr::getSTAR() const
if (_plan && _plan->star()) {
return _plan->star()->ident();
}
-
+
return "";
}
@@ -1194,19 +1192,19 @@ void FGRouteMgr::setSTAR(const std::string& aIdent)
if (!_plan) {
return;
}
-
+
FGAirport* apt = _plan->destinationAirport();
if (!apt || aIdent.empty()) {
_plan->setSTAR((STAR*) NULL);
return;
- }
-
+ }
+
string ident(aIdent);
size_t hyphenPos = ident.find('-');
if (hyphenPos != string::npos) {
string starIdent = ident.substr(0, hyphenPos);
string transIdent = ident.substr(hyphenPos + 1);
-
+
STAR* star = apt->findSTARWithIdent(starIdent);
Transition* trans = star ? star->findTransitionByName(transIdent) : NULL;
_plan->setSTAR(trans);
@@ -1225,7 +1223,7 @@ double FGRouteMgr::getDepartureFieldElevation() const
if (!_plan || !_plan->departureAirport()) {
return 0.0;
}
-
+
return _plan->departureAirport()->elevation();
}
@@ -1234,7 +1232,7 @@ double FGRouteMgr::getDestinationFieldElevation() const
if (!_plan || !_plan->destinationAirport()) {
return 0.0;
}
-
+
return _plan->destinationAirport()->elevation();
}
@@ -1332,7 +1330,7 @@ SGPropertyNode_ptr FGRouteMgr::wayptNodeAtIndex(int index) const
if ((index < 0) || (index >= numWaypts())) {
throw sg_range_exception("waypt index out of range", "FGRouteMgr::wayptAtIndex");
}
-
+
return mirror->getChild("wp", index);
}
@@ -1343,7 +1341,7 @@ bool FGRouteMgr::commandDefineUserWaypoint(const SGPropertyNode * arg, SGPropert
SG_LOG(SG_AUTOPILOT, SG_WARN, "missing ident defining user waypoint");
return false;
}
-
+
// check for duplicate idents
FGPositioned::TypeFilter f(FGPositioned::WAYPOINT);
FGPositionedList dups = FGPositioned::findAllWithIdent(ident, &f);
diff --git a/src/Input/FGEventInput.cxx b/src/Input/FGEventInput.cxx
index fe0d27153..7feb9d786 100644
--- a/src/Input/FGEventInput.cxx
+++ b/src/Input/FGEventInput.cxx
@@ -69,7 +69,7 @@ std::string FGEventInput::computeDeviceIndexName(FGInputDevice* dev) const
return os.str();
}
-unsigned FGEventInput::AddDevice(FGInputDevice* inputDevice)
+unsigned FGEventInput::AddDevice(FGInputDevice_ptr inputDevice)
{
SGPropertyNode_ptr baseNode = fgGetNode(propertyRoot, true);
SGPropertyNode_ptr deviceNode = nullptr;
@@ -108,7 +108,6 @@ unsigned FGEventInput::AddDevice(FGInputDevice* inputDevice)
configNode = configMap.configurationForDeviceName(deviceName);
} else {
SG_LOG(SG_INPUT, SG_INFO, "No configuration found for device " << deviceName);
- delete inputDevice;
return INVALID_DEVICE_INDEX;
}
inputDevice->SetUniqueName(nameWithIndex);
@@ -124,7 +123,6 @@ unsigned FGEventInput::AddDevice(FGInputDevice* inputDevice)
if (index == MAX_DEVICES) {
SG_LOG(SG_INPUT, SG_WARN, "To many event devices - ignoring " << inputDevice->GetUniqueName());
- delete inputDevice;
return INVALID_DEVICE_INDEX;
}
@@ -138,12 +136,14 @@ unsigned FGEventInput::AddDevice(FGInputDevice* inputDevice)
bool ok = inputDevice->Open();
if (!ok) {
- delete inputDevice;
return INVALID_DEVICE_INDEX;
}
inputDevices[deviceNode->getIndex()] = inputDevice;
+ // Run Nasal <open> code for the device, now it's open
+ inputDevice->postOpen();
+
SG_LOG(SG_INPUT, SG_INFO, inputDevice->class_id << "::AddDevice '" << inputDevice->GetUniqueName() << "' s/n: " << inputDevice->GetSerialNumber());
return deviceNode->getIndex();
}
@@ -158,9 +158,8 @@ void FGEventInput::RemoveDevice(unsigned index)
FGInputDevice* inputDevice = inputDevices[index];
if (inputDevice) {
SG_LOG(SG_INPUT, SG_DEBUG, "\tremoving (" << index << ") " << inputDevice->GetUniqueName());
- inputDevice->Close();
+ inputDevice->doClose();
inputDevices.erase(index);
- delete inputDevice;
}
deviceNode = baseNode->removeChild("device", index);
}
diff --git a/src/Input/FGEventInput.hxx b/src/Input/FGEventInput.hxx
index 9773e1406..393a38bf6 100644
--- a/src/Input/FGEventInput.hxx
+++ b/src/Input/FGEventInput.hxx
@@ -41,10 +41,10 @@ protected:
const char* filePath;
const char* propertyRoot;
- unsigned AddDevice(FGInputDevice* inputDevice);
+ unsigned AddDevice(FGInputDevice_ptr inputDevice);
void RemoveDevice(unsigned index);
- std::map<int, FGInputDevice*> inputDevices;
+ std::map<int, FGInputDevice_ptr> inputDevices;
FGDeviceConfigurationMap configMap;
SGPropertyNode_ptr nasalClose;
diff --git a/src/Input/FGHIDDevice.hxx b/src/Input/FGHIDDevice.hxx
index 4de86c61c..dafee4dd5 100644
--- a/src/Input/FGHIDDevice.hxx
+++ b/src/Input/FGHIDDevice.hxx
@@ -36,7 +36,6 @@ public:
virtual ~FGHIDDevice();
bool Open() override;
- void Close() override;
void Configure(SGPropertyNode_ptr node) override;
void update(double dt) override;
@@ -84,6 +83,8 @@ public:
uint8_t reportIdForItem(const std::string& name) const;
private:
+ void Close() override;
+
class Report
{
public:
diff --git a/src/Input/FGHIDUsage.cxx b/src/Input/FGHIDUsage.cxx
index 515114884..cc772ab4f 100644
--- a/src/Input/FGHIDUsage.cxx
+++ b/src/Input/FGHIDUsage.cxx
@@ -321,32 +321,32 @@ std::string nameForUsage(uint32_t usagePage, uint32_t usage)
case LED_Remote: return "remote-led";
case LED_Forward: return "forward-led";
case LED_Reverse: return "reverse-led";
- case LED_Stop: return "stop=led";
+ case LED_Stop: return "stop-led";
case LED_Rewind: return "rewind-led";
case LED_FastForward: return "fastforward-led";
case LED_Play: return "play-led";
case LED_Pause: return "pause-led";
case LED_Record: return "record-led";
case LED_Error: return "error-led";
- case LED_UsageSelectedIndicator: return "usageselectedindicator-led";
- case LED_UsageInUseIndicator: return "usageinuseindicator-led";
- case LED_UsageMultiModeIndicator: return "usagemultimodeindicator-led";
- case LED_IndicatorOn: return "indicatoron-led";
- case LED_IndicatorFlash: return "idicatorflash-led";
+ case LED_UsageSelectedIndicator: return "selected-led";
+ case LED_UsageInUseIndicator: return "in-use-led";
+ case LED_UsageMultiModeIndicator: return "mode-led";
+ case LED_IndicatorOn: return "on-led";
+ case LED_IndicatorFlash: return "flash-led";
case LED_IndicatorSlowBlink: return "indicatorslowblink-led";
case LED_IndicatorFastBlink: return "indicatorfastblink-led";
- case LED_IndicatorOff: return "indicatoroff-led";
+ case LED_IndicatorOff: return "off-led";
case LED_FlashOnTime: return "flashontime-led";
case LED_SlowBlinkOnTime: return "slowblinkontime-led";
case LED_SlowBlinkOffTime: return "slowblinkofftime-led";
case LED_FastBlinkOnTime: return "fastblinkontime-led";
case LED_FastBlinkOfftime: return "fastblinkofftime-led";
- case LED_UsageIndicatorColor: return "usageindicatorcolor-led";
- case LED_IndicatorRed: return "usageindicatorred-led";
- case LED_IndicatorGreen: return "usageindicatorgreen-led";
- case LED_IndicatorAmber: return "usageindicatoramber-led";
- case LED_GenericIndicator: return "usagegenericindicator-led";
- case LED_SystemSuspend: return "usagesystemsuspend-led";
+ case LED_UsageIndicatorColor: return "color-led";
+ case LED_IndicatorRed: return "red-led";
+ case LED_IndicatorGreen: return "green-led";
+ case LED_IndicatorAmber: return "amber-led";
+ case LED_GenericIndicator: return "generic-led";
+ case LED_SystemSuspend: return "suspend-led";
case LED_ExternalPowerConnected: return "externalpowerconnected-led";
default:
SG_LOG(SG_INPUT, SG_WARN, "Unhandled HID LED usage:" << usage);
diff --git a/src/Input/FGInputDevice.cxx b/src/Input/FGInputDevice.cxx
index 624736803..4ed5ed4b9 100644
--- a/src/Input/FGInputDevice.cxx
+++ b/src/Input/FGInputDevice.cxx
@@ -7,10 +7,12 @@
#include <map>
#include <string>
+#include <vector>
#include <simgear/debug/ErrorReportingCallback.hxx>
#include <simgear/debug/debug_types.h>
#include <simgear/misc/strutils.hxx>
+#include <simgear/nasal/cppbind/Ghost.hxx>
#include <simgear/structure/exception.hxx>
#include <Main/fg_props.hxx>
@@ -34,6 +36,18 @@ void FGInputDevice::PrivateListener::valueChanged(SGPropertyNode* node)
}
FGInputDevice::~FGInputDevice()
+{
+ if (!deviceNode) {
+ return;
+ }
+
+ auto debug = deviceNode->getNode("debug-events");
+ if (debug) {
+ debug->removeChangeListener(_configListener.get());
+ }
+}
+
+void FGInputDevice::doClose()
{
auto nas = globals->get_subsystem<FGNasalSys>();
if (nas && deviceNode) {
@@ -48,12 +62,19 @@ FGInputDevice::~FGInputDevice()
nas->deleteModule(nasalModule.c_str());
}
- auto debug = deviceNode->getNode("debug-events");
- if (debug) {
- debug->removeChangeListener(_configListener.get());
- }
+ // call our virtual method
+ Close();
}
+static naRef createNasalGhost(FGInputDevice_ptr ref, naContext c)
+{
+ using NasalInputDevice = nasal::Ghost<FGInputDevice_ptr>;
+
+ // We need a non-const shared pointer for the ghost system
+ return NasalInputDevice::makeGhost(c, ref);
+}
+
+
void FGInputDevice::Configure(SGPropertyNode_ptr aDeviceNode)
{
deviceNode = aDeviceNode;
@@ -100,19 +121,56 @@ void FGInputDevice::Configure(SGPropertyNode_ptr aDeviceNode)
lastEventValue = deviceNode->getNode("last-event")->getNode("value", true);
lastEventValue->setDoubleValue(0.0);
+ auto node = deviceNode->getNode("debug-events", true);
+ node->addChangeListener(_configListener.get());
+
SGPropertyNode_ptr nasal = deviceNode->getNode("nasal");
- if (nasal) {
+ auto nas = globals->get_subsystem<FGNasalSys>();
+ const bool haveUpdate = nasal && nasal->hasChild("update");
+ const bool haveOpenOrClose = nasal && (nasal->hasChild("open") || nasal->hasChild("close"));
+ if (nas && (haveUpdate || haveOpenOrClose)) {
+ // pre-create the module hash, so device property is available
+ // immediately, eg during <open> code
+ naContext c = naNewContext();
+ naRef module = nas->getModule(nasalModule, true /*create*/);
+ naRef ghost = createNasalGhost(this, c);
+ nasal::Hash moduleHash(module, c);
+ moduleHash.set("device", ghost);
+ naFreeContext(c);
+ }
+
+ if (nas && haveUpdate) {
+ const auto updateCode = nasal->getChild("update");
+ const auto loc = updateCode->getLocation();
+ _postUpdateCallback = nas->createCode(updateCode->getStringValue(), loc.getPath(), loc.getLine());
+ if (_postUpdateCallback.getErrors().size() > 0) {
+ simgear::reportFailure(simgear::LoadFailure::Misconfigured,
+ simgear::ErrorCode::InputDeviceConfig,
+ "Failed to compile update callback for device"s + _postUpdateCallback.getErrors().front(),
+ sg_location(loc));
+ _postUpdateCallback = {};
+ }
+ }
+}
+
+void FGInputDevice::postOpen()
+{
+ SGPropertyNode_ptr nasal = deviceNode->getNode("nasal");
+ auto nas = globals->get_subsystem<FGNasalSys>();
+
+ if (nasal && nas) {
SGPropertyNode_ptr open = nasal->getNode("open");
if (open) {
const string s = open->getStringValue();
- auto nas = globals->get_subsystem<FGNasalSys>();
- if (nas)
- nas->createModule(nasalModule.c_str(), nasalModule.c_str(), s.c_str(), s.length(), deviceNode);
+ bool ok = nas->createModule(nasalModule.c_str(), nasalModule.c_str(), s.c_str(), s.length(), deviceNode);
+ if (!ok) {
+ simgear::reportFailure(simgear::LoadFailure::Misconfigured,
+ simgear::ErrorCode::InputDeviceConfig,
+ "Failed to load device Nasal",
+ sg_location(open));
+ }
}
}
-
- auto node = deviceNode->getNode("debug-events", true);
- node->addChangeListener(_configListener.get());
}
void FGInputDevice::AddHandledEvent(FGInputEvent_ptr event)
@@ -123,11 +181,25 @@ void FGInputDevice::AddHandledEvent(FGInputEvent_ptr event)
}
}
+naRef FGInputDevice::getModule()
+{
+ auto nas = globals->get_subsystem<FGNasalSys>();
+ if (!nas) {
+ return naRef();
+ }
+
+ return nas->getModule(nasalModule, false /*don't create*/);
+}
+
void FGInputDevice::update(double dt)
{
- for (map<string, FGInputEvent_ptr>::iterator it = handledEvents.begin(); it != handledEvents.end(); it++)
- (*it).second->update(dt);
+ for (auto it : handledEvents) {
+ it.second->update(dt);
+ }
+ naRef module = naNil();
+
+ bool didSend = false;
for (auto r : reportSettings) {
if (r->hasError()) {
continue;
@@ -135,7 +207,11 @@ void FGInputDevice::update(double dt)
try {
if (r->Test()) {
- auto reportData = r->reportBytes(nasalModule);
+ if (naIsNil(module)) {
+ module = getModule();
+ }
+
+ auto reportData = r->reportBytes(module);
if (debugEvents) {
SG_LOG(SG_INPUT, SG_INFO, class_id << " " << GetUniqueName() << ": Sending report " << r->getReportId() << simgear::strutils::encodeHex(reportData));
}
@@ -144,6 +220,8 @@ void FGInputDevice::update(double dt)
} else {
SendOutputReport(r->getReportId(), reportData);
}
+
+ didSend = true;
}
} catch (sg_exception& e) {
r->markAsError();
@@ -153,6 +231,24 @@ void FGInputDevice::update(double dt)
e.getLocation());
}
} // of report setting iteration
+
+ if (didSend && _postUpdateCallback.isValid()) {
+ try {
+ if (naIsNil(module)) {
+ module = getModule();
+ }
+
+ _postUpdateCallback.callWithLocals(module);
+ } catch (sg_exception& e) {
+ simgear::reportFailure(simgear::LoadFailure::Unknown,
+ simgear::ErrorCode::InputDeviceConfig,
+ "Failed to execute post-update callback:"s + e.getMessage(),
+ e.getLocation());
+
+ // FIXME
+ //_postUpdateCallback.reset();
+ }
+ }
}
void FGInputDevice::HandleEvent(FGEventData& eventData)
diff --git a/src/Input/FGInputDevice.hxx b/src/Input/FGInputDevice.hxx
index 4c679ccc9..a6d712ca4 100644
--- a/src/Input/FGInputDevice.hxx
+++ b/src/Input/FGInputDevice.hxx
@@ -13,6 +13,7 @@
#include <string>
#include <simgear/io/lowlevel.hxx>
+#include <simgear/nasal/cppbind/NasalCode.hxx>
#include <simgear/props/props.hxx>
#include <simgear/structure/SGReferenced.hxx>
#include <simgear/structure/SGSharedPtr.hxx>
@@ -29,7 +30,6 @@ public:
virtual ~FGInputDevice();
virtual bool Open() = 0;
- virtual void Close() = 0;
virtual void Send(const char* eventName, double value) = 0;
@@ -81,9 +81,14 @@ public:
void SetDebugEvents(bool debug);
+ void postOpen();
+ void doClose();
+
protected:
FGInputDevice(std::string aName, std::string aSerial = {});
+ virtual void Close() = 0;
+
// A map of events, this device handles
std::map<std::string, FGInputEvent_ptr> handledEvents;
@@ -130,6 +135,10 @@ protected:
};
std::unique_ptr<PrivateListener> _configListener;
+
+ nasal::NasalCode _postUpdateCallback;
+
+ naRef getModule();
};
typedef SGSharedPtr<FGInputDevice> FGInputDevice_ptr;
diff --git a/src/Input/FGLinuxEventInput.cxx b/src/Input/FGLinuxEventInput.cxx
index bbd816632..dbc177e9c 100644
--- a/src/Input/FGLinuxEventInput.cxx
+++ b/src/Input/FGLinuxEventInput.cxx
@@ -515,7 +515,7 @@ void FGLinuxEventInput::update( double dt )
// the pollfd array by filling in the file descriptor
struct pollfd fds[inputDevices.size()];
std::map<int,FGLinuxInputDevice*> devicesByFd;
- std::map<int,FGInputDevice*>::const_iterator it;
+ std::map<int, FGInputDevice_ptr>::const_iterator it;
int i;
for( i=0, it = inputDevices.begin(); it != inputDevices.end(); ++it, i++ ) {
FGInputDevice* p = (*it).second;
diff --git a/src/Input/FGLinuxEventInput.hxx b/src/Input/FGLinuxEventInput.hxx
index 15767ac59..dfa33016c 100644
--- a/src/Input/FGLinuxEventInput.hxx
+++ b/src/Input/FGLinuxEventInput.hxx
@@ -31,7 +31,6 @@ public:
virtual ~FGLinuxInputDevice();
bool Open() override;
- void Close() override;
void Send( const char * eventName, double value ) override;
const char * TranslateEventName( FGEventData & eventData ) override;
@@ -43,6 +42,8 @@ public:
double Normalize( struct input_event & event );
private:
+ void Close() override;
+
std::string devfile;
std::string devpath;
int fd {-1};
diff --git a/src/Input/FGReportSetting.cxx b/src/Input/FGReportSetting.cxx
index 3bb8a5436..030a5ee0c 100644
--- a/src/Input/FGReportSetting.cxx
+++ b/src/Input/FGReportSetting.cxx
@@ -103,15 +103,9 @@ bool FGReportSetting::Test()
return d;
}
-simgear::UInt8Vector FGReportSetting::reportBytes(const std::string& moduleName) const
+simgear::UInt8Vector FGReportSetting::reportBytes(naRef module) const
{
- auto nas = globals->get_subsystem<FGNasalSys>();
- if (!nas) {
- return {};
- }
-
- naRef locals = nas->getModule(moduleName, true /*create*/);
- naRef result = nasalCode.callWithLocals(locals);
+ naRef result = nasalCode.callWithLocals(module);
if (naIsString(result)) {
size_t len = naStr_len(result);
diff --git a/src/Input/FGReportSetting.hxx b/src/Input/FGReportSetting.hxx
index 6adb35f8a..f2099ac29 100644
--- a/src/Input/FGReportSetting.hxx
+++ b/src/Input/FGReportSetting.hxx
@@ -66,7 +66,7 @@ public:
}
bool Test();
- simgear::UInt8Vector reportBytes(const std::string& moduleName) const;
+ simgear::UInt8Vector reportBytes(naRef module) const;
virtual void valueChanged(SGPropertyNode* node);
protected:
diff --git a/src/Scripting/CMakeLists.txt b/src/Scripting/CMakeLists.txt
index 27763457b..4529b7d98 100644
--- a/src/Scripting/CMakeLists.txt
+++ b/src/Scripting/CMakeLists.txt
@@ -19,6 +19,7 @@ set(SOURCES
NasalFlightPlan.cxx
ScriptBinding.cxx
sqlitelib.cxx
+ NasalInput.cxx
# we don't add this here because we need to exclude it in the testSuite
# so it can't go nto fgfsObjects library
# NasalUnitTesting.cxx
@@ -40,6 +41,7 @@ set(HEADERS
NasalTranslations.hxx
NasalFlightPlan.hxx
ScriptBinding.hxx
+ NasalInput.hxx
)
if(WIN32)
diff --git a/src/Scripting/NasalInput.cxx b/src/Scripting/NasalInput.cxx
new file mode 100644
index 000000000..eb5ab62dc
--- /dev/null
+++ b/src/Scripting/NasalInput.cxx
@@ -0,0 +1,84 @@
+// Expose Input module to Nasal
+//
+// SPDX-FileCopyrightText: 2026 James Turner
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "config.h"
+
+#include "NasalInput.hxx"
+
+#include <Input/FGInputDevice.hxx>
+
+#include <simgear/nasal/cppbind/Ghost.hxx>
+#include <simgear/nasal/cppbind/NasalHash.hxx>
+#include <simgear/nasal/cppbind/from_nasal.hxx>
+#include <simgear/nasal/cppbind/to_nasal.hxx>
+
+
+static simgear::UInt8Vector dataFromString(const std::string& str)
+{
+ return simgear::UInt8Vector(
+ reinterpret_cast<const uint8_t*>(str.data()),
+ reinterpret_cast<const uint8_t*>(str.data() + str.size()));
+}
+
+static simgear::UInt8Vector dataFromArg(const nasal::CallContext& ctx, size_t index)
+{
+ if (ctx.isString(index)) {
+ std::string str = ctx.getArg<std::string>(index);
+ return dataFromString(str);
+ } else if (ctx.isVector(index)) {
+ std::vector<int> ints = ctx.getArg<std::vector<int>>(index);
+ simgear::UInt8Vector data;
+ data.reserve(ints.size());
+ for (int v : ints) {
+ if (v < 0 || v > 255) {
+ ctx.runtimeError("data vector contains out-of-range value: %d, (must be 0-255)", v);
+ }
+
+ data.push_back(static_cast<uint8_t>(v));
+ }
+ return data;
+ } else {
+ ctx.runtimeError("data argument must be a string or a vector of integers");
+ return {};
+ }
+}
+
+static naRef f_sendFeatureReport(FGInputDevice& device, const nasal::CallContext& ctx)
+{
+ if (ctx.argc < 2) {
+ ctx.runtimeError("sendFeatureReport(reportId, data) requires 2 arguments");
+ }
+
+ unsigned int reportId = ctx.requireArg<unsigned int>(0);
+ simgear::UInt8Vector data = dataFromArg(ctx, 1);
+ device.SendFeatureReport(reportId, data);
+ return naNil();
+}
+
+static naRef f_sendOutputReport(FGInputDevice& device, const nasal::CallContext& ctx)
+{
+ if (ctx.argc < 2) {
+ ctx.runtimeError("sendOutputReport(reportId, data) requires 2 arguments");
+ }
+
+ unsigned int reportId = ctx.requireArg<unsigned int>(0);
+ simgear::UInt8Vector data = dataFromArg(ctx, 1);
+
+ device.SendOutputReport(reportId, data);
+ return naNil();
+}
+
+//------------------------------------------------------------------------------
+naRef initNasalInput(naRef globals, naContext c)
+{
+ using InputDeviceRef = SGSharedPtr<FGInputDevice>;
+ using NasalInputDevice = nasal::Ghost<InputDeviceRef>;
+
+ NasalInputDevice::init("FGInputDevice")
+ .method("sendFeatureReport", &f_sendFeatureReport)
+ .method("sendOutputReport", &f_sendOutputReport);
+
+ return naNil();
+}
diff --git a/src/Scripting/NasalInput.hxx b/src/Scripting/NasalInput.hxx
new file mode 100644
index 000000000..4fa7f4783
--- /dev/null
+++ b/src/Scripting/NasalInput.hxx
@@ -0,0 +1,10 @@
+//@file Expose Input module to Nasal
+//
+// SPDX-FileCopyrightText: 2026 James Turner
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <simgear/nasal/nasal.h>
+
+naRef initNasalInput(naRef globals, naContext c);
diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx
index e1e42b0cf..9027e284b 100644
--- a/src/Scripting/NasalSys.cxx
+++ b/src/Scripting/NasalSys.cxx
@@ -49,10 +49,12 @@
#include "NasalCondition.hxx"
#include "NasalFlightPlan.hxx"
#include "NasalHTTP.hxx"
+#include "NasalInput.hxx"
#include "NasalPositioned.hxx"
#include "NasalSGPath.hxx"
#include "NasalString.hxx"
#include "NasalSys.hxx"
+
#include "NasalSys_private.hxx"
#include "NasalTranslations.hxx"
#include "NasalUnitTesting.hxx"
@@ -1127,6 +1129,8 @@ void FGNasalSys::init()
NewGUI::registerNasalBindings(this);
}
+ initNasalInput(d->_globals, d->_context);
+
NasalTimerObj::init("Timer")
.method("start", &TimerObj::start)
.method("stop", &TimerObj::stop)
@@ -1148,6 +1152,10 @@ void FGNasalSys::init()
return;
}
+ if (fgGetString("/sim/nasal-load-priority/file[0]") != "props.nas") {
+ SG_LOG(SG_NASAL, SG_DEV_ALERT, "Nasal loadpriority.xml not included, Nasal loading will fail");
+ }
+
flightgear::initNasalTranslations(d->_globals, d->_context);
flightgear::addons::initAddonClassesForNasal(d->_globals, d->_context);
@@ -1524,7 +1532,6 @@ bool FGNasalSys::createModule(const char* moduleName, const char* fileName,
if (naIsNil(d->_globals))
return false;
- bool didCreateModule = false;
if (!naHash_get(d->_globals, modname, &locals)) {
// if we are re-creating the module for canvas, ensure the C++
// pieces are re-defined first. As far as I can see, Canvas is the only
@@ -1536,7 +1543,6 @@ bool FGNasalSys::createModule(const char* moduleName, const char* fileName,
} else {
locals = naNewHash(ctx);
}
- didCreateModule = true;
}
// store the filename in the module hash, so we could reload it
@@ -1550,10 +1556,16 @@ bool FGNasalSys::createModule(const char* moduleName, const char* fileName,
d->_cmdArg = (SGPropertyNode*)cmdarg;
callWithContext(ctx, code, argc, args, locals);
- if (didCreateModule) {
- hashset(d->_globals, moduleName, locals);
+ if (const char* error = naGetError(ctx)) {
+ int line = naGetLine(ctx, 0);
+ char* file = naStr_data(naGetSourceFile(ctx, 0));
+ SG_LOG(SG_NASAL, SG_ALERT, "Error loading module '" << moduleName << "': " << error << " (at " << file << ":" << line << ")");
+
+ return false;
}
+ hashset(d->_globals, moduleName, locals);
+
naFreeContext(ctx);
return true;
}
@@ -1631,8 +1643,11 @@ naRef FGNasalSys::getModule(const std::string& moduleName, bool create) const
{
naRef mod = naHash_cget(d->_globals, (char*)moduleName.c_str());
if (naIsNil(mod) && create) {
+ naRef modname = naNewString(d->_context);
+ naStr_fromdata(modname, moduleName.data(), moduleName.size());
+
mod = naNewHash(d->_context);
- naHash_cset(d->_globals, (char*)moduleName.c_str(), mod);
+ naHash_set(d->_globals, modname, mod);
}
return mod;
}
diff --git a/test_suite/CMakeLists.txt b/test_suite/CMakeLists.txt
index 5dae5970f..b9e82b44b 100644
--- a/test_suite/CMakeLists.txt
+++ b/test_suite/CMakeLists.txt
@@ -14,7 +14,10 @@ include(SetupFGFSLibraries)
# u unit tests, s system tests, m simgear unit tests
function(fg_add_test_suite SUITE_NAME TYPE)
add_test(NAME "${SUITE_NAME}"
- COMMAND fgfs_test_suite --ctest -${TYPE} "${SUITE_NAME}")
+ COMMAND fgfs_test_suite --ctest -${TYPE} "${SUITE_NAME}" --fg-root ${FG_DATA_DIR}
+ )
+
+
endfunction()
# The test suite output directory.
diff --git a/test_suite/FGTestApi/testGlobals.cxx b/test_suite/FGTestApi/testGlobals.cxx
index baa8675d9..20121a31f 100644
--- a/test_suite/FGTestApi/testGlobals.cxx
+++ b/test_suite/FGTestApi/testGlobals.cxx
@@ -78,6 +78,10 @@ void initTestGlobals(const std::string& testName, const std::string& language,
fgSetDefaults();
+ // load Nasal load priority, which is needed for 'full' NasalSys init
+ auto nasalLoadPriority = globals->get_props()->getNode("/sim/nasal-load-priority", true);
+ readProperties(globals->get_fg_root() / "Nasal/loadpriority.xml", nasalLoadPriority);
+
auto t = globals->get_subsystem_mgr()->add<TimeManager>();
t->bind();
t->init(); // establish mag-var data
diff --git a/test_suite/unit_tests/Input/test_inputDevice.cxx b/test_suite/unit_tests/Input/test_inputDevice.cxx
index 358ed4a5e..68b1f6a82 100644
--- a/test_suite/unit_tests/Input/test_inputDevice.cxx
+++ b/test_suite/unit_tests/Input/test_inputDevice.cxx
@@ -35,7 +35,15 @@ public:
explicit TestInputDevice(const std::string& name) : FGInputDevice(name) {}
bool Open() override { return true; }
- void Close() override {}
+
+ void Close() override
+ {
+ _closeCalled = true;
+ // Record whether the feature report was already populated when Close()
+ // was invoked — used by testNasalClose to verify ordering.
+ _reportSetAtCloseTime = (_lastFeatureReportId != 0);
+ }
+
void Send(const char* /*eventName*/, double /*value*/) override {}
const char* TranslateEventName(FGEventData& /*eventData*/) override
@@ -54,21 +62,55 @@ public:
_lastOutputReportData = data;
}
+ void SendFeatureReport(unsigned int reportId, const simgear::UInt8Vector& data) override
+ {
+ _lastFeatureReportId = reportId;
+ _lastFeatureReportData = data;
+ }
+
void clearReport()
{
_lastOutputReportId = 0;
_lastOutputReportData.clear();
+ _lastFeatureReportId = 0;
+ _lastFeatureReportData.clear();
}
unsigned int getLastOutputReportId() const { return _lastOutputReportId; }
const simgear::UInt8Vector& getLastOutputReportData() const { return _lastOutputReportData; }
+ unsigned int getLastFeatureReportId() const { return _lastFeatureReportId; }
+ const simgear::UInt8Vector& getLastFeatureReportData() const { return _lastFeatureReportData; }
+
+ bool wasCloseCalled() const { return _closeCalled; }
+ bool wasReportSetAtCloseTime() const { return _reportSetAtCloseTime; }
private:
std::string _translatedName;
unsigned int _lastOutputReportId = 0;
simgear::UInt8Vector _lastOutputReportData;
+ unsigned int _lastFeatureReportId = 0;
+ simgear::UInt8Vector _lastFeatureReportData;
+ bool _closeCalled = false;
+ bool _reportSetAtCloseTime = false;
};
+// ---------------------------------------------------------------------------
+// Helper to initialize the full Nasal subsystem for tests that need it.
+// Callers should reset global_nasalMinimalInit in their tearDown if needed.
+// ---------------------------------------------------------------------------
+static void initNasalForTest()
+{
+ fgInitAllowedPaths();
+ globals->get_props()->getNode("nasal", true);
+ globals->get_subsystem_mgr()->add<FGInterpolator>();
+ globals->get_subsystem_mgr()->bind();
+ globals->get_subsystem_mgr()->init();
+
+ global_nasalMinimalInit = false;
+ globals->get_subsystem_mgr()->add<FGNasalSys>();
+ globals->get_subsystem_mgr()->postinit();
+}
+
// ---------------------------------------------------------------------------
// Helpers to build a device property node from an XML snippet and configure
// a TestInputDevice with it. The device node lives in a detached property
@@ -77,14 +119,14 @@ private:
static SGSharedPtr<TestInputDevice> makeDevice(const std::string& name,
const std::string& xmlSnippet)
{
- auto* device = new TestInputDevice(name);
+ SGSharedPtr<TestInputDevice> device = new TestInputDevice(name);
device->SetUniqueName(name);
// Parse the XML snippet into a fresh, standalone property node
SGPropertyNode_ptr node = FGTestApi::propsFromString(xmlSnippet);
device->Configure(node);
- return SGSharedPtr<TestInputDevice>(device);
+ return device;
}
// ---------------------------------------------------------------------------
@@ -988,6 +1030,94 @@ void InputDeviceTests::testRepeatableWithLongPress()
CPPUNIT_ASSERT_EQUAL(0, _longPressCmd.callCount); // still only from scenario 1
}
+// ---------------------------------------------------------------------------
+// testNasalDevice
+//
+// Verify that sendFeatureReport() can be called from inside the <nasal><open>
+// block of a device XML config, and that the call reaches the device's
+// SendFeatureReport override.
+// ---------------------------------------------------------------------------
+void InputDeviceTests::testNasalDevice()
+{
+ initNasalForTest();
+
+ auto device = makeDevice("nasal-test-device", R"(
+ <PropertyList>
+ <nasal>
+ <open>
+ <![CDATA[
+ logprint(LOG_INFO, "In nasal open block");
+ device.sendFeatureReport(42, [10, 20, 30]);
+ logprint(LOG_INFO, "After sendFeatureReport in nasal open block");
+ ]]>
+ </open>
+ </nasal>
+ </PropertyList>
+ )");
+
+ CPPUNIT_ASSERT_EQUAL(0u, device->getLastFeatureReportId());
+ device->Open();
+ device->postOpen();
+
+ CPPUNIT_ASSERT_EQUAL(42u, device->getLastFeatureReportId());
+ auto bytes = device->getLastFeatureReportData();
+ CPPUNIT_ASSERT_EQUAL(size_t(3), bytes.size());
+ CPPUNIT_ASSERT_EQUAL(static_cast<uint8_t>(10), bytes[0]);
+ CPPUNIT_ASSERT_EQUAL(static_cast<uint8_t>(20), bytes[1]);
+ CPPUNIT_ASSERT_EQUAL(static_cast<uint8_t>(30), bytes[2]);
+}
+
+// ---------------------------------------------------------------------------
+// testNasalClose
+//
+// Verify that the <nasal><close> callback fires *before* the virtual Close()
+// method. The nasal block calls device.sendFeatureReport(), which updates
+// the TestInputDevice's internal state. Close() records whether that state
+// was already populated when it ran. If nasal fired first the flag will be
+// true; if Close() ran first it would be false.
+// ---------------------------------------------------------------------------
+void InputDeviceTests::testNasalClose()
+{
+ initNasalForTest();
+
+ auto device = makeDevice("nasal-close-device", R"(
+ <PropertyList>
+ <nasal>
+ <close>
+ <![CDATA[
+ # This executes before the virtual Close() call.
+ # Calling sendFeatureReport() here verifies the device API is
+ # still available (i.e. Close() has not yet severed the link).
+ device.sendFeatureReport(13, [0xAA, 0xBB, 0xCC]);
+ ]]>
+ </close>
+ </nasal>
+ </PropertyList>
+ )");
+
+ // Sanity: no report sent yet, Close() not yet called
+ CPPUNIT_ASSERT_EQUAL(0u, device->getLastFeatureReportId());
+ CPPUNIT_ASSERT(!device->wasCloseCalled());
+
+ device->doClose();
+
+ // The nasal <close> block called sendFeatureReport(13, .....
[truncated message content] |
|
From: <fli...@li...> - 2026-05-13 09:21:36
|
unknown user pushed a commit to branch next
in repository flightgear.
The following commit(s) were added to refs/heads/next by this push:
new 472ce1427 CI: use the C.UTF-8 locale
472ce1427 is described below
SF URL: http://sourceforge.net/p/flightgear/flightgear/ci/472ce1427d84f57a43e9177829c0d14706b7ef3e/
Commit: 472ce1427d84f57a43e9177829c0d14706b7ef3e
Author: Florent Rougon
Committer: Florent Rougon
AuthorDate: Wed May 13 09:32:12 2026 +0200
CI: use the C.UTF-8 locale
The goal is to get rid of the following message when building FG:
Generating qrc_fgqcanvas_resources.cpp
Detected locale "C" with character encoding "ANSI_X3.4-1968", which is
not UTF-8. Qt depends on a UTF-8 locale, and has switched to "C.UTF-8"
instead. If this causes problems, reconfigure your locale. (...)
---
.gitlab-ci.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9a149a208..b4e3fd7e6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -23,6 +23,7 @@ spec:
---
variables:
+ LC_CTYPE: C.UTF-8
BUILD_DIR: "$CI_PROJECT_DIR/build"
PREFIX_DIR: "$CI_PROJECT_DIR/dist"
# cache:key is not allowed to contain '/' characters
|
|
From: <fli...@li...> - 2026-05-12 15:56:26
|
unknown user pushed a change to annotated tag 2024.1.6-rc1
in repository fgmeta.
at 602e652 (tag)
tagging 5923e28f93e1bd29a4452c177ca7b97f0c8cea37 (commit)
replaces 2024.1.5
by Automatic Release Builder
on Tue May 12 09:21:52 2026 +0100
- Log -----------------------------------------------------------------
Release version 2024.1.6-rc1
-----------------------------------------------------------------------
No new revisions were added by this update.
|
|
From: <fli...@li...> - 2026-05-12 12:56:26
|
unknown user pushed a commit to branch release/2024.1
in repository simgear.
The following commit(s) were added to refs/heads/release/2024.1 by this push:
new 50141d88 New version: 2024.1.6-rc1
50141d88 is described below
SF URL: http://sourceforge.net/p/flightgear/simgear/ci/50141d88b1d7c68a97035e6d6f524e59562f34b1/
Commit: 50141d88b1d7c68a97035e6d6f524e59562f34b1
Author: Automatic Release Builder
Committer: Automatic Release Builder
AuthorDate: Tue May 12 09:21:35 2026 +0100
New version: 2024.1.6-rc1
---
simgear-version | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/simgear-version b/simgear-version
index 394e5914..b39be9db 100644
--- a/simgear-version
+++ b/simgear-version
@@ -1 +1 @@
-2024.1.5
+2024.1.6
|
|
From: <fli...@li...> - 2026-05-12 11:56:26
|
unknown user pushed a commit to branch release/2024.1
in repository flightgear.
The following commit(s) were added to refs/heads/release/2024.1 by this push:
new 4ad629a70 New version: 2024.1.6-rc1
4ad629a70 is described below
SF URL: http://sourceforge.net/p/flightgear/flightgear/ci/4ad629a70eb2457733bbd8eaab8ccfd1f8ea8712/
Commit: 4ad629a70eb2457733bbd8eaab8ccfd1f8ea8712
Author: Automatic Release Builder
Committer: Automatic Release Builder
AuthorDate: Tue May 12 09:21:39 2026 +0100
New version: 2024.1.6-rc1
---
flightgear-version | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/flightgear-version b/flightgear-version
index 394e5914c..b39be9dbd 100644
--- a/flightgear-version
+++ b/flightgear-version
@@ -1 +1 @@
-2024.1.5
+2024.1.6
|
|
From: <fli...@li...> - 2026-05-12 09:56:26
|
unknown user pushed a change to annotated tag 2024.1.6-rc1
in repository flightgear.
at 870d015e0 (tag)
tagging 4ad629a70eb2457733bbd8eaab8ccfd1f8ea8712 (commit)
replaces 2024.1.5
by Automatic Release Builder
on Tue May 12 09:21:39 2026 +0100
- Log -----------------------------------------------------------------
Version 2024.1.6-rc1
-----------------------------------------------------------------------
This annotated tag includes the following new commits:
new 4ad629a70 New version: 2024.1.6-rc1
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
|
|
From: <fli...@li...> - 2026-05-12 08:22:46
|
unknown user pushed a change to annotated tag 2024.1.6-rc1
in repository simgear.
at ec9ffde7 (tag)
tagging 50141d88b1d7c68a97035e6d6f524e59562f34b1 (commit)
replaces 2024.1.5
by Automatic Release Builder
on Tue May 12 09:21:35 2026 +0100
- Log -----------------------------------------------------------------
Version 2024.1.6-rc1
-----------------------------------------------------------------------
No new revisions were added by this update.
|
|
From: <fli...@li...> - 2026-05-12 08:22:05
|
unknown user pushed a commit to branch release/2024.1
in repository fgmeta.
The following commit(s) were added to refs/heads/release/2024.1 by this push:
new 5923e28 New version: 2024.1.6-rc1
5923e28 is described below
SF URL: http://sourceforge.net/p/flightgear/fgmeta/ci/5923e28f93e1bd29a4452c177ca7b97f0c8cea37/
Commit: 5923e28f93e1bd29a4452c177ca7b97f0c8cea37
Author: Automatic Release Builder
Committer: Automatic Release Builder
AuthorDate: Tue May 12 09:21:52 2026 +0100
New version: 2024.1.6-rc1
---
fgdata | 2 +-
flightgear | 2 +-
simgear | 2 +-
version | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fgdata b/fgdata
index ad605e8..29d4a84 160000
--- a/fgdata
+++ b/fgdata
@@ -1 +1 @@
-Subproject commit ad605e85114f80bf23bbb129b244ea90c10024ee
+Subproject commit 29d4a84e674cb9e15583958ceed6443c10b3ad5f
diff --git a/flightgear b/flightgear
index eb41dd5..4ad629a 160000
--- a/flightgear
+++ b/flightgear
@@ -1 +1 @@
-Subproject commit eb41dd5ab3ec99c1a00828dead065e8c9debf1aa
+Subproject commit 4ad629a70eb2457733bbd8eaab8ccfd1f8ea8712
diff --git a/simgear b/simgear
index 02118eb..50141d8 160000
--- a/simgear
+++ b/simgear
@@ -1 +1 @@
-Subproject commit 02118eb46220144b408efab7af381443cd85c311
+Subproject commit 50141d88b1d7c68a97035e6d6f524e59562f34b1
diff --git a/version b/version
index 394e591..b39be9d 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-2024.1.5
+2024.1.6
|
|
From: <fli...@li...> - 2026-05-07 05:49:49
|
unknown user pushed a commit to branch next
in repository simgear.
The following commit(s) were added to refs/heads/next by this push:
new fa14d6cd Fix crash when NasalCode call fails
fa14d6cd is described below
SF URL: http://sourceforge.net/p/flightgear/simgear/ci/fa14d6cde0baf7f6397bf5298e350c20491d37a7/
Commit: fa14d6cde0baf7f6397bf5298e350c20491d37a7
Author: James Turner
Committer: James Turner
AuthorDate: Wed May 6 11:55:50 2026 +0100
Fix crash when NasalCode call fails
---
simgear/nasal/cppbind/NasalCode.cxx | 25 +++++++++++++++++++++++++
simgear/nasal/cppbind/test/cppbind_test.cxx | 22 ++++++++++++++++++++++
2 files changed, 47 insertions(+)
diff --git a/simgear/nasal/cppbind/NasalCode.cxx b/simgear/nasal/cppbind/NasalCode.cxx
index 2be18b6a..a0cdc450 100644
--- a/simgear/nasal/cppbind/NasalCode.cxx
+++ b/simgear/nasal/cppbind/NasalCode.cxx
@@ -7,6 +7,8 @@
#include <sstream>
+#include <simgear/structure/exception.hxx>
+
namespace nasal {
//----------------------------------------------------------------------------
@@ -67,6 +69,17 @@ naRef NasalCode::doCall(Context& ctx, std::initializer_list<naRef> args) const
naNil() // locals
);
+ // naCallMethodCtx has already invoked the registered error handler
+ // (which logs the error). Re-surface it as a C++ exception so that
+ // callers can detect the failure and disable the offending code path.
+ if (const char* err = naGetError(ctx)) {
+ int line = naGetLine(ctx, 0);
+ char* file = naStr_data(naGetSourceFile(ctx, 0));
+ throw sg_exception(std::string("Nasal runtime error: ") + err,
+ "",
+ sg_location(file, line));
+ }
+
return result;
}
@@ -94,6 +107,18 @@ naRef NasalCode::callWithLocals(naRef locals) const
locals);
naGCRelease(lsave);
+
+ // naCallMethodCtx has already invoked the registered error handler
+ // (which logs the error). Re-surface it as a C++ exception so that
+ // callers can detect the failure and disable the offending code path.
+ if (const char* err = naGetError(ctx)) {
+ int line = naGetLine(ctx, 0);
+ char* file = naStr_data(naGetSourceFile(ctx, 0));
+ throw sg_exception(std::string("Nasal runtime error: ") + err,
+ "",
+ sg_location(file, line));
+ }
+
return result;
}
diff --git a/simgear/nasal/cppbind/test/cppbind_test.cxx b/simgear/nasal/cppbind/test/cppbind_test.cxx
index f32b681d..2f8ab823 100644
--- a/simgear/nasal/cppbind/test/cppbind_test.cxx
+++ b/simgear/nasal/cppbind/test/cppbind_test.cxx
@@ -10,6 +10,7 @@
#include <simgear/nasal/cppbind/NasalCode.hxx>
#include <simgear/nasal/cppbind/NasalHash.hxx>
#include <simgear/nasal/cppbind/NasalString.hxx>
+#include <simgear/structure/exception.hxx>
#include <simgear/structure/map.hxx>
#include <cstring>
@@ -579,4 +580,25 @@ BOOST_AUTO_TEST_CASE(nasal_code)
naRef result = code.callWithLocals(locals.get_naRef());
BOOST_CHECK_EQUAL(ctx.from_nasal<double>(result), 42.0);
}
+
+ // call() with a runtime error must throw sg_exception, not crash
+ {
+ TestContext ctx;
+ Hash globals(ctx);
+
+ NasalCode code(globals.get_naRef(), "undefined_sym()");
+ BOOST_REQUIRE(code.isValid()); // parses fine; error is at call time
+ BOOST_CHECK_THROW(code.call(), sg_exception);
+ }
+
+ // callWithLocals() with a runtime error must also throw sg_exception
+ {
+ TestContext ctx;
+ Hash locals(ctx);
+ Hash globals(ctx);
+
+ NasalCode code(globals.get_naRef(), "no_such_func()");
+ BOOST_REQUIRE(code.isValid());
+ BOOST_CHECK_THROW(code.callWithLocals(locals.get_naRef()), sg_exception);
+ }
}
|
|
From: <fli...@li...> - 2026-05-03 20:49:49
|
unknown user pushed a commit to branch next
in repository flightgear.
The following commit(s) were added to refs/heads/next by this push:
new a4b17ea34 Use CMake target_sources()
a4b17ea34 is described below
SF URL: http://sourceforge.net/p/flightgear/flightgear/ci/a4b17ea3489c14784436aa416ed444a1dbb39814/
Commit: a4b17ea3489c14784436aa416ed444a1dbb39814
Author: James Turner
Committer: James Turner
AuthorDate: Fri May 1 09:48:04 2026 +0100
Use CMake target_sources()
---
3rdparty/mongoose/CMakeLists.txt | 12 +---------
CMakeModules/FlightGearComponent.cmake | 16 --------------
src/AIModel/CMakeLists.txt | 3 +--
src/ATC/CMakeLists.txt | 10 ++-------
src/Add-ons/CMakeLists.txt | 40 +++++++++++++++-------------------
src/Aircraft/CMakeLists.txt | 3 +--
src/Airports/CMakeLists.txt | 10 ++-------
src/Autopilot/CMakeLists.txt | 12 ++++------
src/Canvas/CMakeLists.txt | 12 ++++------
src/Environment/CMakeLists.txt | 10 ++-------
src/FDM/CMakeLists.txt | 8 +++----
src/FDM/JSBSim/CMakeLists.txt | 1 -
src/FDM/YASim/CMakeLists.txt | 5 +++--
src/GUI/CMakeLists.txt | 3 +--
src/Input/CMakeLists.txt | 3 +--
src/Instrumentation/CMakeLists.txt | 11 +++-------
src/Main/CMakeLists.txt | 10 ++-------
src/Model/CMakeLists.txt | 10 ++-------
src/MultiPlayer/CMakeLists.txt | 12 ++++------
src/Navaids/CMakeLists.txt | 10 ++-------
src/Network/CMakeLists.txt | 3 +--
src/Network/DDS/CMakeLists.txt | 5 +++--
src/Network/Swift/CMakeLists.txt | 12 ++++------
src/Network/http/CMakeLists.txt | 12 ++++------
src/Radio/CMakeLists.txt | 11 ++--------
src/Scenery/CMakeLists.txt | 5 +++--
src/Scripting/CMakeLists.txt | 4 ++--
src/Sound/CMakeLists.txt | 11 ++--------
src/Systems/CMakeLists.txt | 11 ++--------
src/Time/CMakeLists.txt | 10 ++-------
src/Traffic/CMakeLists.txt | 9 +-------
src/Translations/CMakeLists.txt | 12 ++++------
src/Viewer/CMakeLists.txt | 4 ++--
33 files changed, 89 insertions(+), 221 deletions(-)
diff --git a/3rdparty/mongoose/CMakeLists.txt b/3rdparty/mongoose/CMakeLists.txt
index 26182797d..7d7fc94b0 100644
--- a/3rdparty/mongoose/CMakeLists.txt
+++ b/3rdparty/mongoose/CMakeLists.txt
@@ -1,11 +1 @@
-include(FlightGearComponent)
-
-set(SOURCES
- mongoose.c
- )
-
-set(HEADERS
- mongoose.h
- )
-
-flightgear_component(Mongoose "${SOURCES}" "${HEADERS}")
+target_sources(fgfsObjects PRIVATE mongoose.c mongoose.h)
diff --git a/CMakeModules/FlightGearComponent.cmake b/CMakeModules/FlightGearComponent.cmake
deleted file mode 100644
index da648e98b..000000000
--- a/CMakeModules/FlightGearComponent.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-
-function(flightgear_component name sources)
- foreach(s ${sources})
- target_sources(fgfsObjects PRIVATE ${s})
- endforeach()
-
- foreach(h ${ARGV2})
- target_sources(fgfsObjects PRIVATE ${h})
- endforeach()
-
- # third argument is TEST_SOURCES
- foreach(t ${ARGV3})
- set_property(GLOBAL
- APPEND PROPERTY FG_TEST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${t}")
- endforeach()
-endfunction()
diff --git a/src/AIModel/CMakeLists.txt b/src/AIModel/CMakeLists.txt
index 3d9af46df..8def7e22b 100644
--- a/src/AIModel/CMakeLists.txt
+++ b/src/AIModel/CMakeLists.txt
@@ -1,7 +1,6 @@
# SPDX-FileCopyrightText: Copyright (C) 2010 James Turner
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
set(SOURCES
AIAircraft.cxx
@@ -60,4 +59,4 @@ if(ENABLE_SWIFT)
list(APPEND SOURCES AISwiftAircraft.cpp)
endif()
-flightgear_component(AIModel "${SOURCES}" "${HEADERS}")
+target_sources(fgfsObjects PRIVATE ${SOURCES} ${HEADERS})
diff --git a/src/ATC/CMakeLists.txt b/src/ATC/CMakeLists.txt
index d59ceee27..5cf341ad2 100644
--- a/src/ATC/CMakeLists.txt
+++ b/src/ATC/CMakeLists.txt
@@ -1,8 +1,7 @@
# SPDX-FileCopyrightText: 2010 James Turner
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
AirportGroundRadar.cxx
atc_mgr.cxx
trafficcontrol.cxx
@@ -16,9 +15,6 @@ set(SOURCES
GroundController.cxx
StartupController.cxx
TowerController.cxx
- )
-
-set(HEADERS
AirportGroundRadar.hxx
atc_mgr.hxx
trafficcontrol.hxx
@@ -33,6 +29,4 @@ set(HEADERS
StartupController.hxx
TowerController.hxx
QuadTree.hxx
- )
-
-flightgear_component(ATC "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/Add-ons/CMakeLists.txt b/src/Add-ons/CMakeLists.txt
index d4176c3f9..ae5879a04 100644
--- a/src/Add-ons/CMakeLists.txt
+++ b/src/Add-ons/CMakeLists.txt
@@ -1,26 +1,22 @@
# SPDX-FileCopyrightText: 2017 Florent Rougon
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
-set(SOURCES Addon.cxx
- AddonManager.cxx
- AddonMetadataParser.cxx
- AddonResourceProvider.cxx
- AddonVersion.cxx
- contacts.cxx
- exceptions.cxx
- )
-
-set(HEADERS addon_fwd.hxx
- Addon.hxx
- AddonManager.hxx
- AddonMetadataParser.hxx
- AddonResourceProvider.hxx
- AddonVersion.hxx
- contacts.hxx
- exceptions.hxx
- pointer_traits.hxx
- )
-
-flightgear_component(AddonManagement "${SOURCES}" "${HEADERS}")
+target_sources(fgfsObjects PRIVATE
+ Addon.cxx
+ AddonManager.cxx
+ AddonMetadataParser.cxx
+ AddonResourceProvider.cxx
+ AddonVersion.cxx
+ contacts.cxx
+ exceptions.cxx
+ addon_fwd.hxx
+ Addon.hxx
+ AddonManager.hxx
+ AddonMetadataParser.hxx
+ AddonResourceProvider.hxx
+ AddonVersion.hxx
+ contacts.hxx
+ exceptions.hxx
+ pointer_traits.hxx
+)
diff --git a/src/Aircraft/CMakeLists.txt b/src/Aircraft/CMakeLists.txt
index dff060003..b753a1154 100644
--- a/src/Aircraft/CMakeLists.txt
+++ b/src/Aircraft/CMakeLists.txt
@@ -1,7 +1,6 @@
# SPDX-FileCopyrightText: 2010 James Turner <ja...@fl...>
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
set(SOURCES
controls.cxx
@@ -26,4 +25,4 @@ set(HEADERS
)
-flightgear_component(Aircraft "${SOURCES}" "${HEADERS}")
+target_sources(fgfsObjects PRIVATE ${SOURCES} ${HEADERS})
diff --git a/src/Airports/CMakeLists.txt b/src/Airports/CMakeLists.txt
index fc77698d2..59a82dab0 100644
--- a/src/Airports/CMakeLists.txt
+++ b/src/Airports/CMakeLists.txt
@@ -1,9 +1,8 @@
# SPDX-FileCopyrightText: 2010 James Turner
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
apt_loader.cxx
dynamicloader.cxx
dynamics.cxx
@@ -20,9 +19,6 @@ set(SOURCES
xmlloader.cxx
airportdynamicsmanager.cxx
AirportBuilder.cxx
- )
-
-set(HEADERS
airports_fwd.hxx
apt_loader.hxx
dynamicloader.hxx
@@ -40,6 +36,4 @@ set(HEADERS
xmlloader.hxx
airportdynamicsmanager.hxx
AirportBuilder.hxx
- )
-
-flightgear_component(Airports "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/Autopilot/CMakeLists.txt b/src/Autopilot/CMakeLists.txt
index 856b90372..1bb35c978 100644
--- a/src/Autopilot/CMakeLists.txt
+++ b/src/Autopilot/CMakeLists.txt
@@ -1,6 +1,7 @@
-include(FlightGearComponent)
+# SPDX-FileCopyrightText: 2010 James Turner
+# SPDX-License-Identifier: GPL-2.0-or-later
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
analogcomponent.cxx
autopilot.cxx
autopilotgroup.cxx
@@ -13,9 +14,6 @@ set(SOURCES
pisimplecontroller.cxx
predictor.cxx
route_mgr.cxx
- )
-
-set(HEADERS
analogcomponent.hxx
autopilot.hxx
autopilotgroup.hxx
@@ -28,6 +26,4 @@ set(HEADERS
pisimplecontroller.hxx
predictor.hxx
route_mgr.hxx
- )
-
-flightgear_component(Autopilot "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/Canvas/CMakeLists.txt b/src/Canvas/CMakeLists.txt
index f632ecfb9..e6208096f 100644
--- a/src/Canvas/CMakeLists.txt
+++ b/src/Canvas/CMakeLists.txt
@@ -1,17 +1,13 @@
-include(FlightGearComponent)
+# SPDX-FileCopyrightText: 2013 Thomas Geymayer
+# SPDX-License-Identifier: GPL-2.0-or-later
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
canvas_mgr.cxx
FGCanvasSystemAdapter.cxx
texture_replace.cxx
-)
-
-set(HEADERS
canvas_mgr.hxx
FGCanvasSystemAdapter.hxx
gui_mgr.hxx
texture_replace.hxx
)
-
-# gui_mgr.cxx is compiled differently for testing
-flightgear_component(Canvas "${SOURCES}" "${HEADERS}" gui_mgr.cxx)
+set_property(GLOBAL APPEND PROPERTY FG_TEST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/gui_mgr.cxx")
diff --git a/src/Environment/CMakeLists.txt b/src/Environment/CMakeLists.txt
index 8198ac16a..4acd41b60 100644
--- a/src/Environment/CMakeLists.txt
+++ b/src/Environment/CMakeLists.txt
@@ -1,9 +1,8 @@
# SPDX-FileCopyrightText: 2010 James Turner
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
atmosphere.cxx
environment.cxx
environment_ctrl.cxx
@@ -21,9 +20,6 @@ set(SOURCES
presets.cxx
gravity.cxx
magvarmanager.cxx
- )
-
-set(HEADERS
atmosphere.hxx
environment.hxx
environment_ctrl.hxx
@@ -41,6 +37,4 @@ set(HEADERS
presets.hxx
gravity.hxx
magvarmanager.hxx
- )
-
-flightgear_component(Environment "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/FDM/CMakeLists.txt b/src/FDM/CMakeLists.txt
index 9743617cd..045f310d2 100644
--- a/src/FDM/CMakeLists.txt
+++ b/src/FDM/CMakeLists.txt
@@ -1,4 +1,5 @@
-include(FlightGearComponent)
+# SPDX-FileCopyrightText: 2010 James Turner
+# SPDX-License-Identifier: GPL-2.0-or-later
if(SP_FDMS)
set(SP_FDM_SOURCES
@@ -18,7 +19,7 @@ set (SP_FDM_HEADERS
SP/AISim.hpp
)
endif()
-
+
set(SOURCES
NullFDM.cxx
UFO.cxx
@@ -51,7 +52,7 @@ set(HEADERS
ls_matrix.h
)
-flightgear_component(FDM "${SOURCES}" "${HEADERS}")
+target_sources(fgfsObjects PRIVATE ${SOURCES} ${HEADERS})
if(ENABLE_YASIM)
add_subdirectory(YASim)
@@ -61,4 +62,3 @@ endif()
if(ENABLE_JSBSIM)
add_subdirectory(JSBSim)
endif()
-
diff --git a/src/FDM/JSBSim/CMakeLists.txt b/src/FDM/JSBSim/CMakeLists.txt
index 5f7eb2946..65a4dc1cc 100644
--- a/src/FDM/JSBSim/CMakeLists.txt
+++ b/src/FDM/JSBSim/CMakeLists.txt
@@ -1,4 +1,3 @@
-include(FlightGearComponent)
set(HEADERS
FGFDMExec.h
diff --git a/src/FDM/YASim/CMakeLists.txt b/src/FDM/YASim/CMakeLists.txt
index 8a63959f1..de3ffe404 100644
--- a/src/FDM/YASim/CMakeLists.txt
+++ b/src/FDM/YASim/CMakeLists.txt
@@ -1,4 +1,5 @@
-include(FlightGearComponent)
+# SPDX-FileCopyrightText: 2010 James Turner
+# SPDX-License-Identifier: GPL-2.0-or-later
set(COMMON
Airplane.cpp
@@ -36,7 +37,7 @@ set(SOURCES
FGGround.cpp
)
-flightgear_component(YASim "${SOURCES}")
+target_sources(fgfsObjects PRIVATE ${SOURCES})
add_executable(yasim yasim-test.cpp ${COMMON})
add_executable(yasim-proptest proptest.cpp ${COMMON})
diff --git a/src/GUI/CMakeLists.txt b/src/GUI/CMakeLists.txt
index 879fa2e32..b40239ca8 100644
--- a/src/GUI/CMakeLists.txt
+++ b/src/GUI/CMakeLists.txt
@@ -1,7 +1,6 @@
# SPDX-FileCopyrightText: 2010 James Turner <ja...@fl...>
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
set(SOURCES
AirportListModel.cxx
@@ -247,7 +246,7 @@ if (HAVE_QT)
endif()
-flightgear_component(GUI "${SOURCES}" "${HEADERS}")
+target_sources(fgfsObjects PRIVATE ${SOURCES} ${HEADERS})
if (APPLE)
# PCH doesn't work for Objective-C++
diff --git a/src/Input/CMakeLists.txt b/src/Input/CMakeLists.txt
index cde72863e..4fc7208ed 100644
--- a/src/Input/CMakeLists.txt
+++ b/src/Input/CMakeLists.txt
@@ -1,7 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2011 James Turner <ja...@fl...>
-include(FlightGearComponent)
IF(APPLE)
# no Mac implementation, use HID
@@ -96,4 +95,4 @@ if (ENABLE_HID_INPUT)
endif()
endif()
-flightgear_component(Input "${SOURCES}" "${HEADERS}")
+target_sources(fgfsObjects PRIVATE ${SOURCES} ${HEADERS})
diff --git a/src/Instrumentation/CMakeLists.txt b/src/Instrumentation/CMakeLists.txt
index 5cfa717ac..193db69b2 100644
--- a/src/Instrumentation/CMakeLists.txt
+++ b/src/Instrumentation/CMakeLists.txt
@@ -1,6 +1,7 @@
-include(FlightGearComponent)
+# SPDX-FileCopyrightText: 2010 James Turner
+# SPDX-License-Identifier: GPL-2.0-or-later
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
AbstractInstrument.cxx
adf.cxx
airspeed_indicator.cxx
@@ -33,9 +34,6 @@ set(SOURCES
transponder.cxx
turn_indicator.cxx
vertical_speed_indicator.cxx
- )
-
-set(HEADERS
AbstractInstrument.hxx
adf.hxx
airspeed_indicator.hxx
@@ -69,6 +67,3 @@ set(HEADERS
turn_indicator.hxx
vertical_speed_indicator.hxx
)
-
-
-flightgear_component(Instruments "${SOURCES}" "${HEADERS}")
diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt
index 41ca847f6..788aa34a0 100644
--- a/src/Main/CMakeLists.txt
+++ b/src/Main/CMakeLists.txt
@@ -2,7 +2,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# CMake module includes.
-include(FlightGearComponent)
include(SetupFGFSBundle)
include(SetupFGFSEmbeddedResources)
include(SetupFGFSIncludes)
@@ -13,8 +12,7 @@ if(MSVC)
set(MS_RESOURCE_FILE flightgear.rc)
endif(MSVC)
-set(SOURCES
-
+target_sources(fgfsObjects PRIVATE
fg_commands.cxx
fg_init.cxx
fg_io.cxx
@@ -34,9 +32,6 @@ set(SOURCES
util.cxx
ErrorReporter.cxx
${MS_RESOURCE_FILE}
-)
-
-set(HEADERS
AircraftDirVisitorBase.hxx
fg_commands.hxx
fg_init.hxx
@@ -56,8 +51,7 @@ set(HEADERS
ErrorReporter.hxx
sentryIntegration.hxx
)
-
-flightgear_component(Main "${SOURCES}" "${HEADERS}" sentryIntegration.cxx)
+set_property(GLOBAL APPEND PROPERTY FG_TEST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/sentryIntegration.cxx")
# the main() function
set(MAIN_SOURCE
diff --git a/src/Model/CMakeLists.txt b/src/Model/CMakeLists.txt
index 071d8048e..7c31eea2a 100644
--- a/src/Model/CMakeLists.txt
+++ b/src/Model/CMakeLists.txt
@@ -1,18 +1,12 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2011 James Turner <ja...@fl...>
-include(FlightGearComponent)
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
acmodel.cxx
modelmgr.cxx
validateSharedModels.cxx
- )
-
-set(HEADERS
acmodel.hxx
modelmgr.hxx
validateSharedModels.hxx
- )
-
-flightgear_component(Model "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/MultiPlayer/CMakeLists.txt b/src/MultiPlayer/CMakeLists.txt
index 8a59ad3de..4d14a5db3 100644
--- a/src/MultiPlayer/CMakeLists.txt
+++ b/src/MultiPlayer/CMakeLists.txt
@@ -1,20 +1,16 @@
-include(FlightGearComponent)
+# SPDX-FileCopyrightText: 2010 James Turner
+# SPDX-License-Identifier: GPL-2.0-or-later
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
multiplaymgr.cxx
tiny_xdr.cxx
MPServerResolver.cxx
mpirc.cxx
cpdlc.cxx
- )
-
-set(HEADERS
multiplaymgr.hxx
tiny_xdr.hxx
MPServerResolver.hxx
mpirc.hxx
cpdlc.hxx
mpmessages.hxx
- )
-
-flightgear_component(MultiPlayer "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/Navaids/CMakeLists.txt b/src/Navaids/CMakeLists.txt
index e92976455..87d94d8a1 100644
--- a/src/Navaids/CMakeLists.txt
+++ b/src/Navaids/CMakeLists.txt
@@ -1,9 +1,8 @@
# SPDX-FileCopyrightText: 2010 James Turner
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
airways.cxx
fixlist.cxx
markerbeacon.cxx
@@ -22,9 +21,6 @@ set(SOURCES
PositionedOctree.cxx
PolyLine.cxx
SHPParser.cxx
- )
-
-set(HEADERS
airways.hxx
fixlist.hxx
markerbeacon.hxx
@@ -44,6 +40,4 @@ set(HEADERS
PolyLine.hxx
SHPParser.hxx
CacheSchema.h
- )
-
-flightgear_component(Navaids "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/Network/CMakeLists.txt b/src/Network/CMakeLists.txt
index 38b76551c..19727b9b1 100644
--- a/src/Network/CMakeLists.txt
+++ b/src/Network/CMakeLists.txt
@@ -1,7 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2010 James Turner <ja...@fl...>
-include(FlightGearComponent)
set(SOURCES
ATC-Inputs.cxx
@@ -80,7 +79,7 @@ if(ENABLE_IAX)
list(APPEND HEADERS fgcom.hxx)
endif()
-flightgear_component(Network "${SOURCES}" "${HEADERS}")
+target_sources(fgfsObjects PRIVATE ${SOURCES} ${HEADERS})
if (CycloneDDS_FOUND)
add_subdirectory(DDS)
diff --git a/src/Network/DDS/CMakeLists.txt b/src/Network/DDS/CMakeLists.txt
index 745238150..7b55934fc 100644
--- a/src/Network/DDS/CMakeLists.txt
+++ b/src/Network/DDS/CMakeLists.txt
@@ -1,4 +1,5 @@
-include(FlightGearComponent)
+# SPDX-FileCopyrightText: 2020 Erik Hofman
+# SPDX-License-Identifier: GPL-2.0-or-later
set(SOURCES
dds_ctrls.c
@@ -31,4 +32,4 @@ add_executable(fg_dds_prop
setup_fgfs_libraries(fg_dds_prop)
-flightgear_component(Network "${SOURCES}" "${HEADERS}")
+target_sources(fgfsObjects PRIVATE ${SOURCES} ${HEADERS})
diff --git a/src/Network/Swift/CMakeLists.txt b/src/Network/Swift/CMakeLists.txt
index f2a2a3b67..d7a00231e 100644
--- a/src/Network/Swift/CMakeLists.txt
+++ b/src/Network/Swift/CMakeLists.txt
@@ -1,6 +1,7 @@
-include(FlightGearComponent)
+# SPDX-FileCopyrightText: 2019 Lars Toenning
+# SPDX-License-Identifier: GPL-2.0-or-later
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
swift_connection.cxx
dbusconnection.cpp
dbusobject.cpp
@@ -12,9 +13,6 @@ set(SOURCES
service.cpp
traffic.cpp
SwiftAircraftManager.cpp
- )
-
-set(HEADERS
swift_connection.hxx
dbusconnection.h
dbusobject.h
@@ -27,6 +25,4 @@ set(HEADERS
service.h
traffic.h
SwiftAircraftManager.h
- )
-
-flightgear_component(Swift "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/Network/http/CMakeLists.txt b/src/Network/http/CMakeLists.txt
index 5f426515b..3ffd79124 100644
--- a/src/Network/http/CMakeLists.txt
+++ b/src/Network/http/CMakeLists.txt
@@ -1,6 +1,7 @@
-include(FlightGearComponent)
+# SPDX-FileCopyrightText: 2014 Torsten Dreyer
+# SPDX-License-Identifier: GPL-2.0-or-later
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
httpd.cxx
ScreenshotUriHandler.cxx
PropertyUriHandler.cxx
@@ -14,9 +15,6 @@ set(SOURCES
PropertyChangeObserver.cxx
jsonprops.cxx
SimpleDOM.cxx
- )
-
-set(HEADERS
urihandler.hxx
httpd.hxx
ScreenshotUriHandler.hxx
@@ -33,6 +31,4 @@ set(HEADERS
MirrorPropertyTreeWebsocket.hxx
jsonprops.hxx
SimpleDOM.hxx
- )
-
-flightgear_component(Http "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/Radio/CMakeLists.txt b/src/Radio/CMakeLists.txt
index 1faf5f0ec..b11c45691 100644
--- a/src/Radio/CMakeLists.txt
+++ b/src/Radio/CMakeLists.txt
@@ -1,17 +1,10 @@
# SPDX-FileCopyrightText: 2010 James Turner
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
antenna.cxx
radio.cxx
- )
-
-set(HEADERS
antenna.hxx
radio.hxx
- )
-
-
-flightgear_component(Radio "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/Scenery/CMakeLists.txt b/src/Scenery/CMakeLists.txt
index b8cf83c34..0465b1c98 100644
--- a/src/Scenery/CMakeLists.txt
+++ b/src/Scenery/CMakeLists.txt
@@ -1,4 +1,5 @@
-include(FlightGearComponent)
+# SPDX-FileCopyrightText: 2010 James Turner
+# SPDX-License-Identifier: GPL-2.0-or-later
set(SOURCES
SceneryPager.cxx
@@ -23,4 +24,4 @@ set(HEADERS
marker.hxx
)
-flightgear_component(Scenery "${SOURCES}" "${HEADERS}")
+target_sources(fgfsObjects PRIVATE ${SOURCES} ${HEADERS})
diff --git a/src/Scripting/CMakeLists.txt b/src/Scripting/CMakeLists.txt
index d2d418a8b..27763457b 100644
--- a/src/Scripting/CMakeLists.txt
+++ b/src/Scripting/CMakeLists.txt
@@ -1,7 +1,6 @@
# SPDX-FileCopyrightText: 2010 James Turner
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
set(SOURCES
nasal-props.cxx
@@ -66,4 +65,5 @@ endif()
# NasalSys.cxx is passed as TEST_SOURCES since we need to compile it
# separately when building the test_suite
-flightgear_component(Scripting "${SOURCES}" "${HEADERS}" NasalSys.cxx)
+target_sources(fgfsObjects PRIVATE ${SOURCES} ${HEADERS})
+set_property(GLOBAL APPEND PROPERTY FG_TEST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/NasalSys.cxx")
diff --git a/src/Sound/CMakeLists.txt b/src/Sound/CMakeLists.txt
index b2839b9c1..7da31e201 100644
--- a/src/Sound/CMakeLists.txt
+++ b/src/Sound/CMakeLists.txt
@@ -1,9 +1,8 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2011 James Turner <ja...@fl...>
-include(FlightGearComponent)
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
audioident.cxx
soundgenerator.cxx
beacon.cxx
@@ -13,10 +12,6 @@ set(SOURCES
voice.cxx
voiceplayer.cxx
soundmanager.cxx
-
- )
-
-set(HEADERS
audioident.hxx
soundgenerator.hxx
beacon.hxx
@@ -28,9 +23,7 @@ set(HEADERS
soundmanager.hxx
VoiceSynthesizer.hxx
flitevoice.hxx
- )
-
-flightgear_component(Sound "${SOURCES}" "${HEADERS}")
+)
add_library(fgvoicesynth STATIC VoiceSynthesizer.cxx flitevoice.cxx)
target_link_libraries(fgvoicesynth PRIVATE flightgear_flite_hts SimGearScene)
diff --git a/src/Systems/CMakeLists.txt b/src/Systems/CMakeLists.txt
index b3515e7be..8355506cf 100644
--- a/src/Systems/CMakeLists.txt
+++ b/src/Systems/CMakeLists.txt
@@ -1,23 +1,16 @@
# SPDX-FileCopyrightText: 2010 James Turner <ja...@fl...>
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
electrical.cxx
pitot.cxx
static.cxx
system_mgr.cxx
vacuum.cxx
- )
-
-set(HEADERS
electrical.hxx
pitot.hxx
static.hxx
system_mgr.hxx
vacuum.hxx
- )
-
-
-flightgear_component(Systems "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/Time/CMakeLists.txt b/src/Time/CMakeLists.txt
index 2de807e5b..dad9419af 100644
--- a/src/Time/CMakeLists.txt
+++ b/src/Time/CMakeLists.txt
@@ -1,20 +1,14 @@
# SPDX-FileCopyrightText: 2010 James Turner <ja...@fl...>
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
TimeManager.cxx
light.cxx
tide.cxx
bodysolver.cxx
- )
-
-set(HEADERS
TimeManager.hxx
light.hxx
tide.hxx
bodysolver.hxx
- )
-
-flightgear_component(Time "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/Traffic/CMakeLists.txt b/src/Traffic/CMakeLists.txt
index 040325ab9..d7fc7164a 100644
--- a/src/Traffic/CMakeLists.txt
+++ b/src/Traffic/CMakeLists.txt
@@ -1,18 +1,11 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2011 James Turner <ja...@fl...>
-include(FlightGearComponent)
-set(SOURCES
+target_sources(fgfsObjects PRIVATE
SchedFlight.cxx
Schedule.cxx
TrafficMgr.cxx
- )
-
-set(HEADERS
SchedFlight.hxx
Schedule.hxx
TrafficMgr.hxx
)
-
-
-flightgear_component(Traffic "${SOURCES}" "${HEADERS}")
diff --git a/src/Translations/CMakeLists.txt b/src/Translations/CMakeLists.txt
index 18e0b151e..05a654e3f 100644
--- a/src/Translations/CMakeLists.txt
+++ b/src/Translations/CMakeLists.txt
@@ -1,24 +1,20 @@
# SPDX-FileCopyrightText: 2025 Florent Rougon
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
-set(SOURCES DefaultTranslationParser.cxx
+target_sources(fgfsObjects PRIVATE
+ DefaultTranslationParser.cxx
FGTranslate.cxx
LanguageInfo.cxx
TranslationDomain.cxx
TranslationResource.cxx
TranslationUnit.cxx
XLIFFParser.cxx
- )
-
-set(HEADERS DefaultTranslationParser.hxx
+ DefaultTranslationParser.hxx
FGTranslate.hxx
LanguageInfo.hxx
TranslationDomain.hxx
TranslationResource.hxx
TranslationUnit.hxx
XLIFFParser.hxx
- )
-
-flightgear_component(Translations "${SOURCES}" "${HEADERS}")
+)
diff --git a/src/Viewer/CMakeLists.txt b/src/Viewer/CMakeLists.txt
index 65d4ee7e8..e7c7e081c 100644
--- a/src/Viewer/CMakeLists.txt
+++ b/src/Viewer/CMakeLists.txt
@@ -1,7 +1,6 @@
# SPDX-FileCopyrightText: 2010 James Turner <ja...@fl...>
# SPDX-License-Identifier: GPL-2.0-or-later
-include(FlightGearComponent)
set(SOURCES
CameraGroup.cxx
@@ -45,4 +44,5 @@ if (ENABLE_OSGXR)
endif()
# view.cxx is compiled differently for testing
-flightgear_component(Viewer "${SOURCES}" "${HEADERS}" view.cxx)
+target_sources(fgfsObjects PRIVATE ${SOURCES} ${HEADERS})
+set_property(GLOBAL APPEND PROPERTY FG_TEST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/view.cxx")
|
|
From: <fli...@li...> - 2026-05-03 09:49:49
|
unknown user pushed a commit to branch release/2024.1
in repository flightgear.
The following commit(s) were added to refs/heads/release/2024.1 by this push:
new eb41dd5ab Use Sentry's real logging support
eb41dd5ab is described below
SF URL: http://sourceforge.net/p/flightgear/flightgear/ci/eb41dd5ab3ec99c1a00828dead065e8c9debf1aa/
Commit: eb41dd5ab3ec99c1a00828dead065e8c9debf1aa
Author: James Turner
Committer: James Turner
AuthorDate: Tue Apr 28 13:07:34 2026 +0100
Use Sentry's real logging support
---
CMakeLists.txt | 15 +++--
src/Main/ErrorReporter.cxx | 8 ++-
src/Main/sentryIntegration.cxx | 149 +++++++++++++++++------------------------
src/Main/sentryIntegration.hxx | 16 ++++-
4 files changed, 91 insertions(+), 97 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 985d9a3fb..138e39731 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -305,7 +305,8 @@ find_package(OpenSceneGraph 3.6.0 REQUIRED
##############################################################################
## Sentry.io setup
if (ENABLE_SENTRY)
- find_package(sentry QUIET)
+ # logging API needs sentry-native >= 0.11.1
+ find_package(sentry 0.11.1 QUIET)
# Worth nothing that while this *looks* sketchy, DSNs are fundamentally public ingestion
# endpoints and not truly protectable secrets.
@@ -315,7 +316,7 @@ if (ENABLE_SENTRY)
message(STATUS "Sentry.io crash reporting enabled")
set(HAVE_SENTRY 1)
else()
- message(STATUS "Sentry.io crash reporting disabled, Sentry SDK not found")
+ message(STATUS "Sentry.io crash reporting disabled, Sentry SDK not found (required version is 0.11.1 or higher)")
endif()
else()
message(STATUS "Sentry.io crash reporting disabled")
@@ -374,7 +375,7 @@ if (ENABLE_QT)
# short-circuit the check in FindWrapOpenGL.cmake, to avoid looking for
# AGL.frameowkr, which is removed from the Apple SDKs now
set(WrapOpenGL_AGL "-framework OpenGL")
-
+
find_package(QT NAMES ${qtNames} COMPONENTS Core)
if (QT_FOUND)
if (${QT_VERSION_MAJOR} EQUAL "5")
@@ -385,7 +386,7 @@ if (ENABLE_QT)
if (NOT Qt${QT_VERSION_MAJOR}Widgets_FOUND)
message(FATAL_ERROR "Qt support enabled, Qt was found but some required packages are missing, stopping.")
endif()
-
+
set(HAVE_QT 1)
include (Translations)
@@ -397,7 +398,7 @@ if (ENABLE_QT)
endif()
set(CMAKE_AUTOMOC OFF)
-
+
message(STATUS "Qt GUI enabled, found Qt at: ${FG_QT_ROOT_DIR}")
else()
message(STATUS "Qt support disabled, Qt/qmake not found in PATH/CMAKE_PREFIX_PATH")
@@ -425,7 +426,7 @@ message(STATUS "Min Simgear version is ${MIN_SIMGEAR_VERSION}")
if (TARGET SimGearCore)
message(STATUS "Simgear targets exist, assuming superbuild")
- # since we don't find(SimGear), we need to
+ # since we don't find(SimGear), we need to
# find a few dependencies directly
if (SG_SOUND_USES_OPENALSOFT)
message((STATUS "Finding OpenAL"))
@@ -468,7 +469,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
if(HAVE_QT)
- # if Qt is built with reduce-relocations, applicatino code
+ # if Qt is built with reduce-relocations, applicatino code
# needs to be compiled with -fPIC to match
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
diff --git a/src/Main/ErrorReporter.cxx b/src/Main/ErrorReporter.cxx
index a952321b3..3b56cbaf8 100644
--- a/src/Main/ErrorReporter.cxx
+++ b/src/Main/ErrorReporter.cxx
@@ -513,10 +513,16 @@ public:
}
}
+ std::vector<SentryExceptionData> occurrences;
+ for (const auto& e : report.errors) {
+ const auto m = static_errorIds.at(static_cast<int>(e.code)) + "-" + static_errorTypeIds.at(static_cast<int>(e.type));
+ occurrences.emplace_back(m, e.detailedInfo, e.origin.asString());
+ }
+
const int catId = static_cast<int>(report.type);
flightgear::sentryReportUserError(static_categoryIds.at(catId),
report.parameter,
- _displayNode->getStringValue());
+ occurrences);
}
void writeReportToStream(const AggregateReport& report, std::ostream& os) const;
diff --git a/src/Main/sentryIntegration.cxx b/src/Main/sentryIntegration.cxx
index 914a000f9..22de885b0 100644
--- a/src/Main/sentryIntegration.cxx
+++ b/src/Main/sentryIntegration.cxx
@@ -84,10 +84,9 @@ void sentryTraceSimgearThrow(const std::string& msg, const std::string& origin,
return;
}
- sentry_value_t exc = sentry_value_new_object();
- sentry_value_set_by_key(exc, "type", sentry_value_new_string("Exception"));
+ sentry_value_t exc = sentry_value_new_exception("Exception", msg.c_str());
+ sentry_value_set_stacktrace(exc, NULL, 0);
- std::string message = msg;
sentry_value_t info = sentry_value_new_object();
if (!origin.empty()) {
sentry_value_set_by_key(info, "origin", sentry_value_new_string(origin.c_str()));
@@ -99,12 +98,9 @@ void sentryTraceSimgearThrow(const std::string& msg, const std::string& origin,
}
sentry_set_context("what", info);
- sentry_value_set_by_key(exc, "value", sentry_value_new_string(message.c_str()));
sentry_value_t event = sentry_value_new_event();
- sentry_value_set_by_key(event, "exception", exc);
-
- sentry_event_value_add_stacktrace(event, nullptr, 0);
+ sentry_event_add_exception(event, exc);
sentry_capture_event(event);
}
@@ -120,30 +116,40 @@ public:
// we need original priority here, so we don't record MANDATORY_INFO
// or DEV_ messages, which would get noisy.
const auto op = e.originalPriority;
- if ((op != SG_WARN) && (op != SG_ALERT)) {
- return true;
+ if ((op == SG_MANDATORY_INFO) || (op == SG_DEV_WARN) || (op == SG_DEV_ALERT)) {
+ return false;
}
if ((e.debugClass == SG_OSG) && doesStringMatchPrefixes(e.message, OSG_messageWhitelist)) {
- return true;
+ return false;
}
if (doesStringMatchPrefixes(e.message, general_messageWhitelist)) {
- return true;
+ return false;
}
- if (e.message == _lastLoggedMessage) {
- _lastLoggedCount++;
- return true;
- }
+ const auto message = e.message.c_str();
+ switch (e.debugPriority) {
+ case SG_INFO:
+ sentry_log_info(message);
+ break;
+
+ case SG_WARN:
+ sentry_log_warn(message);
+ break;
+
+ case SG_ALERT:
+ sentry_log_error(message);
+ break;
- if (_lastLoggedCount > 0) {
- flightgear::addSentryBreadcrumb("(repeats " + std::to_string(_lastLoggedCount) + " times)", "info");
- _lastLoggedCount = 0;
+ case SG_DEBUG:
+ sentry_log_debug(message);
+ break;
+
+ default:
+ return false;
}
- _lastLoggedMessage = e.message;
- flightgear::addSentryBreadcrumb(e.message, (op == SG_WARN) ? "warning" : "error");
return true;
}
@@ -178,33 +184,22 @@ void sentrySimgearReportCallback(const std::string& msg, const std::string& more
}
}
- sentry_value_t exc = sentry_value_new_object();
- if (isFatal) {
- sentry_value_set_by_key(exc, "type", sentry_value_new_string("Fatal Error"));
- } else {
- sentry_value_set_by_key(exc, "type", sentry_value_new_string("Exception"));
- }
-
- sentry_value_set_by_key(exc, "value", sentry_value_new_string(msg.c_str()));
+ sentry_value_t exc = sentry_value_new_exception(isFatal ? "Fatal Error" : "Exception", msg.c_str());
+ sentry_value_set_stacktrace(exc, NULL, 0);
sentry_value_t event = sentry_value_new_event();
- sentry_value_set_by_key(event, "exception", exc);
-
- sentry_event_value_add_stacktrace(event, nullptr, 0);
+ sentry_event_add_exception(event, exc);
sentry_capture_event(event);
}
void sentryReportBadAlloc()
{
if (simgear::ReportBadAllocGuard::isSet()) {
- sentry_value_t sentryMessage = sentry_value_new_object();
- sentry_value_set_by_key(sentryMessage, "type", sentry_value_new_string("Fatal Error"));
- sentry_value_set_by_key(sentryMessage, "formatted", sentry_value_new_string("bad allocation"));
+ sentry_value_t exc = sentry_value_new_exception("Fatal Error", "bad allocation");
+ sentry_value_set_stacktrace(exc, NULL, 0);
sentry_value_t event = sentry_value_new_event();
- sentry_value_set_by_key(event, "message", sentryMessage);
-
- sentry_event_value_add_stacktrace(event, nullptr, 0);
+ sentry_event_add_exception(event, exc);
sentry_capture_event(event);
}
@@ -222,18 +217,11 @@ bool sentryReportCommand(const SGPropertyNode* args, SGPropertyNode* root)
return false;
}
- sentry_value_t exc = sentry_value_new_object();
- sentry_value_set_by_key(exc, "type", sentry_value_new_string("Report"));
-
const auto message = args->getStringValue("message");
- sentry_value_set_by_key(exc, "value", sentry_value_new_string(message.c_str()));
- sentry_value_t event = sentry_value_new_event();
- sentry_value_set_by_key(event, "exception", exc);
- // capture the C++ stack-trace. Probably not that useful but can't hurt
- sentry_event_value_add_stacktrace(event, nullptr, 0);
-
- sentry_capture_event(event);
+ // TODO: make the level settable via an argument?
+ sentry_value_t msgEv = sentry_value_new_message_event(SENTRY_LEVEL_INFO, nullptr, message.c_str());
+ sentry_capture_event(msgEv);
return true;
}
@@ -302,9 +290,10 @@ void initSentry(bool quiet)
// unknown build type
sentry_options_set_environment(options, "dev");
}
-
+
const auto buildString = std::to_string(JENKINS_BUILD_NUMBER);
sentry_options_set_dist(options, buildString.c_str());
+ sentry_options_set_enable_logs(options, 1);
// for dev / nightly builds, put Sentry in debug mode
if (!quiet && strcmp(FG_BUILD_TYPE, "Release")) {
@@ -378,7 +367,7 @@ void delayedSentryInit()
// allow the user to opt-out of sentry.io features
if (!fgGetBool("/sim/startup/sentry-crash-reporting-enabled", true)) {
SG_LOG(SG_GENERAL, SG_INFO, "Disabling Sentry.io reporting");
- sentry_shutdown();
+ sentry_close();
static_sentryEnabled = false;
return;
}
@@ -394,7 +383,7 @@ void delayedSentryInit()
void shutdownSentry()
{
if (static_sentryEnabled) {
- sentry_shutdown();
+ sentry_close();
static_sentryEnabled = false;
}
}
@@ -471,23 +460,13 @@ void sentryReportException(const std::string& msg, const std::string& location)
if (!static_sentryEnabled)
return;
- sentry_value_t exc = sentry_value_new_object();
- sentry_value_set_by_key(exc, "type", sentry_value_new_string("Exception"));
-
+ sentry_value_t exc = sentry_value_new_exception("Exception", msg.c_str());
+ sentry_value_set_stacktrace(exc, NULL, 0);
- sentry_value_t info = sentry_value_new_object();
- if (!location.empty()) {
- sentry_value_set_by_key(info, "location", sentry_value_new_string(location.c_str()));
- }
- sentry_set_context("what", info);
-
- sentry_value_set_by_key(exc, "value", sentry_value_new_string(msg.c_str()));
+ sentry_value_set_by_key(exc, "location", sentry_value_new_string(location.c_str()));
sentry_value_t event = sentry_value_new_event();
- sentry_value_set_by_key(event, "exception", exc);
-
- // capture the C++ stack-trace. Probably not that useful but can't hurt
- sentry_event_value_add_stacktrace(event, nullptr, 0);
+ sentry_event_add_exception(event, exc);
sentry_capture_event(event);
}
@@ -496,45 +475,38 @@ void sentryReportFatalError(const std::string& msg, const std::string& more)
if (!static_sentryEnabled)
return;
- sentry_value_t sentryMessage = sentry_value_new_object();
- sentry_value_set_by_key(sentryMessage, "type", sentry_value_new_string("Fatal Error"));
+ sentry_value_t exc = sentry_value_new_exception("FatalError", msg.c_str());
+ sentry_value_set_stacktrace(exc, NULL, 0);
- sentry_value_t info = sentry_value_new_object();
if (!more.empty()) {
- sentry_value_set_by_key(info, "more", sentry_value_new_string(more.c_str()));
+ sentry_value_set_by_key(exc, "more", sentry_value_new_string(more.c_str()));
}
- sentry_set_context("what", info);
- sentry_value_set_by_key(sentryMessage, "formatted", sentry_value_new_string(msg.c_str()));
-
sentry_value_t event = sentry_value_new_event();
- sentry_value_set_by_key(event, "message", sentryMessage);
-
- sentry_event_value_add_stacktrace(event, nullptr, 0);
+ sentry_event_add_exception(event, exc);
sentry_capture_event(event);
}
-void sentryReportUserError(const std::string& aggregate, const std::string& parameter, const std::string& details)
+void sentryReportUserError(const std::string& aggregate, const std::string& parameter,
+ const std::vector<SentryExceptionData>& exceptions)
{
- if (!static_sentryEnabled)
- return;
-
- sentry_value_t sentryMessage = sentry_value_new_object();
- sentry_value_set_by_key(sentryMessage, "type", sentry_value_new_string("Error"));
-
- sentry_value_t info = sentry_value_new_object();
- sentry_value_set_by_key(info, "details", sentry_value_new_string(details.c_str()));
-
- sentry_set_context("what", info);
+ sentry_value_t event = sentry_value_new_event();
auto m = aggregate;
if (!parameter.empty()) {
m += ":" + parameter;
}
- sentry_value_t event = sentry_value_new_event();
- sentry_value_set_by_key(event, "message", sentry_value_new_string(m.c_str()));
+ sentry_value_set_by_key(event, "aggregate", sentry_value_new_string(m.c_str()));
+ for (const auto& ex : exceptions) {
+ sentry_value_t exc = sentry_value_new_exception(ex.type.c_str(), ex.value.c_str());
+ if (!ex.location.empty()) {
+ sentry_value_set_by_key(exc, "location", sentry_value_new_string(ex.location.c_str()));
+ }
+
+ sentry_event_add_exception(event, exc);
+ }
sentry_capture_event(event);
}
@@ -594,7 +566,8 @@ void sentryReportFatalError(const std::string&, const std::string&)
{
}
-void sentryReportUserError(const std::string&, const std::string&, const std::string&)
+void sentryReportUserError(const std::string& aggregate, const std::string& parameter,
+ const std::vector<SentryExceptionData>& exceptions)
{
}
diff --git a/src/Main/sentryIntegration.hxx b/src/Main/sentryIntegration.hxx
index d75ae19f9..e9bdbe412 100644
--- a/src/Main/sentryIntegration.hxx
+++ b/src/Main/sentryIntegration.hxx
@@ -33,7 +33,21 @@ void sentryReportException(const std::string& msg, const std::string& location =
void sentryReportFatalError(const std::string& msg, const std::string& more = {});
-void sentryReportUserError(const std::string& aggregate, const std::string& parameter, const std::string& details);
+/**
+ * information about a specific error / failure, to be sent as part of a user-facing
+ * error.
+ */
+struct SentryExceptionData {
+ SentryExceptionData(const std::string& type, const std::string& value, const std::string& location)
+ : type(type), value(value), location(location) {}
+
+ std::string type;
+ std::string value;
+ std::string location;
+};
+
+void sentryReportUserError(const std::string& aggregate, const std::string& parameter,
+ const std::vector<SentryExceptionData>& exceptions);
/**
* @brief retrive the anonymous user ID (a UUID) for this installation.
|
|
From: <fli...@li...> - 2026-05-01 08:49:49
|
unknown user pushed a commit to branch release/2024.1
in repository fgmeta.
The following commit(s) were added to refs/heads/release/2024.1 by this push:
new df993de create_shared_models_manifest.py: raise an exception when non-ASCII chars are found
df993de is described below
SF URL: http://sourceforge.net/p/flightgear/fgmeta/ci/df993de18c39c2459483e439b2c3409a49f2b7a7/
Commit: df993de18c39c2459483e439b2c3409a49f2b7a7
Author: Florent Rougon
Committer: Florent Rougon
AuthorDate: Fri Apr 24 15:48:13 2026 +0200
create_shared_models_manifest.py: raise an exception when non-ASCII chars are found
The previous code wanted to do this but didn't, because of the default
ensure_ascii=True for json.dump().
---
release_builder/create_shared_models_manifest.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/release_builder/create_shared_models_manifest.py b/release_builder/create_shared_models_manifest.py
index 6b82e9a..416d9fb 100755
--- a/release_builder/create_shared_models_manifest.py
+++ b/release_builder/create_shared_models_manifest.py
@@ -95,10 +95,12 @@ def main():
output_path = os.path.join(fgdata_dir, "SharedModelsManifest.json")
with open(output_path, "w", encoding="ascii") as f:
- # Note we keep the default value (True) of ensure_ascii.
- # File names in FGData and TerraSync should be ASCII only,
- # no extended UTF-8 characters, for now.
- json.dump(manifest, f, indent=2)
+ # File names in FGData and TerraSync should be ASCII only, no
+ # extended UTF-8 characters, for now. With ensure_ascii=False,
+ # json.dump() won't escape non-ASCII chars, therefore any such
+ # char in a path will cause an exception to be raised since the
+ # JSON file has been opened with encoding="ascii".
+ json.dump(manifest, f, indent=2, ensure_ascii=False)
f.write("\n")
print(f"Wrote {len(files)} file entries to {output_path!r}")
|
|
From: <fli...@li...> - 2026-04-29 18:12:27
|
unknown user pushed a commit to branch next in repository simgear. SF URL: http://sourceforge.net/p/flightgear/simgear/ci/033af1dcd6a526bb538bd2d105451c51460016b0/ Commit: 033af1dcd6a526bb538bd2d105451c51460016b0 Author: James Hogan Committer: James Hogan AuthorDate: Tue Apr 28 21:40:01 2026 +0100 AC3D: Add SPDX-FileCopyrightText Looking at the OSG & SG history, the AC3D loader is based on ac3d.org code by Andy Colebourne, and adapted to OSG by Geoff Michel, and to SG by Fernando, so add these names as SPDX-FileCopyrightText tags to keep pre-commit happy. --- simgear/scene/model/ReaderWriterAC3D.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/simgear/scene/model/ReaderWriterAC3D.cxx b/simgear/scene/model/ReaderWriterAC3D.cxx index 5a89b0a4..e824c44c 100644 --- a/simgear/scene/model/ReaderWriterAC3D.cxx +++ b/simgear/scene/model/ReaderWriterAC3D.cxx @@ -6,6 +6,9 @@ * Adapted for FlightGear by Fernando García Liñán, 2024. * * SPDX-License-Identifier: LGPL-2.1-or-later + * SPDX-FileCopyrightText: Andy Colebourne + * SPDX-FileCopyrightText: 2002 Geoff Michel + * SPDX-FileCopyrightText: 2024 Fernando García Liñán */ #include "ReaderWriterAC3D.hxx" |
|
From: <fli...@li...> - 2026-04-27 15:49:51
|
unknown user pushed a commit to branch release/2024.1 in repository fgmeta. SF URL: http://sourceforge.net/p/flightgear/fgmeta/ci/34cafde9e652c14a6a6837c174491fe155e90c93/ Commit: 34cafde9e652c14a6a6837c174491fe155e90c93 Author: James Turner Committer: James Turner AuthorDate: Thu Apr 23 13:25:25 2026 +0100 Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Florent Rougon <f.r...@fr...> --- release_builder/create_shared_models_manifest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release_builder/create_shared_models_manifest.py b/release_builder/create_shared_models_manifest.py index 32e810f..1162fe5 100755 --- a/release_builder/create_shared_models_manifest.py +++ b/release_builder/create_shared_models_manifest.py @@ -95,8 +95,8 @@ def main(): output_path = os.path.join(fgdata_dir, "SharedModelsManifest.json") with open(output_path, "w", encoding="utf-8") as f: - # note we keep the default value (True) of ensure_ascii - # file-names in FGData and TerraSync should be ASCII only, + # Note we keep the default value (True) of ensure_ascii. + # File names in FGData and TerraSync should be ASCII only, # no extended UTF-8 characters, for now. json.dump(manifest, f, indent=2) f.write("\n") |
|
From: <fli...@li...> - 2026-04-27 15:49:50
|
unknown user pushed a commit to branch release/2024.1 in repository fgmeta. SF URL: http://sourceforge.net/p/flightgear/fgmeta/ci/2346fa25192cfcfa247e65ac0234f186ed48861e/ Commit: 2346fa25192cfcfa247e65ac0234f186ed48861e Author: James Turner Committer: James Turner AuthorDate: Thu Apr 23 14:05:49 2026 +0100 Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Florent Rougon <f.r...@fr...> --- release_builder/create_shared_models_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_builder/create_shared_models_manifest.py b/release_builder/create_shared_models_manifest.py index 1162fe5..6b82e9a 100755 --- a/release_builder/create_shared_models_manifest.py +++ b/release_builder/create_shared_models_manifest.py @@ -94,7 +94,7 @@ def main(): manifest = {"schemaVersion": 1, "files": files} output_path = os.path.join(fgdata_dir, "SharedModelsManifest.json") - with open(output_path, "w", encoding="utf-8") as f: + with open(output_path, "w", encoding="ascii") as f: # Note we keep the default value (True) of ensure_ascii. # File names in FGData and TerraSync should be ASCII only, # no extended UTF-8 characters, for now. |
|
From: <fli...@li...> - 2026-04-27 15:49:49
|
unknown user pushed a change to branch release/2024.1
in repository fgmeta.
from 8953308 Fixes suggested by Florent
new f3327c5 Improvments suggested by Florent
new 34cafde Apply 1 suggestion(s) to 1 file(s)
new 2346fa2 Apply 1 suggestion(s) to 1 file(s)
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
release_builder/create_shared_models_manifest.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
From: <fli...@li...> - 2026-04-27 12:49:49
|
unknown user pushed a commit to branch next
in repository simgear.
The following commit(s) were added to refs/heads/next by this push:
new adbc5631 Devops/remove dead code
adbc5631 is described below
SF URL: http://sourceforge.net/p/flightgear/simgear/ci/adbc5631906ec521ae03d77073a5b579fd9a7d73/
Commit: adbc5631906ec521ae03d77073a5b579fd9a7d73
Author: James Turner
Committer: James Turner
AuthorDate: Thu Apr 23 13:15:21 2026 +0100
Devops/remove dead code
---
simgear/misc/CMakeLists.txt | 6 ---
simgear/misc/interpolator.cxx | 100 -----------------------------------
simgear/misc/interpolator.hxx | 58 --------------------
simgear/misc/stopwatch.hxx | 102 ------------------------------------
simgear/misc/tabbed_values.cxx | 88 -------------------------------
simgear/misc/tabbed_values.hxx | 44 ----------------
simgear/misc/tabbed_values_test.cxx | 79 ----------------------------
7 files changed, 477 deletions(-)
diff --git a/simgear/misc/CMakeLists.txt b/simgear/misc/CMakeLists.txt
index 12f77750..a21ebc71 100644
--- a/simgear/misc/CMakeLists.txt
+++ b/simgear/misc/CMakeLists.txt
@@ -24,12 +24,10 @@ set(SOURCES
argparse.cxx
inputvalue.cxx
inputcolor.cxx
- interpolator.cxx
sg_dir.cxx
sg_path.cxx
sg_hash.cxx
strutils.cxx
- tabbed_values.cxx
texcoord.cxx
)
@@ -42,10 +40,7 @@ if (APPLE)
endif()
target_sources(SimGearCore PRIVATE ${SOURCES}
- interpolator.hxx
sg_hash.hxx
- stopwatch.hxx
- tabbed_values.hxx
texcoord.hxx
lru_cache.hxx
${HEADERS})
@@ -55,7 +50,6 @@ if(ENABLE_TESTS)
add_simgear_autotest(test_argparse argparse_test.cxx)
add_simgear_autotest(test_CSSBorder CSSBorder_test.cxx)
-add_simgear_autotest(test_tabbed_values tabbed_values_test.cxx)
add_simgear_autotest(test_strutils strutils_test.cxx)
add_simgear_autotest(test_path path_test.cxx )
add_simgear_autotest(test_sg_dir sg_dir_test.cxx)
diff --git a/simgear/misc/interpolator.cxx b/simgear/misc/interpolator.cxx
deleted file mode 100644
index 9223ced5..00000000
--- a/simgear/misc/interpolator.cxx
+++ /dev/null
@@ -1,100 +0,0 @@
-// SPDX-License-Identifier: LGPL-2.1-or-later
-// SPDX-FileCopyrightText: 2003 Andrew J. Ross - an...@pl...
-
-/**
- * @file
- * @brief Subsystem that manages smooth linear interpolation of property values across multiple data points and arbitrary time intervals.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <simgear_config.h>
-#endif
-
-#include "interpolator.hxx"
-
-void SGInterpolator::addNew(SGPropertyNode* prop, int nPoints)
-{
- // Set the property type to a double, if it isn't already, and
- // make sure we aren't already managing this node.
- prop->setDoubleValue(prop->getDoubleValue());
- cancel(prop);
-
- Interp* iterp = new Interp();
- iterp->target = prop;
- iterp->nPoints = nPoints;
- iterp->curve = new double[2*nPoints];
-
- // Dirty trick: leave the new value sitting in _list to avoid
- // having to return a pointer to a private type.
- iterp->next = _list;
- _list = iterp;
-}
-
-void SGInterpolator::interpolate(SGPropertyNode* prop, int nPoints,
- double* values, double* deltas)
-{
- addNew(prop, nPoints);
- for(int i=0; i<nPoints; i++) {
- _list->dt(i) = deltas[i];
- _list->val(i) = values[i];
- }
-}
-
-void SGInterpolator::interpolate(SGPropertyNode* prop, double val, double dt)
-{
- addNew(prop, 1);
- _list->dt(0) = dt;
- _list->val(0) = val;
-}
-
-//
-// Delete all the list elements where "expr" is true.
-//
-// Silly preprocessor hack to avoid writing the linked list code in
-// two places. You would think that an STL set would be the way to
-// go, but I had terrible trouble getting it to work with the
-// dynamically allocated "curve" member. Frankly, this is easier to
-// write, and the code is smaller to boot...
-//
-#define DELETE_WHERE(EXPR)\
-Interp *p = _list, **last = &_list; \
-while(p) { \
- if(EXPR) { \
- *last = p->next; \
- delete p; \
- p = (*last) ? (*last)->next : 0; \
- } else { \
- last = &(p->next); \
- p = p->next; } }
-
-void SGInterpolator::cancel(SGPropertyNode* prop)
-{
- DELETE_WHERE(p->target == prop)
-}
-
-void SGInterpolator::update(double dt)
-{
- DELETE_WHERE(interp(p, dt))
-}
-
-// This is the where the only "real" work happens. Walk through the
-// data points until we find one with some time left, slurp it up and
-// repeat until we run out of dt.
-bool SGInterpolator::interp(Interp* rec, double dt)
-{
- double val = rec->target->getDoubleValue();
- int i;
- for(i=0; i < rec->nPoints; i++) {
- if(rec->dt(i) > 0 && dt < rec->dt(i)) {
- val += (dt / rec->dt(i)) * (rec->val(i) - val);
- rec->dt(i) -= dt;
- break;
- }
- dt -= rec->dt(i);
- val = rec->val(i);
- }
- rec->target->setDoubleValue(val);
-
- // Return true if this one is done
- return i == rec->nPoints;
-}
diff --git a/simgear/misc/interpolator.hxx b/simgear/misc/interpolator.hxx
deleted file mode 100644
index 56b70593..00000000
--- a/simgear/misc/interpolator.hxx
+++ /dev/null
@@ -1,58 +0,0 @@
-// SPDX-License-Identifier: LGPL-2.1-or-later
-// SPDX-FileCopyrightText: 2003 Andrew J. Ross <an...@pl...>
-
-/**
- * @file
- * @brief Subsystem that manages smooth linear interpolation of property values across multiple data points and arbitrary time intervals.
- */
-
-#pragma once
-
-#include <simgear/props/props.hxx>
-#include <simgear/structure/subsystem_mgr.hxx>
-
-// TODO: support a callback upon interpolation completion so that user
-// code can register another one immediately without worrying about
-// timer aliasing.
-
-class SGInterpolator : public SGSubsystem
-{
-public:
- SGInterpolator() { _list = 0; }
-
- // Subsystem API.
- void update(double delta_time_sec) override;
-
- // Subsystem identification.
- static const char* staticSubsystemClassId() { return "interpolator"; }
-
- // Simple method that interpolates a double property value from
- // its current value (default of zero) to the specified target
- // over the specified time.
- void interpolate(SGPropertyNode* prop, double value, double dt_sec);
-
- // More elaborate version that takes a pointer to lists of
- // arbitrary size.
- void interpolate(SGPropertyNode* prop, int nPoints,
- double* values, double* deltas);
-
- // Cancels any interpolation of the specified property, leaving
- // its value at the current (mid-interpolation) state.
- void cancel(SGPropertyNode* prop);
-
-private:
- struct Interp {
- SGPropertyNode_ptr target;
- int nPoints;
- double* curve; // time0, val0, time1, val1, ...
- Interp* next;
-
- virtual ~Interp() { delete[] curve; }
- double& dt(int i) { return curve[2*i]; }
- double& val(int i) { return curve[2*i + 1]; }
- };
- Interp* _list;
-
- bool interp(Interp* rec, double dt);
- void addNew(SGPropertyNode* prop, int nPoints);
-};
diff --git a/simgear/misc/stopwatch.hxx b/simgear/misc/stopwatch.hxx
deleted file mode 100644
index 59405a5d..00000000
--- a/simgear/misc/stopwatch.hxx
+++ /dev/null
@@ -1,102 +0,0 @@
-// SPDX-License-Identifier: LGPL-2.1-or-later
-// SPDX-FileCopyrightText: 1997-1998 Todd Veldhuizen <tve...@se...>
-
-/**
- * @file
- * @brief Timer class, for use in benchmarking
- */
-
-// This class is not portable to non System V platforms.
-// It will need to be rewritten for Windows, NT, Mac.
-// NEEDS_WORK
-
-#ifndef _STOPWATCH_HXX
-#define _STOPWATCH_HXX
-
-#ifndef __cplusplus
-# error This library requires C++
-#endif
-
-#if defined(__linux__) && ! defined(HAVE_GETRUSAGE)
-# define HAVE_GETRUSAGE
-#endif
-
-#if defined( WIN32 ) && defined( HAVE_GETRUSAGE )
-# undef HAVE_GETRUSAGE
-#endif // WIN32
-
-#if defined( HAVE_GETRUSAGE )
-# if defined( __FreeBSD__ )
-# include <sys/types.h>
-# endif
-# include <sys/time.h>
-# include <sys/resource.h>
-# include <unistd.h>
-#elif defined( WIN32 )
-# include <windows.h>
-#else
-# include <time.h>
-#endif
-
-/**
- * A high resolutions timing class
- */
-class StopWatch {
-
-public:
- /** Constructor */
- StopWatch() {
- // state_ = uninitialized;
- }
-
- /** Start counting time */
- void start() {
- // state_ = running;
- t1_ = systemTime();
- }
-
- /** Stop counting time */
- void stop() {
- t2_ = systemTime();
- // BZPRECONDITION(state_ == running);
- // state_ = stopped;
- }
-
- /** @return the elapsed time between start and stop */
- double elapsedSeconds()
- {
- // BZPRECONDITION(state_ == stopped);
- return t2_ - t1_;
- }
-
-private:
- StopWatch(StopWatch&) { }
- void operator=(StopWatch&) { }
-
- double systemTime()
- {
-#if defined( HAVE_GETRUSAGE )
- getrusage(RUSAGE_SELF, &resourceUsage_);
- double seconds = resourceUsage_.ru_utime.tv_sec
- + resourceUsage_.ru_stime.tv_sec;
- double micros = resourceUsage_.ru_utime.tv_usec
- + resourceUsage_.ru_stime.tv_usec;
- return seconds + micros/1.0e6;
-#elif defined( WIN32 )
- return double(GetTickCount()) * double(1e-3);
-#else
- return clock() / (double) CLOCKS_PER_SEC;
-#endif
- }
-
-// enum { uninitialized, running, stopped } state_;
-
-#if defined( HAVE_GETRUSAGE )
- struct rusage resourceUsage_;
-#endif
-
- double t1_, t2_;
-};
-
-#endif // _STOPWATCH_HXX
-
diff --git a/simgear/misc/tabbed_values.cxx b/simgear/misc/tabbed_values.cxx
deleted file mode 100644
index 2ba2bc56..00000000
--- a/simgear/misc/tabbed_values.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-// SPDX-License-Identifier: LGPL-2.1-or-later
-// SPDX-FileCopyrightText: 2003 James Turner
-
-/**
- * @file
- * @brief parse tab separated strings into fields
- */
-
-// $Id$
-
-#include <cstdlib>
-#include <assert.h>
-
-#include "tabbed_values.hxx"
-
-
-SGTabbedValues::SGTabbedValues(const char *line)
-{
- assert(line);
- _fields.push_back(const_cast<char*>(line));
-}
-
-const char* SGTabbedValues::fieldAt(const unsigned int index) const
-{
- // we already computed that offset, cool
- if (_fields.size() > index)
- return _fields[index];
-
- while (_fields.size() <= index) {
- char* nextField = _fields.back();
- if (*nextField=='\0') return NULL; // we went off the end
-
- while (*nextField != '\t') {
- if (*nextField=='\0') return NULL; // we went off the end
- ++nextField;
- }
- _fields.push_back(++nextField);
- }
-
- return _fields.back();
-}
-
-string SGTabbedValues::operator[](const unsigned int offset) const
-{
- const char *data = fieldAt(offset);
- char* endPtr = const_cast<char*>(data);
- int len = 0;
- while ((*endPtr != '\0') && (*endPtr != '\t')) {
- ++len;
- ++endPtr;
- }
- return string(fieldAt(offset), len);
-}
-
-bool SGTabbedValues::isValueAt(const unsigned int offset) const
-{
- const char *data = fieldAt(offset);
- return data && (*data != '\t'); // must be non-NULL and non-tab
-}
-
-char SGTabbedValues::getCharAt(const unsigned int offset) const
-{
- const char *data = fieldAt(offset);
- if (!data || (*data == '\t'))
- return 0;
-
- return *data;
-}
-
-double SGTabbedValues::getDoubleAt(const unsigned int offset) const
-{
- const char *data = fieldAt(offset);
- if (!data || (*data == '\t'))
- return 0;
-
- /* this is safe because strtod will stop parsing when it sees an unrecogznied
- character, which includes tab. */
- return std::strtod(data, NULL);
-}
-
-long SGTabbedValues::getLongAt(const unsigned int offset) const
-{
- const char *data = fieldAt(offset);
- if (!data || (*data == '\t'))
- return 0;
-
- return std::strtol(data, NULL, 0);
-}
diff --git a/simgear/misc/tabbed_values.hxx b/simgear/misc/tabbed_values.hxx
deleted file mode 100644
index 1eb60a47..00000000
--- a/simgear/misc/tabbed_values.hxx
+++ /dev/null
@@ -1,44 +0,0 @@
-// SPDX-License-Identifier: LGPL-2.1-or-later
-// SPDX-FileCopyrightText: 2003 James Turner
-
-/**
- * @file
- * @brief parse tab separated strings into fields
- */
-
-// $Id$
-
-#ifndef SG_TABBED_VALUES_HXX
-#define SG_TABBED_VALUES_HXX
-
-#include <simgear/compiler.h>
-
-#include <vector>
-#include <string>
-
-using std::vector;
-using std::string;
-
-class SGTabbedValues
-{
-public:
- SGTabbedValues(const char* line);
-
- string operator[](const unsigned int) const;
-
- bool isValueAt(const unsigned int) const;
-
- double getDoubleAt(const unsigned int) const;
- char getCharAt(const unsigned int) const;
- long getLongAt(const unsigned int) const;
-private:
- const char* fieldAt(const unsigned int offset) const;
-
- /** this is first character of each field, if the field is empty
- it will be the tab character. It is lazily built as needed, so
- if only the first field is accessed (which is a common case) we
- don't iterative over the whole line. */
- mutable vector<char*> _fields;
-};
-
-#endif
diff --git a/simgear/misc/tabbed_values_test.cxx b/simgear/misc/tabbed_values_test.cxx
deleted file mode 100644
index 1926776a..00000000
--- a/simgear/misc/tabbed_values_test.cxx
+++ /dev/null
@@ -1,79 +0,0 @@
-// SPDX-License-Identifier: LGPL-2.1-or-later
-// SPDX-FileCopyrightText: 2003 James Turner
-
-/**
- * @file
- * @brief Unit Test parse tab separated strings into fields
- */
-
-////////////////////////////////////////////////////////////////////////
-// Test harness.
-////////////////////////////////////////////////////////////////////////
-
-#include <simgear/compiler.h>
-
-#include <iostream>
-#include "tabbed_values.hxx"
-
-using std::cout;
-using std::cerr;
-using std::endl;
-
-
-int main (int ac, char ** av)
-{
- const char* string1 = "Hello\tWorld\t34\tZ\t\tThere Is No Spoon";
-
- SGTabbedValues tv(string1);
-
- if (tv[0] != "Hello") {
- cerr << "failed to read string at index 0" << endl;
- return 1;
- }
-
- if (tv[1] != "World") {
- cerr << "failed to read string at index 1" << endl;
- return 1;
- }
-
- if (tv[2] != "34") {
- cerr << "failed to read string at index 2" << endl;
- return 1;
- }
-
- double dval = tv.getDoubleAt(2);
- if (dval != 34.0) {
- cerr << "failed to read double at index 2" << endl;
- return 2;
- }
-
- char cval = tv.getCharAt(3);
- if (cval != 'Z') {
- cerr << "failed to read char at index 3" << endl;
- return 1;
- }
-
- cval = tv.getCharAt(0);
- if (cval != 'H') {
- cerr << "failed to read char at index 0" << endl;
- return 1;
- }
-
- if (tv.isValueAt(4)) {
- cerr << "didn't identify skipped value correctly" << endl;
- return 3;
- }
-
- if (!tv.isValueAt(3)) {
- cerr << "didn't identify present value correctly" << endl;
- return 3;
- }
-
- if (tv[5] != "There Is No Spoon") {
- cerr << "failed to read string at index 5 (got [" << tv[5] << "]" << endl;
- return 1;
- }
-
- cout << "all tests passed successfully!" << endl;
- return 0;
-}
|
|
From: <fli...@li...> - 2026-04-26 15:49:50
|
unknown user pushed a commit to branch release/2024.1 in repository fgmeta. SF URL: http://sourceforge.net/p/flightgear/fgmeta/ci/2147a694df77c35a8b3d61c5bbd5f29a3a61b85c/ Commit: 2147a694df77c35a8b3d61c5bbd5f29a3a61b85c Author: James Turner Committer: James Turner AuthorDate: Wed Apr 22 10:53:05 2026 +0100 Add script to create shared models list Issue-Id: flightgear/flightgear#3346 --- release_builder/create_shared_models_manifest.py | 85 ++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/release_builder/create_shared_models_manifest.py b/release_builder/create_shared_models_manifest.py new file mode 100644 index 0000000..69299fa --- /dev/null +++ b/release_builder/create_shared_models_manifest.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python3 +""" +Create a manifest of shared model files found under FGData/Models and TerraSync/Models. + +The output is written to FGData/SharedModelsManifest.json and contains a JSON object +with a single "files" array of relative paths (e.g. "Models/Airport/marker.ac"). + +Usage: + python3 create_shared_models_manifest.py <fgdata_dir> [<terrasync_dir>] + +Example: + python3 create_shared_models_manifest.py ~/flightgear/fgdata ~/flightgear/terrasync +""" + +import argparse +import json +import os +import sys + + +def collect_model_files(base_dir): + """ + Walk base_dir/Models and return all file paths relative to base_dir, + with forward-slash separators (e.g. "Models/Airport/marker.ac"). + Returns an empty list if base_dir/Models does not exist. + """ + models_dir = os.path.join(base_dir, "Models") + if not os.path.isdir(models_dir): + print(f"Warning: Models directory not found: {models_dir}", file=sys.stderr) + return [] + + files = [] + for root, _dirs, filenames in os.walk(models_dir): + for fname in filenames: + full_path = os.path.join(root, fname) + rel_path = os.path.relpath(full_path, base_dir) + # Normalise to forward slashes on all platforms + files.append(rel_path.replace(os.sep, "/")) + return files + + +def main(): + parser = argparse.ArgumentParser( + description="Create SharedModelsManifest.json for FlightGear" + ) + parser.add_argument("fgdata_dir", help="Path to the FGData directory") + parser.add_argument( + "terrasync_dir", + nargs="?", + default=None, + help="Optional path to the TerraSync directory", + ) + args = parser.parse_args() + + fgdata_dir = os.path.abspath(args.fgdata_dir) + if not os.path.isdir(fgdata_dir): + print(f"Error: FGData directory not found: {fgdata_dir}", file=sys.stderr) + sys.exit(1) + + files = collect_model_files(fgdata_dir) + + if args.terrasync_dir: + terrasync_dir = os.path.abspath(args.terrasync_dir) + if not os.path.isdir(terrasync_dir): + print( + f"Warning: TerraSync directory not found: {terrasync_dir}", + file=sys.stderr, + ) + else: + files.extend(collect_model_files(terrasync_dir)) + + # Deduplicate and sort for a stable, diff-friendly output + files = sorted(set(files)) + + manifest = {"files": files} + + output_path = os.path.join(fgdata_dir, "SharedModelsManifest.json") + with open(output_path, "w", encoding="utf-8") as f: + json.dump(manifest, f) + + print(f"Written {len(files)} file entries to {output_path}") + + +if __name__ == "__main__": + main() |
|
From: <fli...@li...> - 2026-04-26 15:49:50
|
unknown user pushed a commit to branch release/2024.1
in repository flightgear.
The following commit(s) were added to refs/heads/release/2024.1 by this push:
new 4a0314304 Add support for community URL in aircraft metadata
4a0314304 is described below
SF URL: http://sourceforge.net/p/flightgear/flightgear/ci/4a03143044660c57cb133f97ea3d7798732013cc/
Commit: 4a03143044660c57cb133f97ea3d7798732013cc
Author: philip2012
Committer: James Turner
AuthorDate: Wed Apr 22 15:46:53 2026 +0000
Add support for community URL in aircraft metadata
---
src/GUI/LocalAircraftCache.cxx | 7 ++++---
src/GUI/LocalAircraftCache.hxx | 1 +
src/GUI/QmlAircraftInfo.cxx | 12 ++++++++++++
src/GUI/QmlAircraftInfo.hxx | 2 ++
src/GUI/qml/AircraftDetailsView.qml | 6 ++++++
5 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/src/GUI/LocalAircraftCache.cxx b/src/GUI/LocalAircraftCache.cxx
index ad70bde0e..f7c8c33fe 100644
--- a/src/GUI/LocalAircraftCache.cxx
+++ b/src/GUI/LocalAircraftCache.cxx
@@ -41,7 +41,7 @@
#include "SettingsWrapper.hxx"
-static quint32 CACHE_VERSION = 13;
+static quint32 CACHE_VERSION = 14;
const std::vector<QByteArray> static_localizedStringTags = {"name", "desc"};
@@ -162,6 +162,7 @@ bool AircraftItem::initFromFile(QDir dir, QString filePath)
homepageUrl = QUrl(QString::fromStdString(sim->getStringValue("urls/home-page")));
supportUrl = QUrl(QString::fromStdString(sim->getStringValue("urls/support")));
wikipediaUrl = QUrl(QString::fromStdString(sim->getStringValue("urls/wikipedia")));
+ communityUrl = QUrl(QString::fromStdString(sim->getStringValue("urls/community")));
_localized.push_front(ls);
readLocalizedStrings(sim);
@@ -245,7 +246,7 @@ void AircraftItem::fromDataStream(QDataStream& ds)
ds >> thumbnailPath;
ds >> minFGVersion;
ds >> needsMaintenance >> usesHeliports >> usesSeaports;
- ds >> homepageUrl >> supportUrl >> wikipediaUrl;
+ ds >> homepageUrl >> supportUrl >> wikipediaUrl >> communityUrl;
ds >> tags;
ds >> _localized;
@@ -265,7 +266,7 @@ void AircraftItem::toDataStream(QDataStream& ds) const
ds << thumbnailPath;
ds << minFGVersion;
ds << needsMaintenance << usesHeliports << usesSeaports;
- ds << homepageUrl << supportUrl << wikipediaUrl;
+ ds << homepageUrl << supportUrl << wikipediaUrl << communityUrl;
ds << tags;
ds << _localized;
}
diff --git a/src/GUI/LocalAircraftCache.hxx b/src/GUI/LocalAircraftCache.hxx
index ee63303bb..09a32d262 100644
--- a/src/GUI/LocalAircraftCache.hxx
+++ b/src/GUI/LocalAircraftCache.hxx
@@ -75,6 +75,7 @@ struct AircraftItem
QUrl homepageUrl;
QUrl wikipediaUrl;
QUrl supportUrl;
+ QUrl communityUrl;
QVariant status(int variant);
diff --git a/src/GUI/QmlAircraftInfo.cxx b/src/GUI/QmlAircraftInfo.cxx
index 588549163..35decd8e0 100644
--- a/src/GUI/QmlAircraftInfo.cxx
+++ b/src/GUI/QmlAircraftInfo.cxx
@@ -532,6 +532,18 @@ QUrl QmlAircraftInfo::wikipediaUrl() const
return {};
}
+QUrl QmlAircraftInfo::communityUrl() const
+{
+ if (_item) {
+ return resolveItem()->communityUrl;
+ } else if (_package) {
+ const auto u = _package->getLocalisedProp("urls/community");
+ return QUrl(QString::fromStdString(u));
+ }
+
+ return {};
+}
+
QString QmlAircraftInfo::packageId() const
{
if (_package) {
diff --git a/src/GUI/QmlAircraftInfo.hxx b/src/GUI/QmlAircraftInfo.hxx
index f407d8b5d..4c4933f2c 100644
--- a/src/GUI/QmlAircraftInfo.hxx
+++ b/src/GUI/QmlAircraftInfo.hxx
@@ -92,6 +92,7 @@ class QmlAircraftInfo : public QObject
Q_PROPERTY(QUrl homePage READ homePage NOTIFY infoChanged)
Q_PROPERTY(QUrl supportUrl READ supportUrl NOTIFY infoChanged)
Q_PROPERTY(QUrl wikipediaUrl READ wikipediaUrl NOTIFY infoChanged)
+ Q_PROPERTY(QUrl communityUrl READ communityUrl NOTIFY infoChanged)
Q_PROPERTY(QuantityValue cruiseSpeed READ cruiseSpeed NOTIFY infoChanged)
Q_PROPERTY(QuantityValue cruiseAltitude READ cruiseAltitude NOTIFY infoChanged)
@@ -124,6 +125,7 @@ public:
QUrl homePage() const;
QUrl supportUrl() const;
QUrl wikipediaUrl() const;
+ QUrl communityUrl() const;
QString packageId() const;
quint64 packageSize() const;
diff --git a/src/GUI/qml/AircraftDetailsView.qml b/src/GUI/qml/AircraftDetailsView.qml
index 3c86d0acd..e5680df2f 100644
--- a/src/GUI/qml/AircraftDetailsView.qml
+++ b/src/GUI/qml/AircraftDetailsView.qml
@@ -143,6 +143,12 @@ Rectangle {
label: qsTr("Support and issue reporting")
link: aircraft.supportUrl
}
+
+ Weblink {
+ visible: aircraft.communityUrl != ""
+ label: qsTr("Community")
+ link: aircraft.communityUrl
+ }
Weblink {
visible: aircraft.wikipediaUrl != ""
|
|
From: <fli...@li...> - 2026-04-25 15:49:49
|
unknown user pushed a commit to branch next
in repository fgmeta.
The following commit(s) were added to refs/heads/next by this push:
new 4183544 download_and_compile.sh: remove OpenRTI support and non-existent -e option
4183544 is described below
SF URL: http://sourceforge.net/p/flightgear/fgmeta/ci/4183544de375b411d3d7c909bdbf084a0dc69cef/
Commit: 4183544de375b411d3d7c909bdbf084a0dc69cef
Author: Florent Rougon
Committer: Florent Rougon
AuthorDate: Tue Apr 21 15:10:30 2026 +0200
download_and_compile.sh: remove OpenRTI support and non-existent -e option
Corresponding SimGear and FlightGear code for OpenRTI has been removed
from next:
https://gitlab.com/flightgear/simgear/-/commit/bb4b56c78e5928511e41c9613ea9680a90d9021c
https://gitlab.com/flightgear/flightgear/-/commit/6a601a6aca65e6b5d720d905e3446524fc578f25
The -e option mentioned in the --help output simply doesn't exist
(“compile FlightGear with --with-eventinput option (experimental)”).
---
download_and_compile.sh | 67 ++++++-------------------------------------------
1 file changed, 8 insertions(+), 59 deletions(-)
diff --git a/download_and_compile.sh b/download_and_compile.sh
index d7f692d..18005bd 100755
--- a/download_and_compile.sh
+++ b/download_and_compile.sh
@@ -591,9 +591,8 @@ function _installOrUpdateDistroPackages(){
PKG+=(libboost-dev libcgal-dev libgdal-dev libtiff5-dev zlib1g-dev)
fi
- # TerraGear GUI and OpenRTI
- if _elementIn "TERRAGEARGUI" "${WHATTOBUILD[@]}" || \
- _elementIn "OPENRTI" "${WHATTOBUILD[@]}"; then
+ # TerraGear GUI
+ if _elementIn "TERRAGEARGUI" "${WHATTOBUILD[@]}"; then
PKG+=(libqt4-dev)
fi
@@ -697,7 +696,6 @@ function _determineSuiteDescriptionAndBranchForEachComponent(){
case "$SELECTED_SUITE" in
next)
FG_BRANCH=next
- COMPONENT_BRANCH[OPENRTI]=master
COMPONENT_BRANCH[OSG]=next
COMPONENT_BRANCH[TERRAGEAR]=next
SUITE_DESCRIPTION="\
@@ -709,7 +707,6 @@ function _determineSuiteDescriptionAndBranchForEachComponent(){
;;
latest-release)
FG_BRANCH="release/$(git ls-remote --heads "https://${REPO_ADDRESS[FGFS]}" | sed -nEe 's@.*[ \t]+refs/heads/release/([^ \t]+)@\1@p' | sort -t . -k 1,1n -k2,2n -k3,3n | tail -1)"
- COMPONENT_BRANCH[OPENRTI]=release-0.7
COMPONENT_BRANCH[OSG]=release/2024-build
COMPONENT_BRANCH[TERRAGEAR]=scenery/ws2.0
SUITE_DESCRIPTION="\
@@ -719,7 +716,6 @@ version (which would be obtained with none of '-s', '--lts' and '--old-lts')."
;;
latest-lts)
FG_BRANCH="$CURRENT_LTS_BRANCH"
- COMPONENT_BRANCH[OPENRTI]=release-0.7
COMPONENT_BRANCH[OSG]=OpenSceneGraph-3.4
COMPONENT_BRANCH[TERRAGEAR]=scenery/ws2.0
SUITE_DESCRIPTION="\
@@ -730,7 +726,6 @@ suite, '-s' for the latest release and nothing (none of '-s', '--lts' and
;;
old-lts)
FG_BRANCH="$OLD_LTS_BRANCH"
- COMPONENT_BRANCH[OPENRTI]=release-0.7
COMPONENT_BRANCH[OSG]=OpenSceneGraph-3.4
COMPONENT_BRANCH[TERRAGEAR]=scenery/ws2.0
SUITE_DESCRIPTION="\
@@ -1174,8 +1169,6 @@ Available options:
mode, which shows the compilation commands)
--compositor
build FlightGear with compositor enabled
- -e compile FlightGear with --with-eventinput option (experimental)
- -i compile SimGear and FlightGear with -D ENABLE_RTI=ON option (experimental)
More detailed information can be found on the FlightGear wiki:
@@ -1326,37 +1319,6 @@ function _process_PLIB_compo() {
fi
}
-function _process_OPENRTI_compo() {
- OPENRTI_INSTALL_DIR=openrti # Global: used by other components
- INSTALL_DIR_OPENRTI="$INSTALL_DIR/$OPENRTI_INSTALL_DIR" # Global: ditto
- cd "$CBD"
-
- if _elementIn "OPENRTI" "${WHATTOBUILD[@]}"; then
- _printLog "****************************************"
- _printLog "**************** OPENRTI ***************"
- _printLog "****************************************"
-
- mkdir -p "openrti"
- cd "$CBD"/openrti
- _gitDownload OPENRTI
- _gitUpdate "${COMPONENT_BRANCH[OPENRTI]}"
-
- if [ "$RECONFIGURE" = "y" ]; then
- cd "$CBD"
- mkdir -p build/openrti
- cd "$CBD"/build/openrti
- rm -f CMakeCache.txt
- "$CMAKE" -G "$BUILD_SYSTEM_GENERATOR" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
- -DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_OPENRTI" \
- "${ALL_CMAKE_ARGS[@]}" "${OPENRTI_CMAKE_ARGS[@]}" \
- ../../openrti 2>&1 | _logOutput
- fi
-
- _cmake_build_and_install openrti
- _printLog
- fi
-}
-
function _process_OSG_compo() {
local OSG_BUILD_TYPE
OSG_INSTALL_DIR=openscenegraph # Global: used by other components
@@ -1429,7 +1391,7 @@ function _process_SIMGEAR_compo() {
fi
"$CMAKE" -G "$BUILD_SYSTEM_GENERATOR" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
-DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_SIMGEAR" \
- -DCMAKE_PREFIX_PATH="$INSTALL_DIR_OSG;$INSTALL_DIR_CARES;$INSTALL_DIR_OPENRTI" \
+ -DCMAKE_PREFIX_PATH="$INSTALL_DIR_OSG;$INSTALL_DIR_CARES" \
$extra "${ALL_CMAKE_ARGS[@]}" "${SIMGEAR_CMAKE_ARGS[@]}" \
../../simgear 2>&1 | _logOutput
fi
@@ -1486,7 +1448,7 @@ function _process_FGFS_and_DATA_compos() {
$COMPOSITOR \
-DENABLE_FLITE=ON \
-DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_FGFS" \
- -DCMAKE_PREFIX_PATH="$INSTALL_DIR_SIMGEAR;$INSTALL_DIR_OSG;$INSTALL_DIR_CARES;$INSTALL_DIR_OPENRTI;$INSTALL_DIR_PLIB" \
+ -DCMAKE_PREFIX_PATH="$INSTALL_DIR_SIMGEAR;$INSTALL_DIR_OSG;$INSTALL_DIR_CARES;$INSTALL_DIR_PLIB" \
-DFG_DATA_DIR:PATH="$INSTALL_DIR_FGFS/fgdata" \
-DTRANSLATIONS_SRC_DIR:PATH="$INSTALL_DIR_FGFS/fgdata/Translations" \
$extra "${ALL_CMAKE_ARGS[@]}" "${FGFS_CMAKE_ARGS[@]}" \
@@ -1504,7 +1466,7 @@ function _process_FGFS_and_DATA_compos() {
fi
cd "$CBD"
- paths="\$d/$SIMGEAR_INSTALL_DIR/lib:\$d/$OSG_INSTALL_DIR/lib:\$d/$CARES_INSTALL_DIR/lib:\$d/$OPENRTI_INSTALL_DIR/lib:\$d/$PLIB_INSTALL_DIR/lib"
+ paths="\$d/$SIMGEAR_INSTALL_DIR/lib:\$d/$OSG_INSTALL_DIR/lib:\$d/$CARES_INSTALL_DIR/lib:\$d/$PLIB_INSTALL_DIR/lib"
common="#! /bin/sh"$'\n\n'
if [[ "$(uname)" == 'OpenBSD' ]]; then
@@ -1994,7 +1956,6 @@ function _process_selected_components() {
_process_CARES_compo
_process_ZLIB_compo
_process_PLIB_compo
- _process_OPENRTI_compo
_process_OSG_compo
_process_SIMGEAR_compo
_process_FGFS_and_DATA_compos
@@ -2029,12 +1990,12 @@ MODE="normal"
# Available values for WHATTOBUILD and WHATTOBUILDALL:
declare -a WHATTOBUILD_AVAIL=(
- ATCPIE CARES CMAKE DATA FFGO FGFS FGRUN FGX OPENRADAR OPENRTI OSG PLIB
+ ATCPIE CARES CMAKE DATA FFGO FGFS FGRUN FGX OPENRADAR OSG PLIB
SIMGEAR TERRAGEAR TERRAGEARGUI ZLIB
)
declare -a CMAKE_BASED_COMPONENTS=(
- CARES FGFS FGRUN OPENRTI OSG PLIB SIMGEAR TERRAGEAR TERRAGEARGUI ZLIB
+ CARES FGFS FGRUN OSG PLIB SIMGEAR TERRAGEAR TERRAGEARGUI ZLIB
)
# Arguments used for all CMake-based components
@@ -2125,11 +2086,6 @@ REPO_ADDRESS[PLIB]="git.code.sf.net/p/libplib/code"
REPO_SITE[PLIB]="SourceForge"
REPO_DIR[PLIB]="plib"
-COMPONENT_SRC[OPENRTI]=Git
-REPO_ADDRESS[OPENRTI]="git.code.sf.net/p/openrti/OpenRTI"
-REPO_SITE[OPENRTI]="SourceForge"
-REPO_DIR[OPENRTI]="openrti"
-
COMPONENT_SRC[OSG]=Git
REPO_ADDRESS[OSG]="gitlab.com/flightgear/openscenegraph.git"
REPO_SITE[OSG]="GitLab"
@@ -2187,7 +2143,7 @@ getopt=getopt
if [[ `uname` == 'OpenBSD' ]]; then
getopt=gnugetopt
fi
-TEMP=$($getopt -o '+shc:p:a:d:r:G:Ij:O:ib:' \
+TEMP=$($getopt -o '+shc:p:a:d:r:G:Ij:O:b:' \
--longoptions cleanup,git-clone-default-proto:,git-clone-site-params: \
--longoptions package-manager:,sudo:,ignore-intercomponent-deps,compositor \
--longoptions component-branch:,cmake-arg:,sg-cmake-arg:,fg-cmake-arg: \
@@ -2392,7 +2348,6 @@ Allowed components are:\n\n" "$verbatim_component" >&2
-r) RECONFIGURE="$2"; shift 2 ;;
-j) JOPTION="-j$2"; shift 2 ;;
-O) OOPTION="-O$2"; shift 2 ;;
- -i) OPENRTI="OPENRTI"; shift ;;
-b) BUILD_TYPE="$2"; shift 2 ;;
--compositor) COMPOSITOR="-DENABLE_COMPOSITOR=ON"; shift ;;
--non-interactive) INTERACTIVE_MODE=0; shift ;;
@@ -2442,12 +2397,6 @@ fi
declare -A COMPONENT_BRANCH
_determineSuiteDescriptionAndBranchForEachComponent
-if [[ "$OPENRTI" = "OPENRTI" ]]; then
- SIMGEAR_CMAKE_ARGS+=("-DENABLE_RTI=ON")
- FGFS_CMAKE_ARGS+=("-DENABLE_RTI=ON")
- WHATTOBUILD+=("OPENRTI")
-fi
-
_startLog "$0 $*"
# The following is skipped when only running the “cleanup” routine.
|
|
From: <fli...@li...> - 2026-04-23 21:49:49
|
unknown user pushed a commit to branch release/2024.1 in repository fgmeta. SF URL: http://sourceforge.net/p/flightgear/fgmeta/ci/873e785da7322d26ef7487d9a66a2bcf50046613/ Commit: 873e785da7322d26ef7487d9a66a2bcf50046613 Author: Florent Rougon Committer: Florent Rougon AuthorDate: Wed Apr 22 15:03:15 2026 +0200 Command line parsing in dedicated function --- release_builder/create_shared_models_manifest.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/release_builder/create_shared_models_manifest.py b/release_builder/create_shared_models_manifest.py index fbd0a41..3254538 100755 --- a/release_builder/create_shared_models_manifest.py +++ b/release_builder/create_shared_models_manifest.py @@ -51,9 +51,7 @@ def collect_model_files(base_dir): return files -def main(): - locale.setlocale(locale.LC_ALL, '') - +def parse_command_line(): parser = argparse.ArgumentParser( description="Create SharedModelsManifest.json for FlightGear" ) @@ -64,7 +62,12 @@ def main(): default=None, help="Optional path to the TerraSync directory", ) - args = parser.parse_args() + return parser.parse_args() + + +def main(): + locale.setlocale(locale.LC_ALL, '') + args = parse_command_line() fgdata_dir = os.path.abspath(args.fgdata_dir) if not os.path.isdir(fgdata_dir): |
|
From: <fli...@li...> - 2026-04-23 21:31:51
|
unknown user pushed a commit to branch release/2024.1
in repository simgear.
The following commit(s) were added to refs/heads/release/2024.1 by this push:
new 02118eb4 Add missing <cstdint> header
02118eb4 is described below
SF URL: http://sourceforge.net/p/flightgear/simgear/ci/02118eb46220144b408efab7af381443cd85c311/
Commit: 02118eb46220144b408efab7af381443cd85c311
Author: Florent Rougon
Committer: Florent Rougon
AuthorDate: Thu Apr 23 23:12:31 2026 +0200
Add missing <cstdint> header
---
simgear/io/iostreams/sgstream.hxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/simgear/io/iostreams/sgstream.hxx b/simgear/io/iostreams/sgstream.hxx
index fc441e65..69dfb077 100644
--- a/simgear/io/iostreams/sgstream.hxx
+++ b/simgear/io/iostreams/sgstream.hxx
@@ -28,10 +28,10 @@
#include <simgear/compiler.h>
+#include <cstdint>
+#include <fstream>
#include <istream>
#include <ostream>
-#include <fstream>
-
#include <string>
#include <vector>
|
|
From: <fli...@li...> - 2026-04-23 15:01:29
|
unknown user pushed a commit to branch release/2024.1 in repository fgmeta. SF URL: http://sourceforge.net/p/flightgear/fgmeta/ci/f3327c505d1ee8add28e09dbbcebb4acfdca2e76/ Commit: f3327c505d1ee8add28e09dbbcebb4acfdca2e76 Author: James Turner Committer: James Turner AuthorDate: Thu Apr 23 11:44:53 2026 +0100 Improvments suggested by Florent - add a schema to the JSON - add a trailing newline Co-authored-by: Copilot <co...@gi...> --- release_builder/create_shared_models_manifest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/release_builder/create_shared_models_manifest.py b/release_builder/create_shared_models_manifest.py index 065d18a..32e810f 100755 --- a/release_builder/create_shared_models_manifest.py +++ b/release_builder/create_shared_models_manifest.py @@ -91,11 +91,15 @@ def main(): # Deduplicate and sort for a stable, diff-friendly output files = sorted(frozenset(files)) - manifest = {"files": files} + manifest = {"schemaVersion": 1, "files": files} output_path = os.path.join(fgdata_dir, "SharedModelsManifest.json") with open(output_path, "w", encoding="utf-8") as f: + # note we keep the default value (True) of ensure_ascii + # file-names in FGData and TerraSync should be ASCII only, + # no extended UTF-8 characters, for now. json.dump(manifest, f, indent=2) + f.write("\n") print(f"Wrote {len(files)} file entries to {output_path!r}") |
|
From: <fli...@li...> - 2026-04-23 13:38:44
|
unknown user pushed a commit to branch next
in repository flightgear.
The following commit(s) were added to refs/heads/next by this push:
new ef249c4ce CI: harmonize naming of inputs and reduce verbosity
ef249c4ce is described below
SF URL: http://sourceforge.net/p/flightgear/flightgear/ci/ef249c4ce78d8802ade62f769e59901f3f09171c/
Commit: ef249c4ce78d8802ade62f769e59901f3f09171c
Author: Florent Rougon
Committer: Florent Rougon
AuthorDate: Thu Apr 23 15:16:33 2026 +0200
CI: harmonize naming of inputs and reduce verbosity
'string' is the default type for CI inputs; use this fact to make the
YAML header shorter in case we add more inputs in the future.
---
.gitlab-ci.yml | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 897305f98..ac0334050 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -8,15 +8,14 @@ spec:
default: false
description: "Clear the 'ccache' cache before starting the builds"
- simgear_ref:
- type: string
+ simgear-ref:
default: next
description: "Git ref of the 'simgear' artifacts to fetch"
- fgdata_ref:
- type: string
+ fgdata-ref:
default: next
- description: "Git ref of the 'fgdata' artifacts to fetch"
+ description: >
+ Git ref of the 'fgdata' artifacts to fetch for running the test suite
---
variables:
@@ -142,7 +141,7 @@ linux-build:
- project: flightgear/simgear
job: linux-build
artifacts: true
- ref: $[[ inputs.simgear_ref ]]
+ ref: $[[ inputs.simgear-ref ]]
- project: flightgear/openscenegraph
job: linux-build
ref: $OSG_REF
@@ -177,7 +176,7 @@ linux-qt5-build:
- project: flightgear/simgear
job: linux-qt5-build
artifacts: true
- ref: $[[ inputs.simgear_ref ]]
+ ref: $[[ inputs.simgear-ref ]]
- project: flightgear/openscenegraph
job: linux-build
ref: $OSG_REF
@@ -255,7 +254,7 @@ windows-build:
needs:
- project: flightgear/simgear
job: windows-build
- ref: $[[ inputs.simgear_ref ]]
+ ref: $[[ inputs.simgear-ref ]]
artifacts: true
- project: flightgear/openscenegraph
job: windows_build
@@ -304,7 +303,7 @@ macos-build:
needs:
- project: flightgear/simgear
job: macos-build
- ref: $[[ inputs.simgear_ref ]]
+ ref: $[[ inputs.simgear-ref ]]
artifacts: true
- project: flightgear/openscenegraph
job: macos-build
@@ -334,7 +333,7 @@ test:
artifacts: true
- project: flightgear/fgdata
job: create-test-data
- ref: $[[ inputs.fgdata_ref ]]
+ ref: $[[ inputs.fgdata-ref ]]
artifacts: true
- project: flightgear/openscenegraph
job: linux-build
|