Esempio n. 1
0
        public void saveToCSV(CSVStructure record, String path)
        {
            CSVRecord rec = record.getRecordFromStructure(path);

            saveRecordsToCsv(new CSVRecord[] { rec });
            MessageBox.Show("Zapisano wiersz:\n" + buildRecordString(rec));
        }
Esempio n. 2
0
 private void Form_KeyDown(object sender, KeyEventArgs e)
 {
     e.Handled = true;
     if (e.KeyCode.Equals(Keys.P))
     {
         labelledPatients = Utils.GetNewVal(labelledPatients, 1, maxVal: 1, minVal: 0);
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.B))
     {
         drawer.visibitySrodek ^= true;
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.N))
     {
         drawer.visibityWyjscie ^= true;
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.M))
     {
         drawer.visibityPierscien ^= true;
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.Delete))
     {
         pathStorer.deleteLoadedRecord();
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.Back))
     {
         CSVSaver.deleteRecord();
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.Q))
     {
         CSVStructure = new CSVStructure();
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.L))
     {
         CSVStructure.eye      = Utils.GetNewVal(CSVStructure.eye, 1, 1);
         CSVStructure.eyeImage = ImageValue.Text;
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.Z))
     {
         CSVStructure.changeCurrentAngle(-1);
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.X))
     {
         CSVStructure.changeCurrentAngle(1);
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.Escape))
     {
         CSVStructure.Width  = ImageSlider.WIDTH;
         CSVStructure.Height = ImageSlider.HEIGHT;
         CSVSaver.saveToCSV(CSVStructure, pathStorer.paths[pathStorer.currentPath]);
     }
     if (e.KeyCode.Equals(Keys.Space))
     {
         CSVSaver.addDeleted();
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.A))
     {
         if (CSVStructure != null)
         {
             pathStorer.storeCSVRecord(CSVStructure.getRecordFromStructure(pathStorer.paths[pathStorer.currentPath]));
         }
         slider = new ImageSlider(pathStorer.changePath(-1, labelledPatients: labelledPatients), pictureBox1);
         loadPatientInfo();
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.D))
     {
         if (CSVStructure != null)
         {
             pathStorer.storeCSVRecord(CSVStructure.getRecordFromStructure(pathStorer.paths[pathStorer.currentPath]));
         }
         slider = new ImageSlider(pathStorer.changePath(1, labelledPatients: labelledPatients), pictureBox1);
         loadPatientInfo();
         refreshFeatures();
     }
     if (e.KeyCode.Equals(Keys.Left))
     {
         slider.slide(-1);
         loadImageInfo();
     }
     if (e.KeyCode.Equals(Keys.Right))
     {
         slider.slide(1);
         loadImageInfo();
     }
     if (e.KeyCode.Equals(Keys.Down))
     {
         changeCurrentParameter(1);
         hightlightSelection();
     }
     if (e.KeyCode.Equals(Keys.Up))
     {
         changeCurrentParameter(-1);
         hightlightSelection();
     }
     if (e.Modifiers.Equals(Keys.Control))
     {
         if (showing == 1)
         {
             pictureBox1.Image = slider.image;
             showing           = 0;
         }
         else
         {
             refreshFeatures();
             showing = 1;
         }
     }
 }