Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The final Reserves used for scheduling are displayed and can be validated.

...

Here Labels ca be created than be be used in the Animations Tab and Period Plots Tab.

Examples.

  1. Create a customised Id label

Code Block
public class Label : ILabelTextProvider
{
	public string GetLabel(RecordAndShadingContext rsc)
	{
		if(rsc.Record.Table.HoldsDumps)
			return "";

			var Name = rsc.Record.GetNames();
			var pit = Name[2];
			var bench = Name[4];
			var blast = Name[5];
			return pit + "_" + bench + "_" + blast;
	}
}

2. Id label for GC Dig block only

Code Block
    public class Label : ILabelTextProvider
    {
        public string GetLabel(RecordAndShadingContext rsc)
        {
			//If dump record or a blast solid, return nothing. 
			if(!rsc.Record.GetNames()[0].Eq("Reserves") || !rsc.Record.IsDigLeaf)
				return "";
			
            var agent = rsc.CurrentAgent;
            var database = rsc.Record.Database;
            var digBlock = rsc.Record.GetStringValue(database.FindField("DigSolid", "reservesDataSource"), (IParcelSubset)null);
            var isGradeControl = digBlock.Eq("BlockModel");

            var blast = string.Empty;
            var flitch = string.Empty;
	
            if (isGradeControl)
            {

			var Name = rsc.Record.GetNames();
			var pit = Name[2];
			var bench = Name[4];
			var shot = Name[5];
            return agent + "  " + flitch + "RL" + Environment.NewLine + shot ;
            }

            var names = rsc.Record.GetNames();
			
            flitch = names[6];
            blast = names[5];
			return agent + "  " + flitch + "RL" + Environment.NewLine + blast + "_" + parcel + "_" + block;
        }
    }

3. Volume &Tonnes for a Block

Code Block
public class Label : ILabelTextProvider	
{
    PatriField miningVol;
	PatriField miningDt;
	
	public string GetLabel(RecordAndShadingContext rsc)
	{
		
        miningDt ??= rsc.ShadingContext.Database.FindField("mining_drytonnes");	
		miningVol ??= rsc.ShadingContext.Database.FindField ("mining_volume");
		
		return "dig: " + rsc.Record.GetDoubleValue(miningVol, ParcelAll.Default).ToString("#,##0") + " bcm" 
		+ Environment.NewLine + rsc.Record.GetDoubleValue(miningDt, ParcelAll.Default).ToString("#,##0") + " t";
		
	}
}

4. When the block was first scheduled

Code Block
public class Label : ILabelTextProvider
{
	public string GetLabel(RecordAndShadingContext rsc)
	{
		var date = rsc.FirstScheduledTime.ToString();
		var ignoreDate = "31/12/9999 11:59:59 PM";
		
	//Skip Conditions
		if(date == ignoreDate) 		return "" ;
		else 						return date;
	}
}