Exemplo n.º 1
0
        private void btnOpenFile_Click(object sender, EventArgs e)
        {
            openFileDialog1.ShowDialog();

            if (openFileDialog1.FileName != "")
            {
                List <TrainingSet> t = FileManagement.openFile(openFileDialog1.FileName);

                if (t != null)
                {
                    int sampleAccounts = 0;

                    foreach (TrainingSet m in t)
                    {
                        p.addTrainingSet(m.getInputs(), m.getLetter());
                        sampleAccounts++;
                    }

                    lblOpenedFile.Text   = Constants.OPEN_FILE + openFileDialog1.SafeFileName;
                    lblSamplesAdded.Text = Constants.SAMPLES_ADDED + sampleAccounts;
                }
                else
                {
                    MessageBox.Show("The file could not be read.");
                }
            }
        }
Exemplo n.º 2
0
        private void btnSaveFile_Click(object sender, EventArgs e)
        {
            saveFileDialog1.ShowDialog();

            if (!FileManagement.saveFile(p.getTrainingSet(), saveFileDialog1.FileName))
            {
                MessageBox.Show("The file could not be saved.");
            }
        }
Exemplo n.º 3
0
 public bool generatesLog(string directory)
 {
     return(FileManagement.writeLog(directory, Neurons, TrainSet));
 }