コード例 #1
0
        //--------------------------------------------------------------------------
        // Inventory
        //--------------------------------------------------------------------------

        void doStartStopInventory(object sender, EventArgs e)
        {
            ToggleButton tb = FindViewById <ToggleButton> (Resource.Id.inventoryToggleButton);

            if (tb.Checked)
            {
                UgiRfidConfiguration config = UgiRfidConfiguration.ConfigWithInventoryType(inventoryType);
                Ugi.Singleton().StartInventory(this, config);
                this.selectedTag = null;
                FindViewById <Button> (Resource.Id.batteryButton).Enabled          = false;
                FindViewById <Button> (Resource.Id.configureButton).Enabled        = false;
                FindViewById <Button> (Resource.Id.audioReconfigureButton).Enabled = false;
                FindViewById <View>(Resource.Id.line4).Visibility            = ViewStates.Visible;
                FindViewById <Button> (Resource.Id.commissionButton).Enabled = false;
                FindViewById <Button> (Resource.Id.readTagButton).Enabled    = false;
                FindViewById <Button> (Resource.Id.writeTagButton).Enabled   = false;
                UpdateTable();
            }
            else
            {
                Ugi.Singleton().ActiveInventory.StopInventory(() => {
                    FindViewById <View>(Resource.Id.line4).Visibility               = ViewStates.Invisible;
                    FindViewById <Button> (Resource.Id.batteryButton).Enabled       = true;
                    FindViewById <View>(Resource.Id.configureButton).Enabled        = true;
                    FindViewById <View>(Resource.Id.audioReconfigureButton).Enabled = true;
                });
            }
        }
コード例 #2
0
        //--------------------------------------------------------------------------
        // Inventory
        //--------------------------------------------------------------------------

        partial void inventorySwitch_ValueChanged(UISwitch sender)
        {
            if (inventorySwitch.On)
            {
                selectedTag = null;
                UgiRfidConfiguration config = UgiRfidConfiguration.ConfigWithInventoryType(inventoryType);
                Ugi.Singleton().StartInventory(this, config);
                batteryButton.Enabled    = false;
                configureButton.Enabled  = false;
                commissionButton.Hidden  = false;
                readButton.Hidden        = false;
                writeButton.Hidden       = false;
                commissionButton.Enabled = false;
                readButton.Enabled       = false;
                writeButton.Enabled      = false;
                tableView.ReloadData();
            }
            else
            {
                Ugi.Singleton().ActiveInventory.StopInventory(() => {
                    batteryButton.Enabled   = true;
                    configureButton.Enabled = true;
                    commissionButton.Hidden = true;
                    readButton.Hidden       = true;
                    writeButton.Hidden      = true;
                });
            }
        }
コード例 #3
0
        partial void ReadTagsStartButton_TouchUpInside(UIButton sender)
        {
            ConnectionStateLabel.Text = "Starting Read...";

            UgiRfidConfiguration config = UgiRfidConfiguration.ConfigWithInventoryType(UgiRfidConfiguration.InventoryTypes.LocateVeryShortRange);

            config.SoundType       = UgiRfidConfiguration.SoundTypes.None;
            config.PowerLevelWrite = 48f;
            _runningInventory      = CurrentUgi.StartInventory(this, config);

            ConnectionStateLabel.Text = "Readings tags...";
        }
コード例 #4
0
        public void doLocateTag(View v)
        {
            //
            // This is a demonstration of how to optimize locating a single tag
            // in a tagdense environment by passing the EPC as the select mask.
            //
            UgiEpc epc = this.selectedTag.Epc;

            Ugi.Singleton().ActiveInventory.StopInventory(() => {
                UgiRfidConfiguration config = UgiRfidConfiguration.ConfigWithInventoryType(inventoryType);
                config.SelectMask           = epc.Bytes;
                config.SelectMaskBitLength  = epc.Bytes.Length * 8;
                config.SelectOffset         = 32;
                config.SelectBank           = UgiRfidConfiguration.MemoryBank.Epc;
                Ugi.Singleton().StartInventory(this, config, epc);
            });
        }