Trace view model was changed
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -51,7 +52,7 @@ namespace StructureHelperCommon.Models.Calculators
|
||||
TraceLogger?.AddMessage($"Calculating parameter by iterations is started,\nrequired precision {Accuracy.IterationAccuracy}");
|
||||
if (predicate(end) == false)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Predicate for end value must be true", TraceLoggerStatuses.Error);
|
||||
TraceLogger?.AddMessage($"Predicate for end value must be true", TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": predicate for end value must be true");
|
||||
}
|
||||
double precision = Accuracy.IterationAccuracy;
|
||||
@@ -61,21 +62,21 @@ namespace StructureHelperCommon.Models.Calculators
|
||||
int iterationNum = 0;
|
||||
while (step > precision)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Iteration number {iterationNum} is started", TraceLoggerStatuses.Debug);
|
||||
TraceLogger?.AddMessage($"Iteration number {iterationNum} is started", TraceLogStatuses.Debug);
|
||||
if (predicate(current) == true)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Predicate value in {current} is true", TraceLoggerStatuses.Debug, 50);
|
||||
TraceLogger?.AddMessage($"Predicate value in {current} is true", TraceLogStatuses.Debug, 50);
|
||||
end = current;
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceLogger?.AddMessage($"Predicate value in {current} is false", TraceLoggerStatuses.Debug, 50);
|
||||
TraceLogger?.AddMessage($"Predicate value in {current} is false", TraceLogStatuses.Debug, 50);
|
||||
start = current;
|
||||
}
|
||||
TraceLogger?.AddMessage($"New current value Cur=({start}+{end})/2={current}", TraceLoggerStatuses.Debug);
|
||||
TraceLogger?.AddMessage($"New current value Cur=({start}+{end})/2={current}", TraceLogStatuses.Debug);
|
||||
current = (start + end) / 2d;
|
||||
step = (end - start) / 2d;
|
||||
TraceLogger?.AddMessage($"New step S={current}", TraceLoggerStatuses.Debug, 50);
|
||||
TraceLogger?.AddMessage($"New step S={current}", TraceLogStatuses.Debug, 50);
|
||||
iterationNum++;
|
||||
|
||||
result.IsValid = false;
|
||||
@@ -85,7 +86,7 @@ namespace StructureHelperCommon.Models.Calculators
|
||||
|
||||
if (iterationNum > maxIterationCount)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Recuired precision was not achieved, current step {step}, required precision {precision}", TraceLoggerStatuses.Error);
|
||||
TraceLogger?.AddMessage($"Recuired precision was not achieved, current step {step}, required precision {precision}", TraceLogStatuses.Error);
|
||||
result.Description = "Parameter was not found succefully: \n";
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": violation of iteration count");
|
||||
}
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
using LoaderCalculator.Data.ResultData;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using TaskManager;
|
||||
|
||||
namespace StructureHelperCommon.Models.Calculators
|
||||
{
|
||||
public interface ICalculator : ICloneable
|
||||
{
|
||||
IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public interface ICalculator : ILogic, ICloneable
|
||||
{
|
||||
string Name { get; set; }
|
||||
/// <summary>
|
||||
/// Method for calculating
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public LimitStates LimitState { get; set; }
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public ForceTuple ForceTuple { get; set; }
|
||||
public IForceTuple ForceTuple { get; set; }
|
||||
|
||||
public DesignForceTuple(LimitStates limitState, CalcTerms calcTerm) : this()
|
||||
{
|
||||
|
||||
@@ -8,6 +8,6 @@ namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
LimitStates LimitState { get; set; }
|
||||
CalcTerms CalcTerm { get; set; }
|
||||
ForceTuple ForceTuple { get; set; }
|
||||
IForceTuple ForceTuple { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Models.Tables;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -6,60 +7,195 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Loggers
|
||||
namespace StructureHelperCommon.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Factory for creating trace table entries
|
||||
/// </summary>
|
||||
public class TraceTablesFactory
|
||||
{
|
||||
public int Priority { get; set; }
|
||||
public TraceTablesFactory(TraceLoggerStatuses status = TraceLoggerStatuses.Info, int priorityShift = 0)
|
||||
/// <summary>
|
||||
/// Generates table entry for Point2D (2 columns, 2 rows)
|
||||
/// </summary>
|
||||
/// <param name="point2D">Point fo creating a table</param>
|
||||
/// <returns>Table entry</returns>
|
||||
public TableLogEntry GetByPoint2D(IPoint2D point2D)
|
||||
{
|
||||
Priority = LoggerService.GetPriorityByStatus(status) + priorityShift;
|
||||
}
|
||||
public TableLoggerEntry GetTableByPoint2D(IPoint2D point2D)
|
||||
{
|
||||
var table = new TableLoggerEntry(2);
|
||||
var table = new TableLogEntry(2);
|
||||
table.Priority = Priority;
|
||||
table.Table.AddRow(GetHeaderRow());
|
||||
table.Table.AddRow(GetPointHeaderRow());
|
||||
table.Table.AddRow(GetPointRow(point2D));
|
||||
return table;
|
||||
}
|
||||
public TableLoggerEntry GetTableByPoint2D(IEnumerable<IPoint2D> points)
|
||||
/// <summary>
|
||||
/// Generates a table representation for the provided force tuple
|
||||
/// </summary>
|
||||
/// <param name="forceTuple">Force tuple to create the table for</param>
|
||||
/// <returns>Table entry</returns>
|
||||
public TableLogEntry GetByForceTuple(IForceTuple forceTuple)
|
||||
{
|
||||
var table = new TableLoggerEntry(2);
|
||||
var table = new TableLogEntry(6);
|
||||
table.Priority = Priority;
|
||||
table.Table.AddRow(GetHeaderRow());
|
||||
table.Table.AddRow(GetForceTupleHeaderRow());
|
||||
table.Table.AddRow(GetForceTupleRow(forceTuple));
|
||||
return table;
|
||||
}
|
||||
/// <summary>
|
||||
/// Generates table entry for Point2D (2 columns, (number of poins + 1) rows)
|
||||
/// </summary>
|
||||
/// <param name="points">Collection of points for creating a table</param>
|
||||
/// <returns>Table entry</returns>
|
||||
public TableLogEntry GetByPoint2D(IEnumerable<IPoint2D> points)
|
||||
{
|
||||
var table = new TableLogEntry(2);
|
||||
table.Priority = Priority;
|
||||
table.Table.AddRow(GetPointHeaderRow());
|
||||
foreach (var item in points)
|
||||
{
|
||||
table.Table.AddRow(GetPointRow(item));
|
||||
}
|
||||
return table;
|
||||
}
|
||||
|
||||
private ShTableRow<ITraceLoggerEntry> GetHeaderRow()
|
||||
/// <summary>
|
||||
/// Generates a table representation for the provided force tuple collection
|
||||
/// </summary>
|
||||
/// <param name="forceTuples">Force tuple collection to create the table for</param>
|
||||
/// <returns>Table entry</returns>
|
||||
public TableLogEntry GetByForceTuple(IEnumerable<IForceTuple> forceTuples)
|
||||
{
|
||||
var table = new TableLogEntry(6);
|
||||
table.Priority = Priority;
|
||||
table.Table.AddRow(GetForceTupleHeaderRow());
|
||||
foreach (var forceTuple in forceTuples)
|
||||
{
|
||||
table.Table.AddRow(GetForceTupleRow(forceTuple));
|
||||
}
|
||||
return table;
|
||||
}
|
||||
/// <summary>
|
||||
/// Generates new trace table entry
|
||||
/// </summary>
|
||||
/// <param name="status">Default status = info</param>
|
||||
public TraceTablesFactory(TraceLogStatuses status = TraceLogStatuses.Info)
|
||||
{
|
||||
Priority = LoggerService.GetPriorityByStatus(status);
|
||||
}
|
||||
private ShTableRow<ITraceLoggerEntry> GetForceTupleHeaderRow()
|
||||
{
|
||||
var forceTupleRow = new ShTableRow<ITraceLoggerEntry>(6);
|
||||
|
||||
forceTupleRow.Elements[0].Value = new StringLogEntry()
|
||||
{
|
||||
Message = "Mx",
|
||||
Priority = Priority
|
||||
};
|
||||
|
||||
forceTupleRow.Elements[1].Value = new StringLogEntry()
|
||||
{
|
||||
Message = "My",
|
||||
Priority = Priority
|
||||
};
|
||||
|
||||
forceTupleRow.Elements[2].Value = new StringLogEntry()
|
||||
{
|
||||
Message = "Nz",
|
||||
Priority = Priority
|
||||
};
|
||||
|
||||
forceTupleRow.Elements[3].Value = new StringLogEntry()
|
||||
{
|
||||
Message = "Qx",
|
||||
Priority = Priority
|
||||
};
|
||||
|
||||
forceTupleRow.Elements[4].Value = new StringLogEntry()
|
||||
{
|
||||
Message = "Qy",
|
||||
Priority = Priority
|
||||
};
|
||||
|
||||
forceTupleRow.Elements[5].Value = new StringLogEntry()
|
||||
{
|
||||
Message = "Mz",
|
||||
Priority = Priority
|
||||
};
|
||||
|
||||
return forceTupleRow;
|
||||
}
|
||||
private ShTableRow<ITraceLoggerEntry> GetForceTupleRow(IForceTuple forceTuple)
|
||||
{
|
||||
var forceTupleRow = new ShTableRow<ITraceLoggerEntry>(6);
|
||||
|
||||
forceTupleRow.Elements[0].Value = new StringLogEntry()
|
||||
{
|
||||
Message = forceTuple.Mx.ToString(),
|
||||
Priority = Priority
|
||||
};
|
||||
|
||||
forceTupleRow.Elements[1].Value = new StringLogEntry()
|
||||
{
|
||||
Message = forceTuple.My.ToString(),
|
||||
Priority = Priority
|
||||
};
|
||||
|
||||
|
||||
forceTupleRow.Elements[2].Value = new StringLogEntry()
|
||||
{
|
||||
Message = forceTuple.Nz.ToString(),
|
||||
Priority = Priority
|
||||
};
|
||||
|
||||
|
||||
forceTupleRow.Elements[3].Value = new StringLogEntry()
|
||||
{
|
||||
Message = forceTuple.Qx.ToString(),
|
||||
Priority = Priority
|
||||
};
|
||||
|
||||
|
||||
forceTupleRow.Elements[4].Value = new StringLogEntry()
|
||||
{
|
||||
Message = forceTuple.Qy.ToString(),
|
||||
Priority = Priority
|
||||
};
|
||||
|
||||
forceTupleRow.Elements[5].Value = new StringLogEntry()
|
||||
{
|
||||
Message = forceTuple.Mz.ToString(),
|
||||
Priority = Priority
|
||||
};
|
||||
|
||||
return forceTupleRow;
|
||||
}
|
||||
|
||||
private ShTableRow<ITraceLoggerEntry> GetPointHeaderRow()
|
||||
{
|
||||
const CellRole cellRole = CellRole.Header;
|
||||
|
||||
var headerRow = new ShTableRow<ITraceLoggerEntry>(2);
|
||||
IShTableCell<ITraceLoggerEntry> tableCell;
|
||||
ITraceLoggerEntry loggerEntry;
|
||||
loggerEntry = new StringLoggerEntry()
|
||||
loggerEntry = new StringLogEntry()
|
||||
{
|
||||
Message = "X",
|
||||
Priority = LoggerService.GetPriorityByStatus(TraceLoggerStatuses.Info)
|
||||
Priority = Priority
|
||||
};
|
||||
tableCell = new ShTableCell<ITraceLoggerEntry>()
|
||||
{
|
||||
Value = loggerEntry,
|
||||
Role = CellRole.Header,
|
||||
Role = cellRole,
|
||||
};
|
||||
headerRow.Elements[0] = tableCell;
|
||||
loggerEntry = new StringLoggerEntry()
|
||||
loggerEntry = new StringLogEntry()
|
||||
{
|
||||
Message = "Y",
|
||||
Priority = LoggerService.GetPriorityByStatus(TraceLoggerStatuses.Info)
|
||||
Priority = Priority
|
||||
};
|
||||
tableCell = new ShTableCell<ITraceLoggerEntry>()
|
||||
{
|
||||
Value = loggerEntry,
|
||||
Role = CellRole.Header,
|
||||
Role = cellRole,
|
||||
};
|
||||
headerRow.Elements[1] = tableCell;
|
||||
return headerRow;
|
||||
@@ -67,15 +203,15 @@ namespace StructureHelperCommon.Models.Loggers
|
||||
private ShTableRow<ITraceLoggerEntry> GetPointRow(IPoint2D point2D)
|
||||
{
|
||||
var pointRow = new ShTableRow<ITraceLoggerEntry>(2);
|
||||
pointRow.Elements[0].Value = new StringLoggerEntry()
|
||||
pointRow.Elements[0].Value = new StringLogEntry()
|
||||
{
|
||||
Message = Convert.ToString(point2D.X),
|
||||
Priority = LoggerService.GetPriorityByStatus(TraceLoggerStatuses.Info)
|
||||
Priority = LoggerService.GetPriorityByStatus(TraceLogStatuses.Info)
|
||||
};
|
||||
pointRow.Elements[1].Value = new StringLoggerEntry()
|
||||
pointRow.Elements[1].Value = new StringLogEntry()
|
||||
{
|
||||
Message = Convert.ToString(point2D.Y),
|
||||
Priority = LoggerService.GetPriorityByStatus(TraceLoggerStatuses.Info)
|
||||
Priority = LoggerService.GetPriorityByStatus(TraceLogStatuses.Info)
|
||||
};
|
||||
return pointRow;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Loggers
|
||||
namespace StructureHelperCommon.Models
|
||||
{
|
||||
public interface ILogger
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Loggers
|
||||
namespace StructureHelperCommon.Models
|
||||
{
|
||||
public interface IShiftTraceLogger : ITraceLogger
|
||||
{
|
||||
|
||||
@@ -4,12 +4,12 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Loggers
|
||||
namespace StructureHelperCommon.Models
|
||||
{
|
||||
public interface ITraceLogger
|
||||
{
|
||||
List<ITraceLoggerEntry> TraceLoggerEntries { get; }
|
||||
void AddMessage(string message, TraceLoggerStatuses status = TraceLoggerStatuses.Info, int shiftPriority = 0);
|
||||
void AddMessage(string message, TraceLogStatuses status = TraceLogStatuses.Info, int shiftPriority = 0);
|
||||
void AddMessage(string message, int priority);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Loggers
|
||||
namespace StructureHelperCommon.Models
|
||||
{
|
||||
public interface ITraceLoggerEntry
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Loggers
|
||||
namespace StructureHelperCommon.Models
|
||||
{
|
||||
public static class LoggerService
|
||||
{
|
||||
@@ -16,14 +16,14 @@ namespace StructureHelperCommon.Models.Loggers
|
||||
const int info = 300;
|
||||
const int service = 400;
|
||||
const int debug = 500;
|
||||
public static int GetPriorityByStatus(TraceLoggerStatuses status)
|
||||
public static int GetPriorityByStatus(TraceLogStatuses status)
|
||||
{
|
||||
if (status == TraceLoggerStatuses.Fatal) { return fatal; }
|
||||
else if (status == TraceLoggerStatuses.Error) { return error; }
|
||||
else if (status == TraceLoggerStatuses.Warning) { return warning; }
|
||||
else if (status == TraceLoggerStatuses.Info) { return info; }
|
||||
else if (status == TraceLoggerStatuses.Service) { return service; }
|
||||
else if (status == TraceLoggerStatuses.Debug) { return debug; }
|
||||
if (status == TraceLogStatuses.Fatal) { return fatal; }
|
||||
else if (status == TraceLogStatuses.Error) { return error; }
|
||||
else if (status == TraceLogStatuses.Warning) { return warning; }
|
||||
else if (status == TraceLogStatuses.Info) { return info; }
|
||||
else if (status == TraceLogStatuses.Service) { return service; }
|
||||
else if (status == TraceLogStatuses.Debug) { return debug; }
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(status));
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Loggers
|
||||
namespace StructureHelperCommon.Models
|
||||
{
|
||||
public class ShiftTraceLogger : IShiftTraceLogger
|
||||
{
|
||||
@@ -17,10 +17,10 @@ namespace StructureHelperCommon.Models.Loggers
|
||||
Logger = logger;
|
||||
}
|
||||
public ShiftTraceLogger() : this(new TraceLogger()) { }
|
||||
public void AddMessage(string message, TraceLoggerStatuses status = TraceLoggerStatuses.Info, int shiftPrioriry = 0)
|
||||
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 <= TraceLoggerStatuses.Warning)
|
||||
if (status <= TraceLogStatuses.Warning)
|
||||
{
|
||||
Logger.AddMessage(message, status);
|
||||
}
|
||||
@@ -48,7 +48,10 @@ namespace StructureHelperCommon.Models.Loggers
|
||||
|
||||
public void AddEntry(ITraceLoggerEntry loggerEntry)
|
||||
{
|
||||
loggerEntry.Priority += ShiftPriority;
|
||||
if (loggerEntry.Priority >= LoggerService.GetPriorityByStatus(TraceLogStatuses.Warning))
|
||||
{
|
||||
loggerEntry.Priority += ShiftPriority;
|
||||
}
|
||||
Logger.TraceLoggerEntries.Add(loggerEntry);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,15 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Loggers
|
||||
namespace StructureHelperCommon.Models
|
||||
{
|
||||
public class StringLoggerEntry : ITraceLoggerEntry
|
||||
public class StringLogEntry : ITraceLoggerEntry
|
||||
{
|
||||
public DateTime TimeStamp { get;}
|
||||
public string Message { get; set; }
|
||||
public int Priority { get; set; }
|
||||
|
||||
public StringLoggerEntry()
|
||||
public StringLogEntry()
|
||||
{
|
||||
TimeStamp = DateTime.Now;
|
||||
}
|
||||
@@ -5,16 +5,16 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Loggers
|
||||
namespace StructureHelperCommon.Models
|
||||
{
|
||||
public class TableLoggerEntry : ITraceLoggerEntry
|
||||
public class TableLogEntry : ITraceLoggerEntry
|
||||
{
|
||||
private ShTable<ITraceLoggerEntry> table;
|
||||
public ShTable<ITraceLoggerEntry> Table {get => table;}
|
||||
public DateTime TimeStamp { get; }
|
||||
|
||||
public int Priority { get; set; }
|
||||
public TableLoggerEntry(int rowSize)
|
||||
public TableLogEntry(int rowSize)
|
||||
{
|
||||
if (rowSize <= 0)
|
||||
{
|
||||
@@ -4,9 +4,9 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Loggers
|
||||
namespace StructureHelperCommon.Models
|
||||
{
|
||||
public enum TraceLoggerStatuses
|
||||
public enum TraceLogStatuses
|
||||
{
|
||||
Fatal,
|
||||
Error,
|
||||
@@ -6,7 +6,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace StructureHelperCommon.Models.Loggers
|
||||
namespace StructureHelperCommon.Models
|
||||
{
|
||||
public class TraceLogger : ITraceLogger
|
||||
{
|
||||
@@ -17,12 +17,12 @@ namespace StructureHelperCommon.Models.Loggers
|
||||
TraceLoggerEntries = new();
|
||||
}
|
||||
|
||||
public void AddMessage(string message, TraceLoggerStatuses status = TraceLoggerStatuses.Info, int shiftPrioriry = 0)
|
||||
public void AddMessage(string message, TraceLogStatuses status = TraceLogStatuses.Info, int shiftPrioriry = 0)
|
||||
{
|
||||
if (status == TraceLoggerStatuses.Fatal) { message = $"Fatal error! {message}"; }
|
||||
if (status == TraceLoggerStatuses.Error) { message = $"Error! {message}"; }
|
||||
if (status == TraceLoggerStatuses.Warning) { message = $"Warning! {message}"; }
|
||||
TraceLoggerEntries.Add(new StringLoggerEntry()
|
||||
if (status == TraceLogStatuses.Fatal) { message = $"Fatal error! {message}"; }
|
||||
if (status == TraceLogStatuses.Error) { message = $"Error! {message}"; }
|
||||
if (status == TraceLogStatuses.Warning) { message = $"Warning! {message}"; }
|
||||
TraceLoggerEntries.Add(new StringLogEntry()
|
||||
{
|
||||
Message = message,
|
||||
Priority = LoggerService.GetPriorityByStatus(status)
|
||||
@@ -30,7 +30,7 @@ namespace StructureHelperCommon.Models.Loggers
|
||||
}
|
||||
public void AddMessage(string message, int priority)
|
||||
{
|
||||
TraceLoggerEntries.Add(new StringLoggerEntry()
|
||||
TraceLoggerEntries.Add(new StringLogEntry()
|
||||
{
|
||||
Message = message,
|
||||
Priority = priority
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using StructureHelperCommon.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -54,6 +54,14 @@ namespace StructureHelperCommon.Models.Tables
|
||||
}
|
||||
}
|
||||
|
||||
public int RowCount => GetAllRows().Count();
|
||||
public IShTableCell<T> GetCell(int rowIndex, int columnIndex)
|
||||
{
|
||||
var row = GetElementsFromRow(rowIndex);
|
||||
var cell = row[columnIndex];
|
||||
return cell;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set a value at the specified column and row index
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user