public async void btnSaveClicked(object sender, EventArgs e)
        {
            Xamarin.Forms.DependencyService.Get <ISystemSound>().SystemSound(1);

            BleMvxApplication._config.RFID_Shortcut[0].Function    = (CONFIG.MAINMENUSHORTCUT.FUNCTION)Enum.Parse(typeof(CONFIG.MAINMENUSHORTCUT.FUNCTION), F1.Text);
            BleMvxApplication._config.RFID_Shortcut[0].DurationMin = uint.Parse(F1MinTime.Text);
            BleMvxApplication._config.RFID_Shortcut[0].DurationMax = uint.Parse(F1MaxTime.Text);
            BleMvxApplication._config.RFID_Shortcut[1].Function    = (CONFIG.MAINMENUSHORTCUT.FUNCTION)Enum.Parse(typeof(CONFIG.MAINMENUSHORTCUT.FUNCTION), F2.Text);
            BleMvxApplication._config.RFID_Shortcut[1].DurationMin = uint.Parse(F2MinTime.Text);
            BleMvxApplication._config.RFID_Shortcut[1].DurationMax = uint.Parse(F2MaxTime.Text);

            BleMvxApplication._config.RFID_InventoryAlertSound = switchInventoryAlertSound.IsToggled;

            /*
             *          BleMvxApplication._config.RFID_Shortcut[2].Function = (CONFIG.MAINMENUSHORTCUT.FUNCTION)Enum.Parse(typeof(CONFIG.MAINMENUSHORTCUT.FUNCTION), F3.Text);
             *          BleMvxApplication._config.RFID_Shortcut[2].DurationMin = uint.Parse(F3MinTime.Text);
             *          BleMvxApplication._config.RFID_Shortcut[2].DurationMax = uint.Parse(F3MaxTime.Text);
             *          BleMvxApplication._config.RFID_Shortcut[3].Function = (CONFIG.MAINMENUSHORTCUT.FUNCTION)Enum.Parse(typeof(CONFIG.MAINMENUSHORTCUT.FUNCTION), F4.Text);
             *          BleMvxApplication._config.RFID_Shortcut[3].DurationMin = uint.Parse(F4MinTime.Text);
             *          BleMvxApplication._config.RFID_Shortcut[3].DurationMax = uint.Parse(F4MaxTime.Text);
             *          BleMvxApplication._config.RFID_Shortcut[4].Function = (CONFIG.MAINMENUSHORTCUT.FUNCTION)Enum.Parse(typeof(CONFIG.MAINMENUSHORTCUT.FUNCTION), F5.Text);
             *          BleMvxApplication._config.RFID_Shortcut[4].DurationMin = uint.Parse(F5MinTime.Text);
             *          BleMvxApplication._config.RFID_Shortcut[4].DurationMax = uint.Parse(F5MaxTime.Text);
             *          BleMvxApplication._config.RFID_Shortcut[5].Function = (CONFIG.MAINMENUSHORTCUT.FUNCTION)Enum.Parse(typeof(CONFIG.MAINMENUSHORTCUT.FUNCTION), F6.Text);
             *          BleMvxApplication._config.RFID_Shortcut[5].DurationMin = uint.Parse(F6MinTime.Text);
             *          BleMvxApplication._config.RFID_Shortcut[5].DurationMax = uint.Parse(F6MaxTime.Text);
             */

            BleMvxApplication.SaveConfig();
        }
Exemple #2
0
        public async void btnOKClicked(object sender, EventArgs e)
        {
            Xamarin.Forms.DependencyService.Get <ISystemSound>().SystemSound(1);

            BleMvxApplication._config.RFID_AntennaEnable[0] = switchAntenna1Enable.IsToggled;
            BleMvxApplication._config.RFID_AntennaEnable[1] = switchAntenna2Enable.IsToggled;
            BleMvxApplication._config.RFID_AntennaEnable[2] = switchAntenna3Enable.IsToggled;
            BleMvxApplication._config.RFID_AntennaEnable[3] = switchAntenna4Enable.IsToggled;

            BleMvxApplication._config.RFID_Antenna_Power[0] = uint.Parse(entryPower1.Text);
            BleMvxApplication._config.RFID_Antenna_Power[1] = uint.Parse(entryPower2.Text);
            BleMvxApplication._config.RFID_Antenna_Power[2] = uint.Parse(entryPower3.Text);
            BleMvxApplication._config.RFID_Antenna_Power[3] = uint.Parse(entryPower4.Text);

            BleMvxApplication._config.RFID_Antenna_Dwell[0] = uint.Parse(entryDwell1.Text);
            BleMvxApplication._config.RFID_Antenna_Dwell[1] = uint.Parse(entryDwell2.Text);
            BleMvxApplication._config.RFID_Antenna_Dwell[2] = uint.Parse(entryDwell3.Text);
            BleMvxApplication._config.RFID_Antenna_Dwell[3] = uint.Parse(entryDwell4.Text);

            BleMvxApplication.SaveConfig();

            for (uint cnt = 0; cnt < 4; cnt++)
            {
                BleMvxApplication._reader.rfid.SetAntennaPortState(cnt, BleMvxApplication._config.RFID_AntennaEnable[cnt] ? CSLibrary.Constants.AntennaPortState.ENABLED : CSLibrary.Constants.AntennaPortState.DISABLED);
                BleMvxApplication._reader.rfid.SetPowerLevel(BleMvxApplication._config.RFID_Antenna_Power[cnt], cnt);
                BleMvxApplication._reader.rfid.SetInventoryDuration(BleMvxApplication._config.RFID_Antenna_Dwell[cnt], cnt);
            }
        }
        public async void btnOKClicked(object sender, EventArgs e)
        {
            Xamarin.Forms.DependencyService.Get <ISystemSound>().SystemSound(1);

            BleMvxApplication._PREFILTER_MASK_EPC    = entryMaskData.Text;
            BleMvxApplication._PREFILTER_MASK_Offset = uint.Parse(entryMaskOffset.Text);
            BleMvxApplication._PREFILTER_Bank        = int.Parse(buttonBank.Text.Substring(buttonBank.Text.Length - 2, 1));
            BleMvxApplication._PREFILTER_Enable      = switchEnableFilter.IsToggled;

            BleMvxApplication.SaveConfig();
        }
Exemple #4
0
        public async void btnOKClicked(object sender, EventArgs e)
        {
            int cnt;

            Xamarin.Forms.DependencyService.Get <ISystemSound>().SystemSound(1);

            switch (buttonBatteryLevelFormat.Text)
            {
            case "Voltage":
                BleMvxApplication._config.BatteryLevelIndicatorFormat = 0;
                break;

            default:
                BleMvxApplication._config.BatteryLevelIndicatorFormat = 1;
                break;
            }

            BleMvxApplication._config.RFID_InventoryAlertSound = switchInventoryAlertSound.IsToggled;

            BleMvxApplication._config.RFID_Shortcut[0].Function    = (CONFIG.MAINMENUSHORTCUT.FUNCTION)Enum.Parse(typeof(CONFIG.MAINMENUSHORTCUT.FUNCTION), F1.Text);
            BleMvxApplication._config.RFID_Shortcut[0].DurationMin = uint.Parse(F1MinTime.Text);
            BleMvxApplication._config.RFID_Shortcut[0].DurationMax = uint.Parse(F1MaxTime.Text);
            BleMvxApplication._config.RFID_Shortcut[1].Function    = (CONFIG.MAINMENUSHORTCUT.FUNCTION)Enum.Parse(typeof(CONFIG.MAINMENUSHORTCUT.FUNCTION), F2.Text);
            BleMvxApplication._config.RFID_Shortcut[1].DurationMin = uint.Parse(F2MinTime.Text);
            BleMvxApplication._config.RFID_Shortcut[1].DurationMax = uint.Parse(F2MaxTime.Text);

            BleMvxApplication._config.RFID_DBm = switchRSSIDBm.IsToggled;
            //BleMvxApplication._config.RFID_SavetoFile = switchSavetoFile.IsToggled;
            BleMvxApplication._config.RFID_SavetoCloud   = switchSavetoCloud.IsToggled;
            BleMvxApplication._config.RFID_CloudProtocol = switchhttpProtocol.IsToggled ? 1 : 0;
            BleMvxApplication._config.RFID_IPAddress     = entryServerIP.Text;

            BleMvxApplication._config.RFID_NewTagLocation = switchNewTagLocation.IsToggled;
            BleMvxApplication._config.RFID_ShareFormat    = switchShareDataFormat.IsToggled ? 1 : 0;

            //BleMvxApplication._config.RFID_TagDelayTime = int.Parse(entryTagDelay.Text);
            //BleMvxApplication._config.RFID_InventoryDuration = UInt32.Parse(entryInventoryDuration.Text);

            BleMvxApplication._config.RFID_Vibration       = switchVibration.IsToggled;
            BleMvxApplication._config.RFID_VibrationTag    = switchVibrationTag.IsToggled;
            BleMvxApplication._config.RFID_VibrationWindow = UInt32.Parse(entryVibrationWindow.Text);
            BleMvxApplication._config.RFID_VibrationTime   = UInt32.Parse(entryVibrationTime.Text);

            //BleMvxApplication._config.RFID_BatteryPollingTime = uint.Parse(entryBatteryIntervalTime.Text);

            BleMvxApplication.SaveConfig();

            if (entryReaderNameModified)
            {
                BleMvxApplication._reader.bluetoothIC.SetDeviceName(entryReaderName.Text);
                entryReaderNameModified = false;
                await DisplayAlert("New Reader Name effective after reset CS108", "", null, "OK");
            }
        }
        public async void btnOKClicked(object sender, EventArgs e)
        {
            Xamarin.Forms.DependencyService.Get <ISystemSound>().SystemSound(1);

            BleMvxApplication._PREFILTER_MASK_EPC    = entryMaskData.Text;
            BleMvxApplication._PREFILTER_MASK_Offset = uint.Parse(entryMaskOffset.Text);
            BleMvxApplication._PREFILTER_Enable      = switchEnableFilter.IsToggled;

            BleMvxApplication.SaveConfig();
            //await this.Navigation.PopAsync();
        }
        private async void Connect(IDevice _device)
        {
            Trace.Message("device name :" + _device.Name);

            await BleMvxApplication._reader.ConnectAsync(Adapter, _device);

            Trace.Message("load config");

            //bool LoadSuccess = await BleMvxApplication.LoadConfig(_device.Name);
            //BleMvxApplication._config.readerID = _device.Name;
            bool LoadSuccess = await BleMvxApplication.LoadConfig(_device.Id.ToString());

            BleMvxApplication._config.readerID = _device.Id.ToString();
        }
        public async void btnOKClicked(object sender, EventArgs e)
        {
            Xamarin.Forms.DependencyService.Get <ISystemSound>().SystemSound(1);

            BleMvxApplication._config.RFID_PowerSequencing_NumberofPower = int.Parse(entryNumberofPower.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[0]      = uint.Parse(entryPower1.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[0]      = uint.Parse(entryDWell1.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[1]      = uint.Parse(entryPower2.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[1]      = uint.Parse(entryDWell2.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[2]      = uint.Parse(entryPower3.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[2]      = uint.Parse(entryDWell3.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[3]      = uint.Parse(entryPower4.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[3]      = uint.Parse(entryDWell4.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[4]      = uint.Parse(entryPower5.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[4]      = uint.Parse(entryDWell5.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[5]      = uint.Parse(entryPower6.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[5]      = uint.Parse(entryDWell6.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[6]      = uint.Parse(entryPower7.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[6]      = uint.Parse(entryDWell7.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[7]      = uint.Parse(entryPower8.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[7]      = uint.Parse(entryDWell8.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[8]      = uint.Parse(entryPower9.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[8]      = uint.Parse(entryDWell9.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[9]      = uint.Parse(entryPower10.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[9]      = uint.Parse(entryDWell10.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[10]     = uint.Parse(entryPower11.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[10]     = uint.Parse(entryDWell11.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[11]     = uint.Parse(entryPower12.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[11]     = uint.Parse(entryDWell12.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[12]     = uint.Parse(entryPower13.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[12]     = uint.Parse(entryDWell13.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[13]     = uint.Parse(entryPower14.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[13]     = uint.Parse(entryDWell14.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[14]     = uint.Parse(entryPower15.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[14]     = uint.Parse(entryDWell15.Text);
            BleMvxApplication._config.RFID_PowerSequencing_Level[15]     = uint.Parse(entryPower16.Text);
            BleMvxApplication._config.RFID_PowerSequencing_DWell[15]     = uint.Parse(entryDWell16.Text);

            BleMvxApplication.SaveConfig();

            if (BleMvxApplication._config.RFID_PowerSequencing_NumberofPower == 0)
            {
                BleMvxApplication._reader.rfid.SetPowerSequencing(0);
            }
            else
            {
                BleMvxApplication._reader.rfid.SetPowerSequencing(BleMvxApplication._config.RFID_PowerSequencing_NumberofPower, BleMvxApplication._config.RFID_PowerSequencing_Level, BleMvxApplication._config.RFID_PowerSequencing_DWell);
            }
        }
        void OnOKButtonClicked()
        {
            RaisePropertyChanged(() => switchMultiBank1Enable);
            RaisePropertyChanged(() => entryBank1);
            RaisePropertyChanged(() => entryOffset1);
            RaisePropertyChanged(() => entryCount1);
            RaisePropertyChanged(() => switchMultiBank2Enable);
            RaisePropertyChanged(() => entryBank2);
            RaisePropertyChanged(() => entryOffset2);
            RaisePropertyChanged(() => entryCount2);

            BleMvxApplication.SaveConfig();

            ShowViewModel <ViewModelMultiBankInventory>(new MvxBundle());
        }
        public async void btnOKClicked(object sender, EventArgs e)
        {
            Xamarin.Forms.DependencyService.Get <ISystemSound>().SystemSound(1);

            BleMvxApplication._config.RFID_FixedQParms.qValue            = uint.Parse(entryQValue.Text);
            BleMvxApplication._config.RFID_FixedQParms.retryCount        = uint.Parse(entryRetry.Text);
            BleMvxApplication._config.RFID_FixedQParms.repeatUntilNoTags = (uint)(entryRepeat.Text == "Repeat" ? 1 : 0);

            BleMvxApplication._config.RFID_DynamicQParms.startQValue = BleMvxApplication._config.RFID_FixedQParms.qValue;
            BleMvxApplication._config.RFID_TagPopulation             = ((uint)1 << (int)BleMvxApplication._config.RFID_FixedQParms.qValue);

            BleMvxApplication._settingPage1TagPopulationChanged = true;
            BleMvxApplication._settingPage3QvalueChanged        = true;

            BleMvxApplication.SaveConfig();
        }
        public async void btnOKClicked(object sender, EventArgs e)
        {
            Xamarin.Forms.DependencyService.Get <ISystemSound>().SystemSound(1);

            BleMvxApplication._config.RFID_DynamicQParms.startQValue         = uint.Parse(entryStartQ.Text);
            BleMvxApplication._config.RFID_DynamicQParms.minQValue           = uint.Parse(entryMinQ.Text);
            BleMvxApplication._config.RFID_DynamicQParms.maxQValue           = uint.Parse(entryMaxQ.Text);
            BleMvxApplication._config.RFID_DynamicQParms.thresholdMultiplier = uint.Parse(entryQueryRep.Text);
            BleMvxApplication._config.RFID_DynamicQParms.retryCount          = uint.Parse(entryRetry.Text);

            BleMvxApplication._config.RFID_FixedQParms.qValue = BleMvxApplication._config.RFID_DynamicQParms.startQValue;
            BleMvxApplication._config.RFID_TagPopulation      = ((uint)1 << (int)BleMvxApplication._config.RFID_DynamicQParms.startQValue);

            BleMvxApplication._settingPage1TagPopulationChanged = true;
            BleMvxApplication._settingPage4QvalueChanged        = true;

            BleMvxApplication.SaveConfig();
        }
        public async void btnConfigResetClicked(object sender, EventArgs e)
        {
            BleMvxApplication.ResetConfig();
            BleMvxApplication._reader.rfid.SetDefaultChannel();

            BleMvxApplication._config.RFID_Region = BleMvxApplication._reader.rfid.SelectedRegionCode;

            if (BleMvxApplication._reader.rfid.IsFixedChannel)
            {
                BleMvxApplication._config.RFID_FrequenceSwitch = 1;
                BleMvxApplication._config.RFID_FixedChannel    = BleMvxApplication._reader.rfid.SelectedChannel;
            }
            else
            {
                BleMvxApplication._config.RFID_FrequenceSwitch = 0; // Hopping
            }

            BleMvxApplication.SaveConfig();
        }
        public async void btnConfigResetClicked(object sender, EventArgs e)
        {
            Xamarin.Forms.DependencyService.Get <ISystemSound>().SystemSound(1);
            BleMvxApplication.ResetConfig();
            BleMvxApplication._reader.rfid.SetDefaultChannel();

            BleMvxApplication._config.RFID_Region = BleMvxApplication._reader.rfid.SelectedRegionCode;

            if (BleMvxApplication._reader.rfid.IsFixedChannel)
            {
                BleMvxApplication._config.RFID_FrequenceSwitch = 1;
                BleMvxApplication._config.RFID_FixedChannel    = BleMvxApplication._reader.rfid.SelectedChannel;
            }
            else
            {
                BleMvxApplication._config.RFID_FrequenceSwitch = 0; // Hopping
            }

            BleMvxApplication.SaveConfig();
        }
        public async void btnOKClicked(object sender, EventArgs e)
        {
            int cnt;

            Xamarin.Forms.DependencyService.Get <ISystemSound>().SystemSound(1);

            switch (buttonBatteryLevelFormat.Text)
            {
            case "Voltage":
                BleMvxApplication._config.BatteryLevelIndicatorFormat = 0;
                break;

            default:
                BleMvxApplication._config.BatteryLevelIndicatorFormat = 1;
                break;
            }

            BleMvxApplication._config.RFID_InventoryDelayTime = UInt16.Parse(entryInventoryDelayTime.Text);
            BleMvxApplication._config.RFID_DWellTime          = UInt16.Parse(entryDwellTime.Text);
            BleMvxApplication._config.RFID_Power         = UInt16.Parse(entryPower.Text);
            BleMvxApplication._config.RFID_TagPopulation = UInt16.Parse(entryTagPopulation.Text);


            for (cnt = 0; cnt < _regionsName.Length; cnt++)
            {
                if (_regionsName[cnt] == buttonRegion.Text)
                {
                    BleMvxApplication._config.RFID_Region = _regionsCode[cnt];
                    break;
                }
            }

            if (cnt == _regionsName.Length)
            {
                BleMvxApplication._config.RFID_Region = CSLibrary.Constants.RegionCode.UNKNOWN;
            }

            switch (buttonFrequencyOrder.Text)
            {
            case "Hopping":
                BleMvxApplication._config.RFID_FrequenceSwitch = 0;
                break;

            case "Fixed":
                BleMvxApplication._config.RFID_FrequenceSwitch = 1;
                break;

            case "Agile":
                BleMvxApplication._config.RFID_FrequenceSwitch = 2;
                break;
            }

            for (cnt = 0; cnt < ActiveFrequencyTextList.Length; cnt++)
            {
                if (buttonFixedChannel.Text == ActiveFrequencyTextList[cnt])
                {
                    BleMvxApplication._config.RFID_FixedChannel = (uint)cnt;
                    break;
                }
            }
            if (cnt == ActiveFrequencyTextList.Length)
            {
                BleMvxApplication._config.RFID_FixedChannel = 0;
            }

            BleMvxApplication._config.RFID_DynamicQParms.startQValue = BleMvxApplication._config.RFID_FixedQParms.qValue = (uint)(Math.Log((BleMvxApplication._config.RFID_TagPopulation * 2), 2)) + 1;
            BleMvxApplication._settingPage3QvalueChanged             = true;
            BleMvxApplication._settingPage4QvalueChanged             = true;

            BleMvxApplication.SaveConfig();

            switch (BleMvxApplication._config.RFID_FrequenceSwitch)
            {
            case 0:
                BleMvxApplication._reader.rfid.SetHoppingChannels(BleMvxApplication._config.RFID_Region);
                break;

            case 1:
                BleMvxApplication._reader.rfid.SetFixedChannel(BleMvxApplication._config.RFID_Region, BleMvxApplication._config.RFID_FixedChannel);
                break;

            case 2:
                BleMvxApplication._reader.rfid.SetAgileChannels(BleMvxApplication._config.RFID_Region);
                break;
            }
        }
        public async void btnOKClicked(object sender, EventArgs e)
        {
            int cnt;

            Xamarin.Forms.DependencyService.Get <ISystemSound>().SystemSound(1);

            for (cnt = 0; cnt < _regionsName.Length; cnt++)
            {
                if (_regionsName[cnt] == buttonRegion.Text)
                {
                    BleMvxApplication._config.RFID_Region = _regionsCode[cnt];
                    break;
                }
            }
            if (cnt == _regionsName.Length)
            {
                BleMvxApplication._config.RFID_Region = CSLibrary.Constants.RegionCode.UNKNOWN;
            }

            switch (buttonFrequencyOrder.Text)
            {
            case "Hopping":
                BleMvxApplication._config.RFID_FrequenceSwitch = 0;
                break;

            case "Fixed":
                BleMvxApplication._config.RFID_FrequenceSwitch = 1;
                break;

            case "Agile":
                BleMvxApplication._config.RFID_FrequenceSwitch = 2;
                break;
            }

            for (cnt = 0; cnt < ActiveFrequencyTextList.Length; cnt++)
            {
                if (buttonFixedChannel.Text == ActiveFrequencyTextList[cnt])
                {
                    BleMvxApplication._config.RFID_FixedChannel = (uint)cnt;
                    break;
                }
            }
            if (cnt == ActiveFrequencyTextList.Length)
            {
                BleMvxApplication._config.RFID_FixedChannel = 0;
            }

            BleMvxApplication._config.RFID_Power = UInt16.Parse(entryPower.Text);

            BleMvxApplication._config.RFID_TagPopulation = UInt16.Parse(entryTagPopulation.Text);

            BleMvxApplication._config.RFID_QOverride = entryQOverride.IsEnabled;

            switch (buttonSession.Text)
            {
            case "S0":
                BleMvxApplication._config.RFID_TagGroup.session = CSLibrary.Constants.Session.S0;
                break;

            case "S1":
                BleMvxApplication._config.RFID_TagGroup.session = CSLibrary.Constants.Session.S1;
                break;

            case "S2":
                BleMvxApplication._config.RFID_TagGroup.session = CSLibrary.Constants.Session.S2;
                break;

            case "S3":
                BleMvxApplication._config.RFID_TagGroup.session = CSLibrary.Constants.Session.S3;
                break;
            }

            switch (buttonTarget.Text)
            {
            case "A":
                BleMvxApplication._config.RFID_TagGroup.target            = CSLibrary.Constants.SessionTarget.A;
                BleMvxApplication._config.RFID_FixedQParms.toggleTarget   = 0;
                BleMvxApplication._config.RFID_DynamicQParms.toggleTarget = 0;
                break;

            case "B":
                BleMvxApplication._config.RFID_TagGroup.target            = CSLibrary.Constants.SessionTarget.B;
                BleMvxApplication._config.RFID_FixedQParms.toggleTarget   = 0;
                BleMvxApplication._config.RFID_DynamicQParms.toggleTarget = 0;
                break;

            default:
                BleMvxApplication._config.RFID_DynamicQParms.toggleTarget = 1;
                BleMvxApplication._config.RFID_FixedQParms.toggleTarget   = 1;
                break;
            }

            if (buttonAlgorithm.Text == "DYNAMICQ")
            {
                BleMvxApplication._config.RFID_Algorithm = CSLibrary.Constants.SingulationAlgorithm.DYNAMICQ;
            }
            else
            {
                BleMvxApplication._config.RFID_Algorithm = CSLibrary.Constants.SingulationAlgorithm.FIXEDQ;
            }

            BleMvxApplication._config.RFID_Profile = UInt16.Parse(buttonProfile.Text.Substring(0, 1));

            BleMvxApplication._config.RFID_DynamicQParms.startQValue = uint.Parse(entryQOverride.Text);
            BleMvxApplication._config.RFID_FixedQParms.qValue        = uint.Parse(entryQOverride.Text);

            /*
             * switch (BleMvxApplication._config.RFID_Algorithm)
             * {
             *  case CSLibrary.Constants.SingulationAlgorithm.DYNAMICQ:
             *      BleMvxApplication._config.RFID_DynamicQParms.startQValue = uint.Parse(entryQOverride.Text);
             *      break;
             *
             *  case CSLibrary.Constants.SingulationAlgorithm.FIXEDQ:
             *      BleMvxApplication._config.RFID_FixedQParms.qValue = uint.Parse(entryQOverride.Text);
             *      break;
             * }
             */

            BleMvxApplication.SaveConfig();

            switch (BleMvxApplication._config.RFID_FrequenceSwitch)
            {
            case 0:
                BleMvxApplication._reader.rfid.SetHoppingChannels(BleMvxApplication._config.RFID_Region);
                break;

            case 1:
                BleMvxApplication._reader.rfid.SetFixedChannel(BleMvxApplication._config.RFID_Region, BleMvxApplication._config.RFID_FixedChannel);
                break;

            case 2:
                BleMvxApplication._reader.rfid.SetAgileChannels(BleMvxApplication._config.RFID_Region);
                break;
            }
        }
Exemple #15
0
        public async void btnOKClicked(object sender, EventArgs e)
        {
            Xamarin.Forms.DependencyService.Get <ISystemSound>().SystemSound(1);

            if (BleMvxApplication._config.RFID_OperationMode == CSLibrary.Constants.RadioOperationMode.CONTINUOUS && buttonOperationMode.Text != "CONTINUOUS")
            {
                BleMvxApplication._config.RFID_DWellTime = 2000;
            }

            BleMvxApplication._config.RFID_OperationMode = buttonOperationMode.Text == "CONTINUOUS" ? CSLibrary.Constants.RadioOperationMode.CONTINUOUS : CSLibrary.Constants.RadioOperationMode.NONCONTINUOUS;

            switch (buttonSelected.Text)
            {
            case "ALL":
                BleMvxApplication._config.RFID_TagGroup.selected = CSLibrary.Constants.Selected.ALL;
                break;

            case "ASSERTED":
                BleMvxApplication._config.RFID_TagGroup.selected = CSLibrary.Constants.Selected.ASSERTED;
                break;

            case "DEASSERTED":
                BleMvxApplication._config.RFID_TagGroup.selected = CSLibrary.Constants.Selected.DEASSERTED;
                break;
            }

            switch (buttonSession.Text)
            {
            case "S0":
                BleMvxApplication._config.RFID_TagGroup.session = CSLibrary.Constants.Session.S0;
                break;

            case "S1":
                BleMvxApplication._config.RFID_TagGroup.session = CSLibrary.Constants.Session.S1;
                break;

            case "S2":
                BleMvxApplication._config.RFID_TagGroup.session = CSLibrary.Constants.Session.S2;
                break;

            case "S3":
                BleMvxApplication._config.RFID_TagGroup.session = CSLibrary.Constants.Session.S3;
                break;
            }

            switch (buttonTarget.Text)
            {
            case "A":
                BleMvxApplication._config.RFID_TagGroup.target            = CSLibrary.Constants.SessionTarget.A;
                BleMvxApplication._config.RFID_FixedQParms.toggleTarget   = 0;
                BleMvxApplication._config.RFID_DynamicQParms.toggleTarget = 0;
                break;

            case "B":
                BleMvxApplication._config.RFID_TagGroup.target            = CSLibrary.Constants.SessionTarget.B;
                BleMvxApplication._config.RFID_FixedQParms.toggleTarget   = 0;
                BleMvxApplication._config.RFID_DynamicQParms.toggleTarget = 0;
                break;

            default:
                BleMvxApplication._config.RFID_DynamicQParms.toggleTarget = 1;
                BleMvxApplication._config.RFID_FixedQParms.toggleTarget   = 1;
                break;
            }

            if (buttonAlgorithm.Text == "DYNAMICQ")
            {
                BleMvxApplication._config.RFID_Algorithm = CSLibrary.Constants.SingulationAlgorithm.DYNAMICQ;
            }
            else
            {
                BleMvxApplication._config.RFID_Algorithm = CSLibrary.Constants.SingulationAlgorithm.FIXEDQ;
            }
            BleMvxApplication._config.RFID_Profile = UInt16.Parse(buttonProfile.Text);

            BleMvxApplication.SaveConfig();
        }