CrossSection view model was improved
This commit is contained in:
@@ -24,8 +24,8 @@ namespace StructureHelperCommon.Models
|
||||
{
|
||||
var table = new TableLogEntry(2);
|
||||
table.Priority = Priority;
|
||||
table.Table.AddRow(GetPointHeaderRow());
|
||||
table.Table.AddRow(GetPointRow(point2D));
|
||||
table.Table.AddRow(GetPoint2DHeaderRow());
|
||||
table.Table.AddRow(GetPoint2DRow(point2D));
|
||||
return table;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -50,10 +50,10 @@ namespace StructureHelperCommon.Models
|
||||
{
|
||||
var table = new TableLogEntry(2);
|
||||
table.Priority = Priority;
|
||||
table.Table.AddRow(GetPointHeaderRow());
|
||||
table.Table.AddRow(GetPoint2DHeaderRow());
|
||||
foreach (var item in points)
|
||||
{
|
||||
table.Table.AddRow(GetPointRow(item));
|
||||
table.Table.AddRow(GetPoint2DRow(item));
|
||||
}
|
||||
return table;
|
||||
}
|
||||
@@ -182,7 +182,7 @@ namespace StructureHelperCommon.Models
|
||||
return forceTupleRow;
|
||||
}
|
||||
|
||||
private ShTableRow<ITraceLoggerEntry> GetPointHeaderRow()
|
||||
private ShTableRow<ITraceLoggerEntry> GetPoint2DHeaderRow()
|
||||
{
|
||||
const CellRole cellRole = CellRole.Header;
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace StructureHelperCommon.Models
|
||||
headerRow.Elements[1] = tableCell;
|
||||
return headerRow;
|
||||
}
|
||||
private ShTableRow<ITraceLoggerEntry> GetPointRow(IPoint2D point2D)
|
||||
private ShTableRow<ITraceLoggerEntry> GetPoint2DRow(IPoint2D point2D)
|
||||
{
|
||||
var pointRow = new ShTableRow<ITraceLoggerEntry>(2);
|
||||
pointRow.Elements[0].Value = new StringLogEntry()
|
||||
|
||||
@@ -11,5 +11,6 @@ namespace StructureHelperCommon.Models
|
||||
List<ITraceLoggerEntry> TraceLoggerEntries { get; }
|
||||
void AddMessage(string message, TraceLogStatuses status = TraceLogStatuses.Info, int shiftPriority = 0);
|
||||
void AddMessage(string message, int priority);
|
||||
bool KeepErrorStatus { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,15 +12,18 @@ namespace StructureHelperCommon.Models
|
||||
public int ShiftPriority { get; set; }
|
||||
|
||||
public List<ITraceLoggerEntry> TraceLoggerEntries => Logger.TraceLoggerEntries;
|
||||
public bool KeepErrorStatus { get => Logger.KeepErrorStatus; set => Logger.KeepErrorStatus = value; }
|
||||
|
||||
public ShiftTraceLogger(ITraceLogger logger)
|
||||
{
|
||||
Logger = logger;
|
||||
KeepErrorStatus = true;
|
||||
}
|
||||
public ShiftTraceLogger() : this(new TraceLogger()) { }
|
||||
public void AddMessage(string message, TraceLogStatuses status = TraceLogStatuses.Info, int shiftPrioriry = 0)
|
||||
{
|
||||
// if status in (fatal, error, warning) they must be kept as they are
|
||||
if (status <= TraceLogStatuses.Warning)
|
||||
if (status <= TraceLogStatuses.Warning & KeepErrorStatus == true)
|
||||
{
|
||||
Logger.AddMessage(message, status);
|
||||
}
|
||||
|
||||
@@ -11,10 +11,12 @@ namespace StructureHelperCommon.Models
|
||||
public class TraceLogger : ITraceLogger
|
||||
{
|
||||
public List<ITraceLoggerEntry> TraceLoggerEntries { get; }
|
||||
public bool KeepErrorStatus { get; set; }
|
||||
|
||||
public TraceLogger()
|
||||
{
|
||||
TraceLoggerEntries = new();
|
||||
KeepErrorStatus = true;
|
||||
}
|
||||
|
||||
public void AddMessage(string message, TraceLogStatuses status = TraceLogStatuses.Info, int shiftPrioriry = 0)
|
||||
|
||||
Reference in New Issue
Block a user