IReport is added

This commit is contained in:
ear
2022-09-13 16:06:41 +05:00
parent d9e3f9ba54
commit 7a4fd63fc2
24 changed files with 395 additions and 72 deletions

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Services.Reports.CalculationReports
{
interface IIsoFieldReport : IReport
{
}
}

View File

@@ -0,0 +1,37 @@
using FieldVisualizer.Entities.Values.Primitives;
using FieldVisualizer.Services.PrimitiveServices;
using FieldVisualizer.WindowsOperation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Services.Reports.CalculationReports
{
public class IsoFieldReport : IIsoFieldReport
{
private IEnumerable<IPrimitiveSet> primitiveSets;
public void Prepare()
{
//
}
public void ShowPrepared()
{
FieldViewerOperation.ShowViewer(primitiveSets);
}
public void Show()
{
Prepare();
ShowPrepared();
}
public IsoFieldReport(IEnumerable<IPrimitiveSet> primitiveSets)
{
this.primitiveSets = primitiveSets;
}
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelper.Services.Reports
{
public interface IReport
{
void Prepare();
void ShowPrepared();
void Show();
}
}

View File

@@ -14,7 +14,7 @@ namespace StructureHelper.Services.ResultViewers
List<IResultFunc> resultFuncs = new List<IResultFunc>();
IStressLogic stressLogic = new StressLogic();
resultFuncs.Add(new ResultFunc() { Name = "Total Strain", ResultFunction = stressLogic.GetTotalStrain });
resultFuncs.Add(new ResultFunc() { Name = "Elastic Srtain", ResultFunction = stressLogic.GetElasticStrain });
resultFuncs.Add(new ResultFunc() { Name = "Elastic Strain", ResultFunction = stressLogic.GetElasticStrain });
resultFuncs.Add(new ResultFunc() { Name = "Plastic Strain", ResultFunction = stressLogic.GetPlasticStrain });
resultFuncs.Add(new ResultFunc() { Name = "Stress", ResultFunction = stressLogic.GetStress });
return resultFuncs;

View File

@@ -15,6 +15,12 @@ namespace StructureHelper.Services.ResultViewers
public static class ShowIsoFieldResult
{
public static void ShowResult(IStrainMatrix strainMatrix, IEnumerable<INdm> ndms, IEnumerable<IResultFunc> resultFuncs)
{
var primitiveSets = GetPrimitiveSets(strainMatrix, ndms, resultFuncs);
FieldViewerOperation.ShowViewer(primitiveSets);
}
public static List<IPrimitiveSet> GetPrimitiveSets(IStrainMatrix strainMatrix, IEnumerable<INdm> ndms, IEnumerable<IResultFunc> resultFuncs)
{
List<IPrimitiveSet> primitiveSets = new List<IPrimitiveSet>();
foreach (var valDelegate in resultFuncs)
@@ -39,8 +45,7 @@ namespace StructureHelper.Services.ResultViewers
primitiveSet.ValuePrimitives = primitives;
primitiveSets.Add(primitiveSet);
}
FieldViewerOperation.ShowViewer(primitiveSets);
return primitiveSets;
}
}
}