#!/usr/bin/env python3 ######################################################################## ## ## analyze.py ## ## Copyright (C) 2024 Herbert Poetzl ## ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License version 2 as ## published by the Free Software Foundation. ## ######################################################################## import sys flsd = {} prev = None for line in sys.stdin: line = line.strip() cols = line.split() if len(cols) < 7: continue if cols[6] != "#": continue fid = int(cols[0][:-1], 16) fls = cols[1] corn = [int(_, 16) for _ in cols[2:6]] out = False if fls in flsd: flsi = flsd[fls][0] flsd[fls][1] += 1 else: flsi = len(flsd) flsd[fls] = [flsi, 1] out = True if ((corn[0] ^ corn[1]) & 0xFF00FF) or \ ((corn[2] ^ corn[3]) & 0xFF00FF) or \ ((corn[0] ^ corn[2]) & 0xFF00FF): out = True if prev and ((prev + 1) ^ corn[0]) & 0xFF: out = True if out: hcor = [f"{_:06X}" for _ in corn] pval = "--" if not prev else f"{prev:02X}" print(f"{fid:06X}:", fls, " ".join(hcor), pval, flsi) prev = corn[0] & 0xFF print(flsd)