コード例 #1
0
    def get_trans_ratios(final_dict):
        gear_ratios = []
        # --- determine which transmission list to use ---
        # --- automatic transmisions ---
        if final_dict['jeep_model'] == 'jk_2012' and final_dict[
                'transmissionType'] == 'auto':
            gear_ratios = WranglerRatiosLookup.jk_2012_auto_trans_ratios()
        if final_dict['jeep_model'] == 'jk_2007' and final_dict[
                'transmissionType'] == 'auto':
            gear_ratios = WranglerRatiosLookup.jk_2007_auto_trans_ratios()
        if final_dict['jeep_model'] == 'jl' and final_dict[
                'transmissionType'] == 'auto':
            gear_ratios = WranglerRatiosLookup.jl_automatic_trans_ratios()

        # --- manual transmissions ---
        if final_dict['jeep_model'] == 'jk_2012' and final_dict[
                'transmissionType'] == 'manual':
            gear_ratios = WranglerRatiosLookup.jk_2012_manual_trans_ratios()
        if final_dict['jeep_model'] == 'jk_2007' and final_dict[
                'transmissionType'] == 'manual':
            gear_ratios = WranglerRatiosLookup.jk_2007_manual_trans_ratios()
        if final_dict['jeep_model'] == 'jl' and final_dict[
                'transmissionType'] == 'manual':
            gear_ratios = WranglerRatiosLookup.jl_manual_trans_ratios()
        return gear_ratios
コード例 #2
0
def display_tire_size(some_number, some_value):
    # number = numbers_dict['mph'] * numbers_dict['rpm']
    # return number
    gear_ratios = []
    # --- determine which transmission list to use ---
    # --- automatic transmisions ---
    if numbers_dict['jeep_model'] == 'jk_2012' and numbers_dict[
            'transmissionType'] == 'auto':
        gear_ratios = WranglerRatiosLookup.jk_2012_auto_trans_ratios()
    if numbers_dict['jeep_model'] == 'jk_2007' and numbers_dict[
            'transmissionType'] == 'auto':
        gear_ratios = WranglerRatiosLookup.jk_2007_auto_trans_ratios()
    if numbers_dict['jeep_model'] == 'jl' and numbers_dict[
            'transmissionType'] == 'auto':
        gear_ratios = WranglerRatiosLookup.jl_automatic_trans_ratios()

    # --- manual transmissions ---
    if numbers_dict['jeep_model'] == 'jk_2012' and numbers_dict[
            'transmissionType'] == 'manual':
        gear_ratios = WranglerRatiosLookup.jk_2012_manual_trans_ratios()
    if numbers_dict['jeep_model'] == 'jk_2007' and numbers_dict[
            'transmissionType'] == 'manual':
        gear_ratios = WranglerRatiosLookup.jk_2007_manual_trans_ratios()
    if numbers_dict['jeep_model'] == 'jl' and numbers_dict[
            'transmissionType'] == 'manual':
        gear_ratios = WranglerRatiosLookup.jl_manual_trans_ratios()

    # --- Determine transfer case ratio ---
    if numbers_dict['fourLowEngaged'] is True and numbers_dict[
            'rubicon'] is True:
        transfercase_final_value = 4  # rubicon
    elif numbers_dict['fourLowEngaged'] is True and numbers_dict[
            'rubicon'] is False:
        transfercase_final_value = 2.76  # non-rubicon
    else:
        transfercase_final_value = 1  # not engaged, so 1:1

    return float("{0:.2f}".format(
        Calculate.JeepGearSplitter.calculateTireDiameter(
            mph=numbers_dict['mph'],
            rpm=numbers_dict['rpm'],
            tranny_gear=gear_ratios[-1],
            tcase=transfercase_final_value,
            diff=numbers_dict['differentialGearRatio'])))