Split project
This commit is contained in:
46
Ports/DataPorts/DataOutPort.cs
Normal file
46
Ports/DataPorts/DataOutPort.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using Enigmos.Cables;
|
||||
using Enigmos.Modules.ComputationalModules;
|
||||
using Enigmos.Modules.ControllingModules;
|
||||
using Nocturnis.DataStructures;
|
||||
using Nocturnis.Enigmos.Ports;
|
||||
using TabulaSmaragdina;
|
||||
|
||||
namespace Enigmos.Ports.DataPorts;
|
||||
|
||||
public partial class DataOutPort : DataPort, IDataOutPort
|
||||
{
|
||||
public bool DataUpdated { get; set; }
|
||||
|
||||
public new ComputationalModule Module
|
||||
{
|
||||
get => base.Module as ComputationalModule;
|
||||
set => base.Module = value;
|
||||
}
|
||||
|
||||
public void DataUpdateRequest(RootModule root) => Module.ComputeWithTimeoutHandle(root);
|
||||
|
||||
public DataOutPort()
|
||||
{
|
||||
DataUpdated = false;
|
||||
ResultData = GlobalProvider.DataStructureProvider.NewDataPackage();
|
||||
}
|
||||
|
||||
public new DataInPort ConnectedPort
|
||||
{
|
||||
get => base.ConnectedPort as DataInPort;
|
||||
set => base.ConnectedPort = value;
|
||||
}
|
||||
|
||||
public override bool IsMatch(IBasePort other) =>
|
||||
other is DataInPort inPort &&
|
||||
GlobalProvider.EnigmosProvider.DataPortTypeCompatible(inPort.DataType, DataType);
|
||||
public IDataPackage ResultData { get; set; }
|
||||
|
||||
public override BaseCable MakeCable(IBasePort other)
|
||||
{
|
||||
BaseCable res = base.MakeCable(other);
|
||||
res.PortFrom = other;
|
||||
res.PortTo = this;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user