Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

In the Designer tab > Display panel > Blast section > Shading dropdown > there is a preloaded list of automatic shadings for the level hierarchy and reserves fields. We can add to this list by configuring custom shading sets.

Create a simple custom shading:

  1. Select the gear icon next to the Shading dropdown. This opens the configuration dialog.

  2. Press the blue plus icon to add a new shading set.

  3. Rename the shading to "Grade".

  4. Drop down the Shading Field and select 'Reserves: DryTonnes.FE'.

  5. In the Values table, enter cutoff grades (such as 52,54,56,58,60) and assign a colour to each interval.

  6. Press OK to accept.

Simple shading set on Fe grade.

Blasts shaded by average Fe grade (all materials)

Create a complex blast shading:

  1. Select the gear icon next to the Shading dropdown. This opens the configuration dialog.

  2. Press the blue plus icon to add a new shading set.

  3. Rename the shading to "Data Source".

  4. Click the "Complex" tab to open the code editor.

  5. Paste in the sample code below.

  6. Press OK to accept.

Custom shading for Excluded, Grade Control, and Block Model blasts.

Blasts shaded by data source.

Data Source Shading Sample
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Linq;
using Alastri.RR.Ui;
using Alastri.RR.Service;

public class CustomBlastShading : IBlastShading
{
       public Color GetColor(ShadingContext context) 
		{
        	string dataSource = context.ReservesDataSource.ToString();
            bool excluded = context.IsExcluded;
             
            if(excluded) return Color.DarkOrchid;
        	else if(dataSource == "GradeControl") return Color.BurlyWood;
            else if(dataSource == "BlockModel")   return Color.BlanchedAlmond;
            else return Color.Red;
    	}
}
Tonnes Check
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Linq;
using Alastri.RR.Ui;
using Alastri.RR.Service;

public class CustomBlastShading : IBlastShading
{
       public Color GetColor(ShadingContext context) 
		{
        	double tonnes = context.N("DryTonnes");
             
            if(tonnes > 0) return Color.BlanchedAlmond;
            else return Color.Red;
    	}
}
Ore / Waste Shading
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Linq;
using Alastri.RR.Ui;
using Alastri.RR.Service;

public class CustomBlastShading : IBlastShading
{
       static List<string> oreParcels = new List<string> { "hg", "mg", "lg" };
	
		public Color GetColor(ShadingContext context)
        {
            
			bool containsOre = false;
			bool containsWaste = false;
			
			foreach(string parcel in context.GetParcels())
			{
				if(oreParcels.Contains(parcel))
				{
					containsOre = true;
				}
				else 
				{
					containsWaste = true;
				}
			}
			
			if(containsOre && containsWaste) return Color.Yellow;
			else if(containsOre) return Color.Red;
			else return Color.Gray;
        }
}
Contour Colour Gradient
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Linq;
using Alastri.RR.Ui;
using Alastri.RR.Service;

public class CustomBlastShading : IBlastShading
{
  public Color GetColor(ShadingContext context)
  {
    double contPct = context.GetReserveValue("volume.contour_pct"); //block model value
    double overrideContPct = context.GetSolidPropertyValue("ContPctFix"); //user manual override

    if(overrideContPct >=0) contPct = overrideContPct;
    contPct = Math.Max(0, Math.Min(1, contPct));

    Color high = Color.Magenta;
    Color low = Color.DeepSkyBlue;

    return Lerp(low, high, contPct);
  }

  public Color Lerp(Color one, Color two, double pct)
  {
    return Color.FromArgb( (int)(one.R + pct * (two.R-one.R)) ,
    (int)(one.G + pct * (two.G-one.G)) ,
    (int)(one.B + pct * (two.B-one.B)) );
  }
}
  • No labels