Beispiel #1
0
        /// <summary>
        /// Set settings to sensor flash
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SetSettingsButton_Click(object sender, EventArgs e)
        {
            bool backgroundWasRunning = AcquisitionWorker.IsBusy;

            if (backgroundWasRunning)
            {
                StopAcquisitionThread();
            }

            try
            {
                // ReferenceGain still has value from PullSettingsFromHardware
                // which is OK because the firmware fully controls this anyway.
                activeSingleTact.Settings.I2CAddress  = (byte)(i2cAddressInputComboBox_.SelectedIndex + reservedAddresses);
                activeSingleTact.Settings.Accumulator = 5;
                //singleTact_.Settings.Baselines =
            }
            catch (Exception)
            {
                MessageBox.Show("Invalid settings", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            activeSingleTact.PushSettingsToHardware();

            RefreshFlashSettings_Click(this, null);


            if (backgroundWasRunning)
            {
                StartAcquisitionThread();
            }
        }