46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using Nocturnis.DataStructures;
|
|
using Nocturnis.Enigmos.Cables;
|
|
using Nocturnis.Enigmos.Modules.ComputationalModules;
|
|
using Nocturnis.Enigmos.Ports;
|
|
using Nocturnis.Enigmos.Ports.DataPorts.Directions;
|
|
using Nocturnis.GlobalManagement.Constants;
|
|
using Nocturnis.GlobalManagement.Providers;
|
|
|
|
namespace Enigmos.Ports.DataPorts;
|
|
|
|
public abstract partial class DataOutPort : DataPort, IDataOutPort
|
|
{
|
|
public new IComputationalModule Module
|
|
{
|
|
get => (base.Module as IComputationalModule)!;
|
|
set => base.Module = value;
|
|
}
|
|
|
|
//public void DataUpdateRequest(IRootModule root) => Module.ComputeWithTimeoutHandle(root);
|
|
|
|
|
|
public new IDataInPort ConnectedPort
|
|
{
|
|
get => base.ConnectedPort as IDataInPort;
|
|
set => base.ConnectedPort = value;
|
|
}
|
|
|
|
public override bool IsMatch(IBasePort other) =>
|
|
other is DataInPort inPort &&
|
|
GlobalProvider.DataTypeProvider!.DataPortTypeCompatible(inPort.DataType!, DataType!);
|
|
|
|
public override IBaseCable MakeCable(IBasePort other)
|
|
{
|
|
IBaseCable res = base.MakeCable(other);
|
|
res.PortFrom = other;
|
|
res.PortTo = this;
|
|
return res;
|
|
}
|
|
|
|
public DataCache OutData { get; set; } = new(x => (0, DataTypeConstant.BaseDataTypes.Null));
|
|
public override void PostConnect()
|
|
{
|
|
Module.Define();
|
|
}
|
|
}
|