Skip to content

Instantly share code, notes, and snippets.

@ShilGen
Last active June 21, 2023 14:03
Show Gist options
  • Save ShilGen/db6f5b253ae24bf4a3745cb84ad10936 to your computer and use it in GitHub Desktop.
Save ShilGen/db6f5b253ae24bf4a3745cb84ad10936 to your computer and use it in GitHub Desktop.
using ObjStudioClasses;
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Threading.Tasks;
using GemBox.Spreadsheet;
public class Script
{
public static object Execute()
{
var shid=WebApplication.OnlyInstance.GetCollectorServiceShardsInfo();
//return shid;
var css=CollectorScenario.GetInstances().ToArray();
var els=ElectricityMeter.GetInstances().ToHashSet();
var dic=new Dictionary<CollectorScenario,HashSet<ElectricityMeter>>();
foreach(var cs in css)
{
var enels=new HashSet<ElectricityMeter>();
var eqs = CollectorService.OnlyInstance.
GetEquipmentWithSupportedParametersForScenario(shid.FirstOrDefault().Id,cs).
Select(x => x.Equipment as ElectricityMeter).
AsEnumerable();
foreach(var eq in eqs)
{
enels.Add(eq);
}
dic.Add(cs,enels);
}
return dic;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment