Exemplo n.º 1
0
        /// <summary>
        /// The ButtonAdd_Click method
        /// </summary>
        /// <param name="sender">The <paramref name="sender"/> parameter</param>
        /// <param name="args">The <paramref name="args"/> parameter</param>
        private void ButtonAdd_Click(object sender, EventArgs args)
        {
            try
            {
                var newAnalyticConfig = new NewAnalyticConfig();
                if (cbxPresets.SelectedItem != null)
                {
                    newAnalyticConfig.PtzPresetName = ((ComboboxItem)cbxPresets.SelectedItem).Value.ToString();
                }

                newAnalyticConfig.MinConfidence = (float)nudMinConfidence.Value;
                newAnalyticConfig.Size          = new Resolution();
                newAnalyticConfig.Size.Height   = (int)nudSizeHeight.Value;
                newAnalyticConfig.Size.Width    = (int)nudSizeWidth.Value;

                _selectedDataSource.AddAnalyticConfig(newAnalyticConfig);
            }
            catch (Exception ex)
            {
                MainForm.Instance.WriteToLog($"Error creating analytic config: {ex.Message}");
                throw;
            }
        }