Пример #1
0
 private void DataSave()
 {
     if (csvFileWriter != null)
     {
         ms++;
         if (timeremain == 0)
         {
             csvFileWriter.CloseFile();
             csvFileWriter = null;
             MessageBox.Show("Chưa lưu");
         }
         string stringDataToWrite = String.Concat(DateTime.Now.Second.ToString(), "," + channel[5].ToString(),
                                                  "," + channel[4].ToString(), "," + channel[3].ToString(), "," + channel[2].ToString());
         csvFileWriter.WriteCSVline(stringListDataToWrite);
         stringListDataToWrite.Clear();
         stringListDataToWrite.Add(stringDataToWrite);
         if (ms == timeremain)
         {
             csvFileWriter.CloseFile();
             csvFileWriter = null;
             MessageBox.Show("Dữ liệu đã được lưu");
         }
     }
     #endregion
 }
Пример #2
0
 private void stop_save_data_Click(object sender, EventArgs e)
 {
     if (csvFileWriter != null)
     {
         csvFileWriter.CloseFile();
         csvFileWriter = null;
     }
     SaveData_btn.Enabled   = true;
     stop_save_data.Enabled = false;
 }
Пример #3
0
 //function data save
 private void DataSave()
 {
     if (csvFileWriter != null)
     {
         ms++;
         string stringDataToWrite = String.Concat(ms.ToString(), "," + channel[5].ToString(), "," + channel[4].ToString(), "," + channel[3].ToString(), "," + channel[2].ToString());
         csvFileWriter.WriteCSVline(stringListDataToWrite);
         stringListDataToWrite.Clear();
         stringListDataToWrite.Add(stringDataToWrite);
         if (timeremain == 0)
         {
             csvFileWriter.CloseFile();
             csvFileWriter = null;
             MessageBox.Show("Chưa lưu");
         }
         if (ms >= timeremain + 1)
         {
             csvFileWriter.CloseFile();
             csvFileWriter = null;
             MessageBox.Show("Đã lưu");
         }
     }
 }
Пример #4
0
        //function data save
        private void DataSave()
        {
            if (csvFileWriter != null)
            {
                string stringDataToWrite = String.Concat(DateTime.Now.ToString(), "," + channel[5].ToString(),
                                                         "," + channel[4].ToString(), "," + channel[3].ToString(), "," + channel[2].ToString());
                csvFileWriter.WriteCSVline(stringListDataToWrite);
                stringListDataToWrite.Clear();

                stringListDataToWrite.Add(stringDataToWrite);
                if (DateTime.Compare(DateTime.Now, timeCountSaveData) >= 0)
                {
                    csvFileWriter.CloseFile();
                    csvFileWriter = null;
                    MessageBox.Show("Dữ liệu đã được lưu");
                }
            }
            #endregion
        }
Пример #5
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     if (buttonSave.Text == "Save File")
     {
         buttonSave.Text = "Stop Save";
         xIMUserial.CalInertialAndMagneticDataReceived +=
             new x_IMU_API.xIMUserial.onCalInertialAndMagneticDataReceived(xIMUserial_SaveFile);
         isSaving = true;
     }
     else
     {
         buttonSave.Text = "Save File";
         isSaving        = false;
         if (csvFileWriter != null)
         {
             csvFileWriter.CloseFile();
             csvFileWriter = null;
         }
     }
 }