Skip to content

Commit

Permalink
Merge pull request #4 from svethi/master
Browse files Browse the repository at this point in the history
bugfixing fill entries
  • Loading branch information
mr-manuel authored Jun 15, 2024
2 parents 55bd33b + 435783b commit fcb3a81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion LoxStatFileForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,15 @@ private void mnuFillEntries_Click(object sender, EventArgs e)
{
_loxStatFile.DataPoints[x].Index += (int)InsertCount;
}
double diff = ((double)atDP.Values[0] - (double)beforeDP.Values[0]) / InsertCount;
double diff = ((double)atDP.Values[0] - (double)beforeDP.Values[0]) / (InsertCount +1);
for (int x = 1; x <= InsertCount; x++)
{
newDP = beforeDP.Clone();
newDP.Index += x;
newDP.Timestamp = newDP.Timestamp.AddHours(x);
newDP.Values[0] += diff * x;
_loxStatFile.DataPoints.Insert(newDP.Index, newDP);
_dataGridView.Rows.Insert(newDP.Index, 1);
}
_dataGridView.Refresh();
Cursor = Cursors.Default;
Expand Down

0 comments on commit fcb3a81

Please sign in to comment.