repo time

Dependencies:   mbed MAX14720 MAX30205 USBDevice

HspGuiSourceV301/GuiDLLs/FileLog/FileLogExample/Form1.cs

Committer:
darienf
Date:
2021-04-06
Revision:
20:6d2af70c92ab

File content as of revision 20:6d2af70c92ab:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Maxim.Utility;

namespace FileLogExample
{
    public partial class Form1 : Form
    {
        FileLog fileLog = new FileLog();
        bool fileSelected = false;
        int count = 0;
        
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                fileSelected = fileLog.SelectCSVFile("fileLogExample");
                if (fileSelected)
                    MessageBox.Show("File Select successful");
                else
                    MessageBox.Show("File Select failed");
            }
            catch(System.IO.IOException ex)
            {
                MessageBox.Show(ex.Message, "File Select Failed");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (fileSelected == true)
            {
                fileLog.WriteLine("Writing Line " + count++);
            }
        }
    }
}