From e90da11ffd28b10d340184dbeeaa094007b472ec Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 16 Dec 2017 19:18:35 +0100 Subject: o Moving some code around. --- gen | 105 +++++++++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 67 insertions(+), 38 deletions(-) (limited to 'gen') diff --git a/gen b/gen index 6f21655..bf9c706 100755 --- a/gen +++ b/gen @@ -15,42 +15,6 @@ env.globals["rnd2"] = lambda x: round(x, 2) chip = env.get_template('CHIP.j2') -resc_heights = { - "1005": [0.15, 0.35, 0.37, 0.40], - "1608": [0.40], - "2012": [0.40], - "3216": [0.40], - "3225": [0.40], - "5025": [0.40], - "6332": [0.40], -} - -capc_heights = { - "1005": [0.15, 0.35, 0.37, 0.40], - "1608": [0.40], - "2012": [0.40, 1.35], - "3216": [0.40], - "3225": [0.40], - "5025": [0.40], - "6332": [0.40], -} - -ledsc_heights = { -# https://www.digikey.com/products/en/optoelectronics/led-indication-discrete/105?k=&pkeyword=&pv16=4&FV=ffe00069%2C1140003&mnonly=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=100 - "1005": [0.25, 0.35, 0.40, 0.45, 0.50, 0.52, 0.55, 0.60, 0.70, 0.71], - "1608": [0.20, 0.25, 0.28, 0.30, 0.35, 0.39, 0.40, 0.42, 0.45, 0.46, 0.50, 0.52, 0.55, 0.60, 0.65, 0.70, 0.71, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15], - "2012": [0.40, 0.45, 0.50, 0.70, 0.75, 0.79, 0.80, 0.84, 0.85, 0.90, 1.00, 1.10, 1.20, 1.25, 1.30, 2.10], -} - -def auto_str(cls): - def __str__(self): - return '%s(%s)' % ( - type(self).__name__, - ', '.join('%s=%s' % item for item in vars(self).items()) - ) - cls.__str__ = __str__ - return cls - class Value(object): def __init__(self, typ, mn, mx): @@ -68,6 +32,15 @@ def parse_courtyard(grid): (grid_y, grid_x) = grid_re.match(grid).groups() return (float(grid_x) * 0.5 / 2, float(grid_y) * 0.5 / 2) +def auto_str(cls): + def __str__(self): + return '%s(%s)' % ( + type(self).__name__, + ', '.join('%s=%s' % item for item in vars(self).items()) + ) + cls.__str__ = __str__ + return cls + @auto_str class ChipDimensions(object): @@ -108,12 +81,68 @@ class ChipLandPattern(object): pad_size_y = float(data["x"]), courtyard_x = courtyard_x, courtyard_y = courtyard_y) +resc_heights = { + "1005": [0.15, 0.35, 0.37, 0.40], + "1608": [0.40], + "2012": [0.40], + "3216": [0.40], + "3225": [0.40], + "5025": [0.40], + "6332": [0.40], + "7142": [0.89], +} + +capc_heights = { + "1005": [0.15, 0.35, 0.37, 0.40], + "1608": [0.40], + "2012": [0.40, 1.35], + "3216": [0.40], + "3225": [0.40], + "5025": [0.40], + "6332": [0.40], +} + +ledsc_heights = { +# https://www.digikey.com/products/en/optoelectronics/led-indication-discrete/105?k=&pkeyword=&pv16=4&FV=ffe00069%2C1140003&mnonly=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=100 + "1005": [0.25, 0.35, 0.40, 0.45, 0.50, 0.52, 0.55, 0.60, 0.70, 0.71], + "1608": [0.20, 0.25, 0.28, 0.30, 0.35, 0.39, 0.40, 0.42, 0.45, 0.46, 0.50, 0.52, 0.55, 0.60, 0.65, 0.70, 0.71, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15], + "2012": [0.40, 0.45, 0.50, 0.70, 0.75, 0.79, 0.80, 0.84, 0.85, 0.90, 1.00, 1.10, 1.20, 1.25, 1.30, 2.10], +} + #resc_dims = [ChipDimensions.from_ipc(p) for p in ipc_sm_782.data["resc"]["dimensions"]] -resc_lp = [ChipLandPattern.from_ipc(p) for p in ipc_sm_782.data["resc"]["land_patterns"]] +resc_land_patterns = ipc_sm_782.data["resc"]["land_patterns"] +# Some extra custom patterns +if False: + resc_land_dimensions.append({ + "size_mm": "710420", + "size_in": "2816", + "l_min": 7.10 - 0.2, + "l_max": 7.10 + 0.2, +# "s_min": +# "s_max": + "w_min": 4.20 - 0.2, + "w_max": 4.20 + 0.2, +# "t_min": +# "t_max": +# "h_max": + }) + resc_land_patterns.append({ +# "rlp_no": + "size_mm": "7142", + "size_in": "2816", +# "z": +# "g": +# "x": +# "y": +# "c": + "grid": "10x10", + }) +resc_lp = [ChipLandPattern.from_ipc(p) for p in resc_land_patterns] #capc_dims = [ChipDimensions.from_ipc(p) for p in ipc_sm_782.data["capc"]["dimensions"]] capc_lp = [ChipLandPattern.from_ipc(p) for p in ipc_sm_782.data["capc"]["land_patterns"]] -ledsc_lp = [ChipLandPattern.from_ipc(p) for p in ipc_sm_782.data["ledsc"]["land_patterns"]] +# We borrow the CAPC land patterns +ledsc_lp = [ChipLandPattern.from_ipc(p) for p in ipc_sm_782.data["capc"]["land_patterns"]] work = [\ ("RESC", resc_lp, resc_heights), \ -- cgit v1.2.3