Upgrade structure of code base
This commit is contained in:
39
Modules/InterlayerModules/IterativeOutputModule.cs
Normal file
39
Modules/InterlayerModules/IterativeOutputModule.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Enigmos.Modules.ComputationalModules;
|
||||
using Nocturnis.Enigmos.Modules;
|
||||
using Nocturnis.Enigmos.Modules.ComputationalModules;
|
||||
using Nocturnis.Enigmos.Modules.InterlayerModules;
|
||||
using Nocturnis.Enigmos.Ports;
|
||||
using Nocturnis.Enigmos.Ports.DataPorts.Directions;
|
||||
using Nocturnis.GlobalManagement.Constants;
|
||||
|
||||
namespace Enigmos.Modules.InterlayerModules;
|
||||
|
||||
public partial class IterativeOutputModule : NullaryComputationalModule, IInterlayerModule, IDuplicateOutputModule
|
||||
{
|
||||
protected override bool Draggable => false;
|
||||
protected override bool HasManual => false;
|
||||
public IDataOutPort? Output { get; set; }
|
||||
|
||||
public override IEnumerable<IBasePort> Ports => new[] { Output }!;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
this.DataOutInit("DataOut", 1);
|
||||
Output = DataOutPorts[0];
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public override void Define()
|
||||
{
|
||||
if (ParentModule is IOptimizationModule opm)
|
||||
this.Define(cache => (opm.CachedResult.Data, opm.CachedResult.Type)!);
|
||||
if (ParentModule is IFilterModule fm)
|
||||
this.Define(cache => (fm.CachedResult, EnigmosConstant.DataPortTypes.AnyArrayType));
|
||||
|
||||
}
|
||||
|
||||
//protected override void Compute(IRootModule root) => throw new Exception("Should be Handled by Other Module");
|
||||
public IBasePort UnderlyingPort => Output!;
|
||||
public IProgrammableModule? ParentModule { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user