private void openToolStripMenuItem_Click(object sender, EventArgs e) { napon1.Clear(); napon2.Clear(); OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "MIT Arrhythmia File (*.txt, *.dat)|*.txt; *.dat"; if (ofd.ShowDialog() == DialogResult.OK) { string filePath = ofd.FileName; string fileName = System.IO.Path.GetFileName(filePath); string fileExtension = System.IO.Path.GetExtension(filePath); string directoryPath = System.IO.Path.GetDirectoryName(filePath); EKGFileType tip = EKGFileType.BINARY; if (fileExtension == ".txt" || fileExtension == ".TXT") { tip = EKGFileType.TEXT; } try { DajNapon1(filePath, tip); } catch (Exception izuzetak) { MessageBox.Show(izuzetak.ToString()); } try { DajNapon2(filePath, tip); } catch (Exception izuzetak) { MessageBox.Show(izuzetak.ToString()); } if (tip == EKGFileType.TEXT) { for (int i = 0; i < napon1.Count; i++) { napon1[i] = napon1[i] * 1000; } for (int i = 0; i < napon2.Count; i++) { napon2[i] = napon2[i] * 1000; } } CalcDataGraphs(); } }
public static void Open(string filename, short channel, EKGFileType filetype) { if (!System.IO.File.Exists(filename)) throw new System.IO.FileNotFoundException("Fajl nije pronaðen!", filename); if (filetype == EKGFileType.BINARY) ulaz = new BinarniUlaz(filename, 30); else if (filetype == EKGFileType.TEXT) ulaz = new TekstualniUlaz(filename, 30); ulaz.Read(channel); }
public void DajNapon2(string filePath, EKGFileType type) { timer = new System.Threading.Timer(new TimerCallback(tick2)); try { UlazniBuffer.Open(filePath, 2, type); timer.Change(0, 60); // 30 Thread.Sleep(10000); //10000 } catch (Exception izuzetak) { MessageBox.Show(izuzetak.ToString()); } }
public void DajNapon1(string filePath, EKGFileType type) { timer = new System.Threading.Timer(new TimerCallback(tick1)); try { UlazniBuffer.Open(filePath, 1, type); timer.Change(0, 60); // 30 Thread.Sleep(10000); //10000 } catch (Exception izuzetak) { MessageBox.Show(izuzetak.ToString()); } }
public static void Open(string filename, short channel, EKGFileType filetype) { if (!System.IO.File.Exists(filename)) { throw new System.IO.FileNotFoundException("Fajl nije pronaðen!", filename); } if (filetype == EKGFileType.BINARY) { ulaz = new BinarniUlaz(filename, 30); } else if (filetype == EKGFileType.TEXT) { ulaz = new TekstualniUlaz(filename, 30); } ulaz.Read(channel); }