Exemplo n.º 1
0
        internal static Result constructResult(List <ExpandedPair> pairs)
        {
            BitArray binary = BitArrayBuilder.buildBitArray(pairs);

            AbstractExpandedDecoder decoder = AbstractExpandedDecoder.createDecoder(binary);
            String resultingString          = decoder.parseInformation();

            if (resultingString == null)
            {
                return(null);
            }

            ResultPoint[] firstPoints = pairs[0].FinderPattern.ResultPoints;
            ResultPoint[] lastPoints  = pairs[pairs.Count - 1].FinderPattern.ResultPoints;

            var result = new Result(
                resultingString,
                null,
                new ResultPoint[] { firstPoints[0], firstPoints[1], lastPoints[0], lastPoints[1] },
                BarcodeFormat.RSS_EXPANDED
                );

            result.putMetadata(ResultMetadataType.SYMBOLOGY_IDENTIFIER, "]e0");
            return(result);
        }
Exemplo n.º 2
0
        protected static void assertCorrectBinaryString(String binaryString, String expectedNumber)
        {
            BitArray binary = BinaryUtil.buildBitArrayFromStringWithoutSpaces(binaryString);
            AbstractExpandedDecoder decoder = AbstractExpandedDecoder.createDecoder(binary);
            String result = decoder.parseInformation();

            Assert.AreEqual(expectedNumber, result);
        }
        public void testNoAi()
        {
            BitArray information = BinaryUtil.buildBitArrayFromString(" .......X ..XX..X. X.X....X .......X ....");

            AbstractExpandedDecoder decoder = AbstractExpandedDecoder.createDecoder(information);
            String decoded = decoder.parseInformation();

            Assert.AreEqual("(10)12A", decoded);
        }
Exemplo n.º 4
0
        private static Result constructResult(ArrayList pairs)
        {
            BitArray binary = BitArrayBuilder.buildBitArray(pairs);

            AbstractExpandedDecoder decoder = AbstractExpandedDecoder.createDecoder(binary);
            String resultingString          = decoder.parseInformation();

            ResultPoint[] firstPoints = ((ExpandedPair)pairs[0]).FinderPattern.ResultPoints;
            ResultPoint[] lastPoints  = ((ExpandedPair)pairs[pairs.Count - 1]).FinderPattern.ResultPoints;

            return(new Result(
                       resultingString,
                       null,
                       new ResultPoint[] { firstPoints[0], firstPoints[1], lastPoints[0], lastPoints[1] },
                       BarcodeFormat.RSS_EXPANDED
                       ));
        }