update 2016-11-10 b4

1. implemented irda_encoder completely
This commit is contained in:
strawmanbobi
2016-11-10 19:44:47 +08:00
parent 9c35d50c8f
commit 3f983791d0
5 changed files with 6 additions and 5 deletions

1
.gitignore vendored
View File

@@ -5,5 +5,6 @@ src/ir_encoder/.idea
src/ir_decoder/out
src/ir_decoder/libs
src/ir_decoder/obj
src/ir_encoder/source
files/
files/*

View File

@@ -95,17 +95,17 @@ def print_remote(input_file, real_path, real_name, category):
key.append(data)
key[0].pack_length(binary)
for j in range(len(keymap_dicts[category])):
empty_key = CKeyMap(keymap_dicts[category][j], empty_value)
for j in range(len(keymap_dicts[int(category)])):
empty_key = CKeyMap(keymap_dicts[int(category)][j], empty_value)
find = 0
for n in range(len(key)):
if cmp(keymap_dicts[category][j], key[n].name) == 0:
if cmp(keymap_dicts[int(category)][j], key[n].name) == 0:
key[n].print_info()
key[n].pack_key(binary)
find = 1
break
if find == 0:
print "Don't file this key %s" % (keymap_dicts[category][j])
print "Don't file this key %s" % (keymap_dicts[int(category)][j])
empty_key.pack_key(binary)
fileName = sys.argv[1]

View File

@@ -21,7 +21,7 @@ for root, dirs, files in os.walk(sys.argv[1]):
if cmp(protocolType[0].split('/')[-1], fileType[0]) == 0:
outName = remotePath.split('#')
binary = open(sys.argv[3] + "/irda_" + outName[0].split('/')[-1] + "_" + outName[1], 'wb')
prot_file = open(root+i, "rb")
prot_file = open(root + i, "rb")
remote_file = open(remotePath, "rb")
binary.write(prot_file.read())
binary.write(remote_file.read())