예제 #1
0
# Ziel-Matrix anlegen
#

db3 = CanMatrix()

#
# Hier kann die neue Can-Matrix 'Programmiert' werden:
# -----------------------------------------------------
#

#Kopiere ID 1234 aus der 2. K-Matrix in die Zielmatrix
copyFrame(1234, db2, db3)

#Kopiere Frame "Engine_123" aus der 1. K-Matrix in die Zielmatrix
copyFrame("Engine_123", db1, db3)

#Kopiere ECU "Gateway" aus der 1. K-Matrix (mit allen zugehoerigen Frames) in die Zielmatrix
copyBUwithFrames("Gateway", db1, db3)

#
# -----------------------------------------------------
#


#
#
# Exportieren der neuen matrix z.B. als dbc:
#

ex.exportDbc(db3, "ziel.dbc")
예제 #2
0
#
# Ziel-Matrix anlegen
#

db3 = CanMatrix()

#
# Hier kann die neue Can-Matrix 'Programmiert' werden:
# -----------------------------------------------------
#

#Kopiere ID 1234 aus der 2. K-Matrix in die Zielmatrix
copyFrame(1234, db2, db3)

#Kopiere Frame "Engine_123" aus der 1. K-Matrix in die Zielmatrix
copyFrame("Engine_123", db1, db3)

#Kopiere ECU "Gateway" aus der 1. K-Matrix (mit allen zugehoerigen Frames) in die Zielmatrix
copyBUwithFrames("Gateway", db1, db3)

#
# -----------------------------------------------------
#

#
#
# Exportieren der neuen matrix z.B. als dbc:
#

ex.exportDbc(db3, "ziel.dbc")
예제 #3
0
파일: convert.py 프로젝트: krase/canmatrix
    db = im.importDbc(infile)
elif infile[-3:] == "dbf":
    db = im.importDbf(infile)
elif infile[-3:] == "kcd":
    db = im.importKcd(infile)
elif infile[-3:] == "xls" or infile[-4:] == "xlsx":
    db = im.importXls(infile)
elif infile[-5:] == "arxml":
    db = im.importArxml(infile)
else:
    sys.stderr.write("\nFile not recognized: " + infile + "\n")
print "done\n"

print "%d Frames found" % (db._fl._list.__len__())

print "Exporting " + outfile + " ... "

if outfile[-3:] == "dbc":
    db = ex.exportDbc(db, outfile)
elif outfile[-3:] == "dbf":
    db = ex.exportDbf(db, outfile)
elif outfile[-3:] == "kcd":
    db = ex.exportKcd(db, outfile)
elif outfile[-3:] == "xls":
    db = ex.exportXls(db, outfile)
elif outfile[-4:] == "json":
    db = ex.exportJson(db, outfile)
else:
    sys.stderr.write("File not recognized: " + infile + "\n")
print "done"
예제 #4
0
	db = im.importDbf(infile)
elif infile[-3:] == 'kcd':
	db = im.importKcd(infile)
elif infile[-3:] == 'xls' or infile[-4:] == 'xlsx' :
	db = im.importXls(infile)
elif infile[-5:] == 'arxml':
	db = im.importArxml(infile)
elif infile[-3:] == 'sym':
	db = im.importSym(infile)
else:
    sys.stderr.write('\nFile not recognized: ' + infile + "\n")
print("done\n")

print("%d Frames found" % (db._fl._list.__len__()))

print("Exporting " + outfile + " ... ")

if outfile[-3:] == 'dbc':
	db = ex.exportDbc(db, outfile)
elif outfile[-3:] == 'dbf':
	db = ex.exportDbf(db, outfile)
elif outfile[-3:] == 'kcd':
	db = ex.exportKcd(db, outfile)
elif outfile[-3:] == 'xls':
	db = ex.exportXls(db, outfile)
elif outfile[-4:] == 'json':
	db = ex.exportJson(db, outfile)
else:
    sys.stderr.write('File not recognized: ' + infile + "\n")
print("done")