Exemple #1
0
        public List <RFPatternPad> GetRFPatternS(String rawdatafilename, double t0)
        {
            List <RFPatternPad> pl         = new List <RFPatternPad>();
            List <String>       tagReports = IOTools.ReadListFromTxt(rawdatafilename);

            if (t0 == -1)
            {
                String[] ss = tagReports[0].Split(splitChar);
                t0 = GetSecondFromString(ss[indexTime]);
            }

            for (int i = 0; i < tagReports.Count; i++)
            {
                String[] ss = tagReports[i].Split(splitChar);



                RFPatternPad rfp = new RFPatternPad();
                rfp.t = (GetSecondFromString(ss[indexTime]) - t0);//chacha
                if (rfp.t < 0)
                {
                    continue;
                }
                rfp.phase = double.Parse(ss[indexPhase]);
                rfp.ant   = int.Parse(ss[indexAntenna]);
                rfp.ID    = -1;
                if (ss.Length > 4)
                {
                    rfp.ID = int.Parse(ss[indexEPC]);
                }
                pl.Add(rfp);
            }
            return(pl);
        }
Exemple #2
0
        public RFPatternPad[] GetRFPatternVector(List <RFPatternPad> rpl, double time)
        {
            RFPatternPad[] patterns = new RFPatternPad[64];
            double[]       dis      = new double[64];
            for (int i = 0; i < 64; i++)
            {
                dis[i]            = 10000;
                patterns[i]       = new RFPatternPad();
                patterns[i].phase = Conf.invalidphase;
            }
            foreach (RFPatternPad rp in rpl)
            {
                double d     = Math.Abs(rp.t - time);
                int    index = rp.ant;
                if (dis[index] > d)
                {
                    dis[index]      = d;
                    patterns[index] = rp;
                }
            }

            return(patterns);
        }