public override void Evaluate(int SpreadMax) { if (RemovePinsFirst) { RetryConfig(); } SpreadMax = FSpreadCount.IsAnyInvalid() || FTopic.IsAnyInvalid() ? 0 : FSpreadCount[0]; SpreadMax = Math.Max(SpreadMax, 0); // safeguard against negative binsizes // Reset? var anyUpdate = ResetNecessary; var forceUpdate = !FAutoSense[0] || FAutoSense.IsChanged; var newData = FPins.Any(x => x.Value.ToISpread().IsChanged); // changed pins newData |= forceUpdate; // if update is forced, then predent it is new Data var newTopic = FTopic.IsChanged; newTopic |= forceUpdate; // if update is forced, then pretend it is a new Topic // remove superfluous entries if (SpreadMax < Keep.Count) { anyUpdate = true; Keep.RemoveRange(SpreadMax, Keep.Count - SpreadMax); } // add new entries for (int i = Keep.Count; i < SpreadMax; i++) { anyUpdate = true; // new entry in Keep will require data newData = true; newTopic = true; var message = new Message(Formular); message.Topic = FTopic[i]; Keep.Add(message); } // check update pin anyUpdate |= FUpdate.Any(); if (anyUpdate && (newData || newTopic)) { // ...and start filling messages int messageIndex = 0; foreach (var message in Keep) { // only copy, when Update is true for this message if (newData && FUpdate[messageIndex] && CopyFromPins(message, messageIndex, !forceUpdate)) { anyUpdate = true; } if (newTopic && FUpdate[messageIndex] && message.Topic != FTopic[messageIndex]) { message.Topic = FTopic[messageIndex]; anyUpdate = true; } messageIndex++; } } if (Keep.IsChanged) { UpKeep(anyUpdate); } else // no change, so make sure, none is reported { if (FChangeOut.SliceCount > 0) { FChangeOut.SliceCount = 0; FChangeIndexOut.SliceCount = 0; } } }
public override void Evaluate(int SpreadMax) { InitDX11Graph(); bool warnPinSafety = false; if (RemovePinsFirst) { warnPinSafety = !RetryConfig(); // defer PinConnectionException until end of method, if not successful } SpreadMax = FSpreadCount.IsAnyInvalid() || FTopic.IsAnyInvalid() ? 0 : FSpreadCount[0]; SpreadMax = Math.Max(SpreadMax, 0); // safeguard against negative binsizes // Reset? var anyUpdate = FResetNecessary; var forceUpdate = FForce[0] || FForce.IsChanged; var newData = FPins.Any(x => x.Value.ToISpread().IsChanged); // changed pins newData |= forceUpdate; // if update is forced, then predent it is new Data var newTopic = FTopic.IsChanged; newTopic |= forceUpdate; // if update is forced, then pretend it is a new Topic // remove superfluous entries if (SpreadMax < Keep.Count) { anyUpdate = true; Keep.RemoveRange(SpreadMax, Keep.Count - SpreadMax); } // add new entries for (int i = Keep.Count; i < SpreadMax; i++) { anyUpdate = true; // new entry in Keep will require data newData = true; newTopic = true; var message = new Message(Formular); message.Topic = FTopic[i]; Keep.Add(message); } // check update pin anyUpdate |= FUpdate.Any(); if (anyUpdate && (newData || newTopic)) { // ...and start filling messages int messageIndex = 0; foreach (var message in Keep) { // only copy, when Update is true for this message if (newData && FUpdate[messageIndex] && CopyFromPins(message, messageIndex, !forceUpdate)) { anyUpdate = true; } if (newTopic && FUpdate[messageIndex] && message.Topic != FTopic[messageIndex]) { message.Topic = FTopic[messageIndex]; anyUpdate = true; } messageIndex++; } } if (Keep.IsChanged || Keep.Any(m => m.HasRecentCommit(Keep))) { UpKeep(anyUpdate); } else // no change, so make sure, none is reported { if (FChangeOut.SliceCount > 0) { FChangeOut.FlushNil(); FChangeIndexOut.FlushNil(); } } if (warnPinSafety) { throw new PinConnectionException("Manually remove unneeded links first! [ConfigKeep]. ID = [" + PluginHost.GetNodePath(false) + "]"); } }