Check for valid value when updating AI lod radius.
Update radius of AI model after model data is loaded - prevents rendering artifacts at near/far camera boundary.
Modifications to launcher to load Add-on modules and view related metadata. Each module can also be selectively enabled with a checkbox. Fixes also submitted by Florent Rougon.
Modifications to the Launcher to enable the management of Add-on modules
I also see this. I cleaned out the directory pointed to by FG_HOME, and I can reset one time okay. If I reset more than once, FG crashes.
I've added a check to make sure, the model radius doesn't get updated to something less than zero.
Check for valid value when updating AI lod radius.
Update radius of AI model after model data is loaded - prevents rendering artifacts at near/far camera boundary.
Update radius of AI model after model data is loaded - prevents rendering artifacts at near/far camera boundary.
Revert "AI Traffic - better integration with terrasync."
Uggh, that was dumb on my part. I've pushed a new update to fix it.
Fix sound issue when Aircraft model reloaded from debug menu
Fix Sound issue after reloading aircraft model from debug menu.
Fix sound going up/down with pause/un-pause cycles.
This was already merged
Fix sound going up/down with pause/un-pause cycles.
Fix sound going up/down with pause/un-pause cycles.
Ok, I guess wasn't clear. I wasn't trying to add something to your todo list. Instead, I was asking your opinion and offering to do the work to update the unit test. Earlier in this thread, you asked me to do the unit test update, so I'm not sure what's different now, but I'll leave it alone.
The split is not ideal, but it's better than the bug that if fixes at least. It doesn't appear that dynamics is instantiated in the unit test, so I don't think most of the fgSetPosFromAirportIDandParkpos routine was being tested anyway. To avoid instantiating the ATC manager, I could create a static method or function call for the modified bit in ATC manager (returns ParkingAssignment), so it can be called separately for the unit test. That's assuming dynamics can be instantiated in the unit test...
Any other issues to resolve? Can we get this merged?
Added to check to avoid null-ptr exception in the event available parking is not found.
I've pushed a change to add radius check for available parking spot.
Modify available parking so that it looks for a spot based on radius size. If not found, largest parking spot from available spots is selected.
That's true, but when you designate a specific spot, the radius isn't looked at either. Also, in the previous version of the code, there were issues, since it appears that not all aircraft designate a radius, and in addition, the radius is not defined in the aircraft data file on the first flight, so the radius would come back as zero in those cases, and a parking spot would not be found. If you prefer I can first try getting the radius, and if it returns zero, I could then default to selecting the...
Fix problem where AI planes are placed on top of user aircraft when user either selects a specific spot or user selects parking to be an available spot.
I've pushed a squash commit for the combined changes. If your okay with it, please merge.
Fix problem where AI planes are placed on top of user aircraft when user either selects a specific spot or user selects parking to be an available spot.
I have the if AVAILABLE clause in fgSetPosFromAirportIDandParkpos disabled, so it needs to be removed. Let me clean it up first, and I'll push a new squashed commit.
FGATCManager::postinit runs before finalizePosition runs. The parking positions exist in the dynamics object, so when FGATCManager::postinit runs it selects one that is available and sets it as if it were selected by the user. I've tested it, so I know it works. Are there use cases that I'm overlooking?
Fix problem where AI planes are placed on top of user aircraft when user either selects a specific spot or user selects parking to be an available spot.
It needs cleanup, but I pushed a version that handles the parkpos == AVAILABLE case mentioned in my previous post.
Handle case where --parkpos=AVAILABLE. Prevents AI plane being placed over user aircraft.
If it's invalid, that means someone started fgfs from the command line with --parkpos set to an invalid position. If the position is valid, it would have been set in FGATCManager::postinit prior to this point. For an invalid position, the aircraft ends up in the grass somewhere. I could add a fallback where it picks an available position, if pka is invalid the first time. There's also another problem in this code related to the if ((parkpos == "AVAILABLE") && (radius > 0)) { code right above this...
It seems like the original idea is intact. Setting a breakpoint in handleAirportEndPoints, I observed that the user aircraft parking spot is released when the user aircraft is moved away from the parking spot selected at startup. I've modified the dynamics class to add a new routine called getOccupiedParkingByName that only returns the user's ParkingAssignment FGParkingRef instead of a ParkingAssignment object. The actual parking assignment is not needed at this point, since the only purpose for...
If the user parking is not tracked in the ground-controller, then where? Is there anything else that makes sense?
Would it make sense to have the FGGroundController track the user's postion, and remove the parking assignment once the user's aircraft moved from the assigned parking spot? FGAirportDynamics already tracks assigned parking spots, so it could be modified to hold the ParkingAssignments instead of tracking ParkingRefs.
It looks like your are correct. FGAirportDynamics::getParkingByName creates a new ParkingAssignment from a ParkingRef instead of copying the ParkingAssignment that was assigned in the FGATCManager::postinit routine. I think occupiedParkings needs to be changed to refer to ParkingAssignments instead of ParkingRefs, so that the same object is referred to in fgSetPosFromAirportIDandParkpos and the postinit routines.
I'm not sure about that. The parking assignment gets saved in the F GATCManager::postinit routine when FGAIFlightPlan::setGate is executed. It seems like ParkingAssignment's reference count is not being managed properly. When fgSetPosFromAirportIDandParkpos exits, the reference count should still be one, since FGAIFlightPlan is holding a copy. At least I think it should be. I assume it holds it until the plane pushes away from the parking spot, but I'm not familiar with most of this code, so I could...
There's a subtle difference between the two approaches. In the before patch approach, after pka = dcs->getParkingByName(parkpos) is called, the pka object and the rvalue returned rom getParkingByName both point to the same _sharedData object, so when the rvalue is cleaned up after the assignment to pka, the reference count is decremented by one, The reference count is decremented again when pka is destroyed on exit from fgSetPosFromAirportIDandParkpos. The total reference count is now zero, so the...
The copy-and-swap idiom is a fairly common solution for implementing an assignment operator, so I don't see why it wouldn't be applicable here? Some references: https://cpppatterns.com/patterns/copy-and-swap.html https://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom
Problem with AI planes being parked on user aircraft
Fixed problem with copy-assignment operator in ParkingAssignment class that caused user aircraft parking spot to be released prematurely.
changed getParkingByName to return ParkingRef instead of ParkingAssignment in order to fix problem with ParkingAssignment reference count releasing assigned parking spot before AI planes are placed.
Merge branch 'next' into fix_parking
changed getParkingByName to return ParkingRef instead of ParkingAssignment in order to fix problem with ParkingAssignment reference count releasing assigned parking spot before AI planes are placed.
I had a similar problem on windows, and I commented out setup_fgfs_embedded_resources in Main/CmakeLists.txt to get rid of the problem.
Ok, thanks for your help.
It's changed. New version pushed.
Modifications to launcher to load Add-on modules and view related metadata. Each module can also be selectively enabled with a checkbox. Fixes also submitted by Florent Rougon.
I'm not sure what you mean? I just changed the name in the template that was already there.
Your problem was reproducible on Ubuntu. There I have Qt 5.9.2, and it turns out the Object.values() is not supported. I changed it back to Object.keys() and it works. Try it out, and let me know if it's okay. I've pushed the new changes - except for the issue with copyrights in qml files. I'm not sure why there are no copyright notices in any of the those files. Note: on windows, I have Qt 5.12, so I guess Object.values() was only a recent addition to qml support.
Modifications to launcher to load Add-on modules and view related metadata. Each module can also be selectively enabled with a checkbox. Fixes also submitted by Florent Rougon.
Sorry, I haven't pushed them yet. I'm doing a build on Ubuntu to see if the authors/maintainers problem shows there. My ubuntu box is slow, so it's taking a while to build.
I've reverted the LauncherMainWindow.cxx file to its original, and updated the copyright in AddonsModel.*. There doesn't seem to be copyright notices in any of the qml files. At least grep -rni copyright doesn't return anything.
The fix for multiple authors/maintainers is definitely working on my end. It works for both cases: with multiple contacts and with just one. I did the development on windows, so maybe there is a linux vs windows issue here? I'll try it on ubuntu and see if it makes a difference.
I cherry-picked your two fixup comits and removed the createinstance method call in the launcher main window startup. Definitely cleaner with the static method template for creating addon refs.
Modifications to launcher to load Add-on modules and view related metadata. Each module can also be selectively enabled with a checkbox. Fixes also submitted by Florent Rougon.
Ok, thanks for catching that. I made a bad assumption with qml and assumed that the qstringlist returned as a qvariant type would be an array type in qml. Turns out it's an object type, so I need to conver it to an array before I can do a join on it. Something like this: function labelText(lbl, idx, key) { var value = _addOns.modules.get(idx, key); if (typeof value === 'object') { value = Object.keys(value).map(function(key) { return value[key]; }).join(', '); } return qsTr("%1: %2").arg(lbl).arg(value);...
I've cleaned it up and squashed the commits. I think it's ready to merge now.
Converted Metadata and MetadataParser back to private classes in the Addon class, and changed launcher code to use addons instead of metadata for interface to xml metadata file.
Is there any reason why you couldn't proceed this way? I didn't see a benefit to bringing in the Addon class, when I all I really needed was the parsing from the Metadata class. The Addon class seems well done, but it seems to address several items that are not relevant to the Launcher, such as the Nasal ghosts, menubar reading, menubar property nodes and addon property nodes, In addition, the use of SGPath forces an additional conversion step in the Launcher, since strings in Qt usually need to...
Changes from review comments. Moved enable and path members out of Metadata class and put them in AddonsModel. Also made failure of min/max fg version check nicer.
Changed MetadataListModel name to AddonsModel, and fixed a couple of issues in qml due to undefined errors when deleting addon modules. Also removed an unneeded include of qstringlist.
Extending Add-on Module management to show module meta-data details in the Launcher
Modifications to launcher to load Add-on modules and view related metadata. Each module can also be selectively enabled with a checkbox.
Extending Add-on Module management to show module meta-data details in the Launcher
Extending Add-on Module management to show module meta-data details in the Launcher
Fix problem with duplicate entries being allowed.
Extend data method to return values for tags, authors, and maintainters
Converted Metadata to be passed around as a shared_ptr instead of a copied object. Changed AddOns delegate to show some of the metadata.
Minor cleanups.
Added details view for Add-ons Metadata display.
Modified ListModel so that roles can be accessed using string names instead of enums. Also, fixed problem with moving addon module items.
Split Addons out from PathListDelegate, and cleaned up MetadataListModel a little. Found issue with resetData routine not working correctly.
connected addon module metadata to qml. Some work still needed on PathListDelegate.qml and the qml presentation of the metadata. Not all display roles are fully implemented.
modified main startup and dialog startup to allow capture of Addon objects from launcher. Addon objects now hold meta-data. Next step is to connect objects to qml.
save WIP for adding metadata display in launcher addon section.
Updated mandatory files to require addon-metadata.xml instead of addon-config.xml, which is optional.
Adding Add-on Module management to the Launcher
Modifications to the Launcher to enable the management of Add-on modules
VOTE: flightgear