Skip to content

Commit

Permalink
Handle TO218AB-5 and TO218-5-146 packages
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre committed Oct 13, 2017
1 parent 14db74f commit 0c6f254
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Elecena/Utils/PackageInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ public static function getPackage($desc) {
// SOP08 -> SOP8
$desc = preg_replace('#([A-Z]{3,})0(\d)#', '$1$2', $desc);

// TO218AB-5pin -> TO218AB-5 pin
$desc = preg_replace('#(\d)PIN#', '$1 PIN', $desc);

$groups = [
'TO-?(1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|201|202|203|204|205|206|206-?AA|207|208|208A|210|211|212|213AA|214|217|218|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|239|241|242|248|249|254|255|257|258|259|264|268|276)',
// https://www.infineon.com/cms/en/product/packages/PG-TO218/
// https://www.infineon.com/cms/en/product/packages/PG-TO218/PG-TO218-5-146/
'TO-?218(AB-5|-5-146)',
// https://en.wikipedia.org/wiki/TO-92
'TO-?92(-3)?',
// https://en.wikipedia.org/wiki/TO-220
Expand Down Expand Up @@ -286,6 +292,9 @@ public static function getPackage($desc) {
// @see https://www.arrow.com/en/products/2n2222a/microsemi
'TO-206-AA' => 'TO-18',

// @see https://www.infineon.com/cms/en/product/packages/PG-TO218/
'TO-218AB5' => 'TO-218AB-5',

// http://www.taydaelectronics.com/1-5ke6v8-tvs-bidirectional-6-8v-1500w-cb429-do-201ad-1-5ke6v8ca.html
'CB429' => 'DO-201AD',
];
Expand All @@ -294,6 +303,9 @@ public static function getPackage($desc) {
$package = $normalizations[$package];
}
}
else {
# var_dump(__METHOD__, $desc, $package); // debug
}
return $package;
}
}
4 changes: 4 additions & 0 deletions tests/PackageInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function getPackageProvider() {
[ 'Tranzystor PNP 100 V 25 A 3 MHz HFE 10 TO-247 TIP36C 3-Pin', 'TO-247' ],
[ 'BU626A TO-3', 'TO-247' ],
[ 'Dioda FYA3010DNTU 30A 100V TO-3P 3-Pin', 'TO-247' ],
[ '2SC3320 TO-3P TRANSISTOR', 'TO-247' ],
[ '2SC-3421 NPN 1A/120V/10W SOT-429 TRANZYS', 'TO-247' ],
[ 'TRANS NPN DARL 400V 15A TO-247-3', 'TO-247-3' ],
[ 'TRANSISTOR, BIPOLAR, NPN, 600V, 96A, TO-247AC', 'TO-247AC' ],
Expand Down Expand Up @@ -137,6 +138,9 @@ public function getPackageProvider() {

[ '2SK956 Tranzystor N-MOSFET 800V 9A 150W 1R5 SOT93', 'TO-218' ],
[ 'Transistor NPN TO-218 60 V 15 A 90 W', 'TO-218' ],
[ 'BTS555 MOSFET 165A/62V driver TO218AB-5pin', 'TO-218AB-5' ],
[ 'BTS555 Transistor N Channel MOSFET Case TO218AB-5' ,'TO-218AB-5' ],
[ 'IC SW PWR HISIDE TO-218-5-146', 'TO-218-5-146' ],

[ 'BSP52E6327 INFIN 0205 SOT223', 'SOT223' ],
[ 'PNP high-voltage low VCEsat Breakthrough In Small Signal (BISS) transistor in a SOT223 (SC-73) medium power', 'SOT223' ],
Expand Down

0 comments on commit 0c6f254

Please sign in to comment.