Exemplo n.º 1
0
directory = sys.argv[1]
output_directory = sys.argv[2]
dry_run = False

print "Processing directory: %s" % directory

if not dry_run:
    if not os.path.exists(output_directory):
        os.mkdir(output_directory)

for filename in os.listdir(directory):
    run = 1
    sample_counter = 1
    last_row = None
    try:
        rows = logfile.getRows(directory + '/' + filename)
    except:
        next

    for row in rows:
        if row['throttle'] == 78 and row['load'] > 95:
            if last_row != None:
                if row['sample'] != (last_row['sample'] +
                                     1) or row['rpm'] < last_row['rpm']:
                    sample_counter = 1
                    run += 1

            if sample_counter == 1:
                print "Run: %s" % run

                if not dry_run:
Exemplo n.º 2
0
#!/usr/bin/python #vim: ts=4:sw=4:et
import sys, os
from tunehelper import logfile, afrs

if len(sys.argv) != 2:
    print "Usage: %s <logfile-directory>" % (os.path.basename(sys.argv[0]))
    sys.exit(0)

directory = sys.argv[1]
prev_row = ""

for filename in os.listdir(directory):
    for row in logfile.getRows(directory + '/' + filename):
        if afrs.isLean(prev_row, row):
            # logfile.printRow(filename, prev_row)
            logfile.printRow(filename, row)
        prev_row = row
Exemplo n.º 3
0
        filename = os.path.join(root, filename)

        print "Processing file: %s" % filename

        run = 1
        sample_counter = 1
        last_row = None
        acceleration = 0
        current_run = {
            "duration": [],
            "velocity_change": [],
            "velocity": [],
            "rpm": []
        }

        for row in logfile.getRows(filename):
            if isinstance(row, Exception):
                break

            if row['throttle'] == 78 and row['load'] > 95:
                if last_row != None:
                    if row['sample'] != (last_row['sample'] +
                                         1) or row['rpm'] < last_row['rpm']:
                        print_current_run_summary(current_run)
                        sample_counter = 1
                        run += 1

                if sample_counter == 1:
                    current_run = {
                        "duration": [],
                        "velocity_change": [],