Пример #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;
        }
Пример #2
0
        public void main(Boolean isPred)
        {
            TextParser parser = new TextParser(24, 24);


            if (isPred)
            {
                String epc     = "";
                String tid     = "";
                String time    = "";
                String theDate = "";
                String line    = "";

                using (StreamReader reader = new StreamReader(this.fileToRead))
                {
                    while ((line = reader.ReadLine()) != null)
                    {
                        parser.ParsePredator(ref line, ref epc, ref tid, ref time, ref theDate);
                        dualList.addTag(epc, tid, theDate, time);
                    }
                }
            }

            else
            {
                String line;
                String epc     = "";
                String tid     = "";
                String time    = "";
                String theDate = "";

                using (StreamReader reader = new StreamReader(this.fileToRead))
                {
                    while ((line = reader.ReadLine()) != null)
                    {
                        parser.parsePickUp(ref line, ref epc, ref tid, ref time, ref theDate);
                        dualList.addTag(epc, tid, theDate, time);
                    }
                }
            }
            dualList.checkMissing();

            try
            {
                FileBuilder.buildBadFile("W://Public/RFID/" + orderNumber + "/" + orderNumber + "BAD_TAGS", dualList);
                FileBuilder.buildBadFile("W://Public/RFID/" + orderNumber + "/" + orderNumber + "GOOD_TAGS", dualList);

                if (dualList.getNumBadTags() == 0)
                {
                    FileBuilder.buildAssociationFile("W://Public/RFID/" + orderNumber + "/" + orderNumber + "ASSOCIATION_FILE", dualList);
                }
            }
            catch (Exception e)
            {
                FileBuilder.buildBadFile("C://Users/Public/BAD_TAGS", dualList);
                FileBuilder.buildGoodFile("C://Users/Public/Good_TAGS", dualList);

                if (dualList.getBadEpcList().Length == 0)
                {
                    FileBuilder.buildAssociationFile("C://Users/Public/ASSOCIATION_FILE", dualList);
                }
            }

            MessageBox.Show("Number of badtags " + dualList.getNumBadTags().ToString());
        }