mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-15 07:29:30 +00:00
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:
parent
fdf64f9e9a
commit
7a6b045030
4 changed files with 141 additions and 34 deletions
|
|
@ -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
|
|||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue