示例#1
0
 public override Collection <SymbolData> EncodeData()
 {
     Symbol      = new Collection <SymbolData>();
     barcodeData = MessagePreProcessor.MessageParser(barcodeMessage);
     AusPost();
     return(Symbol);
 }
示例#2
0
        public override Collection <SymbolData> EncodeData()
        {
            Symbol = new Collection <SymbolData>();
            switch (symbolId)
            {
            case Symbology.PostNet:
                barcodeData = MessagePreProcessor.NumericOnlyParser(barcodeMessage);
                PostNet();
                break;

            case Symbology.Planet:
                barcodeData = MessagePreProcessor.NumericOnlyParser(barcodeMessage);
                Planet();
                break;

            case Symbology.KoreaPost:
                barcodeData = MessagePreProcessor.NumericOnlyParser(barcodeMessage);
                KoreaPost();
                break;

            case Symbology.FIM:
                barcodeData = MessagePreProcessor.MessageParser(barcodeMessage);
                FIM();
                break;

            case Symbology.RoyalMail:
                barcodeData = MessagePreProcessor.MessageParser(barcodeMessage);
                RoyalMail();
                break;

            case Symbology.KixCode:
                barcodeData = MessagePreProcessor.MessageParser(barcodeMessage);
                KixCode();
                break;

            case Symbology.DaftCode:
                barcodeData = MessagePreProcessor.MessageParser(barcodeMessage);
                DaftCode();
                break;

            case Symbology.Flattermarken:
                barcodeData = MessagePreProcessor.NumericOnlyParser(barcodeMessage);
                Flattermarken();
                break;

            case Symbology.JapanPost:
                barcodeData = MessagePreProcessor.MessageParser(barcodeMessage);
                JapanPost();
                break;
            }

            return(Symbol);
        }
示例#3
0
        public override Collection <SymbolData> EncodeData()
        {
            Symbol = new Collection <SymbolData>();
            switch (symbolId)
            {
            case Symbology.Code32:
                barcodeData        = MessagePreProcessor.NumericOnlyParser(barcodeMessage);
                optionalCheckDigit = false;      // Code 32 generates it's own check digit.
                Code32();
                break;

            case Symbology.PharmaZentralNummer:
                barcodeData        = MessagePreProcessor.NumericOnlyParser(barcodeMessage);
                optionalCheckDigit = false;     // PharmaZentral generates it's own check digit.
                PNZ();
                break;

            case Symbology.Code39:
                if (encodingMode == EncodingMode.HIBC)
                {
                    barcodeData        = MessagePreProcessor.HIBCParser(barcodeMessage);
                    optionalCheckDigit = true;      // HIBC requires a Code 39 check digit.
                    Code39();
                }

                else
                {
                    barcodeData = MessagePreProcessor.MessageParser(barcodeMessage);
                    Code39();
                }

                break;

            case Symbology.Code39Extended:
                barcodeData = MessagePreProcessor.TildeParser(barcodeMessage);
                Code39Extended();
                break;

            case Symbology.LOGMARS:
                barcodeData = MessagePreProcessor.MessageParser(barcodeMessage);
                Logmars();
                break;

            case Symbology.VINCode:
                barcodeData = MessagePreProcessor.MessageParser(barcodeMessage);
                VINCode();
                break;
            }

            return(Symbol);
        }
示例#4
0
        public override Collection <SymbolData> EncodeData()
        {
            Symbol = new Collection <SymbolData>();
            switch (symbolId)
            {
            case Symbology.Telepen:
                barcodeData = MessagePreProcessor.TildeParser(barcodeMessage);
                Telepen();
                barcodeText = new String(barcodeData);
                break;

            case Symbology.TelepenNumeric:
                barcodeData = MessagePreProcessor.MessageParser(barcodeMessage);
                TelepenNumeric();
                barcodeText = new String(barcodeData);
                break;
            }

            return(Symbol);
        }
        public override Collection <SymbolData> EncodeData()
        {
            Symbol = new Collection <SymbolData>();
            switch (symbolId)
            {
            case Symbology.Code128:
                switch (encodingMode)
                {
                case EncodingMode.Standard:
                    barcodeData = MessagePreProcessor.TildeParser(barcodeMessage);
                    Code128();
                    barcodeText = new String(barcodeData);
                    break;

                case EncodingMode.GS1:
                    isGS1       = true;
                    barcodeData = MessagePreProcessor.AIParser(barcodeMessage);
                    EAN128();
                    barcodeText = barcodeMessage;
                    barcodeText = barcodeText.Replace('[', '(');
                    barcodeText = barcodeText.Replace(']', ')');
                    break;

                case EncodingMode.HIBC:
                    barcodeData = MessagePreProcessor.HIBCParser(barcodeMessage);
                    Code128();
                    barcodeText = new String(barcodeData);
                    break;
                }

                break;

            case Symbology.EAN14:
                isCompositeSymbol = false;
                barcodeData       = MessagePreProcessor.MessageParser(barcodeMessage);
                EAN14();
                barcodeText = new string(barcodeData);
                break;

            case Symbology.SSCC18:
                isCompositeSymbol = false;
                barcodeData       = MessagePreProcessor.MessageParser(barcodeMessage);
                SSC18();
                barcodeText = new string(barcodeData);
                break;
            }

            // Expand the row pattern into the symbol data.
            SymbolBuilder.ExpandSymbolRow(Symbol, rowPattern, 0.0f);

            // Build the symbol separator and add the 2D component (GS1-128)
            if (isGS1 && isCompositeSymbol)
            {
                byte[] rowData = new byte[Symbol[0].GetRowData().Length];
                for (int i = 0; i < rowData.Length; i++)
                {
                    if (Symbol[0].GetRowData()[i] == 0)
                    {
                        rowData[i] = 1;
                    }
                }

                // Insert the separator to the symbol (top down ).
                SymbolData symbolData = new SymbolData(rowData, 1.0f);
                Symbol.Insert(0, symbolData);
                CompositeEncoder.AddComposite(symbolId, compositeMessage, Symbol, compositeMode, rowData.Length);
            }

            return(Symbol);
        }