// **************************************************************************** // Implement our own event handler so we can access TAG data in our class private void mcRFID_EventReadNotify(object sender, EventReadNotifyEventArgs e) { TagData[] myTags = Reader.Actions.GetReadTags(100); ListView lstViewData = FindViewById <ListView>(Resource.Id.listviewdata); RunOnUiThread(() => { bool viewUpdated = false; if (myTags != null) { for (int index = 0; index < myTags.Length; index++) { if (myTags[index].TagID.Substring(0, 4) == "F0C5") { if (!EPCExists(myTags[index].TagID)) { if (PassFilter(myTags[index].TagID)) { if (scanType != "VERIFY") { if (AddEPC(myTags[index].TagID)) //Full Tag EPC Data { FoxProduct prod = new FoxProduct(); prod.EPC = myTags[index].TagID; prod.FoxSKU = mcTools.GetFoxSKUFromEPC(prod.EPC); prod.VendorCode = prod.FoxSKU.Substring(0, 3); prod.Category = prod.FoxSKU.Substring(3, 2); prod.epcLast6 = Convert.ToInt16(myTags[index].TagID.Substring(26, 6)); prod.Qty = scanQTY; // 1 = IN, -1 = OUT, 0 = CURRENT ON HAND prod.DateTimeScanned = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString(); prod.EmployeeID = empNo; prod.OtherStoreCode = destStoreCode; prod.ActionWOtherLoc = toFrom; prod.NewConsol = newConsol; viewUpdated = true; invUpdated = true; listFoxProducts.Add(prod); } } } } } } // Update listview w/ data stored in listFoxProducts if (viewUpdated) { RefreshView(); } } }); }
// **************************************************************************** // Implement our own event handler so we can access TAG data in our class private void mcRFID_EventReadNotify(object sender, EventReadNotifyEventArgs e) { TagData[] myTags = Reader.Actions.GetReadTags(100); ListView lstViewData = FindViewById <ListView>(Resource.Id.listviewdata); //RunOnUiThread(() => //{ // if (myTags != null) // { // for (int index = 0; index < myTags.Length; index++) // { // if (myTags[index].TagID.Substring(0, 4) == "F0C5") // { // if (!EPCExists(myTags[index].TagID)) // { // if (PassFilter(myTags[index].TagID)) // { // AddEPC(myTags[index].TagID); //Full Tag EPC Data // FoxProduct prod = new FoxProduct(); // prod.EPC = myTags[index].TagID; // prod.FoxSKU = mcTools.GetFoxSKUFromEPC(prod.EPC); // prod.VendorCode = prod.FoxSKU.Substring(0, 3); // prod.Category = prod.FoxSKU.Substring(3, 2); // prod.epcLast6 = Convert.ToInt16(myTags[index].TagID.Substring(26, 6)); // prod.Qty = scanQTY; // 1 = IN, -1 = OUT, 0 = CURRENT ON HAND // prod.DateTimeScanned = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString(); // prod.EmployeeID = empNo; // prod.ToFromLocation = destStoreCode; // listFoxProducts.Add(prod); // } // } // } // } // // Update listview w/ data stored in listFoxProducts // RefreshView(); // } //}); }
// **************************************************************************** // Implement our own event handler so we can access TAG data in our class private void mcRFID_EventReadNotify(object sender, EventReadNotifyEventArgs e) { TextView txtFindSKUDistance = FindViewById <TextView>(Resource.Id.txtFindSKUDistance); TagData[] myTags = Reader.Actions.GetReadTags(100); RunOnUiThread(() => { if (myTags != null) { // Update listview w/ data stored in listFoxProducts for (int index = 0; index < myTags.Length; index++) { if (myTags[index].IsContainsLocationInfo) { int tag = index; int distance = (int)90 - (int)myTags[tag].LocationInfo.RelativeDistance; if (distance < 0) { distance = 0; } if (distance < 90) { txtFindSKUDistance.SetTextColor(Android.Graphics.Color.Black); txtFindSKUDistance.Text = distance.ToString(); } else { txtFindSKUDistance.SetTextColor(Android.Graphics.Color.DarkRed); txtFindSKUDistance.Text = "Out of range"; } UpdateRadarGraphic((int)myTags[tag].LocationInfo.RelativeDistance); } } } }); }