public void FlushBuffer(DataHolder data, TrialInfo trial, int trialNumber) { if (Buffer.Count == 0) { return; } else { DateTime time = DateTime.Now; string filename = _subjID + "_" + _playerName + "_" + trialNumber.ToString() + "_" + trial.Task + "_TrialID" + trial.TrialID.ToString() + "_Date_" + time.ToString("dd'_'MM'_'yyyy'_'H''mm''ss") + ".csv"; using (StreamWriter sw = File.CreateText(Path.Combine(_directory, filename))) { sw.WriteLine(data.Header); for (int i = 0; i < Buffer.Count; i++) { sw.WriteLine(Buffer[i]); } } Buffer.Clear(); } }
public void InitializeDataHolder() { DATA = new DataHolder(this, SYNCEXP, new EyesData(EYES, GAZED), new HandData(HAND), SYNCACT.partnerPlayer); }