Exemple #1
0
 /// <summary>
 /// Serialize dataLog to previously opened JSON file
 /// </summary>
 /// <param name="dataLog">Datalog to be serialized</param>
 public void SerializeData(DataLog dataLog)
 {
     using (FileStream fs = File.Open(fileName, FileMode.Append))
     {
         using (StreamWriter sw = new StreamWriter(fs))
         {
             // add comma if not first file in datalog
             if (serializedCount > 0)
             {
                 sw.Write(",");
             }
             //    // add data delimited with braces
             sw.Write("{\r\n");
             sw.Write(dataLog.ToString());
             sw.Write("\r\n}");
         }
     }
     // increment counter
     serializedCount++;
 }
Exemple #2
0
 /// <summary>
 /// Added dataLog queue to be serialized
 /// </summary>
 /// <param name="dataLog">Datalog to be serialized</param>
 public void AddData(DataLog dataLog)
 {
     dataQueue.Add(dataLog);
 }
Exemple #3
0
 public DataLog(DataLog log)
 {
     TimeStamp = log.TimeStamp;
 }
Exemple #4
0
 public DataLog(DataLog log)
 {
     TimeStamp = log.TimeStamp;
 }
 /// <summary>
 /// Added dataLog queue to be serialized
 /// </summary>
 /// <param name="dataLog">Datalog to be serialized</param>
 public void AddData(DataLog dataLog)
 {
     dataQueue.Add(dataLog);
 }
 /// <summary>
 /// Serialize dataLog to previously opened JSON file
 /// </summary>
 /// <param name="dataLog">Datalog to be serialized</param>
 public void SerializeData(DataLog dataLog)
 {
     using (FileStream fs = File.Open(fileName, FileMode.Append))
     {
         using (StreamWriter sw = new StreamWriter(fs))
         {
             // add comma if not first file in datalog
             if (serializedCount > 0) sw.Write(",");
         //    // add data delimited with braces
             sw.Write("{\r\n");
             sw.Write(dataLog.ToString());
             sw.Write("\r\n}");
         }
     }
     // increment counter
     serializedCount++;
 }