Exemple #1
0
        public virtual void Connect(string outPortName, InPort inPort)
        {
            int outPortNO = OutPortList.FindIndex(outPort => outPort.Name == outPortName);

            if (outPortNO < 0)
            {
                throw logger.Error(new ModelException(this, $"Out port {outPortName} not found."));
            }
            Connect(outPortNO, inPort);
        }
Exemple #2
0
 public override void Connect(int outPortNO, InPort inPort)
 {
     if (outPortNO == 0)
     {
         Bind(inPort);
     }
     else
     {
         throw logger.Error(new ModelException(FatherModel, "Out port has only single signal"));
     }
 }
Exemple #3
0
 public virtual void Connect(int outPortNO, InPort inPort)
 {
     if (outPortNO >= OutPortCount())
     {
         throw logger.Error(new ModelException(this, $"Out port number {outPortNO} exceed boundary"));
     }
     else
     {
         OutPortList[outPortNO].Bind(inPort);
     }
 }
Exemple #4
0
 public void Bind(InPort inPort)
 {
     if (inPort.Source != null)
     {
         throw logger.Error(new ModelException(FatherModel, "Duplicated binding of InPort."));
     }
     else
     {
         destinationList.Add(inPort);
         inPort.Source = this;
     }
 }
Exemple #5
0
 public override void Connect(int outPortNO, InPort inPort)
 {
     throw logger.Error(new ModelException(FatherModel, "Cannot link in port to in port"));
 }
Exemple #6
0
 public virtual void Connect(int outPortNO, InPort inPort)
 {
     throw new System.NotImplementedException();
 }