mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-01 21:48:28 -04:00
Planner: Implemented the ParameterMetaDataRepository.cs's GetParameterMetaData method. It will now return a meta value by the parameter name and meta key.
This commit is contained in:
parent
a91c7781a5
commit
b293997e2d
@ -3,6 +3,7 @@ using System.Configuration;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace ArdupilotMega.Utilities
|
namespace ArdupilotMega.Utilities
|
||||||
{
|
{
|
||||||
@ -32,7 +33,19 @@ namespace ArdupilotMega.Utilities
|
|||||||
{
|
{
|
||||||
// Use this to find the endpoint node we are looking for
|
// Use this to find the endpoint node we are looking for
|
||||||
// Either it will be pulled from a file in the ArduPlane hierarchy or the ArduCopter hierarchy
|
// Either it will be pulled from a file in the ArduPlane hierarchy or the ArduCopter hierarchy
|
||||||
string endpointSearchString = (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) ? "arduplane" : "arducopter";
|
var element = _parameterMetaDataXML.Element(MainV2.cs.firmware.ToString());
|
||||||
|
if(element != null && element.HasElements)
|
||||||
|
{
|
||||||
|
var node = element.Element(nodeKey);
|
||||||
|
if(node != null && node.HasElements)
|
||||||
|
{
|
||||||
|
var metaValue = node.Element(metaKey);
|
||||||
|
if(metaValue != null)
|
||||||
|
{
|
||||||
|
return metaValue.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user