Esempio n. 1
0
        private void buttonTeach_Click(object sender, EventArgs e)
        {
            if (cmbBoxFiles.SelectedItem == null)
            {
                SetStatusStrip(Color.Red, Resources.statusStripInfo_SelectDataError);
                return;
            }

            try
            {
                var datafilePath = $"{folderBrowser.SelectedPath}\\{cmbBoxFiles.SelectedItem}";
                var separator    = ' ';
                _hopfieldNetwork.TeachWithHebbsRule(datafilePath, separator);
            }
            catch (Exception ex)
            {
                SetStatusStrip(Color.Red, ex.Message);
                return;
            }

            SetStatusStrip(Color.Green, Resources.statusStripInfo_TeachingDone);
            btnTest.Enabled = true;
        }