RR. Blast Custom Shading
In the Designer tab in Display panel locate Blast section and press 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:
Select the gear icon next to the Shading dropdown. This opens the configuration dialog.
Press the blue plus icon to add a new shading set.
Rename the shading to "Grade".
Drop down the Shading Field and select “Reserves: DryTonnes.FE”.
In the Values table, enter cutoff grades (such as 52,54,56,58,60) and assign a colour to each interval.
Press OK to accept.
Create a complex blast shading:
Select the gear icon next to the Shading dropdown. This opens the configuration dialog.
Press the blue plus icon to add a new shading set.
Rename the shading to "Data Source".
Click the Complex tab to open the code editor.
Paste in the sample code below.
Press OK to accept.
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;
}
}