Skip to content

Commit

Permalink
Further changes to display of concat errors
Browse files Browse the repository at this point in the history
  • Loading branch information
towsey committed Aug 31, 2017
1 parent 0567daa commit 24550ef
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ErroneousIndexSegments
public const string ErroneousIndexSegmentsFilenameFragment = "WARNING-IndexErrors";

private static string errorMissingData = "No Recording";
private static string errorZeroSignal = "Flat Signal";
private static string errorZeroSignal = "ERROR: Zero Signal";
private static string invalidIndexValue = "Invalid Index Value";

public string ErrorDescription { get; set; }
Expand Down Expand Up @@ -356,27 +356,28 @@ public Bitmap DrawErrorPatch(int height, bool textInVerticalOrientation)
{
int width = this.EndPosition - this.StartPosition + 1;
var bmp = new Bitmap(width, height);
int fontVerticalPosition = (height / 2) - 7;
int fontVerticalPosition = (height / 2) - 10;
var g = Graphics.FromImage(bmp);

g.Clear(this.ErrorDescription.Equals(errorMissingData) ? Color.LightGray : Color.HotPink);

// Draw black cross over error patch only if is wider than arbitrary 10 pixels.
// Draw error message and black cross over error patch only if is wider than arbitrary 10 pixels.
if (width > 10)
{
g.DrawLine(Pens.Black, 0, 0, width, height);
g.DrawLine(Pens.Black, 0, height, width, 0);
// decided to do without the black cross!!! - 31/08/2017
// g.DrawLine(Pens.Black, 0, 0, width, height);
// g.DrawLine(Pens.Black, 0, height, width, 0);

// Write description of the error cause.
var font = new Font("Arial", 9.0f, FontStyle.Bold);
if (textInVerticalOrientation)
{
var drawFormat = new StringFormat(StringFormatFlags.DirectionVertical);
g.DrawString(" " + this.ErrorDescription, font, Brushes.Black, 2, 10, drawFormat);
g.DrawString(" " + this.ErrorDescription, font, Brushes.Black, 2, 10, drawFormat);
}
else
{
g.DrawString(" " + this.ErrorDescription, font, Brushes.Black, 2, fontVerticalPosition);
g.DrawString(" " + this.ErrorDescription, font, Brushes.Black, 2, fontVerticalPosition);
}
}

Expand Down

0 comments on commit 24550ef

Please sign in to comment.