예제 #1
0
        // This load for basic grab current fields on board

        public rfid.Constants.Result load
        (
            rfid.Linkage transport,
            UInt32 readerHandle
        )
        {
            Result result;

            result = transport.API_l8K6CGetQueryTagGroup(ref this.nativeTagGroup);

            if (Result.OK != result)
            {
                return(result);
            }

            SingulationAlgorithm algorithm = SingulationAlgorithm.UNKNOWN;

            result = transport.API_l8K6CGetCurrentSingulationAlgorithm(ref algorithm);

            if (Result.OK != result)
            {
                return(result);
            }

            switch (algorithm)
            {
            case SingulationAlgorithm.FIXEDQ:
            {
                this.nativeSingulationParms = new FixedQParms();
            }
            break;

            case SingulationAlgorithm.DYNAMICQ:
            {
                this.nativeSingulationParms = new DynamicQParms();
            }
            break;
            //case SingulationAlgorithm.DYNAMICQ_ADJUST:
            //    {

            //    }
            //    break;
            //case SingulationAlgorithm.DYNAMICQ_THRESHOLD:
            //    {

            //    }
            //    break;

            default:
            {
                return(Result.DRIVER_MISMATCH);
            }
            }

            result = transport.API_l8K6CGetSingulationAlgorithmParameters
                     (
                algorithm,
                ref this.nativeSingulationParms
                     );

            if (Result.OK == result)
            {
                Type algoType = this.nativeSingulationParms.GetType();

                if (algoType == typeof(rfid.Structures.FixedQParms))
                {
                    this.sourceParameters = new Source_SingulationParametersFixedQ
                                            (
                        (rfid.Structures.FixedQParms) this.nativeSingulationParms
                                            );
                }
                else if (algoType == typeof(rfid.Structures.DynamicQParms))
                {
                    this.sourceParameters = new Source_SingulationParametersDynamicQ
                                            (
                        (rfid.Structures.DynamicQParms) this.nativeSingulationParms
                                            );
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("ERR : Algorithm.Copy( Source_QueryParms from )");
                    Console.WriteLine("ERR : Algorithm.Copy( Source_QueryParms from )");
                }
            }

            return(result);
        }