/// <summary> /// Parses a line and returns the <see cref="RowEntry"/> with /// <see cref="SensorData.Date"/> and one variable value determined by the header. /// </summary> /// <param name="line">The line to parse</param> /// <returns>The parsed data</returns> /// <exception cref="LineparserException">If the line has an invalid format for this parser.</exception> public override RowEntry parseLine(string line) { Match match = this.lineMatcher.Match(line); if (match.Success) { RowEntry entry = new RowEntry(); entry.Date = DateTime.Parse(match.Groups[1].Value + " " + match.Groups[2].Value, CultureInfoDE); entry.setValue(this.extraValue, match.Groups[3].Value); return entry; } throw new LineparserException("Invalid line-format: " + line); }
/// <summary> /// Parses a line and returns the <see cref="RowEntry"/> with /// <see cref="SensorData.Date"/>, /// <see cref="SensorData.CaloriesTotal"/>, <see cref="SensorData.CaloriesActivity"/> /// and <see cref="SensorData.Vmu"/> set. /// </summary> /// <param name="line">The line to parse</param> /// <returns>The parsed data</returns> /// <exception cref="LineparserException">If the line has an invalid format for this parser.</exception> public override RowEntry parseLine(string line) { Match match = this.lineMatcher.Match(line); if (match.Success) { RowEntry entry = new RowEntry(); entry.Date = DateTime.Parse(match.Groups[2].Value + " " + match.Groups[3].Value, CultureInfoDE); entry.CaloriesTotal = float.Parse(match.Groups[4].Value.Replace(";", ",")); entry.CaloriesActivity = float.Parse(match.Groups[6].Value.Replace(";", ",")); entry.Vmu = int.Parse(match.Groups[8].Value); return entry; } throw new LineparserException("Invalid line-format: " + line); }
/// <summary> /// Parses a line and returns the <see cref="RowEntry"/> with /// <see cref="SensorData.Date"/>, /// <see cref="SensorData.Activity"/> and <see cref="SensorData.Steps"/> set. /// </summary> /// <param name="line">The line to parse</param> /// <returns>The parsed data</returns> /// <exception cref="LineparserException">If the line has an invalid format for this parser.</exception> public override RowEntry parseLine(string line) { Match match = this.lineMatcher.Match(line); if (match.Success) { RowEntry entry = new RowEntry(); entry.Date = this.entryTime; entry.Activity = int.Parse(match.Groups[3].Value); entry.Steps = int.Parse(match.Groups[4].Value); this.entryTime += this.epochPeriod; return entry; } throw new LineparserException("Invalid line-format: " + line); }
public bool filter(RowEntry entry) { return ((entry.Date.TimeOfDay > this.startTime) && (entry.Date.TimeOfDay < this.endTime)); }
public bool filter(RowEntry entry) { return this.days.Contains(entry.Date.Date); }