コード例 #1
0
ファイル: test.py プロジェクト: lupengyu/ais
import Decoder

Decoder.AIS_Decoder(
    "!AIVDM,2,1,2,,56:RPb00000094tP001`PtpLMDtP4T`T4r3;3<0o2hK4672c08n2@H3AC`,0*70",
    None, None, None)
Decoder.AIS_Decoder("!AIVDM,2,2,2,,888888888888;,2*6C", None, None, None)

# !AIVDM,1,1,0,B,16:b4BiP007WveP@taA000IN1P00,0*64
# !AIVDM,1,1,,A,169FsD001o8ewMhF8Bb997A@05K8,0*26
# !AIVDM,1,1,0,A,H6:VA;A0DpN1PT4pN3S3>222222,2*25
# !AIVDM,1,1,,,;028j:Qv;:cn<OvPlFFl:PQ00000,0*43

# !AIVDM,2,1,2,,56:RPb00000094tP001`PtpLMDtP4T`T4r3;3<0o2hK4672c08n2@H3AC`,0*70
# !AIVDM,2,2,2,,888888888888;,2*6C
コード例 #2
0
ファイル: DataDecode.py プロジェクト: lupengyu/ais
import Decoder
import time

starttime = time.time()
fwirt = open("main.csv", "w+")
flog = open("decodelog.txt", "w+")
finfo = open("info.csv", "w+")
filecnt = 0
for i in range(10000):
    try:
        f = open("/root/aaa/f" + str(i) + ".txt")
    except FileNotFoundError:
        continue
    print(str(i) + ".txt")
    filecnt += 1
    line = f.readline()
    sum = 0
    while line:
        Decoder.AIS_Decoder(line, fwirt, finfo, flog)
        line = f.readline()
        sum += 1
        # if sum % 10000 == 0:
        #     print(sum)
    f.close()
fwirt.close()
flog.close()
endtime = time.time()
print("File cnt:", filecnt)
print("Spend time:", endtime-starttime)
print(sum, Decoder.getTypeDict())