Add logic for import of combination from xls files
This commit is contained in:
40
StructureHelperCommon/Models/Forces/FilePropertyFactory.cs
Normal file
40
StructureHelperCommon/Models/Forces/FilePropertyFactory.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
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 enum FilePropertyType
|
||||
{
|
||||
Forces
|
||||
}
|
||||
public static class FilePropertyFactory
|
||||
{
|
||||
public static IColumnedFileProperty GetForceFileProperty(FilePropertyType propertyType)
|
||||
{
|
||||
if (propertyType == FilePropertyType.Forces)
|
||||
{
|
||||
ColumnedFileProperty fileProperty = new();
|
||||
List<IColumnProperty> columnProperties = GetForceColumns();
|
||||
fileProperty.ColumnProperties.AddRange(columnProperties);
|
||||
return fileProperty;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(propertyType));
|
||||
}
|
||||
}
|
||||
|
||||
private static List<IColumnProperty> GetForceColumns()
|
||||
{
|
||||
List<IColumnProperty> columnProperties = new();
|
||||
columnProperties.Add(new ColumnProperty("Nz") { SearchingName = "N", Index = 6 });
|
||||
columnProperties.Add(new ColumnProperty("Mx") { SearchingName = "My", Index = 8 });
|
||||
columnProperties.Add(new ColumnProperty("My") { SearchingName = "Mz", Index = 10 });
|
||||
return columnProperties;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user