TDF and TDF script changes (application changes pending):
- Added new `pad` element to TDFs - Refactored `pin` and `signal` elements to accommodate new `pad` element - Improved validation of signal-to-pad relation in TDF validation script - Added key attribute to `variant` element - Removed `package` attribute from `variant` element
This commit is contained in:
@@ -5,6 +5,7 @@ use DOMDocument;
|
||||
use DOMNode;
|
||||
use DOMNodeList;
|
||||
use DOMElement;
|
||||
use Targets\TargetDescriptionFiles\Pad;
|
||||
use Targets\TargetDescriptionFiles\Services\StringService;
|
||||
use Targets\TargetDescriptionFiles\Services\Xml\Exceptions\XmlParsingException;
|
||||
use Targets\TargetDescriptionFiles\AddressSpace;
|
||||
@@ -370,7 +371,7 @@ class FromXmlService
|
||||
$attributes = $this->getNodeAttributesByName($element);
|
||||
|
||||
return new Signal(
|
||||
$attributes['pad-id'] ?? null,
|
||||
$attributes['pad-key'] ?? null,
|
||||
$this->stringService->tryStringToInt($attributes['index'] ?? null),
|
||||
$attributes['function'] ?? null,
|
||||
$attributes['group'] ?? null,
|
||||
@@ -378,6 +379,16 @@ class FromXmlService
|
||||
);
|
||||
}
|
||||
|
||||
public function padFromElement(DOMElement $element): Pad
|
||||
{
|
||||
$attributes = $this->getNodeAttributesByName($element);
|
||||
|
||||
return new Pad(
|
||||
$attributes['key'] ?? null,
|
||||
$attributes['name'] ?? null
|
||||
);
|
||||
}
|
||||
|
||||
public function pinoutFromElement(DOMElement $element): Pinout
|
||||
{
|
||||
$attributes = $this->getNodeAttributesByName($element);
|
||||
@@ -409,7 +420,7 @@ class FromXmlService
|
||||
|
||||
return new Pin(
|
||||
$attributes['position'] ?? null,
|
||||
$attributes['pad'] ?? null
|
||||
$attributes['pad-key'] ?? null
|
||||
);
|
||||
}
|
||||
|
||||
@@ -418,9 +429,9 @@ class FromXmlService
|
||||
$attributes = $this->getNodeAttributesByName($element);
|
||||
|
||||
return new Variant(
|
||||
$attributes['key'] ?? null,
|
||||
$attributes['name'] ?? null,
|
||||
$attributes['pinout-key'] ?? null,
|
||||
$attributes['package'] ?? null
|
||||
$attributes['pinout-key'] ?? null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user