Skip to content

Commit

Permalink
Show an additional message when duplicate rows are removed
Browse files Browse the repository at this point in the history
  • Loading branch information
alchemistmatt committed Oct 7, 2020
1 parent c8fcf94 commit 45b4900
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Inferno/Forms/frmDAnTE.Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public partial class frmDAnTE : Form
{
#region Other Variables

public const string PROGRAM_DATE = "September 8, 2020";
public const string PROGRAM_DATE = "October 6, 2020";

public const int SUGGESTED_DATASETS_TO_SELECT = 30;
public const int MAX_DATASETS_TO_SELECT = 60;
Expand Down
2 changes: 1 addition & 1 deletion Inferno/Forms/frmShowProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void AppendWarningMessage(string message)
return;
}

lblWarningMsg.Text = lblWarningMsg.Text + "; " + message;
lblWarningMsg.Text = lblWarningMsg.Text + "\n\n" + message;
}

public void Reset(string task)
Expand Down
14 changes: 12 additions & 2 deletions Tools/clsDataTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ public DataTable RemoveDuplicateRows2(DataTable dTable, string keyColumn)

if (duplicateList.Count > 0)
{
RemoveRows(dTable, duplicateList, keyColumn, "duplicate");
RemoveRows(dTable, duplicateList, keyColumn, "duplicate", "Note that abundance values for duplicate rows were summed.");
}

if (emptyList.Count > 0)
Expand All @@ -599,7 +599,12 @@ public DataTable RemoveDuplicateRows2(DataTable dTable, string keyColumn)
return dTable;
}

private void RemoveRows(DataTable dTable, IEnumerable<DataRow> rowsToRemove, string keyColumn, string rowType)
private void RemoveRows(
DataTable dTable,
IEnumerable<DataRow> rowsToRemove,
string keyColumn,
string rowType,
string additionalMessage = "")
{
var keysRemoved = new List<string>();

Expand Down Expand Up @@ -629,6 +634,11 @@ private void RemoveRows(DataTable dTable, IEnumerable<DataRow> rowsToRemove, str
ReportWarning(string.Format("Removed {0} {1} rows named: {2} ...",
keysRemoved.Count, rowType, string.Join(", ", keysRemoved.Take(10))));
}

if (!string.IsNullOrWhiteSpace(additionalMessage))
{
ReportWarning(additionalMessage);
}
}

private void AddDuplicateRow(IDictionary<object, DataRow> uniqueKeys, DataRow thisRow,
Expand Down

0 comments on commit 45b4900

Please sign in to comment.