コード例 #1
0
def handle_jlc_without_smd_code(cell_values_array, m_r):
    try:
        # extract
        first_category_value = cell_values_array[COL_NUM_FIRST_CATEGORY]
        lcsc_part = cell_values_array[COL_NUM_LCSC_PART]
        package = get_component_package(cell_values_array)

        r_accuracy = m_r[2]

        r_smd_code = get_smd_code(m_r[1])
        component_name = ','.join(
            [get_r_name(r_smd_code), package, m_r[1], r_accuracy, lcsc_part])
        component_name = massage_component_name(component_name)

        # translate
        temp_lib = gen_r.getLibText(*[
            component_name, cell_values_array[COL_NUM_PACKAGE], r_accuracy,
            cell_values_array[COL_NUM_LCSC_PART],
            cell_values_array[COL_NUM_MFR_PART],
            cell_values_array[COL_NUM_FIRST_CATEGORY],
            cell_values_array[COL_NUM_SECOND_CATEGORY],
            cell_values_array[COL_NUM_SOLDER_JOINT],
            cell_values_array[COL_NUM_MANUFACTURER],
            cell_values_array[COL_NUM_LIBRARY_TYPE]
        ])
        temp_dcm = gen_r.getDcmText(component_name, '',
                                    cell_values_array[COL_NUM_PACKAGE],
                                    r_accuracy)

        return temp_lib, temp_dcm

    except Exception as e:
        print('debug')
        pprint(m_r)
        raise e
コード例 #2
0
def handle_jlc_with_resistor_ppm(cell_values_array, m_r):
    try:
        # extract
        first_category_value = cell_values_array[COL_NUM_FIRST_CATEGORY]
        lcsc_number = cell_values_array[COL_NUM_LCSC_PART]
        package = cell_values_array[COL_NUM_PACKAGE]
        ppm_value = m_r[3]
        ppm_spec = massage_ppm_value(ppm_value)

        component_name = ','.join(
            [m_r[1], ppm_spec + 'PPM', package, lcsc_number])
        r_text_value = m_r[1]

        # r_smd_code = str(parseTextCode(r_text_value.replace('Ω','')))
        # r_smd_code = getThreeDigitCode(r_smd_code)
        # print(r_smd_code)
        # print(getThreeDigitCode(r_smd_code))

        # r_accuracy = m_r[2]

        # translate
        temp_lib = gen_r.getLibText(*[
            component_name, cell_values_array[COL_NUM_PACKAGE], None,
            cell_values_array[COL_NUM_LCSC_PART],
            cell_values_array[COL_NUM_MFR_PART],
            cell_values_array[COL_NUM_FIRST_CATEGORY],
            cell_values_array[COL_NUM_SECOND_CATEGORY],
            cell_values_array[COL_NUM_SOLDER_JOINT],
            cell_values_array[COL_NUM_MANUFACTURER],
            cell_values_array[COL_NUM_LIBRARY_TYPE]
        ])
        temp_dcm = gen_r.getDcmText(component_name, r_text_value,
                                    cell_values_array[COL_NUM_PACKAGE], '')

        return temp_lib, temp_dcm

    except Exception as e:
        print('debug')
        pprint(m_r)
        raise e
コード例 #3
0
def handle_r_resistance_precision(cell_values_array, m_r):

    try:
        # extract
        first_category_value = cell_values_array[COL_NUM_FIRST_CATEGORY]

        resistance_value = m_r[1]
        package = get_component_package(cell_values_array)
        lcsc_part = get_component_lcsc_part(cell_values_array)
        component_name = ','.join([resistance_value, package, lcsc_part])
        component_name = massage_component_name(component_name)

        # r_smd_code = str(parseTextCode(r_text_value.replace('Ω','')))
        # r_smd_code = getThreeDigitCode(r_smd_code)
        # print(r_smd_code)
        # print(getThreeDigitCode(r_smd_code))

        # r_accuracy = m_r[2]

        # translate
        temp_lib = gen_r.getLibText(*[
            component_name, cell_values_array[COL_NUM_PACKAGE], None,
            cell_values_array[COL_NUM_LCSC_PART],
            cell_values_array[COL_NUM_MFR_PART],
            cell_values_array[COL_NUM_FIRST_CATEGORY],
            cell_values_array[COL_NUM_SECOND_CATEGORY],
            cell_values_array[COL_NUM_SOLDER_JOINT],
            cell_values_array[COL_NUM_MANUFACTURER],
            cell_values_array[COL_NUM_LIBRARY_TYPE]
        ])
        temp_dcm = gen_r.getDcmText(component_name, '',
                                    cell_values_array[COL_NUM_PACKAGE], '')

        return temp_lib, temp_dcm

    except Exception as e:
        print('debug')
        pprint(m_r)
        raise e
コード例 #4
0
def handle_with_power_rating(cell_values_array, m_r):

    try:
        # extract
        first_category_value = cell_values_array[COL_NUM_FIRST_CATEGORY]
        lcsc_part = cell_values_array[COL_NUM_LCSC_PART]

        component_name = massage_component_name(','.join([m_r[0], lcsc_part]))
        r_text_value = component_name

        # r_smd_code = str(parseTextCode(r_text_value.replace('Ω','')))
        # r_smd_code = getThreeDigitCode(r_smd_code)
        # print(r_smd_code)
        # print(getThreeDigitCode(r_smd_code))

        r_accuracy = m_r[2]

        # translate
        temp_lib = gen_r.getLibText(*[
            component_name, cell_values_array[COL_NUM_PACKAGE], r_accuracy,
            cell_values_array[COL_NUM_LCSC_PART],
            cell_values_array[COL_NUM_MFR_PART],
            cell_values_array[COL_NUM_FIRST_CATEGORY],
            cell_values_array[COL_NUM_SECOND_CATEGORY],
            cell_values_array[COL_NUM_SOLDER_JOINT],
            cell_values_array[COL_NUM_MANUFACTURER],
            cell_values_array[COL_NUM_LIBRARY_TYPE]
        ])
        temp_dcm = gen_r.getDcmText(component_name, r_text_value,
                                    cell_values_array[COL_NUM_PACKAGE], '')

        return temp_lib, temp_dcm

    except Exception as e:
        print('debug')
        pprint(m_r)
        raise e
コード例 #5
0
def handle_jlc_with_part_number(cell_values_array, m_r):

    try:
        # extract
        first_category_value = cell_values_array[COL_NUM_FIRST_CATEGORY]

        r_text_value = m_r[1]

        # r_smd_code = str(parseTextCode(r_text_value.replace('Ω','')))
        # r_smd_code = getThreeDigitCode(r_smd_code)
        # print(r_smd_code)
        # print(getThreeDigitCode(r_smd_code))

        # r_accuracy = m_r[2]

        # translate
        temp_lib = gen_r.getLibText(*[
            r_text_value, cell_values_array[COL_NUM_PACKAGE], None,
            cell_values_array[COL_NUM_LCSC_PART],
            cell_values_array[COL_NUM_MFR_PART],
            cell_values_array[COL_NUM_FIRST_CATEGORY],
            cell_values_array[COL_NUM_SECOND_CATEGORY],
            cell_values_array[COL_NUM_SOLDER_JOINT],
            cell_values_array[COL_NUM_MANUFACTURER],
            cell_values_array[COL_NUM_LIBRARY_TYPE]
        ])
        temp_dcm = gen_r.getDcmText(cell_values_array[COL_NUM_MFR_PART],
                                    r_text_value,
                                    cell_values_array[COL_NUM_PACKAGE], '')

        return temp_lib, temp_dcm

    except Exception as e:
        print('debug')
        pprint(m_r)
        raise e