Пример #1
0
    milTestIdx = 0

for adsbdata in sys.stdin:

    if adsbObj.isValidRec(adsbdata):

        adsbObj.loadData(adsbdata)

        if (firstRow):
            logPath = setupTodaysDir(adsbObj.theDate)
            dt = getDateTime(adsbObj.theDate, adsbObj.theTime)
            csCivfn = os.path.join(logPath, "civ-callsign-" + dt + ".txt")
            csMilfn = os.path.join(logPath, "mil-callsign-" + dt + ".txt")
            adsbfn = os.path.join(logPath, "adsbdata-" + dt + ".txt")
            fileMgr.createFile(adsbfn)
            #writeADSBHeader(fileMgr)
            firstRow = False

        # always log ADSB data and save the current ICAO ID and callsign
        writeADSBData(fileMgr, adsbdata.strip())
        adsbCount += 1
        dsp.updateAdsbCount(adsbCount)
        currentID = adsbObj.ICAOid
        currentCallsign = adsbObj.callsign.strip()

        # adsbObj is used for all data onward, so we can modify adsbdata if needed
        if (milTestMode):
            if (adsbCount % 500 == 0):
                currentCallsign = milTestList[milTestIdx][0]
                currentID = milTestList[milTestIdx][1]