Esempio n. 1
0
 private void IOManager_IOsChanged(object sender, EventArgs e)
 {
     FStruct = IOManager.CreateStruct(Declaration);
     IOManager.ReadFromIOs(ref FStruct);
     if (FEnabled.SliceCount > 0 && FEnabled[0])
     {
         FStructOut[0] = FStruct;
         FStructOut.Flush();
     }
 }
Esempio n. 2
0
 public void Evaluate(int spreadMax)
 {
     FLastSet.ResizeAndDismiss(FSet.SliceCount, (int i) => !FSet[i]);
     if (FSet.SliceCount == 1)
     {
         if (FSet[0])
         {
             FInput.Sync();
             FOutput.ResizeAndDismiss(spreadMax, (int i) => FInput[i]);
             FBuffer.ResizeAndDismiss(spreadMax, (int i) => FInput[i] == null ? null : new StructType(FInput[i]));
             for (int i = 0; i < FInput.SliceCount; i++)
             {
                 if (FOutput[i] != FInput[i])
                 {
                     FOutput[i] = FInput[i];
                     if (FInput[i] != null)
                     {
                         FBuffer[i] = new StructType(FInput[i]);
                     }
                 }
             }
         }
         else if ((FSet[0] != FLastSet[0]) && (!FSet[0]))
         {
             FOutput.SliceCount = FBuffer.SliceCount;
             for (int i = 0; i < FInput.SliceCount; i++)
             {
                 if (FBuffer[i] != null)
                 {
                     FOutput[i] = new StructType(FBuffer[i]);
                     foreach (var f in FBuffer[i].Fields)
                     {
                         FOutput[i][f] = FBuffer[i].GetClonedData(f);
                     }
                 }
                 else
                 {
                     FOutput[i] = null;
                 }
             }
         }
     }
     else
     {
         FInput.Sync();
         FOutput.ResizeAndDismiss(spreadMax, (int i) => null);
         FBuffer.ResizeAndDismiss(spreadMax, (int i) => null);
         for (int i = 0; i < spreadMax; i++)
         {
             if (FSet[i])
             {
                 if (FOutput[i] != FInput[i])
                 {
                     FOutput[i] = FInput[i];
                     if (FInput[i] != null)
                     {
                         FBuffer[i] = new StructType(FInput[i]);
                     }
                 }
             }
             else if ((FSet[i] != FLastSet[i]) && (!FSet[i]))
             {
                 if (FBuffer[i] == null)
                 {
                     FOutput[i] = null;
                 }
                 else
                 {
                     FOutput[i] = new StructType(FBuffer[i]);
                     foreach (var f in FBuffer[i].Fields)
                     {
                         FOutput[i][f] = FBuffer[i].GetClonedData(f);
                     }
                 }
             }
         }
     }
     FLastSet.AssignFrom(FSet);
 }