Blend Results Script

The blend results script are C# script is used to perform a calculation after a calculated blend is done. The parameters are the used stockpiles, blend quantities and blend results. After executing the script, MineMarket displays the updated blend results on the Blending screen.

The following example shows the script structure and an adjustment of an analyte value for iron by 50%.

Copy
using System;
using Mincom.MineMarket.DAL;
using Mincom.MineMarket;

/// <summary>
///    Exposes events for business objects
/// </summary>
public class BlendScript : IBlendScript
{
  public BlendScript() 
  {        
  }

  public void UpdateBlendResult(BlendContext blendContext)
  {
    double feValue = 0;
    foreach (BlendResultAnalyte bra in blendContext.BlendResultsAnalyte)
    {
      if(bra.BlendAnalyteSpecification.AssociatedAnalyteSpecification.AnalyteDef.Name == "Fe")
      {
        feValue = Math.Round(bra.Answer.Value, 3, MidpointRounding.AwayFromZero);
        break;
      }
    }
    foreach (BlendResultAnalyte bra in blendContext.BlendResultsAnalyte)
    {
      if(bra.BlendAnalyteSpecification.AssociatedAnalyteSpecification.AnalyteDef.Name == "jig_Fe")
      {
        bra.Answer = feValue * 1.5;
      }
    }
  }         
}