...
Code Block | ||
---|---|---|
| ||
using System; using Alastri.RR.Ui; using Alastri.RR.Service; public class LabelFormat : ILabel { public string GetLabel(ShadingContext context) { return "Blast " + context.GetLevelName("Solid") + "\n" + context.GetReserveValue("Volume").ToString("#,##0") + " bcm \n" + context.GetReserveValue("DryTonnes").ToString("#,##0") + "t"; } } |
...
Площадь/периметр
Code Block | ||
---|---|---|
| ||
using System; using Alastri.RR.Ui; using Alastri.RR.Service; public class LabelFormat : ILabel { public string GetLabel(ShadingContext context) { return (context.SurfaceArea / context.Perimeter).ToString("#,##0.00"); } } |
...
Code Block | ||
---|---|---|
| ||
using System; using System.Collections.Generic; using System.Linq; using Alastri.RR.Ui; using Alastri.RR.Service; public class LabelFormat : ILabel { public string GetLabel(ShadingContext context) { List<string> parcels = context.GetParcels(); List<string> ores = new List<string>(){ "hg", "mg", "lg" }; double oreTonnes = 0; foreach(var parcel in parcels) { if(ores.Any(ore => parcel.StartsWith(ore))) { oreTonnes += context.GetReserveValue("DryTonnes", parcel); } } return oreTonnes.ToString("#,##0"); } } |
Приобладающий
...
полезный компонент
Code Block | ||
---|---|---|
| ||
using System; using Alastri.RR.Ui; using Alastri.RR.Service; public class LabelFormat : ILabel { public string GetLabel(ShadingContext context) { var parcels = context.GetParcels(); string majorityParcel = ""; double majorityTonnes = -1e7; foreach (var parcel in parcels) { double t = context.GetReserveValue("DryTonnes", parcel); if (t > majorityTonnes) { majorityTonnes = t; majorityParcel = parcel; } } return majorityParcel; } } |
...