PESensor: OnMaxProductsReached

Invoked when the Product Schedule generates the maximum number products if MaxProductsEnabled is true.

Note: This event does not support multiple subscriptions. Previous subscriptions will be lost if this event is subscribed to multiple times.

Event

void xxxxxxxxxxxxxxxxx (sender: object, maxproducts: UInt32);

Parameters

Name Type Description
sender Object The Product Schedule that has reached its maximum products count.
maxproducts UInt32 The number of products generated since MaxProductsEnabled is true

Example

function OnSimulationStart() {
    LogDebug("OnSimulationStart called");
    SubscribeToEvent("OnMaxProductsReached", "ProductSchedule1", "Product Schedule", onMaxProduct);
}

function onMaxProduct(sender, maxproducts) {
    LogDebug("Sender " + sender.Name);
    LogDebug("Max Products " + maxproducts);
}