public void WriteToIOBin(Field field, IIOContainer ioContainer, ref Core.Struct str, int index = 0)
        {
            dynamic source = str[field];
            dynamic dest   = ioContainer.RawIOObject;

            WriteStream(source, dest, index);
        }
Example #2
0
 public void ReadFromIOs(ref Core.Struct str)
 {
     foreach (var f in FIOContainers.Keys)
     {
         str[f] = FIOContainers[f].RawIOObject;
     }
 }
        public void WriteToIO(Field field, IIOContainer ioContainer, ref Core.Struct str)
        {
            dynamic source = str[field];
            dynamic dest   = ioContainer.RawIOObject;

            AssignStream(source, dest);
        }
Example #4
0
 public void WriteToIOBins(ref Core.Struct str, int index = 0)
 {
     foreach (var f in FIOContainers.Keys)
     {
         if (FIOContainers[f].IsVisible)
         {
             f.ContainerRegistry.WriteToIOBin(f, FIOContainers[f], ref str, index);
         }
     }
 }
Example #5
0
 public void WriteToIOs(ref Core.Struct str)
 {
     foreach (var f in FIOContainers.Keys)
     {
         if (FIOContainers[f].IsVisible)
         {
             f.ContainerRegistry.WriteToIO(f, FIOContainers[f], ref str);
         }
     }
 }
Example #6
0
        public void Evaluate(int spreadMax)
        {
            FOutput.SliceCount = FBuffer.SliceCount;
            for (int i = 0; i < FBuffer.SliceCount; i++)
            {
                if (FBuffer[i] == null)
                {
                    FOutput[i] = null;
                }
                else
                {
                    if (FOutput[i] == null)
                    {
                        FOutput[i] = new Core.Struct(FBuffer[i]);
                    }
                    foreach (var f in FBuffer[i].Fields)
                    {
                        FOutput[i][f] = FBuffer[i].GetClonedData(f);
                    }
                }
            }

            if (!declarationChanged)
            {
                FOutput.Flush();
                FInput.Sync();
            }

            FBuffer.SliceCount = FInput.SliceCount;
            for (int i = 0; i < FInput.SliceCount; i++)
            {
                if (FInput[i] == null)
                {
                    FBuffer[i] = null;
                }
                else
                {
                    if (FBuffer[i] == null || FBuffer[i].Name != FInput[i].Name)
                    {
                        FBuffer[i]         = new Core.Struct(FInput[i]);
                        FOutput[i]         = new Core.Struct(FBuffer[i]);
                        declarationChanged = true;
                    }
                    foreach (var f in FInput[i].Fields)
                    {
                        FBuffer[i][f] = FInput[i].GetClonedData(f);
                    }
                }
            }
            if (declarationChanged)
            {
                FOutput.Flush();
                declarationChanged = false;
            }
        }
Example #7
0
        public Core.Struct CreateStruct(Declaration declaration)
        {
            var s = new Core.Struct(declaration);

            foreach (var f in s.Sync.Keys)
            {
                s.Sync[f].Requested += (o, e) => { SyncIO(f); }
            }
            ;
            return(s);
        }
Example #8
0
        public Core.Struct CreateStruct(Core.Struct other)
        {
            var s = new Core.Struct(other);

            foreach (var f in s.Sync.Keys)
            {
                if (FIOContainers.ContainsKey(f))
                {
                    s.Sync[f].Requested += (o, e) => { SyncIO(f); }
                }
                ;                                                    //sync local pin
                else
                {
                    s.Sync[f].Requested += (o, e) => { other.Sync[f].Request(); }
                };                                                                 //bubble up sync request
            }
            return(s);
        }
Example #9
0
        void HandleDeclarationChanged()
        {
            bool invalidate = false;

            for (int i = 0; i < FBuffer.SliceCount; i++)
            {
                if (FBuffer[i] != null &&
                    (FBuffer[i].Name == oldDeclarationName ||
                     !FBuffer[i].Equals(changedDeclaration)))
                {
                    if (!invalidate)
                    {
                        FInput.Sync();
                    }
                    FBuffer[i] = new Core.Struct(FInput[i]);
                    FOutput[i] = new Core.Struct(FInput[i]);
                    invalidate = true;
                }
            }
            declarationChanged = invalidate;
        }
 public virtual void WriteToIOBin(Field field, IIOContainer ioContainer, ref Core.Struct str, int index = 0)
 {
 }
 public void WriteToIO(Field field, IIOContainer ioContainer, ref Core.Struct str)
 {
 }