Пример #1
0
        public void ScanItem()
        {
            if (ItemInfo != null)
            {
                string recognizerType = (Scanner as ItemScanner).
                                        ItemToRecognizeDataMap.GetRecognizerTypeByItem(ItemInfo);

                Recognizer = MachineRecognizerFactory.CreateRecognizer(
                    WorkingDirectoryPath,
                    recognizerType);

                if (Recognizer != null)
                {
                    Recognizer.RecognizerFinished += SetShouldStopStatus;
                    string itemCategory = (Scanner as ItemScanner).
                                          ItemToRecognizeDataMap.GetCategoryByItem(ItemInfo);
                    Recognizer.LoadProcessedData(recognizerType, itemCategory);
                }
                else
                {
                    mLogger.WriteLine("Scan result: Item has no recognizer");
                }
            }
            else
            {
                mLogger.WriteLine("Scan result: No recognized item available");
            }
        }
Пример #2
0
        private void ScanItem()
        {
            mMicrowaveItemInfo = mScanner.Scan() as MicrowaveItemInfo;
            if (mMicrowaveItemInfo != null)
            {
                mRecognizer = MachineRecognizerFactory.CreateRecognizer(
                    (mScanner as ItemScanner).ItemToRecognizerTypeMap.
                    GetRecognizerTypeByItem(mMicrowaveItemInfo),
                    10,
                    10);

                if (mRecognizer != null)
                {
                    mRecognizer.RecognizerFinished += SetShouldStopStatus;
                    string itemCategory = (mScanner as ItemScanner).
                                          ItemToRecognizerTypeMap.GetRecognizerTypeByItem(mMicrowaveItemInfo);
                    mRecognizer.LoadProcessedData(itemCategory);
                }
            }
        }