Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="deviceBoard"></param>
        public FindThresholdDialog(DeviceRfidBoard deviceBoard)
        {
            this.deviceBoard = deviceBoard;

            freqTab.Add(338, 118300);
            freqTab.Add(336, 119100);
            freqTab.Add(334, 119700);
            freqTab.Add(332, 120500);
            freqTab.Add(330, 121200);
            freqTab.Add(328, 121900);
            freqTab.Add(326, 122700);
            freqTab.Add(324, 123500);
            freqTab.Add(322, 124200);
            freqTab.Add(320, 125000);
            freqTab.Add(318, 125800);
            freqTab.Add(316, 126600);


            InitializeComponent();

            autoUpdateCheckBox.Checked = true;
            sampleCountTextBox.Text    = "64";
            cycleCheckBox.Checked      = true;

            GetFreq();

            byte correlationThreshold = deviceBoard.getCorrelationThreshold();

            correlationThresholdTextBox.Text = correlationThreshold.ToString();
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            loopPeriodTextBox.Text        = (string)Application.UserAppDataRegistry.GetValue(GetType().Name + "LoopPeriod", "0.5");
            loopCheckBox.Checked          = ((int)Application.UserAppDataRegistry.GetValue(GetType().Name + "LoopEnabled", 0) != 0);
            assumeUnknownCheckBox.Checked = ((int)Application.UserAppDataRegistry.GetValue(GetType().Name + "AssumeUnknownTags", 0) != 0);
            switch ((int)Application.UserAppDataRegistry.GetValue(GetType().Name + "ReceiveTags", 0))
            {
            case 0:
            default:
                receiveTagsAsynchronouslyRadioButton.Checked = true;
                break;

            case 1:
                receiveTagsSynchronouslyAfterScanRadioButton.Checked = true;
                break;

            case 2:
                receiveTagsSynchronouslyDuringScanRadioButton.Checked = true;
                break;
            }

            base.OnLoad(e);

            // Get the latch status and display it.
            PbRspGetStatus status = (PbRspGetStatus)device.getStatus();

            // Get the device's current correlation threshold. This value is saved in Flash ROM on the
            // device and may be different per device.
            byte correlationThreshold = device.getCorrelationThreshold();

            Debug.Assert(correlationThreshold > 0);
            correlationThresholdTextBox.Text = correlationThreshold.ToString();
        }