Improve parameter parsing (#583)

* DigiKey: Skip empty values

* Move improved range detection from LCSCProvider to ParameterDTO class
Improve numeric value detection by moving extra info to value_text

* ParameterDTO: Add micro unit prefix

* Bring $value_text2 to a defined state

* ParameterDTO: Don't overwrite $unit if it's not empty

* ParameterDTO: Don't overwrite $unit if it's not empty

* Correct some inaccuacies in comments

* Added tests and fixed certain edge cases in parsing parameters

* Added more tests for parameter parsing

---------

Co-authored-by: Jan Böhmer <mail@jan-boehmer.de>
This commit is contained in:
frank-f 2024-04-15 22:33:27 +02:00 committed by GitHub
parent fdf64f9e9a
commit 7a6b045030
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 141 additions and 34 deletions

View file

@ -210,6 +210,10 @@ class DigikeyProvider implements InfoProviderInterface
$footprint_name = $parameter['Value'];
}
if (in_array(trim($parameter['Value']), array('', '-'), true)) {
continue;
}
$results[] = ParameterDTO::parseValueIncludingUnit($parameter['Parameter'], $parameter['Value']);
}
@ -265,4 +269,4 @@ class DigikeyProvider implements InfoProviderInterface
];
}
}
}