Torsten wrote in Tue Jul 18, 2017 9:47 pm:Hooray wrote in Tue Jul 18, 2017 8:34 pm:I think that FGCamera would make for an excellent "testbed" to see how complete the current framework really is.
Challenge accepted. What's the current license state of FGCamera? I found a statement here in the forum that it is "license free". I need it to be GPL (compatible).
Hi all, maybe i'll add something to discussion. I've been learning nasal/propertytree and best way for me is to learn by working on something useful. I've taken fgcamera latest code (201706) from fgcamera thread: viewtopic.php?f=6&t=21685&start=135#p314678
I've ported most of the code to addon api but with the newest code Anders is using property rules (viewtopic.php?f=6&t=21685&start=135#p314678). Right now they cannot be loaded. Error comes from the flightgear code autopilotgroup.cxx:
- Code: Select all
void FGXMLAutopilotGroup::addAutopilotFromFile( const std::string& name,
SGPropertyNode_ptr apNode,
const char* path )
{
SGPath config = globals->resolve_maybe_aircraft_path(path);
respective code for loading property rule in fgcamera config.xml is:
- Code: Select all
<systems>
<property-rule n="150">
<path>/Nasal/fgcamera/property-rules/fgcamera.xml</path>
</property-rule>
When fgcamera was transferred directly to fg-root there was no problem. Problem with finding it is in options.cxx where we load addon:
- Code: Select all
p->propertyFiles.push_back(config_xml);
globals->append_aircraft_path(path);
fgGetNode("addons",true)
->addChild("addon")
->getNode("path",true)
->setStringValue(path.str());
This code in globals put paths into :
- Code: Select all
fg_aircraft_dirs.push_back(dirPath.realpath());
extra_read_allowed_paths.push_back(dirPath.realpath());
but autopilot when loading property rule is searching for path with: resolve_maybe_aircraft_path(path) and in simgear it is looking in ResourceManager.cxx in:
- Code: Select all
SGPath ResourceManager::findPath(const std::string& aResource, SGPath aContext)
Soo for my understanding one should somehow implement loading property rules (files) from addon directories in such way that this could be possible. This can be done either with adding addon path to base paths or to implement another resource provider as in globals.cxx for AircraftResourceProvider ? All solutions are waay beyond my grade and I would like to ask for some solution/proposition to this issue.
I think, when this is implemented fgcamera should be working as addon.