Exemplo n.º 1
0
        /// <summary>S
        /// creates a new instance of a DualList object
        /// </summary>
        public DualList(String filePath, int numEpc, int newEpcLength, int newTidLength)
        {
            epcCount       = numEpc;
            epcCountHolder = new Dictionary <string, int>();
            masterIndices  = new Dictionary <string, int>();
            indicesMaster  = new Dictionary <int, string>();
            FileBuilder.createSortingDictionaries(filePath, epcCountHolder,
                                                  masterIndices, indicesMaster);

            goodTags = new Dictionary <String, String>();
            badTags  = new Dictionary <String, String>();
            timeList = new TimeList();

            epcList    = new string[masterIndices.Count];
            tidList    = new string[masterIndices.Count];
            badEpcList = new string[masterIndices.Count];
            badTidList = new string[masterIndices.Count];
            epcLength  = newEpcLength;
            tidLength  = newTidLength;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a file containing all the good tags
        /// </summary>
        /// <param name="destination">File pathway</param>
        /// <param name="dualList">DualList object containing the lists of tags</param>
        public static void buildGoodFile(string destination, DualList dualList)
        {
            StreamWriter writer = new StreamWriter(destination);

            string[] tids = dualList.getTidArray();
            string[] epcs = dualList.getEpcArray();
            TimeList time = dualList.getTimeList();


            for (int i = 0; i < tids.Length; i++)
            {
                if (epcs[i] == null || epcs[i] == "")
                {
                }
                else
                {
                    writer.WriteLine(epcs[i] + "," + tids[i] + "," + time.getDateAt(i) + "," + time.getTimeAt(i));
                }
            }
            writer.Close();
        }