Exemple #1
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;
                });
            }
        }
Exemple #2
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;
                });
            }
        }
Exemple #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...";
        }
Exemple #4
0
            override public View GetView(int position, View convertView, ViewGroup parent)
            {
                UgiInventory inventory = Ugi.Singleton().ActiveInventory;

                if (inventory == null)
                {
                    return(convertView);
                }
                UgiRfidConfiguration config = inventory.Configuration;

                if (convertView == null)
                {
                    convertView        = mainActivity.LayoutInflater.Inflate(config.ReportSubsequentFinds ? Resource.Layout.list_item : Resource.Layout.list_item_no_history, null);
                    convertView.Click += (object sender, EventArgs e) => {
                        //
                    };
                }
                ListView lv = mainActivity.FindViewById <ListView>(Resource.Id.tagList);

                if (lv.CheckedItemPositions.Get(position))
                {
                    convertView.SetBackgroundColor(Color.ParseColor("#888888"));
                }
                else
                {
                    convertView.SetBackgroundColor(Color.ParseColor("#222222"));
                }

                TextView tv = convertView.FindViewById <TextView>(Resource.Id.listItemText);

                tv.Text = "Item " + position;

                List <UgiTag> tags = Ugi.Singleton().ActiveInventory.Tags;

                if (position < tags.Count)
                {
                    UgiTag tag = tags[position];
                    tv.Text = tag.Epc.ToString();
                    if (config.ReportSubsequentFinds)
                    {
                        tv      = convertView.FindViewById <TextView>(Resource.Id.listItemDetail);
                        tv.Text = tag.ReadState.ReadHistoryString;
                    }
                }
                return(convertView);
            }
Exemple #5
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);
            });
        }
Exemple #6
0
        public UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            UgiInventory inventory = Ugi.Singleton().ActiveInventory;

            if (inventory == null)
            {
                UITableViewCell cell = tableView.DequeueReusableCell("InventoryCell");
                if (cell == null)
                {
                    cell = new UITableViewCell(UITableViewCellStyle.Default, "InventoryCell");
                }
                return(cell);
            }
            else
            {
                UgiRfidConfiguration config    = inventory.Configuration;
                string          cellIdentifier = config.ReportSubsequentFinds ? "LocateCell" : "InventoryCell";
                UITableViewCell cell           = tableView.DequeueReusableCell(cellIdentifier);
                if (cell == null)
                {
                    cell = new UITableViewCell(UITableViewCellStyle.Default, cellIdentifier);
                }
                List <UgiTag> tags = Ugi.Singleton().ActiveInventory.Tags;
                if (indexPath.Row < tags.Count)
                {
                    UgiTag tag = tags [indexPath.Row];
                    cell.TextLabel.Text = tag.Epc.ToString();
                    if (config.ReportSubsequentFinds)
                    {
                        cell.DetailTextLabel.Text = tag.ReadState.ReadHistoryString;
                    }
                }
                else
                {
                    cell.TextLabel.Text = "Item #" + indexPath.Row;
                }
                return(cell);
            }
        }