repo time
Dependencies: mbed MAX14720 MAX30205 USBDevice
HspGuiSourceV301/GuiDLLs/FileLog/FileLogExample/Form1.cs@20:6d2af70c92ab, 2021-04-06 (annotated)
- Committer:
- darienf
- Date:
- Tue Apr 06 06:41:40 2021 +0000
- Revision:
- 20:6d2af70c92ab
another repo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
darienf | 20:6d2af70c92ab | 1 | using System; |
darienf | 20:6d2af70c92ab | 2 | using System.Collections.Generic; |
darienf | 20:6d2af70c92ab | 3 | using System.ComponentModel; |
darienf | 20:6d2af70c92ab | 4 | using System.Data; |
darienf | 20:6d2af70c92ab | 5 | using System.Drawing; |
darienf | 20:6d2af70c92ab | 6 | using System.Linq; |
darienf | 20:6d2af70c92ab | 7 | using System.Text; |
darienf | 20:6d2af70c92ab | 8 | using System.Threading.Tasks; |
darienf | 20:6d2af70c92ab | 9 | using System.Windows.Forms; |
darienf | 20:6d2af70c92ab | 10 | using Maxim.Utility; |
darienf | 20:6d2af70c92ab | 11 | |
darienf | 20:6d2af70c92ab | 12 | namespace FileLogExample |
darienf | 20:6d2af70c92ab | 13 | { |
darienf | 20:6d2af70c92ab | 14 | public partial class Form1 : Form |
darienf | 20:6d2af70c92ab | 15 | { |
darienf | 20:6d2af70c92ab | 16 | FileLog fileLog = new FileLog(); |
darienf | 20:6d2af70c92ab | 17 | bool fileSelected = false; |
darienf | 20:6d2af70c92ab | 18 | int count = 0; |
darienf | 20:6d2af70c92ab | 19 | |
darienf | 20:6d2af70c92ab | 20 | public Form1() |
darienf | 20:6d2af70c92ab | 21 | { |
darienf | 20:6d2af70c92ab | 22 | InitializeComponent(); |
darienf | 20:6d2af70c92ab | 23 | } |
darienf | 20:6d2af70c92ab | 24 | |
darienf | 20:6d2af70c92ab | 25 | private void button1_Click(object sender, EventArgs e) |
darienf | 20:6d2af70c92ab | 26 | { |
darienf | 20:6d2af70c92ab | 27 | try |
darienf | 20:6d2af70c92ab | 28 | { |
darienf | 20:6d2af70c92ab | 29 | fileSelected = fileLog.SelectCSVFile("fileLogExample"); |
darienf | 20:6d2af70c92ab | 30 | if (fileSelected) |
darienf | 20:6d2af70c92ab | 31 | MessageBox.Show("File Select successful"); |
darienf | 20:6d2af70c92ab | 32 | else |
darienf | 20:6d2af70c92ab | 33 | MessageBox.Show("File Select failed"); |
darienf | 20:6d2af70c92ab | 34 | } |
darienf | 20:6d2af70c92ab | 35 | catch(System.IO.IOException ex) |
darienf | 20:6d2af70c92ab | 36 | { |
darienf | 20:6d2af70c92ab | 37 | MessageBox.Show(ex.Message, "File Select Failed"); |
darienf | 20:6d2af70c92ab | 38 | } |
darienf | 20:6d2af70c92ab | 39 | } |
darienf | 20:6d2af70c92ab | 40 | |
darienf | 20:6d2af70c92ab | 41 | private void button2_Click(object sender, EventArgs e) |
darienf | 20:6d2af70c92ab | 42 | { |
darienf | 20:6d2af70c92ab | 43 | if (fileSelected == true) |
darienf | 20:6d2af70c92ab | 44 | { |
darienf | 20:6d2af70c92ab | 45 | fileLog.WriteLine("Writing Line " + count++); |
darienf | 20:6d2af70c92ab | 46 | } |
darienf | 20:6d2af70c92ab | 47 | } |
darienf | 20:6d2af70c92ab | 48 | } |
darienf | 20:6d2af70c92ab | 49 | } |