Add logic for import of combination from xls files
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public class CheckColumnedFilePropertyLogic : ICheckEntityLogic<IColumnedFileProperty>
|
||||
{
|
||||
private string checkResult;
|
||||
private bool result;
|
||||
|
||||
public IColumnedFileProperty Entity { get; set; }
|
||||
|
||||
public string CheckResult => checkResult;
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
result = true;
|
||||
int skipRows = Entity.SkipRowBeforeHeaderCount + Entity.SkipRowHeaderCount;
|
||||
if (skipRows < 0)
|
||||
{
|
||||
string errorString = ErrorStrings.DataIsInCorrect + $": skip row count must be greater or equal to 0, bu was {skipRows}";
|
||||
TraceMessage(errorString);
|
||||
return false;
|
||||
}
|
||||
if (File.Exists(Entity.FilePath) == false)
|
||||
{
|
||||
string errorString = ErrorStrings.DataIsInCorrect + $": File {Entity.FilePath} does not exist";
|
||||
TraceMessage(errorString);
|
||||
return false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void TraceMessage(string errorString)
|
||||
{
|
||||
checkResult += errorString;
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public class ColumnPropertyCloningStrategy : ICloneStrategy<IColumnProperty>
|
||||
{
|
||||
private IUpdateStrategy<IColumnProperty> updateStrategy;
|
||||
|
||||
public ColumnPropertyCloningStrategy(IUpdateStrategy<IColumnProperty> updateStrategy)
|
||||
{
|
||||
this.updateStrategy = updateStrategy;
|
||||
}
|
||||
|
||||
public ColumnPropertyCloningStrategy()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public IColumnProperty GetClone(IColumnProperty sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (updateStrategy is null)
|
||||
{
|
||||
updateStrategy = new ColumnPropertyUpdateStrategy();
|
||||
}
|
||||
ColumnProperty newItem = new(sourceObject.Name);
|
||||
updateStrategy.Update(newItem, sourceObject);
|
||||
return newItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,16 +8,17 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public class ForceColumnPropertyUpdateStrategy : IUpdateStrategy<IColumnProperty>
|
||||
public class ColumnPropertyUpdateStrategy : IUpdateStrategy<IColumnProperty>
|
||||
{
|
||||
public void Update(IColumnProperty targetObject, IColumnProperty sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
targetObject.ColumnName = sourceObject.ColumnName;
|
||||
targetObject.ColumnIndex = sourceObject.ColumnIndex;
|
||||
targetObject.ColumnFactor = sourceObject.ColumnFactor;
|
||||
targetObject.Name = sourceObject.Name;
|
||||
targetObject.SearchingName = sourceObject.SearchingName;
|
||||
targetObject.Index = sourceObject.Index;
|
||||
targetObject.Factor = sourceObject.Factor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public class ColumnedFilePropertyUpdateStrategy : IUpdateStrategy<IColumnedFileProperty>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public void Update(IColumnedFileProperty targetObject, IColumnedFileProperty sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
UpdateObjects(targetObject, sourceObject);
|
||||
}
|
||||
|
||||
private static void UpdateObjects(IColumnedFileProperty targetObject, IColumnedFileProperty sourceObject)
|
||||
{
|
||||
targetObject.FilePath = sourceObject.FilePath;
|
||||
targetObject.GlobalFactor = sourceObject.GlobalFactor;
|
||||
targetObject.SkipRowBeforeHeaderCount = sourceObject.SkipRowBeforeHeaderCount;
|
||||
targetObject.SkipRowHeaderCount = sourceObject.SkipRowHeaderCount;
|
||||
CheckObject.IsNull(targetObject.ColumnProperties);
|
||||
CheckObject.IsNull(sourceObject.ColumnProperties);
|
||||
targetObject.ColumnProperties.Clear();
|
||||
foreach (var item in sourceObject.ColumnProperties)
|
||||
{
|
||||
IColumnProperty clone = (IColumnProperty)item.Clone();
|
||||
targetObject.ColumnProperties.Add(clone);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public class FillTupleArrayByColumnNameLogic : IFillTupleArrayByColumnNameLogic
|
||||
{
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public void ProceeForceTupleArray(double[] nDouble, double doubleValue, string columnName, string filePath)
|
||||
{
|
||||
if (columnName == "Nz")
|
||||
{
|
||||
nDouble[0] = doubleValue;
|
||||
}
|
||||
else if (columnName == "Mx")
|
||||
{
|
||||
nDouble[1] = doubleValue;
|
||||
}
|
||||
else if (columnName == "My")
|
||||
{
|
||||
nDouble[2] = doubleValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
string errorString = ErrorStrings.DataIsInCorrect + $": column {columnName} in file {filePath}, ";
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models.Forces.Logics;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -11,31 +12,37 @@ namespace StructureHelperCommon.Models.Forces
|
||||
public class ForceCombinationFromFileUpdateStrategy : IUpdateStrategy<IForceCombinationFromFile>
|
||||
{
|
||||
private IUpdateStrategy<IForceAction> baseUpdateStrategy;
|
||||
private IUpdateStrategy<IForceFileProperty> fileUpdateStrategy;
|
||||
private IUpdateStrategy<IColumnedFileProperty> filePropertyUpdateStrategy;
|
||||
private IUpdateStrategy<IFactoredCombinationProperty> combinationPropertyUpdateStrategy;
|
||||
|
||||
public ForceCombinationFromFileUpdateStrategy(IUpdateStrategy<IForceAction> baseUpdateStrategy,
|
||||
IUpdateStrategy<IForceFileProperty> fileUpdateStrategy)
|
||||
IUpdateStrategy<IColumnedFileProperty> filePropertyUpdateStrategy,
|
||||
IUpdateStrategy<IFactoredCombinationProperty> combinationPropertyUpdateStrategy)
|
||||
{
|
||||
this.baseUpdateStrategy = baseUpdateStrategy;
|
||||
this.fileUpdateStrategy = fileUpdateStrategy;
|
||||
this.filePropertyUpdateStrategy = filePropertyUpdateStrategy;
|
||||
this.combinationPropertyUpdateStrategy = combinationPropertyUpdateStrategy;
|
||||
}
|
||||
|
||||
public ForceCombinationFromFileUpdateStrategy()
|
||||
{
|
||||
}
|
||||
|
||||
void IUpdateStrategy<IForceCombinationFromFile>.Update(IForceCombinationFromFile targetObject, IForceCombinationFromFile sourceObject)
|
||||
public void Update(IForceCombinationFromFile targetObject, IForceCombinationFromFile sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
InitializeLogics();
|
||||
baseUpdateStrategy.Update(targetObject, sourceObject);
|
||||
CheckObject.IsNull(targetObject.CombinationProperty, "Target object combination property");
|
||||
CheckObject.IsNull(sourceObject.CombinationProperty, "Source object combination property");
|
||||
combinationPropertyUpdateStrategy.Update(targetObject.CombinationProperty, sourceObject.CombinationProperty);
|
||||
targetObject.ForceFiles.Clear();
|
||||
foreach (var file in sourceObject.ForceFiles)
|
||||
{
|
||||
ForceFileProperty newProperty = new();
|
||||
fileUpdateStrategy.Update(newProperty, file);
|
||||
ColumnedFileProperty newProperty = new();
|
||||
filePropertyUpdateStrategy.Update(newProperty, file);
|
||||
targetObject.ForceFiles.Add(newProperty);
|
||||
}
|
||||
}
|
||||
@@ -43,7 +50,8 @@ namespace StructureHelperCommon.Models.Forces
|
||||
private void InitializeLogics()
|
||||
{
|
||||
baseUpdateStrategy ??= new ForceActionBaseUpdateStrategy();
|
||||
fileUpdateStrategy ??= new ForceFilePropertyUpdateStrategy();
|
||||
filePropertyUpdateStrategy ??= new ColumnedFilePropertyUpdateStrategy();
|
||||
combinationPropertyUpdateStrategy ??= new FactoredCombinationPropertyUpdateStrategy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public class ForceFilePropertyUpdateStrategy : IUpdateStrategy<IForceFileProperty>
|
||||
{
|
||||
private IUpdateStrategy<IColumnProperty> columnUpdateStrategy;
|
||||
|
||||
public ForceFilePropertyUpdateStrategy(IUpdateStrategy<IColumnProperty> columnUpdateStrategy)
|
||||
{
|
||||
this.columnUpdateStrategy = columnUpdateStrategy;
|
||||
}
|
||||
|
||||
public ForceFilePropertyUpdateStrategy() : this (new ForceColumnPropertyUpdateStrategy())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Update(IForceFileProperty targetObject, IForceFileProperty sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(targetObject);
|
||||
CheckObject.IsNull(sourceObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
targetObject.FilePath = sourceObject.FilePath;
|
||||
targetObject.GlobalFactor = sourceObject.GlobalFactor;
|
||||
targetObject.SkipRowBeforeHeaderCount = sourceObject.SkipRowBeforeHeaderCount;
|
||||
targetObject.SkipRowHeaderCount = sourceObject.SkipRowHeaderCount;
|
||||
columnUpdateStrategy.Update(targetObject.Mx, sourceObject.Mx);
|
||||
columnUpdateStrategy.Update(targetObject.My, sourceObject.My);
|
||||
columnUpdateStrategy.Update(targetObject.Nz, sourceObject.Nz);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using ExcelDataReader;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public class GetTupleByExcelReaderLogic : IGetTupleByExcelReaderLogic
|
||||
{
|
||||
IFillTupleArrayByColumnNameLogic fillArrayLogic;
|
||||
|
||||
public GetTupleByExcelReaderLogic(IFillTupleArrayByColumnNameLogic fillArrayLogic)
|
||||
{
|
||||
this.fillArrayLogic = fillArrayLogic;
|
||||
}
|
||||
|
||||
public GetTupleByExcelReaderLogic()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
public IColumnedFileProperty ForceFileProperty { get; set; }
|
||||
|
||||
public IForceTuple GetForceTuple(IExcelDataReader? reader)
|
||||
{
|
||||
// Ensure ExcelDataReader's encoding provider is registered
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
|
||||
double[] nDouble = new double[3];
|
||||
foreach (var item in ForceFileProperty.ColumnProperties)
|
||||
{
|
||||
if (reader is null)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.NullReference + $": reader value for column {item.Name} in file {ForceFileProperty.FilePath}");
|
||||
}
|
||||
var readerValue = reader.GetValue(item.Index);
|
||||
var strValue = readerValue.ToString();
|
||||
double factor = ForceFileProperty.GlobalFactor * item.Factor * 1000d;
|
||||
var doubleValue = Convert.ToDouble(strValue) * factor;
|
||||
fillArrayLogic ??= new FillTupleArrayByColumnNameLogic() { TraceLogger = TraceLogger };
|
||||
fillArrayLogic.ProceeForceTupleArray(nDouble, doubleValue, item.Name, ForceFileProperty.FilePath);
|
||||
}
|
||||
TraceLogger?.AddMessage($"String values: Nz = {nDouble[0]}, Mx = {nDouble[1]}, My = {nDouble[2]} were gained", TraceLogStatuses.Debug);
|
||||
ForceTuple newTuple = new() { Nz = nDouble[0], Mx = nDouble[1], My = nDouble[2] };
|
||||
return newTuple;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
using ExcelDataReader;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.Logics
|
||||
{
|
||||
public class GetTupleFromFileLogic : IGetTupleFromFileLogic
|
||||
{
|
||||
public IForceFileProperty ForceFileProperty { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public List<IForceTuple> GetTuples()
|
||||
{
|
||||
// Ensure ExcelDataReader's encoding provider is registered
|
||||
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
|
||||
|
||||
var result = ReadDataFromFile();
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<IForceTuple> ReadDataFromFile()
|
||||
{
|
||||
List<IForceTuple> result = new();
|
||||
// Open the Excel file stream
|
||||
using (var stream = File.Open(ForceFileProperty.FilePath, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
// Create an Excel reader
|
||||
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||
{
|
||||
// Skip the first two header rows if necessary (adjust based on structure)
|
||||
int skipRows = ForceFileProperty.SkipRowBeforeHeaderCount + ForceFileProperty.SkipRowHeaderCount;
|
||||
for (int i = 0; i < skipRows; i++)
|
||||
{
|
||||
reader.Read(); // Skip row
|
||||
}
|
||||
|
||||
// Loop through the rows
|
||||
while (reader.Read())
|
||||
{
|
||||
var nValue = reader.GetValue(ForceFileProperty.Nz.ColumnIndex)?.ToString();
|
||||
var mxValue = reader.GetValue(ForceFileProperty.Mx.ColumnIndex)?.ToString();
|
||||
var myValue = reader.GetValue(ForceFileProperty.My.ColumnIndex)?.ToString();
|
||||
TraceLogger?.AddMessage($"Values: Nz = {nValue}(N), Mx = {mxValue}(N*m), My = {myValue}(N*m) were gained", TraceLogStatuses.Debug);
|
||||
if (nValue is not null && mxValue is not null && myValue is not null)
|
||||
{
|
||||
ForceTuple newTuple = GetForceTuple(nValue, mxValue, myValue);
|
||||
result.Add(newTuple);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private ForceTuple GetForceTuple(string? nValue, string? mxValue, string? myValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
double nDouble = Convert.ToDouble(nValue);
|
||||
double mxDouble = Convert.ToDouble(mxValue);
|
||||
double myDouble = Convert.ToDouble(myValue);
|
||||
TraceLogger?.AddMessage($"Values: Nz = {nDouble}(N), Mx = {mxDouble}(N*m), My = {myDouble}(N*m) were converted successfully", TraceLogStatuses.Debug);
|
||||
ForceTuple newTuple = new() { Nz = nDouble, Mx = mxDouble, My = myDouble };
|
||||
return newTuple;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string errorString = ErrorStrings.DataIsInCorrect + $": incorrect data in file {ForceFileProperty.FilePath}, " + ex.Message;
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
using ExcelDataReader;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public class GetTuplesFromFileLogic : IGetTuplesFromFileLogic
|
||||
{
|
||||
private IGetTupleByExcelReaderLogic excelReaderLogic;
|
||||
private ICheckEntityLogic<IColumnedFileProperty> checkEntityLogic;
|
||||
|
||||
public GetTuplesFromFileLogic(IGetTupleByExcelReaderLogic excelReaderLogic,
|
||||
ICheckEntityLogic<IColumnedFileProperty> checkEntityLogic)
|
||||
{
|
||||
this.excelReaderLogic = excelReaderLogic;
|
||||
this.checkEntityLogic = checkEntityLogic;
|
||||
}
|
||||
|
||||
public GetTuplesFromFileLogic()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private List<IForceTuple> result;
|
||||
private int skipRows;
|
||||
|
||||
public IColumnedFileProperty ForceFileProperty { get; set; }
|
||||
public IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
public List<IForceTuple> GetTuples()
|
||||
{
|
||||
Check();
|
||||
// Ensure ExcelDataReader's encoding provider is registered
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
|
||||
result = ReadDataFromFile();
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<IForceTuple> ReadDataFromFile()
|
||||
{
|
||||
result = new();
|
||||
skipRows = ForceFileProperty.SkipRowBeforeHeaderCount + ForceFileProperty.SkipRowHeaderCount;
|
||||
// Open the Excel file stream
|
||||
using (var stream = File.Open(ForceFileProperty.FilePath, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
// Create an Excel reader
|
||||
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||
{
|
||||
// Skip the first two header rows if necessary (adjust based on structure)
|
||||
for (int i = 0; i < skipRows; i++)
|
||||
{
|
||||
reader.Read(); // Skip row
|
||||
}
|
||||
|
||||
excelReaderLogic ??= new GetTupleByExcelReaderLogic()
|
||||
{
|
||||
ForceFileProperty = ForceFileProperty,
|
||||
TraceLogger = TraceLogger
|
||||
};
|
||||
|
||||
// Loop through the rows
|
||||
while (reader.Read())
|
||||
{
|
||||
try
|
||||
{
|
||||
IForceTuple newTuple = excelReaderLogic.GetForceTuple(reader);
|
||||
result.Add(newTuple);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string errorString = ErrorStrings.DataIsInCorrect + $": incorrect data in file {ForceFileProperty.FilePath}, " + ex.Message;
|
||||
TraceLogger?.AddMessage(errorString, TraceLogStatuses.Error);
|
||||
throw new StructureHelperException(errorString);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void Check()
|
||||
{
|
||||
checkEntityLogic ??= new CheckColumnedFilePropertyLogic()
|
||||
{
|
||||
Entity = ForceFileProperty,
|
||||
TraceLogger = TraceLogger
|
||||
};
|
||||
if (checkEntityLogic.Check() == false)
|
||||
{
|
||||
throw new StructureHelperException(checkEntityLogic.CheckResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public interface IFillTupleArrayByColumnNameLogic : ILogic
|
||||
{
|
||||
void ProceeForceTupleArray(double[] nDouble, double doubleValue, string columnName, string filePath);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using ExcelDataReader;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public interface IGetTupleByExcelReaderLogic : ILogic
|
||||
{
|
||||
IColumnedFileProperty ForceFileProperty { get; set;}
|
||||
IForceTuple GetForceTuple(IExcelDataReader? reader);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces.Logics
|
||||
{
|
||||
public interface IGetTupleFromFileLogic : ILogic
|
||||
{
|
||||
IForceFileProperty ForceFileProperty { get; set; }
|
||||
|
||||
List<IForceTuple> GetTuples();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StructureHelperCommon.Models.Forces
|
||||
{
|
||||
public interface IGetTuplesFromFileLogic : ILogic
|
||||
{
|
||||
IColumnedFileProperty ForceFileProperty { get; set; }
|
||||
|
||||
List<IForceTuple> GetTuples();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user